@overdoser/react-toolkit 0.0.10 → 0.0.12
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/AGENTS.md +1 -1
- package/components/Table/Table.d.ts +13 -1
- package/index.js +1296 -1284
- package/llms.txt +16 -0
- package/manifest.json +2 -0
- package/package.json +1 -1
- package/recipes/multi-select-in-modal.tsx +7 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef as $e, createElement as an, useState as Le, useCallback as fe, useMemo as ke, useEffect as Ne, useLayoutEffect as jt, useRef as re, useId as Ye, isValidElement as dn, cloneElement as Xt, createContext as _t, useContext as ft, useImperativeHandle as un } from "react";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as z, jsx as s, Fragment as je } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as pt } from "react-dom";
|
|
4
4
|
import { FormProvider as hn, useFormContext as mn, useController as fn } from "react-hook-form";
|
|
5
5
|
function Ut(e) {
|
|
@@ -11,11 +11,11 @@ function Ut(e) {
|
|
|
11
11
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
12
12
|
return r;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function m() {
|
|
15
15
|
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Ut(e)) && (r && (r += " "), r += t);
|
|
16
16
|
return r;
|
|
17
17
|
}
|
|
18
|
-
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY",
|
|
18
|
+
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU", Sn = "crk-shimmer-8iQSU", Rn = "crk-loadingShimmer-BVvFw", Tn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", In = "crk-dotBounce-FwdcC", Dn = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Be = {
|
|
19
19
|
root: pn,
|
|
20
20
|
loading: gn,
|
|
21
21
|
primary: yn,
|
|
@@ -23,8 +23,8 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
23
23
|
danger: bn,
|
|
24
24
|
ghost: xn,
|
|
25
25
|
sm: kn,
|
|
26
|
-
md:
|
|
27
|
-
lg:
|
|
26
|
+
md: Mn,
|
|
27
|
+
lg: wn,
|
|
28
28
|
fullWidth: $n,
|
|
29
29
|
iconOnly: Nn,
|
|
30
30
|
content: Ln,
|
|
@@ -55,11 +55,11 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
55
55
|
style: h,
|
|
56
56
|
children: u,
|
|
57
57
|
...d
|
|
58
|
-
},
|
|
58
|
+
}, f) => /* @__PURE__ */ z(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
|
-
ref:
|
|
62
|
-
className:
|
|
61
|
+
ref: f,
|
|
62
|
+
className: m(
|
|
63
63
|
Be.root,
|
|
64
64
|
Be[e],
|
|
65
65
|
Be[t],
|
|
@@ -75,12 +75,12 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
75
75
|
"aria-busy": n || void 0,
|
|
76
76
|
...d,
|
|
77
77
|
children: [
|
|
78
|
-
/* @__PURE__ */ s("div", { className:
|
|
79
|
-
/* @__PURE__ */ s("span", { className:
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */ s("span", { className:
|
|
82
|
-
/* @__PURE__ */ s("span", { className:
|
|
83
|
-
/* @__PURE__ */ s("span", { className:
|
|
78
|
+
/* @__PURE__ */ s("div", { className: m(Be.shimmer, l?.shimmer) }),
|
|
79
|
+
/* @__PURE__ */ s("span", { className: m(Be.content, l?.content), children: u }),
|
|
80
|
+
/* @__PURE__ */ z("span", { className: m(Be.dots, l?.dots), "aria-hidden": "true", children: [
|
|
81
|
+
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
82
|
+
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
83
|
+
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) })
|
|
84
84
|
] })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
@@ -101,11 +101,11 @@ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn
|
|
|
101
101
|
style: r,
|
|
102
102
|
children: o,
|
|
103
103
|
...c
|
|
104
|
-
}, i) => /* @__PURE__ */
|
|
104
|
+
}, i) => /* @__PURE__ */ z(
|
|
105
105
|
"a",
|
|
106
106
|
{
|
|
107
107
|
ref: i,
|
|
108
|
-
className:
|
|
108
|
+
className: m($t.root, $t[e], n),
|
|
109
109
|
style: r,
|
|
110
110
|
...t && {
|
|
111
111
|
target: "_blank",
|
|
@@ -159,7 +159,7 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Un = "crk
|
|
|
159
159
|
e,
|
|
160
160
|
{
|
|
161
161
|
ref: h,
|
|
162
|
-
className:
|
|
162
|
+
className: m(
|
|
163
163
|
Ue.root,
|
|
164
164
|
Ue[e],
|
|
165
165
|
t && Ue[t],
|
|
@@ -196,7 +196,7 @@ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82",
|
|
|
196
196
|
e === "ordered" ? "ol" : "ul",
|
|
197
197
|
{
|
|
198
198
|
ref: i,
|
|
199
|
-
className:
|
|
199
|
+
className: m(
|
|
200
200
|
ut.root,
|
|
201
201
|
ut[e],
|
|
202
202
|
ut[t],
|
|
@@ -214,7 +214,7 @@ const xr = $e(
|
|
|
214
214
|
"li",
|
|
215
215
|
{
|
|
216
216
|
ref: o,
|
|
217
|
-
className:
|
|
217
|
+
className: m(ut.item, e),
|
|
218
218
|
style: t,
|
|
219
219
|
...r,
|
|
220
220
|
children: n
|
|
@@ -222,10 +222,10 @@ const xr = $e(
|
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
224
|
xr.displayName = "ListItem";
|
|
225
|
-
const kr = "crk-wrapper-zxjMt",
|
|
225
|
+
const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4", Sr = "crk-sortArrowActive-yhWrO", Rr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Ir = "crk-striped-6Qckq", Dr = "crk-hoverable-ljU9B", Er = "crk-compact-2-UWr", Pr = "crk-paginator-UlYIY", Wr = "crk-paginatorInfo-BVca4", Hr = "crk-paginatorText-sqWS0", Or = "crk-pageSizeSelect-yhqJQ", Fr = "crk-paginatorNav-MDSui", zr = "crk-pageButton-1PX-g", jr = "crk-pageButtonActive--D7Q7", Xr = "crk-pageEllipsis-en59J", ve = {
|
|
226
226
|
wrapper: kr,
|
|
227
|
-
root:
|
|
228
|
-
headerCell:
|
|
227
|
+
root: Mr,
|
|
228
|
+
headerCell: wr,
|
|
229
229
|
headerCellSortable: $r,
|
|
230
230
|
sortIndicator: Nr,
|
|
231
231
|
sortArrow: Lr,
|
|
@@ -258,31 +258,31 @@ function Ur(e, t = []) {
|
|
|
258
258
|
});
|
|
259
259
|
}, []), c = fe((a) => {
|
|
260
260
|
r((h) => {
|
|
261
|
-
const u = h.findIndex((
|
|
261
|
+
const u = h.findIndex((f) => f.key === a);
|
|
262
262
|
if (u === -1)
|
|
263
263
|
return [...h, { key: a, direction: "asc" }];
|
|
264
264
|
if (h[u].direction === "asc") {
|
|
265
|
-
const
|
|
266
|
-
return
|
|
265
|
+
const f = [...h];
|
|
266
|
+
return f[u] = { key: a, direction: "desc" }, f;
|
|
267
267
|
}
|
|
268
|
-
return h.filter((
|
|
268
|
+
return h.filter((f, y) => y !== u);
|
|
269
269
|
});
|
|
270
270
|
}, []), i = fe(() => {
|
|
271
271
|
r([]);
|
|
272
272
|
}, []);
|
|
273
273
|
return { sortedData: ke(() => n.length === 0 ? e : [...e].sort((a, h) => {
|
|
274
274
|
for (const { key: u, direction: d } of n) {
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
return d === "asc" ?
|
|
275
|
+
const f = _r(a[u], h[u]);
|
|
276
|
+
if (f !== 0)
|
|
277
|
+
return d === "asc" ? f : -f;
|
|
278
278
|
}
|
|
279
279
|
return 0;
|
|
280
280
|
}), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: c, resetSort: i };
|
|
281
281
|
}
|
|
282
282
|
function Yr({ direction: e, sortIndex: t }) {
|
|
283
|
-
return /* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */ s("span", { className:
|
|
285
|
-
/* @__PURE__ */ s("span", { className:
|
|
283
|
+
return /* @__PURE__ */ z("span", { className: ve.sortIndicator, "aria-hidden": "true", children: [
|
|
284
|
+
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "asc" && ve.sortArrowActive), children: "▲" }),
|
|
285
|
+
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "desc" && ve.sortArrowActive), children: "▼" }),
|
|
286
286
|
t !== void 0 && t >= 0 && /* @__PURE__ */ s("span", { className: ve.sortIndex, children: t + 1 })
|
|
287
287
|
] });
|
|
288
288
|
}
|
|
@@ -306,8 +306,8 @@ function Vr({
|
|
|
306
306
|
}
|
|
307
307
|
return u;
|
|
308
308
|
}, [e, i]);
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ z("nav", { className: m(ve.paginator, c?.paginator), "aria-label": "Table pagination", children: [
|
|
310
|
+
/* @__PURE__ */ z("div", { className: ve.paginatorInfo, children: [
|
|
311
311
|
/* @__PURE__ */ s("span", { className: ve.paginatorText, children: n > 0 ? `${l}–${a} of ${n}` : "No results" }),
|
|
312
312
|
r.length > 1 && /* @__PURE__ */ s(
|
|
313
313
|
"select",
|
|
@@ -316,19 +316,19 @@ function Vr({
|
|
|
316
316
|
value: t,
|
|
317
317
|
onChange: (u) => o(1, Number(u.target.value)),
|
|
318
318
|
"aria-label": "Rows per page",
|
|
319
|
-
children: r.map((u) => /* @__PURE__ */
|
|
319
|
+
children: r.map((u) => /* @__PURE__ */ z("option", { value: u, children: [
|
|
320
320
|
u,
|
|
321
321
|
" / page"
|
|
322
322
|
] }, u))
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ z("div", { className: ve.paginatorNav, children: [
|
|
327
327
|
/* @__PURE__ */ s(
|
|
328
328
|
"button",
|
|
329
329
|
{
|
|
330
330
|
type: "button",
|
|
331
|
-
className:
|
|
331
|
+
className: m(ve.pageButton, c?.pageButton),
|
|
332
332
|
disabled: e <= 1,
|
|
333
333
|
onClick: () => o(e - 1, t),
|
|
334
334
|
"aria-label": "Previous page",
|
|
@@ -340,7 +340,7 @@ function Vr({
|
|
|
340
340
|
"button",
|
|
341
341
|
{
|
|
342
342
|
type: "button",
|
|
343
|
-
className:
|
|
343
|
+
className: m(ve.pageButton, u === e && ve.pageButtonActive, c?.pageButton),
|
|
344
344
|
onClick: () => o(u, t),
|
|
345
345
|
"aria-label": `Page ${u}`,
|
|
346
346
|
"aria-current": u === e ? "page" : void 0,
|
|
@@ -353,7 +353,7 @@ function Vr({
|
|
|
353
353
|
"button",
|
|
354
354
|
{
|
|
355
355
|
type: "button",
|
|
356
|
-
className:
|
|
356
|
+
className: m(ve.pageButton, c?.pageButton),
|
|
357
357
|
disabled: e >= i,
|
|
358
358
|
onClick: () => o(e + 1, t),
|
|
359
359
|
"aria-label": "Next page",
|
|
@@ -375,116 +375,126 @@ function qr({
|
|
|
375
375
|
className: a,
|
|
376
376
|
style: h,
|
|
377
377
|
rowKey: u,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
rowClassName: d,
|
|
379
|
+
rowStyle: f,
|
|
380
|
+
emptyMessage: y = "No data",
|
|
381
|
+
pagination: L,
|
|
382
|
+
classes: v
|
|
381
383
|
}) {
|
|
382
384
|
const S = r !== void 0, {
|
|
383
|
-
sortedData:
|
|
384
|
-
sortConfig:
|
|
385
|
-
requestSort:
|
|
386
|
-
requestMultiSort:
|
|
387
|
-
} = Ur(e, n),
|
|
388
|
-
if (!
|
|
389
|
-
const
|
|
390
|
-
return
|
|
391
|
-
}, [
|
|
392
|
-
(
|
|
393
|
-
const
|
|
385
|
+
sortedData: N,
|
|
386
|
+
sortConfig: D,
|
|
387
|
+
requestSort: j,
|
|
388
|
+
requestMultiSort: Z
|
|
389
|
+
} = Ur(e, n), U = S ? n ?? [] : D, C = S ? e : N, $ = ke(() => {
|
|
390
|
+
if (!L || S) return C;
|
|
391
|
+
const R = (L.page - 1) * L.pageSize;
|
|
392
|
+
return C.slice(R, R + L.pageSize);
|
|
393
|
+
}, [C, L, S]), oe = L?.totalRows ?? C.length, ce = fe(
|
|
394
|
+
(R, te) => {
|
|
395
|
+
const H = o && (te.ctrlKey || te.metaKey);
|
|
394
396
|
if (S)
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
let
|
|
398
|
-
|
|
399
|
-
(
|
|
400
|
-
) :
|
|
397
|
+
if (H) {
|
|
398
|
+
const O = U.findIndex((F) => F.key === R);
|
|
399
|
+
let A;
|
|
400
|
+
O === -1 ? A = [...U, { key: R, direction: "asc" }] : U[O].direction === "asc" ? A = U.map(
|
|
401
|
+
(F, ne) => ne === O ? { key: R, direction: "desc" } : F
|
|
402
|
+
) : A = U.filter((F, ne) => ne !== O), r(A);
|
|
401
403
|
} else {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
+
const O = U.find((A) => A.key === R);
|
|
405
|
+
O ? O.direction === "asc" ? r([{ key: R, direction: "desc" }]) : r([]) : r([{ key: R, direction: "asc" }]);
|
|
404
406
|
}
|
|
405
407
|
else
|
|
406
|
-
|
|
408
|
+
H ? Z(R) : j(R);
|
|
407
409
|
},
|
|
408
410
|
[
|
|
409
411
|
S,
|
|
410
412
|
o,
|
|
411
|
-
|
|
413
|
+
U,
|
|
412
414
|
r,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
+
j,
|
|
416
|
+
Z
|
|
415
417
|
]
|
|
416
|
-
),
|
|
417
|
-
if (
|
|
418
|
-
const
|
|
419
|
-
return
|
|
418
|
+
), q = (R) => U.find((H) => H.key === R)?.direction, ae = (R) => {
|
|
419
|
+
if (U.length <= 1) return;
|
|
420
|
+
const te = U.findIndex((H) => H.key === R);
|
|
421
|
+
return te >= 0 ? te : void 0;
|
|
420
422
|
};
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ z("div", { className: m(ve.wrapper, v?.wrapper), children: [
|
|
424
|
+
/* @__PURE__ */ z(
|
|
423
425
|
"table",
|
|
424
426
|
{
|
|
425
|
-
className:
|
|
427
|
+
className: m(
|
|
426
428
|
ve.root,
|
|
427
429
|
c && ve.striped,
|
|
428
430
|
i && ve.hoverable,
|
|
429
431
|
l && ve.compact,
|
|
430
|
-
|
|
432
|
+
v?.root,
|
|
431
433
|
a
|
|
432
434
|
),
|
|
433
435
|
style: h,
|
|
434
436
|
children: [
|
|
435
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((
|
|
437
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((R) => /* @__PURE__ */ z(
|
|
436
438
|
"th",
|
|
437
439
|
{
|
|
438
|
-
className:
|
|
440
|
+
className: m(
|
|
439
441
|
ve.headerCell,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
+
R.sortable && ve.headerCellSortable,
|
|
443
|
+
v?.headerCell
|
|
442
444
|
),
|
|
443
445
|
style: {
|
|
444
|
-
width:
|
|
445
|
-
textAlign:
|
|
446
|
+
width: R.width,
|
|
447
|
+
textAlign: R.align
|
|
446
448
|
},
|
|
447
|
-
onClick:
|
|
448
|
-
"aria-sort":
|
|
449
|
+
onClick: R.sortable ? (te) => ce(R.key, te) : void 0,
|
|
450
|
+
"aria-sort": R.sortable ? q(R.key) === "asc" ? "ascending" : q(R.key) === "desc" ? "descending" : "none" : void 0,
|
|
449
451
|
children: [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
+
R.header,
|
|
453
|
+
R.sortable && /* @__PURE__ */ s(
|
|
452
454
|
Yr,
|
|
453
455
|
{
|
|
454
|
-
direction:
|
|
455
|
-
sortIndex:
|
|
456
|
+
direction: q(R.key),
|
|
457
|
+
sortIndex: ae(R.key)
|
|
456
458
|
}
|
|
457
459
|
)
|
|
458
460
|
]
|
|
459
461
|
},
|
|
460
|
-
|
|
462
|
+
R.key
|
|
461
463
|
)) }) }),
|
|
462
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
463
|
-
const
|
|
464
|
-
return /* @__PURE__ */ s(
|
|
465
|
-
"
|
|
464
|
+
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell, v?.emptyCell), colSpan: t.length, children: y }) }) : $.map((R, te) => {
|
|
465
|
+
const H = u ? String(R[u]) : te, O = typeof d == "function" ? d(R, te) : d, A = typeof f == "function" ? f(R, te) : f;
|
|
466
|
+
return /* @__PURE__ */ s(
|
|
467
|
+
"tr",
|
|
466
468
|
{
|
|
467
|
-
className:
|
|
468
|
-
style:
|
|
469
|
-
children:
|
|
469
|
+
className: m(ve.row, v?.row, O),
|
|
470
|
+
style: A,
|
|
471
|
+
children: t.map((F) => /* @__PURE__ */ s(
|
|
472
|
+
"td",
|
|
473
|
+
{
|
|
474
|
+
className: m(ve.cell, v?.cell),
|
|
475
|
+
style: { textAlign: F.align },
|
|
476
|
+
children: F.render ? F.render(R[F.key], R, te) : R[F.key]
|
|
477
|
+
},
|
|
478
|
+
F.key
|
|
479
|
+
))
|
|
470
480
|
},
|
|
471
|
-
|
|
472
|
-
)
|
|
481
|
+
H
|
|
482
|
+
);
|
|
473
483
|
}) })
|
|
474
484
|
]
|
|
475
485
|
}
|
|
476
486
|
),
|
|
477
|
-
|
|
487
|
+
L && /* @__PURE__ */ s(
|
|
478
488
|
Vr,
|
|
479
489
|
{
|
|
480
|
-
...
|
|
481
|
-
totalRows:
|
|
482
|
-
paginatorClasses: { paginator:
|
|
490
|
+
...L,
|
|
491
|
+
totalRows: oe,
|
|
492
|
+
paginatorClasses: { paginator: v?.paginator, pageButton: v?.pageButton }
|
|
483
493
|
}
|
|
484
494
|
)
|
|
485
495
|
] });
|
|
486
496
|
}
|
|
487
|
-
const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo",
|
|
497
|
+
const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo", Me = {
|
|
488
498
|
root: Gr,
|
|
489
499
|
fullWidth: Zr,
|
|
490
500
|
trigger: Kr,
|
|
@@ -546,114 +556,114 @@ const Vt = $e(
|
|
|
546
556
|
placeholder: h = "Select...",
|
|
547
557
|
value: u,
|
|
548
558
|
onChange: d,
|
|
549
|
-
error:
|
|
550
|
-
fullWidth:
|
|
551
|
-
portal:
|
|
552
|
-
classes:
|
|
553
|
-
},
|
|
554
|
-
const [N,
|
|
559
|
+
error: f = !1,
|
|
560
|
+
fullWidth: y = !0,
|
|
561
|
+
portal: L = !0,
|
|
562
|
+
classes: v
|
|
563
|
+
}, S) => {
|
|
564
|
+
const [N, D] = Le(!1), j = re(null), Z = re(null), U = re(null), C = Ye();
|
|
555
565
|
Ne(() => {
|
|
556
|
-
N &&
|
|
566
|
+
N && Z.current && Z.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
557
567
|
}, [N]);
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
}, [l]),
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
return
|
|
568
|
+
const $ = fe(() => {
|
|
569
|
+
D(!1), l?.(), U.current?.focus();
|
|
570
|
+
}, [l]), oe = fe(() => {
|
|
571
|
+
D((A) => {
|
|
572
|
+
const F = !A;
|
|
573
|
+
return F ? i?.() : l?.(), F;
|
|
564
574
|
});
|
|
565
|
-
}, [i, l]),
|
|
566
|
-
(
|
|
567
|
-
d?.(
|
|
575
|
+
}, [i, l]), ce = fe(
|
|
576
|
+
(A) => {
|
|
577
|
+
d?.(A), $();
|
|
568
578
|
},
|
|
569
|
-
[d,
|
|
579
|
+
[d, $]
|
|
570
580
|
);
|
|
571
581
|
Ne(() => {
|
|
572
582
|
if (!N) return;
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
|
|
583
|
+
const A = (F) => {
|
|
584
|
+
const ne = F.target;
|
|
585
|
+
j.current?.contains(ne) || Z.current?.contains(ne) || $();
|
|
576
586
|
};
|
|
577
|
-
return document.addEventListener("mousedown",
|
|
578
|
-
}, [N,
|
|
587
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
588
|
+
}, [N, $]), Rt(
|
|
579
589
|
{
|
|
580
|
-
Escape: () =>
|
|
590
|
+
Escape: () => $()
|
|
581
591
|
},
|
|
582
592
|
N
|
|
583
593
|
);
|
|
584
|
-
const
|
|
594
|
+
const q = Tt(U, N && L), ae = a?.find((A) => A.value === u)?.label, R = a ? ae || h : e, te = a && !ae, H = a ? a.map((A) => /* @__PURE__ */ s(
|
|
585
595
|
"button",
|
|
586
596
|
{
|
|
587
597
|
type: "button",
|
|
588
598
|
role: "menuitem",
|
|
589
|
-
className:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
599
|
+
className: m(
|
|
600
|
+
Me.item,
|
|
601
|
+
A.disabled && Me.itemDisabled,
|
|
602
|
+
A.value === u && Me.itemSelected,
|
|
603
|
+
v?.item
|
|
594
604
|
),
|
|
595
|
-
disabled:
|
|
596
|
-
onClick: () =>
|
|
597
|
-
children:
|
|
605
|
+
disabled: A.disabled,
|
|
606
|
+
onClick: () => ce(A.value),
|
|
607
|
+
children: A.label
|
|
598
608
|
},
|
|
599
|
-
|
|
600
|
-
)) : t,
|
|
609
|
+
A.value
|
|
610
|
+
)) : t, O = (A) => /* @__PURE__ */ s(
|
|
601
611
|
"div",
|
|
602
612
|
{
|
|
603
|
-
ref:
|
|
604
|
-
id:
|
|
605
|
-
className:
|
|
606
|
-
|
|
607
|
-
N &&
|
|
608
|
-
n === "left" ?
|
|
609
|
-
!
|
|
610
|
-
|
|
613
|
+
ref: Z,
|
|
614
|
+
id: C,
|
|
615
|
+
className: m(
|
|
616
|
+
Me.menu,
|
|
617
|
+
N && Me.menuOpen,
|
|
618
|
+
n === "left" ? Me.alignLeft : Me.alignRight,
|
|
619
|
+
!L && y && Me.fullWidth,
|
|
620
|
+
v?.menu
|
|
611
621
|
),
|
|
612
|
-
style:
|
|
622
|
+
style: A,
|
|
613
623
|
role: "menu",
|
|
614
|
-
children:
|
|
624
|
+
children: H
|
|
615
625
|
}
|
|
616
626
|
);
|
|
617
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ z(
|
|
618
628
|
"div",
|
|
619
629
|
{
|
|
620
|
-
ref:
|
|
621
|
-
className:
|
|
630
|
+
ref: S,
|
|
631
|
+
className: m(Me.root, y && Me.fullWidth, v?.root, r),
|
|
622
632
|
style: o,
|
|
623
633
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ z("div", { ref: j, style: y ? { width: "100%" } : void 0, children: [
|
|
635
|
+
/* @__PURE__ */ z(
|
|
626
636
|
"button",
|
|
627
637
|
{
|
|
628
|
-
ref:
|
|
638
|
+
ref: U,
|
|
629
639
|
id: c,
|
|
630
640
|
type: "button",
|
|
631
|
-
className:
|
|
632
|
-
|
|
633
|
-
N &&
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
641
|
+
className: m(
|
|
642
|
+
Me.trigger,
|
|
643
|
+
N && Me.triggerOpen,
|
|
644
|
+
f && Me.triggerError,
|
|
645
|
+
y && Me.fullWidth,
|
|
646
|
+
v?.trigger
|
|
637
647
|
),
|
|
638
|
-
onClick:
|
|
648
|
+
onClick: oe,
|
|
639
649
|
"aria-expanded": N,
|
|
640
650
|
"aria-haspopup": "menu",
|
|
641
|
-
"aria-controls": N ?
|
|
651
|
+
"aria-controls": N ? C : void 0,
|
|
642
652
|
children: [
|
|
643
|
-
/* @__PURE__ */ s("span", { className:
|
|
644
|
-
/* @__PURE__ */ s("span", { className:
|
|
653
|
+
/* @__PURE__ */ s("span", { className: m(Me.triggerLabel, te && Me.placeholder, v?.triggerLabel), children: R }),
|
|
654
|
+
/* @__PURE__ */ s("span", { className: m(Me.chevron, v?.chevron), "aria-hidden": "true" })
|
|
645
655
|
]
|
|
646
656
|
}
|
|
647
657
|
),
|
|
648
|
-
!
|
|
658
|
+
!L && O()
|
|
649
659
|
] }),
|
|
650
|
-
|
|
651
|
-
|
|
660
|
+
L && N && typeof document < "u" && pt(
|
|
661
|
+
O({
|
|
652
662
|
position: "fixed",
|
|
653
|
-
top:
|
|
654
|
-
left: n === "right" ? void 0 :
|
|
655
|
-
right: n === "right" ? window.innerWidth - (
|
|
656
|
-
minWidth:
|
|
663
|
+
top: q.top + 4,
|
|
664
|
+
left: n === "right" ? void 0 : q.left,
|
|
665
|
+
right: n === "right" ? window.innerWidth - (q.left + q.width) : void 0,
|
|
666
|
+
minWidth: q.width,
|
|
657
667
|
zIndex: "var(--crk-z-floating)"
|
|
658
668
|
}),
|
|
659
669
|
document.body
|
|
@@ -676,9 +686,9 @@ const uo = $e(
|
|
|
676
686
|
ref: o,
|
|
677
687
|
type: "button",
|
|
678
688
|
role: "menuitem",
|
|
679
|
-
className:
|
|
680
|
-
|
|
681
|
-
e &&
|
|
689
|
+
className: m(
|
|
690
|
+
Me.item,
|
|
691
|
+
e && Me.itemDisabled,
|
|
682
692
|
t
|
|
683
693
|
),
|
|
684
694
|
disabled: e,
|
|
@@ -727,53 +737,53 @@ const qt = $e(
|
|
|
727
737
|
className: l,
|
|
728
738
|
style: a
|
|
729
739
|
}, h) => {
|
|
730
|
-
const [u, d] = Le(!1),
|
|
731
|
-
(
|
|
732
|
-
|
|
740
|
+
const [u, d] = Le(!1), f = re(null), y = re(null), L = re(null), v = Ye(), S = o !== void 0, N = S ? o : u, D = fe(
|
|
741
|
+
(C) => {
|
|
742
|
+
S || d(C), c?.(C);
|
|
733
743
|
},
|
|
734
|
-
[
|
|
735
|
-
),
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
|
|
739
|
-
}, [N,
|
|
740
|
-
xo(
|
|
744
|
+
[S, c]
|
|
745
|
+
), j = fe(() => {
|
|
746
|
+
D(!1), L.current?.focus();
|
|
747
|
+
}, [D]), Z = fe(() => {
|
|
748
|
+
D(!N);
|
|
749
|
+
}, [N, D]);
|
|
750
|
+
xo(f, j, N), Rt(
|
|
741
751
|
{
|
|
742
|
-
Escape: () =>
|
|
752
|
+
Escape: () => j()
|
|
743
753
|
},
|
|
744
754
|
N
|
|
745
755
|
), Ne(() => {
|
|
746
|
-
if (N &&
|
|
747
|
-
const
|
|
756
|
+
if (N && y.current) {
|
|
757
|
+
const C = y.current.querySelector(
|
|
748
758
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
749
759
|
);
|
|
750
|
-
|
|
760
|
+
C ? C.focus() : y.current.focus();
|
|
751
761
|
}
|
|
752
762
|
}, [N]);
|
|
753
|
-
let
|
|
763
|
+
let U;
|
|
754
764
|
if (t && dn(e)) {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
ref: ko(
|
|
758
|
-
onClick: (
|
|
759
|
-
|
|
765
|
+
const C = e, $ = C.ref;
|
|
766
|
+
U = Xt(C, {
|
|
767
|
+
ref: ko(L, $),
|
|
768
|
+
onClick: (oe) => {
|
|
769
|
+
C.props.onClick?.(oe), Z();
|
|
760
770
|
},
|
|
761
|
-
className:
|
|
771
|
+
className: m(C.props.className, i?.trigger),
|
|
762
772
|
"aria-expanded": N,
|
|
763
773
|
"aria-haspopup": "dialog",
|
|
764
|
-
"aria-controls": N ?
|
|
774
|
+
"aria-controls": N ? v : void 0
|
|
765
775
|
});
|
|
766
776
|
} else
|
|
767
|
-
|
|
777
|
+
U = /* @__PURE__ */ s(
|
|
768
778
|
"button",
|
|
769
779
|
{
|
|
770
|
-
ref:
|
|
780
|
+
ref: L,
|
|
771
781
|
type: "button",
|
|
772
|
-
className:
|
|
773
|
-
onClick:
|
|
782
|
+
className: m(at.trigger, i?.trigger),
|
|
783
|
+
onClick: Z,
|
|
774
784
|
"aria-expanded": N,
|
|
775
785
|
"aria-haspopup": "dialog",
|
|
776
|
-
"aria-controls": N ?
|
|
786
|
+
"aria-controls": N ? v : void 0,
|
|
777
787
|
children: e
|
|
778
788
|
}
|
|
779
789
|
);
|
|
@@ -781,18 +791,18 @@ const qt = $e(
|
|
|
781
791
|
"div",
|
|
782
792
|
{
|
|
783
793
|
ref: h,
|
|
784
|
-
className:
|
|
794
|
+
className: m(at.root, i?.root, l),
|
|
785
795
|
style: a,
|
|
786
|
-
children: /* @__PURE__ */
|
|
787
|
-
|
|
796
|
+
children: /* @__PURE__ */ z("div", { ref: f, children: [
|
|
797
|
+
U,
|
|
788
798
|
N && /* @__PURE__ */ s(
|
|
789
799
|
"div",
|
|
790
800
|
{
|
|
791
|
-
ref:
|
|
792
|
-
id:
|
|
801
|
+
ref: y,
|
|
802
|
+
id: v,
|
|
793
803
|
role: "dialog",
|
|
794
804
|
tabIndex: -1,
|
|
795
|
-
className:
|
|
805
|
+
className: m(at.popover, at[r], i?.popover),
|
|
796
806
|
children: n
|
|
797
807
|
}
|
|
798
808
|
)
|
|
@@ -810,7 +820,7 @@ const It = [
|
|
|
810
820
|
"a[href]",
|
|
811
821
|
'[tabindex]:not([tabindex="-1"])'
|
|
812
822
|
].join(", ");
|
|
813
|
-
function
|
|
823
|
+
function Mo(e, t) {
|
|
814
824
|
const n = re(null), r = fe(
|
|
815
825
|
(o) => {
|
|
816
826
|
if (o.key !== "Tab" || !e.current)
|
|
@@ -837,8 +847,8 @@ function wo(e, t) {
|
|
|
837
847
|
};
|
|
838
848
|
}, [t, e, r]);
|
|
839
849
|
}
|
|
840
|
-
const
|
|
841
|
-
backdrop:
|
|
850
|
+
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm", So = "crk-sm--xyY9", Ro = "crk-md-ETTfh", To = "crk-lg-5DBb7", Co = "crk-fullscreen-b4jQ-", Ao = "crk-header-NS30G", Bo = "crk-headerWithClose-4davm", Io = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Eo = "crk-footer-Oyz-R", ze = {
|
|
851
|
+
backdrop: wo,
|
|
842
852
|
backdropIn: $o,
|
|
843
853
|
modal: No,
|
|
844
854
|
modalIn: Lo,
|
|
@@ -853,11 +863,11 @@ const Mo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
853
863
|
footer: Eo
|
|
854
864
|
}, gt = _t({ classes: {}, titleId: "" }), Gt = ({ children: e, className: t, style: n, onClose: r }) => {
|
|
855
865
|
const { classes: o, titleId: c } = ft(gt);
|
|
856
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ z(
|
|
857
867
|
"div",
|
|
858
868
|
{
|
|
859
869
|
id: c,
|
|
860
|
-
className:
|
|
870
|
+
className: m(ze.header, r && ze.headerWithClose, o.header, t),
|
|
861
871
|
style: n,
|
|
862
872
|
children: [
|
|
863
873
|
e,
|
|
@@ -865,7 +875,7 @@ const Mo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
865
875
|
"button",
|
|
866
876
|
{
|
|
867
877
|
type: "button",
|
|
868
|
-
className:
|
|
878
|
+
className: m(ze.closeButton, o.closeButton),
|
|
869
879
|
onClick: r,
|
|
870
880
|
"aria-label": "Close",
|
|
871
881
|
children: "×"
|
|
@@ -878,12 +888,12 @@ const Mo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
878
888
|
Gt.displayName = "Modal.Header";
|
|
879
889
|
const Zt = ({ children: e, className: t, style: n }) => {
|
|
880
890
|
const { classes: r } = ft(gt);
|
|
881
|
-
return /* @__PURE__ */ s("div", { className:
|
|
891
|
+
return /* @__PURE__ */ s("div", { className: m(ze.body, r.body, t), style: n, children: e });
|
|
882
892
|
};
|
|
883
893
|
Zt.displayName = "Modal.Body";
|
|
884
894
|
const Kt = ({ children: e, className: t, style: n }) => {
|
|
885
895
|
const { classes: r } = ft(gt);
|
|
886
|
-
return /* @__PURE__ */ s("div", { className:
|
|
896
|
+
return /* @__PURE__ */ s("div", { className: m(ze.footer, r.footer, t), style: n, children: e });
|
|
887
897
|
};
|
|
888
898
|
Kt.displayName = "Modal.Footer";
|
|
889
899
|
const yt = $e(
|
|
@@ -900,9 +910,9 @@ const yt = $e(
|
|
|
900
910
|
"aria-label": h,
|
|
901
911
|
"aria-labelledby": u
|
|
902
912
|
}, d) => {
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
const
|
|
913
|
+
const f = re(null), y = d ?? f, L = Ye(), v = u ?? `${L}-title`;
|
|
914
|
+
Mo(y, e);
|
|
915
|
+
const S = ke(
|
|
906
916
|
() => ({
|
|
907
917
|
Escape: () => {
|
|
908
918
|
r && t();
|
|
@@ -910,34 +920,34 @@ const yt = $e(
|
|
|
910
920
|
}),
|
|
911
921
|
[r, t]
|
|
912
922
|
);
|
|
913
|
-
Rt(
|
|
923
|
+
Rt(S, e), Ne(() => {
|
|
914
924
|
if (!e) return;
|
|
915
|
-
const
|
|
925
|
+
const D = document.body.style.overflow;
|
|
916
926
|
return document.body.style.overflow = "hidden", () => {
|
|
917
|
-
document.body.style.overflow =
|
|
927
|
+
document.body.style.overflow = D;
|
|
918
928
|
};
|
|
919
929
|
}, [e]);
|
|
920
|
-
const N = (
|
|
921
|
-
n &&
|
|
930
|
+
const N = (D) => {
|
|
931
|
+
n && D.target === D.currentTarget && t();
|
|
922
932
|
};
|
|
923
933
|
return e ? pt(
|
|
924
934
|
/* @__PURE__ */ s(
|
|
925
935
|
"div",
|
|
926
936
|
{
|
|
927
|
-
className:
|
|
937
|
+
className: m(ze.backdrop, c?.backdrop),
|
|
928
938
|
onClick: N,
|
|
929
939
|
role: "presentation",
|
|
930
940
|
children: /* @__PURE__ */ s(
|
|
931
941
|
"div",
|
|
932
942
|
{
|
|
933
|
-
ref:
|
|
934
|
-
className:
|
|
943
|
+
ref: y,
|
|
944
|
+
className: m(ze.modal, ze[o], c?.modal, i),
|
|
935
945
|
style: l,
|
|
936
946
|
role: "dialog",
|
|
937
947
|
"aria-modal": "true",
|
|
938
948
|
"aria-label": h,
|
|
939
|
-
"aria-labelledby": h ? void 0 :
|
|
940
|
-
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId:
|
|
949
|
+
"aria-labelledby": h ? void 0 : v,
|
|
950
|
+
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId: v }, children: a })
|
|
941
951
|
}
|
|
942
952
|
)
|
|
943
953
|
}
|
|
@@ -971,11 +981,11 @@ function Pl({
|
|
|
971
981
|
children: c
|
|
972
982
|
}) {
|
|
973
983
|
const i = n && n.length > 0;
|
|
974
|
-
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */ z(
|
|
975
985
|
"form",
|
|
976
986
|
{
|
|
977
987
|
onSubmit: e.handleSubmit(t),
|
|
978
|
-
className:
|
|
988
|
+
className: m(We.root, r),
|
|
979
989
|
style: o,
|
|
980
990
|
children: [
|
|
981
991
|
i && /* @__PURE__ */ s("ul", { className: We.formErrors, role: "alert", children: n.map((l, a) => /* @__PURE__ */ s("li", { className: We.formError, children: l }, a)) }),
|
|
@@ -1002,27 +1012,27 @@ function Wl({
|
|
|
1002
1012
|
style: l,
|
|
1003
1013
|
children: a
|
|
1004
1014
|
}) {
|
|
1005
|
-
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }),
|
|
1006
|
-
N.current =
|
|
1007
|
-
const
|
|
1008
|
-
(
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1011
|
-
N.current(
|
|
1015
|
+
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, y = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L = Yo.has(y), { ref: v, ...S } = u, N = re(v);
|
|
1016
|
+
N.current = v;
|
|
1017
|
+
const D = fe(
|
|
1018
|
+
(j) => {
|
|
1019
|
+
if (j) {
|
|
1020
|
+
const Z = j.matches("input, select, textarea, button, [tabindex]") ? j : j.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
1021
|
+
N.current(Z ?? j);
|
|
1012
1022
|
} else
|
|
1013
1023
|
N.current(null);
|
|
1014
1024
|
},
|
|
1015
1025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1016
1026
|
[]
|
|
1017
1027
|
);
|
|
1018
|
-
return /* @__PURE__ */
|
|
1019
|
-
t && /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ z("div", { className: m(We.field, c?.field, i), style: l, children: [
|
|
1029
|
+
t && /* @__PURE__ */ z("label", { className: m(We.label, d.error && We.labelError, c?.label), htmlFor: e, children: [
|
|
1020
1030
|
t,
|
|
1021
1031
|
r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
|
|
1022
1032
|
] }),
|
|
1023
1033
|
Xt(a, {
|
|
1024
|
-
...
|
|
1025
|
-
ref:
|
|
1034
|
+
...S,
|
|
1035
|
+
ref: D,
|
|
1026
1036
|
id: e,
|
|
1027
1037
|
error: !!d.error,
|
|
1028
1038
|
"aria-invalid": d.error ? !0 : void 0,
|
|
@@ -1030,18 +1040,18 @@ function Wl({
|
|
|
1030
1040
|
// Bridge for custom components that use onValueChange/onValuesChange (Select, Dropdown).
|
|
1031
1041
|
// Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
|
|
1032
1042
|
// handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
|
|
1033
|
-
...
|
|
1034
|
-
onValueChange:
|
|
1035
|
-
onValuesChange:
|
|
1043
|
+
...L && {
|
|
1044
|
+
onValueChange: S.onChange,
|
|
1045
|
+
onValuesChange: S.onChange
|
|
1036
1046
|
},
|
|
1037
1047
|
// Bridge for Checkbox (expects checked, not value)
|
|
1038
|
-
checked: typeof
|
|
1048
|
+
checked: typeof S.value == "boolean" ? S.value : void 0
|
|
1039
1049
|
}),
|
|
1040
|
-
d.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className:
|
|
1050
|
+
d.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: m(We.error, c?.error), role: "alert", children: d.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: m(We.helperText, c?.helperText), children: n }) : null
|
|
1041
1051
|
] });
|
|
1042
1052
|
}
|
|
1043
1053
|
function Hl({ children: e, className: t, style: n }) {
|
|
1044
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1054
|
+
return /* @__PURE__ */ s("div", { className: m(We.row, t), style: n, children: e });
|
|
1045
1055
|
}
|
|
1046
1056
|
const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo = "crk-md-F4B0G", Ko = "crk-lg-pBxwX", Qo = "crk-error-fucxe", Jo = "crk-prefix-w53Md", ei = "crk-suffix-fcNgR", ti = "crk-hasPrefix--bqPD", ni = "crk-hasSuffix-zO0nX", Pe = {
|
|
1047
1057
|
root: Vo,
|
|
@@ -1069,7 +1079,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1069
1079
|
"input",
|
|
1070
1080
|
{
|
|
1071
1081
|
ref: a,
|
|
1072
|
-
className:
|
|
1082
|
+
className: m(
|
|
1073
1083
|
Pe.root,
|
|
1074
1084
|
Pe[e],
|
|
1075
1085
|
t && Pe.error,
|
|
@@ -1082,22 +1092,22 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1082
1092
|
...l
|
|
1083
1093
|
}
|
|
1084
1094
|
);
|
|
1085
|
-
return n || r ? /* @__PURE__ */
|
|
1095
|
+
return n || r ? /* @__PURE__ */ z(
|
|
1086
1096
|
"div",
|
|
1087
1097
|
{
|
|
1088
|
-
className:
|
|
1098
|
+
className: m(Pe.wrapper, Pe[e], t && Pe.error, o?.wrapper, c),
|
|
1089
1099
|
style: i,
|
|
1090
1100
|
children: [
|
|
1091
|
-
n && /* @__PURE__ */ s("span", { className:
|
|
1101
|
+
n && /* @__PURE__ */ s("span", { className: m(Pe.prefix, o?.prefix), children: n }),
|
|
1092
1102
|
h,
|
|
1093
|
-
r && /* @__PURE__ */ s("span", { className:
|
|
1103
|
+
r && /* @__PURE__ */ s("span", { className: m(Pe.suffix, o?.suffix), children: r })
|
|
1094
1104
|
]
|
|
1095
1105
|
}
|
|
1096
1106
|
) : h;
|
|
1097
1107
|
}
|
|
1098
1108
|
);
|
|
1099
1109
|
ri.displayName = "Input";
|
|
1100
|
-
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV",
|
|
1110
|
+
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV", Mi = "crk-menuItems-VrZnE", wi = "crk-item-fU3XI", $i = "crk-itemHighlighted-MvR41", Ni = "crk-itemDisabled-KTUO8", Li = "crk-itemSelected-42-BG", Si = "crk-noResults-uicSW", Ri = "crk-multiTrigger-Pd3wJ", Ti = "crk-multiTriggerDisabled-9ajge", Ci = "crk-chip-TuYUB", Ai = "crk-chipLabel-H4JWu", Bi = "crk-chipRemove-Lfk0R", Ii = "crk-multiSearch-OrVeS", Di = "crk-arrowMulti-Nh9Hr", Ei = "crk-itemCheck-DPB5A", W = {
|
|
1101
1111
|
wrapper: oi,
|
|
1102
1112
|
sm: ii,
|
|
1103
1113
|
md: ci,
|
|
@@ -1116,8 +1126,8 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1116
1126
|
visuallyHidden: bi,
|
|
1117
1127
|
menu: xi,
|
|
1118
1128
|
menuEnter: ki,
|
|
1119
|
-
menuItems:
|
|
1120
|
-
item:
|
|
1129
|
+
menuItems: Mi,
|
|
1130
|
+
item: wi,
|
|
1121
1131
|
itemHighlighted: $i,
|
|
1122
1132
|
itemDisabled: Ni,
|
|
1123
1133
|
itemSelected: Li,
|
|
@@ -1144,20 +1154,20 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1144
1154
|
searchPlaceholder: h,
|
|
1145
1155
|
onValueChange: u,
|
|
1146
1156
|
...d
|
|
1147
|
-
},
|
|
1148
|
-
/* @__PURE__ */
|
|
1157
|
+
}, f) => /* @__PURE__ */ z("div", { className: m(W.wrapper, W[e], t && W.error, o?.wrapper, c), style: i, children: [
|
|
1158
|
+
/* @__PURE__ */ z(
|
|
1149
1159
|
"select",
|
|
1150
1160
|
{
|
|
1151
|
-
ref:
|
|
1152
|
-
className:
|
|
1161
|
+
ref: f,
|
|
1162
|
+
className: m(W.root, W[e], t && W.error, o?.root),
|
|
1153
1163
|
...d,
|
|
1154
1164
|
children: [
|
|
1155
1165
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
1156
|
-
n ? n.map((
|
|
1166
|
+
n ? n.map((y) => /* @__PURE__ */ s("option", { value: y.value, disabled: y.disabled, children: y.label }, y.value)) : l
|
|
1157
1167
|
]
|
|
1158
1168
|
}
|
|
1159
1169
|
),
|
|
1160
|
-
/* @__PURE__ */ s("span", { className:
|
|
1170
|
+
/* @__PURE__ */ s("span", { className: m(W.arrow, o?.arrow) })
|
|
1161
1171
|
] })
|
|
1162
1172
|
);
|
|
1163
1173
|
Qt.displayName = "NativeSelect";
|
|
@@ -1175,80 +1185,80 @@ const Jt = $e(
|
|
|
1175
1185
|
id: h,
|
|
1176
1186
|
searchPlaceholder: u = "Search...",
|
|
1177
1187
|
onChange: d,
|
|
1178
|
-
onValueChange:
|
|
1179
|
-
portal:
|
|
1180
|
-
},
|
|
1181
|
-
const [
|
|
1188
|
+
onValueChange: f,
|
|
1189
|
+
portal: y = !0
|
|
1190
|
+
}, L) => {
|
|
1191
|
+
const [v, S] = Le(!1), [N, D] = Le(""), [j, Z] = Le(0), U = re(null), C = re(null), $ = re(null), oe = re(null), ce = re(null), q = Ye(), ae = Tt($, v && y), R = re(null), te = L ?? R, H = re(!1);
|
|
1182
1192
|
Ne(() => {
|
|
1183
|
-
|
|
1184
|
-
}, [
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
}, []),
|
|
1188
|
-
a || (
|
|
1189
|
-
}, [a]),
|
|
1193
|
+
H.current && !v && $.current?.focus(), H.current = v;
|
|
1194
|
+
}, [v]);
|
|
1195
|
+
const O = fe(() => {
|
|
1196
|
+
S(!1), D(""), Z(0);
|
|
1197
|
+
}, []), A = fe(() => {
|
|
1198
|
+
a || (S(!0), D(""), Z(0), setTimeout(() => C.current?.focus(), 0));
|
|
1199
|
+
}, [a]), F = fe(
|
|
1190
1200
|
(M) => {
|
|
1191
|
-
if (
|
|
1201
|
+
if (f?.(M), te.current) {
|
|
1192
1202
|
Object.getOwnPropertyDescriptor(
|
|
1193
1203
|
HTMLSelectElement.prototype,
|
|
1194
1204
|
"value"
|
|
1195
|
-
)?.set?.call(
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1205
|
+
)?.set?.call(te.current, M);
|
|
1206
|
+
const k = new Event("change", { bubbles: !0 });
|
|
1207
|
+
te.current.dispatchEvent(k), d?.(k);
|
|
1198
1208
|
}
|
|
1199
|
-
|
|
1209
|
+
O();
|
|
1200
1210
|
},
|
|
1201
|
-
[
|
|
1202
|
-
),
|
|
1211
|
+
[f, d, te, O]
|
|
1212
|
+
), ne = ke(() => {
|
|
1203
1213
|
if (!N) return n;
|
|
1204
1214
|
const M = N.toLowerCase();
|
|
1205
|
-
return n.filter((
|
|
1215
|
+
return n.filter((g) => g.label.toLowerCase().includes(M));
|
|
1206
1216
|
}, [n, N]);
|
|
1207
1217
|
Ne(() => {
|
|
1208
|
-
const M =
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1211
|
-
if (!
|
|
1212
|
-
const M =
|
|
1218
|
+
const M = ne.findIndex((g) => !g.disabled);
|
|
1219
|
+
Z(M >= 0 ? M : 0);
|
|
1220
|
+
}, [ne]), Ne(() => {
|
|
1221
|
+
if (!v) return;
|
|
1222
|
+
const M = ce.current;
|
|
1213
1223
|
if (!M) return;
|
|
1214
|
-
M.querySelectorAll('[role="option"]')[
|
|
1215
|
-
}, [
|
|
1224
|
+
M.querySelectorAll('[role="option"]')[j]?.scrollIntoView?.({ block: "nearest" });
|
|
1225
|
+
}, [j, v]);
|
|
1216
1226
|
const pe = fe(
|
|
1217
1227
|
(M) => {
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1228
|
+
const g = ne.map((k, B) => k.disabled ? -1 : B).filter((k) => k >= 0);
|
|
1229
|
+
if (g.length !== 0)
|
|
1220
1230
|
if (M.key === "ArrowDown")
|
|
1221
|
-
M.preventDefault(),
|
|
1222
|
-
const
|
|
1223
|
-
return
|
|
1231
|
+
M.preventDefault(), Z((k) => {
|
|
1232
|
+
const B = g.indexOf(k);
|
|
1233
|
+
return B < g.length - 1 ? g[B + 1] : g[0];
|
|
1224
1234
|
});
|
|
1225
1235
|
else if (M.key === "ArrowUp")
|
|
1226
|
-
M.preventDefault(),
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1236
|
+
M.preventDefault(), Z((k) => {
|
|
1237
|
+
const B = g.indexOf(k);
|
|
1238
|
+
return B > 0 ? g[B - 1] : g[g.length - 1];
|
|
1229
1239
|
});
|
|
1230
1240
|
else if (M.key === "Enter") {
|
|
1231
1241
|
M.preventDefault();
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
} else M.key === "Escape" && (M.preventDefault(),
|
|
1242
|
+
const k = ne[j];
|
|
1243
|
+
k && !k.disabled && F(k.value);
|
|
1244
|
+
} else M.key === "Escape" && (M.preventDefault(), O());
|
|
1235
1245
|
},
|
|
1236
|
-
[
|
|
1246
|
+
[ne, j, F, O]
|
|
1237
1247
|
);
|
|
1238
1248
|
Ne(() => {
|
|
1239
|
-
if (!
|
|
1240
|
-
const M = (
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1249
|
+
if (!v) return;
|
|
1250
|
+
const M = (g) => {
|
|
1251
|
+
const k = g.target;
|
|
1252
|
+
U.current?.contains(k) || oe.current?.contains(k) || O();
|
|
1243
1253
|
};
|
|
1244
1254
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
1245
|
-
}, [
|
|
1246
|
-
const
|
|
1247
|
-
return /* @__PURE__ */
|
|
1255
|
+
}, [v, O]);
|
|
1256
|
+
const K = n.find((M) => M.value === l)?.label, X = ne.filter((M) => !M.disabled);
|
|
1257
|
+
return /* @__PURE__ */ z(
|
|
1248
1258
|
"div",
|
|
1249
1259
|
{
|
|
1250
|
-
ref:
|
|
1251
|
-
className:
|
|
1260
|
+
ref: U,
|
|
1261
|
+
className: m(
|
|
1252
1262
|
W.wrapper,
|
|
1253
1263
|
W.searchableWrapper,
|
|
1254
1264
|
W[e],
|
|
@@ -1262,7 +1272,7 @@ const Jt = $e(
|
|
|
1262
1272
|
/* @__PURE__ */ s(
|
|
1263
1273
|
"select",
|
|
1264
1274
|
{
|
|
1265
|
-
ref:
|
|
1275
|
+
ref: te,
|
|
1266
1276
|
className: W.hiddenSelect,
|
|
1267
1277
|
value: l ?? "",
|
|
1268
1278
|
disabled: a,
|
|
@@ -1273,39 +1283,39 @@ const Jt = $e(
|
|
|
1273
1283
|
children: n.map((M) => /* @__PURE__ */ s("option", { value: M.value, children: M.label }, M.value))
|
|
1274
1284
|
}
|
|
1275
1285
|
),
|
|
1276
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ z(
|
|
1277
1287
|
"button",
|
|
1278
1288
|
{
|
|
1279
|
-
ref:
|
|
1289
|
+
ref: $,
|
|
1280
1290
|
id: h,
|
|
1281
1291
|
type: "button",
|
|
1282
|
-
className:
|
|
1292
|
+
className: m(
|
|
1283
1293
|
W.root,
|
|
1284
1294
|
W.searchableTrigger,
|
|
1285
1295
|
W[e],
|
|
1286
|
-
|
|
1296
|
+
v && W.triggerOpen,
|
|
1287
1297
|
t && W.error,
|
|
1288
|
-
|
|
1298
|
+
v && W.visuallyHidden,
|
|
1289
1299
|
o?.root
|
|
1290
1300
|
),
|
|
1291
|
-
onClick:
|
|
1301
|
+
onClick: A,
|
|
1292
1302
|
disabled: a,
|
|
1293
|
-
"aria-expanded":
|
|
1303
|
+
"aria-expanded": v,
|
|
1294
1304
|
"aria-haspopup": "listbox",
|
|
1295
|
-
"aria-controls":
|
|
1305
|
+
"aria-controls": v ? q : void 0,
|
|
1296
1306
|
children: [
|
|
1297
|
-
/* @__PURE__ */ s("span", { className:
|
|
1298
|
-
/* @__PURE__ */ s("span", { className:
|
|
1307
|
+
/* @__PURE__ */ s("span", { className: m(W.triggerLabel, !K && W.placeholder), children: K || r }),
|
|
1308
|
+
/* @__PURE__ */ s("span", { className: m(W.arrow, W.arrowInline, o?.arrow) })
|
|
1299
1309
|
]
|
|
1300
1310
|
}
|
|
1301
1311
|
),
|
|
1302
|
-
|
|
1312
|
+
v && /* @__PURE__ */ s(
|
|
1303
1313
|
"input",
|
|
1304
1314
|
{
|
|
1305
|
-
ref:
|
|
1315
|
+
ref: C,
|
|
1306
1316
|
type: "text",
|
|
1307
1317
|
role: "combobox",
|
|
1308
|
-
className:
|
|
1318
|
+
className: m(
|
|
1309
1319
|
W.root,
|
|
1310
1320
|
W.searchableTrigger,
|
|
1311
1321
|
W[e],
|
|
@@ -1314,55 +1324,56 @@ const Jt = $e(
|
|
|
1314
1324
|
o?.root,
|
|
1315
1325
|
o?.search
|
|
1316
1326
|
),
|
|
1317
|
-
placeholder:
|
|
1327
|
+
placeholder: K || r,
|
|
1318
1328
|
value: N,
|
|
1319
|
-
onChange: (M) =>
|
|
1329
|
+
onChange: (M) => D(M.target.value),
|
|
1320
1330
|
onKeyDown: pe,
|
|
1321
1331
|
"aria-expanded": !0,
|
|
1322
1332
|
"aria-haspopup": "listbox",
|
|
1323
|
-
"aria-controls":
|
|
1324
|
-
"aria-activedescendant":
|
|
1333
|
+
"aria-controls": q,
|
|
1334
|
+
"aria-activedescendant": X.length > 0 ? `select-option-${ne[j]?.value}` : void 0
|
|
1325
1335
|
}
|
|
1326
1336
|
),
|
|
1327
|
-
|
|
1328
|
-
const M =
|
|
1337
|
+
v && (() => {
|
|
1338
|
+
const M = y ? {
|
|
1329
1339
|
position: "fixed",
|
|
1330
|
-
top:
|
|
1331
|
-
left:
|
|
1332
|
-
|
|
1340
|
+
top: ae.top + 4,
|
|
1341
|
+
left: ae.left,
|
|
1342
|
+
right: "auto",
|
|
1343
|
+
width: ae.width,
|
|
1333
1344
|
zIndex: "var(--crk-z-floating)"
|
|
1334
|
-
} : void 0,
|
|
1345
|
+
} : void 0, g = /* @__PURE__ */ s(
|
|
1335
1346
|
"div",
|
|
1336
1347
|
{
|
|
1337
|
-
id:
|
|
1338
|
-
ref:
|
|
1339
|
-
className:
|
|
1348
|
+
id: q,
|
|
1349
|
+
ref: oe,
|
|
1350
|
+
className: m(W.menu, o?.menu),
|
|
1340
1351
|
style: M,
|
|
1341
1352
|
role: "listbox",
|
|
1342
|
-
children: /* @__PURE__ */ s("div", { className: W.menuItems, ref:
|
|
1353
|
+
children: /* @__PURE__ */ s("div", { className: W.menuItems, ref: ce, children: ne.length === 0 ? /* @__PURE__ */ s("div", { className: W.noResults, children: "No results" }) : ne.map((k, B) => /* @__PURE__ */ s(
|
|
1343
1354
|
"button",
|
|
1344
1355
|
{
|
|
1345
|
-
id: `select-option-${
|
|
1356
|
+
id: `select-option-${k.value}`,
|
|
1346
1357
|
type: "button",
|
|
1347
1358
|
role: "option",
|
|
1348
|
-
"aria-selected":
|
|
1349
|
-
className:
|
|
1359
|
+
"aria-selected": k.value === l,
|
|
1360
|
+
className: m(
|
|
1350
1361
|
W.item,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1362
|
+
k.disabled && W.itemDisabled,
|
|
1363
|
+
k.value === l && W.itemSelected,
|
|
1364
|
+
B === j && W.itemHighlighted,
|
|
1354
1365
|
o?.item
|
|
1355
1366
|
),
|
|
1356
|
-
disabled:
|
|
1357
|
-
onClick: () =>
|
|
1358
|
-
onMouseEnter: () =>
|
|
1359
|
-
children:
|
|
1367
|
+
disabled: k.disabled,
|
|
1368
|
+
onClick: () => F(k.value),
|
|
1369
|
+
onMouseEnter: () => Z(B),
|
|
1370
|
+
children: k.content ?? k.label
|
|
1360
1371
|
},
|
|
1361
|
-
|
|
1372
|
+
k.value
|
|
1362
1373
|
)) })
|
|
1363
1374
|
}
|
|
1364
1375
|
);
|
|
1365
|
-
return
|
|
1376
|
+
return y && typeof document < "u" ? pt(g, document.body) : g;
|
|
1366
1377
|
})()
|
|
1367
1378
|
]
|
|
1368
1379
|
}
|
|
@@ -1384,92 +1395,92 @@ const en = $e(
|
|
|
1384
1395
|
id: h,
|
|
1385
1396
|
searchPlaceholder: u,
|
|
1386
1397
|
onValuesChange: d,
|
|
1387
|
-
clearSearchOnSelect:
|
|
1388
|
-
allowCreate:
|
|
1389
|
-
onCreate:
|
|
1390
|
-
createLabel:
|
|
1391
|
-
portal:
|
|
1398
|
+
clearSearchOnSelect: f = !0,
|
|
1399
|
+
allowCreate: y = !1,
|
|
1400
|
+
onCreate: L,
|
|
1401
|
+
createLabel: v,
|
|
1402
|
+
portal: S = !0
|
|
1392
1403
|
}, N) => {
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1404
|
+
const D = Array.isArray(l) ? l : l ? [l] : [], [j, Z] = Le(!1), [U, C] = Le(""), [$, oe] = Le(0), ce = re(null), q = re(null), ae = re(null), R = re(null), te = re(null), H = Ye(), O = Tt(te, j && S), A = re(null), F = N ?? A, ne = fe(() => {
|
|
1405
|
+
Z(!1), C(""), oe(0);
|
|
1395
1406
|
}, []), pe = fe(() => {
|
|
1396
|
-
a || (
|
|
1397
|
-
}, [a]),
|
|
1398
|
-
(
|
|
1399
|
-
const
|
|
1400
|
-
d?.(
|
|
1407
|
+
a || (Z(!0), C(""), oe(0), setTimeout(() => q.current?.focus(), 0));
|
|
1408
|
+
}, [a]), K = fe(
|
|
1409
|
+
(b) => {
|
|
1410
|
+
const E = D.includes(b) ? D.filter((V) => V !== b) : [...D, b];
|
|
1411
|
+
d?.(E), f && C("");
|
|
1401
1412
|
},
|
|
1402
|
-
[
|
|
1403
|
-
),
|
|
1404
|
-
(
|
|
1405
|
-
|
|
1413
|
+
[D, d, f]
|
|
1414
|
+
), X = fe(
|
|
1415
|
+
(b, E) => {
|
|
1416
|
+
E.stopPropagation(), d?.(D.filter((V) => V !== b));
|
|
1406
1417
|
},
|
|
1407
|
-
[
|
|
1418
|
+
[D, d]
|
|
1408
1419
|
), M = ke(() => {
|
|
1409
|
-
if (!
|
|
1410
|
-
const
|
|
1411
|
-
return n.filter((
|
|
1412
|
-
}, [n,
|
|
1413
|
-
(
|
|
1414
|
-
) && !
|
|
1415
|
-
|
|
1416
|
-
}, [
|
|
1420
|
+
if (!U) return n;
|
|
1421
|
+
const b = U.toLowerCase();
|
|
1422
|
+
return n.filter((E) => E.label.toLowerCase().includes(b));
|
|
1423
|
+
}, [n, U]), g = U.trim(), k = y && g.length > 0 && !n.some(
|
|
1424
|
+
(b) => b.label.toLowerCase() === g.toLowerCase() || b.value === g
|
|
1425
|
+
) && !D.includes(g), B = fe(() => {
|
|
1426
|
+
g && (D.includes(g) || (L?.(g), d?.([...D, g]), f && C("")));
|
|
1427
|
+
}, [g, D, L, d, f]);
|
|
1417
1428
|
Ne(() => {
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1429
|
+
const b = M.findIndex((E) => !E.disabled);
|
|
1430
|
+
oe(b >= 0 ? b : 0);
|
|
1420
1431
|
}, [M]), Ne(() => {
|
|
1421
|
-
if (!
|
|
1422
|
-
const
|
|
1423
|
-
if (!
|
|
1424
|
-
|
|
1425
|
-
}, [
|
|
1426
|
-
const
|
|
1427
|
-
(
|
|
1428
|
-
const
|
|
1429
|
-
if (
|
|
1430
|
-
|
|
1432
|
+
if (!j) return;
|
|
1433
|
+
const b = R.current;
|
|
1434
|
+
if (!b) return;
|
|
1435
|
+
b.querySelectorAll('[role="option"]')[$]?.scrollIntoView?.({ block: "nearest" });
|
|
1436
|
+
}, [$, j]);
|
|
1437
|
+
const _ = M.length, J = fe(
|
|
1438
|
+
(b) => {
|
|
1439
|
+
const E = M.map((V, de) => V.disabled ? -1 : de).filter((V) => V >= 0);
|
|
1440
|
+
if (k && E.push(_), b.key === "Backspace" && U === "" && D.length > 0) {
|
|
1441
|
+
b.preventDefault(), d?.(D.slice(0, -1));
|
|
1431
1442
|
return;
|
|
1432
1443
|
}
|
|
1433
|
-
if (
|
|
1434
|
-
if (
|
|
1435
|
-
if (
|
|
1444
|
+
if (E.length !== 0)
|
|
1445
|
+
if (b.key === "ArrowDown") {
|
|
1446
|
+
if (b.preventDefault(), !j) {
|
|
1436
1447
|
pe();
|
|
1437
1448
|
return;
|
|
1438
1449
|
}
|
|
1439
|
-
|
|
1440
|
-
const de =
|
|
1441
|
-
return de <
|
|
1450
|
+
oe((V) => {
|
|
1451
|
+
const de = E.indexOf(V);
|
|
1452
|
+
return de < E.length - 1 ? E[de + 1] : E[0];
|
|
1442
1453
|
});
|
|
1443
|
-
} else if (
|
|
1444
|
-
|
|
1445
|
-
const de =
|
|
1446
|
-
return de > 0 ?
|
|
1454
|
+
} else if (b.key === "ArrowUp")
|
|
1455
|
+
b.preventDefault(), oe((V) => {
|
|
1456
|
+
const de = E.indexOf(V);
|
|
1457
|
+
return de > 0 ? E[de - 1] : E[E.length - 1];
|
|
1447
1458
|
});
|
|
1448
|
-
else if (
|
|
1449
|
-
if (
|
|
1450
|
-
|
|
1459
|
+
else if (b.key === "Enter") {
|
|
1460
|
+
if (b.preventDefault(), k && $ === _) {
|
|
1461
|
+
B();
|
|
1451
1462
|
return;
|
|
1452
1463
|
}
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
} else
|
|
1464
|
+
const V = M[$];
|
|
1465
|
+
V && !V.disabled ? K(V.value) : k && B();
|
|
1466
|
+
} else b.key === "Escape" && (b.preventDefault(), ne());
|
|
1456
1467
|
},
|
|
1457
|
-
[M,
|
|
1468
|
+
[M, $, K, ne, U, D, d, j, pe, k, B, _]
|
|
1458
1469
|
);
|
|
1459
1470
|
Ne(() => {
|
|
1460
|
-
if (!
|
|
1461
|
-
const
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1471
|
+
if (!j) return;
|
|
1472
|
+
const b = (E) => {
|
|
1473
|
+
const V = E.target;
|
|
1474
|
+
ce.current?.contains(V) || ae.current?.contains(V) || ne();
|
|
1464
1475
|
};
|
|
1465
|
-
return document.addEventListener("mousedown",
|
|
1466
|
-
}, [
|
|
1467
|
-
const
|
|
1468
|
-
return /* @__PURE__ */
|
|
1476
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
1477
|
+
}, [j, ne]);
|
|
1478
|
+
const Y = D.map((b) => n.find((V) => V.value === b) ?? { value: b, label: b });
|
|
1479
|
+
return /* @__PURE__ */ z(
|
|
1469
1480
|
"div",
|
|
1470
1481
|
{
|
|
1471
|
-
ref:
|
|
1472
|
-
className:
|
|
1482
|
+
ref: ce,
|
|
1483
|
+
className: m(
|
|
1473
1484
|
W.wrapper,
|
|
1474
1485
|
W.searchableWrapper,
|
|
1475
1486
|
W[e],
|
|
@@ -1483,134 +1494,135 @@ const en = $e(
|
|
|
1483
1494
|
/* @__PURE__ */ s(
|
|
1484
1495
|
"select",
|
|
1485
1496
|
{
|
|
1486
|
-
ref:
|
|
1497
|
+
ref: F,
|
|
1487
1498
|
className: W.hiddenSelect,
|
|
1488
1499
|
multiple: !0,
|
|
1489
|
-
value:
|
|
1500
|
+
value: D,
|
|
1490
1501
|
disabled: a,
|
|
1491
1502
|
tabIndex: -1,
|
|
1492
1503
|
"aria-hidden": "true",
|
|
1493
1504
|
onChange: () => {
|
|
1494
1505
|
},
|
|
1495
|
-
children: n.map((
|
|
1506
|
+
children: n.map((b) => /* @__PURE__ */ s("option", { value: b.value, children: b.label }, b.value))
|
|
1496
1507
|
}
|
|
1497
1508
|
),
|
|
1498
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ z(
|
|
1499
1510
|
"div",
|
|
1500
1511
|
{
|
|
1501
|
-
ref:
|
|
1502
|
-
className:
|
|
1512
|
+
ref: te,
|
|
1513
|
+
className: m(
|
|
1503
1514
|
W.multiTrigger,
|
|
1504
1515
|
W[e],
|
|
1505
|
-
|
|
1516
|
+
j && W.triggerOpen,
|
|
1506
1517
|
t && W.error,
|
|
1507
1518
|
a && W.multiTriggerDisabled,
|
|
1508
1519
|
o?.root
|
|
1509
1520
|
),
|
|
1510
1521
|
onClick: () => {
|
|
1511
|
-
|
|
1522
|
+
j ? q.current?.focus() : pe();
|
|
1512
1523
|
},
|
|
1513
1524
|
role: "combobox",
|
|
1514
|
-
"aria-expanded":
|
|
1525
|
+
"aria-expanded": j,
|
|
1515
1526
|
"aria-haspopup": "listbox",
|
|
1516
|
-
"aria-controls":
|
|
1527
|
+
"aria-controls": j ? H : void 0,
|
|
1517
1528
|
children: [
|
|
1518
|
-
|
|
1519
|
-
/* @__PURE__ */ s("span", { className: W.chipLabel, children:
|
|
1529
|
+
Y.map((b) => /* @__PURE__ */ z("span", { className: m(W.chip, o?.chip), children: [
|
|
1530
|
+
/* @__PURE__ */ s("span", { className: W.chipLabel, children: b.content ?? b.label }),
|
|
1520
1531
|
/* @__PURE__ */ s(
|
|
1521
1532
|
"button",
|
|
1522
1533
|
{
|
|
1523
1534
|
type: "button",
|
|
1524
|
-
className:
|
|
1525
|
-
onClick: (
|
|
1526
|
-
"aria-label": `Remove ${
|
|
1535
|
+
className: m(W.chipRemove, o?.chipRemove),
|
|
1536
|
+
onClick: (E) => X(b.value, E),
|
|
1537
|
+
"aria-label": `Remove ${b.label}`,
|
|
1527
1538
|
tabIndex: -1,
|
|
1528
1539
|
children: "×"
|
|
1529
1540
|
}
|
|
1530
1541
|
)
|
|
1531
|
-
] },
|
|
1542
|
+
] }, b.value)),
|
|
1532
1543
|
/* @__PURE__ */ s(
|
|
1533
1544
|
"input",
|
|
1534
1545
|
{
|
|
1535
|
-
ref:
|
|
1546
|
+
ref: q,
|
|
1536
1547
|
id: h,
|
|
1537
1548
|
type: "text",
|
|
1538
1549
|
className: W.multiSearch,
|
|
1539
|
-
placeholder:
|
|
1540
|
-
value:
|
|
1541
|
-
onChange: (
|
|
1542
|
-
|
|
1550
|
+
placeholder: D.length === 0 ? r : "",
|
|
1551
|
+
value: U,
|
|
1552
|
+
onChange: (b) => {
|
|
1553
|
+
C(b.target.value), j || pe();
|
|
1543
1554
|
},
|
|
1544
|
-
onKeyDown:
|
|
1555
|
+
onKeyDown: J,
|
|
1545
1556
|
disabled: a,
|
|
1546
1557
|
"aria-label": "Search options"
|
|
1547
1558
|
}
|
|
1548
1559
|
),
|
|
1549
|
-
/* @__PURE__ */ s("span", { className:
|
|
1560
|
+
/* @__PURE__ */ s("span", { className: m(W.arrow, W.arrowMulti, o?.arrow) })
|
|
1550
1561
|
]
|
|
1551
1562
|
}
|
|
1552
1563
|
),
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1564
|
+
j && (() => {
|
|
1565
|
+
const b = S ? {
|
|
1555
1566
|
position: "fixed",
|
|
1556
|
-
top:
|
|
1557
|
-
left:
|
|
1558
|
-
|
|
1567
|
+
top: O.top + 4,
|
|
1568
|
+
left: O.left,
|
|
1569
|
+
right: "auto",
|
|
1570
|
+
width: O.width,
|
|
1559
1571
|
zIndex: "var(--crk-z-floating)"
|
|
1560
|
-
} : void 0,
|
|
1572
|
+
} : void 0, E = /* @__PURE__ */ s(
|
|
1561
1573
|
"div",
|
|
1562
1574
|
{
|
|
1563
|
-
id:
|
|
1564
|
-
ref:
|
|
1565
|
-
className:
|
|
1566
|
-
style:
|
|
1575
|
+
id: H,
|
|
1576
|
+
ref: ae,
|
|
1577
|
+
className: m(W.menu, o?.menu),
|
|
1578
|
+
style: b,
|
|
1567
1579
|
role: "listbox",
|
|
1568
1580
|
"aria-multiselectable": "true",
|
|
1569
|
-
children: /* @__PURE__ */
|
|
1570
|
-
M.length === 0 && !
|
|
1571
|
-
M.map((
|
|
1572
|
-
const he =
|
|
1573
|
-
return /* @__PURE__ */
|
|
1581
|
+
children: /* @__PURE__ */ z("div", { className: W.menuItems, ref: R, children: [
|
|
1582
|
+
M.length === 0 && !k && /* @__PURE__ */ s("div", { className: W.noResults, children: "No results" }),
|
|
1583
|
+
M.map((V, de) => {
|
|
1584
|
+
const he = D.includes(V.value);
|
|
1585
|
+
return /* @__PURE__ */ z(
|
|
1574
1586
|
"button",
|
|
1575
1587
|
{
|
|
1576
|
-
id: `select-option-${
|
|
1588
|
+
id: `select-option-${V.value}`,
|
|
1577
1589
|
type: "button",
|
|
1578
1590
|
role: "option",
|
|
1579
1591
|
"aria-selected": he,
|
|
1580
|
-
className:
|
|
1592
|
+
className: m(
|
|
1581
1593
|
W.item,
|
|
1582
|
-
|
|
1594
|
+
V.disabled && W.itemDisabled,
|
|
1583
1595
|
he && W.itemSelected,
|
|
1584
|
-
de ===
|
|
1596
|
+
de === $ && W.itemHighlighted,
|
|
1585
1597
|
o?.item
|
|
1586
1598
|
),
|
|
1587
|
-
disabled:
|
|
1588
|
-
onClick: () =>
|
|
1589
|
-
onMouseEnter: () =>
|
|
1599
|
+
disabled: V.disabled,
|
|
1600
|
+
onClick: () => K(V.value),
|
|
1601
|
+
onMouseEnter: () => oe(de),
|
|
1590
1602
|
children: [
|
|
1591
1603
|
he && /* @__PURE__ */ s("span", { className: W.itemCheck, "aria-hidden": "true" }),
|
|
1592
|
-
|
|
1604
|
+
V.content ?? V.label
|
|
1593
1605
|
]
|
|
1594
1606
|
},
|
|
1595
|
-
|
|
1607
|
+
V.value
|
|
1596
1608
|
);
|
|
1597
1609
|
}),
|
|
1598
|
-
|
|
1610
|
+
k && /* @__PURE__ */ s(
|
|
1599
1611
|
"button",
|
|
1600
1612
|
{
|
|
1601
1613
|
type: "button",
|
|
1602
1614
|
role: "option",
|
|
1603
1615
|
"aria-selected": !1,
|
|
1604
|
-
className:
|
|
1616
|
+
className: m(
|
|
1605
1617
|
W.item,
|
|
1606
|
-
|
|
1618
|
+
$ === _ && W.itemHighlighted,
|
|
1607
1619
|
o?.item
|
|
1608
1620
|
),
|
|
1609
|
-
onClick:
|
|
1610
|
-
onMouseEnter: () =>
|
|
1611
|
-
children:
|
|
1621
|
+
onClick: B,
|
|
1622
|
+
onMouseEnter: () => oe(_),
|
|
1623
|
+
children: v ? v(g) : /* @__PURE__ */ z(je, { children: [
|
|
1612
1624
|
"Create “",
|
|
1613
|
-
/* @__PURE__ */ s("strong", { children:
|
|
1625
|
+
/* @__PURE__ */ s("strong", { children: g }),
|
|
1614
1626
|
"”"
|
|
1615
1627
|
] })
|
|
1616
1628
|
},
|
|
@@ -1619,7 +1631,7 @@ const en = $e(
|
|
|
1619
1631
|
] })
|
|
1620
1632
|
}
|
|
1621
1633
|
);
|
|
1622
|
-
return
|
|
1634
|
+
return S && typeof document < "u" ? pt(E, document.body) : E;
|
|
1623
1635
|
})()
|
|
1624
1636
|
]
|
|
1625
1637
|
}
|
|
@@ -1648,10 +1660,10 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1648
1660
|
const l = re(null);
|
|
1649
1661
|
return Ne(() => {
|
|
1650
1662
|
l.current && (l.current.indeterminate = t);
|
|
1651
|
-
}, [t]), /* @__PURE__ */
|
|
1663
|
+
}, [t]), /* @__PURE__ */ z(
|
|
1652
1664
|
"label",
|
|
1653
1665
|
{
|
|
1654
|
-
className:
|
|
1666
|
+
className: m(dt.root, t && dt.indeterminate, n?.root, r),
|
|
1655
1667
|
style: o,
|
|
1656
1668
|
children: [
|
|
1657
1669
|
/* @__PURE__ */ s(
|
|
@@ -1661,11 +1673,11 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1661
1673
|
l.current = a, typeof i == "function" ? i(a) : i && (i.current = a);
|
|
1662
1674
|
},
|
|
1663
1675
|
type: "checkbox",
|
|
1664
|
-
className:
|
|
1676
|
+
className: m(dt.input, n?.input),
|
|
1665
1677
|
...c
|
|
1666
1678
|
}
|
|
1667
1679
|
),
|
|
1668
|
-
e && /* @__PURE__ */ s("span", { className:
|
|
1680
|
+
e && /* @__PURE__ */ s("span", { className: m(dt.label, n?.label), children: e })
|
|
1669
1681
|
]
|
|
1670
1682
|
}
|
|
1671
1683
|
);
|
|
@@ -1692,7 +1704,7 @@ const ji = "crk-group-NNwCD", Xi = "crk-root-7fGik", _i = "crk-input-43PQW", Ui
|
|
|
1692
1704
|
"div",
|
|
1693
1705
|
{
|
|
1694
1706
|
id: i,
|
|
1695
|
-
className:
|
|
1707
|
+
className: m(ht.group, r),
|
|
1696
1708
|
style: o,
|
|
1697
1709
|
role: "radiogroup",
|
|
1698
1710
|
tabIndex: -1,
|
|
@@ -1715,24 +1727,24 @@ const Vi = $e(
|
|
|
1715
1727
|
name: l,
|
|
1716
1728
|
...a
|
|
1717
1729
|
}, h) => {
|
|
1718
|
-
const u = ft(tn), d = u?.name ?? l,
|
|
1719
|
-
u?.onChange?.(t), c?.(
|
|
1730
|
+
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i, y = (L) => {
|
|
1731
|
+
u?.onChange?.(t), c?.(L);
|
|
1720
1732
|
};
|
|
1721
|
-
return /* @__PURE__ */
|
|
1733
|
+
return /* @__PURE__ */ z("label", { className: m(ht.root, n?.root, r), style: o, children: [
|
|
1722
1734
|
/* @__PURE__ */ s(
|
|
1723
1735
|
"input",
|
|
1724
1736
|
{
|
|
1725
1737
|
ref: h,
|
|
1726
1738
|
type: "radio",
|
|
1727
|
-
className:
|
|
1739
|
+
className: m(ht.input, n?.input),
|
|
1728
1740
|
name: d,
|
|
1729
1741
|
value: t,
|
|
1730
|
-
checked:
|
|
1731
|
-
onChange:
|
|
1742
|
+
checked: f,
|
|
1743
|
+
onChange: y,
|
|
1732
1744
|
...a
|
|
1733
1745
|
}
|
|
1734
1746
|
),
|
|
1735
|
-
e && /* @__PURE__ */ s("span", { className:
|
|
1747
|
+
e && /* @__PURE__ */ s("span", { className: m(ht.label, n?.label), children: e })
|
|
1736
1748
|
] });
|
|
1737
1749
|
}
|
|
1738
1750
|
);
|
|
@@ -1765,25 +1777,25 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1765
1777
|
...l
|
|
1766
1778
|
}, a) => {
|
|
1767
1779
|
const h = re(null), u = fe(() => {
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1780
|
+
const y = h.current;
|
|
1781
|
+
y && (y.style.height = "auto", y.style.height = `${y.scrollHeight}px`);
|
|
1770
1782
|
}, []), d = l.value ?? "";
|
|
1771
1783
|
Ne(() => {
|
|
1772
1784
|
r && u();
|
|
1773
1785
|
}, [r, u, d]);
|
|
1774
|
-
const
|
|
1775
|
-
(
|
|
1776
|
-
r && u(), i?.(
|
|
1786
|
+
const f = fe(
|
|
1787
|
+
(y) => {
|
|
1788
|
+
r && u(), i?.(y);
|
|
1777
1789
|
},
|
|
1778
1790
|
[r, u, i]
|
|
1779
1791
|
);
|
|
1780
1792
|
return /* @__PURE__ */ s(
|
|
1781
1793
|
"textarea",
|
|
1782
1794
|
{
|
|
1783
|
-
ref: (
|
|
1784
|
-
h.current =
|
|
1795
|
+
ref: (y) => {
|
|
1796
|
+
h.current = y, typeof a == "function" ? a(y) : a && (a.current = y);
|
|
1785
1797
|
},
|
|
1786
|
-
className:
|
|
1798
|
+
className: m(
|
|
1787
1799
|
Ke.root,
|
|
1788
1800
|
Ke[e],
|
|
1789
1801
|
t && Ke.error,
|
|
@@ -1791,7 +1803,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1791
1803
|
o
|
|
1792
1804
|
),
|
|
1793
1805
|
style: c,
|
|
1794
|
-
onChange:
|
|
1806
|
+
onChange: f,
|
|
1795
1807
|
rows: l.rows ?? 1,
|
|
1796
1808
|
...l
|
|
1797
1809
|
}
|
|
@@ -1805,8 +1817,8 @@ function cc(e, t = { width: 600, height: 300 }) {
|
|
|
1805
1817
|
const c = e.current;
|
|
1806
1818
|
if (!c || typeof ResizeObserver > "u") return;
|
|
1807
1819
|
const i = (h, u) => {
|
|
1808
|
-
const d = Math.max(0, Math.round(h)),
|
|
1809
|
-
o.current.width === d && o.current.height ===
|
|
1820
|
+
const d = Math.max(0, Math.round(h)), f = Math.max(0, Math.round(u));
|
|
1821
|
+
o.current.width === d && o.current.height === f || (o.current = { width: d, height: f }, r({ width: d, height: f }));
|
|
1810
1822
|
}, l = c.getBoundingClientRect();
|
|
1811
1823
|
(l.width > 0 || l.height > 0) && i(l.width, l.height);
|
|
1812
1824
|
const a = new ResizeObserver((h) => {
|
|
@@ -1818,7 +1830,7 @@ function cc(e, t = { width: 600, height: 300 }) {
|
|
|
1818
1830
|
return a.observe(c), () => a.disconnect();
|
|
1819
1831
|
}, [e]), n;
|
|
1820
1832
|
}
|
|
1821
|
-
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI",
|
|
1833
|
+
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI", Mc = "crk-legendItem-rcdvO", wc = "crk-legendSwatch-eJBsF", $c = "crk-legendIcon-6gzcO", Nc = "crk-legendLabel-C-eu3", Lc = "crk-tooltip-m55-N", Sc = "crk-tooltipTitle-0EfoX", Rc = "crk-tooltipRows-MC0wM", Tc = "crk-tooltipRow-ZQomr", Cc = "crk-tooltipLabel-s4OKX", Ac = "crk-tooltipValue-iwj1s", Bc = "crk-empty-aa4vk", Ic = "crk-sparkline-3-eRc", Dc = "crk-tradingHeader-Pb9wS", w = {
|
|
1822
1834
|
root: lc,
|
|
1823
1835
|
canvas: sc,
|
|
1824
1836
|
svg: ac,
|
|
@@ -1834,8 +1846,8 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1834
1846
|
activeBar: bc,
|
|
1835
1847
|
interactionLayer: xc,
|
|
1836
1848
|
legend: kc,
|
|
1837
|
-
legendItem:
|
|
1838
|
-
legendSwatch:
|
|
1849
|
+
legendItem: Mc,
|
|
1850
|
+
legendSwatch: wc,
|
|
1839
1851
|
legendIcon: $c,
|
|
1840
1852
|
legendLabel: Nc,
|
|
1841
1853
|
tooltip: Lc,
|
|
@@ -1851,24 +1863,24 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1851
1863
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: c, overlay: i, children: l }, a) => {
|
|
1852
1864
|
const h = re(null);
|
|
1853
1865
|
un(a, () => h.current);
|
|
1854
|
-
const { width: u } = cc(h), d = Math.max(0, u),
|
|
1855
|
-
return /* @__PURE__ */
|
|
1866
|
+
const { width: u } = cc(h), d = Math.max(0, u), f = t ?? Math.round(d / e);
|
|
1867
|
+
return /* @__PURE__ */ z(
|
|
1856
1868
|
"div",
|
|
1857
1869
|
{
|
|
1858
1870
|
ref: h,
|
|
1859
|
-
className:
|
|
1871
|
+
className: m(w.root, o?.root, n),
|
|
1860
1872
|
style: r,
|
|
1861
1873
|
children: [
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
d > 0 &&
|
|
1874
|
+
/* @__PURE__ */ z("div", { className: w.canvas, style: { height: f || void 0 }, children: [
|
|
1875
|
+
d > 0 && f > 0 && /* @__PURE__ */ s(
|
|
1864
1876
|
"svg",
|
|
1865
1877
|
{
|
|
1866
|
-
className:
|
|
1878
|
+
className: m(w.svg, o?.svg),
|
|
1867
1879
|
width: d,
|
|
1868
|
-
height:
|
|
1869
|
-
viewBox: `0 0 ${d} ${
|
|
1880
|
+
height: f,
|
|
1881
|
+
viewBox: `0 0 ${d} ${f}`,
|
|
1870
1882
|
role: "img",
|
|
1871
|
-
children: l({ width: d, height:
|
|
1883
|
+
children: l({ width: d, height: f })
|
|
1872
1884
|
}
|
|
1873
1885
|
),
|
|
1874
1886
|
i
|
|
@@ -1882,13 +1894,13 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1882
1894
|
Ve.displayName = "ChartContainer";
|
|
1883
1895
|
function vt({ config: e, order: t, classes: n }) {
|
|
1884
1896
|
const r = t ?? Object.keys(e);
|
|
1885
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1897
|
+
return /* @__PURE__ */ s("div", { className: m(w.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
1886
1898
|
const c = e[o];
|
|
1887
|
-
return c ? /* @__PURE__ */
|
|
1899
|
+
return c ? /* @__PURE__ */ z("div", { className: m(w.legendItem, n?.legendItem), role: "listitem", children: [
|
|
1888
1900
|
c.icon ? /* @__PURE__ */ s(
|
|
1889
1901
|
"span",
|
|
1890
1902
|
{
|
|
1891
|
-
className:
|
|
1903
|
+
className: w.legendIcon,
|
|
1892
1904
|
style: { color: c.color },
|
|
1893
1905
|
"aria-hidden": "true",
|
|
1894
1906
|
children: c.icon
|
|
@@ -1896,12 +1908,12 @@ function vt({ config: e, order: t, classes: n }) {
|
|
|
1896
1908
|
) : /* @__PURE__ */ s(
|
|
1897
1909
|
"span",
|
|
1898
1910
|
{
|
|
1899
|
-
className:
|
|
1911
|
+
className: w.legendSwatch,
|
|
1900
1912
|
style: { background: c.color },
|
|
1901
1913
|
"aria-hidden": "true"
|
|
1902
1914
|
}
|
|
1903
1915
|
),
|
|
1904
|
-
/* @__PURE__ */ s("span", { className:
|
|
1916
|
+
/* @__PURE__ */ s("span", { className: w.legendLabel, children: c.label })
|
|
1905
1917
|
] }, o) : null;
|
|
1906
1918
|
}) });
|
|
1907
1919
|
}
|
|
@@ -1918,35 +1930,35 @@ function et({
|
|
|
1918
1930
|
classes: h
|
|
1919
1931
|
}) {
|
|
1920
1932
|
if (!e) return null;
|
|
1921
|
-
const u = 180,
|
|
1933
|
+
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12, y = Math.max(8, n - 16);
|
|
1922
1934
|
return /* @__PURE__ */ s(
|
|
1923
1935
|
"div",
|
|
1924
1936
|
{
|
|
1925
|
-
className:
|
|
1926
|
-
style: { left:
|
|
1937
|
+
className: m(w.tooltip, h?.tooltip),
|
|
1938
|
+
style: { left: f, top: y, width: u },
|
|
1927
1939
|
role: "tooltip",
|
|
1928
|
-
children: c ? c(e) : /* @__PURE__ */
|
|
1929
|
-
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className:
|
|
1930
|
-
/* @__PURE__ */ s("div", { className:
|
|
1931
|
-
const
|
|
1932
|
-
if (
|
|
1933
|
-
const N = typeof
|
|
1934
|
-
return /* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */ s("span", { className:
|
|
1936
|
-
/* @__PURE__ */ s("span", { className:
|
|
1937
|
-
/* @__PURE__ */ s("span", { className:
|
|
1938
|
-
] },
|
|
1940
|
+
children: c ? c(e) : /* @__PURE__ */ z(je, { children: [
|
|
1941
|
+
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: w.tooltipTitle, children: String(e[l]) }),
|
|
1942
|
+
/* @__PURE__ */ s("div", { className: w.tooltipRows, children: Object.entries(o).map(([L, v]) => {
|
|
1943
|
+
const S = e[L];
|
|
1944
|
+
if (S == null) return null;
|
|
1945
|
+
const N = typeof S == "number" ? i(S) : String(S), D = a?.(L) ?? v.color;
|
|
1946
|
+
return /* @__PURE__ */ z("div", { className: w.tooltipRow, children: [
|
|
1947
|
+
/* @__PURE__ */ s("span", { className: w.legendSwatch, style: { background: D }, "aria-hidden": "true" }),
|
|
1948
|
+
/* @__PURE__ */ s("span", { className: w.tooltipLabel, children: v.label }),
|
|
1949
|
+
/* @__PURE__ */ s("span", { className: w.tooltipValue, children: N })
|
|
1950
|
+
] }, L);
|
|
1939
1951
|
}) })
|
|
1940
1952
|
] })
|
|
1941
1953
|
}
|
|
1942
1954
|
);
|
|
1943
1955
|
}
|
|
1944
1956
|
function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: c }) {
|
|
1945
|
-
return /* @__PURE__ */ s("g", { className:
|
|
1957
|
+
return /* @__PURE__ */ s("g", { className: m(w.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */ z("g", { children: [
|
|
1946
1958
|
o && /* @__PURE__ */ s(
|
|
1947
1959
|
"line",
|
|
1948
1960
|
{
|
|
1949
|
-
className:
|
|
1961
|
+
className: m(w.gridLine, c?.grid),
|
|
1950
1962
|
x1: t,
|
|
1951
1963
|
x2: t + n,
|
|
1952
1964
|
y1: l,
|
|
@@ -1956,7 +1968,7 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1956
1968
|
/* @__PURE__ */ s(
|
|
1957
1969
|
"text",
|
|
1958
1970
|
{
|
|
1959
|
-
className:
|
|
1971
|
+
className: m(w.axisLabel, c?.axisLabel),
|
|
1960
1972
|
x: t - 8,
|
|
1961
1973
|
y: l,
|
|
1962
1974
|
textAnchor: "end",
|
|
@@ -1967,10 +1979,10 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1967
1979
|
] }, `y-${i}`)) });
|
|
1968
1980
|
}
|
|
1969
1981
|
function rn({ ticks: e, y: t, format: n, classes: r }) {
|
|
1970
|
-
return /* @__PURE__ */ s("g", { className:
|
|
1982
|
+
return /* @__PURE__ */ s("g", { className: m(w.axis, r?.axis), children: e.map(({ label: o, x: c }) => /* @__PURE__ */ s(
|
|
1971
1983
|
"text",
|
|
1972
1984
|
{
|
|
1973
|
-
className:
|
|
1985
|
+
className: m(w.axisLabel, r?.axisLabel),
|
|
1974
1986
|
x: c,
|
|
1975
1987
|
y: t + 16,
|
|
1976
1988
|
textAnchor: "middle",
|
|
@@ -2049,180 +2061,180 @@ function Ol({
|
|
|
2049
2061
|
showValues: h = !1,
|
|
2050
2062
|
valuePosition: u = "top",
|
|
2051
2063
|
renderLabel: d,
|
|
2052
|
-
activeIndex:
|
|
2053
|
-
onPointClick:
|
|
2054
|
-
showGrid:
|
|
2055
|
-
showLegend:
|
|
2056
|
-
showTooltip:
|
|
2064
|
+
activeIndex: f,
|
|
2065
|
+
onPointClick: y,
|
|
2066
|
+
showGrid: L = !0,
|
|
2067
|
+
showLegend: v = !0,
|
|
2068
|
+
showTooltip: S = !0,
|
|
2057
2069
|
yTickCount: N = 5,
|
|
2058
|
-
yFormat:
|
|
2059
|
-
xFormat:
|
|
2060
|
-
valueFormat:
|
|
2061
|
-
renderTooltip:
|
|
2062
|
-
margin:
|
|
2063
|
-
emptyMessage:
|
|
2064
|
-
className:
|
|
2065
|
-
style:
|
|
2066
|
-
classes:
|
|
2070
|
+
yFormat: D,
|
|
2071
|
+
xFormat: j,
|
|
2072
|
+
valueFormat: Z,
|
|
2073
|
+
renderTooltip: U,
|
|
2074
|
+
margin: C,
|
|
2075
|
+
emptyMessage: $ = "No data",
|
|
2076
|
+
className: oe,
|
|
2077
|
+
style: ce,
|
|
2078
|
+
classes: q
|
|
2067
2079
|
}) {
|
|
2068
|
-
const
|
|
2080
|
+
const ae = { ...Ec, ...C }, R = ke(() => Object.keys(n), [n]), [te, H] = Le(null), O = re(null), A = f ?? te, F = (pe, K) => {
|
|
2069
2081
|
if (l) {
|
|
2070
|
-
const
|
|
2071
|
-
if (typeof
|
|
2082
|
+
const X = e[K]?.[l];
|
|
2083
|
+
if (typeof X == "string") return X;
|
|
2072
2084
|
}
|
|
2073
2085
|
return n[pe]?.color ?? "var(--crk-chart-1)";
|
|
2074
2086
|
};
|
|
2075
2087
|
if (e.length === 0)
|
|
2076
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2077
|
-
const
|
|
2088
|
+
return /* @__PURE__ */ s("div", { ref: O, className: m(w.root, q?.root, oe), style: ce, children: /* @__PURE__ */ s("div", { className: w.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: w.empty, children: $ }) }) });
|
|
2089
|
+
const ne = S && A !== null ? /* @__PURE__ */ s(
|
|
2078
2090
|
et,
|
|
2079
2091
|
{
|
|
2080
|
-
row: e[
|
|
2081
|
-
x: Hc(e, t,
|
|
2092
|
+
row: e[A],
|
|
2093
|
+
x: Hc(e, t, ae, A, O),
|
|
2082
2094
|
y: 16,
|
|
2083
|
-
containerWidth:
|
|
2095
|
+
containerWidth: O.current?.getBoundingClientRect().width ?? 0,
|
|
2084
2096
|
config: n,
|
|
2085
|
-
render:
|
|
2086
|
-
valueFormat:
|
|
2097
|
+
render: U ? () => U(e[A]) : void 0,
|
|
2098
|
+
valueFormat: Z,
|
|
2087
2099
|
titleKey: t,
|
|
2088
|
-
resolveColor: l ? (pe) =>
|
|
2089
|
-
classes:
|
|
2100
|
+
resolveColor: l ? (pe) => F(pe, A) : void 0,
|
|
2101
|
+
classes: q
|
|
2090
2102
|
}
|
|
2091
2103
|
) : null;
|
|
2092
2104
|
return /* @__PURE__ */ s(
|
|
2093
2105
|
Ve,
|
|
2094
2106
|
{
|
|
2095
|
-
ref:
|
|
2107
|
+
ref: O,
|
|
2096
2108
|
aspectRatio: r,
|
|
2097
2109
|
height: o,
|
|
2098
|
-
className:
|
|
2099
|
-
style:
|
|
2100
|
-
classes:
|
|
2101
|
-
legend:
|
|
2102
|
-
overlay:
|
|
2103
|
-
children: ({ width: pe, height:
|
|
2104
|
-
const
|
|
2105
|
-
for (const
|
|
2106
|
-
for (const
|
|
2107
|
-
const
|
|
2108
|
-
typeof
|
|
2110
|
+
className: oe,
|
|
2111
|
+
style: ce,
|
|
2112
|
+
classes: q,
|
|
2113
|
+
legend: v ? /* @__PURE__ */ s(vt, { config: n, classes: q }) : void 0,
|
|
2114
|
+
overlay: ne,
|
|
2115
|
+
children: ({ width: pe, height: K }) => {
|
|
2116
|
+
const X = ae.left, M = pe - ae.right, g = ae.top, k = K - ae.bottom, B = Math.max(0, M - X), _ = Math.max(0, k - g), J = e.map((p) => String(p[t])), Y = Xe(J, [X, M], 0), b = [];
|
|
2117
|
+
for (const p of R)
|
|
2118
|
+
for (const x of e) {
|
|
2119
|
+
const ee = x[p];
|
|
2120
|
+
typeof ee == "number" && b.push(ee);
|
|
2109
2121
|
}
|
|
2110
|
-
const [
|
|
2111
|
-
return /* @__PURE__ */
|
|
2122
|
+
const [E, V] = bt(b), de = Math.min(0, E), he = qe(de, V, N), ye = Je([he[0], he[he.length - 1]], [k, g]), be = he.map((p) => ({ value: p, y: ye(p) })), Se = Wc(J).map((p) => ({ label: p, x: Y(p) }));
|
|
2123
|
+
return /* @__PURE__ */ z(je, { children: [
|
|
2112
2124
|
/* @__PURE__ */ s(
|
|
2113
2125
|
nn,
|
|
2114
2126
|
{
|
|
2115
2127
|
ticks: be,
|
|
2116
|
-
x:
|
|
2117
|
-
plotWidth:
|
|
2118
|
-
format:
|
|
2119
|
-
showGrid:
|
|
2120
|
-
classes:
|
|
2128
|
+
x: X,
|
|
2129
|
+
plotWidth: B,
|
|
2130
|
+
format: D,
|
|
2131
|
+
showGrid: L,
|
|
2132
|
+
classes: q
|
|
2121
2133
|
}
|
|
2122
2134
|
),
|
|
2123
|
-
/* @__PURE__ */ s(rn, { ticks: Se, y:
|
|
2124
|
-
|
|
2125
|
-
const
|
|
2126
|
-
const
|
|
2127
|
-
return { x:
|
|
2135
|
+
/* @__PURE__ */ s(rn, { ticks: Se, y: k, format: j, classes: q }),
|
|
2136
|
+
R.map((p) => {
|
|
2137
|
+
const x = n[p], ee = e.map((P, G) => {
|
|
2138
|
+
const I = P[p], me = typeof I == "number" ? I : 0;
|
|
2139
|
+
return { x: Y(J[G]), y: ye(me), value: me, row: P };
|
|
2128
2140
|
});
|
|
2129
|
-
return /* @__PURE__ */
|
|
2141
|
+
return /* @__PURE__ */ z("g", { className: m(w.series, q?.series), children: [
|
|
2130
2142
|
/* @__PURE__ */ s(
|
|
2131
2143
|
"path",
|
|
2132
2144
|
{
|
|
2133
|
-
className:
|
|
2134
|
-
d: Pc(
|
|
2135
|
-
stroke:
|
|
2145
|
+
className: m(w.linePath),
|
|
2146
|
+
d: Pc(ee, c),
|
|
2147
|
+
stroke: x.color
|
|
2136
2148
|
}
|
|
2137
2149
|
),
|
|
2138
|
-
i &&
|
|
2139
|
-
const
|
|
2150
|
+
i && ee.map((P, G) => {
|
|
2151
|
+
const I = F(p, G), me = A === G, Q = f !== void 0 && !me, T = y ? () => y({ row: P.row, value: P.value, seriesKey: p, index: G }) : void 0;
|
|
2140
2152
|
return a ? /* @__PURE__ */ s(
|
|
2141
2153
|
"g",
|
|
2142
2154
|
{
|
|
2143
|
-
onClick:
|
|
2144
|
-
style:
|
|
2145
|
-
opacity:
|
|
2155
|
+
onClick: T,
|
|
2156
|
+
style: T ? { cursor: "pointer" } : void 0,
|
|
2157
|
+
opacity: Q ? 0.45 : 1,
|
|
2146
2158
|
children: a({
|
|
2147
|
-
row:
|
|
2148
|
-
value:
|
|
2149
|
-
seriesKey:
|
|
2150
|
-
index:
|
|
2151
|
-
x:
|
|
2152
|
-
y:
|
|
2153
|
-
color:
|
|
2159
|
+
row: P.row,
|
|
2160
|
+
value: P.value,
|
|
2161
|
+
seriesKey: p,
|
|
2162
|
+
index: G,
|
|
2163
|
+
x: P.x,
|
|
2164
|
+
y: P.y,
|
|
2165
|
+
color: I,
|
|
2154
2166
|
active: me
|
|
2155
2167
|
})
|
|
2156
2168
|
},
|
|
2157
|
-
`${
|
|
2169
|
+
`${p}-${G}`
|
|
2158
2170
|
) : /* @__PURE__ */ s(
|
|
2159
2171
|
"circle",
|
|
2160
2172
|
{
|
|
2161
|
-
className:
|
|
2162
|
-
cx:
|
|
2163
|
-
cy:
|
|
2173
|
+
className: m(w.point, q?.point),
|
|
2174
|
+
cx: P.x,
|
|
2175
|
+
cy: P.y,
|
|
2164
2176
|
r: me ? 5 : 3.5,
|
|
2165
|
-
fill:
|
|
2166
|
-
onClick:
|
|
2167
|
-
style:
|
|
2168
|
-
opacity:
|
|
2177
|
+
fill: I,
|
|
2178
|
+
onClick: T,
|
|
2179
|
+
style: T ? { cursor: "pointer" } : void 0,
|
|
2180
|
+
opacity: Q ? 0.45 : 1
|
|
2169
2181
|
},
|
|
2170
|
-
`${
|
|
2182
|
+
`${p}-${G}`
|
|
2171
2183
|
);
|
|
2172
2184
|
}),
|
|
2173
|
-
(h || d) &&
|
|
2174
|
-
const
|
|
2175
|
-
if (
|
|
2176
|
-
const me = 10,
|
|
2185
|
+
(h || d) && ee.map((P, G) => {
|
|
2186
|
+
const I = d ? d({ row: P.row, value: P.value, seriesKey: p, index: G }) : h ? Z ? Z(P.value) : String(P.value) : null;
|
|
2187
|
+
if (I == null) return null;
|
|
2188
|
+
const me = 10, Q = u === "top" ? P.y - me : P.y + me + 4;
|
|
2177
2189
|
return /* @__PURE__ */ s(
|
|
2178
2190
|
"text",
|
|
2179
2191
|
{
|
|
2180
|
-
className:
|
|
2181
|
-
x:
|
|
2182
|
-
y:
|
|
2192
|
+
className: m(w.axisLabel),
|
|
2193
|
+
x: P.x,
|
|
2194
|
+
y: Q,
|
|
2183
2195
|
textAnchor: "middle",
|
|
2184
2196
|
dominantBaseline: u === "top" ? "auto" : "middle",
|
|
2185
|
-
children:
|
|
2197
|
+
children: I
|
|
2186
2198
|
},
|
|
2187
|
-
`label-${
|
|
2199
|
+
`label-${p}-${G}`
|
|
2188
2200
|
);
|
|
2189
2201
|
})
|
|
2190
|
-
] },
|
|
2202
|
+
] }, p);
|
|
2191
2203
|
}),
|
|
2192
|
-
|
|
2204
|
+
A !== null && /* @__PURE__ */ s(
|
|
2193
2205
|
"line",
|
|
2194
2206
|
{
|
|
2195
|
-
className:
|
|
2196
|
-
x1:
|
|
2197
|
-
x2:
|
|
2198
|
-
y1:
|
|
2199
|
-
y2:
|
|
2207
|
+
className: w.cursorLine,
|
|
2208
|
+
x1: Y(J[A]),
|
|
2209
|
+
x2: Y(J[A]),
|
|
2210
|
+
y1: g,
|
|
2211
|
+
y2: k
|
|
2200
2212
|
}
|
|
2201
2213
|
),
|
|
2202
2214
|
/* @__PURE__ */ s(
|
|
2203
2215
|
"rect",
|
|
2204
2216
|
{
|
|
2205
|
-
className:
|
|
2206
|
-
x:
|
|
2207
|
-
y,
|
|
2208
|
-
width:
|
|
2209
|
-
height:
|
|
2210
|
-
onMouseMove: (
|
|
2211
|
-
const
|
|
2217
|
+
className: w.interactionLayer,
|
|
2218
|
+
x: X,
|
|
2219
|
+
y: g,
|
|
2220
|
+
width: B,
|
|
2221
|
+
height: _,
|
|
2222
|
+
onMouseMove: (p) => {
|
|
2223
|
+
const x = p.currentTarget.getBoundingClientRect(), ee = p.clientX - x.left + X, P = Y.step(), G = Math.max(
|
|
2212
2224
|
0,
|
|
2213
|
-
Math.min(e.length - 1, Math.round((
|
|
2225
|
+
Math.min(e.length - 1, Math.round((ee - X - P / 2) / P))
|
|
2214
2226
|
);
|
|
2215
|
-
|
|
2227
|
+
H(G);
|
|
2216
2228
|
},
|
|
2217
|
-
onMouseLeave: () =>
|
|
2218
|
-
onClick:
|
|
2219
|
-
const
|
|
2229
|
+
onMouseLeave: () => H(null),
|
|
2230
|
+
onClick: y ? (p) => {
|
|
2231
|
+
const x = p.currentTarget.getBoundingClientRect(), ee = p.clientX - x.left + X, P = Y.step(), G = Math.max(
|
|
2220
2232
|
0,
|
|
2221
|
-
Math.min(e.length - 1, Math.round((
|
|
2222
|
-
),
|
|
2223
|
-
|
|
2233
|
+
Math.min(e.length - 1, Math.round((ee - X - P / 2) / P))
|
|
2234
|
+
), I = R[0], me = e[G][I], Q = typeof me == "number" ? me : 0;
|
|
2235
|
+
y({ row: e[G], value: Q, seriesKey: I, index: G });
|
|
2224
2236
|
} : void 0,
|
|
2225
|
-
style:
|
|
2237
|
+
style: y ? { cursor: "pointer" } : void 0
|
|
2226
2238
|
}
|
|
2227
2239
|
)
|
|
2228
2240
|
] });
|
|
@@ -2283,178 +2295,178 @@ function Fl({
|
|
|
2283
2295
|
showGrid: h = !0,
|
|
2284
2296
|
showXAxis: u = !0,
|
|
2285
2297
|
showYAxis: d = !0,
|
|
2286
|
-
showLegend:
|
|
2287
|
-
showTooltip:
|
|
2288
|
-
yTickCount:
|
|
2289
|
-
yFormat:
|
|
2290
|
-
xFormat:
|
|
2298
|
+
showLegend: f = !0,
|
|
2299
|
+
showTooltip: y = !0,
|
|
2300
|
+
yTickCount: L = 5,
|
|
2301
|
+
yFormat: v,
|
|
2302
|
+
xFormat: S,
|
|
2291
2303
|
valueFormat: N,
|
|
2292
|
-
renderTooltip:
|
|
2293
|
-
margin:
|
|
2294
|
-
emptyMessage:
|
|
2295
|
-
className:
|
|
2296
|
-
style:
|
|
2297
|
-
classes:
|
|
2304
|
+
renderTooltip: D,
|
|
2305
|
+
margin: j,
|
|
2306
|
+
emptyMessage: Z = "No data",
|
|
2307
|
+
className: U,
|
|
2308
|
+
style: C,
|
|
2309
|
+
classes: $
|
|
2298
2310
|
}) {
|
|
2299
|
-
const
|
|
2311
|
+
const oe = ke(
|
|
2300
2312
|
() => ({
|
|
2301
2313
|
...Oc,
|
|
2302
2314
|
...d ? {} : { left: 16 },
|
|
2303
|
-
...
|
|
2315
|
+
...j
|
|
2304
2316
|
}),
|
|
2305
|
-
[
|
|
2306
|
-
),
|
|
2317
|
+
[j, d]
|
|
2318
|
+
), ce = ke(() => Object.keys(n), [n]), q = i && ce.length > 0, ae = q && l === "expand", [R, te] = Le(null), H = re(null), O = Ye();
|
|
2307
2319
|
if (e.length === 0)
|
|
2308
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2309
|
-
const
|
|
2310
|
-
const
|
|
2311
|
-
for (let
|
|
2312
|
-
let
|
|
2313
|
-
if (
|
|
2314
|
-
for (const
|
|
2315
|
-
const
|
|
2316
|
-
typeof
|
|
2320
|
+
return /* @__PURE__ */ s("div", { ref: H, className: m(w.root, $?.root, U), style: C, children: /* @__PURE__ */ s("div", { className: w.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: w.empty, children: Z }) }) });
|
|
2321
|
+
const A = ke(() => {
|
|
2322
|
+
const X = ce.map(() => []), M = ce.map(() => []);
|
|
2323
|
+
for (let g = 0; g < e.length; g++) {
|
|
2324
|
+
let k = 0;
|
|
2325
|
+
if (ae) {
|
|
2326
|
+
for (const _ of ce) {
|
|
2327
|
+
const J = e[g][_];
|
|
2328
|
+
typeof J == "number" && J > 0 && (k += J);
|
|
2317
2329
|
}
|
|
2318
|
-
|
|
2330
|
+
k === 0 && (k = 1);
|
|
2319
2331
|
}
|
|
2320
|
-
let
|
|
2321
|
-
for (let
|
|
2322
|
-
const
|
|
2323
|
-
if (
|
|
2324
|
-
const
|
|
2325
|
-
M[
|
|
2332
|
+
let B = 0;
|
|
2333
|
+
for (let _ = 0; _ < ce.length; _++) {
|
|
2334
|
+
const J = ce[_], Y = e[g][J], b = typeof Y == "number" ? Y : 0;
|
|
2335
|
+
if (q) {
|
|
2336
|
+
const E = ae ? b / k : b;
|
|
2337
|
+
M[_][g] = B, B += E, X[_][g] = B;
|
|
2326
2338
|
} else
|
|
2327
|
-
M[
|
|
2339
|
+
M[_][g] = 0, X[_][g] = b;
|
|
2328
2340
|
}
|
|
2329
2341
|
}
|
|
2330
|
-
return { tops:
|
|
2331
|
-
}, [e,
|
|
2332
|
-
if (
|
|
2333
|
-
let
|
|
2334
|
-
for (const
|
|
2335
|
-
for (const
|
|
2336
|
-
|
|
2337
|
-
for (const
|
|
2338
|
-
for (const
|
|
2339
|
-
|
|
2340
|
-
return [Math.min(0,
|
|
2341
|
-
}, [
|
|
2342
|
+
return { tops: X, bottoms: M };
|
|
2343
|
+
}, [e, ce, q, ae]), { tops: F, bottoms: ne } = A, [pe, K] = ke(() => {
|
|
2344
|
+
if (ae) return [0, 1];
|
|
2345
|
+
let X = 0, M = 0;
|
|
2346
|
+
for (const g of F)
|
|
2347
|
+
for (const k of g)
|
|
2348
|
+
k < X && (X = k), k > M && (M = k);
|
|
2349
|
+
for (const g of ne)
|
|
2350
|
+
for (const k of g)
|
|
2351
|
+
k < X && (X = k);
|
|
2352
|
+
return [Math.min(0, X), M];
|
|
2353
|
+
}, [F, ne, ae]);
|
|
2342
2354
|
return /* @__PURE__ */ s(
|
|
2343
2355
|
Ve,
|
|
2344
2356
|
{
|
|
2345
|
-
ref:
|
|
2357
|
+
ref: H,
|
|
2346
2358
|
aspectRatio: r,
|
|
2347
2359
|
height: o,
|
|
2348
|
-
className:
|
|
2349
|
-
style:
|
|
2350
|
-
classes:
|
|
2351
|
-
legend:
|
|
2352
|
-
overlay:
|
|
2360
|
+
className: U,
|
|
2361
|
+
style: C,
|
|
2362
|
+
classes: $,
|
|
2363
|
+
legend: f ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
2364
|
+
overlay: y && R !== null ? /* @__PURE__ */ s(
|
|
2353
2365
|
et,
|
|
2354
2366
|
{
|
|
2355
|
-
row: e[
|
|
2356
|
-
x: zc(e, t,
|
|
2367
|
+
row: e[R],
|
|
2368
|
+
x: zc(e, t, oe, R, H),
|
|
2357
2369
|
y: 16,
|
|
2358
|
-
containerWidth:
|
|
2370
|
+
containerWidth: H.current?.getBoundingClientRect().width ?? 0,
|
|
2359
2371
|
config: n,
|
|
2360
|
-
render:
|
|
2361
|
-
valueFormat:
|
|
2372
|
+
render: D ? () => D(e[R]) : void 0,
|
|
2373
|
+
valueFormat: ae ? (X) => `${Math.round(X * 100)}%` : N,
|
|
2362
2374
|
titleKey: t,
|
|
2363
|
-
classes:
|
|
2375
|
+
classes: $
|
|
2364
2376
|
}
|
|
2365
2377
|
) : null,
|
|
2366
|
-
children: ({ width:
|
|
2367
|
-
const
|
|
2368
|
-
return /* @__PURE__ */
|
|
2369
|
-
a && /* @__PURE__ */ s("defs", { children:
|
|
2378
|
+
children: ({ width: X, height: M }) => {
|
|
2379
|
+
const g = oe.left, k = X - oe.right, B = oe.top, _ = M - oe.bottom, J = Math.max(0, k - g), Y = Math.max(0, _ - B), b = e.map((p) => String(p[t])), E = Xe(b, [g, k], 0), V = ae ? [0, 0.25, 0.5, 0.75, 1] : qe(pe, K, L), de = Je([V[0], V[V.length - 1]], [_, B]), he = de(0), ye = V.map((p) => ({ value: p, y: de(p) })), Ce = Fc(b).map((p) => ({ label: p, x: E(p) })), Se = ae ? (p) => `${Math.round(p * 100)}%` : v;
|
|
2380
|
+
return /* @__PURE__ */ z(je, { children: [
|
|
2381
|
+
a && /* @__PURE__ */ s("defs", { children: ce.map((p) => /* @__PURE__ */ z(
|
|
2370
2382
|
"linearGradient",
|
|
2371
2383
|
{
|
|
2372
|
-
id: `${
|
|
2384
|
+
id: `${O}-${p}`,
|
|
2373
2385
|
x1: "0",
|
|
2374
2386
|
y1: "0",
|
|
2375
2387
|
x2: "0",
|
|
2376
2388
|
y2: "1",
|
|
2377
2389
|
children: [
|
|
2378
|
-
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[
|
|
2379
|
-
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[
|
|
2390
|
+
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[p].color, stopOpacity: 0.6 }),
|
|
2391
|
+
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[p].color, stopOpacity: 0.05 })
|
|
2380
2392
|
]
|
|
2381
2393
|
},
|
|
2382
|
-
|
|
2394
|
+
p
|
|
2383
2395
|
)) }),
|
|
2384
2396
|
d ? /* @__PURE__ */ s(
|
|
2385
2397
|
nn,
|
|
2386
2398
|
{
|
|
2387
2399
|
ticks: ye,
|
|
2388
|
-
x:
|
|
2389
|
-
plotWidth:
|
|
2400
|
+
x: g,
|
|
2401
|
+
plotWidth: J,
|
|
2390
2402
|
format: Se,
|
|
2391
2403
|
showGrid: h,
|
|
2392
|
-
classes:
|
|
2404
|
+
classes: $
|
|
2393
2405
|
}
|
|
2394
|
-
) : h && /* @__PURE__ */ s("g", { className:
|
|
2406
|
+
) : h && /* @__PURE__ */ s("g", { className: m(w.axis, $?.axis), children: ye.map(({ value: p, y: x }) => /* @__PURE__ */ s(
|
|
2395
2407
|
"line",
|
|
2396
2408
|
{
|
|
2397
|
-
className:
|
|
2398
|
-
x1:
|
|
2399
|
-
x2:
|
|
2400
|
-
y1:
|
|
2401
|
-
y2:
|
|
2409
|
+
className: m(w.gridLine, $?.grid),
|
|
2410
|
+
x1: g,
|
|
2411
|
+
x2: k,
|
|
2412
|
+
y1: x,
|
|
2413
|
+
y2: x
|
|
2402
2414
|
},
|
|
2403
|
-
`grid-${
|
|
2415
|
+
`grid-${p}`
|
|
2404
2416
|
)) }),
|
|
2405
|
-
u && /* @__PURE__ */ s(rn, { ticks: Ce, y:
|
|
2406
|
-
|
|
2407
|
-
const
|
|
2408
|
-
x:
|
|
2409
|
-
y: de(
|
|
2410
|
-
})),
|
|
2411
|
-
return /* @__PURE__ */
|
|
2417
|
+
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format: S, classes: $ }),
|
|
2418
|
+
ce.map((p, x) => {
|
|
2419
|
+
const ee = n[p], P = e.map((Q, T) => ({
|
|
2420
|
+
x: E(b[T]),
|
|
2421
|
+
y: de(F[x][T])
|
|
2422
|
+
})), G = a ? `url(#${O}-${p})` : ee.color, I = a ? 1 : 0.18, me = q ? Dt(P, ne[x].map((Q) => de(Q)), c) : Dt(P, he, c);
|
|
2423
|
+
return /* @__PURE__ */ z("g", { className: m(w.series, $?.series), children: [
|
|
2412
2424
|
/* @__PURE__ */ s(
|
|
2413
2425
|
"path",
|
|
2414
2426
|
{
|
|
2415
|
-
className:
|
|
2427
|
+
className: w.areaPath,
|
|
2416
2428
|
d: me,
|
|
2417
|
-
fill:
|
|
2418
|
-
fillOpacity:
|
|
2429
|
+
fill: G,
|
|
2430
|
+
fillOpacity: I
|
|
2419
2431
|
}
|
|
2420
2432
|
),
|
|
2421
|
-
/* @__PURE__ */ s("path", { className:
|
|
2422
|
-
!
|
|
2433
|
+
/* @__PURE__ */ s("path", { className: w.linePath, d: St(P, c), stroke: ee.color }),
|
|
2434
|
+
!q && P.map((Q, T) => /* @__PURE__ */ s(
|
|
2423
2435
|
"circle",
|
|
2424
2436
|
{
|
|
2425
|
-
className:
|
|
2426
|
-
cx:
|
|
2427
|
-
cy:
|
|
2428
|
-
r:
|
|
2429
|
-
fill:
|
|
2437
|
+
className: m(w.point, $?.point),
|
|
2438
|
+
cx: Q.x,
|
|
2439
|
+
cy: Q.y,
|
|
2440
|
+
r: R === T ? 5 : 3,
|
|
2441
|
+
fill: ee.color
|
|
2430
2442
|
},
|
|
2431
|
-
`${
|
|
2443
|
+
`${p}-${T}`
|
|
2432
2444
|
))
|
|
2433
|
-
] },
|
|
2445
|
+
] }, p);
|
|
2434
2446
|
}),
|
|
2435
|
-
|
|
2447
|
+
R !== null && /* @__PURE__ */ s(
|
|
2436
2448
|
"line",
|
|
2437
2449
|
{
|
|
2438
|
-
className:
|
|
2439
|
-
x1:
|
|
2440
|
-
x2:
|
|
2441
|
-
y1:
|
|
2442
|
-
y2:
|
|
2450
|
+
className: w.cursorLine,
|
|
2451
|
+
x1: E(b[R]),
|
|
2452
|
+
x2: E(b[R]),
|
|
2453
|
+
y1: B,
|
|
2454
|
+
y2: _
|
|
2443
2455
|
}
|
|
2444
2456
|
),
|
|
2445
2457
|
/* @__PURE__ */ s(
|
|
2446
2458
|
"rect",
|
|
2447
2459
|
{
|
|
2448
|
-
className:
|
|
2449
|
-
x:
|
|
2450
|
-
y:
|
|
2451
|
-
width:
|
|
2452
|
-
height:
|
|
2453
|
-
onMouseMove: (
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2460
|
+
className: w.interactionLayer,
|
|
2461
|
+
x: g,
|
|
2462
|
+
y: B,
|
|
2463
|
+
width: J,
|
|
2464
|
+
height: Y,
|
|
2465
|
+
onMouseMove: (p) => {
|
|
2466
|
+
const x = p.currentTarget.getBoundingClientRect(), ee = p.clientX - x.left + g, P = E.step(), G = Math.max(0, Math.min(e.length - 1, Math.round((ee - g - P / 2) / P)));
|
|
2467
|
+
te(G);
|
|
2456
2468
|
},
|
|
2457
|
-
onMouseLeave: () =>
|
|
2469
|
+
onMouseLeave: () => te(null)
|
|
2458
2470
|
}
|
|
2459
2471
|
)
|
|
2460
2472
|
] });
|
|
@@ -2493,193 +2505,193 @@ function zl({
|
|
|
2493
2505
|
barRadius: h = 4,
|
|
2494
2506
|
showGrid: u = !0,
|
|
2495
2507
|
showLegend: d = !0,
|
|
2496
|
-
showTooltip:
|
|
2497
|
-
showValues:
|
|
2498
|
-
valuePosition:
|
|
2499
|
-
renderLabel:
|
|
2500
|
-
colorBy:
|
|
2508
|
+
showTooltip: f = !0,
|
|
2509
|
+
showValues: y = !1,
|
|
2510
|
+
valuePosition: L = "outside",
|
|
2511
|
+
renderLabel: v,
|
|
2512
|
+
colorBy: S = "series",
|
|
2501
2513
|
colors: N = jc,
|
|
2502
|
-
negativeColor:
|
|
2503
|
-
activeIndex:
|
|
2504
|
-
onBarClick:
|
|
2505
|
-
yTickCount:
|
|
2506
|
-
yFormat:
|
|
2507
|
-
xFormat:
|
|
2508
|
-
valueFormat:
|
|
2509
|
-
renderTooltip:
|
|
2510
|
-
margin:
|
|
2511
|
-
emptyMessage:
|
|
2512
|
-
className:
|
|
2513
|
-
style:
|
|
2514
|
-
classes:
|
|
2514
|
+
negativeColor: D,
|
|
2515
|
+
activeIndex: j,
|
|
2516
|
+
onBarClick: Z,
|
|
2517
|
+
yTickCount: U = 5,
|
|
2518
|
+
yFormat: C,
|
|
2519
|
+
xFormat: $,
|
|
2520
|
+
valueFormat: oe,
|
|
2521
|
+
renderTooltip: ce,
|
|
2522
|
+
margin: q,
|
|
2523
|
+
emptyMessage: ae = "No data",
|
|
2524
|
+
className: R,
|
|
2525
|
+
style: te,
|
|
2526
|
+
classes: H
|
|
2515
2527
|
}) {
|
|
2516
|
-
const
|
|
2528
|
+
const O = r === "horizontal", A = { ...O ? _c : Xc, ...q }, F = ke(() => Object.keys(n), [n]), ne = o && F.length > 1, [pe, K] = Le(null), X = re(null);
|
|
2517
2529
|
if (e.length === 0)
|
|
2518
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2519
|
-
const M = e.map((
|
|
2520
|
-
if (
|
|
2530
|
+
return /* @__PURE__ */ s("div", { ref: X, className: m(w.root, H?.root, R), style: te, children: /* @__PURE__ */ s("div", { className: w.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: w.empty, children: ae }) }) });
|
|
2531
|
+
const M = e.map((E) => String(E[t])), g = j ?? pe, k = ke(() => {
|
|
2532
|
+
if (ne) {
|
|
2521
2533
|
let he = 0, ye = 0;
|
|
2522
2534
|
for (const be of e) {
|
|
2523
2535
|
let Ce = 0, Se = 0;
|
|
2524
|
-
for (const
|
|
2525
|
-
const
|
|
2526
|
-
typeof
|
|
2536
|
+
for (const p of F) {
|
|
2537
|
+
const x = be[p];
|
|
2538
|
+
typeof x == "number" && (x >= 0 ? Ce += x : Se += x);
|
|
2527
2539
|
}
|
|
2528
2540
|
Ce > he && (he = Ce), Se < ye && (ye = Se);
|
|
2529
2541
|
}
|
|
2530
2542
|
return [ye, he];
|
|
2531
2543
|
}
|
|
2532
|
-
const
|
|
2544
|
+
const E = [];
|
|
2533
2545
|
for (const he of e)
|
|
2534
|
-
for (const ye of
|
|
2546
|
+
for (const ye of F) {
|
|
2535
2547
|
const be = he[ye];
|
|
2536
|
-
typeof be == "number" &&
|
|
2548
|
+
typeof be == "number" && E.push(be);
|
|
2537
2549
|
}
|
|
2538
|
-
const [
|
|
2539
|
-
return [Math.min(0,
|
|
2540
|
-
}, [e,
|
|
2550
|
+
const [V, de] = bt(E);
|
|
2551
|
+
return [Math.min(0, V), Math.max(0, de)];
|
|
2552
|
+
}, [e, F, ne]), B = qe(k[0], k[1], U), _ = B[0], J = B[B.length - 1], Y = (E, V) => S === "index" ? N[V % N.length] : n[E]?.color ?? N[0], b = f && g !== null && e[g] ? /* @__PURE__ */ s(
|
|
2541
2553
|
et,
|
|
2542
2554
|
{
|
|
2543
|
-
row: e[
|
|
2544
|
-
x: Vc(e, t,
|
|
2545
|
-
y:
|
|
2546
|
-
containerWidth:
|
|
2555
|
+
row: e[g],
|
|
2556
|
+
x: Vc(e, t, A, g, X, O, l),
|
|
2557
|
+
y: O ? qc(e, t, A, g, X, l) : 16,
|
|
2558
|
+
containerWidth: X.current?.getBoundingClientRect().width ?? 0,
|
|
2547
2559
|
config: n,
|
|
2548
|
-
render:
|
|
2549
|
-
valueFormat:
|
|
2560
|
+
render: ce ? () => ce(e[g]) : void 0,
|
|
2561
|
+
valueFormat: oe,
|
|
2550
2562
|
titleKey: t,
|
|
2551
|
-
resolveColor: (
|
|
2552
|
-
const
|
|
2553
|
-
return typeof
|
|
2563
|
+
resolveColor: (E) => {
|
|
2564
|
+
const V = e[g][E], de = Y(E, g);
|
|
2565
|
+
return typeof V != "number" ? de : D !== void 0 && V < 0 ? D : de;
|
|
2554
2566
|
},
|
|
2555
|
-
classes:
|
|
2567
|
+
classes: H
|
|
2556
2568
|
}
|
|
2557
2569
|
) : null;
|
|
2558
2570
|
return /* @__PURE__ */ s(
|
|
2559
2571
|
Ve,
|
|
2560
2572
|
{
|
|
2561
|
-
ref:
|
|
2573
|
+
ref: X,
|
|
2562
2574
|
aspectRatio: c,
|
|
2563
2575
|
height: i,
|
|
2564
|
-
className:
|
|
2565
|
-
style:
|
|
2566
|
-
classes:
|
|
2567
|
-
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes:
|
|
2568
|
-
overlay:
|
|
2569
|
-
children: ({ width:
|
|
2570
|
-
const de =
|
|
2571
|
-
value:
|
|
2572
|
-
pos:
|
|
2576
|
+
className: R,
|
|
2577
|
+
style: te,
|
|
2578
|
+
classes: H,
|
|
2579
|
+
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: H }) : void 0,
|
|
2580
|
+
overlay: b,
|
|
2581
|
+
children: ({ width: E, height: V }) => {
|
|
2582
|
+
const de = A.left, he = E - A.right, ye = A.top, be = V - A.bottom, Ce = Math.max(0, he - de), Se = Math.max(0, be - ye), x = Xe(M, O ? [ye, be] : [de, he], l), ee = x.bandWidth(), G = Je([_, J], O ? [de, he] : [be, ye]), I = G(0), me = ne ? 1 : Math.max(1, F.length), Q = ee / me, T = Q * (1 - a), le = B.map((ie) => ({
|
|
2583
|
+
value: ie,
|
|
2584
|
+
pos: G(ie)
|
|
2573
2585
|
})), ge = Uc(M);
|
|
2574
|
-
return /* @__PURE__ */
|
|
2575
|
-
u && /* @__PURE__ */ s("g", { className:
|
|
2576
|
-
({ value:
|
|
2586
|
+
return /* @__PURE__ */ z(je, { children: [
|
|
2587
|
+
u && /* @__PURE__ */ s("g", { className: m(w.axis, H?.axis), children: le.map(
|
|
2588
|
+
({ value: ie, pos: ue }) => O ? /* @__PURE__ */ s(
|
|
2577
2589
|
"line",
|
|
2578
2590
|
{
|
|
2579
|
-
className:
|
|
2591
|
+
className: m(w.gridLine, H?.grid),
|
|
2580
2592
|
x1: ue,
|
|
2581
2593
|
x2: ue,
|
|
2582
2594
|
y1: ye,
|
|
2583
2595
|
y2: be
|
|
2584
2596
|
},
|
|
2585
|
-
`g-${
|
|
2597
|
+
`g-${ie}`
|
|
2586
2598
|
) : /* @__PURE__ */ s(
|
|
2587
2599
|
"line",
|
|
2588
2600
|
{
|
|
2589
|
-
className:
|
|
2601
|
+
className: m(w.gridLine, H?.grid),
|
|
2590
2602
|
x1: de,
|
|
2591
2603
|
x2: he,
|
|
2592
2604
|
y1: ue,
|
|
2593
2605
|
y2: ue
|
|
2594
2606
|
},
|
|
2595
|
-
`g-${
|
|
2607
|
+
`g-${ie}`
|
|
2596
2608
|
)
|
|
2597
2609
|
) }),
|
|
2598
|
-
/* @__PURE__ */ s("g", { className:
|
|
2599
|
-
const Ae =
|
|
2600
|
-
return
|
|
2610
|
+
/* @__PURE__ */ s("g", { className: m(w.axis, H?.axis), children: le.map(({ value: ie, pos: ue }) => {
|
|
2611
|
+
const Ae = C ? C(ie) : String(ie);
|
|
2612
|
+
return O ? /* @__PURE__ */ s(
|
|
2601
2613
|
"text",
|
|
2602
2614
|
{
|
|
2603
|
-
className:
|
|
2615
|
+
className: m(w.axisLabel, H?.axisLabel),
|
|
2604
2616
|
x: ue,
|
|
2605
2617
|
y: be + 16,
|
|
2606
2618
|
textAnchor: "middle",
|
|
2607
2619
|
children: Ae
|
|
2608
2620
|
},
|
|
2609
|
-
`vt-${
|
|
2621
|
+
`vt-${ie}`
|
|
2610
2622
|
) : /* @__PURE__ */ s(
|
|
2611
2623
|
"text",
|
|
2612
2624
|
{
|
|
2613
|
-
className:
|
|
2625
|
+
className: m(w.axisLabel, H?.axisLabel),
|
|
2614
2626
|
x: de - 8,
|
|
2615
2627
|
y: ue,
|
|
2616
2628
|
textAnchor: "end",
|
|
2617
2629
|
dominantBaseline: "middle",
|
|
2618
2630
|
children: Ae
|
|
2619
2631
|
},
|
|
2620
|
-
`vt-${
|
|
2632
|
+
`vt-${ie}`
|
|
2621
2633
|
);
|
|
2622
2634
|
}) }),
|
|
2623
|
-
/* @__PURE__ */ s("g", { className:
|
|
2624
|
-
const ue =
|
|
2625
|
-
return
|
|
2635
|
+
/* @__PURE__ */ s("g", { className: m(w.axis, H?.axis), children: ge.map((ie) => {
|
|
2636
|
+
const ue = x(ie), Ae = $ ? $(ie) : ie;
|
|
2637
|
+
return O ? /* @__PURE__ */ s(
|
|
2626
2638
|
"text",
|
|
2627
2639
|
{
|
|
2628
|
-
className:
|
|
2640
|
+
className: m(w.axisLabel, H?.axisLabel),
|
|
2629
2641
|
x: de - 8,
|
|
2630
2642
|
y: ue,
|
|
2631
2643
|
textAnchor: "end",
|
|
2632
2644
|
dominantBaseline: "middle",
|
|
2633
2645
|
children: Ae
|
|
2634
2646
|
},
|
|
2635
|
-
`c-${
|
|
2647
|
+
`c-${ie}`
|
|
2636
2648
|
) : /* @__PURE__ */ s(
|
|
2637
2649
|
"text",
|
|
2638
2650
|
{
|
|
2639
|
-
className:
|
|
2651
|
+
className: m(w.axisLabel, H?.axisLabel),
|
|
2640
2652
|
x: ue,
|
|
2641
2653
|
y: be + 16,
|
|
2642
2654
|
textAnchor: "middle",
|
|
2643
2655
|
children: Ae
|
|
2644
2656
|
},
|
|
2645
|
-
`c-${
|
|
2657
|
+
`c-${ie}`
|
|
2646
2658
|
);
|
|
2647
2659
|
}) }),
|
|
2648
|
-
e.map((
|
|
2649
|
-
const De =
|
|
2650
|
-
let xe = 0,
|
|
2651
|
-
return /* @__PURE__ */ s("g", { className:
|
|
2652
|
-
const Ge =
|
|
2660
|
+
e.map((ie, ue) => {
|
|
2661
|
+
const De = x(M[ue]) - ee / 2;
|
|
2662
|
+
let xe = 0, se = 0;
|
|
2663
|
+
return /* @__PURE__ */ s("g", { className: m(w.series, H?.series), children: F.map((Ie, He) => {
|
|
2664
|
+
const Ge = ie[Ie];
|
|
2653
2665
|
if (typeof Ge != "number") return null;
|
|
2654
|
-
const Ee = Ge, xt =
|
|
2666
|
+
const Ee = Ge, xt = Y(Ie, ue), kt = D !== void 0 && Ee < 0 ? D : xt, Oe = j !== void 0 ? j === ue : pe === ue, tt = j !== void 0 && !Oe;
|
|
2655
2667
|
let nt, _e;
|
|
2656
|
-
|
|
2657
|
-
const rt =
|
|
2668
|
+
ne ? Ee >= 0 ? (nt = xe, _e = xe + Ee, xe = _e) : (nt = se, _e = se + Ee, se = _e) : (nt = 0, _e = Ee);
|
|
2669
|
+
const rt = G(nt), ot = G(_e), Bt = ne ? (ee - T) / 2 : He * Q + (Q - T) / 2;
|
|
2658
2670
|
let it = 0, ct = 0, lt = 0, st = 0;
|
|
2659
|
-
if (
|
|
2660
|
-
const Ze = Math.min(rt, ot),
|
|
2661
|
-
it = Ze, lt =
|
|
2671
|
+
if (O) {
|
|
2672
|
+
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2673
|
+
it = Ze, lt = wt - Ze, ct = De + Bt, st = T;
|
|
2662
2674
|
} else {
|
|
2663
|
-
const Ze = Math.min(rt, ot),
|
|
2664
|
-
it = De + Bt, lt =
|
|
2675
|
+
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2676
|
+
it = De + Bt, lt = T, ct = Ze, st = wt - Ze;
|
|
2665
2677
|
}
|
|
2666
|
-
const
|
|
2667
|
-
isHorizontal:
|
|
2668
|
-
valuePosition:
|
|
2678
|
+
const Mt = v ? v({ row: ie, value: Ee, seriesKey: Ie, index: ue }) : y ? oe ? oe(Ee) : String(Ee) : null, Fe = Yc({
|
|
2679
|
+
isHorizontal: O,
|
|
2680
|
+
valuePosition: L,
|
|
2669
2681
|
x: it,
|
|
2670
2682
|
y: ct,
|
|
2671
2683
|
rectW: lt,
|
|
2672
2684
|
rectH: st,
|
|
2673
2685
|
value: Ee
|
|
2674
2686
|
});
|
|
2675
|
-
return /* @__PURE__ */
|
|
2687
|
+
return /* @__PURE__ */ z("g", { children: [
|
|
2676
2688
|
/* @__PURE__ */ s(
|
|
2677
2689
|
"rect",
|
|
2678
2690
|
{
|
|
2679
|
-
className:
|
|
2680
|
-
|
|
2681
|
-
Oe &&
|
|
2682
|
-
|
|
2691
|
+
className: m(
|
|
2692
|
+
w.bar,
|
|
2693
|
+
Oe && w.activeBar,
|
|
2694
|
+
H?.point
|
|
2683
2695
|
),
|
|
2684
2696
|
x: it,
|
|
2685
2697
|
y: ct,
|
|
@@ -2689,16 +2701,16 @@ function zl({
|
|
|
2689
2701
|
ry: h,
|
|
2690
2702
|
fill: kt,
|
|
2691
2703
|
opacity: tt ? 0.35 : 1,
|
|
2692
|
-
onClick:
|
|
2693
|
-
style:
|
|
2704
|
+
onClick: Z ? () => Z({ row: ie, value: Ee, seriesKey: Ie, index: ue }) : void 0,
|
|
2705
|
+
style: Z ? { cursor: "pointer" } : void 0
|
|
2694
2706
|
}
|
|
2695
2707
|
),
|
|
2696
|
-
|
|
2708
|
+
Mt != null && /* @__PURE__ */ s(
|
|
2697
2709
|
"text",
|
|
2698
2710
|
{
|
|
2699
|
-
className:
|
|
2700
|
-
|
|
2701
|
-
(
|
|
2711
|
+
className: m(
|
|
2712
|
+
w.axisLabel,
|
|
2713
|
+
(L === "inside" || L === "inside-start") && w.barLabelInside
|
|
2702
2714
|
),
|
|
2703
2715
|
x: Fe.x,
|
|
2704
2716
|
y: Fe.y,
|
|
@@ -2706,39 +2718,39 @@ function zl({
|
|
|
2706
2718
|
dominantBaseline: Fe.dominantBaseline,
|
|
2707
2719
|
transform: Fe.rotate ? `rotate(${Fe.rotate} ${Fe.x} ${Fe.y})` : void 0,
|
|
2708
2720
|
opacity: tt ? 0.5 : 1,
|
|
2709
|
-
children:
|
|
2721
|
+
children: Mt
|
|
2710
2722
|
}
|
|
2711
2723
|
)
|
|
2712
2724
|
] }, Ie);
|
|
2713
2725
|
}) }, `group-${ue}`);
|
|
2714
2726
|
}),
|
|
2715
|
-
|
|
2727
|
+
_ < 0 && J > 0 && /* @__PURE__ */ s(
|
|
2716
2728
|
"line",
|
|
2717
2729
|
{
|
|
2718
|
-
className:
|
|
2719
|
-
x1:
|
|
2720
|
-
x2:
|
|
2721
|
-
y1:
|
|
2722
|
-
y2:
|
|
2730
|
+
className: m(w.gridLine),
|
|
2731
|
+
x1: O ? I : de,
|
|
2732
|
+
x2: O ? I : he,
|
|
2733
|
+
y1: O ? ye : I,
|
|
2734
|
+
y2: O ? be : I,
|
|
2723
2735
|
opacity: 0.9
|
|
2724
2736
|
}
|
|
2725
2737
|
),
|
|
2726
2738
|
/* @__PURE__ */ s(
|
|
2727
2739
|
"rect",
|
|
2728
2740
|
{
|
|
2729
|
-
className:
|
|
2741
|
+
className: w.interactionLayer,
|
|
2730
2742
|
x: de,
|
|
2731
2743
|
y: ye,
|
|
2732
2744
|
width: Ce,
|
|
2733
2745
|
height: Se,
|
|
2734
|
-
onMouseMove: (
|
|
2735
|
-
const ue =
|
|
2746
|
+
onMouseMove: (ie) => {
|
|
2747
|
+
const ue = ie.currentTarget.getBoundingClientRect(), Ae = ie.clientX - ue.left + de, De = ie.clientY - ue.top + ye, xe = x.step(), se = O ? De - ye : Ae - de, Ie = Math.max(
|
|
2736
2748
|
0,
|
|
2737
|
-
Math.min(e.length - 1, Math.round((
|
|
2749
|
+
Math.min(e.length - 1, Math.round((se - xe / 2) / xe))
|
|
2738
2750
|
);
|
|
2739
|
-
|
|
2751
|
+
K(Ie);
|
|
2740
2752
|
},
|
|
2741
|
-
onMouseLeave: () =>
|
|
2753
|
+
onMouseLeave: () => K(null)
|
|
2742
2754
|
}
|
|
2743
2755
|
)
|
|
2744
2756
|
] });
|
|
@@ -2838,21 +2850,21 @@ function Zc(e, t, n, r, o, c) {
|
|
|
2838
2850
|
`A ${n} ${n} 0 1 1 ${e + n} ${t}`,
|
|
2839
2851
|
"Z"
|
|
2840
2852
|
].join(" ");
|
|
2841
|
-
const i = (o - 90) * Math.PI / 180, l = (c - 90) * Math.PI / 180, a = c - o > 180 ? 1 : 0, h = e + n * Math.cos(i), u = t + n * Math.sin(i), d = e + n * Math.cos(l),
|
|
2853
|
+
const i = (o - 90) * Math.PI / 180, l = (c - 90) * Math.PI / 180, a = c - o > 180 ? 1 : 0, h = e + n * Math.cos(i), u = t + n * Math.sin(i), d = e + n * Math.cos(l), f = t + n * Math.sin(l);
|
|
2842
2854
|
if (r > 0) {
|
|
2843
|
-
const
|
|
2855
|
+
const y = e + r * Math.cos(l), L = t + r * Math.sin(l), v = e + r * Math.cos(i), S = t + r * Math.sin(i);
|
|
2844
2856
|
return [
|
|
2845
2857
|
`M ${h} ${u}`,
|
|
2846
|
-
`A ${n} ${n} 0 ${a} 1 ${d} ${
|
|
2847
|
-
`L ${
|
|
2848
|
-
`A ${r} ${r} 0 ${a} 0 ${
|
|
2858
|
+
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2859
|
+
`L ${y} ${L}`,
|
|
2860
|
+
`A ${r} ${r} 0 ${a} 0 ${v} ${S}`,
|
|
2849
2861
|
"Z"
|
|
2850
2862
|
].join(" ");
|
|
2851
2863
|
}
|
|
2852
2864
|
return [
|
|
2853
2865
|
`M ${e} ${t}`,
|
|
2854
2866
|
`L ${h} ${u}`,
|
|
2855
|
-
`A ${n} ${n} 0 ${a} 1 ${d} ${
|
|
2867
|
+
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2856
2868
|
"Z"
|
|
2857
2869
|
].join(" ");
|
|
2858
2870
|
}
|
|
@@ -2873,96 +2885,96 @@ function jl({
|
|
|
2873
2885
|
strokeWidth: h = 2,
|
|
2874
2886
|
strokeColor: u = "var(--crk-color-bg)",
|
|
2875
2887
|
padAngle: d = 0,
|
|
2876
|
-
showLabels:
|
|
2877
|
-
valuePosition:
|
|
2878
|
-
showLabelLines:
|
|
2879
|
-
renderLabel:
|
|
2880
|
-
centerLabel:
|
|
2888
|
+
showLabels: f = !1,
|
|
2889
|
+
valuePosition: y = "outside",
|
|
2890
|
+
showLabelLines: L = !0,
|
|
2891
|
+
renderLabel: v,
|
|
2892
|
+
centerLabel: S,
|
|
2881
2893
|
activeIndex: N,
|
|
2882
|
-
onSliceClick:
|
|
2883
|
-
showLegend:
|
|
2884
|
-
showTooltip:
|
|
2885
|
-
valueFormat:
|
|
2886
|
-
renderTooltip:
|
|
2887
|
-
emptyMessage:
|
|
2888
|
-
className:
|
|
2889
|
-
style:
|
|
2890
|
-
classes:
|
|
2894
|
+
onSliceClick: D,
|
|
2895
|
+
showLegend: j = !0,
|
|
2896
|
+
showTooltip: Z = !0,
|
|
2897
|
+
valueFormat: U,
|
|
2898
|
+
renderTooltip: C,
|
|
2899
|
+
emptyMessage: $ = "No data",
|
|
2900
|
+
className: oe,
|
|
2901
|
+
style: ce,
|
|
2902
|
+
classes: q
|
|
2891
2903
|
}) {
|
|
2892
|
-
const [
|
|
2904
|
+
const [ae, R] = Le(null), te = re(null), H = N ?? ae, O = (K) => {
|
|
2893
2905
|
if (r) {
|
|
2894
|
-
const
|
|
2895
|
-
if (typeof
|
|
2906
|
+
const X = e[K]?.[r];
|
|
2907
|
+
if (typeof X == "string") return X;
|
|
2896
2908
|
}
|
|
2897
|
-
return o[
|
|
2898
|
-
},
|
|
2899
|
-
let
|
|
2900
|
-
for (const
|
|
2901
|
-
const M =
|
|
2902
|
-
typeof M == "number" && M > 0 && (
|
|
2909
|
+
return o[K % o.length];
|
|
2910
|
+
}, A = ke(() => {
|
|
2911
|
+
let K = 0;
|
|
2912
|
+
for (const X of e) {
|
|
2913
|
+
const M = X[t];
|
|
2914
|
+
typeof M == "number" && M > 0 && (K += M);
|
|
2903
2915
|
}
|
|
2904
|
-
return
|
|
2916
|
+
return K;
|
|
2905
2917
|
}, [e, t]);
|
|
2906
|
-
if (e.length === 0 ||
|
|
2907
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2908
|
-
const
|
|
2909
|
-
const
|
|
2910
|
-
let
|
|
2918
|
+
if (e.length === 0 || A === 0)
|
|
2919
|
+
return /* @__PURE__ */ s("div", { ref: te, className: m(w.root, q?.root, oe), style: ce, children: /* @__PURE__ */ s("div", { className: w.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: w.empty, children: $ }) }) });
|
|
2920
|
+
const F = ke(() => {
|
|
2921
|
+
const K = [];
|
|
2922
|
+
let X = 0;
|
|
2911
2923
|
for (let M = 0; M < e.length; M++) {
|
|
2912
|
-
const
|
|
2913
|
-
if (
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2924
|
+
const g = e[M], k = g[t], B = typeof k == "number" && k > 0 ? k : 0;
|
|
2925
|
+
if (B === 0) continue;
|
|
2926
|
+
const _ = B / A, J = _ * 360;
|
|
2927
|
+
K.push({ index: M, row: g, value: B, start: X, end: X + J, fraction: _ }), X += J;
|
|
2916
2928
|
}
|
|
2917
|
-
return
|
|
2918
|
-
}, [e, t,
|
|
2929
|
+
return K;
|
|
2930
|
+
}, [e, t, A]), ne = j ? /* @__PURE__ */ s("div", { className: m(w.legend, q?.legend), role: "list", children: F.map((K) => /* @__PURE__ */ z("div", { className: m(w.legendItem, q?.legendItem), role: "listitem", children: [
|
|
2919
2931
|
/* @__PURE__ */ s(
|
|
2920
2932
|
"span",
|
|
2921
2933
|
{
|
|
2922
|
-
className:
|
|
2923
|
-
style: { background:
|
|
2934
|
+
className: w.legendSwatch,
|
|
2935
|
+
style: { background: O(K.index) },
|
|
2924
2936
|
"aria-hidden": "true"
|
|
2925
2937
|
}
|
|
2926
2938
|
),
|
|
2927
|
-
/* @__PURE__ */ s("span", { className:
|
|
2928
|
-
] },
|
|
2929
|
-
const
|
|
2930
|
-
for (const
|
|
2931
|
-
|
|
2932
|
-
label: String(
|
|
2933
|
-
color:
|
|
2939
|
+
/* @__PURE__ */ s("span", { className: w.legendLabel, children: String(K.row[n]) })
|
|
2940
|
+
] }, K.index)) }) : void 0, pe = ke(() => {
|
|
2941
|
+
const K = {};
|
|
2942
|
+
for (const X of F)
|
|
2943
|
+
K[X.index.toString()] = {
|
|
2944
|
+
label: String(X.row[n]),
|
|
2945
|
+
color: O(X.index)
|
|
2934
2946
|
};
|
|
2935
|
-
return
|
|
2936
|
-
}, [
|
|
2947
|
+
return K;
|
|
2948
|
+
}, [F]);
|
|
2937
2949
|
return /* @__PURE__ */ s(
|
|
2938
2950
|
Ve,
|
|
2939
2951
|
{
|
|
2940
|
-
ref:
|
|
2952
|
+
ref: te,
|
|
2941
2953
|
aspectRatio: c,
|
|
2942
2954
|
height: i,
|
|
2943
|
-
className:
|
|
2944
|
-
style:
|
|
2945
|
-
classes:
|
|
2946
|
-
legend:
|
|
2947
|
-
overlay:
|
|
2955
|
+
className: oe,
|
|
2956
|
+
style: ce,
|
|
2957
|
+
classes: q,
|
|
2958
|
+
legend: ne,
|
|
2959
|
+
overlay: Z && H !== null && e[H] ? /* @__PURE__ */ s(
|
|
2948
2960
|
et,
|
|
2949
2961
|
{
|
|
2950
|
-
row: { [
|
|
2951
|
-
x:
|
|
2962
|
+
row: { [H.toString()]: e[H][t] },
|
|
2963
|
+
x: te.current ? te.current.getBoundingClientRect().width / 2 : 0,
|
|
2952
2964
|
y: 16,
|
|
2953
|
-
containerWidth:
|
|
2954
|
-
config: { [
|
|
2955
|
-
render:
|
|
2956
|
-
valueFormat:
|
|
2965
|
+
containerWidth: te.current?.getBoundingClientRect().width ?? 0,
|
|
2966
|
+
config: { [H.toString()]: pe[H.toString()] },
|
|
2967
|
+
render: C ? () => C(e[H]) : void 0,
|
|
2968
|
+
valueFormat: U,
|
|
2957
2969
|
titleKey: void 0,
|
|
2958
|
-
classes:
|
|
2970
|
+
classes: q
|
|
2959
2971
|
}
|
|
2960
2972
|
) : null,
|
|
2961
|
-
children: ({ width:
|
|
2962
|
-
const M =
|
|
2963
|
-
return /* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */ s("g", { children:
|
|
2965
|
-
const
|
|
2973
|
+
children: ({ width: K, height: X }) => {
|
|
2974
|
+
const M = K / 2, g = X / 2, k = Math.min(K, X) / 2 - 4, B = Et(a, k), _ = Math.min(B - 1, Et(l, k)), J = Math.max(4, B * 0.06);
|
|
2975
|
+
return /* @__PURE__ */ z(je, { children: [
|
|
2976
|
+
/* @__PURE__ */ s("g", { children: F.map((Y) => {
|
|
2977
|
+
const b = d / 2, E = Math.min(Y.end, Y.start + b), V = Math.max(Y.start, Y.end - b), de = O(Y.index), he = H === Y.index, ye = N !== void 0 && !he, be = he && N !== void 0 ? B + J : B, Ce = Zc(M, g, be, _, E, V), Se = D ? () => D({ row: Y.row, value: Y.value, index: Y.index }) : void 0;
|
|
2966
2978
|
return /* @__PURE__ */ s(
|
|
2967
2979
|
"path",
|
|
2968
2980
|
{
|
|
@@ -2971,24 +2983,24 @@ function jl({
|
|
|
2971
2983
|
stroke: h > 0 ? u : "none",
|
|
2972
2984
|
strokeWidth: h,
|
|
2973
2985
|
opacity: ye ? 0.45 : 1,
|
|
2974
|
-
onMouseEnter: () =>
|
|
2975
|
-
onMouseLeave: () =>
|
|
2986
|
+
onMouseEnter: () => R(Y.index),
|
|
2987
|
+
onMouseLeave: () => R(null),
|
|
2976
2988
|
onClick: Se,
|
|
2977
2989
|
style: Se ? { cursor: "pointer" } : void 0
|
|
2978
2990
|
},
|
|
2979
|
-
|
|
2991
|
+
Y.index
|
|
2980
2992
|
);
|
|
2981
2993
|
}) }),
|
|
2982
|
-
(
|
|
2983
|
-
const
|
|
2984
|
-
if (
|
|
2985
|
-
const
|
|
2994
|
+
(f || v) && F.map((Y) => {
|
|
2995
|
+
const b = v ? v({ row: Y.row, value: Y.value, fraction: Y.fraction, index: Y.index }) : f ? `${String(Y.row[n])} ${U ? U(Y.value) : Math.round(Y.fraction * 100) + "%"}` : null;
|
|
2996
|
+
if (b == null) return null;
|
|
2997
|
+
const E = y === "inside", V = Math.max(16, B * 0.12), de = E ? (B + _) / 2 : B + V, he = Pt(M, g, de, Y.start, Y.end), ye = E ? "middle" : he.x < M - 1 ? "end" : he.x > M + 1 ? "start" : "middle";
|
|
2986
2998
|
let be = null;
|
|
2987
|
-
if (!
|
|
2988
|
-
const Ce = Pt(M,
|
|
2989
|
-
be = { x1: Ce.x, y1: Ce.y, x2: he.x +
|
|
2999
|
+
if (!E && L) {
|
|
3000
|
+
const Ce = Pt(M, g, B, Y.start, Y.end), Se = 4, p = ye === "end" ? Se : ye === "start" ? -Se : 0;
|
|
3001
|
+
be = { x1: Ce.x, y1: Ce.y, x2: he.x + p, y2: he.y };
|
|
2990
3002
|
}
|
|
2991
|
-
return /* @__PURE__ */
|
|
3003
|
+
return /* @__PURE__ */ z("g", { children: [
|
|
2992
3004
|
be && /* @__PURE__ */ s(
|
|
2993
3005
|
"line",
|
|
2994
3006
|
{
|
|
@@ -2996,7 +3008,7 @@ function jl({
|
|
|
2996
3008
|
y1: be.y1,
|
|
2997
3009
|
x2: be.x2,
|
|
2998
3010
|
y2: be.y2,
|
|
2999
|
-
stroke: Y
|
|
3011
|
+
stroke: O(Y.index),
|
|
3000
3012
|
strokeWidth: 1,
|
|
3001
3013
|
opacity: 0.7
|
|
3002
3014
|
}
|
|
@@ -3006,24 +3018,24 @@ function jl({
|
|
|
3006
3018
|
{
|
|
3007
3019
|
x: he.x,
|
|
3008
3020
|
y: he.y,
|
|
3009
|
-
className:
|
|
3010
|
-
|
|
3011
|
-
|
|
3021
|
+
className: m(
|
|
3022
|
+
w.axisLabel,
|
|
3023
|
+
E && w.barLabelInside
|
|
3012
3024
|
),
|
|
3013
3025
|
textAnchor: ye,
|
|
3014
3026
|
dominantBaseline: "middle",
|
|
3015
|
-
children:
|
|
3027
|
+
children: b
|
|
3016
3028
|
}
|
|
3017
3029
|
)
|
|
3018
|
-
] }, `label-${
|
|
3030
|
+
] }, `label-${Y.index}`);
|
|
3019
3031
|
}),
|
|
3020
|
-
|
|
3032
|
+
S !== void 0 && /* @__PURE__ */ s(
|
|
3021
3033
|
"foreignObject",
|
|
3022
3034
|
{
|
|
3023
|
-
x: M -
|
|
3024
|
-
y:
|
|
3025
|
-
width: Math.max(0,
|
|
3026
|
-
height: Math.max(0,
|
|
3035
|
+
x: M - _,
|
|
3036
|
+
y: g - _,
|
|
3037
|
+
width: Math.max(0, _ * 2),
|
|
3038
|
+
height: Math.max(0, _ * 2),
|
|
3027
3039
|
style: { pointerEvents: "none" },
|
|
3028
3040
|
children: /* @__PURE__ */ s(
|
|
3029
3041
|
"div",
|
|
@@ -3039,7 +3051,7 @@ function jl({
|
|
|
3039
3051
|
color: "var(--crk-color-text)",
|
|
3040
3052
|
fontFamily: "var(--crk-font-family)"
|
|
3041
3053
|
},
|
|
3042
|
-
children:
|
|
3054
|
+
children: S
|
|
3043
3055
|
}
|
|
3044
3056
|
)
|
|
3045
3057
|
}
|
|
@@ -3072,186 +3084,186 @@ function Xl({
|
|
|
3072
3084
|
showRadiusAxis: h = !1,
|
|
3073
3085
|
levels: u = 5,
|
|
3074
3086
|
showPoints: d = !0,
|
|
3075
|
-
fillOpacity:
|
|
3076
|
-
strokeWidth:
|
|
3077
|
-
renderAxisLabel:
|
|
3078
|
-
axisFormat:
|
|
3079
|
-
valueFormat:
|
|
3087
|
+
fillOpacity: f = 0.4,
|
|
3088
|
+
strokeWidth: y = 2,
|
|
3089
|
+
renderAxisLabel: L,
|
|
3090
|
+
axisFormat: v,
|
|
3091
|
+
valueFormat: S,
|
|
3080
3092
|
renderTooltip: N,
|
|
3081
|
-
showLegend:
|
|
3082
|
-
showTooltip:
|
|
3083
|
-
emptyMessage:
|
|
3084
|
-
className:
|
|
3085
|
-
style:
|
|
3086
|
-
classes:
|
|
3093
|
+
showLegend: D = !0,
|
|
3094
|
+
showTooltip: j = !0,
|
|
3095
|
+
emptyMessage: Z = "No data",
|
|
3096
|
+
className: U,
|
|
3097
|
+
style: C,
|
|
3098
|
+
classes: $
|
|
3087
3099
|
}) {
|
|
3088
|
-
const [
|
|
3100
|
+
const [oe, ce] = Le(null), q = re(null), ae = ke(() => Object.keys(n), [n]);
|
|
3089
3101
|
if (e.length === 0)
|
|
3090
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
3091
|
-
const
|
|
3092
|
-
() => e.map((
|
|
3102
|
+
return /* @__PURE__ */ s("div", { ref: q, className: m(w.root, $?.root, U), style: C, children: /* @__PURE__ */ s("div", { className: w.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: w.empty, children: Z }) }) });
|
|
3103
|
+
const R = ke(
|
|
3104
|
+
() => e.map((A, F) => F / e.length * 360),
|
|
3093
3105
|
[e]
|
|
3094
|
-
),
|
|
3095
|
-
const
|
|
3096
|
-
for (const
|
|
3106
|
+
), te = ke(() => {
|
|
3107
|
+
const A = [];
|
|
3108
|
+
for (const ne of ae)
|
|
3097
3109
|
for (const pe of e) {
|
|
3098
|
-
const
|
|
3099
|
-
typeof
|
|
3110
|
+
const K = pe[ne];
|
|
3111
|
+
typeof K == "number" && A.push(K);
|
|
3100
3112
|
}
|
|
3101
|
-
const [,
|
|
3102
|
-
return Math.max(1,
|
|
3103
|
-
}, [e,
|
|
3113
|
+
const [, F] = bt(A);
|
|
3114
|
+
return Math.max(1, F);
|
|
3115
|
+
}, [e, ae]), H = ke(() => qe(0, te, u).filter((F) => F > 0), [te, u]), O = H[H.length - 1] ?? te;
|
|
3104
3116
|
return /* @__PURE__ */ s(
|
|
3105
3117
|
Ve,
|
|
3106
3118
|
{
|
|
3107
|
-
ref:
|
|
3119
|
+
ref: q,
|
|
3108
3120
|
aspectRatio: r,
|
|
3109
3121
|
height: o,
|
|
3110
|
-
className:
|
|
3111
|
-
style:
|
|
3112
|
-
classes:
|
|
3113
|
-
legend:
|
|
3114
|
-
overlay:
|
|
3122
|
+
className: U,
|
|
3123
|
+
style: C,
|
|
3124
|
+
classes: $,
|
|
3125
|
+
legend: D ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
3126
|
+
overlay: j && oe !== null ? /* @__PURE__ */ s(
|
|
3115
3127
|
et,
|
|
3116
3128
|
{
|
|
3117
|
-
row: e[
|
|
3118
|
-
x: (
|
|
3129
|
+
row: e[oe],
|
|
3130
|
+
x: (q.current?.getBoundingClientRect().width ?? 0) / 2,
|
|
3119
3131
|
y: 16,
|
|
3120
|
-
containerWidth:
|
|
3132
|
+
containerWidth: q.current?.getBoundingClientRect().width ?? 0,
|
|
3121
3133
|
config: n,
|
|
3122
|
-
render: N ? () => N(e[
|
|
3123
|
-
valueFormat:
|
|
3134
|
+
render: N ? () => N(e[oe]) : void 0,
|
|
3135
|
+
valueFormat: S,
|
|
3124
3136
|
titleKey: t,
|
|
3125
|
-
classes:
|
|
3137
|
+
classes: $
|
|
3126
3138
|
}
|
|
3127
3139
|
) : null,
|
|
3128
|
-
children: ({ width:
|
|
3129
|
-
const
|
|
3130
|
-
return /* @__PURE__ */
|
|
3131
|
-
i &&
|
|
3132
|
-
const
|
|
3140
|
+
children: ({ width: A, height: F }) => {
|
|
3141
|
+
const ne = a ? 32 : 8, pe = A / 2, K = F / 2, X = Math.max(0, Math.min(A, F) / 2 - ne), M = (g) => Math.max(0, g) / O * X;
|
|
3142
|
+
return /* @__PURE__ */ z(je, { children: [
|
|
3143
|
+
i && H.map((g) => {
|
|
3144
|
+
const k = M(g);
|
|
3133
3145
|
return c === "circle" ? /* @__PURE__ */ s(
|
|
3134
3146
|
"circle",
|
|
3135
3147
|
{
|
|
3136
|
-
className:
|
|
3148
|
+
className: m(w.gridLine, $?.grid),
|
|
3137
3149
|
cx: pe,
|
|
3138
|
-
cy:
|
|
3139
|
-
r:
|
|
3150
|
+
cy: K,
|
|
3151
|
+
r: k,
|
|
3140
3152
|
fill: "none"
|
|
3141
3153
|
},
|
|
3142
|
-
`ring-${
|
|
3154
|
+
`ring-${g}`
|
|
3143
3155
|
) : /* @__PURE__ */ s(
|
|
3144
3156
|
"polygon",
|
|
3145
3157
|
{
|
|
3146
|
-
className:
|
|
3147
|
-
points: Kc(pe,
|
|
3158
|
+
className: m(w.gridLine, $?.grid),
|
|
3159
|
+
points: Kc(pe, K, k, R),
|
|
3148
3160
|
fill: "none"
|
|
3149
3161
|
},
|
|
3150
|
-
`ring-${
|
|
3162
|
+
`ring-${g}`
|
|
3151
3163
|
);
|
|
3152
3164
|
}),
|
|
3153
|
-
l &&
|
|
3154
|
-
const
|
|
3165
|
+
l && R.map((g, k) => {
|
|
3166
|
+
const B = mt(pe, K, X, g);
|
|
3155
3167
|
return /* @__PURE__ */ s(
|
|
3156
3168
|
"line",
|
|
3157
3169
|
{
|
|
3158
|
-
className:
|
|
3170
|
+
className: m(w.gridLine, $?.grid),
|
|
3159
3171
|
x1: pe,
|
|
3160
|
-
y1:
|
|
3161
|
-
x2:
|
|
3162
|
-
y2:
|
|
3172
|
+
y1: K,
|
|
3173
|
+
x2: B.x,
|
|
3174
|
+
y2: B.y
|
|
3163
3175
|
},
|
|
3164
|
-
`spoke-${
|
|
3176
|
+
`spoke-${k}`
|
|
3165
3177
|
);
|
|
3166
3178
|
}),
|
|
3167
|
-
h &&
|
|
3168
|
-
const
|
|
3179
|
+
h && H.map((g) => {
|
|
3180
|
+
const k = M(g);
|
|
3169
3181
|
return /* @__PURE__ */ s(
|
|
3170
3182
|
"text",
|
|
3171
3183
|
{
|
|
3172
|
-
className:
|
|
3184
|
+
className: m(w.axisLabel, $?.axisLabel),
|
|
3173
3185
|
x: pe + 4,
|
|
3174
|
-
y:
|
|
3186
|
+
y: K - k,
|
|
3175
3187
|
textAnchor: "start",
|
|
3176
3188
|
dominantBaseline: "middle",
|
|
3177
|
-
children:
|
|
3189
|
+
children: S ? S(g) : g
|
|
3178
3190
|
},
|
|
3179
|
-
`raxis-${
|
|
3191
|
+
`raxis-${g}`
|
|
3180
3192
|
);
|
|
3181
3193
|
}),
|
|
3182
|
-
a && e.map((
|
|
3183
|
-
const
|
|
3184
|
-
if (
|
|
3185
|
-
return /* @__PURE__ */ s("g", { children:
|
|
3186
|
-
row:
|
|
3187
|
-
index:
|
|
3188
|
-
angle:
|
|
3189
|
-
x:
|
|
3190
|
-
y:
|
|
3191
|
-
textAnchor:
|
|
3192
|
-
}) }, `label-${
|
|
3193
|
-
const
|
|
3194
|
+
a && e.map((g, k) => {
|
|
3195
|
+
const B = R[k], _ = mt(pe, K, X + 14, B), J = _.x < pe - 1 ? "end" : _.x > pe + 1 ? "start" : "middle";
|
|
3196
|
+
if (L)
|
|
3197
|
+
return /* @__PURE__ */ s("g", { children: L({
|
|
3198
|
+
row: g,
|
|
3199
|
+
index: k,
|
|
3200
|
+
angle: B,
|
|
3201
|
+
x: _.x,
|
|
3202
|
+
y: _.y,
|
|
3203
|
+
textAnchor: J
|
|
3204
|
+
}) }, `label-${k}`);
|
|
3205
|
+
const Y = String(g[t]), b = v ? v(Y) : Y;
|
|
3194
3206
|
return /* @__PURE__ */ s(
|
|
3195
3207
|
"text",
|
|
3196
3208
|
{
|
|
3197
|
-
className:
|
|
3198
|
-
x:
|
|
3199
|
-
y:
|
|
3200
|
-
textAnchor:
|
|
3209
|
+
className: m(w.axisLabel, $?.axisLabel),
|
|
3210
|
+
x: _.x,
|
|
3211
|
+
y: _.y,
|
|
3212
|
+
textAnchor: J,
|
|
3201
3213
|
dominantBaseline: "middle",
|
|
3202
|
-
children:
|
|
3214
|
+
children: b
|
|
3203
3215
|
},
|
|
3204
|
-
`label-${
|
|
3216
|
+
`label-${k}`
|
|
3205
3217
|
);
|
|
3206
3218
|
}),
|
|
3207
|
-
|
|
3208
|
-
const
|
|
3209
|
-
const
|
|
3210
|
-
return mt(pe,
|
|
3211
|
-
}),
|
|
3212
|
-
return /* @__PURE__ */
|
|
3219
|
+
ae.map((g) => {
|
|
3220
|
+
const k = n[g], B = e.map((J, Y) => {
|
|
3221
|
+
const b = J[g], V = M(typeof b == "number" ? b : 0);
|
|
3222
|
+
return mt(pe, K, V, R[Y]);
|
|
3223
|
+
}), _ = B.map((J) => `${J.x},${J.y}`).join(" ");
|
|
3224
|
+
return /* @__PURE__ */ z("g", { className: m(w.series, $?.series), children: [
|
|
3213
3225
|
/* @__PURE__ */ s(
|
|
3214
3226
|
"polygon",
|
|
3215
3227
|
{
|
|
3216
|
-
points:
|
|
3217
|
-
fill:
|
|
3218
|
-
fillOpacity:
|
|
3219
|
-
stroke:
|
|
3220
|
-
strokeWidth:
|
|
3228
|
+
points: _,
|
|
3229
|
+
fill: k.color,
|
|
3230
|
+
fillOpacity: f,
|
|
3231
|
+
stroke: k.color,
|
|
3232
|
+
strokeWidth: y,
|
|
3221
3233
|
strokeLinejoin: "round",
|
|
3222
3234
|
strokeLinecap: "round"
|
|
3223
3235
|
}
|
|
3224
3236
|
),
|
|
3225
|
-
d &&
|
|
3237
|
+
d && B.map((J, Y) => /* @__PURE__ */ s(
|
|
3226
3238
|
"circle",
|
|
3227
3239
|
{
|
|
3228
|
-
className:
|
|
3229
|
-
cx:
|
|
3230
|
-
cy:
|
|
3231
|
-
r:
|
|
3232
|
-
fill:
|
|
3240
|
+
className: m(w.point, $?.point),
|
|
3241
|
+
cx: J.x,
|
|
3242
|
+
cy: J.y,
|
|
3243
|
+
r: oe === Y ? 5 : 3.5,
|
|
3244
|
+
fill: k.color
|
|
3233
3245
|
},
|
|
3234
|
-
`${
|
|
3246
|
+
`${g}-${Y}`
|
|
3235
3247
|
))
|
|
3236
|
-
] },
|
|
3248
|
+
] }, g);
|
|
3237
3249
|
}),
|
|
3238
3250
|
/* @__PURE__ */ s(
|
|
3239
3251
|
"rect",
|
|
3240
3252
|
{
|
|
3241
|
-
className:
|
|
3253
|
+
className: w.interactionLayer,
|
|
3242
3254
|
x: 0,
|
|
3243
3255
|
y: 0,
|
|
3244
|
-
width:
|
|
3245
|
-
height:
|
|
3246
|
-
onMouseMove: (
|
|
3247
|
-
const
|
|
3248
|
-
if (
|
|
3249
|
-
let
|
|
3250
|
-
|
|
3251
|
-
const
|
|
3252
|
-
|
|
3256
|
+
width: A,
|
|
3257
|
+
height: F,
|
|
3258
|
+
onMouseMove: (g) => {
|
|
3259
|
+
const k = g.currentTarget.getBoundingClientRect(), B = g.clientX - k.left - pe, _ = g.clientY - k.top - K;
|
|
3260
|
+
if (B === 0 && _ === 0) return;
|
|
3261
|
+
let J = Math.atan2(_, B) * 180 / Math.PI + 90;
|
|
3262
|
+
J < 0 && (J += 360), J >= 360 && (J -= 360);
|
|
3263
|
+
const Y = 360 / e.length, b = Math.round(J / Y) % e.length;
|
|
3264
|
+
ce(b);
|
|
3253
3265
|
},
|
|
3254
|
-
onMouseLeave: () =>
|
|
3266
|
+
onMouseLeave: () => ce(null)
|
|
3255
3267
|
}
|
|
3256
3268
|
)
|
|
3257
3269
|
] });
|
|
@@ -3286,12 +3298,12 @@ function el(e, t, n = 2) {
|
|
|
3286
3298
|
if (t <= 0 || r < t) return { middle: o, upper: c, lower: i };
|
|
3287
3299
|
for (let l = t - 1; l < r; l++) {
|
|
3288
3300
|
let a = 0;
|
|
3289
|
-
for (let
|
|
3301
|
+
for (let f = l - t + 1; f <= l; f++) a += e[f].close;
|
|
3290
3302
|
const h = a / t;
|
|
3291
3303
|
let u = 0;
|
|
3292
|
-
for (let
|
|
3293
|
-
const
|
|
3294
|
-
u +=
|
|
3304
|
+
for (let f = l - t + 1; f <= l; f++) {
|
|
3305
|
+
const y = e[f].close - h;
|
|
3306
|
+
u += y * y;
|
|
3295
3307
|
}
|
|
3296
3308
|
u /= t;
|
|
3297
3309
|
const d = Math.sqrt(u);
|
|
@@ -3389,209 +3401,209 @@ function Vl({
|
|
|
3389
3401
|
upColor: h = "var(--crk-color-success)",
|
|
3390
3402
|
downColor: u = "var(--crk-color-danger)",
|
|
3391
3403
|
lineColor: d = "var(--crk-chart-1)",
|
|
3392
|
-
timezone:
|
|
3393
|
-
defaultTimezone:
|
|
3394
|
-
onTimezoneChange:
|
|
3395
|
-
showConfigPanel:
|
|
3396
|
-
onCrosshair:
|
|
3404
|
+
timezone: f,
|
|
3405
|
+
defaultTimezone: y = "local",
|
|
3406
|
+
onTimezoneChange: L,
|
|
3407
|
+
showConfigPanel: v = !0,
|
|
3408
|
+
onCrosshair: S,
|
|
3397
3409
|
onVisibleRangeChange: N,
|
|
3398
|
-
className:
|
|
3399
|
-
style:
|
|
3410
|
+
className: D,
|
|
3411
|
+
style: j
|
|
3400
3412
|
}) {
|
|
3401
|
-
const
|
|
3402
|
-
}),
|
|
3403
|
-
|
|
3404
|
-
const [
|
|
3405
|
-
(
|
|
3406
|
-
|
|
3413
|
+
const Z = re(null), U = re(null), C = re([]), $ = re({ from: 0, to: 0 }), oe = re(null), ce = re(null), q = re(!1), ae = re(null), R = re(null), te = re(1), H = re({ width: 0, height: 0 }), O = re(() => {
|
|
3414
|
+
}), A = re(S), F = re(N);
|
|
3415
|
+
A.current = S, F.current = N;
|
|
3416
|
+
const [ne, pe] = Le(null), [K, X] = Le(y), M = f ?? K, g = fe(
|
|
3417
|
+
(p) => {
|
|
3418
|
+
f === void 0 && X(p), L?.(p);
|
|
3407
3419
|
},
|
|
3408
|
-
[
|
|
3409
|
-
),
|
|
3420
|
+
[f, L]
|
|
3421
|
+
), k = ke(
|
|
3410
3422
|
() => ({ up: h, down: u, line: d }),
|
|
3411
3423
|
[h, u, d]
|
|
3412
|
-
),
|
|
3413
|
-
const
|
|
3414
|
-
if (!
|
|
3415
|
-
const
|
|
3416
|
-
if (!
|
|
3417
|
-
const { width:
|
|
3418
|
-
if (
|
|
3419
|
-
const
|
|
3420
|
-
|
|
3421
|
-
const
|
|
3422
|
-
if (
|
|
3423
|
-
gl(
|
|
3424
|
+
), B = c, _ = B.some((p) => p.type === "rsi"), J = B.some((p) => p.type === "volume"), Y = fe(() => {
|
|
3425
|
+
const p = U.current;
|
|
3426
|
+
if (!p) return;
|
|
3427
|
+
const x = p.getContext("2d");
|
|
3428
|
+
if (!x) return;
|
|
3429
|
+
const { width: ee, height: P } = H.current;
|
|
3430
|
+
if (ee === 0 || P === 0) return;
|
|
3431
|
+
const G = te.current;
|
|
3432
|
+
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, p.width, p.height), x.scale(G, G);
|
|
3433
|
+
const I = pl(Z.current, k), me = ln(Z.current), Q = C.current;
|
|
3434
|
+
if (Q.length === 0) {
|
|
3435
|
+
gl(x, ee, P, I), x.restore();
|
|
3424
3436
|
return;
|
|
3425
3437
|
}
|
|
3426
|
-
const
|
|
3427
|
-
|
|
3428
|
-
const
|
|
3429
|
-
const Ie = ge -
|
|
3430
|
-
return
|
|
3431
|
-
}, Ae =
|
|
3432
|
-
Lt(
|
|
3433
|
-
for (let
|
|
3434
|
-
const Ie =
|
|
3435
|
-
He && kl(
|
|
3438
|
+
const T = Nt(ee, P, _, J), { from: le, to: ge } = hl($.current, Q.length);
|
|
3439
|
+
$.current = { from: le, to: ge };
|
|
3440
|
+
const ie = Q.slice(Math.max(0, Math.floor(le)), Math.min(Q.length, Math.ceil(ge) + 1)), ue = (se) => {
|
|
3441
|
+
const Ie = ge - le + 1, He = T.plotWidth / Ie;
|
|
3442
|
+
return T.plotLeft + (se - le + 0.5) * He;
|
|
3443
|
+
}, Ae = T.plotWidth / (ge - le + 1), De = B.map((se) => ml(se, Q)).filter((se) => se !== null).map((se) => ({ ...se, color: me(se.color) })), xe = cn(T.main, ie, De, le, ge);
|
|
3444
|
+
Lt(x, T.plotLeft, T.plotRight, xe, I), yl(x, T, xe, i, I), x.save(), x.beginPath(), x.rect(T.plotLeft, xe.paneTop, T.plotWidth, xe.paneHeight), x.clip();
|
|
3445
|
+
for (let se = 0; se < B.length; se++) {
|
|
3446
|
+
const Ie = B[se], He = De[se];
|
|
3447
|
+
He && kl(x, He, Ie, Q, le, ge, ue, xe);
|
|
3436
3448
|
}
|
|
3437
|
-
if (o === "candle" ? vl(
|
|
3438
|
-
const
|
|
3439
|
-
Lt(
|
|
3449
|
+
if (o === "candle" ? vl(x, Q, le, ge, ue, Ae, xe, { up: I.up, down: I.down }) : o === "bar" ? bl(x, Q, le, ge, ue, Ae, xe, { up: I.up, down: I.down }) : xl(x, Q, le, ge, ue, xe, I.line, o === "area"), x.restore(), T.volume) {
|
|
3450
|
+
const se = fl(T.volume, Q, le, ge);
|
|
3451
|
+
Lt(x, T.plotLeft, T.plotRight, se, I, !0), Ft(x, T, T.volume, "Volume", I), x.save(), x.beginPath(), x.rect(T.plotLeft, se.paneTop, T.plotWidth, se.paneHeight), x.clip(), Ml(x, Q, le, ge, ue, Ae, se, { up: I.up, down: I.down }), x.restore();
|
|
3440
3452
|
}
|
|
3441
|
-
if (
|
|
3442
|
-
const
|
|
3443
|
-
paneTop:
|
|
3444
|
-
paneBottom:
|
|
3445
|
-
paneHeight:
|
|
3453
|
+
if (T.rsi) {
|
|
3454
|
+
const se = B.find((tt) => tt.type === "rsi"), Ie = se && se.type === "rsi" ? se.period ?? 14 : 14, He = se && se.type === "rsi" ? se.overbought ?? 70 : 70, Ge = se && se.type === "rsi" ? se.oversold ?? 30 : 30, Ee = (se && se.type === "rsi" ? se.color : void 0) ?? "var(--crk-chart-5)", xt = me(Ee), kt = tl(Q, Ie), Oe = {
|
|
3455
|
+
paneTop: T.rsi.top,
|
|
3456
|
+
paneBottom: T.rsi.bottom,
|
|
3457
|
+
paneHeight: T.rsi.height,
|
|
3446
3458
|
priceMin: 0,
|
|
3447
3459
|
priceMax: 100,
|
|
3448
3460
|
ticks: [Ge, 50, He]
|
|
3449
3461
|
};
|
|
3450
|
-
Lt(
|
|
3462
|
+
Lt(x, T.plotLeft, T.plotRight, Oe, I, !0), Ft(x, T, T.rsi, `RSI ${Ie}`, I), x.save(), x.beginPath(), x.rect(T.plotLeft, Oe.paneTop, T.plotWidth, Oe.paneHeight), x.clip(), Qe(x, kt, le, ge, ue, Oe, xt), x.restore(), wl(x, T, Oe, He, Ge, I);
|
|
3451
3463
|
}
|
|
3452
|
-
$l(
|
|
3453
|
-
}, [o,
|
|
3454
|
-
|
|
3455
|
-
const
|
|
3456
|
-
if (
|
|
3464
|
+
$l(x, T, Q, le, ge, n, I), oe.current && Nl(x, T, oe.current, Q, le, ge, ue, i, xe, M, I), x.restore();
|
|
3465
|
+
}, [o, B, _, J, i, k, n, M]);
|
|
3466
|
+
O.current = Y;
|
|
3467
|
+
const b = fe(() => {
|
|
3468
|
+
if (R.current === null) {
|
|
3457
3469
|
if (typeof requestAnimationFrame > "u") {
|
|
3458
|
-
|
|
3470
|
+
O.current();
|
|
3459
3471
|
return;
|
|
3460
3472
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3473
|
+
R.current = requestAnimationFrame(() => {
|
|
3474
|
+
R.current = null, O.current();
|
|
3463
3475
|
});
|
|
3464
3476
|
}
|
|
3465
3477
|
}, []);
|
|
3466
3478
|
jt(() => {
|
|
3467
|
-
const
|
|
3468
|
-
if (!
|
|
3469
|
-
const
|
|
3470
|
-
const
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3479
|
+
const p = Z.current;
|
|
3480
|
+
if (!p) return;
|
|
3481
|
+
const x = () => {
|
|
3482
|
+
const P = p.getBoundingClientRect(), G = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3483
|
+
te.current = G, H.current = { width: P.width, height: P.height };
|
|
3484
|
+
const I = U.current;
|
|
3485
|
+
I && (I.width = Math.round(P.width * G), I.height = Math.round(P.height * G), I.style.width = `${P.width}px`, I.style.height = `${P.height}px`), b();
|
|
3474
3486
|
};
|
|
3475
|
-
if (
|
|
3476
|
-
const
|
|
3477
|
-
return
|
|
3478
|
-
}, [
|
|
3479
|
-
let
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3482
|
-
if (
|
|
3483
|
-
const
|
|
3484
|
-
|
|
3485
|
-
const
|
|
3487
|
+
if (x(), typeof ResizeObserver > "u") return;
|
|
3488
|
+
const ee = new ResizeObserver(x);
|
|
3489
|
+
return ee.observe(p), () => ee.disconnect();
|
|
3490
|
+
}, [b]), Ne(() => {
|
|
3491
|
+
let p = !1;
|
|
3492
|
+
const x = Math.floor(Date.now() / 1e3), ee = zt(n), P = r !== void 0 ? on(r) : ee * l, G = r !== void 0 ? Math.max(10, Math.ceil(P / ee)) : l, I = x - P;
|
|
3493
|
+
C.current = [], $.current = { from: 0, to: 0 }, b(), e.getBars({ symbol: t, resolution: n, from: I, to: x, countBack: G }).then((Q) => {
|
|
3494
|
+
if (p) return;
|
|
3495
|
+
const T = [...Q].sort((ge, ie) => ge.time - ie.time);
|
|
3496
|
+
C.current = T;
|
|
3497
|
+
const le = T.length - 1;
|
|
3486
3498
|
if (r !== void 0)
|
|
3487
|
-
|
|
3499
|
+
$.current = { from: 0, to: le };
|
|
3488
3500
|
else {
|
|
3489
|
-
const ge = Math.min(
|
|
3490
|
-
|
|
3491
|
-
from: Math.max(0,
|
|
3492
|
-
to:
|
|
3501
|
+
const ge = Math.min(T.length, Math.min(200, l));
|
|
3502
|
+
$.current = {
|
|
3503
|
+
from: Math.max(0, le - ge + 1),
|
|
3504
|
+
to: le
|
|
3493
3505
|
};
|
|
3494
3506
|
}
|
|
3495
|
-
|
|
3507
|
+
F.current?.($.current, T), b();
|
|
3496
3508
|
}).catch(() => {
|
|
3497
3509
|
});
|
|
3498
3510
|
const me = e.subscribeBars({
|
|
3499
3511
|
symbol: t,
|
|
3500
3512
|
resolution: n,
|
|
3501
|
-
onTick: (
|
|
3502
|
-
if (
|
|
3503
|
-
const
|
|
3504
|
-
if (
|
|
3505
|
-
|
|
3506
|
-
else if (!
|
|
3507
|
-
|
|
3508
|
-
const ge =
|
|
3509
|
-
ge.to >=
|
|
3513
|
+
onTick: (Q) => {
|
|
3514
|
+
if (p) return;
|
|
3515
|
+
const T = C.current, le = T[T.length - 1];
|
|
3516
|
+
if (le && le.time === Q.time)
|
|
3517
|
+
T[T.length - 1] = Q;
|
|
3518
|
+
else if (!le || Q.time > le.time) {
|
|
3519
|
+
T.push(Q);
|
|
3520
|
+
const ge = $.current;
|
|
3521
|
+
ge.to >= T.length - 2 && ($.current = { from: ge.from + 1, to: ge.to + 1 });
|
|
3510
3522
|
}
|
|
3511
|
-
|
|
3523
|
+
b();
|
|
3512
3524
|
}
|
|
3513
3525
|
});
|
|
3514
|
-
return
|
|
3515
|
-
|
|
3526
|
+
return ae.current = me, () => {
|
|
3527
|
+
p = !0, ae.current !== null && (e.unsubscribeBars(ae.current), ae.current = null);
|
|
3516
3528
|
};
|
|
3517
3529
|
}, [e, t, n, r, l]);
|
|
3518
|
-
const
|
|
3519
|
-
pe(
|
|
3520
|
-
}, []),
|
|
3521
|
-
|
|
3522
|
-
const
|
|
3523
|
-
|
|
3530
|
+
const E = fe((p) => {
|
|
3531
|
+
pe(p), A.current?.(p);
|
|
3532
|
+
}, []), V = fe((p) => {
|
|
3533
|
+
p.currentTarget.setPointerCapture(p.pointerId);
|
|
3534
|
+
const x = $.current;
|
|
3535
|
+
ce.current = { startX: p.clientX, from: x.from, to: x.to };
|
|
3524
3536
|
}, []), de = fe(
|
|
3525
|
-
(
|
|
3526
|
-
const
|
|
3527
|
-
if (
|
|
3528
|
-
const { startX: me, from:
|
|
3529
|
-
let De =
|
|
3530
|
-
const
|
|
3531
|
-
De < 0 && (Se(), De = 0, xe =
|
|
3537
|
+
(p) => {
|
|
3538
|
+
const x = p.currentTarget.getBoundingClientRect(), ee = p.clientX - x.left, P = p.clientY - x.top;
|
|
3539
|
+
if (oe.current = { x: ee, y: P }, ce.current) {
|
|
3540
|
+
const { startX: me, from: Q, to: T } = ce.current, { width: le } = H.current, ge = Math.max(1, le - Ct), ie = T - Q + 1, ue = ge / ie, Ae = -(p.clientX - me) / ue;
|
|
3541
|
+
let De = Q + Ae, xe = T + Ae;
|
|
3542
|
+
const se = C.current.length;
|
|
3543
|
+
De < 0 && (Se(), De = 0, xe = ie - 1), xe > se - 1 && (xe = se - 1, De = xe - ie + 1), $.current = { from: De, to: xe }, F.current?.($.current, C.current);
|
|
3532
3544
|
}
|
|
3533
|
-
const
|
|
3534
|
-
if (
|
|
3535
|
-
const me =
|
|
3536
|
-
|
|
3545
|
+
const G = Nt(x.width, x.height, _, J), I = $.current;
|
|
3546
|
+
if (ee >= G.plotLeft && ee <= G.plotRight) {
|
|
3547
|
+
const me = I.to - I.from + 1, Q = G.plotWidth / me, T = Math.round(I.from + (ee - G.plotLeft) / Q - 0.5), le = C.current, ge = Math.max(0, Math.min(le.length - 1, T)), ie = le[ge] ?? null, ue = Ll(P, G, le, I.from, I.to);
|
|
3548
|
+
E({ barIndex: ge, bar: ie, priceAtCursor: ue });
|
|
3537
3549
|
} else
|
|
3538
|
-
|
|
3539
|
-
|
|
3550
|
+
E(null);
|
|
3551
|
+
b();
|
|
3540
3552
|
},
|
|
3541
|
-
[
|
|
3542
|
-
), he = fe((
|
|
3543
|
-
|
|
3553
|
+
[_, J, b, E]
|
|
3554
|
+
), he = fe((p) => {
|
|
3555
|
+
p.currentTarget.releasePointerCapture(p.pointerId), ce.current = null;
|
|
3544
3556
|
}, []), ye = fe(() => {
|
|
3545
|
-
|
|
3546
|
-
}, [
|
|
3547
|
-
(
|
|
3548
|
-
|
|
3549
|
-
const
|
|
3550
|
-
if (
|
|
3551
|
-
const me =
|
|
3552
|
-
|
|
3553
|
-
Math.min(
|
|
3554
|
-
),
|
|
3555
|
-
let
|
|
3556
|
-
|
|
3557
|
+
oe.current = null, ce.current = null, E(null), b();
|
|
3558
|
+
}, [b, E]), be = fe(
|
|
3559
|
+
(p) => {
|
|
3560
|
+
p.preventDefault();
|
|
3561
|
+
const x = p.currentTarget.getBoundingClientRect(), ee = p.clientX - x.left, P = Nt(x.width, x.height, _, J), G = $.current, I = C.current;
|
|
3562
|
+
if (I.length === 0) return;
|
|
3563
|
+
const me = G.to - G.from + 1, Q = p.deltaY > 0 ? 1 + Ot : 1 / (1 + Ot), T = Math.max(
|
|
3564
|
+
P.plotWidth / cl,
|
|
3565
|
+
Math.min(I.length, P.plotWidth / il, me * Q)
|
|
3566
|
+
), le = G.from + (ee - P.plotLeft) / (P.plotWidth / me), ge = (le - G.from) / me;
|
|
3567
|
+
let ie = le - ge * T, ue = ie + T - 1;
|
|
3568
|
+
ie < 0 && (ie = 0, ue = T - 1), ue > I.length - 1 && (ue = I.length - 1, ie = ue - T + 1), $.current = { from: ie, to: ue }, F.current?.($.current, I), b();
|
|
3557
3569
|
},
|
|
3558
|
-
[
|
|
3570
|
+
[_, J, b]
|
|
3559
3571
|
), Ce = fe(
|
|
3560
|
-
(
|
|
3561
|
-
const
|
|
3562
|
-
if (
|
|
3563
|
-
let
|
|
3564
|
-
if (
|
|
3565
|
-
else if (
|
|
3572
|
+
(p) => {
|
|
3573
|
+
const x = $.current, ee = x.to - x.from + 1, P = C.current;
|
|
3574
|
+
if (P.length === 0) return;
|
|
3575
|
+
let G = 0;
|
|
3576
|
+
if (p.key === "ArrowLeft") G = -Math.max(1, Math.floor(ee * 0.1));
|
|
3577
|
+
else if (p.key === "ArrowRight") G = Math.max(1, Math.floor(ee * 0.1));
|
|
3566
3578
|
else return;
|
|
3567
|
-
|
|
3568
|
-
let
|
|
3569
|
-
|
|
3579
|
+
p.preventDefault();
|
|
3580
|
+
let I = x.from + G, me = x.to + G;
|
|
3581
|
+
I < 0 && (I = 0, me = ee - 1), me > P.length - 1 && (me = P.length - 1, I = me - ee + 1), $.current = { from: I, to: me }, F.current?.($.current, P), b();
|
|
3570
3582
|
},
|
|
3571
|
-
[
|
|
3583
|
+
[b]
|
|
3572
3584
|
), Se = fe(() => {
|
|
3573
|
-
if (
|
|
3574
|
-
const
|
|
3575
|
-
if (
|
|
3576
|
-
|
|
3577
|
-
const
|
|
3578
|
-
e.getBars({ symbol: t, resolution: n, from:
|
|
3579
|
-
if (
|
|
3580
|
-
|
|
3585
|
+
if (q.current) return;
|
|
3586
|
+
const p = C.current;
|
|
3587
|
+
if (p.length === 0) return;
|
|
3588
|
+
q.current = !0;
|
|
3589
|
+
const x = zt(n), ee = p[0].time, P = ee - x * l, G = ee - x;
|
|
3590
|
+
e.getBars({ symbol: t, resolution: n, from: P, to: G, countBack: l }).then((I) => {
|
|
3591
|
+
if (I.length === 0) {
|
|
3592
|
+
q.current = !1;
|
|
3581
3593
|
return;
|
|
3582
3594
|
}
|
|
3583
|
-
const
|
|
3584
|
-
|
|
3595
|
+
const Q = [...I].sort((le, ge) => le.time - ge.time).filter((le) => le.time < ee), T = $.current;
|
|
3596
|
+
C.current = [...Q, ...p], $.current = { from: T.from + Q.length, to: T.to + Q.length }, q.current = !1, b();
|
|
3585
3597
|
}).catch(() => {
|
|
3586
|
-
|
|
3598
|
+
q.current = !1;
|
|
3587
3599
|
});
|
|
3588
|
-
}, [e, t, n, l,
|
|
3589
|
-
return /* @__PURE__ */
|
|
3600
|
+
}, [e, t, n, l, b]);
|
|
3601
|
+
return /* @__PURE__ */ z(
|
|
3590
3602
|
"div",
|
|
3591
3603
|
{
|
|
3592
|
-
ref:
|
|
3593
|
-
className:
|
|
3594
|
-
style: { ...
|
|
3604
|
+
ref: Z,
|
|
3605
|
+
className: m(w.root, D),
|
|
3606
|
+
style: { ...j, height: a, position: "relative" },
|
|
3595
3607
|
tabIndex: 0,
|
|
3596
3608
|
role: "figure",
|
|
3597
3609
|
"aria-label": `${t} ${n} chart`,
|
|
@@ -3600,20 +3612,20 @@ function Vl({
|
|
|
3600
3612
|
/* @__PURE__ */ s(
|
|
3601
3613
|
"canvas",
|
|
3602
3614
|
{
|
|
3603
|
-
ref:
|
|
3604
|
-
className:
|
|
3605
|
-
onPointerDown:
|
|
3615
|
+
ref: U,
|
|
3616
|
+
className: w.svg,
|
|
3617
|
+
onPointerDown: V,
|
|
3606
3618
|
onPointerMove: de,
|
|
3607
3619
|
onPointerUp: he,
|
|
3608
3620
|
onPointerLeave: ye,
|
|
3609
3621
|
onWheel: be,
|
|
3610
|
-
style: { cursor:
|
|
3622
|
+
style: { cursor: ce.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3611
3623
|
}
|
|
3612
3624
|
),
|
|
3613
|
-
/* @__PURE__ */
|
|
3625
|
+
/* @__PURE__ */ z(
|
|
3614
3626
|
"div",
|
|
3615
3627
|
{
|
|
3616
|
-
className:
|
|
3628
|
+
className: w.tradingHeader,
|
|
3617
3629
|
style: {
|
|
3618
3630
|
position: "absolute",
|
|
3619
3631
|
top: ol,
|
|
@@ -3626,22 +3638,22 @@ function Vl({
|
|
|
3626
3638
|
gap: 8
|
|
3627
3639
|
},
|
|
3628
3640
|
children: [
|
|
3629
|
-
/* @__PURE__ */
|
|
3641
|
+
/* @__PURE__ */ z("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
3630
3642
|
/* @__PURE__ */ s("strong", { children: t }),
|
|
3631
3643
|
/* @__PURE__ */ s("span", { style: { color: "var(--crk-color-text-muted)" }, children: n }),
|
|
3632
|
-
|
|
3644
|
+
ne?.bar && /* @__PURE__ */ z("span", { style: { color: "var(--crk-color-text-muted)", whiteSpace: "nowrap" }, children: [
|
|
3633
3645
|
"O ",
|
|
3634
|
-
|
|
3646
|
+
ne.bar.open.toFixed(i),
|
|
3635
3647
|
" · H ",
|
|
3636
|
-
|
|
3648
|
+
ne.bar.high.toFixed(i),
|
|
3637
3649
|
" · L",
|
|
3638
3650
|
" ",
|
|
3639
|
-
|
|
3651
|
+
ne.bar.low.toFixed(i),
|
|
3640
3652
|
" · C ",
|
|
3641
|
-
|
|
3653
|
+
ne.bar.close.toFixed(i)
|
|
3642
3654
|
] })
|
|
3643
3655
|
] }),
|
|
3644
|
-
|
|
3656
|
+
v && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
3645
3657
|
qt,
|
|
3646
3658
|
{
|
|
3647
3659
|
position: "bottom",
|
|
@@ -3660,7 +3672,7 @@ function Vl({
|
|
|
3660
3672
|
dl,
|
|
3661
3673
|
{
|
|
3662
3674
|
timezone: M,
|
|
3663
|
-
onTimezoneChange:
|
|
3675
|
+
onTimezoneChange: g
|
|
3664
3676
|
}
|
|
3665
3677
|
)
|
|
3666
3678
|
}
|
|
@@ -3686,7 +3698,7 @@ function dl({
|
|
|
3686
3698
|
timezone: e,
|
|
3687
3699
|
onTimezoneChange: t
|
|
3688
3700
|
}) {
|
|
3689
|
-
return /* @__PURE__ */
|
|
3701
|
+
return /* @__PURE__ */ z("div", { style: { minWidth: 220, padding: 4 }, children: [
|
|
3690
3702
|
/* @__PURE__ */ s(
|
|
3691
3703
|
"div",
|
|
3692
3704
|
{
|
|
@@ -3698,7 +3710,7 @@ function dl({
|
|
|
3698
3710
|
children: "Settings"
|
|
3699
3711
|
}
|
|
3700
3712
|
),
|
|
3701
|
-
/* @__PURE__ */
|
|
3713
|
+
/* @__PURE__ */ z("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
|
|
3702
3714
|
/* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
|
|
3703
3715
|
/* @__PURE__ */ s(
|
|
3704
3716
|
Vt,
|
|
@@ -3712,7 +3724,7 @@ function dl({
|
|
|
3712
3724
|
] });
|
|
3713
3725
|
}
|
|
3714
3726
|
function ul() {
|
|
3715
|
-
return /* @__PURE__ */
|
|
3727
|
+
return /* @__PURE__ */ z(
|
|
3716
3728
|
"svg",
|
|
3717
3729
|
{
|
|
3718
3730
|
viewBox: "0 0 24 24",
|
|
@@ -3732,10 +3744,10 @@ function ul() {
|
|
|
3732
3744
|
function Nt(e, t, n, r) {
|
|
3733
3745
|
const c = Math.max(0, e - Ct), i = rl, l = Math.max(i, t - At), a = Math.max(0, c - 0), h = Math.max(0, l - i);
|
|
3734
3746
|
let u = h, d = i;
|
|
3735
|
-
const
|
|
3736
|
-
let
|
|
3737
|
-
const
|
|
3738
|
-
return u = h * (1 -
|
|
3747
|
+
const f = { top: i, bottom: l, height: h };
|
|
3748
|
+
let y = null, L = null;
|
|
3749
|
+
const v = n ? Ht.rsi : 0, S = r ? Ht.volume : 0;
|
|
3750
|
+
return u = h * (1 - v - S), f.top = d, f.height = u, f.bottom = f.top + u, d = f.bottom, n && (y = { top: d, height: h * v, bottom: d + h * v }, d = y.bottom), r && (L = { top: d, height: h * S, bottom: d + h * S }), { width: e, height: t, plotLeft: 0, plotRight: c, plotTop: i, plotBottom: l, plotWidth: a, plotHeight: h, main: f, rsi: y, volume: L };
|
|
3739
3751
|
}
|
|
3740
3752
|
function hl(e, t) {
|
|
3741
3753
|
if (t === 0) return { from: 0, to: 0 };
|
|
@@ -3769,11 +3781,11 @@ function cn(e, t, n, r, o) {
|
|
|
3769
3781
|
for (const d of t)
|
|
3770
3782
|
d.low < c && (c = d.low), d.high > i && (i = d.high);
|
|
3771
3783
|
for (const d of n) {
|
|
3772
|
-
const
|
|
3773
|
-
for (const
|
|
3774
|
-
const
|
|
3775
|
-
for (let
|
|
3776
|
-
const N =
|
|
3784
|
+
const f = d.kind === "line" ? [d.values] : [d.upper, d.lower];
|
|
3785
|
+
for (const y of f) {
|
|
3786
|
+
const L = Math.max(0, Math.floor(r)), v = Math.min(y.length - 1, Math.ceil(o));
|
|
3787
|
+
for (let S = L; S <= v; S++) {
|
|
3788
|
+
const N = y[S];
|
|
3777
3789
|
N != null && (N < c && (c = N), N > i && (i = N));
|
|
3778
3790
|
}
|
|
3779
3791
|
}
|
|
@@ -3792,7 +3804,7 @@ function fl(e, t, n, r) {
|
|
|
3792
3804
|
const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
|
|
3793
3805
|
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
|
|
3794
3806
|
}
|
|
3795
|
-
function
|
|
3807
|
+
function we(e, t) {
|
|
3796
3808
|
const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
|
|
3797
3809
|
return t.paneBottom - n * t.paneHeight;
|
|
3798
3810
|
}
|
|
@@ -3832,7 +3844,7 @@ function gl(e, t, n, r) {
|
|
|
3832
3844
|
function Lt(e, t, n, r, o, c = !1) {
|
|
3833
3845
|
e.strokeStyle = o.grid, e.lineWidth = 1, e.beginPath();
|
|
3834
3846
|
for (const i of r.ticks) {
|
|
3835
|
-
const l = Math.round(
|
|
3847
|
+
const l = Math.round(we(i, r)) + 0.5;
|
|
3836
3848
|
e.moveTo(t, l), e.lineTo(n, l);
|
|
3837
3849
|
}
|
|
3838
3850
|
e.stroke();
|
|
@@ -3840,35 +3852,35 @@ function Lt(e, t, n, r, o, c = !1) {
|
|
|
3840
3852
|
function yl(e, t, n, r, o) {
|
|
3841
3853
|
e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
|
|
3842
3854
|
for (const c of n.ticks) {
|
|
3843
|
-
const i =
|
|
3855
|
+
const i = we(c, n);
|
|
3844
3856
|
e.fillText(c.toFixed(r), t.plotRight + 6, i);
|
|
3845
3857
|
}
|
|
3846
3858
|
}
|
|
3847
3859
|
function vl(e, t, n, r, o, c, i, l) {
|
|
3848
3860
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3849
3861
|
for (let d = a; d <= h; d++) {
|
|
3850
|
-
const
|
|
3851
|
-
e.strokeStyle =
|
|
3852
|
-
const
|
|
3853
|
-
e.moveTo(
|
|
3854
|
-
const
|
|
3855
|
-
e.fillRect(Math.round(
|
|
3862
|
+
const f = t[d], y = o(d), L = we(f.open, i), v = we(f.close, i), S = we(f.high, i), N = we(f.low, i), j = f.close >= f.open ? l.up : l.down;
|
|
3863
|
+
e.strokeStyle = j, e.fillStyle = j, e.beginPath();
|
|
3864
|
+
const Z = Math.round(y) + 0.5;
|
|
3865
|
+
e.moveTo(Z, S), e.lineTo(Z, N), e.stroke();
|
|
3866
|
+
const U = Math.min(L, v), C = Math.max(1, Math.abs(v - L));
|
|
3867
|
+
e.fillRect(Math.round(y - u / 2), Math.round(U), Math.round(u), Math.round(C));
|
|
3856
3868
|
}
|
|
3857
3869
|
}
|
|
3858
3870
|
function bl(e, t, n, r, o, c, i, l) {
|
|
3859
3871
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(2, Math.min(c * 0.4, 8));
|
|
3860
3872
|
e.lineWidth = Math.max(1, Math.min(2, c * 0.18)), e.lineCap = "butt";
|
|
3861
3873
|
for (let d = a; d <= h; d++) {
|
|
3862
|
-
const
|
|
3863
|
-
e.strokeStyle =
|
|
3874
|
+
const f = t[d], y = Math.round(o(d)) + 0.5, L = we(f.high, i), v = we(f.low, i), S = we(f.open, i), N = we(f.close, i), D = f.close >= f.open;
|
|
3875
|
+
e.strokeStyle = D ? l.up : l.down, e.beginPath(), e.moveTo(y, L), e.lineTo(y, v), e.moveTo(y - u, S), e.lineTo(y, S), e.moveTo(y, N), e.lineTo(y + u, N), e.stroke();
|
|
3864
3876
|
}
|
|
3865
3877
|
}
|
|
3866
3878
|
function xl(e, t, n, r, o, c, i, l) {
|
|
3867
3879
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3868
3880
|
if (!(h <= a)) {
|
|
3869
|
-
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a),
|
|
3881
|
+
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), we(t[a].close, c));
|
|
3870
3882
|
for (let u = a + 1; u <= h; u++)
|
|
3871
|
-
e.lineTo(o(u),
|
|
3883
|
+
e.lineTo(o(u), we(t[u].close, c));
|
|
3872
3884
|
e.stroke(), l && (e.globalAlpha = 0.18, e.fillStyle = i, e.lineTo(o(h), c.paneBottom), e.lineTo(o(a), c.paneBottom), e.closePath(), e.fill(), e.globalAlpha = 1);
|
|
3873
3885
|
}
|
|
3874
3886
|
}
|
|
@@ -3881,14 +3893,14 @@ function kl(e, t, n, r, o, c, i, l) {
|
|
|
3881
3893
|
e.globalAlpha = t.fillOpacity, e.fillStyle = t.color, e.beginPath();
|
|
3882
3894
|
let u = !1;
|
|
3883
3895
|
for (let d = a; d <= h; d++) {
|
|
3884
|
-
const
|
|
3885
|
-
if (
|
|
3886
|
-
const
|
|
3887
|
-
u ? e.lineTo(
|
|
3896
|
+
const f = t.upper[d];
|
|
3897
|
+
if (f == null) continue;
|
|
3898
|
+
const y = i(d), L = we(f, l);
|
|
3899
|
+
u ? e.lineTo(y, L) : (e.moveTo(y, L), u = !0);
|
|
3888
3900
|
}
|
|
3889
3901
|
for (let d = h; d >= a; d--) {
|
|
3890
|
-
const
|
|
3891
|
-
|
|
3902
|
+
const f = t.lower[d];
|
|
3903
|
+
f != null && e.lineTo(i(d), we(f, l));
|
|
3892
3904
|
}
|
|
3893
3905
|
e.closePath(), e.fill(), e.globalAlpha = 1, Qe(e, t.upper, o, c, i, l, t.color), Qe(e, t.lower, o, c, i, l, t.color), Qe(e, t.middle, o, c, i, l, t.color);
|
|
3894
3906
|
}
|
|
@@ -3902,30 +3914,30 @@ function Qe(e, t, n, r, o, c, i) {
|
|
|
3902
3914
|
l = !1;
|
|
3903
3915
|
continue;
|
|
3904
3916
|
}
|
|
3905
|
-
const
|
|
3906
|
-
l ? e.lineTo(
|
|
3917
|
+
const f = o(u), y = we(d, c);
|
|
3918
|
+
l ? e.lineTo(f, y) : (e.moveTo(f, y), l = !0);
|
|
3907
3919
|
}
|
|
3908
3920
|
e.stroke();
|
|
3909
3921
|
}
|
|
3910
|
-
function
|
|
3922
|
+
function Ml(e, t, n, r, o, c, i, l) {
|
|
3911
3923
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3912
3924
|
for (let d = a; d <= h; d++) {
|
|
3913
|
-
const
|
|
3914
|
-
if (
|
|
3915
|
-
const
|
|
3916
|
-
e.fillStyle =
|
|
3917
|
-
const
|
|
3918
|
-
e.fillRect(Math.round(o(d) - u / 2), Math.round(
|
|
3925
|
+
const f = t[d], y = f.volume ?? 0;
|
|
3926
|
+
if (y === 0) continue;
|
|
3927
|
+
const L = f.close >= f.open;
|
|
3928
|
+
e.fillStyle = L ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3929
|
+
const v = we(y, i), S = i.paneBottom - v;
|
|
3930
|
+
e.fillRect(Math.round(o(d) - u / 2), Math.round(v), Math.round(u), Math.round(S));
|
|
3919
3931
|
}
|
|
3920
3932
|
e.globalAlpha = 1;
|
|
3921
3933
|
}
|
|
3922
|
-
function
|
|
3934
|
+
function wl(e, t, n, r, o, c) {
|
|
3923
3935
|
e.strokeStyle = c.grid, e.setLineDash([3, 3]), e.beginPath();
|
|
3924
3936
|
for (const i of [r, o]) {
|
|
3925
|
-
const l = Math.round(
|
|
3937
|
+
const l = Math.round(we(i, n)) + 0.5;
|
|
3926
3938
|
e.moveTo(t.plotLeft, l), e.lineTo(t.plotRight, l);
|
|
3927
3939
|
}
|
|
3928
|
-
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6,
|
|
3940
|
+
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6, we(r, n)), e.fillText(String(o), t.plotRight + 6, we(o, n));
|
|
3929
3941
|
}
|
|
3930
3942
|
function Ft(e, t, n, r, o) {
|
|
3931
3943
|
e.fillStyle = o.textMuted, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "top", e.fillText(r, t.plotLeft + 6, n.top + 4);
|
|
@@ -3933,27 +3945,27 @@ function Ft(e, t, n, r, o) {
|
|
|
3933
3945
|
function $l(e, t, n, r, o, c, i) {
|
|
3934
3946
|
const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
|
|
3935
3947
|
e.fillStyle = i.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
|
|
3936
|
-
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)),
|
|
3937
|
-
for (let
|
|
3938
|
-
const
|
|
3939
|
-
e.fillText(Sl(
|
|
3948
|
+
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)), f = t.plotBottom + At / 2;
|
|
3949
|
+
for (let y = u; y <= d; y += h) {
|
|
3950
|
+
const L = n[y], v = t.plotLeft + (y - r + 0.5) * a;
|
|
3951
|
+
e.fillText(Sl(L.time, c), v, f);
|
|
3940
3952
|
}
|
|
3941
3953
|
}
|
|
3942
3954
|
function Nl(e, t, n, r, o, c, i, l, a, h, u) {
|
|
3943
3955
|
if (n.x < t.plotLeft || n.x > t.plotRight) return;
|
|
3944
|
-
const d = c - o + 1,
|
|
3945
|
-
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(
|
|
3956
|
+
const d = c - o + 1, f = t.plotWidth / d, y = o + (n.x - t.plotLeft) / f - 0.5, L = Math.round(y), v = Math.max(0, Math.min(r.length - 1, L)), S = i(v);
|
|
3957
|
+
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(S + 0.5, t.plotTop), e.lineTo(S + 0.5, t.plotBottom), e.moveTo(t.plotLeft, n.y + 0.5), e.lineTo(t.plotRight, n.y + 0.5), e.stroke(), e.setLineDash([]), n.y >= a.paneTop && n.y <= a.paneBottom) {
|
|
3946
3958
|
const N = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3947
3959
|
e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Ct, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(N.toFixed(l), t.plotRight + 6, n.y);
|
|
3948
3960
|
}
|
|
3949
|
-
if (r[
|
|
3950
|
-
const N = sn(r[
|
|
3961
|
+
if (r[v]) {
|
|
3962
|
+
const N = sn(r[v].time, h);
|
|
3951
3963
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3952
|
-
const
|
|
3964
|
+
const Z = e.measureText(N).width + 8 * 2, U = At, C = Math.max(
|
|
3953
3965
|
t.plotLeft,
|
|
3954
|
-
Math.min(t.plotRight -
|
|
3955
|
-
),
|
|
3956
|
-
e.fillStyle = u.text, e.fillRect(
|
|
3966
|
+
Math.min(t.plotRight - Z, S - Z / 2)
|
|
3967
|
+
), $ = t.plotBottom;
|
|
3968
|
+
e.fillStyle = u.text, e.fillRect(C, $, Z, U), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(N, C + Z / 2, $ + U / 2);
|
|
3957
3969
|
}
|
|
3958
3970
|
e.restore();
|
|
3959
3971
|
}
|
|
@@ -4037,16 +4049,16 @@ const Cl = $e(
|
|
|
4037
4049
|
className: h,
|
|
4038
4050
|
style: u
|
|
4039
4051
|
}, d) => {
|
|
4040
|
-
const { line:
|
|
4052
|
+
const { line: f, area: y, last: L } = ke(() => {
|
|
4041
4053
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
4042
|
-
const
|
|
4043
|
-
return { line:
|
|
4054
|
+
const v = o, S = Math.max(1, t - v * 2), N = Math.max(1, n - v * 2), [D, j] = bt(e), Z = Je([0, Math.max(1, e.length - 1)], [v, v + S]), U = Je([D, j], [v + N, v]), C = e.map((ce, q) => ({ x: Z(q), y: U(ce) })), $ = Tl(C, c), oe = i ? `${$} L ${C[C.length - 1].x} ${v + N} L ${C[0].x} ${v + N} Z` : "";
|
|
4055
|
+
return { line: $, area: oe, last: C[C.length - 1] };
|
|
4044
4056
|
}, [e, t, n, o, c, i]);
|
|
4045
|
-
return /* @__PURE__ */
|
|
4057
|
+
return /* @__PURE__ */ z(
|
|
4046
4058
|
"svg",
|
|
4047
4059
|
{
|
|
4048
4060
|
ref: d,
|
|
4049
|
-
className:
|
|
4061
|
+
className: m(w.sparkline, h),
|
|
4050
4062
|
style: u,
|
|
4051
4063
|
width: t,
|
|
4052
4064
|
height: n,
|
|
@@ -4054,11 +4066,11 @@ const Cl = $e(
|
|
|
4054
4066
|
role: "img",
|
|
4055
4067
|
"aria-label": a,
|
|
4056
4068
|
children: [
|
|
4057
|
-
i &&
|
|
4058
|
-
|
|
4069
|
+
i && y && /* @__PURE__ */ s("path", { d: y, fill: r, opacity: 0.18 }),
|
|
4070
|
+
f && /* @__PURE__ */ s(
|
|
4059
4071
|
"path",
|
|
4060
4072
|
{
|
|
4061
|
-
d:
|
|
4073
|
+
d: f,
|
|
4062
4074
|
fill: "none",
|
|
4063
4075
|
stroke: r,
|
|
4064
4076
|
strokeWidth: o,
|
|
@@ -4066,7 +4078,7 @@ const Cl = $e(
|
|
|
4066
4078
|
strokeLinecap: "round"
|
|
4067
4079
|
}
|
|
4068
4080
|
),
|
|
4069
|
-
l &&
|
|
4081
|
+
l && L && /* @__PURE__ */ s("circle", { cx: L.x, cy: L.y, r: o + 1, fill: r })
|
|
4070
4082
|
]
|
|
4071
4083
|
}
|
|
4072
4084
|
);
|
|
@@ -4109,7 +4121,7 @@ export {
|
|
|
4109
4121
|
Yl as suggestPeriodForResolution,
|
|
4110
4122
|
Ul as suggestResolutionForPeriod,
|
|
4111
4123
|
xo as useClickOutside,
|
|
4112
|
-
|
|
4124
|
+
Mo as useFocusTrap,
|
|
4113
4125
|
Rt as useKeyboard,
|
|
4114
4126
|
Ur as useTableSort,
|
|
4115
4127
|
_l as volumeSeries
|