@overdoser/react-toolkit 0.0.11 → 0.0.13
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/components/Table/Table.d.ts +13 -1
- package/components/inputs/Select/Select.d.ts +6 -0
- package/index.js +1400 -1389
- package/llms.txt +17 -0
- package/manifest.json +3 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { forwardRef as $e, createElement as an, useState as Le, useCallback as
|
|
2
|
-
import { jsxs as
|
|
1
|
+
import { forwardRef as $e, createElement as an, useState as Le, useCallback as pe, useMemo as ke, useEffect as Ne, useLayoutEffect as jt, useRef as oe, useId as Ye, isValidElement as dn, cloneElement as Xt, createContext as _t, useContext as ft, useImperativeHandle as un } from "react";
|
|
2
|
+
import { jsxs as j, 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", Rn = "crk-shimmer-8iQSU", Sn = "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,13 +23,13 @@ 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,
|
|
31
|
-
shimmer:
|
|
32
|
-
loadingShimmer:
|
|
31
|
+
shimmer: Rn,
|
|
32
|
+
loadingShimmer: Sn,
|
|
33
33
|
shimmerSweep: Tn,
|
|
34
34
|
dots: Cn,
|
|
35
35
|
loadingDots: An,
|
|
@@ -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__ */ j(
|
|
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__ */ j("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__ */ j(
|
|
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,15 +222,15 @@ 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", Rr = "crk-sortArrowActive-yhWrO", Sr = "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,
|
|
232
|
-
sortArrowActive:
|
|
233
|
-
sortIndex:
|
|
232
|
+
sortArrowActive: Rr,
|
|
233
|
+
sortIndex: Sr,
|
|
234
234
|
row: Tr,
|
|
235
235
|
cell: Cr,
|
|
236
236
|
emptyRow: Ar,
|
|
@@ -251,38 +251,38 @@ function _r(e, t) {
|
|
|
251
251
|
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
252
252
|
}
|
|
253
253
|
function Ur(e, t = []) {
|
|
254
|
-
const [n, r] = Le(t), o =
|
|
254
|
+
const [n, r] = Le(t), o = pe((a) => {
|
|
255
255
|
r((h) => {
|
|
256
256
|
const u = h.find((d) => d.key === a);
|
|
257
257
|
return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
258
258
|
});
|
|
259
|
-
}, []), c =
|
|
259
|
+
}, []), c = pe((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, p) => p !== u);
|
|
269
269
|
});
|
|
270
|
-
}, []), i =
|
|
270
|
+
}, []), i = pe(() => {
|
|
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__ */ j("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__ */ j("nav", { className: m(ve.paginator, c?.paginator), "aria-label": "Table pagination", children: [
|
|
310
|
+
/* @__PURE__ */ j("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__ */ j("option", { value: u, children: [
|
|
320
320
|
u,
|
|
321
321
|
" / page"
|
|
322
322
|
] }, u))
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ j("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: p = "No data",
|
|
381
|
+
pagination: L,
|
|
382
|
+
classes: b
|
|
381
383
|
}) {
|
|
382
|
-
const
|
|
383
|
-
sortedData:
|
|
384
|
-
sortConfig:
|
|
385
|
-
requestSort:
|
|
386
|
-
requestMultiSort:
|
|
387
|
-
} = Ur(e, n),
|
|
388
|
-
if (!
|
|
389
|
-
const
|
|
390
|
-
return
|
|
391
|
-
}, [
|
|
392
|
-
(
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
if (
|
|
396
|
-
const
|
|
397
|
-
let
|
|
398
|
-
|
|
399
|
-
(
|
|
400
|
-
) :
|
|
384
|
+
const R = r !== void 0, {
|
|
385
|
+
sortedData: w,
|
|
386
|
+
sortConfig: J,
|
|
387
|
+
requestSort: W,
|
|
388
|
+
requestMultiSort: E
|
|
389
|
+
} = Ur(e, n), Z = R ? n ?? [] : J, C = R ? e : w, $ = ke(() => {
|
|
390
|
+
if (!L || R) return C;
|
|
391
|
+
const S = (L.page - 1) * L.pageSize;
|
|
392
|
+
return C.slice(S, S + L.pageSize);
|
|
393
|
+
}, [C, L, R]), ie = L?.totalRows ?? C.length, ne = pe(
|
|
394
|
+
(S, re) => {
|
|
395
|
+
const F = o && (re.ctrlKey || re.metaKey);
|
|
396
|
+
if (R)
|
|
397
|
+
if (F) {
|
|
398
|
+
const X = Z.findIndex((z) => z.key === S);
|
|
399
|
+
let A;
|
|
400
|
+
X === -1 ? A = [...Z, { key: S, direction: "asc" }] : Z[X].direction === "asc" ? A = Z.map(
|
|
401
|
+
(z, ce) => ce === X ? { key: S, direction: "desc" } : z
|
|
402
|
+
) : A = Z.filter((z, ce) => ce !== X), r(A);
|
|
401
403
|
} else {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
+
const X = Z.find((A) => A.key === S);
|
|
405
|
+
X ? X.direction === "asc" ? r([{ key: S, direction: "desc" }]) : r([]) : r([{ key: S, direction: "asc" }]);
|
|
404
406
|
}
|
|
405
407
|
else
|
|
406
|
-
|
|
408
|
+
F ? E(S) : W(S);
|
|
407
409
|
},
|
|
408
410
|
[
|
|
409
|
-
|
|
411
|
+
R,
|
|
410
412
|
o,
|
|
411
|
-
|
|
413
|
+
Z,
|
|
412
414
|
r,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
+
W,
|
|
416
|
+
E
|
|
415
417
|
]
|
|
416
|
-
),
|
|
417
|
-
if (
|
|
418
|
-
const
|
|
419
|
-
return
|
|
418
|
+
), V = (S) => Z.find((F) => F.key === S)?.direction, ae = (S) => {
|
|
419
|
+
if (Z.length <= 1) return;
|
|
420
|
+
const re = Z.findIndex((F) => F.key === S);
|
|
421
|
+
return re >= 0 ? re : void 0;
|
|
420
422
|
};
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ j("div", { className: m(ve.wrapper, b?.wrapper), children: [
|
|
424
|
+
/* @__PURE__ */ j(
|
|
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
|
+
b?.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((S) => /* @__PURE__ */ j(
|
|
436
438
|
"th",
|
|
437
439
|
{
|
|
438
|
-
className:
|
|
440
|
+
className: m(
|
|
439
441
|
ve.headerCell,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
+
S.sortable && ve.headerCellSortable,
|
|
443
|
+
b?.headerCell
|
|
442
444
|
),
|
|
443
445
|
style: {
|
|
444
|
-
width:
|
|
445
|
-
textAlign:
|
|
446
|
+
width: S.width,
|
|
447
|
+
textAlign: S.align
|
|
446
448
|
},
|
|
447
|
-
onClick:
|
|
448
|
-
"aria-sort":
|
|
449
|
+
onClick: S.sortable ? (re) => ne(S.key, re) : void 0,
|
|
450
|
+
"aria-sort": S.sortable ? V(S.key) === "asc" ? "ascending" : V(S.key) === "desc" ? "descending" : "none" : void 0,
|
|
449
451
|
children: [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
+
S.header,
|
|
453
|
+
S.sortable && /* @__PURE__ */ s(
|
|
452
454
|
Yr,
|
|
453
455
|
{
|
|
454
|
-
direction:
|
|
455
|
-
sortIndex:
|
|
456
|
+
direction: V(S.key),
|
|
457
|
+
sortIndex: ae(S.key)
|
|
456
458
|
}
|
|
457
459
|
)
|
|
458
460
|
]
|
|
459
461
|
},
|
|
460
|
-
|
|
462
|
+
S.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, b?.emptyCell), colSpan: t.length, children: p }) }) : $.map((S, re) => {
|
|
465
|
+
const F = u ? String(S[u]) : re, X = typeof d == "function" ? d(S, re) : d, A = typeof f == "function" ? f(S, re) : f;
|
|
466
|
+
return /* @__PURE__ */ s(
|
|
467
|
+
"tr",
|
|
466
468
|
{
|
|
467
|
-
className:
|
|
468
|
-
style:
|
|
469
|
-
children:
|
|
469
|
+
className: m(ve.row, b?.row, X),
|
|
470
|
+
style: A,
|
|
471
|
+
children: t.map((z) => /* @__PURE__ */ s(
|
|
472
|
+
"td",
|
|
473
|
+
{
|
|
474
|
+
className: m(ve.cell, b?.cell),
|
|
475
|
+
style: { textAlign: z.align },
|
|
476
|
+
children: z.render ? z.render(S[z.key], S, re) : S[z.key]
|
|
477
|
+
},
|
|
478
|
+
z.key
|
|
479
|
+
))
|
|
470
480
|
},
|
|
471
|
-
|
|
472
|
-
)
|
|
481
|
+
F
|
|
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: ie,
|
|
492
|
+
paginatorClasses: { paginator: b?.paginator, pageButton: b?.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,
|
|
@@ -501,8 +511,8 @@ const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trig
|
|
|
501
511
|
itemDisabled: so,
|
|
502
512
|
itemSelected: ao
|
|
503
513
|
};
|
|
504
|
-
function
|
|
505
|
-
const n =
|
|
514
|
+
function St(e, t = !0) {
|
|
515
|
+
const n = pe(
|
|
506
516
|
(r) => {
|
|
507
517
|
const o = e[r.key];
|
|
508
518
|
o && o(r);
|
|
@@ -546,114 +556,114 @@ const Vt = $e(
|
|
|
546
556
|
placeholder: h = "Select...",
|
|
547
557
|
value: u,
|
|
548
558
|
onChange: d,
|
|
549
|
-
error:
|
|
559
|
+
error: f = !1,
|
|
550
560
|
fullWidth: p = !0,
|
|
551
|
-
portal:
|
|
552
|
-
classes:
|
|
553
|
-
},
|
|
554
|
-
const [
|
|
561
|
+
portal: L = !0,
|
|
562
|
+
classes: b
|
|
563
|
+
}, R) => {
|
|
564
|
+
const [w, J] = Le(!1), W = oe(null), E = oe(null), Z = oe(null), C = Ye();
|
|
555
565
|
Ne(() => {
|
|
556
|
-
|
|
557
|
-
}, [
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
}, [l]),
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
return
|
|
566
|
+
w && E.current && E.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
567
|
+
}, [w]);
|
|
568
|
+
const $ = pe(() => {
|
|
569
|
+
J(!1), l?.(), Z.current?.focus();
|
|
570
|
+
}, [l]), ie = pe(() => {
|
|
571
|
+
J((A) => {
|
|
572
|
+
const z = !A;
|
|
573
|
+
return z ? i?.() : l?.(), z;
|
|
564
574
|
});
|
|
565
|
-
}, [i, l]),
|
|
566
|
-
(
|
|
567
|
-
d?.(
|
|
575
|
+
}, [i, l]), ne = pe(
|
|
576
|
+
(A) => {
|
|
577
|
+
d?.(A), $();
|
|
568
578
|
},
|
|
569
|
-
[d,
|
|
579
|
+
[d, $]
|
|
570
580
|
);
|
|
571
581
|
Ne(() => {
|
|
572
|
-
if (!
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
|
|
582
|
+
if (!w) return;
|
|
583
|
+
const A = (z) => {
|
|
584
|
+
const ce = z.target;
|
|
585
|
+
W.current?.contains(ce) || E.current?.contains(ce) || $();
|
|
576
586
|
};
|
|
577
|
-
return document.addEventListener("mousedown",
|
|
578
|
-
}, [
|
|
587
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
588
|
+
}, [w, $]), St(
|
|
579
589
|
{
|
|
580
|
-
Escape: () =>
|
|
590
|
+
Escape: () => $()
|
|
581
591
|
},
|
|
582
|
-
|
|
592
|
+
w
|
|
583
593
|
);
|
|
584
|
-
const
|
|
594
|
+
const V = Tt(Z, w && L), ae = a?.find((A) => A.value === u)?.label, S = a ? ae || h : e, re = a && !ae, F = 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
|
+
b?.item
|
|
594
604
|
),
|
|
595
|
-
disabled:
|
|
596
|
-
onClick: () =>
|
|
597
|
-
children:
|
|
605
|
+
disabled: A.disabled,
|
|
606
|
+
onClick: () => ne(A.value),
|
|
607
|
+
children: A.label
|
|
598
608
|
},
|
|
599
|
-
|
|
600
|
-
)) : t,
|
|
609
|
+
A.value
|
|
610
|
+
)) : t, X = (A) => /* @__PURE__ */ s(
|
|
601
611
|
"div",
|
|
602
612
|
{
|
|
603
|
-
ref:
|
|
604
|
-
id:
|
|
605
|
-
className:
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
n === "left" ?
|
|
609
|
-
!
|
|
610
|
-
|
|
613
|
+
ref: E,
|
|
614
|
+
id: C,
|
|
615
|
+
className: m(
|
|
616
|
+
Me.menu,
|
|
617
|
+
w && Me.menuOpen,
|
|
618
|
+
n === "left" ? Me.alignLeft : Me.alignRight,
|
|
619
|
+
!L && p && Me.fullWidth,
|
|
620
|
+
b?.menu
|
|
611
621
|
),
|
|
612
|
-
style:
|
|
622
|
+
style: A,
|
|
613
623
|
role: "menu",
|
|
614
|
-
children:
|
|
624
|
+
children: F
|
|
615
625
|
}
|
|
616
626
|
);
|
|
617
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ j(
|
|
618
628
|
"div",
|
|
619
629
|
{
|
|
620
|
-
ref:
|
|
621
|
-
className:
|
|
630
|
+
ref: R,
|
|
631
|
+
className: m(Me.root, p && Me.fullWidth, b?.root, r),
|
|
622
632
|
style: o,
|
|
623
633
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ j("div", { ref: W, style: p ? { width: "100%" } : void 0, children: [
|
|
635
|
+
/* @__PURE__ */ j(
|
|
626
636
|
"button",
|
|
627
637
|
{
|
|
628
|
-
ref:
|
|
638
|
+
ref: Z,
|
|
629
639
|
id: c,
|
|
630
640
|
type: "button",
|
|
631
|
-
className:
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
p &&
|
|
636
|
-
|
|
641
|
+
className: m(
|
|
642
|
+
Me.trigger,
|
|
643
|
+
w && Me.triggerOpen,
|
|
644
|
+
f && Me.triggerError,
|
|
645
|
+
p && Me.fullWidth,
|
|
646
|
+
b?.trigger
|
|
637
647
|
),
|
|
638
|
-
onClick:
|
|
639
|
-
"aria-expanded":
|
|
648
|
+
onClick: ie,
|
|
649
|
+
"aria-expanded": w,
|
|
640
650
|
"aria-haspopup": "menu",
|
|
641
|
-
"aria-controls":
|
|
651
|
+
"aria-controls": w ? C : void 0,
|
|
642
652
|
children: [
|
|
643
|
-
/* @__PURE__ */ s("span", { className:
|
|
644
|
-
/* @__PURE__ */ s("span", { className:
|
|
653
|
+
/* @__PURE__ */ s("span", { className: m(Me.triggerLabel, re && Me.placeholder, b?.triggerLabel), children: S }),
|
|
654
|
+
/* @__PURE__ */ s("span", { className: m(Me.chevron, b?.chevron), "aria-hidden": "true" })
|
|
645
655
|
]
|
|
646
656
|
}
|
|
647
657
|
),
|
|
648
|
-
!
|
|
658
|
+
!L && X()
|
|
649
659
|
] }),
|
|
650
|
-
|
|
651
|
-
|
|
660
|
+
L && w && typeof document < "u" && pt(
|
|
661
|
+
X({
|
|
652
662
|
position: "fixed",
|
|
653
|
-
top:
|
|
654
|
-
left: n === "right" ? void 0 :
|
|
655
|
-
right: n === "right" ? window.innerWidth - (
|
|
656
|
-
minWidth:
|
|
663
|
+
top: V.top + 4,
|
|
664
|
+
left: n === "right" ? void 0 : V.left,
|
|
665
|
+
right: n === "right" ? window.innerWidth - (V.left + V.width) : void 0,
|
|
666
|
+
minWidth: V.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 = oe(null), p = oe(null), L = oe(null), b = Ye(), R = o !== void 0, w = R ? o : u, J = pe(
|
|
741
|
+
(C) => {
|
|
742
|
+
R || d(C), c?.(C);
|
|
733
743
|
},
|
|
734
|
-
[
|
|
735
|
-
),
|
|
736
|
-
|
|
737
|
-
}, [
|
|
738
|
-
|
|
739
|
-
}, [
|
|
740
|
-
xo(
|
|
744
|
+
[R, c]
|
|
745
|
+
), W = pe(() => {
|
|
746
|
+
J(!1), L.current?.focus();
|
|
747
|
+
}, [J]), E = pe(() => {
|
|
748
|
+
J(!w);
|
|
749
|
+
}, [w, J]);
|
|
750
|
+
xo(f, W, w), St(
|
|
741
751
|
{
|
|
742
|
-
Escape: () =>
|
|
752
|
+
Escape: () => W()
|
|
743
753
|
},
|
|
744
|
-
|
|
754
|
+
w
|
|
745
755
|
), Ne(() => {
|
|
746
|
-
if (
|
|
747
|
-
const
|
|
756
|
+
if (w && p.current) {
|
|
757
|
+
const C = p.current.querySelector(
|
|
748
758
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
749
759
|
);
|
|
750
|
-
|
|
760
|
+
C ? C.focus() : p.current.focus();
|
|
751
761
|
}
|
|
752
|
-
}, [
|
|
753
|
-
let
|
|
762
|
+
}, [w]);
|
|
763
|
+
let Z;
|
|
754
764
|
if (t && dn(e)) {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
ref: ko(
|
|
758
|
-
onClick: (
|
|
759
|
-
|
|
765
|
+
const C = e, $ = C.ref;
|
|
766
|
+
Z = Xt(C, {
|
|
767
|
+
ref: ko(L, $),
|
|
768
|
+
onClick: (ie) => {
|
|
769
|
+
C.props.onClick?.(ie), E();
|
|
760
770
|
},
|
|
761
|
-
className:
|
|
762
|
-
"aria-expanded":
|
|
771
|
+
className: m(C.props.className, i?.trigger),
|
|
772
|
+
"aria-expanded": w,
|
|
763
773
|
"aria-haspopup": "dialog",
|
|
764
|
-
"aria-controls":
|
|
774
|
+
"aria-controls": w ? b : void 0
|
|
765
775
|
});
|
|
766
776
|
} else
|
|
767
|
-
|
|
777
|
+
Z = /* @__PURE__ */ s(
|
|
768
778
|
"button",
|
|
769
779
|
{
|
|
770
|
-
ref:
|
|
780
|
+
ref: L,
|
|
771
781
|
type: "button",
|
|
772
|
-
className:
|
|
773
|
-
onClick:
|
|
774
|
-
"aria-expanded":
|
|
782
|
+
className: m(at.trigger, i?.trigger),
|
|
783
|
+
onClick: E,
|
|
784
|
+
"aria-expanded": w,
|
|
775
785
|
"aria-haspopup": "dialog",
|
|
776
|
-
"aria-controls":
|
|
786
|
+
"aria-controls": w ? b : 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
|
-
|
|
788
|
-
|
|
796
|
+
children: /* @__PURE__ */ j("div", { ref: f, children: [
|
|
797
|
+
Z,
|
|
798
|
+
w && /* @__PURE__ */ s(
|
|
789
799
|
"div",
|
|
790
800
|
{
|
|
791
801
|
ref: p,
|
|
792
|
-
id:
|
|
802
|
+
id: b,
|
|
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,8 +820,8 @@ const It = [
|
|
|
810
820
|
"a[href]",
|
|
811
821
|
'[tabindex]:not([tabindex="-1"])'
|
|
812
822
|
].join(", ");
|
|
813
|
-
function
|
|
814
|
-
const n =
|
|
823
|
+
function Mo(e, t) {
|
|
824
|
+
const n = oe(null), r = pe(
|
|
815
825
|
(o) => {
|
|
816
826
|
if (o.key !== "Tab" || !e.current)
|
|
817
827
|
return;
|
|
@@ -837,13 +847,13 @@ 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", Ro = "crk-sm--xyY9", So = "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,
|
|
845
|
-
sm:
|
|
846
|
-
md:
|
|
855
|
+
sm: Ro,
|
|
856
|
+
md: So,
|
|
847
857
|
lg: To,
|
|
848
858
|
fullscreen: Co,
|
|
849
859
|
header: Ao,
|
|
@@ -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__ */ j(
|
|
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 = oe(null), p = d ?? f, L = Ye(), b = u ?? `${L}-title`;
|
|
914
|
+
Mo(p, e);
|
|
915
|
+
const R = 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
|
-
|
|
923
|
+
St(R, e), Ne(() => {
|
|
914
924
|
if (!e) return;
|
|
915
|
-
const
|
|
925
|
+
const J = document.body.style.overflow;
|
|
916
926
|
return document.body.style.overflow = "hidden", () => {
|
|
917
|
-
document.body.style.overflow =
|
|
927
|
+
document.body.style.overflow = J;
|
|
918
928
|
};
|
|
919
929
|
}, [e]);
|
|
920
|
-
const
|
|
921
|
-
n &&
|
|
930
|
+
const w = (J) => {
|
|
931
|
+
n && J.target === J.currentTarget && t();
|
|
922
932
|
};
|
|
923
933
|
return e ? pt(
|
|
924
934
|
/* @__PURE__ */ s(
|
|
925
935
|
"div",
|
|
926
936
|
{
|
|
927
|
-
className:
|
|
928
|
-
onClick:
|
|
937
|
+
className: m(ze.backdrop, c?.backdrop),
|
|
938
|
+
onClick: w,
|
|
929
939
|
role: "presentation",
|
|
930
940
|
children: /* @__PURE__ */ s(
|
|
931
941
|
"div",
|
|
932
942
|
{
|
|
933
943
|
ref: p,
|
|
934
|
-
className:
|
|
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 : b,
|
|
950
|
+
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId: b }, 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__ */ j(
|
|
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
|
-
|
|
1007
|
-
const
|
|
1008
|
-
(
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1015
|
+
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, p = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L = Yo.has(p), { ref: b, ...R } = u, w = oe(b);
|
|
1016
|
+
w.current = b;
|
|
1017
|
+
const J = pe(
|
|
1018
|
+
(W) => {
|
|
1019
|
+
if (W) {
|
|
1020
|
+
const E = W.matches("input, select, textarea, button, [tabindex]") ? W : W.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
1021
|
+
w.current(E ?? W);
|
|
1012
1022
|
} else
|
|
1013
|
-
|
|
1023
|
+
w.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__ */ j("div", { className: m(We.field, c?.field, i), style: l, children: [
|
|
1029
|
+
t && /* @__PURE__ */ j("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
|
+
...R,
|
|
1035
|
+
ref: J,
|
|
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: R.onChange,
|
|
1045
|
+
onValuesChange: R.onChange
|
|
1036
1046
|
},
|
|
1037
1047
|
// Bridge for Checkbox (expects checked, not value)
|
|
1038
|
-
checked: typeof
|
|
1048
|
+
checked: typeof R.value == "boolean" ? R.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__ */ j(
|
|
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", Ri = "crk-noResults-uicSW", Si = "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", P = {
|
|
1101
1111
|
wrapper: oi,
|
|
1102
1112
|
sm: ii,
|
|
1103
1113
|
md: ci,
|
|
@@ -1116,13 +1126,13 @@ 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,
|
|
1124
|
-
noResults:
|
|
1125
|
-
multiTrigger:
|
|
1134
|
+
noResults: Ri,
|
|
1135
|
+
multiTrigger: Si,
|
|
1126
1136
|
multiTriggerDisabled: Ti,
|
|
1127
1137
|
chip: Ci,
|
|
1128
1138
|
chipLabel: Ai,
|
|
@@ -1144,12 +1154,12 @@ 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__ */ j("div", { className: m(P.wrapper, P[e], t && P.error, o?.wrapper, c), style: i, children: [
|
|
1158
|
+
/* @__PURE__ */ j(
|
|
1149
1159
|
"select",
|
|
1150
1160
|
{
|
|
1151
|
-
ref:
|
|
1152
|
-
className:
|
|
1161
|
+
ref: f,
|
|
1162
|
+
className: m(P.root, P[e], t && P.error, o?.root),
|
|
1153
1163
|
...d,
|
|
1154
1164
|
children: [
|
|
1155
1165
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
@@ -1157,7 +1167,7 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1157
1167
|
]
|
|
1158
1168
|
}
|
|
1159
1169
|
),
|
|
1160
|
-
/* @__PURE__ */ s("span", { className:
|
|
1170
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, o?.arrow) })
|
|
1161
1171
|
] })
|
|
1162
1172
|
);
|
|
1163
1173
|
Qt.displayName = "NativeSelect";
|
|
@@ -1175,85 +1185,85 @@ const Jt = $e(
|
|
|
1175
1185
|
id: h,
|
|
1176
1186
|
searchPlaceholder: u = "Search...",
|
|
1177
1187
|
onChange: d,
|
|
1178
|
-
onValueChange:
|
|
1188
|
+
onValueChange: f,
|
|
1179
1189
|
portal: p = !0
|
|
1180
|
-
},
|
|
1181
|
-
const [
|
|
1190
|
+
}, L) => {
|
|
1191
|
+
const [b, R] = Le(!1), [w, J] = Le(""), [W, E] = Le(0), Z = oe(null), C = oe(null), $ = oe(null), ie = oe(null), ne = oe(null), V = Ye(), ae = Tt($, b && p), S = oe(null), re = L ?? S, F = oe(!1);
|
|
1182
1192
|
Ne(() => {
|
|
1183
|
-
|
|
1184
|
-
}, [
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
}, []),
|
|
1188
|
-
a || (
|
|
1189
|
-
}, [a]),
|
|
1190
|
-
(
|
|
1191
|
-
if (
|
|
1193
|
+
F.current && !b && $.current?.focus(), F.current = b;
|
|
1194
|
+
}, [b]);
|
|
1195
|
+
const X = pe(() => {
|
|
1196
|
+
R(!1), J(""), E(0);
|
|
1197
|
+
}, []), A = pe(() => {
|
|
1198
|
+
a || (R(!0), J(""), E(0), setTimeout(() => C.current?.focus(), 0));
|
|
1199
|
+
}, [a]), z = pe(
|
|
1200
|
+
(N) => {
|
|
1201
|
+
if (f?.(N), re.current) {
|
|
1192
1202
|
Object.getOwnPropertyDescriptor(
|
|
1193
1203
|
HTMLSelectElement.prototype,
|
|
1194
1204
|
"value"
|
|
1195
|
-
)?.set?.call(
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1205
|
+
)?.set?.call(re.current, N);
|
|
1206
|
+
const v = new Event("change", { bubbles: !0 });
|
|
1207
|
+
re.current.dispatchEvent(v), d?.(v);
|
|
1198
1208
|
}
|
|
1199
|
-
|
|
1209
|
+
X();
|
|
1200
1210
|
},
|
|
1201
|
-
[
|
|
1202
|
-
),
|
|
1203
|
-
if (!
|
|
1204
|
-
const
|
|
1205
|
-
return n.filter((y) => y.label.toLowerCase().includes(
|
|
1206
|
-
}, [n,
|
|
1211
|
+
[f, d, re, X]
|
|
1212
|
+
), ce = ke(() => {
|
|
1213
|
+
if (!w) return n;
|
|
1214
|
+
const N = w.toLowerCase();
|
|
1215
|
+
return n.filter((y) => y.label.toLowerCase().includes(N));
|
|
1216
|
+
}, [n, w]);
|
|
1207
1217
|
Ne(() => {
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1211
|
-
if (!
|
|
1212
|
-
const
|
|
1213
|
-
if (!
|
|
1214
|
-
|
|
1215
|
-
}, [
|
|
1216
|
-
const
|
|
1217
|
-
(
|
|
1218
|
-
const y =
|
|
1218
|
+
const N = ce.findIndex((y) => !y.disabled);
|
|
1219
|
+
E(N >= 0 ? N : 0);
|
|
1220
|
+
}, [ce]), Ne(() => {
|
|
1221
|
+
if (!b) return;
|
|
1222
|
+
const N = ne.current;
|
|
1223
|
+
if (!N) return;
|
|
1224
|
+
N.querySelectorAll('[role="option"]')[W]?.scrollIntoView?.({ block: "nearest" });
|
|
1225
|
+
}, [W, b]);
|
|
1226
|
+
const me = pe(
|
|
1227
|
+
(N) => {
|
|
1228
|
+
const y = ce.map((v, B) => v.disabled ? -1 : B).filter((v) => v >= 0);
|
|
1219
1229
|
if (y.length !== 0)
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
return
|
|
1230
|
+
if (N.key === "ArrowDown")
|
|
1231
|
+
N.preventDefault(), E((v) => {
|
|
1232
|
+
const B = y.indexOf(v);
|
|
1233
|
+
return B < y.length - 1 ? y[B + 1] : y[0];
|
|
1224
1234
|
});
|
|
1225
|
-
else if (
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1235
|
+
else if (N.key === "ArrowUp")
|
|
1236
|
+
N.preventDefault(), E((v) => {
|
|
1237
|
+
const B = y.indexOf(v);
|
|
1238
|
+
return B > 0 ? y[B - 1] : y[y.length - 1];
|
|
1229
1239
|
});
|
|
1230
|
-
else if (
|
|
1231
|
-
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
} else
|
|
1240
|
+
else if (N.key === "Enter") {
|
|
1241
|
+
N.preventDefault();
|
|
1242
|
+
const v = ce[W];
|
|
1243
|
+
v && !v.disabled && z(v.value);
|
|
1244
|
+
} else N.key === "Escape" && (N.preventDefault(), X());
|
|
1235
1245
|
},
|
|
1236
|
-
[
|
|
1246
|
+
[ce, W, z, X]
|
|
1237
1247
|
);
|
|
1238
1248
|
Ne(() => {
|
|
1239
|
-
if (!
|
|
1240
|
-
const
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1249
|
+
if (!b) return;
|
|
1250
|
+
const N = (y) => {
|
|
1251
|
+
const v = y.target;
|
|
1252
|
+
Z.current?.contains(v) || ie.current?.contains(v) || X();
|
|
1243
1253
|
};
|
|
1244
|
-
return document.addEventListener("mousedown",
|
|
1245
|
-
}, [
|
|
1246
|
-
const
|
|
1247
|
-
return /* @__PURE__ */
|
|
1254
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
1255
|
+
}, [b, X]);
|
|
1256
|
+
const K = n.find((N) => N.value === l)?.label, H = ce.filter((N) => !N.disabled);
|
|
1257
|
+
return /* @__PURE__ */ j(
|
|
1248
1258
|
"div",
|
|
1249
1259
|
{
|
|
1250
|
-
ref:
|
|
1251
|
-
className:
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
t &&
|
|
1256
|
-
a &&
|
|
1260
|
+
ref: Z,
|
|
1261
|
+
className: m(
|
|
1262
|
+
P.wrapper,
|
|
1263
|
+
P.searchableWrapper,
|
|
1264
|
+
P[e],
|
|
1265
|
+
t && P.error,
|
|
1266
|
+
a && P.disabled,
|
|
1257
1267
|
o?.wrapper,
|
|
1258
1268
|
c
|
|
1259
1269
|
),
|
|
@@ -1262,104 +1272,104 @@ const Jt = $e(
|
|
|
1262
1272
|
/* @__PURE__ */ s(
|
|
1263
1273
|
"select",
|
|
1264
1274
|
{
|
|
1265
|
-
ref:
|
|
1266
|
-
className:
|
|
1275
|
+
ref: re,
|
|
1276
|
+
className: P.hiddenSelect,
|
|
1267
1277
|
value: l ?? "",
|
|
1268
1278
|
disabled: a,
|
|
1269
1279
|
tabIndex: -1,
|
|
1270
1280
|
"aria-hidden": "true",
|
|
1271
1281
|
onChange: () => {
|
|
1272
1282
|
},
|
|
1273
|
-
children: n.map((
|
|
1283
|
+
children: n.map((N) => /* @__PURE__ */ s("option", { value: N.value, children: N.label }, N.value))
|
|
1274
1284
|
}
|
|
1275
1285
|
),
|
|
1276
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ j(
|
|
1277
1287
|
"button",
|
|
1278
1288
|
{
|
|
1279
|
-
ref:
|
|
1289
|
+
ref: $,
|
|
1280
1290
|
id: h,
|
|
1281
1291
|
type: "button",
|
|
1282
|
-
className:
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
t &&
|
|
1288
|
-
|
|
1292
|
+
className: m(
|
|
1293
|
+
P.root,
|
|
1294
|
+
P.searchableTrigger,
|
|
1295
|
+
P[e],
|
|
1296
|
+
b && P.triggerOpen,
|
|
1297
|
+
t && P.error,
|
|
1298
|
+
b && P.visuallyHidden,
|
|
1289
1299
|
o?.root
|
|
1290
1300
|
),
|
|
1291
|
-
onClick:
|
|
1301
|
+
onClick: A,
|
|
1292
1302
|
disabled: a,
|
|
1293
|
-
"aria-expanded":
|
|
1303
|
+
"aria-expanded": b,
|
|
1294
1304
|
"aria-haspopup": "listbox",
|
|
1295
|
-
"aria-controls":
|
|
1305
|
+
"aria-controls": b ? V : void 0,
|
|
1296
1306
|
children: [
|
|
1297
|
-
/* @__PURE__ */ s("span", { className:
|
|
1298
|
-
/* @__PURE__ */ s("span", { className:
|
|
1307
|
+
/* @__PURE__ */ s("span", { className: m(P.triggerLabel, !K && P.placeholder), children: K || r }),
|
|
1308
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowInline, o?.arrow) })
|
|
1299
1309
|
]
|
|
1300
1310
|
}
|
|
1301
1311
|
),
|
|
1302
|
-
|
|
1312
|
+
b && /* @__PURE__ */ s(
|
|
1303
1313
|
"input",
|
|
1304
1314
|
{
|
|
1305
|
-
ref:
|
|
1315
|
+
ref: C,
|
|
1306
1316
|
type: "text",
|
|
1307
1317
|
role: "combobox",
|
|
1308
|
-
className:
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
t &&
|
|
1318
|
+
className: m(
|
|
1319
|
+
P.root,
|
|
1320
|
+
P.searchableTrigger,
|
|
1321
|
+
P[e],
|
|
1322
|
+
P.triggerOpen,
|
|
1323
|
+
t && P.error,
|
|
1314
1324
|
o?.root,
|
|
1315
1325
|
o?.search
|
|
1316
1326
|
),
|
|
1317
|
-
placeholder:
|
|
1318
|
-
value:
|
|
1319
|
-
onChange: (
|
|
1320
|
-
onKeyDown:
|
|
1327
|
+
placeholder: K || r,
|
|
1328
|
+
value: w,
|
|
1329
|
+
onChange: (N) => J(N.target.value),
|
|
1330
|
+
onKeyDown: me,
|
|
1321
1331
|
"aria-expanded": !0,
|
|
1322
1332
|
"aria-haspopup": "listbox",
|
|
1323
|
-
"aria-controls":
|
|
1324
|
-
"aria-activedescendant":
|
|
1333
|
+
"aria-controls": V,
|
|
1334
|
+
"aria-activedescendant": H.length > 0 ? `select-option-${ce[W]?.value}` : void 0
|
|
1325
1335
|
}
|
|
1326
1336
|
),
|
|
1327
|
-
|
|
1328
|
-
const
|
|
1337
|
+
b && (() => {
|
|
1338
|
+
const N = p ? {
|
|
1329
1339
|
position: "fixed",
|
|
1330
|
-
top:
|
|
1331
|
-
left:
|
|
1340
|
+
top: ae.top + 4,
|
|
1341
|
+
left: ae.left,
|
|
1332
1342
|
right: "auto",
|
|
1333
|
-
width:
|
|
1343
|
+
width: ae.width,
|
|
1334
1344
|
zIndex: "var(--crk-z-floating)"
|
|
1335
1345
|
} : void 0, y = /* @__PURE__ */ s(
|
|
1336
1346
|
"div",
|
|
1337
1347
|
{
|
|
1338
|
-
id:
|
|
1339
|
-
ref:
|
|
1340
|
-
className:
|
|
1341
|
-
style:
|
|
1348
|
+
id: V,
|
|
1349
|
+
ref: ie,
|
|
1350
|
+
className: m(P.menu, o?.menu),
|
|
1351
|
+
style: N,
|
|
1342
1352
|
role: "listbox",
|
|
1343
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
1353
|
+
children: /* @__PURE__ */ s("div", { className: P.menuItems, ref: ne, children: ce.length === 0 ? /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }) : ce.map((v, B) => /* @__PURE__ */ s(
|
|
1344
1354
|
"button",
|
|
1345
1355
|
{
|
|
1346
|
-
id: `select-option-${
|
|
1356
|
+
id: `select-option-${v.value}`,
|
|
1347
1357
|
type: "button",
|
|
1348
1358
|
role: "option",
|
|
1349
|
-
"aria-selected":
|
|
1350
|
-
className:
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1359
|
+
"aria-selected": v.value === l,
|
|
1360
|
+
className: m(
|
|
1361
|
+
P.item,
|
|
1362
|
+
v.disabled && P.itemDisabled,
|
|
1363
|
+
v.value === l && P.itemSelected,
|
|
1364
|
+
B === W && P.itemHighlighted,
|
|
1355
1365
|
o?.item
|
|
1356
1366
|
),
|
|
1357
|
-
disabled:
|
|
1358
|
-
onClick: () =>
|
|
1359
|
-
onMouseEnter: () =>
|
|
1360
|
-
children:
|
|
1367
|
+
disabled: v.disabled,
|
|
1368
|
+
onClick: () => z(v.value),
|
|
1369
|
+
onMouseEnter: () => E(B),
|
|
1370
|
+
children: v.content ?? v.label
|
|
1361
1371
|
},
|
|
1362
|
-
|
|
1372
|
+
v.value
|
|
1363
1373
|
)) })
|
|
1364
1374
|
}
|
|
1365
1375
|
);
|
|
@@ -1385,97 +1395,98 @@ const en = $e(
|
|
|
1385
1395
|
id: h,
|
|
1386
1396
|
searchPlaceholder: u,
|
|
1387
1397
|
onValuesChange: d,
|
|
1388
|
-
clearSearchOnSelect:
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1398
|
+
clearSearchOnSelect: f = !0,
|
|
1399
|
+
closeOnSelect: p = !0,
|
|
1400
|
+
allowCreate: L = !1,
|
|
1401
|
+
onCreate: b,
|
|
1402
|
+
createLabel: R,
|
|
1403
|
+
portal: w = !0
|
|
1404
|
+
}, J) => {
|
|
1405
|
+
const W = Array.isArray(l) ? l : l ? [l] : [], [E, Z] = Le(!1), [C, $] = Le(""), [ie, ne] = Le(0), V = oe(null), ae = oe(null), S = oe(null), re = oe(null), F = oe(null), X = Ye(), A = Tt(F, E && w), z = oe(null), ce = J ?? z, me = pe(() => {
|
|
1406
|
+
Z(!1), $(""), ne(0);
|
|
1407
|
+
}, []), K = pe(() => {
|
|
1408
|
+
a || (Z(!0), $(""), ne(0), setTimeout(() => ae.current?.focus(), 0));
|
|
1409
|
+
}, [a]), H = pe(
|
|
1410
|
+
(k) => {
|
|
1411
|
+
const G = W.includes(k) ? W.filter((O) => O !== k) : [...W, k];
|
|
1412
|
+
d?.(G), p ? me() : f && $("");
|
|
1402
1413
|
},
|
|
1403
|
-
[
|
|
1404
|
-
),
|
|
1405
|
-
(
|
|
1406
|
-
|
|
1414
|
+
[W, d, p, me, f]
|
|
1415
|
+
), N = pe(
|
|
1416
|
+
(k, G) => {
|
|
1417
|
+
G.stopPropagation(), d?.(W.filter((O) => O !== k));
|
|
1407
1418
|
},
|
|
1408
|
-
[
|
|
1409
|
-
),
|
|
1410
|
-
if (!
|
|
1411
|
-
const
|
|
1412
|
-
return n.filter((
|
|
1413
|
-
}, [n,
|
|
1414
|
-
(
|
|
1415
|
-
) && !
|
|
1416
|
-
|
|
1417
|
-
}, [
|
|
1419
|
+
[W, d]
|
|
1420
|
+
), y = ke(() => {
|
|
1421
|
+
if (!C) return n;
|
|
1422
|
+
const k = C.toLowerCase();
|
|
1423
|
+
return n.filter((G) => G.label.toLowerCase().includes(k));
|
|
1424
|
+
}, [n, C]), v = C.trim(), B = L && v.length > 0 && !n.some(
|
|
1425
|
+
(k) => k.label.toLowerCase() === v.toLowerCase() || k.value === v
|
|
1426
|
+
) && !W.includes(v), _ = pe(() => {
|
|
1427
|
+
v && (W.includes(v) || (b?.(v), d?.([...W, v]), p ? me() : f && $("")));
|
|
1428
|
+
}, [v, W, b, d, p, me, f]);
|
|
1418
1429
|
Ne(() => {
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1421
|
-
}, [
|
|
1422
|
-
if (!
|
|
1423
|
-
const
|
|
1424
|
-
if (!
|
|
1425
|
-
|
|
1426
|
-
}, [
|
|
1427
|
-
const
|
|
1428
|
-
(
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
|
|
1430
|
+
const k = y.findIndex((G) => !G.disabled);
|
|
1431
|
+
ne(k >= 0 ? k : 0);
|
|
1432
|
+
}, [y]), Ne(() => {
|
|
1433
|
+
if (!E) return;
|
|
1434
|
+
const k = re.current;
|
|
1435
|
+
if (!k) return;
|
|
1436
|
+
k.querySelectorAll('[role="option"]')[ie]?.scrollIntoView?.({ block: "nearest" });
|
|
1437
|
+
}, [ie, E]);
|
|
1438
|
+
const q = y.length, U = pe(
|
|
1439
|
+
(k) => {
|
|
1440
|
+
const G = y.map((O, le) => O.disabled ? -1 : le).filter((O) => O >= 0);
|
|
1441
|
+
if (B && G.push(q), k.key === "Backspace" && C === "" && W.length > 0) {
|
|
1442
|
+
k.preventDefault(), d?.(W.slice(0, -1));
|
|
1432
1443
|
return;
|
|
1433
1444
|
}
|
|
1434
|
-
if (
|
|
1435
|
-
if (
|
|
1436
|
-
if (
|
|
1437
|
-
|
|
1445
|
+
if (G.length !== 0)
|
|
1446
|
+
if (k.key === "ArrowDown") {
|
|
1447
|
+
if (k.preventDefault(), !E) {
|
|
1448
|
+
K();
|
|
1438
1449
|
return;
|
|
1439
1450
|
}
|
|
1440
|
-
|
|
1441
|
-
const
|
|
1442
|
-
return
|
|
1451
|
+
ne((O) => {
|
|
1452
|
+
const le = G.indexOf(O);
|
|
1453
|
+
return le < G.length - 1 ? G[le + 1] : G[0];
|
|
1443
1454
|
});
|
|
1444
|
-
} else if (
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1455
|
+
} else if (k.key === "ArrowUp")
|
|
1456
|
+
k.preventDefault(), ne((O) => {
|
|
1457
|
+
const le = G.indexOf(O);
|
|
1458
|
+
return le > 0 ? G[le - 1] : G[G.length - 1];
|
|
1448
1459
|
});
|
|
1449
|
-
else if (
|
|
1450
|
-
if (
|
|
1451
|
-
|
|
1460
|
+
else if (k.key === "Enter") {
|
|
1461
|
+
if (k.preventDefault(), B && ie === q) {
|
|
1462
|
+
_();
|
|
1452
1463
|
return;
|
|
1453
1464
|
}
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
} else
|
|
1465
|
+
const O = y[ie];
|
|
1466
|
+
O && !O.disabled ? H(O.value) : B && _();
|
|
1467
|
+
} else k.key === "Escape" && (k.preventDefault(), me());
|
|
1457
1468
|
},
|
|
1458
|
-
[
|
|
1469
|
+
[y, ie, H, me, C, W, d, E, K, B, _, q]
|
|
1459
1470
|
);
|
|
1460
1471
|
Ne(() => {
|
|
1461
|
-
if (!
|
|
1462
|
-
const
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1472
|
+
if (!E) return;
|
|
1473
|
+
const k = (G) => {
|
|
1474
|
+
const O = G.target;
|
|
1475
|
+
V.current?.contains(O) || S.current?.contains(O) || me();
|
|
1465
1476
|
};
|
|
1466
|
-
return document.addEventListener("mousedown",
|
|
1467
|
-
}, [
|
|
1468
|
-
const
|
|
1469
|
-
return /* @__PURE__ */
|
|
1477
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
1478
|
+
}, [E, me]);
|
|
1479
|
+
const ee = W.map((k) => n.find((O) => O.value === k) ?? { value: k, label: k });
|
|
1480
|
+
return /* @__PURE__ */ j(
|
|
1470
1481
|
"div",
|
|
1471
1482
|
{
|
|
1472
|
-
ref:
|
|
1473
|
-
className:
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
t &&
|
|
1478
|
-
a &&
|
|
1483
|
+
ref: V,
|
|
1484
|
+
className: m(
|
|
1485
|
+
P.wrapper,
|
|
1486
|
+
P.searchableWrapper,
|
|
1487
|
+
P[e],
|
|
1488
|
+
t && P.error,
|
|
1489
|
+
a && P.disabled,
|
|
1479
1490
|
o?.wrapper,
|
|
1480
1491
|
c
|
|
1481
1492
|
),
|
|
@@ -1484,135 +1495,135 @@ const en = $e(
|
|
|
1484
1495
|
/* @__PURE__ */ s(
|
|
1485
1496
|
"select",
|
|
1486
1497
|
{
|
|
1487
|
-
ref:
|
|
1488
|
-
className:
|
|
1498
|
+
ref: ce,
|
|
1499
|
+
className: P.hiddenSelect,
|
|
1489
1500
|
multiple: !0,
|
|
1490
|
-
value:
|
|
1501
|
+
value: W,
|
|
1491
1502
|
disabled: a,
|
|
1492
1503
|
tabIndex: -1,
|
|
1493
1504
|
"aria-hidden": "true",
|
|
1494
1505
|
onChange: () => {
|
|
1495
1506
|
},
|
|
1496
|
-
children: n.map((
|
|
1507
|
+
children: n.map((k) => /* @__PURE__ */ s("option", { value: k.value, children: k.label }, k.value))
|
|
1497
1508
|
}
|
|
1498
1509
|
),
|
|
1499
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ j(
|
|
1500
1511
|
"div",
|
|
1501
1512
|
{
|
|
1502
|
-
ref:
|
|
1503
|
-
className:
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
t &&
|
|
1508
|
-
a &&
|
|
1513
|
+
ref: F,
|
|
1514
|
+
className: m(
|
|
1515
|
+
P.multiTrigger,
|
|
1516
|
+
P[e],
|
|
1517
|
+
E && P.triggerOpen,
|
|
1518
|
+
t && P.error,
|
|
1519
|
+
a && P.multiTriggerDisabled,
|
|
1509
1520
|
o?.root
|
|
1510
1521
|
),
|
|
1511
1522
|
onClick: () => {
|
|
1512
|
-
|
|
1523
|
+
E ? ae.current?.focus() : K();
|
|
1513
1524
|
},
|
|
1514
1525
|
role: "combobox",
|
|
1515
|
-
"aria-expanded":
|
|
1526
|
+
"aria-expanded": E,
|
|
1516
1527
|
"aria-haspopup": "listbox",
|
|
1517
|
-
"aria-controls":
|
|
1528
|
+
"aria-controls": E ? X : void 0,
|
|
1518
1529
|
children: [
|
|
1519
|
-
|
|
1520
|
-
/* @__PURE__ */ s("span", { className:
|
|
1530
|
+
ee.map((k) => /* @__PURE__ */ j("span", { className: m(P.chip, o?.chip), children: [
|
|
1531
|
+
/* @__PURE__ */ s("span", { className: P.chipLabel, children: k.content ?? k.label }),
|
|
1521
1532
|
/* @__PURE__ */ s(
|
|
1522
1533
|
"button",
|
|
1523
1534
|
{
|
|
1524
1535
|
type: "button",
|
|
1525
|
-
className:
|
|
1526
|
-
onClick: (
|
|
1527
|
-
"aria-label": `Remove ${
|
|
1536
|
+
className: m(P.chipRemove, o?.chipRemove),
|
|
1537
|
+
onClick: (G) => N(k.value, G),
|
|
1538
|
+
"aria-label": `Remove ${k.label}`,
|
|
1528
1539
|
tabIndex: -1,
|
|
1529
1540
|
children: "×"
|
|
1530
1541
|
}
|
|
1531
1542
|
)
|
|
1532
|
-
] },
|
|
1543
|
+
] }, k.value)),
|
|
1533
1544
|
/* @__PURE__ */ s(
|
|
1534
1545
|
"input",
|
|
1535
1546
|
{
|
|
1536
|
-
ref:
|
|
1547
|
+
ref: ae,
|
|
1537
1548
|
id: h,
|
|
1538
1549
|
type: "text",
|
|
1539
|
-
className:
|
|
1540
|
-
placeholder:
|
|
1541
|
-
value:
|
|
1542
|
-
onChange: (
|
|
1543
|
-
|
|
1550
|
+
className: P.multiSearch,
|
|
1551
|
+
placeholder: W.length === 0 ? r : "",
|
|
1552
|
+
value: C,
|
|
1553
|
+
onChange: (k) => {
|
|
1554
|
+
$(k.target.value), E || K();
|
|
1544
1555
|
},
|
|
1545
|
-
onKeyDown:
|
|
1556
|
+
onKeyDown: U,
|
|
1546
1557
|
disabled: a,
|
|
1547
1558
|
"aria-label": "Search options"
|
|
1548
1559
|
}
|
|
1549
1560
|
),
|
|
1550
|
-
/* @__PURE__ */ s("span", { className:
|
|
1561
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowMulti, o?.arrow) })
|
|
1551
1562
|
]
|
|
1552
1563
|
}
|
|
1553
1564
|
),
|
|
1554
|
-
|
|
1555
|
-
const
|
|
1565
|
+
E && (() => {
|
|
1566
|
+
const k = w ? {
|
|
1556
1567
|
position: "fixed",
|
|
1557
|
-
top:
|
|
1558
|
-
left:
|
|
1568
|
+
top: A.top + 4,
|
|
1569
|
+
left: A.left,
|
|
1559
1570
|
right: "auto",
|
|
1560
|
-
width:
|
|
1571
|
+
width: A.width,
|
|
1561
1572
|
zIndex: "var(--crk-z-floating)"
|
|
1562
|
-
} : void 0,
|
|
1573
|
+
} : void 0, G = /* @__PURE__ */ s(
|
|
1563
1574
|
"div",
|
|
1564
1575
|
{
|
|
1565
|
-
id:
|
|
1566
|
-
ref:
|
|
1567
|
-
className:
|
|
1568
|
-
style:
|
|
1576
|
+
id: X,
|
|
1577
|
+
ref: S,
|
|
1578
|
+
className: m(P.menu, o?.menu),
|
|
1579
|
+
style: k,
|
|
1569
1580
|
role: "listbox",
|
|
1570
1581
|
"aria-multiselectable": "true",
|
|
1571
|
-
children: /* @__PURE__ */
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
const
|
|
1575
|
-
return /* @__PURE__ */
|
|
1582
|
+
children: /* @__PURE__ */ j("div", { className: P.menuItems, ref: re, children: [
|
|
1583
|
+
y.length === 0 && !B && /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }),
|
|
1584
|
+
y.map((O, le) => {
|
|
1585
|
+
const ge = W.includes(O.value);
|
|
1586
|
+
return /* @__PURE__ */ j(
|
|
1576
1587
|
"button",
|
|
1577
1588
|
{
|
|
1578
|
-
id: `select-option-${
|
|
1589
|
+
id: `select-option-${O.value}`,
|
|
1579
1590
|
type: "button",
|
|
1580
1591
|
role: "option",
|
|
1581
|
-
"aria-selected":
|
|
1582
|
-
className:
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1592
|
+
"aria-selected": ge,
|
|
1593
|
+
className: m(
|
|
1594
|
+
P.item,
|
|
1595
|
+
O.disabled && P.itemDisabled,
|
|
1596
|
+
ge && P.itemSelected,
|
|
1597
|
+
le === ie && P.itemHighlighted,
|
|
1587
1598
|
o?.item
|
|
1588
1599
|
),
|
|
1589
|
-
disabled:
|
|
1590
|
-
onClick: () =>
|
|
1591
|
-
onMouseEnter: () =>
|
|
1600
|
+
disabled: O.disabled,
|
|
1601
|
+
onClick: () => H(O.value),
|
|
1602
|
+
onMouseEnter: () => ne(le),
|
|
1592
1603
|
children: [
|
|
1593
|
-
|
|
1594
|
-
|
|
1604
|
+
ge && /* @__PURE__ */ s("span", { className: P.itemCheck, "aria-hidden": "true" }),
|
|
1605
|
+
O.content ?? O.label
|
|
1595
1606
|
]
|
|
1596
1607
|
},
|
|
1597
|
-
|
|
1608
|
+
O.value
|
|
1598
1609
|
);
|
|
1599
1610
|
}),
|
|
1600
|
-
|
|
1611
|
+
B && /* @__PURE__ */ s(
|
|
1601
1612
|
"button",
|
|
1602
1613
|
{
|
|
1603
1614
|
type: "button",
|
|
1604
1615
|
role: "option",
|
|
1605
1616
|
"aria-selected": !1,
|
|
1606
|
-
className:
|
|
1607
|
-
|
|
1608
|
-
|
|
1617
|
+
className: m(
|
|
1618
|
+
P.item,
|
|
1619
|
+
ie === q && P.itemHighlighted,
|
|
1609
1620
|
o?.item
|
|
1610
1621
|
),
|
|
1611
|
-
onClick:
|
|
1612
|
-
onMouseEnter: () =>
|
|
1613
|
-
children:
|
|
1622
|
+
onClick: _,
|
|
1623
|
+
onMouseEnter: () => ne(q),
|
|
1624
|
+
children: R ? R(v) : /* @__PURE__ */ j(je, { children: [
|
|
1614
1625
|
"Create “",
|
|
1615
|
-
/* @__PURE__ */ s("strong", { children:
|
|
1626
|
+
/* @__PURE__ */ s("strong", { children: v }),
|
|
1616
1627
|
"”"
|
|
1617
1628
|
] })
|
|
1618
1629
|
},
|
|
@@ -1621,7 +1632,7 @@ const en = $e(
|
|
|
1621
1632
|
] })
|
|
1622
1633
|
}
|
|
1623
1634
|
);
|
|
1624
|
-
return
|
|
1635
|
+
return w && typeof document < "u" ? pt(G, document.body) : G;
|
|
1625
1636
|
})()
|
|
1626
1637
|
]
|
|
1627
1638
|
}
|
|
@@ -1647,13 +1658,13 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1647
1658
|
style: o,
|
|
1648
1659
|
...c
|
|
1649
1660
|
}, i) => {
|
|
1650
|
-
const l =
|
|
1661
|
+
const l = oe(null);
|
|
1651
1662
|
return Ne(() => {
|
|
1652
1663
|
l.current && (l.current.indeterminate = t);
|
|
1653
|
-
}, [t]), /* @__PURE__ */
|
|
1664
|
+
}, [t]), /* @__PURE__ */ j(
|
|
1654
1665
|
"label",
|
|
1655
1666
|
{
|
|
1656
|
-
className:
|
|
1667
|
+
className: m(dt.root, t && dt.indeterminate, n?.root, r),
|
|
1657
1668
|
style: o,
|
|
1658
1669
|
children: [
|
|
1659
1670
|
/* @__PURE__ */ s(
|
|
@@ -1663,11 +1674,11 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1663
1674
|
l.current = a, typeof i == "function" ? i(a) : i && (i.current = a);
|
|
1664
1675
|
},
|
|
1665
1676
|
type: "checkbox",
|
|
1666
|
-
className:
|
|
1677
|
+
className: m(dt.input, n?.input),
|
|
1667
1678
|
...c
|
|
1668
1679
|
}
|
|
1669
1680
|
),
|
|
1670
|
-
e && /* @__PURE__ */ s("span", { className:
|
|
1681
|
+
e && /* @__PURE__ */ s("span", { className: m(dt.label, n?.label), children: e })
|
|
1671
1682
|
]
|
|
1672
1683
|
}
|
|
1673
1684
|
);
|
|
@@ -1694,7 +1705,7 @@ const ji = "crk-group-NNwCD", Xi = "crk-root-7fGik", _i = "crk-input-43PQW", Ui
|
|
|
1694
1705
|
"div",
|
|
1695
1706
|
{
|
|
1696
1707
|
id: i,
|
|
1697
|
-
className:
|
|
1708
|
+
className: m(ht.group, r),
|
|
1698
1709
|
style: o,
|
|
1699
1710
|
role: "radiogroup",
|
|
1700
1711
|
tabIndex: -1,
|
|
@@ -1717,24 +1728,24 @@ const Vi = $e(
|
|
|
1717
1728
|
name: l,
|
|
1718
1729
|
...a
|
|
1719
1730
|
}, h) => {
|
|
1720
|
-
const u = ft(tn), d = u?.name ?? l,
|
|
1721
|
-
u?.onChange?.(t), c?.(
|
|
1731
|
+
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i, p = (L) => {
|
|
1732
|
+
u?.onChange?.(t), c?.(L);
|
|
1722
1733
|
};
|
|
1723
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ j("label", { className: m(ht.root, n?.root, r), style: o, children: [
|
|
1724
1735
|
/* @__PURE__ */ s(
|
|
1725
1736
|
"input",
|
|
1726
1737
|
{
|
|
1727
1738
|
ref: h,
|
|
1728
1739
|
type: "radio",
|
|
1729
|
-
className:
|
|
1740
|
+
className: m(ht.input, n?.input),
|
|
1730
1741
|
name: d,
|
|
1731
1742
|
value: t,
|
|
1732
|
-
checked:
|
|
1743
|
+
checked: f,
|
|
1733
1744
|
onChange: p,
|
|
1734
1745
|
...a
|
|
1735
1746
|
}
|
|
1736
1747
|
),
|
|
1737
|
-
e && /* @__PURE__ */ s("span", { className:
|
|
1748
|
+
e && /* @__PURE__ */ s("span", { className: m(ht.label, n?.label), children: e })
|
|
1738
1749
|
] });
|
|
1739
1750
|
}
|
|
1740
1751
|
);
|
|
@@ -1766,14 +1777,14 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1766
1777
|
onChange: i,
|
|
1767
1778
|
...l
|
|
1768
1779
|
}, a) => {
|
|
1769
|
-
const h =
|
|
1780
|
+
const h = oe(null), u = pe(() => {
|
|
1770
1781
|
const p = h.current;
|
|
1771
1782
|
p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
|
|
1772
1783
|
}, []), d = l.value ?? "";
|
|
1773
1784
|
Ne(() => {
|
|
1774
1785
|
r && u();
|
|
1775
1786
|
}, [r, u, d]);
|
|
1776
|
-
const
|
|
1787
|
+
const f = pe(
|
|
1777
1788
|
(p) => {
|
|
1778
1789
|
r && u(), i?.(p);
|
|
1779
1790
|
},
|
|
@@ -1785,7 +1796,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1785
1796
|
ref: (p) => {
|
|
1786
1797
|
h.current = p, typeof a == "function" ? a(p) : a && (a.current = p);
|
|
1787
1798
|
},
|
|
1788
|
-
className:
|
|
1799
|
+
className: m(
|
|
1789
1800
|
Ke.root,
|
|
1790
1801
|
Ke[e],
|
|
1791
1802
|
t && Ke.error,
|
|
@@ -1793,7 +1804,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1793
1804
|
o
|
|
1794
1805
|
),
|
|
1795
1806
|
style: c,
|
|
1796
|
-
onChange:
|
|
1807
|
+
onChange: f,
|
|
1797
1808
|
rows: l.rows ?? 1,
|
|
1798
1809
|
...l
|
|
1799
1810
|
}
|
|
@@ -1802,13 +1813,13 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1802
1813
|
);
|
|
1803
1814
|
ic.displayName = "Textarea";
|
|
1804
1815
|
function cc(e, t = { width: 600, height: 300 }) {
|
|
1805
|
-
const [n, r] = Le(t), o =
|
|
1816
|
+
const [n, r] = Le(t), o = oe(t);
|
|
1806
1817
|
return Ne(() => {
|
|
1807
1818
|
const c = e.current;
|
|
1808
1819
|
if (!c || typeof ResizeObserver > "u") return;
|
|
1809
1820
|
const i = (h, u) => {
|
|
1810
|
-
const d = Math.max(0, Math.round(h)),
|
|
1811
|
-
o.current.width === d && o.current.height ===
|
|
1821
|
+
const d = Math.max(0, Math.round(h)), f = Math.max(0, Math.round(u));
|
|
1822
|
+
o.current.width === d && o.current.height === f || (o.current = { width: d, height: f }, r({ width: d, height: f }));
|
|
1812
1823
|
}, l = c.getBoundingClientRect();
|
|
1813
1824
|
(l.width > 0 || l.height > 0) && i(l.width, l.height);
|
|
1814
1825
|
const a = new ResizeObserver((h) => {
|
|
@@ -1820,7 +1831,7 @@ function cc(e, t = { width: 600, height: 300 }) {
|
|
|
1820
1831
|
return a.observe(c), () => a.disconnect();
|
|
1821
1832
|
}, [e]), n;
|
|
1822
1833
|
}
|
|
1823
|
-
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",
|
|
1834
|
+
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", Rc = "crk-tooltipTitle-0EfoX", Sc = "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", M = {
|
|
1824
1835
|
root: lc,
|
|
1825
1836
|
canvas: sc,
|
|
1826
1837
|
svg: ac,
|
|
@@ -1836,13 +1847,13 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1836
1847
|
activeBar: bc,
|
|
1837
1848
|
interactionLayer: xc,
|
|
1838
1849
|
legend: kc,
|
|
1839
|
-
legendItem:
|
|
1840
|
-
legendSwatch:
|
|
1850
|
+
legendItem: Mc,
|
|
1851
|
+
legendSwatch: wc,
|
|
1841
1852
|
legendIcon: $c,
|
|
1842
1853
|
legendLabel: Nc,
|
|
1843
1854
|
tooltip: Lc,
|
|
1844
|
-
tooltipTitle:
|
|
1845
|
-
tooltipRows:
|
|
1855
|
+
tooltipTitle: Rc,
|
|
1856
|
+
tooltipRows: Sc,
|
|
1846
1857
|
tooltipRow: Tc,
|
|
1847
1858
|
tooltipLabel: Cc,
|
|
1848
1859
|
tooltipValue: Ac,
|
|
@@ -1851,26 +1862,26 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1851
1862
|
tradingHeader: Dc
|
|
1852
1863
|
}, Ve = $e(
|
|
1853
1864
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: c, overlay: i, children: l }, a) => {
|
|
1854
|
-
const h =
|
|
1865
|
+
const h = oe(null);
|
|
1855
1866
|
un(a, () => h.current);
|
|
1856
|
-
const { width: u } = cc(h), d = Math.max(0, u),
|
|
1857
|
-
return /* @__PURE__ */
|
|
1867
|
+
const { width: u } = cc(h), d = Math.max(0, u), f = t ?? Math.round(d / e);
|
|
1868
|
+
return /* @__PURE__ */ j(
|
|
1858
1869
|
"div",
|
|
1859
1870
|
{
|
|
1860
1871
|
ref: h,
|
|
1861
|
-
className:
|
|
1872
|
+
className: m(M.root, o?.root, n),
|
|
1862
1873
|
style: r,
|
|
1863
1874
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
d > 0 &&
|
|
1875
|
+
/* @__PURE__ */ j("div", { className: M.canvas, style: { height: f || void 0 }, children: [
|
|
1876
|
+
d > 0 && f > 0 && /* @__PURE__ */ s(
|
|
1866
1877
|
"svg",
|
|
1867
1878
|
{
|
|
1868
|
-
className:
|
|
1879
|
+
className: m(M.svg, o?.svg),
|
|
1869
1880
|
width: d,
|
|
1870
|
-
height:
|
|
1871
|
-
viewBox: `0 0 ${d} ${
|
|
1881
|
+
height: f,
|
|
1882
|
+
viewBox: `0 0 ${d} ${f}`,
|
|
1872
1883
|
role: "img",
|
|
1873
|
-
children: l({ width: d, height:
|
|
1884
|
+
children: l({ width: d, height: f })
|
|
1874
1885
|
}
|
|
1875
1886
|
),
|
|
1876
1887
|
i
|
|
@@ -1884,13 +1895,13 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1884
1895
|
Ve.displayName = "ChartContainer";
|
|
1885
1896
|
function vt({ config: e, order: t, classes: n }) {
|
|
1886
1897
|
const r = t ?? Object.keys(e);
|
|
1887
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1898
|
+
return /* @__PURE__ */ s("div", { className: m(M.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
1888
1899
|
const c = e[o];
|
|
1889
|
-
return c ? /* @__PURE__ */
|
|
1900
|
+
return c ? /* @__PURE__ */ j("div", { className: m(M.legendItem, n?.legendItem), role: "listitem", children: [
|
|
1890
1901
|
c.icon ? /* @__PURE__ */ s(
|
|
1891
1902
|
"span",
|
|
1892
1903
|
{
|
|
1893
|
-
className:
|
|
1904
|
+
className: M.legendIcon,
|
|
1894
1905
|
style: { color: c.color },
|
|
1895
1906
|
"aria-hidden": "true",
|
|
1896
1907
|
children: c.icon
|
|
@@ -1898,12 +1909,12 @@ function vt({ config: e, order: t, classes: n }) {
|
|
|
1898
1909
|
) : /* @__PURE__ */ s(
|
|
1899
1910
|
"span",
|
|
1900
1911
|
{
|
|
1901
|
-
className:
|
|
1912
|
+
className: M.legendSwatch,
|
|
1902
1913
|
style: { background: c.color },
|
|
1903
1914
|
"aria-hidden": "true"
|
|
1904
1915
|
}
|
|
1905
1916
|
),
|
|
1906
|
-
/* @__PURE__ */ s("span", { className:
|
|
1917
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: c.label })
|
|
1907
1918
|
] }, o) : null;
|
|
1908
1919
|
}) });
|
|
1909
1920
|
}
|
|
@@ -1920,35 +1931,35 @@ function et({
|
|
|
1920
1931
|
classes: h
|
|
1921
1932
|
}) {
|
|
1922
1933
|
if (!e) return null;
|
|
1923
|
-
const u = 180,
|
|
1934
|
+
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12, p = Math.max(8, n - 16);
|
|
1924
1935
|
return /* @__PURE__ */ s(
|
|
1925
1936
|
"div",
|
|
1926
1937
|
{
|
|
1927
|
-
className:
|
|
1928
|
-
style: { left:
|
|
1938
|
+
className: m(M.tooltip, h?.tooltip),
|
|
1939
|
+
style: { left: f, top: p, width: u },
|
|
1929
1940
|
role: "tooltip",
|
|
1930
|
-
children: c ? c(e) : /* @__PURE__ */
|
|
1931
|
-
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className:
|
|
1932
|
-
/* @__PURE__ */ s("div", { className:
|
|
1933
|
-
const
|
|
1934
|
-
if (
|
|
1935
|
-
const
|
|
1936
|
-
return /* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */ s("span", { className:
|
|
1938
|
-
/* @__PURE__ */ s("span", { className:
|
|
1939
|
-
/* @__PURE__ */ s("span", { className:
|
|
1940
|
-
] },
|
|
1941
|
+
children: c ? c(e) : /* @__PURE__ */ j(je, { children: [
|
|
1942
|
+
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: M.tooltipTitle, children: String(e[l]) }),
|
|
1943
|
+
/* @__PURE__ */ s("div", { className: M.tooltipRows, children: Object.entries(o).map(([L, b]) => {
|
|
1944
|
+
const R = e[L];
|
|
1945
|
+
if (R == null) return null;
|
|
1946
|
+
const w = typeof R == "number" ? i(R) : String(R), J = a?.(L) ?? b.color;
|
|
1947
|
+
return /* @__PURE__ */ j("div", { className: M.tooltipRow, children: [
|
|
1948
|
+
/* @__PURE__ */ s("span", { className: M.legendSwatch, style: { background: J }, "aria-hidden": "true" }),
|
|
1949
|
+
/* @__PURE__ */ s("span", { className: M.tooltipLabel, children: b.label }),
|
|
1950
|
+
/* @__PURE__ */ s("span", { className: M.tooltipValue, children: w })
|
|
1951
|
+
] }, L);
|
|
1941
1952
|
}) })
|
|
1942
1953
|
] })
|
|
1943
1954
|
}
|
|
1944
1955
|
);
|
|
1945
1956
|
}
|
|
1946
1957
|
function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: c }) {
|
|
1947
|
-
return /* @__PURE__ */ s("g", { className:
|
|
1958
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */ j("g", { children: [
|
|
1948
1959
|
o && /* @__PURE__ */ s(
|
|
1949
1960
|
"line",
|
|
1950
1961
|
{
|
|
1951
|
-
className:
|
|
1962
|
+
className: m(M.gridLine, c?.grid),
|
|
1952
1963
|
x1: t,
|
|
1953
1964
|
x2: t + n,
|
|
1954
1965
|
y1: l,
|
|
@@ -1958,7 +1969,7 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1958
1969
|
/* @__PURE__ */ s(
|
|
1959
1970
|
"text",
|
|
1960
1971
|
{
|
|
1961
|
-
className:
|
|
1972
|
+
className: m(M.axisLabel, c?.axisLabel),
|
|
1962
1973
|
x: t - 8,
|
|
1963
1974
|
y: l,
|
|
1964
1975
|
textAnchor: "end",
|
|
@@ -1969,10 +1980,10 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1969
1980
|
] }, `y-${i}`)) });
|
|
1970
1981
|
}
|
|
1971
1982
|
function rn({ ticks: e, y: t, format: n, classes: r }) {
|
|
1972
|
-
return /* @__PURE__ */ s("g", { className:
|
|
1983
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, r?.axis), children: e.map(({ label: o, x: c }) => /* @__PURE__ */ s(
|
|
1973
1984
|
"text",
|
|
1974
1985
|
{
|
|
1975
|
-
className:
|
|
1986
|
+
className: m(M.axisLabel, r?.axisLabel),
|
|
1976
1987
|
x: c,
|
|
1977
1988
|
y: t + 16,
|
|
1978
1989
|
textAnchor: "middle",
|
|
@@ -2051,178 +2062,178 @@ function Ol({
|
|
|
2051
2062
|
showValues: h = !1,
|
|
2052
2063
|
valuePosition: u = "top",
|
|
2053
2064
|
renderLabel: d,
|
|
2054
|
-
activeIndex:
|
|
2065
|
+
activeIndex: f,
|
|
2055
2066
|
onPointClick: p,
|
|
2056
|
-
showGrid:
|
|
2057
|
-
showLegend:
|
|
2058
|
-
showTooltip:
|
|
2059
|
-
yTickCount:
|
|
2060
|
-
yFormat:
|
|
2061
|
-
xFormat:
|
|
2062
|
-
valueFormat:
|
|
2063
|
-
renderTooltip:
|
|
2064
|
-
margin:
|
|
2065
|
-
emptyMessage:
|
|
2066
|
-
className:
|
|
2067
|
-
style:
|
|
2068
|
-
classes:
|
|
2067
|
+
showGrid: L = !0,
|
|
2068
|
+
showLegend: b = !0,
|
|
2069
|
+
showTooltip: R = !0,
|
|
2070
|
+
yTickCount: w = 5,
|
|
2071
|
+
yFormat: J,
|
|
2072
|
+
xFormat: W,
|
|
2073
|
+
valueFormat: E,
|
|
2074
|
+
renderTooltip: Z,
|
|
2075
|
+
margin: C,
|
|
2076
|
+
emptyMessage: $ = "No data",
|
|
2077
|
+
className: ie,
|
|
2078
|
+
style: ne,
|
|
2079
|
+
classes: V
|
|
2069
2080
|
}) {
|
|
2070
|
-
const
|
|
2081
|
+
const ae = { ...Ec, ...C }, S = ke(() => Object.keys(n), [n]), [re, F] = Le(null), X = oe(null), A = f ?? re, z = (me, K) => {
|
|
2071
2082
|
if (l) {
|
|
2072
|
-
const
|
|
2073
|
-
if (typeof
|
|
2083
|
+
const H = e[K]?.[l];
|
|
2084
|
+
if (typeof H == "string") return H;
|
|
2074
2085
|
}
|
|
2075
|
-
return n[
|
|
2086
|
+
return n[me]?.color ?? "var(--crk-chart-1)";
|
|
2076
2087
|
};
|
|
2077
2088
|
if (e.length === 0)
|
|
2078
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2079
|
-
const
|
|
2089
|
+
return /* @__PURE__ */ s("div", { ref: X, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2090
|
+
const ce = R && A !== null ? /* @__PURE__ */ s(
|
|
2080
2091
|
et,
|
|
2081
2092
|
{
|
|
2082
|
-
row: e[
|
|
2083
|
-
x: Hc(e, t,
|
|
2093
|
+
row: e[A],
|
|
2094
|
+
x: Hc(e, t, ae, A, X),
|
|
2084
2095
|
y: 16,
|
|
2085
|
-
containerWidth:
|
|
2096
|
+
containerWidth: X.current?.getBoundingClientRect().width ?? 0,
|
|
2086
2097
|
config: n,
|
|
2087
|
-
render:
|
|
2088
|
-
valueFormat:
|
|
2098
|
+
render: Z ? () => Z(e[A]) : void 0,
|
|
2099
|
+
valueFormat: E,
|
|
2089
2100
|
titleKey: t,
|
|
2090
|
-
resolveColor: l ? (
|
|
2091
|
-
classes:
|
|
2101
|
+
resolveColor: l ? (me) => z(me, A) : void 0,
|
|
2102
|
+
classes: V
|
|
2092
2103
|
}
|
|
2093
2104
|
) : null;
|
|
2094
2105
|
return /* @__PURE__ */ s(
|
|
2095
2106
|
Ve,
|
|
2096
2107
|
{
|
|
2097
|
-
ref:
|
|
2108
|
+
ref: X,
|
|
2098
2109
|
aspectRatio: r,
|
|
2099
2110
|
height: o,
|
|
2100
|
-
className:
|
|
2101
|
-
style:
|
|
2102
|
-
classes:
|
|
2103
|
-
legend:
|
|
2104
|
-
overlay:
|
|
2105
|
-
children: ({ width:
|
|
2106
|
-
const
|
|
2107
|
-
for (const g of
|
|
2108
|
-
for (const
|
|
2109
|
-
const
|
|
2110
|
-
typeof
|
|
2111
|
+
className: ie,
|
|
2112
|
+
style: ne,
|
|
2113
|
+
classes: V,
|
|
2114
|
+
legend: b ? /* @__PURE__ */ s(vt, { config: n, classes: V }) : void 0,
|
|
2115
|
+
overlay: ce,
|
|
2116
|
+
children: ({ width: me, height: K }) => {
|
|
2117
|
+
const H = ae.left, N = me - ae.right, y = ae.top, v = K - ae.bottom, B = Math.max(0, N - H), _ = Math.max(0, v - y), q = e.map((g) => String(g[t])), U = Xe(q, [H, N], 0), ee = [];
|
|
2118
|
+
for (const g of S)
|
|
2119
|
+
for (const x of e) {
|
|
2120
|
+
const te = x[g];
|
|
2121
|
+
typeof te == "number" && ee.push(te);
|
|
2111
2122
|
}
|
|
2112
|
-
const [
|
|
2113
|
-
return /* @__PURE__ */
|
|
2123
|
+
const [k, G] = bt(ee), O = Math.min(0, k), le = qe(O, G, w), ge = Je([le[0], le[le.length - 1]], [v, y]), be = le.map((g) => ({ value: g, y: ge(g) })), Re = Wc(q).map((g) => ({ label: g, x: U(g) }));
|
|
2124
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2114
2125
|
/* @__PURE__ */ s(
|
|
2115
2126
|
nn,
|
|
2116
2127
|
{
|
|
2117
2128
|
ticks: be,
|
|
2118
|
-
x:
|
|
2119
|
-
plotWidth:
|
|
2120
|
-
format:
|
|
2121
|
-
showGrid:
|
|
2122
|
-
classes:
|
|
2129
|
+
x: H,
|
|
2130
|
+
plotWidth: B,
|
|
2131
|
+
format: J,
|
|
2132
|
+
showGrid: L,
|
|
2133
|
+
classes: V
|
|
2123
2134
|
}
|
|
2124
2135
|
),
|
|
2125
|
-
/* @__PURE__ */ s(rn, { ticks:
|
|
2126
|
-
|
|
2127
|
-
const
|
|
2128
|
-
const
|
|
2129
|
-
return { x:
|
|
2136
|
+
/* @__PURE__ */ s(rn, { ticks: Re, y: v, format: W, classes: V }),
|
|
2137
|
+
S.map((g) => {
|
|
2138
|
+
const x = n[g], te = e.map((D, Y) => {
|
|
2139
|
+
const I = D[g], fe = typeof I == "number" ? I : 0;
|
|
2140
|
+
return { x: U(q[Y]), y: ge(fe), value: fe, row: D };
|
|
2130
2141
|
});
|
|
2131
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, V?.series), children: [
|
|
2132
2143
|
/* @__PURE__ */ s(
|
|
2133
2144
|
"path",
|
|
2134
2145
|
{
|
|
2135
|
-
className:
|
|
2136
|
-
d: Pc(
|
|
2137
|
-
stroke:
|
|
2146
|
+
className: m(M.linePath),
|
|
2147
|
+
d: Pc(te, c),
|
|
2148
|
+
stroke: x.color
|
|
2138
2149
|
}
|
|
2139
2150
|
),
|
|
2140
|
-
i &&
|
|
2141
|
-
const
|
|
2151
|
+
i && te.map((D, Y) => {
|
|
2152
|
+
const I = z(g, Y), fe = A === Y, Q = f !== void 0 && !fe, T = p ? () => p({ row: D.row, value: D.value, seriesKey: g, index: Y }) : void 0;
|
|
2142
2153
|
return a ? /* @__PURE__ */ s(
|
|
2143
2154
|
"g",
|
|
2144
2155
|
{
|
|
2145
|
-
onClick:
|
|
2146
|
-
style:
|
|
2147
|
-
opacity:
|
|
2156
|
+
onClick: T,
|
|
2157
|
+
style: T ? { cursor: "pointer" } : void 0,
|
|
2158
|
+
opacity: Q ? 0.45 : 1,
|
|
2148
2159
|
children: a({
|
|
2149
|
-
row:
|
|
2150
|
-
value:
|
|
2160
|
+
row: D.row,
|
|
2161
|
+
value: D.value,
|
|
2151
2162
|
seriesKey: g,
|
|
2152
|
-
index:
|
|
2153
|
-
x:
|
|
2154
|
-
y:
|
|
2155
|
-
color:
|
|
2156
|
-
active:
|
|
2163
|
+
index: Y,
|
|
2164
|
+
x: D.x,
|
|
2165
|
+
y: D.y,
|
|
2166
|
+
color: I,
|
|
2167
|
+
active: fe
|
|
2157
2168
|
})
|
|
2158
2169
|
},
|
|
2159
|
-
`${g}-${
|
|
2170
|
+
`${g}-${Y}`
|
|
2160
2171
|
) : /* @__PURE__ */ s(
|
|
2161
2172
|
"circle",
|
|
2162
2173
|
{
|
|
2163
|
-
className:
|
|
2164
|
-
cx:
|
|
2165
|
-
cy:
|
|
2166
|
-
r:
|
|
2167
|
-
fill:
|
|
2168
|
-
onClick:
|
|
2169
|
-
style:
|
|
2170
|
-
opacity:
|
|
2174
|
+
className: m(M.point, V?.point),
|
|
2175
|
+
cx: D.x,
|
|
2176
|
+
cy: D.y,
|
|
2177
|
+
r: fe ? 5 : 3.5,
|
|
2178
|
+
fill: I,
|
|
2179
|
+
onClick: T,
|
|
2180
|
+
style: T ? { cursor: "pointer" } : void 0,
|
|
2181
|
+
opacity: Q ? 0.45 : 1
|
|
2171
2182
|
},
|
|
2172
|
-
`${g}-${
|
|
2183
|
+
`${g}-${Y}`
|
|
2173
2184
|
);
|
|
2174
2185
|
}),
|
|
2175
|
-
(h || d) &&
|
|
2176
|
-
const
|
|
2177
|
-
if (
|
|
2178
|
-
const
|
|
2186
|
+
(h || d) && te.map((D, Y) => {
|
|
2187
|
+
const I = d ? d({ row: D.row, value: D.value, seriesKey: g, index: Y }) : h ? E ? E(D.value) : String(D.value) : null;
|
|
2188
|
+
if (I == null) return null;
|
|
2189
|
+
const fe = 10, Q = u === "top" ? D.y - fe : D.y + fe + 4;
|
|
2179
2190
|
return /* @__PURE__ */ s(
|
|
2180
2191
|
"text",
|
|
2181
2192
|
{
|
|
2182
|
-
className:
|
|
2183
|
-
x:
|
|
2184
|
-
y:
|
|
2193
|
+
className: m(M.axisLabel),
|
|
2194
|
+
x: D.x,
|
|
2195
|
+
y: Q,
|
|
2185
2196
|
textAnchor: "middle",
|
|
2186
2197
|
dominantBaseline: u === "top" ? "auto" : "middle",
|
|
2187
|
-
children:
|
|
2198
|
+
children: I
|
|
2188
2199
|
},
|
|
2189
|
-
`label-${g}-${
|
|
2200
|
+
`label-${g}-${Y}`
|
|
2190
2201
|
);
|
|
2191
2202
|
})
|
|
2192
2203
|
] }, g);
|
|
2193
2204
|
}),
|
|
2194
|
-
|
|
2205
|
+
A !== null && /* @__PURE__ */ s(
|
|
2195
2206
|
"line",
|
|
2196
2207
|
{
|
|
2197
|
-
className:
|
|
2198
|
-
x1:
|
|
2199
|
-
x2:
|
|
2208
|
+
className: M.cursorLine,
|
|
2209
|
+
x1: U(q[A]),
|
|
2210
|
+
x2: U(q[A]),
|
|
2200
2211
|
y1: y,
|
|
2201
|
-
y2:
|
|
2212
|
+
y2: v
|
|
2202
2213
|
}
|
|
2203
2214
|
),
|
|
2204
2215
|
/* @__PURE__ */ s(
|
|
2205
2216
|
"rect",
|
|
2206
2217
|
{
|
|
2207
|
-
className:
|
|
2208
|
-
x:
|
|
2218
|
+
className: M.interactionLayer,
|
|
2219
|
+
x: H,
|
|
2209
2220
|
y,
|
|
2210
|
-
width:
|
|
2211
|
-
height:
|
|
2221
|
+
width: B,
|
|
2222
|
+
height: _,
|
|
2212
2223
|
onMouseMove: (g) => {
|
|
2213
|
-
const
|
|
2224
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + H, D = U.step(), Y = Math.max(
|
|
2214
2225
|
0,
|
|
2215
|
-
Math.min(e.length - 1, Math.round((
|
|
2226
|
+
Math.min(e.length - 1, Math.round((te - H - D / 2) / D))
|
|
2216
2227
|
);
|
|
2217
|
-
|
|
2228
|
+
F(Y);
|
|
2218
2229
|
},
|
|
2219
|
-
onMouseLeave: () =>
|
|
2230
|
+
onMouseLeave: () => F(null),
|
|
2220
2231
|
onClick: p ? (g) => {
|
|
2221
|
-
const
|
|
2232
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + H, D = U.step(), Y = Math.max(
|
|
2222
2233
|
0,
|
|
2223
|
-
Math.min(e.length - 1, Math.round((
|
|
2224
|
-
),
|
|
2225
|
-
p({ row: e[
|
|
2234
|
+
Math.min(e.length - 1, Math.round((te - H - D / 2) / D))
|
|
2235
|
+
), I = S[0], fe = e[Y][I], Q = typeof fe == "number" ? fe : 0;
|
|
2236
|
+
p({ row: e[Y], value: Q, seriesKey: I, index: Y });
|
|
2226
2237
|
} : void 0,
|
|
2227
2238
|
style: p ? { cursor: "pointer" } : void 0
|
|
2228
2239
|
}
|
|
@@ -2239,7 +2250,7 @@ function Hc(e, t, n, r, o) {
|
|
|
2239
2250
|
return Xe(l, [n.left, i - n.right], 0)(l[r]);
|
|
2240
2251
|
}
|
|
2241
2252
|
const Oc = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
2242
|
-
function
|
|
2253
|
+
function Rt(e, t) {
|
|
2243
2254
|
if (e.length === 0) return "";
|
|
2244
2255
|
if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
|
|
2245
2256
|
if (t === "linear")
|
|
@@ -2259,12 +2270,12 @@ function St(e, t) {
|
|
|
2259
2270
|
}
|
|
2260
2271
|
function Dt(e, t, n) {
|
|
2261
2272
|
if (e.length === 0) return "";
|
|
2262
|
-
const r =
|
|
2273
|
+
const r = Rt(e, n);
|
|
2263
2274
|
if (typeof t == "number") {
|
|
2264
2275
|
const l = e[e.length - 1], a = e[0];
|
|
2265
2276
|
return `${r} L ${l.x} ${t} L ${a.x} ${t} Z`;
|
|
2266
2277
|
}
|
|
2267
|
-
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i =
|
|
2278
|
+
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i = Rt(o, n).replace(/^M /, "L ");
|
|
2268
2279
|
return `${r} ${i} Z`;
|
|
2269
2280
|
}
|
|
2270
2281
|
function Fc(e, t = 8) {
|
|
@@ -2285,93 +2296,93 @@ function Fl({
|
|
|
2285
2296
|
showGrid: h = !0,
|
|
2286
2297
|
showXAxis: u = !0,
|
|
2287
2298
|
showYAxis: d = !0,
|
|
2288
|
-
showLegend:
|
|
2299
|
+
showLegend: f = !0,
|
|
2289
2300
|
showTooltip: p = !0,
|
|
2290
|
-
yTickCount:
|
|
2291
|
-
yFormat:
|
|
2292
|
-
xFormat:
|
|
2293
|
-
valueFormat:
|
|
2294
|
-
renderTooltip:
|
|
2295
|
-
margin:
|
|
2296
|
-
emptyMessage:
|
|
2297
|
-
className:
|
|
2298
|
-
style:
|
|
2299
|
-
classes:
|
|
2301
|
+
yTickCount: L = 5,
|
|
2302
|
+
yFormat: b,
|
|
2303
|
+
xFormat: R,
|
|
2304
|
+
valueFormat: w,
|
|
2305
|
+
renderTooltip: J,
|
|
2306
|
+
margin: W,
|
|
2307
|
+
emptyMessage: E = "No data",
|
|
2308
|
+
className: Z,
|
|
2309
|
+
style: C,
|
|
2310
|
+
classes: $
|
|
2300
2311
|
}) {
|
|
2301
|
-
const
|
|
2312
|
+
const ie = ke(
|
|
2302
2313
|
() => ({
|
|
2303
2314
|
...Oc,
|
|
2304
2315
|
...d ? {} : { left: 16 },
|
|
2305
|
-
...
|
|
2316
|
+
...W
|
|
2306
2317
|
}),
|
|
2307
|
-
[
|
|
2308
|
-
),
|
|
2318
|
+
[W, d]
|
|
2319
|
+
), ne = ke(() => Object.keys(n), [n]), V = i && ne.length > 0, ae = V && l === "expand", [S, re] = Le(null), F = oe(null), X = Ye();
|
|
2309
2320
|
if (e.length === 0)
|
|
2310
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2311
|
-
const
|
|
2312
|
-
const
|
|
2321
|
+
return /* @__PURE__ */ s("div", { ref: F, className: m(M.root, $?.root, Z), style: C, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: E }) }) });
|
|
2322
|
+
const A = ke(() => {
|
|
2323
|
+
const H = ne.map(() => []), N = ne.map(() => []);
|
|
2313
2324
|
for (let y = 0; y < e.length; y++) {
|
|
2314
|
-
let
|
|
2315
|
-
if (
|
|
2316
|
-
for (const
|
|
2317
|
-
const
|
|
2318
|
-
typeof
|
|
2325
|
+
let v = 0;
|
|
2326
|
+
if (ae) {
|
|
2327
|
+
for (const _ of ne) {
|
|
2328
|
+
const q = e[y][_];
|
|
2329
|
+
typeof q == "number" && q > 0 && (v += q);
|
|
2319
2330
|
}
|
|
2320
|
-
|
|
2331
|
+
v === 0 && (v = 1);
|
|
2321
2332
|
}
|
|
2322
|
-
let
|
|
2323
|
-
for (let
|
|
2324
|
-
const
|
|
2325
|
-
if (
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2333
|
+
let B = 0;
|
|
2334
|
+
for (let _ = 0; _ < ne.length; _++) {
|
|
2335
|
+
const q = ne[_], U = e[y][q], ee = typeof U == "number" ? U : 0;
|
|
2336
|
+
if (V) {
|
|
2337
|
+
const k = ae ? ee / v : ee;
|
|
2338
|
+
N[_][y] = B, B += k, H[_][y] = B;
|
|
2328
2339
|
} else
|
|
2329
|
-
|
|
2340
|
+
N[_][y] = 0, H[_][y] = ee;
|
|
2330
2341
|
}
|
|
2331
2342
|
}
|
|
2332
|
-
return { tops:
|
|
2333
|
-
}, [e,
|
|
2334
|
-
if (
|
|
2335
|
-
let
|
|
2336
|
-
for (const y of
|
|
2337
|
-
for (const
|
|
2338
|
-
|
|
2339
|
-
for (const y of
|
|
2340
|
-
for (const
|
|
2341
|
-
|
|
2342
|
-
return [Math.min(0,
|
|
2343
|
-
}, [
|
|
2343
|
+
return { tops: H, bottoms: N };
|
|
2344
|
+
}, [e, ne, V, ae]), { tops: z, bottoms: ce } = A, [me, K] = ke(() => {
|
|
2345
|
+
if (ae) return [0, 1];
|
|
2346
|
+
let H = 0, N = 0;
|
|
2347
|
+
for (const y of z)
|
|
2348
|
+
for (const v of y)
|
|
2349
|
+
v < H && (H = v), v > N && (N = v);
|
|
2350
|
+
for (const y of ce)
|
|
2351
|
+
for (const v of y)
|
|
2352
|
+
v < H && (H = v);
|
|
2353
|
+
return [Math.min(0, H), N];
|
|
2354
|
+
}, [z, ce, ae]);
|
|
2344
2355
|
return /* @__PURE__ */ s(
|
|
2345
2356
|
Ve,
|
|
2346
2357
|
{
|
|
2347
|
-
ref:
|
|
2358
|
+
ref: F,
|
|
2348
2359
|
aspectRatio: r,
|
|
2349
2360
|
height: o,
|
|
2350
|
-
className:
|
|
2351
|
-
style:
|
|
2352
|
-
classes:
|
|
2353
|
-
legend:
|
|
2354
|
-
overlay: p &&
|
|
2361
|
+
className: Z,
|
|
2362
|
+
style: C,
|
|
2363
|
+
classes: $,
|
|
2364
|
+
legend: f ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
2365
|
+
overlay: p && S !== null ? /* @__PURE__ */ s(
|
|
2355
2366
|
et,
|
|
2356
2367
|
{
|
|
2357
|
-
row: e[
|
|
2358
|
-
x: zc(e, t,
|
|
2368
|
+
row: e[S],
|
|
2369
|
+
x: zc(e, t, ie, S, F),
|
|
2359
2370
|
y: 16,
|
|
2360
|
-
containerWidth:
|
|
2371
|
+
containerWidth: F.current?.getBoundingClientRect().width ?? 0,
|
|
2361
2372
|
config: n,
|
|
2362
|
-
render:
|
|
2363
|
-
valueFormat:
|
|
2373
|
+
render: J ? () => J(e[S]) : void 0,
|
|
2374
|
+
valueFormat: ae ? (H) => `${Math.round(H * 100)}%` : w,
|
|
2364
2375
|
titleKey: t,
|
|
2365
|
-
classes:
|
|
2376
|
+
classes: $
|
|
2366
2377
|
}
|
|
2367
2378
|
) : null,
|
|
2368
|
-
children: ({ width:
|
|
2369
|
-
const y =
|
|
2370
|
-
return /* @__PURE__ */
|
|
2371
|
-
a && /* @__PURE__ */ s("defs", { children:
|
|
2379
|
+
children: ({ width: H, height: N }) => {
|
|
2380
|
+
const y = ie.left, v = H - ie.right, B = ie.top, _ = N - ie.bottom, q = Math.max(0, v - y), U = Math.max(0, _ - B), ee = e.map((g) => String(g[t])), k = Xe(ee, [y, v], 0), G = ae ? [0, 0.25, 0.5, 0.75, 1] : qe(me, K, L), O = Je([G[0], G[G.length - 1]], [_, B]), le = O(0), ge = G.map((g) => ({ value: g, y: O(g) })), Ce = Fc(ee).map((g) => ({ label: g, x: k(g) })), Re = ae ? (g) => `${Math.round(g * 100)}%` : b;
|
|
2381
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2382
|
+
a && /* @__PURE__ */ s("defs", { children: ne.map((g) => /* @__PURE__ */ j(
|
|
2372
2383
|
"linearGradient",
|
|
2373
2384
|
{
|
|
2374
|
-
id: `${
|
|
2385
|
+
id: `${X}-${g}`,
|
|
2375
2386
|
x1: "0",
|
|
2376
2387
|
y1: "0",
|
|
2377
2388
|
x2: "0",
|
|
@@ -2386,77 +2397,77 @@ function Fl({
|
|
|
2386
2397
|
d ? /* @__PURE__ */ s(
|
|
2387
2398
|
nn,
|
|
2388
2399
|
{
|
|
2389
|
-
ticks:
|
|
2400
|
+
ticks: ge,
|
|
2390
2401
|
x: y,
|
|
2391
|
-
plotWidth:
|
|
2392
|
-
format:
|
|
2402
|
+
plotWidth: q,
|
|
2403
|
+
format: Re,
|
|
2393
2404
|
showGrid: h,
|
|
2394
|
-
classes:
|
|
2405
|
+
classes: $
|
|
2395
2406
|
}
|
|
2396
|
-
) : h && /* @__PURE__ */ s("g", { className:
|
|
2407
|
+
) : h && /* @__PURE__ */ s("g", { className: m(M.axis, $?.axis), children: ge.map(({ value: g, y: x }) => /* @__PURE__ */ s(
|
|
2397
2408
|
"line",
|
|
2398
2409
|
{
|
|
2399
|
-
className:
|
|
2410
|
+
className: m(M.gridLine, $?.grid),
|
|
2400
2411
|
x1: y,
|
|
2401
|
-
x2:
|
|
2402
|
-
y1:
|
|
2403
|
-
y2:
|
|
2412
|
+
x2: v,
|
|
2413
|
+
y1: x,
|
|
2414
|
+
y2: x
|
|
2404
2415
|
},
|
|
2405
2416
|
`grid-${g}`
|
|
2406
2417
|
)) }),
|
|
2407
|
-
u && /* @__PURE__ */ s(rn, { ticks: Ce, y:
|
|
2408
|
-
|
|
2409
|
-
const
|
|
2410
|
-
x:
|
|
2411
|
-
y:
|
|
2412
|
-
})),
|
|
2413
|
-
return /* @__PURE__ */
|
|
2418
|
+
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format: R, classes: $ }),
|
|
2419
|
+
ne.map((g, x) => {
|
|
2420
|
+
const te = n[g], D = e.map((Q, T) => ({
|
|
2421
|
+
x: k(ee[T]),
|
|
2422
|
+
y: O(z[x][T])
|
|
2423
|
+
})), Y = a ? `url(#${X}-${g})` : te.color, I = a ? 1 : 0.18, fe = V ? Dt(D, ce[x].map((Q) => O(Q)), c) : Dt(D, le, c);
|
|
2424
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, $?.series), children: [
|
|
2414
2425
|
/* @__PURE__ */ s(
|
|
2415
2426
|
"path",
|
|
2416
2427
|
{
|
|
2417
|
-
className:
|
|
2418
|
-
d:
|
|
2419
|
-
fill:
|
|
2420
|
-
fillOpacity:
|
|
2428
|
+
className: M.areaPath,
|
|
2429
|
+
d: fe,
|
|
2430
|
+
fill: Y,
|
|
2431
|
+
fillOpacity: I
|
|
2421
2432
|
}
|
|
2422
2433
|
),
|
|
2423
|
-
/* @__PURE__ */ s("path", { className:
|
|
2424
|
-
!
|
|
2434
|
+
/* @__PURE__ */ s("path", { className: M.linePath, d: Rt(D, c), stroke: te.color }),
|
|
2435
|
+
!V && D.map((Q, T) => /* @__PURE__ */ s(
|
|
2425
2436
|
"circle",
|
|
2426
2437
|
{
|
|
2427
|
-
className:
|
|
2428
|
-
cx:
|
|
2429
|
-
cy:
|
|
2430
|
-
r:
|
|
2431
|
-
fill:
|
|
2438
|
+
className: m(M.point, $?.point),
|
|
2439
|
+
cx: Q.x,
|
|
2440
|
+
cy: Q.y,
|
|
2441
|
+
r: S === T ? 5 : 3,
|
|
2442
|
+
fill: te.color
|
|
2432
2443
|
},
|
|
2433
|
-
`${g}-${
|
|
2444
|
+
`${g}-${T}`
|
|
2434
2445
|
))
|
|
2435
2446
|
] }, g);
|
|
2436
2447
|
}),
|
|
2437
|
-
|
|
2448
|
+
S !== null && /* @__PURE__ */ s(
|
|
2438
2449
|
"line",
|
|
2439
2450
|
{
|
|
2440
|
-
className:
|
|
2441
|
-
x1:
|
|
2442
|
-
x2:
|
|
2443
|
-
y1:
|
|
2444
|
-
y2:
|
|
2451
|
+
className: M.cursorLine,
|
|
2452
|
+
x1: k(ee[S]),
|
|
2453
|
+
x2: k(ee[S]),
|
|
2454
|
+
y1: B,
|
|
2455
|
+
y2: _
|
|
2445
2456
|
}
|
|
2446
2457
|
),
|
|
2447
2458
|
/* @__PURE__ */ s(
|
|
2448
2459
|
"rect",
|
|
2449
2460
|
{
|
|
2450
|
-
className:
|
|
2461
|
+
className: M.interactionLayer,
|
|
2451
2462
|
x: y,
|
|
2452
|
-
y:
|
|
2453
|
-
width:
|
|
2454
|
-
height:
|
|
2463
|
+
y: B,
|
|
2464
|
+
width: q,
|
|
2465
|
+
height: U,
|
|
2455
2466
|
onMouseMove: (g) => {
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2467
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left + y, D = k.step(), Y = Math.max(0, Math.min(e.length - 1, Math.round((te - y - D / 2) / D)));
|
|
2468
|
+
re(Y);
|
|
2458
2469
|
},
|
|
2459
|
-
onMouseLeave: () =>
|
|
2470
|
+
onMouseLeave: () => re(null)
|
|
2460
2471
|
}
|
|
2461
2472
|
)
|
|
2462
2473
|
] });
|
|
@@ -2495,193 +2506,193 @@ function zl({
|
|
|
2495
2506
|
barRadius: h = 4,
|
|
2496
2507
|
showGrid: u = !0,
|
|
2497
2508
|
showLegend: d = !0,
|
|
2498
|
-
showTooltip:
|
|
2509
|
+
showTooltip: f = !0,
|
|
2499
2510
|
showValues: p = !1,
|
|
2500
|
-
valuePosition:
|
|
2501
|
-
renderLabel:
|
|
2502
|
-
colorBy:
|
|
2503
|
-
colors:
|
|
2504
|
-
negativeColor:
|
|
2505
|
-
activeIndex:
|
|
2506
|
-
onBarClick:
|
|
2507
|
-
yTickCount:
|
|
2508
|
-
yFormat:
|
|
2509
|
-
xFormat:
|
|
2510
|
-
valueFormat:
|
|
2511
|
-
renderTooltip:
|
|
2512
|
-
margin:
|
|
2513
|
-
emptyMessage:
|
|
2514
|
-
className:
|
|
2515
|
-
style:
|
|
2516
|
-
classes:
|
|
2511
|
+
valuePosition: L = "outside",
|
|
2512
|
+
renderLabel: b,
|
|
2513
|
+
colorBy: R = "series",
|
|
2514
|
+
colors: w = jc,
|
|
2515
|
+
negativeColor: J,
|
|
2516
|
+
activeIndex: W,
|
|
2517
|
+
onBarClick: E,
|
|
2518
|
+
yTickCount: Z = 5,
|
|
2519
|
+
yFormat: C,
|
|
2520
|
+
xFormat: $,
|
|
2521
|
+
valueFormat: ie,
|
|
2522
|
+
renderTooltip: ne,
|
|
2523
|
+
margin: V,
|
|
2524
|
+
emptyMessage: ae = "No data",
|
|
2525
|
+
className: S,
|
|
2526
|
+
style: re,
|
|
2527
|
+
classes: F
|
|
2517
2528
|
}) {
|
|
2518
|
-
const
|
|
2529
|
+
const X = r === "horizontal", A = { ...X ? _c : Xc, ...V }, z = ke(() => Object.keys(n), [n]), ce = o && z.length > 1, [me, K] = Le(null), H = oe(null);
|
|
2519
2530
|
if (e.length === 0)
|
|
2520
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2521
|
-
const
|
|
2522
|
-
if (
|
|
2523
|
-
let
|
|
2531
|
+
return /* @__PURE__ */ s("div", { ref: H, className: m(M.root, F?.root, S), style: re, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: ae }) }) });
|
|
2532
|
+
const N = e.map((k) => String(k[t])), y = W ?? me, v = ke(() => {
|
|
2533
|
+
if (ce) {
|
|
2534
|
+
let le = 0, ge = 0;
|
|
2524
2535
|
for (const be of e) {
|
|
2525
|
-
let Ce = 0,
|
|
2526
|
-
for (const g of
|
|
2527
|
-
const
|
|
2528
|
-
typeof
|
|
2536
|
+
let Ce = 0, Re = 0;
|
|
2537
|
+
for (const g of z) {
|
|
2538
|
+
const x = be[g];
|
|
2539
|
+
typeof x == "number" && (x >= 0 ? Ce += x : Re += x);
|
|
2529
2540
|
}
|
|
2530
|
-
Ce >
|
|
2541
|
+
Ce > le && (le = Ce), Re < ge && (ge = Re);
|
|
2531
2542
|
}
|
|
2532
|
-
return [
|
|
2543
|
+
return [ge, le];
|
|
2533
2544
|
}
|
|
2534
|
-
const
|
|
2535
|
-
for (const
|
|
2536
|
-
for (const
|
|
2537
|
-
const be =
|
|
2538
|
-
typeof be == "number" &&
|
|
2545
|
+
const k = [];
|
|
2546
|
+
for (const le of e)
|
|
2547
|
+
for (const ge of z) {
|
|
2548
|
+
const be = le[ge];
|
|
2549
|
+
typeof be == "number" && k.push(be);
|
|
2539
2550
|
}
|
|
2540
|
-
const [
|
|
2541
|
-
return [Math.min(0,
|
|
2542
|
-
}, [e,
|
|
2551
|
+
const [G, O] = bt(k);
|
|
2552
|
+
return [Math.min(0, G), Math.max(0, O)];
|
|
2553
|
+
}, [e, z, ce]), B = qe(v[0], v[1], Z), _ = B[0], q = B[B.length - 1], U = (k, G) => R === "index" ? w[G % w.length] : n[k]?.color ?? w[0], ee = f && y !== null && e[y] ? /* @__PURE__ */ s(
|
|
2543
2554
|
et,
|
|
2544
2555
|
{
|
|
2545
2556
|
row: e[y],
|
|
2546
|
-
x: Vc(e, t,
|
|
2547
|
-
y:
|
|
2548
|
-
containerWidth:
|
|
2557
|
+
x: Vc(e, t, A, y, H, X, l),
|
|
2558
|
+
y: X ? qc(e, t, A, y, H, l) : 16,
|
|
2559
|
+
containerWidth: H.current?.getBoundingClientRect().width ?? 0,
|
|
2549
2560
|
config: n,
|
|
2550
|
-
render:
|
|
2551
|
-
valueFormat:
|
|
2561
|
+
render: ne ? () => ne(e[y]) : void 0,
|
|
2562
|
+
valueFormat: ie,
|
|
2552
2563
|
titleKey: t,
|
|
2553
|
-
resolveColor: (
|
|
2554
|
-
const
|
|
2555
|
-
return typeof
|
|
2564
|
+
resolveColor: (k) => {
|
|
2565
|
+
const G = e[y][k], O = U(k, y);
|
|
2566
|
+
return typeof G != "number" ? O : J !== void 0 && G < 0 ? J : O;
|
|
2556
2567
|
},
|
|
2557
|
-
classes:
|
|
2568
|
+
classes: F
|
|
2558
2569
|
}
|
|
2559
2570
|
) : null;
|
|
2560
2571
|
return /* @__PURE__ */ s(
|
|
2561
2572
|
Ve,
|
|
2562
2573
|
{
|
|
2563
|
-
ref:
|
|
2574
|
+
ref: H,
|
|
2564
2575
|
aspectRatio: c,
|
|
2565
2576
|
height: i,
|
|
2566
|
-
className:
|
|
2567
|
-
style:
|
|
2568
|
-
classes:
|
|
2569
|
-
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes:
|
|
2570
|
-
overlay:
|
|
2571
|
-
children: ({ width:
|
|
2572
|
-
const
|
|
2573
|
-
value:
|
|
2574
|
-
pos:
|
|
2575
|
-
})),
|
|
2576
|
-
return /* @__PURE__ */
|
|
2577
|
-
u && /* @__PURE__ */ s("g", { className:
|
|
2578
|
-
({ value:
|
|
2577
|
+
className: S,
|
|
2578
|
+
style: re,
|
|
2579
|
+
classes: F,
|
|
2580
|
+
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
|
|
2581
|
+
overlay: ee,
|
|
2582
|
+
children: ({ width: k, height: G }) => {
|
|
2583
|
+
const O = A.left, le = k - A.right, ge = A.top, be = G - A.bottom, Ce = Math.max(0, le - O), Re = Math.max(0, be - ge), x = Xe(N, X ? [ge, be] : [O, le], l), te = x.bandWidth(), Y = Je([_, q], X ? [O, le] : [be, ge]), I = Y(0), fe = ce ? 1 : Math.max(1, z.length), Q = te / fe, T = Q * (1 - a), de = B.map((se) => ({
|
|
2584
|
+
value: se,
|
|
2585
|
+
pos: Y(se)
|
|
2586
|
+
})), ye = Uc(N);
|
|
2587
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2588
|
+
u && /* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: de.map(
|
|
2589
|
+
({ value: se, pos: he }) => X ? /* @__PURE__ */ s(
|
|
2579
2590
|
"line",
|
|
2580
2591
|
{
|
|
2581
|
-
className:
|
|
2582
|
-
x1:
|
|
2583
|
-
x2:
|
|
2584
|
-
y1:
|
|
2592
|
+
className: m(M.gridLine, F?.grid),
|
|
2593
|
+
x1: he,
|
|
2594
|
+
x2: he,
|
|
2595
|
+
y1: ge,
|
|
2585
2596
|
y2: be
|
|
2586
2597
|
},
|
|
2587
|
-
`g-${
|
|
2598
|
+
`g-${se}`
|
|
2588
2599
|
) : /* @__PURE__ */ s(
|
|
2589
2600
|
"line",
|
|
2590
2601
|
{
|
|
2591
|
-
className:
|
|
2592
|
-
x1:
|
|
2593
|
-
x2:
|
|
2594
|
-
y1:
|
|
2595
|
-
y2:
|
|
2602
|
+
className: m(M.gridLine, F?.grid),
|
|
2603
|
+
x1: O,
|
|
2604
|
+
x2: le,
|
|
2605
|
+
y1: he,
|
|
2606
|
+
y2: he
|
|
2596
2607
|
},
|
|
2597
|
-
`g-${
|
|
2608
|
+
`g-${se}`
|
|
2598
2609
|
)
|
|
2599
2610
|
) }),
|
|
2600
|
-
/* @__PURE__ */ s("g", { className:
|
|
2601
|
-
const Ae =
|
|
2602
|
-
return
|
|
2611
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: de.map(({ value: se, pos: he }) => {
|
|
2612
|
+
const Ae = C ? C(se) : String(se);
|
|
2613
|
+
return X ? /* @__PURE__ */ s(
|
|
2603
2614
|
"text",
|
|
2604
2615
|
{
|
|
2605
|
-
className:
|
|
2606
|
-
x:
|
|
2616
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2617
|
+
x: he,
|
|
2607
2618
|
y: be + 16,
|
|
2608
2619
|
textAnchor: "middle",
|
|
2609
2620
|
children: Ae
|
|
2610
2621
|
},
|
|
2611
|
-
`vt-${
|
|
2622
|
+
`vt-${se}`
|
|
2612
2623
|
) : /* @__PURE__ */ s(
|
|
2613
2624
|
"text",
|
|
2614
2625
|
{
|
|
2615
|
-
className:
|
|
2616
|
-
x:
|
|
2617
|
-
y:
|
|
2626
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2627
|
+
x: O - 8,
|
|
2628
|
+
y: he,
|
|
2618
2629
|
textAnchor: "end",
|
|
2619
2630
|
dominantBaseline: "middle",
|
|
2620
2631
|
children: Ae
|
|
2621
2632
|
},
|
|
2622
|
-
`vt-${
|
|
2633
|
+
`vt-${se}`
|
|
2623
2634
|
);
|
|
2624
2635
|
}) }),
|
|
2625
|
-
/* @__PURE__ */ s("g", { className:
|
|
2626
|
-
const
|
|
2627
|
-
return
|
|
2636
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: ye.map((se) => {
|
|
2637
|
+
const he = x(se), Ae = $ ? $(se) : se;
|
|
2638
|
+
return X ? /* @__PURE__ */ s(
|
|
2628
2639
|
"text",
|
|
2629
2640
|
{
|
|
2630
|
-
className:
|
|
2631
|
-
x:
|
|
2632
|
-
y:
|
|
2641
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2642
|
+
x: O - 8,
|
|
2643
|
+
y: he,
|
|
2633
2644
|
textAnchor: "end",
|
|
2634
2645
|
dominantBaseline: "middle",
|
|
2635
2646
|
children: Ae
|
|
2636
2647
|
},
|
|
2637
|
-
`c-${
|
|
2648
|
+
`c-${se}`
|
|
2638
2649
|
) : /* @__PURE__ */ s(
|
|
2639
2650
|
"text",
|
|
2640
2651
|
{
|
|
2641
|
-
className:
|
|
2642
|
-
x:
|
|
2652
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2653
|
+
x: he,
|
|
2643
2654
|
y: be + 16,
|
|
2644
2655
|
textAnchor: "middle",
|
|
2645
2656
|
children: Ae
|
|
2646
2657
|
},
|
|
2647
|
-
`c-${
|
|
2658
|
+
`c-${se}`
|
|
2648
2659
|
);
|
|
2649
2660
|
}) }),
|
|
2650
|
-
e.map((
|
|
2651
|
-
const De =
|
|
2652
|
-
let xe = 0,
|
|
2653
|
-
return /* @__PURE__ */ s("g", { className:
|
|
2654
|
-
const Ge =
|
|
2661
|
+
e.map((se, he) => {
|
|
2662
|
+
const De = x(N[he]) - te / 2;
|
|
2663
|
+
let xe = 0, ue = 0;
|
|
2664
|
+
return /* @__PURE__ */ s("g", { className: m(M.series, F?.series), children: z.map((Ie, He) => {
|
|
2665
|
+
const Ge = se[Ie];
|
|
2655
2666
|
if (typeof Ge != "number") return null;
|
|
2656
|
-
const Ee = Ge, xt =
|
|
2667
|
+
const Ee = Ge, xt = U(Ie, he), kt = J !== void 0 && Ee < 0 ? J : xt, Oe = W !== void 0 ? W === he : me === he, tt = W !== void 0 && !Oe;
|
|
2657
2668
|
let nt, _e;
|
|
2658
|
-
|
|
2659
|
-
const rt =
|
|
2669
|
+
ce ? Ee >= 0 ? (nt = xe, _e = xe + Ee, xe = _e) : (nt = ue, _e = ue + Ee, ue = _e) : (nt = 0, _e = Ee);
|
|
2670
|
+
const rt = Y(nt), ot = Y(_e), Bt = ce ? (te - T) / 2 : He * Q + (Q - T) / 2;
|
|
2660
2671
|
let it = 0, ct = 0, lt = 0, st = 0;
|
|
2661
|
-
if (
|
|
2662
|
-
const Ze = Math.min(rt, ot),
|
|
2663
|
-
it = Ze, lt =
|
|
2672
|
+
if (X) {
|
|
2673
|
+
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2674
|
+
it = Ze, lt = wt - Ze, ct = De + Bt, st = T;
|
|
2664
2675
|
} else {
|
|
2665
|
-
const Ze = Math.min(rt, ot),
|
|
2666
|
-
it = De + Bt, lt =
|
|
2676
|
+
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2677
|
+
it = De + Bt, lt = T, ct = Ze, st = wt - Ze;
|
|
2667
2678
|
}
|
|
2668
|
-
const
|
|
2669
|
-
isHorizontal:
|
|
2670
|
-
valuePosition:
|
|
2679
|
+
const Mt = b ? b({ row: se, value: Ee, seriesKey: Ie, index: he }) : p ? ie ? ie(Ee) : String(Ee) : null, Fe = Yc({
|
|
2680
|
+
isHorizontal: X,
|
|
2681
|
+
valuePosition: L,
|
|
2671
2682
|
x: it,
|
|
2672
2683
|
y: ct,
|
|
2673
2684
|
rectW: lt,
|
|
2674
2685
|
rectH: st,
|
|
2675
2686
|
value: Ee
|
|
2676
2687
|
});
|
|
2677
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ j("g", { children: [
|
|
2678
2689
|
/* @__PURE__ */ s(
|
|
2679
2690
|
"rect",
|
|
2680
2691
|
{
|
|
2681
|
-
className:
|
|
2682
|
-
|
|
2683
|
-
Oe &&
|
|
2684
|
-
|
|
2692
|
+
className: m(
|
|
2693
|
+
M.bar,
|
|
2694
|
+
Oe && M.activeBar,
|
|
2695
|
+
F?.point
|
|
2685
2696
|
),
|
|
2686
2697
|
x: it,
|
|
2687
2698
|
y: ct,
|
|
@@ -2691,16 +2702,16 @@ function zl({
|
|
|
2691
2702
|
ry: h,
|
|
2692
2703
|
fill: kt,
|
|
2693
2704
|
opacity: tt ? 0.35 : 1,
|
|
2694
|
-
onClick:
|
|
2695
|
-
style:
|
|
2705
|
+
onClick: E ? () => E({ row: se, value: Ee, seriesKey: Ie, index: he }) : void 0,
|
|
2706
|
+
style: E ? { cursor: "pointer" } : void 0
|
|
2696
2707
|
}
|
|
2697
2708
|
),
|
|
2698
|
-
|
|
2709
|
+
Mt != null && /* @__PURE__ */ s(
|
|
2699
2710
|
"text",
|
|
2700
2711
|
{
|
|
2701
|
-
className:
|
|
2702
|
-
|
|
2703
|
-
(
|
|
2712
|
+
className: m(
|
|
2713
|
+
M.axisLabel,
|
|
2714
|
+
(L === "inside" || L === "inside-start") && M.barLabelInside
|
|
2704
2715
|
),
|
|
2705
2716
|
x: Fe.x,
|
|
2706
2717
|
y: Fe.y,
|
|
@@ -2708,39 +2719,39 @@ function zl({
|
|
|
2708
2719
|
dominantBaseline: Fe.dominantBaseline,
|
|
2709
2720
|
transform: Fe.rotate ? `rotate(${Fe.rotate} ${Fe.x} ${Fe.y})` : void 0,
|
|
2710
2721
|
opacity: tt ? 0.5 : 1,
|
|
2711
|
-
children:
|
|
2722
|
+
children: Mt
|
|
2712
2723
|
}
|
|
2713
2724
|
)
|
|
2714
2725
|
] }, Ie);
|
|
2715
|
-
}) }, `group-${
|
|
2726
|
+
}) }, `group-${he}`);
|
|
2716
2727
|
}),
|
|
2717
|
-
|
|
2728
|
+
_ < 0 && q > 0 && /* @__PURE__ */ s(
|
|
2718
2729
|
"line",
|
|
2719
2730
|
{
|
|
2720
|
-
className:
|
|
2721
|
-
x1:
|
|
2722
|
-
x2:
|
|
2723
|
-
y1:
|
|
2724
|
-
y2:
|
|
2731
|
+
className: m(M.gridLine),
|
|
2732
|
+
x1: X ? I : O,
|
|
2733
|
+
x2: X ? I : le,
|
|
2734
|
+
y1: X ? ge : I,
|
|
2735
|
+
y2: X ? be : I,
|
|
2725
2736
|
opacity: 0.9
|
|
2726
2737
|
}
|
|
2727
2738
|
),
|
|
2728
2739
|
/* @__PURE__ */ s(
|
|
2729
2740
|
"rect",
|
|
2730
2741
|
{
|
|
2731
|
-
className:
|
|
2732
|
-
x:
|
|
2733
|
-
y:
|
|
2742
|
+
className: M.interactionLayer,
|
|
2743
|
+
x: O,
|
|
2744
|
+
y: ge,
|
|
2734
2745
|
width: Ce,
|
|
2735
|
-
height:
|
|
2736
|
-
onMouseMove: (
|
|
2737
|
-
const
|
|
2746
|
+
height: Re,
|
|
2747
|
+
onMouseMove: (se) => {
|
|
2748
|
+
const he = se.currentTarget.getBoundingClientRect(), Ae = se.clientX - he.left + O, De = se.clientY - he.top + ge, xe = x.step(), ue = X ? De - ge : Ae - O, Ie = Math.max(
|
|
2738
2749
|
0,
|
|
2739
|
-
Math.min(e.length - 1, Math.round((
|
|
2750
|
+
Math.min(e.length - 1, Math.round((ue - xe / 2) / xe))
|
|
2740
2751
|
);
|
|
2741
|
-
|
|
2752
|
+
K(Ie);
|
|
2742
2753
|
},
|
|
2743
|
-
onMouseLeave: () =>
|
|
2754
|
+
onMouseLeave: () => K(null)
|
|
2744
2755
|
}
|
|
2745
2756
|
)
|
|
2746
2757
|
] });
|
|
@@ -2840,21 +2851,21 @@ function Zc(e, t, n, r, o, c) {
|
|
|
2840
2851
|
`A ${n} ${n} 0 1 1 ${e + n} ${t}`,
|
|
2841
2852
|
"Z"
|
|
2842
2853
|
].join(" ");
|
|
2843
|
-
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),
|
|
2854
|
+
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);
|
|
2844
2855
|
if (r > 0) {
|
|
2845
|
-
const p = e + r * Math.cos(l),
|
|
2856
|
+
const p = e + r * Math.cos(l), L = t + r * Math.sin(l), b = e + r * Math.cos(i), R = t + r * Math.sin(i);
|
|
2846
2857
|
return [
|
|
2847
2858
|
`M ${h} ${u}`,
|
|
2848
|
-
`A ${n} ${n} 0 ${a} 1 ${d} ${
|
|
2849
|
-
`L ${p} ${
|
|
2850
|
-
`A ${r} ${r} 0 ${a} 0 ${
|
|
2859
|
+
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2860
|
+
`L ${p} ${L}`,
|
|
2861
|
+
`A ${r} ${r} 0 ${a} 0 ${b} ${R}`,
|
|
2851
2862
|
"Z"
|
|
2852
2863
|
].join(" ");
|
|
2853
2864
|
}
|
|
2854
2865
|
return [
|
|
2855
2866
|
`M ${e} ${t}`,
|
|
2856
2867
|
`L ${h} ${u}`,
|
|
2857
|
-
`A ${n} ${n} 0 ${a} 1 ${d} ${
|
|
2868
|
+
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2858
2869
|
"Z"
|
|
2859
2870
|
].join(" ");
|
|
2860
2871
|
}
|
|
@@ -2875,122 +2886,122 @@ function jl({
|
|
|
2875
2886
|
strokeWidth: h = 2,
|
|
2876
2887
|
strokeColor: u = "var(--crk-color-bg)",
|
|
2877
2888
|
padAngle: d = 0,
|
|
2878
|
-
showLabels:
|
|
2889
|
+
showLabels: f = !1,
|
|
2879
2890
|
valuePosition: p = "outside",
|
|
2880
|
-
showLabelLines:
|
|
2881
|
-
renderLabel:
|
|
2882
|
-
centerLabel:
|
|
2883
|
-
activeIndex:
|
|
2884
|
-
onSliceClick:
|
|
2885
|
-
showLegend:
|
|
2886
|
-
showTooltip:
|
|
2887
|
-
valueFormat:
|
|
2888
|
-
renderTooltip:
|
|
2889
|
-
emptyMessage:
|
|
2890
|
-
className:
|
|
2891
|
-
style:
|
|
2892
|
-
classes:
|
|
2891
|
+
showLabelLines: L = !0,
|
|
2892
|
+
renderLabel: b,
|
|
2893
|
+
centerLabel: R,
|
|
2894
|
+
activeIndex: w,
|
|
2895
|
+
onSliceClick: J,
|
|
2896
|
+
showLegend: W = !0,
|
|
2897
|
+
showTooltip: E = !0,
|
|
2898
|
+
valueFormat: Z,
|
|
2899
|
+
renderTooltip: C,
|
|
2900
|
+
emptyMessage: $ = "No data",
|
|
2901
|
+
className: ie,
|
|
2902
|
+
style: ne,
|
|
2903
|
+
classes: V
|
|
2893
2904
|
}) {
|
|
2894
|
-
const [
|
|
2905
|
+
const [ae, S] = Le(null), re = oe(null), F = w ?? ae, X = (K) => {
|
|
2895
2906
|
if (r) {
|
|
2896
|
-
const
|
|
2897
|
-
if (typeof
|
|
2907
|
+
const H = e[K]?.[r];
|
|
2908
|
+
if (typeof H == "string") return H;
|
|
2898
2909
|
}
|
|
2899
|
-
return o[
|
|
2900
|
-
},
|
|
2901
|
-
let
|
|
2902
|
-
for (const
|
|
2903
|
-
const
|
|
2904
|
-
typeof
|
|
2910
|
+
return o[K % o.length];
|
|
2911
|
+
}, A = ke(() => {
|
|
2912
|
+
let K = 0;
|
|
2913
|
+
for (const H of e) {
|
|
2914
|
+
const N = H[t];
|
|
2915
|
+
typeof N == "number" && N > 0 && (K += N);
|
|
2905
2916
|
}
|
|
2906
|
-
return
|
|
2917
|
+
return K;
|
|
2907
2918
|
}, [e, t]);
|
|
2908
|
-
if (e.length === 0 ||
|
|
2909
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2910
|
-
const
|
|
2911
|
-
const
|
|
2912
|
-
let
|
|
2913
|
-
for (let
|
|
2914
|
-
const y = e[
|
|
2915
|
-
if (
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2919
|
+
if (e.length === 0 || A === 0)
|
|
2920
|
+
return /* @__PURE__ */ s("div", { ref: re, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2921
|
+
const z = ke(() => {
|
|
2922
|
+
const K = [];
|
|
2923
|
+
let H = 0;
|
|
2924
|
+
for (let N = 0; N < e.length; N++) {
|
|
2925
|
+
const y = e[N], v = y[t], B = typeof v == "number" && v > 0 ? v : 0;
|
|
2926
|
+
if (B === 0) continue;
|
|
2927
|
+
const _ = B / A, q = _ * 360;
|
|
2928
|
+
K.push({ index: N, row: y, value: B, start: H, end: H + q, fraction: _ }), H += q;
|
|
2918
2929
|
}
|
|
2919
|
-
return
|
|
2920
|
-
}, [e, t,
|
|
2930
|
+
return K;
|
|
2931
|
+
}, [e, t, A]), ce = W ? /* @__PURE__ */ s("div", { className: m(M.legend, V?.legend), role: "list", children: z.map((K) => /* @__PURE__ */ j("div", { className: m(M.legendItem, V?.legendItem), role: "listitem", children: [
|
|
2921
2932
|
/* @__PURE__ */ s(
|
|
2922
2933
|
"span",
|
|
2923
2934
|
{
|
|
2924
|
-
className:
|
|
2925
|
-
style: { background:
|
|
2935
|
+
className: M.legendSwatch,
|
|
2936
|
+
style: { background: X(K.index) },
|
|
2926
2937
|
"aria-hidden": "true"
|
|
2927
2938
|
}
|
|
2928
2939
|
),
|
|
2929
|
-
/* @__PURE__ */ s("span", { className:
|
|
2930
|
-
] },
|
|
2931
|
-
const
|
|
2932
|
-
for (const
|
|
2933
|
-
|
|
2934
|
-
label: String(
|
|
2935
|
-
color:
|
|
2940
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: String(K.row[n]) })
|
|
2941
|
+
] }, K.index)) }) : void 0, me = ke(() => {
|
|
2942
|
+
const K = {};
|
|
2943
|
+
for (const H of z)
|
|
2944
|
+
K[H.index.toString()] = {
|
|
2945
|
+
label: String(H.row[n]),
|
|
2946
|
+
color: X(H.index)
|
|
2936
2947
|
};
|
|
2937
|
-
return
|
|
2938
|
-
}, [
|
|
2948
|
+
return K;
|
|
2949
|
+
}, [z]);
|
|
2939
2950
|
return /* @__PURE__ */ s(
|
|
2940
2951
|
Ve,
|
|
2941
2952
|
{
|
|
2942
|
-
ref:
|
|
2953
|
+
ref: re,
|
|
2943
2954
|
aspectRatio: c,
|
|
2944
2955
|
height: i,
|
|
2945
|
-
className:
|
|
2946
|
-
style:
|
|
2947
|
-
classes:
|
|
2948
|
-
legend:
|
|
2949
|
-
overlay:
|
|
2956
|
+
className: ie,
|
|
2957
|
+
style: ne,
|
|
2958
|
+
classes: V,
|
|
2959
|
+
legend: ce,
|
|
2960
|
+
overlay: E && F !== null && e[F] ? /* @__PURE__ */ s(
|
|
2950
2961
|
et,
|
|
2951
2962
|
{
|
|
2952
|
-
row: { [
|
|
2953
|
-
x:
|
|
2963
|
+
row: { [F.toString()]: e[F][t] },
|
|
2964
|
+
x: re.current ? re.current.getBoundingClientRect().width / 2 : 0,
|
|
2954
2965
|
y: 16,
|
|
2955
|
-
containerWidth:
|
|
2956
|
-
config: { [
|
|
2957
|
-
render:
|
|
2958
|
-
valueFormat:
|
|
2966
|
+
containerWidth: re.current?.getBoundingClientRect().width ?? 0,
|
|
2967
|
+
config: { [F.toString()]: me[F.toString()] },
|
|
2968
|
+
render: C ? () => C(e[F]) : void 0,
|
|
2969
|
+
valueFormat: Z,
|
|
2959
2970
|
titleKey: void 0,
|
|
2960
|
-
classes:
|
|
2971
|
+
classes: V
|
|
2961
2972
|
}
|
|
2962
2973
|
) : null,
|
|
2963
|
-
children: ({ width:
|
|
2964
|
-
const
|
|
2965
|
-
return /* @__PURE__ */
|
|
2966
|
-
/* @__PURE__ */ s("g", { children:
|
|
2967
|
-
const
|
|
2974
|
+
children: ({ width: K, height: H }) => {
|
|
2975
|
+
const N = K / 2, y = H / 2, v = Math.min(K, H) / 2 - 4, B = Et(a, v), _ = Math.min(B - 1, Et(l, v)), q = Math.max(4, B * 0.06);
|
|
2976
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
2977
|
+
/* @__PURE__ */ s("g", { children: z.map((U) => {
|
|
2978
|
+
const ee = d / 2, k = Math.min(U.end, U.start + ee), G = Math.max(U.start, U.end - ee), O = X(U.index), le = F === U.index, ge = w !== void 0 && !le, be = le && w !== void 0 ? B + q : B, Ce = Zc(N, y, be, _, k, G), Re = J ? () => J({ row: U.row, value: U.value, index: U.index }) : void 0;
|
|
2968
2979
|
return /* @__PURE__ */ s(
|
|
2969
2980
|
"path",
|
|
2970
2981
|
{
|
|
2971
2982
|
d: Ce,
|
|
2972
|
-
fill:
|
|
2983
|
+
fill: O,
|
|
2973
2984
|
stroke: h > 0 ? u : "none",
|
|
2974
2985
|
strokeWidth: h,
|
|
2975
|
-
opacity:
|
|
2976
|
-
onMouseEnter: () =>
|
|
2977
|
-
onMouseLeave: () =>
|
|
2978
|
-
onClick:
|
|
2979
|
-
style:
|
|
2986
|
+
opacity: ge ? 0.45 : 1,
|
|
2987
|
+
onMouseEnter: () => S(U.index),
|
|
2988
|
+
onMouseLeave: () => S(null),
|
|
2989
|
+
onClick: Re,
|
|
2990
|
+
style: Re ? { cursor: "pointer" } : void 0
|
|
2980
2991
|
},
|
|
2981
|
-
|
|
2992
|
+
U.index
|
|
2982
2993
|
);
|
|
2983
2994
|
}) }),
|
|
2984
|
-
(
|
|
2985
|
-
const
|
|
2986
|
-
if (
|
|
2987
|
-
const
|
|
2995
|
+
(f || b) && z.map((U) => {
|
|
2996
|
+
const ee = b ? b({ row: U.row, value: U.value, fraction: U.fraction, index: U.index }) : f ? `${String(U.row[n])} ${Z ? Z(U.value) : Math.round(U.fraction * 100) + "%"}` : null;
|
|
2997
|
+
if (ee == null) return null;
|
|
2998
|
+
const k = p === "inside", G = Math.max(16, B * 0.12), O = k ? (B + _) / 2 : B + G, le = Pt(N, y, O, U.start, U.end), ge = k ? "middle" : le.x < N - 1 ? "end" : le.x > N + 1 ? "start" : "middle";
|
|
2988
2999
|
let be = null;
|
|
2989
|
-
if (!
|
|
2990
|
-
const Ce = Pt(
|
|
2991
|
-
be = { x1: Ce.x, y1: Ce.y, x2:
|
|
3000
|
+
if (!k && L) {
|
|
3001
|
+
const Ce = Pt(N, y, B, U.start, U.end), Re = 4, g = ge === "end" ? Re : ge === "start" ? -Re : 0;
|
|
3002
|
+
be = { x1: Ce.x, y1: Ce.y, x2: le.x + g, y2: le.y };
|
|
2992
3003
|
}
|
|
2993
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ j("g", { children: [
|
|
2994
3005
|
be && /* @__PURE__ */ s(
|
|
2995
3006
|
"line",
|
|
2996
3007
|
{
|
|
@@ -2998,7 +3009,7 @@ function jl({
|
|
|
2998
3009
|
y1: be.y1,
|
|
2999
3010
|
x2: be.x2,
|
|
3000
3011
|
y2: be.y2,
|
|
3001
|
-
stroke:
|
|
3012
|
+
stroke: X(U.index),
|
|
3002
3013
|
strokeWidth: 1,
|
|
3003
3014
|
opacity: 0.7
|
|
3004
3015
|
}
|
|
@@ -3006,26 +3017,26 @@ function jl({
|
|
|
3006
3017
|
/* @__PURE__ */ s(
|
|
3007
3018
|
"text",
|
|
3008
3019
|
{
|
|
3009
|
-
x:
|
|
3010
|
-
y:
|
|
3011
|
-
className:
|
|
3012
|
-
|
|
3013
|
-
|
|
3020
|
+
x: le.x,
|
|
3021
|
+
y: le.y,
|
|
3022
|
+
className: m(
|
|
3023
|
+
M.axisLabel,
|
|
3024
|
+
k && M.barLabelInside
|
|
3014
3025
|
),
|
|
3015
|
-
textAnchor:
|
|
3026
|
+
textAnchor: ge,
|
|
3016
3027
|
dominantBaseline: "middle",
|
|
3017
|
-
children:
|
|
3028
|
+
children: ee
|
|
3018
3029
|
}
|
|
3019
3030
|
)
|
|
3020
|
-
] }, `label-${
|
|
3031
|
+
] }, `label-${U.index}`);
|
|
3021
3032
|
}),
|
|
3022
|
-
|
|
3033
|
+
R !== void 0 && /* @__PURE__ */ s(
|
|
3023
3034
|
"foreignObject",
|
|
3024
3035
|
{
|
|
3025
|
-
x:
|
|
3026
|
-
y: y -
|
|
3027
|
-
width: Math.max(0,
|
|
3028
|
-
height: Math.max(0,
|
|
3036
|
+
x: N - _,
|
|
3037
|
+
y: y - _,
|
|
3038
|
+
width: Math.max(0, _ * 2),
|
|
3039
|
+
height: Math.max(0, _ * 2),
|
|
3029
3040
|
style: { pointerEvents: "none" },
|
|
3030
3041
|
children: /* @__PURE__ */ s(
|
|
3031
3042
|
"div",
|
|
@@ -3041,7 +3052,7 @@ function jl({
|
|
|
3041
3052
|
color: "var(--crk-color-text)",
|
|
3042
3053
|
fontFamily: "var(--crk-font-family)"
|
|
3043
3054
|
},
|
|
3044
|
-
children:
|
|
3055
|
+
children: R
|
|
3045
3056
|
}
|
|
3046
3057
|
)
|
|
3047
3058
|
}
|
|
@@ -3074,186 +3085,186 @@ function Xl({
|
|
|
3074
3085
|
showRadiusAxis: h = !1,
|
|
3075
3086
|
levels: u = 5,
|
|
3076
3087
|
showPoints: d = !0,
|
|
3077
|
-
fillOpacity:
|
|
3088
|
+
fillOpacity: f = 0.4,
|
|
3078
3089
|
strokeWidth: p = 2,
|
|
3079
|
-
renderAxisLabel:
|
|
3080
|
-
axisFormat:
|
|
3081
|
-
valueFormat:
|
|
3082
|
-
renderTooltip:
|
|
3083
|
-
showLegend:
|
|
3084
|
-
showTooltip:
|
|
3085
|
-
emptyMessage:
|
|
3086
|
-
className:
|
|
3087
|
-
style:
|
|
3088
|
-
classes:
|
|
3090
|
+
renderAxisLabel: L,
|
|
3091
|
+
axisFormat: b,
|
|
3092
|
+
valueFormat: R,
|
|
3093
|
+
renderTooltip: w,
|
|
3094
|
+
showLegend: J = !0,
|
|
3095
|
+
showTooltip: W = !0,
|
|
3096
|
+
emptyMessage: E = "No data",
|
|
3097
|
+
className: Z,
|
|
3098
|
+
style: C,
|
|
3099
|
+
classes: $
|
|
3089
3100
|
}) {
|
|
3090
|
-
const [
|
|
3101
|
+
const [ie, ne] = Le(null), V = oe(null), ae = ke(() => Object.keys(n), [n]);
|
|
3091
3102
|
if (e.length === 0)
|
|
3092
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
3093
|
-
const
|
|
3094
|
-
() => e.map((
|
|
3103
|
+
return /* @__PURE__ */ s("div", { ref: V, className: m(M.root, $?.root, Z), style: C, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: E }) }) });
|
|
3104
|
+
const S = ke(
|
|
3105
|
+
() => e.map((A, z) => z / e.length * 360),
|
|
3095
3106
|
[e]
|
|
3096
|
-
),
|
|
3097
|
-
const
|
|
3098
|
-
for (const
|
|
3099
|
-
for (const
|
|
3100
|
-
const
|
|
3101
|
-
typeof
|
|
3107
|
+
), re = ke(() => {
|
|
3108
|
+
const A = [];
|
|
3109
|
+
for (const ce of ae)
|
|
3110
|
+
for (const me of e) {
|
|
3111
|
+
const K = me[ce];
|
|
3112
|
+
typeof K == "number" && A.push(K);
|
|
3102
3113
|
}
|
|
3103
|
-
const [,
|
|
3104
|
-
return Math.max(1,
|
|
3105
|
-
}, [e,
|
|
3114
|
+
const [, z] = bt(A);
|
|
3115
|
+
return Math.max(1, z);
|
|
3116
|
+
}, [e, ae]), F = ke(() => qe(0, re, u).filter((z) => z > 0), [re, u]), X = F[F.length - 1] ?? re;
|
|
3106
3117
|
return /* @__PURE__ */ s(
|
|
3107
3118
|
Ve,
|
|
3108
3119
|
{
|
|
3109
|
-
ref:
|
|
3120
|
+
ref: V,
|
|
3110
3121
|
aspectRatio: r,
|
|
3111
3122
|
height: o,
|
|
3112
|
-
className:
|
|
3113
|
-
style:
|
|
3114
|
-
classes:
|
|
3115
|
-
legend:
|
|
3116
|
-
overlay:
|
|
3123
|
+
className: Z,
|
|
3124
|
+
style: C,
|
|
3125
|
+
classes: $,
|
|
3126
|
+
legend: J ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
3127
|
+
overlay: W && ie !== null ? /* @__PURE__ */ s(
|
|
3117
3128
|
et,
|
|
3118
3129
|
{
|
|
3119
|
-
row: e[
|
|
3120
|
-
x: (
|
|
3130
|
+
row: e[ie],
|
|
3131
|
+
x: (V.current?.getBoundingClientRect().width ?? 0) / 2,
|
|
3121
3132
|
y: 16,
|
|
3122
|
-
containerWidth:
|
|
3133
|
+
containerWidth: V.current?.getBoundingClientRect().width ?? 0,
|
|
3123
3134
|
config: n,
|
|
3124
|
-
render:
|
|
3125
|
-
valueFormat:
|
|
3135
|
+
render: w ? () => w(e[ie]) : void 0,
|
|
3136
|
+
valueFormat: R,
|
|
3126
3137
|
titleKey: t,
|
|
3127
|
-
classes:
|
|
3138
|
+
classes: $
|
|
3128
3139
|
}
|
|
3129
3140
|
) : null,
|
|
3130
|
-
children: ({ width:
|
|
3131
|
-
const
|
|
3132
|
-
return /* @__PURE__ */
|
|
3133
|
-
i &&
|
|
3134
|
-
const
|
|
3141
|
+
children: ({ width: A, height: z }) => {
|
|
3142
|
+
const ce = a ? 32 : 8, me = A / 2, K = z / 2, H = Math.max(0, Math.min(A, z) / 2 - ce), N = (y) => Math.max(0, y) / X * H;
|
|
3143
|
+
return /* @__PURE__ */ j(je, { children: [
|
|
3144
|
+
i && F.map((y) => {
|
|
3145
|
+
const v = N(y);
|
|
3135
3146
|
return c === "circle" ? /* @__PURE__ */ s(
|
|
3136
3147
|
"circle",
|
|
3137
3148
|
{
|
|
3138
|
-
className:
|
|
3139
|
-
cx:
|
|
3140
|
-
cy:
|
|
3141
|
-
r:
|
|
3149
|
+
className: m(M.gridLine, $?.grid),
|
|
3150
|
+
cx: me,
|
|
3151
|
+
cy: K,
|
|
3152
|
+
r: v,
|
|
3142
3153
|
fill: "none"
|
|
3143
3154
|
},
|
|
3144
3155
|
`ring-${y}`
|
|
3145
3156
|
) : /* @__PURE__ */ s(
|
|
3146
3157
|
"polygon",
|
|
3147
3158
|
{
|
|
3148
|
-
className:
|
|
3149
|
-
points: Kc(
|
|
3159
|
+
className: m(M.gridLine, $?.grid),
|
|
3160
|
+
points: Kc(me, K, v, S),
|
|
3150
3161
|
fill: "none"
|
|
3151
3162
|
},
|
|
3152
3163
|
`ring-${y}`
|
|
3153
3164
|
);
|
|
3154
3165
|
}),
|
|
3155
|
-
l &&
|
|
3156
|
-
const
|
|
3166
|
+
l && S.map((y, v) => {
|
|
3167
|
+
const B = mt(me, K, H, y);
|
|
3157
3168
|
return /* @__PURE__ */ s(
|
|
3158
3169
|
"line",
|
|
3159
3170
|
{
|
|
3160
|
-
className:
|
|
3161
|
-
x1:
|
|
3162
|
-
y1:
|
|
3163
|
-
x2:
|
|
3164
|
-
y2:
|
|
3171
|
+
className: m(M.gridLine, $?.grid),
|
|
3172
|
+
x1: me,
|
|
3173
|
+
y1: K,
|
|
3174
|
+
x2: B.x,
|
|
3175
|
+
y2: B.y
|
|
3165
3176
|
},
|
|
3166
|
-
`spoke-${
|
|
3177
|
+
`spoke-${v}`
|
|
3167
3178
|
);
|
|
3168
3179
|
}),
|
|
3169
|
-
h &&
|
|
3170
|
-
const
|
|
3180
|
+
h && F.map((y) => {
|
|
3181
|
+
const v = N(y);
|
|
3171
3182
|
return /* @__PURE__ */ s(
|
|
3172
3183
|
"text",
|
|
3173
3184
|
{
|
|
3174
|
-
className:
|
|
3175
|
-
x:
|
|
3176
|
-
y:
|
|
3185
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3186
|
+
x: me + 4,
|
|
3187
|
+
y: K - v,
|
|
3177
3188
|
textAnchor: "start",
|
|
3178
3189
|
dominantBaseline: "middle",
|
|
3179
|
-
children:
|
|
3190
|
+
children: R ? R(y) : y
|
|
3180
3191
|
},
|
|
3181
3192
|
`raxis-${y}`
|
|
3182
3193
|
);
|
|
3183
3194
|
}),
|
|
3184
|
-
a && e.map((y,
|
|
3185
|
-
const
|
|
3186
|
-
if (
|
|
3187
|
-
return /* @__PURE__ */ s("g", { children:
|
|
3195
|
+
a && e.map((y, v) => {
|
|
3196
|
+
const B = S[v], _ = mt(me, K, H + 14, B), q = _.x < me - 1 ? "end" : _.x > me + 1 ? "start" : "middle";
|
|
3197
|
+
if (L)
|
|
3198
|
+
return /* @__PURE__ */ s("g", { children: L({
|
|
3188
3199
|
row: y,
|
|
3189
|
-
index:
|
|
3190
|
-
angle:
|
|
3191
|
-
x:
|
|
3192
|
-
y:
|
|
3193
|
-
textAnchor:
|
|
3194
|
-
}) }, `label-${
|
|
3195
|
-
const
|
|
3200
|
+
index: v,
|
|
3201
|
+
angle: B,
|
|
3202
|
+
x: _.x,
|
|
3203
|
+
y: _.y,
|
|
3204
|
+
textAnchor: q
|
|
3205
|
+
}) }, `label-${v}`);
|
|
3206
|
+
const U = String(y[t]), ee = b ? b(U) : U;
|
|
3196
3207
|
return /* @__PURE__ */ s(
|
|
3197
3208
|
"text",
|
|
3198
3209
|
{
|
|
3199
|
-
className:
|
|
3200
|
-
x:
|
|
3201
|
-
y:
|
|
3202
|
-
textAnchor:
|
|
3210
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3211
|
+
x: _.x,
|
|
3212
|
+
y: _.y,
|
|
3213
|
+
textAnchor: q,
|
|
3203
3214
|
dominantBaseline: "middle",
|
|
3204
|
-
children:
|
|
3215
|
+
children: ee
|
|
3205
3216
|
},
|
|
3206
|
-
`label-${
|
|
3217
|
+
`label-${v}`
|
|
3207
3218
|
);
|
|
3208
3219
|
}),
|
|
3209
|
-
|
|
3210
|
-
const
|
|
3211
|
-
const
|
|
3212
|
-
return mt(
|
|
3213
|
-
}),
|
|
3214
|
-
return /* @__PURE__ */
|
|
3220
|
+
ae.map((y) => {
|
|
3221
|
+
const v = n[y], B = e.map((q, U) => {
|
|
3222
|
+
const ee = q[y], G = N(typeof ee == "number" ? ee : 0);
|
|
3223
|
+
return mt(me, K, G, S[U]);
|
|
3224
|
+
}), _ = B.map((q) => `${q.x},${q.y}`).join(" ");
|
|
3225
|
+
return /* @__PURE__ */ j("g", { className: m(M.series, $?.series), children: [
|
|
3215
3226
|
/* @__PURE__ */ s(
|
|
3216
3227
|
"polygon",
|
|
3217
3228
|
{
|
|
3218
|
-
points:
|
|
3219
|
-
fill:
|
|
3220
|
-
fillOpacity:
|
|
3221
|
-
stroke:
|
|
3229
|
+
points: _,
|
|
3230
|
+
fill: v.color,
|
|
3231
|
+
fillOpacity: f,
|
|
3232
|
+
stroke: v.color,
|
|
3222
3233
|
strokeWidth: p,
|
|
3223
3234
|
strokeLinejoin: "round",
|
|
3224
3235
|
strokeLinecap: "round"
|
|
3225
3236
|
}
|
|
3226
3237
|
),
|
|
3227
|
-
d &&
|
|
3238
|
+
d && B.map((q, U) => /* @__PURE__ */ s(
|
|
3228
3239
|
"circle",
|
|
3229
3240
|
{
|
|
3230
|
-
className:
|
|
3231
|
-
cx:
|
|
3232
|
-
cy:
|
|
3233
|
-
r:
|
|
3234
|
-
fill:
|
|
3241
|
+
className: m(M.point, $?.point),
|
|
3242
|
+
cx: q.x,
|
|
3243
|
+
cy: q.y,
|
|
3244
|
+
r: ie === U ? 5 : 3.5,
|
|
3245
|
+
fill: v.color
|
|
3235
3246
|
},
|
|
3236
|
-
`${y}-${
|
|
3247
|
+
`${y}-${U}`
|
|
3237
3248
|
))
|
|
3238
3249
|
] }, y);
|
|
3239
3250
|
}),
|
|
3240
3251
|
/* @__PURE__ */ s(
|
|
3241
3252
|
"rect",
|
|
3242
3253
|
{
|
|
3243
|
-
className:
|
|
3254
|
+
className: M.interactionLayer,
|
|
3244
3255
|
x: 0,
|
|
3245
3256
|
y: 0,
|
|
3246
|
-
width:
|
|
3247
|
-
height:
|
|
3257
|
+
width: A,
|
|
3258
|
+
height: z,
|
|
3248
3259
|
onMouseMove: (y) => {
|
|
3249
|
-
const
|
|
3250
|
-
if (
|
|
3251
|
-
let
|
|
3252
|
-
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3260
|
+
const v = y.currentTarget.getBoundingClientRect(), B = y.clientX - v.left - me, _ = y.clientY - v.top - K;
|
|
3261
|
+
if (B === 0 && _ === 0) return;
|
|
3262
|
+
let q = Math.atan2(_, B) * 180 / Math.PI + 90;
|
|
3263
|
+
q < 0 && (q += 360), q >= 360 && (q -= 360);
|
|
3264
|
+
const U = 360 / e.length, ee = Math.round(q / U) % e.length;
|
|
3265
|
+
ne(ee);
|
|
3255
3266
|
},
|
|
3256
|
-
onMouseLeave: () =>
|
|
3267
|
+
onMouseLeave: () => ne(null)
|
|
3257
3268
|
}
|
|
3258
3269
|
)
|
|
3259
3270
|
] });
|
|
@@ -3288,11 +3299,11 @@ function el(e, t, n = 2) {
|
|
|
3288
3299
|
if (t <= 0 || r < t) return { middle: o, upper: c, lower: i };
|
|
3289
3300
|
for (let l = t - 1; l < r; l++) {
|
|
3290
3301
|
let a = 0;
|
|
3291
|
-
for (let
|
|
3302
|
+
for (let f = l - t + 1; f <= l; f++) a += e[f].close;
|
|
3292
3303
|
const h = a / t;
|
|
3293
3304
|
let u = 0;
|
|
3294
|
-
for (let
|
|
3295
|
-
const p = e[
|
|
3305
|
+
for (let f = l - t + 1; f <= l; f++) {
|
|
3306
|
+
const p = e[f].close - h;
|
|
3296
3307
|
u += p * p;
|
|
3297
3308
|
}
|
|
3298
3309
|
u /= t;
|
|
@@ -3322,34 +3333,34 @@ function Wt(e, t) {
|
|
|
3322
3333
|
function _l(e) {
|
|
3323
3334
|
return e.map((t) => typeof t.volume == "number" ? t.volume : null);
|
|
3324
3335
|
}
|
|
3325
|
-
const
|
|
3336
|
+
const Se = 86400;
|
|
3326
3337
|
function on(e) {
|
|
3327
3338
|
switch (e) {
|
|
3328
3339
|
case "1D":
|
|
3329
|
-
return
|
|
3340
|
+
return Se;
|
|
3330
3341
|
case "5D":
|
|
3331
|
-
return 5 *
|
|
3342
|
+
return 5 * Se;
|
|
3332
3343
|
case "1M":
|
|
3333
|
-
return 30 *
|
|
3344
|
+
return 30 * Se;
|
|
3334
3345
|
case "3M":
|
|
3335
|
-
return 90 *
|
|
3346
|
+
return 90 * Se;
|
|
3336
3347
|
case "6M":
|
|
3337
|
-
return 180 *
|
|
3348
|
+
return 180 * Se;
|
|
3338
3349
|
case "1Y":
|
|
3339
|
-
return 365 *
|
|
3350
|
+
return 365 * Se;
|
|
3340
3351
|
case "5Y":
|
|
3341
|
-
return 5 * 365 *
|
|
3352
|
+
return 5 * 365 * Se;
|
|
3342
3353
|
}
|
|
3343
3354
|
const t = /^(\d+)\s*([dDwWmMyYhH])$/.exec(e);
|
|
3344
3355
|
if (t) {
|
|
3345
3356
|
const n = Number(t[1]), r = t[2].toLowerCase();
|
|
3346
3357
|
if (r === "h") return n * 3600;
|
|
3347
|
-
if (r === "d") return n *
|
|
3348
|
-
if (r === "w") return n * 7 *
|
|
3349
|
-
if (r === "m") return n * 30 *
|
|
3350
|
-
if (r === "y") return n * 365 *
|
|
3358
|
+
if (r === "d") return n * Se;
|
|
3359
|
+
if (r === "w") return n * 7 * Se;
|
|
3360
|
+
if (r === "m") return n * 30 * Se;
|
|
3361
|
+
if (r === "y") return n * 365 * Se;
|
|
3351
3362
|
}
|
|
3352
|
-
return 30 *
|
|
3363
|
+
return 30 * Se;
|
|
3353
3364
|
}
|
|
3354
3365
|
function Ul(e) {
|
|
3355
3366
|
switch (e) {
|
|
@@ -3369,7 +3380,7 @@ function Ul(e) {
|
|
|
3369
3380
|
return "W";
|
|
3370
3381
|
}
|
|
3371
3382
|
const t = on(e);
|
|
3372
|
-
return t >= 3 * 365 *
|
|
3383
|
+
return t >= 3 * 365 * Se ? "W" : t >= 180 * Se ? "D" : t >= 60 * Se ? "240" : t >= 14 * Se ? "60" : t >= 3 * Se ? "15" : "5";
|
|
3373
3384
|
}
|
|
3374
3385
|
function Yl(e) {
|
|
3375
3386
|
if (e === "W" || e === "M") return "5Y";
|
|
@@ -3391,209 +3402,209 @@ function Vl({
|
|
|
3391
3402
|
upColor: h = "var(--crk-color-success)",
|
|
3392
3403
|
downColor: u = "var(--crk-color-danger)",
|
|
3393
3404
|
lineColor: d = "var(--crk-chart-1)",
|
|
3394
|
-
timezone:
|
|
3405
|
+
timezone: f,
|
|
3395
3406
|
defaultTimezone: p = "local",
|
|
3396
|
-
onTimezoneChange:
|
|
3397
|
-
showConfigPanel:
|
|
3398
|
-
onCrosshair:
|
|
3399
|
-
onVisibleRangeChange:
|
|
3400
|
-
className:
|
|
3401
|
-
style:
|
|
3407
|
+
onTimezoneChange: L,
|
|
3408
|
+
showConfigPanel: b = !0,
|
|
3409
|
+
onCrosshair: R,
|
|
3410
|
+
onVisibleRangeChange: w,
|
|
3411
|
+
className: J,
|
|
3412
|
+
style: W
|
|
3402
3413
|
}) {
|
|
3403
|
-
const
|
|
3404
|
-
}),
|
|
3405
|
-
|
|
3406
|
-
const [
|
|
3414
|
+
const E = oe(null), Z = oe(null), C = oe([]), $ = oe({ from: 0, to: 0 }), ie = oe(null), ne = oe(null), V = oe(!1), ae = oe(null), S = oe(null), re = oe(1), F = oe({ width: 0, height: 0 }), X = oe(() => {
|
|
3415
|
+
}), A = oe(R), z = oe(w);
|
|
3416
|
+
A.current = R, z.current = w;
|
|
3417
|
+
const [ce, me] = Le(null), [K, H] = Le(p), N = f ?? K, y = pe(
|
|
3407
3418
|
(g) => {
|
|
3408
|
-
|
|
3419
|
+
f === void 0 && H(g), L?.(g);
|
|
3409
3420
|
},
|
|
3410
|
-
[
|
|
3411
|
-
),
|
|
3421
|
+
[f, L]
|
|
3422
|
+
), v = ke(
|
|
3412
3423
|
() => ({ up: h, down: u, line: d }),
|
|
3413
3424
|
[h, u, d]
|
|
3414
|
-
),
|
|
3415
|
-
const g =
|
|
3425
|
+
), B = c, _ = B.some((g) => g.type === "rsi"), q = B.some((g) => g.type === "volume"), U = pe(() => {
|
|
3426
|
+
const g = Z.current;
|
|
3416
3427
|
if (!g) return;
|
|
3417
|
-
const
|
|
3418
|
-
if (!
|
|
3419
|
-
const { width:
|
|
3420
|
-
if (
|
|
3421
|
-
const
|
|
3422
|
-
|
|
3423
|
-
const
|
|
3424
|
-
if (
|
|
3425
|
-
gl(
|
|
3428
|
+
const x = g.getContext("2d");
|
|
3429
|
+
if (!x) return;
|
|
3430
|
+
const { width: te, height: D } = F.current;
|
|
3431
|
+
if (te === 0 || D === 0) return;
|
|
3432
|
+
const Y = re.current;
|
|
3433
|
+
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, g.width, g.height), x.scale(Y, Y);
|
|
3434
|
+
const I = pl(E.current, v), fe = ln(E.current), Q = C.current;
|
|
3435
|
+
if (Q.length === 0) {
|
|
3436
|
+
gl(x, te, D, I), x.restore();
|
|
3426
3437
|
return;
|
|
3427
3438
|
}
|
|
3428
|
-
const
|
|
3429
|
-
|
|
3430
|
-
const
|
|
3431
|
-
const Ie =
|
|
3432
|
-
return
|
|
3433
|
-
}, Ae =
|
|
3434
|
-
Lt(
|
|
3435
|
-
for (let
|
|
3436
|
-
const Ie =
|
|
3437
|
-
He && kl(
|
|
3439
|
+
const T = Nt(te, D, _, q), { from: de, to: ye } = hl($.current, Q.length);
|
|
3440
|
+
$.current = { from: de, to: ye };
|
|
3441
|
+
const se = Q.slice(Math.max(0, Math.floor(de)), Math.min(Q.length, Math.ceil(ye) + 1)), he = (ue) => {
|
|
3442
|
+
const Ie = ye - de + 1, He = T.plotWidth / Ie;
|
|
3443
|
+
return T.plotLeft + (ue - de + 0.5) * He;
|
|
3444
|
+
}, Ae = T.plotWidth / (ye - de + 1), De = B.map((ue) => ml(ue, Q)).filter((ue) => ue !== null).map((ue) => ({ ...ue, color: fe(ue.color) })), xe = cn(T.main, se, De, de, ye);
|
|
3445
|
+
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();
|
|
3446
|
+
for (let ue = 0; ue < B.length; ue++) {
|
|
3447
|
+
const Ie = B[ue], He = De[ue];
|
|
3448
|
+
He && kl(x, He, Ie, Q, de, ye, he, xe);
|
|
3438
3449
|
}
|
|
3439
|
-
if (o === "candle" ? vl(
|
|
3440
|
-
const
|
|
3441
|
-
Lt(
|
|
3450
|
+
if (o === "candle" ? vl(x, Q, de, ye, he, Ae, xe, { up: I.up, down: I.down }) : o === "bar" ? bl(x, Q, de, ye, he, Ae, xe, { up: I.up, down: I.down }) : xl(x, Q, de, ye, he, xe, I.line, o === "area"), x.restore(), T.volume) {
|
|
3451
|
+
const ue = fl(T.volume, Q, de, ye);
|
|
3452
|
+
Lt(x, T.plotLeft, T.plotRight, ue, I, !0), Ft(x, T, T.volume, "Volume", I), x.save(), x.beginPath(), x.rect(T.plotLeft, ue.paneTop, T.plotWidth, ue.paneHeight), x.clip(), Ml(x, Q, de, ye, he, Ae, ue, { up: I.up, down: I.down }), x.restore();
|
|
3442
3453
|
}
|
|
3443
|
-
if (
|
|
3444
|
-
const
|
|
3445
|
-
paneTop:
|
|
3446
|
-
paneBottom:
|
|
3447
|
-
paneHeight:
|
|
3454
|
+
if (T.rsi) {
|
|
3455
|
+
const ue = B.find((tt) => tt.type === "rsi"), Ie = ue && ue.type === "rsi" ? ue.period ?? 14 : 14, He = ue && ue.type === "rsi" ? ue.overbought ?? 70 : 70, Ge = ue && ue.type === "rsi" ? ue.oversold ?? 30 : 30, Ee = (ue && ue.type === "rsi" ? ue.color : void 0) ?? "var(--crk-chart-5)", xt = fe(Ee), kt = tl(Q, Ie), Oe = {
|
|
3456
|
+
paneTop: T.rsi.top,
|
|
3457
|
+
paneBottom: T.rsi.bottom,
|
|
3458
|
+
paneHeight: T.rsi.height,
|
|
3448
3459
|
priceMin: 0,
|
|
3449
3460
|
priceMax: 100,
|
|
3450
3461
|
ticks: [Ge, 50, He]
|
|
3451
3462
|
};
|
|
3452
|
-
Lt(
|
|
3463
|
+
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, de, ye, he, Oe, xt), x.restore(), wl(x, T, Oe, He, Ge, I);
|
|
3453
3464
|
}
|
|
3454
|
-
$l(
|
|
3455
|
-
}, [o,
|
|
3456
|
-
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3465
|
+
$l(x, T, Q, de, ye, n, I), ie.current && Nl(x, T, ie.current, Q, de, ye, he, i, xe, N, I), x.restore();
|
|
3466
|
+
}, [o, B, _, q, i, v, n, N]);
|
|
3467
|
+
X.current = U;
|
|
3468
|
+
const ee = pe(() => {
|
|
3469
|
+
if (S.current === null) {
|
|
3459
3470
|
if (typeof requestAnimationFrame > "u") {
|
|
3460
|
-
|
|
3471
|
+
X.current();
|
|
3461
3472
|
return;
|
|
3462
3473
|
}
|
|
3463
|
-
|
|
3464
|
-
|
|
3474
|
+
S.current = requestAnimationFrame(() => {
|
|
3475
|
+
S.current = null, X.current();
|
|
3465
3476
|
});
|
|
3466
3477
|
}
|
|
3467
3478
|
}, []);
|
|
3468
3479
|
jt(() => {
|
|
3469
|
-
const g =
|
|
3480
|
+
const g = E.current;
|
|
3470
3481
|
if (!g) return;
|
|
3471
|
-
const
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3482
|
+
const x = () => {
|
|
3483
|
+
const D = g.getBoundingClientRect(), Y = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3484
|
+
re.current = Y, F.current = { width: D.width, height: D.height };
|
|
3485
|
+
const I = Z.current;
|
|
3486
|
+
I && (I.width = Math.round(D.width * Y), I.height = Math.round(D.height * Y), I.style.width = `${D.width}px`, I.style.height = `${D.height}px`), ee();
|
|
3476
3487
|
};
|
|
3477
|
-
if (
|
|
3478
|
-
const
|
|
3479
|
-
return
|
|
3480
|
-
}, [
|
|
3488
|
+
if (x(), typeof ResizeObserver > "u") return;
|
|
3489
|
+
const te = new ResizeObserver(x);
|
|
3490
|
+
return te.observe(g), () => te.disconnect();
|
|
3491
|
+
}, [ee]), Ne(() => {
|
|
3481
3492
|
let g = !1;
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3493
|
+
const x = Math.floor(Date.now() / 1e3), te = zt(n), D = r !== void 0 ? on(r) : te * l, Y = r !== void 0 ? Math.max(10, Math.ceil(D / te)) : l, I = x - D;
|
|
3494
|
+
C.current = [], $.current = { from: 0, to: 0 }, ee(), e.getBars({ symbol: t, resolution: n, from: I, to: x, countBack: Y }).then((Q) => {
|
|
3484
3495
|
if (g) return;
|
|
3485
|
-
const
|
|
3486
|
-
|
|
3487
|
-
const
|
|
3496
|
+
const T = [...Q].sort((ye, se) => ye.time - se.time);
|
|
3497
|
+
C.current = T;
|
|
3498
|
+
const de = T.length - 1;
|
|
3488
3499
|
if (r !== void 0)
|
|
3489
|
-
|
|
3500
|
+
$.current = { from: 0, to: de };
|
|
3490
3501
|
else {
|
|
3491
|
-
const
|
|
3492
|
-
|
|
3493
|
-
from: Math.max(0,
|
|
3494
|
-
to:
|
|
3502
|
+
const ye = Math.min(T.length, Math.min(200, l));
|
|
3503
|
+
$.current = {
|
|
3504
|
+
from: Math.max(0, de - ye + 1),
|
|
3505
|
+
to: de
|
|
3495
3506
|
};
|
|
3496
3507
|
}
|
|
3497
|
-
|
|
3508
|
+
z.current?.($.current, T), ee();
|
|
3498
3509
|
}).catch(() => {
|
|
3499
3510
|
});
|
|
3500
|
-
const
|
|
3511
|
+
const fe = e.subscribeBars({
|
|
3501
3512
|
symbol: t,
|
|
3502
3513
|
resolution: n,
|
|
3503
|
-
onTick: (
|
|
3514
|
+
onTick: (Q) => {
|
|
3504
3515
|
if (g) return;
|
|
3505
|
-
const
|
|
3506
|
-
if (
|
|
3507
|
-
|
|
3508
|
-
else if (!
|
|
3509
|
-
|
|
3510
|
-
const
|
|
3511
|
-
|
|
3516
|
+
const T = C.current, de = T[T.length - 1];
|
|
3517
|
+
if (de && de.time === Q.time)
|
|
3518
|
+
T[T.length - 1] = Q;
|
|
3519
|
+
else if (!de || Q.time > de.time) {
|
|
3520
|
+
T.push(Q);
|
|
3521
|
+
const ye = $.current;
|
|
3522
|
+
ye.to >= T.length - 2 && ($.current = { from: ye.from + 1, to: ye.to + 1 });
|
|
3512
3523
|
}
|
|
3513
|
-
|
|
3524
|
+
ee();
|
|
3514
3525
|
}
|
|
3515
3526
|
});
|
|
3516
|
-
return
|
|
3517
|
-
g = !0,
|
|
3527
|
+
return ae.current = fe, () => {
|
|
3528
|
+
g = !0, ae.current !== null && (e.unsubscribeBars(ae.current), ae.current = null);
|
|
3518
3529
|
};
|
|
3519
3530
|
}, [e, t, n, r, l]);
|
|
3520
|
-
const
|
|
3521
|
-
|
|
3522
|
-
}, []),
|
|
3531
|
+
const k = pe((g) => {
|
|
3532
|
+
me(g), A.current?.(g);
|
|
3533
|
+
}, []), G = pe((g) => {
|
|
3523
3534
|
g.currentTarget.setPointerCapture(g.pointerId);
|
|
3524
|
-
const
|
|
3525
|
-
|
|
3526
|
-
}, []),
|
|
3535
|
+
const x = $.current;
|
|
3536
|
+
ne.current = { startX: g.clientX, from: x.from, to: x.to };
|
|
3537
|
+
}, []), O = pe(
|
|
3527
3538
|
(g) => {
|
|
3528
|
-
const
|
|
3529
|
-
if (
|
|
3530
|
-
const { startX:
|
|
3531
|
-
let De =
|
|
3532
|
-
const
|
|
3533
|
-
De < 0 && (
|
|
3539
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left, D = g.clientY - x.top;
|
|
3540
|
+
if (ie.current = { x: te, y: D }, ne.current) {
|
|
3541
|
+
const { startX: fe, from: Q, to: T } = ne.current, { width: de } = F.current, ye = Math.max(1, de - Ct), se = T - Q + 1, he = ye / se, Ae = -(g.clientX - fe) / he;
|
|
3542
|
+
let De = Q + Ae, xe = T + Ae;
|
|
3543
|
+
const ue = C.current.length;
|
|
3544
|
+
De < 0 && (Re(), De = 0, xe = se - 1), xe > ue - 1 && (xe = ue - 1, De = xe - se + 1), $.current = { from: De, to: xe }, z.current?.($.current, C.current);
|
|
3534
3545
|
}
|
|
3535
|
-
const
|
|
3536
|
-
if (
|
|
3537
|
-
const
|
|
3538
|
-
|
|
3546
|
+
const Y = Nt(x.width, x.height, _, q), I = $.current;
|
|
3547
|
+
if (te >= Y.plotLeft && te <= Y.plotRight) {
|
|
3548
|
+
const fe = I.to - I.from + 1, Q = Y.plotWidth / fe, T = Math.round(I.from + (te - Y.plotLeft) / Q - 0.5), de = C.current, ye = Math.max(0, Math.min(de.length - 1, T)), se = de[ye] ?? null, he = Ll(D, Y, de, I.from, I.to);
|
|
3549
|
+
k({ barIndex: ye, bar: se, priceAtCursor: he });
|
|
3539
3550
|
} else
|
|
3540
|
-
|
|
3541
|
-
|
|
3551
|
+
k(null);
|
|
3552
|
+
ee();
|
|
3542
3553
|
},
|
|
3543
|
-
[
|
|
3544
|
-
),
|
|
3545
|
-
g.currentTarget.releasePointerCapture(g.pointerId),
|
|
3546
|
-
}, []),
|
|
3547
|
-
|
|
3548
|
-
}, [
|
|
3554
|
+
[_, q, ee, k]
|
|
3555
|
+
), le = pe((g) => {
|
|
3556
|
+
g.currentTarget.releasePointerCapture(g.pointerId), ne.current = null;
|
|
3557
|
+
}, []), ge = pe(() => {
|
|
3558
|
+
ie.current = null, ne.current = null, k(null), ee();
|
|
3559
|
+
}, [ee, k]), be = pe(
|
|
3549
3560
|
(g) => {
|
|
3550
3561
|
g.preventDefault();
|
|
3551
|
-
const
|
|
3552
|
-
if (
|
|
3553
|
-
const
|
|
3554
|
-
|
|
3555
|
-
Math.min(
|
|
3556
|
-
),
|
|
3557
|
-
let
|
|
3558
|
-
|
|
3562
|
+
const x = g.currentTarget.getBoundingClientRect(), te = g.clientX - x.left, D = Nt(x.width, x.height, _, q), Y = $.current, I = C.current;
|
|
3563
|
+
if (I.length === 0) return;
|
|
3564
|
+
const fe = Y.to - Y.from + 1, Q = g.deltaY > 0 ? 1 + Ot : 1 / (1 + Ot), T = Math.max(
|
|
3565
|
+
D.plotWidth / cl,
|
|
3566
|
+
Math.min(I.length, D.plotWidth / il, fe * Q)
|
|
3567
|
+
), de = Y.from + (te - D.plotLeft) / (D.plotWidth / fe), ye = (de - Y.from) / fe;
|
|
3568
|
+
let se = de - ye * T, he = se + T - 1;
|
|
3569
|
+
se < 0 && (se = 0, he = T - 1), he > I.length - 1 && (he = I.length - 1, se = he - T + 1), $.current = { from: se, to: he }, z.current?.($.current, I), ee();
|
|
3559
3570
|
},
|
|
3560
|
-
[
|
|
3561
|
-
), Ce =
|
|
3571
|
+
[_, q, ee]
|
|
3572
|
+
), Ce = pe(
|
|
3562
3573
|
(g) => {
|
|
3563
|
-
const
|
|
3564
|
-
if (
|
|
3565
|
-
let
|
|
3566
|
-
if (g.key === "ArrowLeft")
|
|
3567
|
-
else if (g.key === "ArrowRight")
|
|
3574
|
+
const x = $.current, te = x.to - x.from + 1, D = C.current;
|
|
3575
|
+
if (D.length === 0) return;
|
|
3576
|
+
let Y = 0;
|
|
3577
|
+
if (g.key === "ArrowLeft") Y = -Math.max(1, Math.floor(te * 0.1));
|
|
3578
|
+
else if (g.key === "ArrowRight") Y = Math.max(1, Math.floor(te * 0.1));
|
|
3568
3579
|
else return;
|
|
3569
3580
|
g.preventDefault();
|
|
3570
|
-
let
|
|
3571
|
-
|
|
3581
|
+
let I = x.from + Y, fe = x.to + Y;
|
|
3582
|
+
I < 0 && (I = 0, fe = te - 1), fe > D.length - 1 && (fe = D.length - 1, I = fe - te + 1), $.current = { from: I, to: fe }, z.current?.($.current, D), ee();
|
|
3572
3583
|
},
|
|
3573
|
-
[
|
|
3574
|
-
),
|
|
3575
|
-
if (
|
|
3576
|
-
const g =
|
|
3584
|
+
[ee]
|
|
3585
|
+
), Re = pe(() => {
|
|
3586
|
+
if (V.current) return;
|
|
3587
|
+
const g = C.current;
|
|
3577
3588
|
if (g.length === 0) return;
|
|
3578
|
-
|
|
3579
|
-
const
|
|
3580
|
-
e.getBars({ symbol: t, resolution: n, from:
|
|
3581
|
-
if (
|
|
3582
|
-
|
|
3589
|
+
V.current = !0;
|
|
3590
|
+
const x = zt(n), te = g[0].time, D = te - x * l, Y = te - x;
|
|
3591
|
+
e.getBars({ symbol: t, resolution: n, from: D, to: Y, countBack: l }).then((I) => {
|
|
3592
|
+
if (I.length === 0) {
|
|
3593
|
+
V.current = !1;
|
|
3583
3594
|
return;
|
|
3584
3595
|
}
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3596
|
+
const Q = [...I].sort((de, ye) => de.time - ye.time).filter((de) => de.time < te), T = $.current;
|
|
3597
|
+
C.current = [...Q, ...g], $.current = { from: T.from + Q.length, to: T.to + Q.length }, V.current = !1, ee();
|
|
3587
3598
|
}).catch(() => {
|
|
3588
|
-
|
|
3599
|
+
V.current = !1;
|
|
3589
3600
|
});
|
|
3590
|
-
}, [e, t, n, l,
|
|
3591
|
-
return /* @__PURE__ */
|
|
3601
|
+
}, [e, t, n, l, ee]);
|
|
3602
|
+
return /* @__PURE__ */ j(
|
|
3592
3603
|
"div",
|
|
3593
3604
|
{
|
|
3594
|
-
ref:
|
|
3595
|
-
className:
|
|
3596
|
-
style: { ...
|
|
3605
|
+
ref: E,
|
|
3606
|
+
className: m(M.root, J),
|
|
3607
|
+
style: { ...W, height: a, position: "relative" },
|
|
3597
3608
|
tabIndex: 0,
|
|
3598
3609
|
role: "figure",
|
|
3599
3610
|
"aria-label": `${t} ${n} chart`,
|
|
@@ -3602,20 +3613,20 @@ function Vl({
|
|
|
3602
3613
|
/* @__PURE__ */ s(
|
|
3603
3614
|
"canvas",
|
|
3604
3615
|
{
|
|
3605
|
-
ref:
|
|
3606
|
-
className:
|
|
3607
|
-
onPointerDown:
|
|
3608
|
-
onPointerMove:
|
|
3609
|
-
onPointerUp:
|
|
3610
|
-
onPointerLeave:
|
|
3616
|
+
ref: Z,
|
|
3617
|
+
className: M.svg,
|
|
3618
|
+
onPointerDown: G,
|
|
3619
|
+
onPointerMove: O,
|
|
3620
|
+
onPointerUp: le,
|
|
3621
|
+
onPointerLeave: ge,
|
|
3611
3622
|
onWheel: be,
|
|
3612
|
-
style: { cursor:
|
|
3623
|
+
style: { cursor: ne.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3613
3624
|
}
|
|
3614
3625
|
),
|
|
3615
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ j(
|
|
3616
3627
|
"div",
|
|
3617
3628
|
{
|
|
3618
|
-
className:
|
|
3629
|
+
className: M.tradingHeader,
|
|
3619
3630
|
style: {
|
|
3620
3631
|
position: "absolute",
|
|
3621
3632
|
top: ol,
|
|
@@ -3628,22 +3639,22 @@ function Vl({
|
|
|
3628
3639
|
gap: 8
|
|
3629
3640
|
},
|
|
3630
3641
|
children: [
|
|
3631
|
-
/* @__PURE__ */
|
|
3642
|
+
/* @__PURE__ */ j("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
3632
3643
|
/* @__PURE__ */ s("strong", { children: t }),
|
|
3633
3644
|
/* @__PURE__ */ s("span", { style: { color: "var(--crk-color-text-muted)" }, children: n }),
|
|
3634
|
-
|
|
3645
|
+
ce?.bar && /* @__PURE__ */ j("span", { style: { color: "var(--crk-color-text-muted)", whiteSpace: "nowrap" }, children: [
|
|
3635
3646
|
"O ",
|
|
3636
|
-
|
|
3647
|
+
ce.bar.open.toFixed(i),
|
|
3637
3648
|
" · H ",
|
|
3638
|
-
|
|
3649
|
+
ce.bar.high.toFixed(i),
|
|
3639
3650
|
" · L",
|
|
3640
3651
|
" ",
|
|
3641
|
-
|
|
3652
|
+
ce.bar.low.toFixed(i),
|
|
3642
3653
|
" · C ",
|
|
3643
|
-
|
|
3654
|
+
ce.bar.close.toFixed(i)
|
|
3644
3655
|
] })
|
|
3645
3656
|
] }),
|
|
3646
|
-
|
|
3657
|
+
b && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
3647
3658
|
qt,
|
|
3648
3659
|
{
|
|
3649
3660
|
position: "bottom",
|
|
@@ -3661,7 +3672,7 @@ function Vl({
|
|
|
3661
3672
|
content: /* @__PURE__ */ s(
|
|
3662
3673
|
dl,
|
|
3663
3674
|
{
|
|
3664
|
-
timezone:
|
|
3675
|
+
timezone: N,
|
|
3665
3676
|
onTimezoneChange: y
|
|
3666
3677
|
}
|
|
3667
3678
|
)
|
|
@@ -3688,7 +3699,7 @@ function dl({
|
|
|
3688
3699
|
timezone: e,
|
|
3689
3700
|
onTimezoneChange: t
|
|
3690
3701
|
}) {
|
|
3691
|
-
return /* @__PURE__ */
|
|
3702
|
+
return /* @__PURE__ */ j("div", { style: { minWidth: 220, padding: 4 }, children: [
|
|
3692
3703
|
/* @__PURE__ */ s(
|
|
3693
3704
|
"div",
|
|
3694
3705
|
{
|
|
@@ -3700,7 +3711,7 @@ function dl({
|
|
|
3700
3711
|
children: "Settings"
|
|
3701
3712
|
}
|
|
3702
3713
|
),
|
|
3703
|
-
/* @__PURE__ */
|
|
3714
|
+
/* @__PURE__ */ j("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
|
|
3704
3715
|
/* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
|
|
3705
3716
|
/* @__PURE__ */ s(
|
|
3706
3717
|
Vt,
|
|
@@ -3714,7 +3725,7 @@ function dl({
|
|
|
3714
3725
|
] });
|
|
3715
3726
|
}
|
|
3716
3727
|
function ul() {
|
|
3717
|
-
return /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ j(
|
|
3718
3729
|
"svg",
|
|
3719
3730
|
{
|
|
3720
3731
|
viewBox: "0 0 24 24",
|
|
@@ -3734,10 +3745,10 @@ function ul() {
|
|
|
3734
3745
|
function Nt(e, t, n, r) {
|
|
3735
3746
|
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);
|
|
3736
3747
|
let u = h, d = i;
|
|
3737
|
-
const
|
|
3738
|
-
let p = null,
|
|
3739
|
-
const
|
|
3740
|
-
return u = h * (1 -
|
|
3748
|
+
const f = { top: i, bottom: l, height: h };
|
|
3749
|
+
let p = null, L = null;
|
|
3750
|
+
const b = n ? Ht.rsi : 0, R = r ? Ht.volume : 0;
|
|
3751
|
+
return u = h * (1 - b - R), f.top = d, f.height = u, f.bottom = f.top + u, d = f.bottom, n && (p = { top: d, height: h * b, bottom: d + h * b }, d = p.bottom), r && (L = { top: d, height: h * R, bottom: d + h * R }), { width: e, height: t, plotLeft: 0, plotRight: c, plotTop: i, plotBottom: l, plotWidth: a, plotHeight: h, main: f, rsi: p, volume: L };
|
|
3741
3752
|
}
|
|
3742
3753
|
function hl(e, t) {
|
|
3743
3754
|
if (t === 0) return { from: 0, to: 0 };
|
|
@@ -3771,12 +3782,12 @@ function cn(e, t, n, r, o) {
|
|
|
3771
3782
|
for (const d of t)
|
|
3772
3783
|
d.low < c && (c = d.low), d.high > i && (i = d.high);
|
|
3773
3784
|
for (const d of n) {
|
|
3774
|
-
const
|
|
3775
|
-
for (const p of
|
|
3776
|
-
const
|
|
3777
|
-
for (let
|
|
3778
|
-
const
|
|
3779
|
-
|
|
3785
|
+
const f = d.kind === "line" ? [d.values] : [d.upper, d.lower];
|
|
3786
|
+
for (const p of f) {
|
|
3787
|
+
const L = Math.max(0, Math.floor(r)), b = Math.min(p.length - 1, Math.ceil(o));
|
|
3788
|
+
for (let R = L; R <= b; R++) {
|
|
3789
|
+
const w = p[R];
|
|
3790
|
+
w != null && (w < c && (c = w), w > i && (i = w));
|
|
3780
3791
|
}
|
|
3781
3792
|
}
|
|
3782
3793
|
}
|
|
@@ -3794,7 +3805,7 @@ function fl(e, t, n, r) {
|
|
|
3794
3805
|
const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
|
|
3795
3806
|
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
|
|
3796
3807
|
}
|
|
3797
|
-
function
|
|
3808
|
+
function we(e, t) {
|
|
3798
3809
|
const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
|
|
3799
3810
|
return t.paneBottom - n * t.paneHeight;
|
|
3800
3811
|
}
|
|
@@ -3834,7 +3845,7 @@ function gl(e, t, n, r) {
|
|
|
3834
3845
|
function Lt(e, t, n, r, o, c = !1) {
|
|
3835
3846
|
e.strokeStyle = o.grid, e.lineWidth = 1, e.beginPath();
|
|
3836
3847
|
for (const i of r.ticks) {
|
|
3837
|
-
const l = Math.round(
|
|
3848
|
+
const l = Math.round(we(i, r)) + 0.5;
|
|
3838
3849
|
e.moveTo(t, l), e.lineTo(n, l);
|
|
3839
3850
|
}
|
|
3840
3851
|
e.stroke();
|
|
@@ -3842,35 +3853,35 @@ function Lt(e, t, n, r, o, c = !1) {
|
|
|
3842
3853
|
function yl(e, t, n, r, o) {
|
|
3843
3854
|
e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
|
|
3844
3855
|
for (const c of n.ticks) {
|
|
3845
|
-
const i =
|
|
3856
|
+
const i = we(c, n);
|
|
3846
3857
|
e.fillText(c.toFixed(r), t.plotRight + 6, i);
|
|
3847
3858
|
}
|
|
3848
3859
|
}
|
|
3849
3860
|
function vl(e, t, n, r, o, c, i, l) {
|
|
3850
3861
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3851
3862
|
for (let d = a; d <= h; d++) {
|
|
3852
|
-
const
|
|
3853
|
-
e.strokeStyle =
|
|
3854
|
-
const
|
|
3855
|
-
e.moveTo(
|
|
3856
|
-
const
|
|
3857
|
-
e.fillRect(Math.round(p - u / 2), Math.round(
|
|
3863
|
+
const f = t[d], p = o(d), L = we(f.open, i), b = we(f.close, i), R = we(f.high, i), w = we(f.low, i), W = f.close >= f.open ? l.up : l.down;
|
|
3864
|
+
e.strokeStyle = W, e.fillStyle = W, e.beginPath();
|
|
3865
|
+
const E = Math.round(p) + 0.5;
|
|
3866
|
+
e.moveTo(E, R), e.lineTo(E, w), e.stroke();
|
|
3867
|
+
const Z = Math.min(L, b), C = Math.max(1, Math.abs(b - L));
|
|
3868
|
+
e.fillRect(Math.round(p - u / 2), Math.round(Z), Math.round(u), Math.round(C));
|
|
3858
3869
|
}
|
|
3859
3870
|
}
|
|
3860
3871
|
function bl(e, t, n, r, o, c, i, l) {
|
|
3861
3872
|
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));
|
|
3862
3873
|
e.lineWidth = Math.max(1, Math.min(2, c * 0.18)), e.lineCap = "butt";
|
|
3863
3874
|
for (let d = a; d <= h; d++) {
|
|
3864
|
-
const
|
|
3865
|
-
e.strokeStyle =
|
|
3875
|
+
const f = t[d], p = Math.round(o(d)) + 0.5, L = we(f.high, i), b = we(f.low, i), R = we(f.open, i), w = we(f.close, i), J = f.close >= f.open;
|
|
3876
|
+
e.strokeStyle = J ? l.up : l.down, e.beginPath(), e.moveTo(p, L), e.lineTo(p, b), e.moveTo(p - u, R), e.lineTo(p, R), e.moveTo(p, w), e.lineTo(p + u, w), e.stroke();
|
|
3866
3877
|
}
|
|
3867
3878
|
}
|
|
3868
3879
|
function xl(e, t, n, r, o, c, i, l) {
|
|
3869
3880
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3870
3881
|
if (!(h <= a)) {
|
|
3871
|
-
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a),
|
|
3882
|
+
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), we(t[a].close, c));
|
|
3872
3883
|
for (let u = a + 1; u <= h; u++)
|
|
3873
|
-
e.lineTo(o(u),
|
|
3884
|
+
e.lineTo(o(u), we(t[u].close, c));
|
|
3874
3885
|
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);
|
|
3875
3886
|
}
|
|
3876
3887
|
}
|
|
@@ -3883,14 +3894,14 @@ function kl(e, t, n, r, o, c, i, l) {
|
|
|
3883
3894
|
e.globalAlpha = t.fillOpacity, e.fillStyle = t.color, e.beginPath();
|
|
3884
3895
|
let u = !1;
|
|
3885
3896
|
for (let d = a; d <= h; d++) {
|
|
3886
|
-
const
|
|
3887
|
-
if (
|
|
3888
|
-
const p = i(d),
|
|
3889
|
-
u ? e.lineTo(p,
|
|
3897
|
+
const f = t.upper[d];
|
|
3898
|
+
if (f == null) continue;
|
|
3899
|
+
const p = i(d), L = we(f, l);
|
|
3900
|
+
u ? e.lineTo(p, L) : (e.moveTo(p, L), u = !0);
|
|
3890
3901
|
}
|
|
3891
3902
|
for (let d = h; d >= a; d--) {
|
|
3892
|
-
const
|
|
3893
|
-
|
|
3903
|
+
const f = t.lower[d];
|
|
3904
|
+
f != null && e.lineTo(i(d), we(f, l));
|
|
3894
3905
|
}
|
|
3895
3906
|
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);
|
|
3896
3907
|
}
|
|
@@ -3904,30 +3915,30 @@ function Qe(e, t, n, r, o, c, i) {
|
|
|
3904
3915
|
l = !1;
|
|
3905
3916
|
continue;
|
|
3906
3917
|
}
|
|
3907
|
-
const
|
|
3908
|
-
l ? e.lineTo(
|
|
3918
|
+
const f = o(u), p = we(d, c);
|
|
3919
|
+
l ? e.lineTo(f, p) : (e.moveTo(f, p), l = !0);
|
|
3909
3920
|
}
|
|
3910
3921
|
e.stroke();
|
|
3911
3922
|
}
|
|
3912
|
-
function
|
|
3923
|
+
function Ml(e, t, n, r, o, c, i, l) {
|
|
3913
3924
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3914
3925
|
for (let d = a; d <= h; d++) {
|
|
3915
|
-
const
|
|
3926
|
+
const f = t[d], p = f.volume ?? 0;
|
|
3916
3927
|
if (p === 0) continue;
|
|
3917
|
-
const
|
|
3918
|
-
e.fillStyle =
|
|
3919
|
-
const
|
|
3920
|
-
e.fillRect(Math.round(o(d) - u / 2), Math.round(
|
|
3928
|
+
const L = f.close >= f.open;
|
|
3929
|
+
e.fillStyle = L ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3930
|
+
const b = we(p, i), R = i.paneBottom - b;
|
|
3931
|
+
e.fillRect(Math.round(o(d) - u / 2), Math.round(b), Math.round(u), Math.round(R));
|
|
3921
3932
|
}
|
|
3922
3933
|
e.globalAlpha = 1;
|
|
3923
3934
|
}
|
|
3924
|
-
function
|
|
3935
|
+
function wl(e, t, n, r, o, c) {
|
|
3925
3936
|
e.strokeStyle = c.grid, e.setLineDash([3, 3]), e.beginPath();
|
|
3926
3937
|
for (const i of [r, o]) {
|
|
3927
|
-
const l = Math.round(
|
|
3938
|
+
const l = Math.round(we(i, n)) + 0.5;
|
|
3928
3939
|
e.moveTo(t.plotLeft, l), e.lineTo(t.plotRight, l);
|
|
3929
3940
|
}
|
|
3930
|
-
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,
|
|
3941
|
+
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));
|
|
3931
3942
|
}
|
|
3932
3943
|
function Ft(e, t, n, r, o) {
|
|
3933
3944
|
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);
|
|
@@ -3935,27 +3946,27 @@ function Ft(e, t, n, r, o) {
|
|
|
3935
3946
|
function $l(e, t, n, r, o, c, i) {
|
|
3936
3947
|
const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
|
|
3937
3948
|
e.fillStyle = i.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
|
|
3938
|
-
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)),
|
|
3949
|
+
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)), f = t.plotBottom + At / 2;
|
|
3939
3950
|
for (let p = u; p <= d; p += h) {
|
|
3940
|
-
const
|
|
3941
|
-
e.fillText(
|
|
3951
|
+
const L = n[p], b = t.plotLeft + (p - r + 0.5) * a;
|
|
3952
|
+
e.fillText(Rl(L.time, c), b, f);
|
|
3942
3953
|
}
|
|
3943
3954
|
}
|
|
3944
3955
|
function Nl(e, t, n, r, o, c, i, l, a, h, u) {
|
|
3945
3956
|
if (n.x < t.plotLeft || n.x > t.plotRight) return;
|
|
3946
|
-
const d = c - o + 1,
|
|
3947
|
-
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(
|
|
3948
|
-
const
|
|
3949
|
-
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(
|
|
3957
|
+
const d = c - o + 1, f = t.plotWidth / d, p = o + (n.x - t.plotLeft) / f - 0.5, L = Math.round(p), b = Math.max(0, Math.min(r.length - 1, L)), R = i(b);
|
|
3958
|
+
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(R + 0.5, t.plotTop), e.lineTo(R + 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) {
|
|
3959
|
+
const w = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3960
|
+
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(w.toFixed(l), t.plotRight + 6, n.y);
|
|
3950
3961
|
}
|
|
3951
|
-
if (r[
|
|
3952
|
-
const
|
|
3962
|
+
if (r[b]) {
|
|
3963
|
+
const w = sn(r[b].time, h);
|
|
3953
3964
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3954
|
-
const
|
|
3965
|
+
const E = e.measureText(w).width + 8 * 2, Z = At, C = Math.max(
|
|
3955
3966
|
t.plotLeft,
|
|
3956
|
-
Math.min(t.plotRight -
|
|
3957
|
-
),
|
|
3958
|
-
e.fillStyle = u.text, e.fillRect(
|
|
3967
|
+
Math.min(t.plotRight - E, R - E / 2)
|
|
3968
|
+
), $ = t.plotBottom;
|
|
3969
|
+
e.fillStyle = u.text, e.fillRect(C, $, E, Z), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(w, C + E / 2, $ + Z / 2);
|
|
3959
3970
|
}
|
|
3960
3971
|
e.restore();
|
|
3961
3972
|
}
|
|
@@ -3963,14 +3974,14 @@ function Ll(e, t, n, r, o, c, i) {
|
|
|
3963
3974
|
const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = cn(t.main, l, [], r, o);
|
|
3964
3975
|
return e < a.paneTop || e > a.paneBottom ? null : a.priceMax - (e - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3965
3976
|
}
|
|
3966
|
-
function
|
|
3977
|
+
function Rl(e, t) {
|
|
3967
3978
|
const n = new Date(e * 1e3);
|
|
3968
3979
|
return t === "D" || t === "W" || t === "M" ? `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())}` : `${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}`;
|
|
3969
3980
|
}
|
|
3970
3981
|
function sn(e, t) {
|
|
3971
3982
|
const n = new Date(e * 1e3);
|
|
3972
3983
|
if (t === "local")
|
|
3973
|
-
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${
|
|
3984
|
+
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${Sl(n)}`;
|
|
3974
3985
|
if (t === "utc")
|
|
3975
3986
|
return `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())} ${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}:${Te(n.getUTCSeconds())} UTC`;
|
|
3976
3987
|
try {
|
|
@@ -3991,7 +4002,7 @@ function sn(e, t) {
|
|
|
3991
4002
|
return sn(e, "utc");
|
|
3992
4003
|
}
|
|
3993
4004
|
}
|
|
3994
|
-
function
|
|
4005
|
+
function Sl(e) {
|
|
3995
4006
|
const t = -e.getTimezoneOffset(), n = t >= 0 ? "+" : "-", r = Math.abs(t);
|
|
3996
4007
|
return `${n}${Te(Math.floor(r / 60))}:${Te(r % 60)}`;
|
|
3997
4008
|
}
|
|
@@ -4039,16 +4050,16 @@ const Cl = $e(
|
|
|
4039
4050
|
className: h,
|
|
4040
4051
|
style: u
|
|
4041
4052
|
}, d) => {
|
|
4042
|
-
const { line:
|
|
4053
|
+
const { line: f, area: p, last: L } = ke(() => {
|
|
4043
4054
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
4044
|
-
const
|
|
4045
|
-
return { line:
|
|
4055
|
+
const b = o, R = Math.max(1, t - b * 2), w = Math.max(1, n - b * 2), [J, W] = bt(e), E = Je([0, Math.max(1, e.length - 1)], [b, b + R]), Z = Je([J, W], [b + w, b]), C = e.map((ne, V) => ({ x: E(V), y: Z(ne) })), $ = Tl(C, c), ie = i ? `${$} L ${C[C.length - 1].x} ${b + w} L ${C[0].x} ${b + w} Z` : "";
|
|
4056
|
+
return { line: $, area: ie, last: C[C.length - 1] };
|
|
4046
4057
|
}, [e, t, n, o, c, i]);
|
|
4047
|
-
return /* @__PURE__ */
|
|
4058
|
+
return /* @__PURE__ */ j(
|
|
4048
4059
|
"svg",
|
|
4049
4060
|
{
|
|
4050
4061
|
ref: d,
|
|
4051
|
-
className:
|
|
4062
|
+
className: m(M.sparkline, h),
|
|
4052
4063
|
style: u,
|
|
4053
4064
|
width: t,
|
|
4054
4065
|
height: n,
|
|
@@ -4057,10 +4068,10 @@ const Cl = $e(
|
|
|
4057
4068
|
"aria-label": a,
|
|
4058
4069
|
children: [
|
|
4059
4070
|
i && p && /* @__PURE__ */ s("path", { d: p, fill: r, opacity: 0.18 }),
|
|
4060
|
-
|
|
4071
|
+
f && /* @__PURE__ */ s(
|
|
4061
4072
|
"path",
|
|
4062
4073
|
{
|
|
4063
|
-
d:
|
|
4074
|
+
d: f,
|
|
4064
4075
|
fill: "none",
|
|
4065
4076
|
stroke: r,
|
|
4066
4077
|
strokeWidth: o,
|
|
@@ -4068,7 +4079,7 @@ const Cl = $e(
|
|
|
4068
4079
|
strokeLinecap: "round"
|
|
4069
4080
|
}
|
|
4070
4081
|
),
|
|
4071
|
-
l &&
|
|
4082
|
+
l && L && /* @__PURE__ */ s("circle", { cx: L.x, cy: L.y, r: o + 1, fill: r })
|
|
4072
4083
|
]
|
|
4073
4084
|
}
|
|
4074
4085
|
);
|
|
@@ -4111,8 +4122,8 @@ export {
|
|
|
4111
4122
|
Yl as suggestPeriodForResolution,
|
|
4112
4123
|
Ul as suggestResolutionForPeriod,
|
|
4113
4124
|
xo as useClickOutside,
|
|
4114
|
-
|
|
4115
|
-
|
|
4125
|
+
Mo as useFocusTrap,
|
|
4126
|
+
St as useKeyboard,
|
|
4116
4127
|
Ur as useTableSort,
|
|
4117
4128
|
_l as volumeSeries
|
|
4118
4129
|
};
|