@cccsaurora/clue-ui 1.1.0-dev.98 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionForm-myEAs2UC.js +435 -0
- package/AnnotationDetails-BdfWMISw.js +160 -0
- package/AnnotationPreview-CKMGCoUH.js +140 -0
- package/ClueEnrichContext-CrFpdYhh.js +414 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +6 -6
- package/components/AnnotationEntry.js +47 -50
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +50 -64
- package/components/actions/ResultModal.js +5 -5
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5761 -8662
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +66 -77
- package/components/stats/QueryStatus.js +31 -41
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.js +8 -0
- package/hooks/ClueActionContext.js +7 -7
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +10 -21
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +29 -45
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BXxfAxFt.js +12734 -0
- package/index-C15OYgRY.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/index-vF6IyBhz.js +975 -0
- package/isEmpty-g47Qir2A.js +21 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +62 -62
- package/package.json +1 -1
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-DyeBcXQX.js +2214 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-BnmI_6N8.js +130 -0
- package/ActionForm-ByeOzpc4.js +0 -555
- package/AnnotationDetails-DknbKDyl.js +0 -175
- package/AnnotationPreview-CQwKs8se.js +0 -188
- package/ClueEnrichContext-6NJfXpUB.js +0 -536
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BbPn6-Mw.js +0 -15750
- package/index-Bi21Wb23.js +0 -465
- package/index-C3lkTD69.js +0 -1172
- package/index-CC12Ux-9.js +0 -17654
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-XvGvIw2S.js +0 -3201
- package/utils-7OtvGnmf.js +0 -200
|
@@ -1,55 +1,49 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Popover } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { A as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}, [open]);
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
Popover,
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { Popover as r } from "@mui/material";
|
|
3
|
+
import v, { useRef as c, useState as g, useEffect as R } from "react";
|
|
4
|
+
import { A as k } from "../AnnotationDetails-BdfWMISw.js";
|
|
5
|
+
const S = v.memo(({ anchorEl: t, enrichRequest: u, open: o, onClose: l, ...e }) => {
|
|
6
|
+
var f, s, m;
|
|
7
|
+
const a = c(), [x, n] = g(!1);
|
|
8
|
+
return R(() => {
|
|
9
|
+
o || n(!1);
|
|
10
|
+
}, [o]), /* @__PURE__ */ d(
|
|
11
|
+
r,
|
|
16
12
|
{
|
|
17
13
|
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
18
|
-
...
|
|
19
|
-
action:
|
|
20
|
-
open: !!(
|
|
21
|
-
keepMounted:
|
|
22
|
-
anchorEl,
|
|
23
|
-
onClose,
|
|
14
|
+
...e,
|
|
15
|
+
action: a,
|
|
16
|
+
open: !!(o && x),
|
|
17
|
+
keepMounted: o,
|
|
18
|
+
anchorEl: t,
|
|
19
|
+
onClose: l,
|
|
24
20
|
slotProps: {
|
|
25
|
-
...
|
|
21
|
+
...e.slotProps ?? {},
|
|
26
22
|
paper: {
|
|
27
|
-
...((
|
|
23
|
+
...((f = e.slotProps) == null ? void 0 : f.paper) ?? {},
|
|
28
24
|
sx: [
|
|
29
25
|
{
|
|
30
26
|
maxHeight: "min(600px, 95vh)",
|
|
31
27
|
overflowY: "auto",
|
|
32
28
|
maxWidth: "500px",
|
|
33
29
|
width: "100%",
|
|
34
|
-
zIndex: ((
|
|
30
|
+
zIndex: ((m = (s = t == null ? void 0 : t.computedStyleMap) == null ? void 0 : s.call(t).get("z-index")) == null ? void 0 : m.toString()) || 2
|
|
35
31
|
}
|
|
36
32
|
]
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
|
-
onClick: (
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
e.stopPropagation();
|
|
43
|
-
(_a2 = otherProps.onClick) == null ? void 0 : _a2.call(otherProps, e);
|
|
35
|
+
onClick: (i) => {
|
|
36
|
+
var p;
|
|
37
|
+
i.preventDefault(), i.stopPropagation(), (p = e.onClick) == null || p.call(e, i);
|
|
44
38
|
},
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
-
|
|
39
|
+
children: /* @__PURE__ */ d(
|
|
40
|
+
k,
|
|
47
41
|
{
|
|
48
|
-
enrichRequest,
|
|
49
|
-
setReady,
|
|
42
|
+
enrichRequest: u,
|
|
43
|
+
setReady: n,
|
|
50
44
|
updatePosition: () => {
|
|
51
|
-
var
|
|
52
|
-
return (
|
|
45
|
+
var i;
|
|
46
|
+
return (i = a.current) == null ? void 0 : i.updatePosition();
|
|
53
47
|
}
|
|
54
48
|
}
|
|
55
49
|
)
|
|
@@ -57,5 +51,5 @@ const AnnotationDetailPopover = React__default.memo(({ anchorEl, enrichRequest,
|
|
|
57
51
|
);
|
|
58
52
|
});
|
|
59
53
|
export {
|
|
60
|
-
|
|
54
|
+
S as default
|
|
61
55
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../iconify-
|
|
2
|
+
import "../iconify-BBckr5AQ.js";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "./display/icons/Iconified.js";
|
|
5
5
|
import "../data/event.js";
|
|
@@ -9,15 +9,15 @@ import "../hooks/useAnnotations.js";
|
|
|
9
9
|
import "../hooks/useErrors.js";
|
|
10
10
|
import "../icons/iconMap.js";
|
|
11
11
|
import "../utils/window.js";
|
|
12
|
-
import "../groupBy-
|
|
13
|
-
import { A } from "../AnnotationDetails-
|
|
14
|
-
import "../ClueEnrichContext-
|
|
12
|
+
import "../groupBy-BheQYl6f.js";
|
|
13
|
+
import { A as n } from "../AnnotationDetails-BdfWMISw.js";
|
|
14
|
+
import "../ClueEnrichContext-CrFpdYhh.js";
|
|
15
15
|
import "react";
|
|
16
|
-
import "../index-
|
|
16
|
+
import "../index-E7g8cRyW.js";
|
|
17
17
|
import "./actions/ExecutePopover.js";
|
|
18
18
|
import "./AnnotationEntry.js";
|
|
19
19
|
import "./ClassificationChip.js";
|
|
20
20
|
import "./enrichment/EnrichPopover.js";
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
n as default
|
|
23
23
|
};
|
|
@@ -1,54 +1,51 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { I as
|
|
3
|
-
import { Stack, Typography, Chip, IconButton } from "@mui/material";
|
|
4
|
-
import
|
|
5
|
-
import { t as
|
|
6
|
-
import { memo } from "react";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
")"
|
|
24
|
-
] }),
|
|
25
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
26
|
-
annotation.version && /* @__PURE__ */ jsx(
|
|
27
|
-
Chip,
|
|
28
|
-
{
|
|
29
|
-
size: "small",
|
|
30
|
-
label: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
-
"v",
|
|
32
|
-
annotation.version.replace(/^v/, "")
|
|
33
|
-
] })
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
annotation.link && /* @__PURE__ */ jsx(IconButton, { component: "a", href: annotation.link, target: "_blank", rel: "noreferrer", size: "small", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) }),
|
|
37
|
-
annotation.classification && /* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: annotation.classification })
|
|
1
|
+
import { jsxs as e, jsx as i, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { I as o } from "../iconify-BBckr5AQ.js";
|
|
3
|
+
import { Stack as t, Typography as c, Chip as s, IconButton as a } from "@mui/material";
|
|
4
|
+
import n from "./display/icons/Iconified.js";
|
|
5
|
+
import { t as m } from "../utils-BnmI_6N8.js";
|
|
6
|
+
import { memo as p } from "react";
|
|
7
|
+
import d from "./AnnotationBody.js";
|
|
8
|
+
import f from "./ClassificationChip.js";
|
|
9
|
+
const y = ({ annotation: r }) => /* @__PURE__ */ e(t, { direction: "column", spacing: 1, children: [
|
|
10
|
+
/* @__PURE__ */ e(t, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
11
|
+
r.analytic_icon && /* @__PURE__ */ i(
|
|
12
|
+
o,
|
|
13
|
+
{
|
|
14
|
+
style: { alignSelf: "center", filter: "drop-shadow(0px 0px 1px rgb(0 0 0 / 0.4))" },
|
|
15
|
+
icon: r.analytic_icon
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
/* @__PURE__ */ i(c, { variant: "body1", sx: { textTransform: "capitalize", maxWidth: "275px" }, children: r.analytic ?? r.author }),
|
|
19
|
+
r.quantity > 1 && /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", children: [
|
|
20
|
+
"(x",
|
|
21
|
+
r.quantity,
|
|
22
|
+
")"
|
|
38
23
|
] }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
/* @__PURE__ */ i("div", { style: { flex: 1 } }),
|
|
25
|
+
r.version && /* @__PURE__ */ i(
|
|
26
|
+
s,
|
|
27
|
+
{
|
|
28
|
+
size: "small",
|
|
29
|
+
label: /* @__PURE__ */ e(l, { children: [
|
|
30
|
+
"v",
|
|
31
|
+
r.version.replace(/^v/, "")
|
|
32
|
+
] })
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
r.link && /* @__PURE__ */ i(a, { component: "a", href: r.link, target: "_blank", rel: "noreferrer", size: "small", children: /* @__PURE__ */ i(n, { icon: "ic:baseline-open-in-new", fontSize: "small" }) }),
|
|
36
|
+
r.classification && /* @__PURE__ */ i(f, { size: "small", classification: r.classification })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ i(d, { annotation: r }),
|
|
39
|
+
/* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", children: r.summary }),
|
|
40
|
+
/* @__PURE__ */ e(t, { direction: "row", children: [
|
|
41
|
+
/* @__PURE__ */ i(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: m(r.timestamp) }),
|
|
42
|
+
/* @__PURE__ */ i("div", { style: { flex: 1 } }),
|
|
43
|
+
!!r.latency && /* @__PURE__ */ e(c, { variant: "caption", color: "text.secondary", fontSize: "10px", children: [
|
|
44
|
+
Math.round(r.latency),
|
|
45
|
+
"ms"
|
|
48
46
|
] })
|
|
49
|
-
] })
|
|
50
|
-
};
|
|
51
|
-
const AnnotationEntry = memo(AnnotatonEntry);
|
|
47
|
+
] })
|
|
48
|
+
] }), w = p(y);
|
|
52
49
|
export {
|
|
53
|
-
|
|
50
|
+
w as default
|
|
54
51
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../iconify-
|
|
2
|
+
import "../iconify-BBckr5AQ.js";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import { A } from "../AnnotationPreview-
|
|
4
|
+
import { A as d } from "../AnnotationPreview-CKMGCoUH.js";
|
|
5
5
|
import "../hooks/useAnnotations.js";
|
|
6
|
-
import "../utils-
|
|
6
|
+
import "../utils-BnmI_6N8.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import "../index-
|
|
8
|
+
import "../index-E7g8cRyW.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
d as default
|
|
11
11
|
};
|
|
@@ -1,52 +1,31 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Tooltip, Chip } from "@mui/material";
|
|
3
|
-
import
|
|
4
|
-
import { getParts, normalizedClassification } from "../utils/classificationParser.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, [classification, config.c12nDef]);
|
|
17
|
-
const normalized = useMemo(() => {
|
|
18
|
-
if (!config.c12nDef || !parts) {
|
|
19
|
-
return classification;
|
|
20
|
-
}
|
|
21
|
-
return normalizedClassification(parts, config.c12nDef, "short", true);
|
|
22
|
-
}, [classification, config.c12nDef, parts]);
|
|
23
|
-
const chipProps = useMemo(() => {
|
|
24
|
-
var _a2, _b2, _c;
|
|
25
|
-
const definedColor = (_c = (_b2 = config.c12nDef) == null ? void 0 : _b2.levels_styles_map[(_a2 = config.c12nDef) == null ? void 0 : _a2.levels_map[parts.lvlIdx]]) == null ? void 0 : _c.color;
|
|
26
|
-
if (THEME_TYPES.includes(definedColor)) {
|
|
27
|
-
return { color: definedColor };
|
|
28
|
-
}
|
|
29
|
-
if (definedColor) {
|
|
30
|
-
return { sx: { color: definedColor } };
|
|
31
|
-
}
|
|
32
|
-
return { color: "default" };
|
|
33
|
-
}, [(_a = config.c12nDef) == null ? void 0 : _a.levels_map, (_b = config.c12nDef) == null ? void 0 : _b.levels_styles_map, parts.lvlIdx]);
|
|
34
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: classification, children: /* @__PURE__ */ jsx(
|
|
35
|
-
Chip,
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as p, Chip as x } from "@mui/material";
|
|
3
|
+
import D from "../hooks/useClueConfig.js";
|
|
4
|
+
import { getParts as C, normalizedClassification as _ } from "../utils/classificationParser.js";
|
|
5
|
+
import v, { useMemo as s, memo as y } from "react";
|
|
6
|
+
const g = ["default", "primary", "secondary", "error", "info", "success", "warning"], A = v.memo(
|
|
7
|
+
({ classification: r, ...n }) => {
|
|
8
|
+
var i, f;
|
|
9
|
+
const { config: e } = D(), t = s(() => e.c12nDef ? C(r, e.c12nDef, "short", !0) : null, [r, e.c12nDef]), d = s(() => !e.c12nDef || !t ? r : _(t, e.c12nDef, "short", !0), [r, e.c12nDef, t]), o = s(() => {
|
|
10
|
+
var c, a, m;
|
|
11
|
+
const l = (m = (a = e.c12nDef) == null ? void 0 : a.levels_styles_map[(c = e.c12nDef) == null ? void 0 : c.levels_map[t.lvlIdx]]) == null ? void 0 : m.color;
|
|
12
|
+
return g.includes(l) ? { color: l } : l ? { sx: { color: l } } : { color: "default" };
|
|
13
|
+
}, [(i = e.c12nDef) == null ? void 0 : i.levels_map, (f = e.c12nDef) == null ? void 0 : f.levels_styles_map, t.lvlIdx]);
|
|
14
|
+
return /* @__PURE__ */ u(p, { title: r, children: /* @__PURE__ */ u(
|
|
15
|
+
x,
|
|
36
16
|
{
|
|
37
|
-
variant:
|
|
38
|
-
label:
|
|
39
|
-
...
|
|
40
|
-
...
|
|
17
|
+
variant: n.variant || "outlined",
|
|
18
|
+
label: d,
|
|
19
|
+
...o,
|
|
20
|
+
...n,
|
|
41
21
|
sx: [
|
|
42
|
-
...Array.isArray(
|
|
43
|
-
...Array.isArray(
|
|
22
|
+
...Array.isArray(o.sx) ? o.sx : [o.sx],
|
|
23
|
+
...Array.isArray(n.sx) ? n.sx : [n.sx]
|
|
44
24
|
]
|
|
45
25
|
}
|
|
46
26
|
) });
|
|
47
27
|
}
|
|
48
|
-
);
|
|
49
|
-
const ClassificationChip$1 = memo(ClassificationChip);
|
|
28
|
+
), M = y(A);
|
|
50
29
|
export {
|
|
51
|
-
|
|
30
|
+
M as default
|
|
52
31
|
};
|
package/components/CountBadge.js
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Badge } from "@mui/material";
|
|
3
|
-
import { forwardRef, cloneElement, Children } from "react";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as l } from "@mui/material";
|
|
3
|
+
import { forwardRef as d, cloneElement as f, Children as g } from "react";
|
|
4
|
+
const b = d(({ children: r, color: a = "primary", count: t, disabled: n, ...e }, o) => n ? f(g.only(r), { ref: o, ...e }) : /* @__PURE__ */ m(
|
|
5
|
+
l,
|
|
6
|
+
{
|
|
7
|
+
ref: o,
|
|
8
|
+
...e,
|
|
9
|
+
badgeContent: t < 100 ? t : "99+",
|
|
10
|
+
color: a,
|
|
11
|
+
sx: (i) => ({
|
|
12
|
+
"& .MuiBadge-badge": {
|
|
13
|
+
backgroundColor: "transparent",
|
|
14
|
+
color: i.palette[a].main,
|
|
15
|
+
fontWeight: "bold",
|
|
16
|
+
right: 0,
|
|
17
|
+
top: 0,
|
|
18
|
+
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(t)), 3) * 10}%)`,
|
|
19
|
+
px: 0,
|
|
20
|
+
fontSize: ".85rem"
|
|
21
|
+
},
|
|
22
|
+
pr: 1.5
|
|
23
|
+
}),
|
|
24
|
+
children: r
|
|
7
25
|
}
|
|
8
|
-
|
|
9
|
-
Badge,
|
|
10
|
-
{
|
|
11
|
-
ref,
|
|
12
|
-
...props,
|
|
13
|
-
badgeContent: count < 100 ? count : "99+",
|
|
14
|
-
color,
|
|
15
|
-
sx: (theme) => ({
|
|
16
|
-
"& .MuiBadge-badge": {
|
|
17
|
-
backgroundColor: "transparent",
|
|
18
|
-
color: theme.palette[color].main,
|
|
19
|
-
fontWeight: "bold",
|
|
20
|
-
right: 0,
|
|
21
|
-
top: 0,
|
|
22
|
-
transform: `translateY(-25%) translateX(${Math.min(Math.ceil(Math.log10(count)), 3) * 10}%)`,
|
|
23
|
-
px: 0,
|
|
24
|
-
fontSize: ".85rem"
|
|
25
|
-
},
|
|
26
|
-
pr: 1.5
|
|
27
|
-
}),
|
|
28
|
-
children
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
});
|
|
26
|
+
));
|
|
32
27
|
export {
|
|
33
|
-
|
|
28
|
+
b as default
|
|
34
29
|
};
|