@hybridcore/ui 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LinearGradient-DiRq5YcI.js +93 -0
- package/dist/components/charts/chart-wrapper/index.js +41 -40
- package/dist/components/charts/chart-wrapper/logic.js +14 -12
- package/dist/components/charts/heatmap/logic.js +155 -242
- package/dist/components/metric-card/MetricChart.js +65 -50
- package/dist/components/metric-card/helpers.js +18 -0
- package/dist/components/metric-card/index.js +83 -73
- package/dist/components/metric-card/logic.js +64 -76
- package/dist/components/metric-card/styled.js +125 -137
- package/dist/components/sortable-list/index.js +1992 -346
- package/dist/main.d.ts +53 -21
- package/dist/main.js +97 -95
- package/package.json +5 -2
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { R as u, A
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useRef as x, useLayoutEffect as
|
|
5
|
-
import { X as R, V as
|
|
6
|
-
import { C as
|
|
7
|
-
import { A as
|
|
8
|
-
import { C
|
|
9
|
-
import { c as
|
|
10
|
-
import { L as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { R as u, A, T as g } from "../../AnimatedTheme-jnasw6rT.js";
|
|
3
|
+
import { useTheme as v, alpha as w } from "@mui/material";
|
|
4
|
+
import { useRef as x, useLayoutEffect as y } from "react";
|
|
5
|
+
import { X as R, V as L } from "../../AxisRenderer-DTyLLA6c.js";
|
|
6
|
+
import { C as T } from "../../CategoryAxis-CwnfaGc8.js";
|
|
7
|
+
import { A as b, a as X } from "../../AxisRendererY-C_ItLPNV.js";
|
|
8
|
+
import { C } from "../../ColumnSeries-CjgdJ2QL.js";
|
|
9
|
+
import { c as a } from "../../ColorSet-C7vpNXhM.js";
|
|
10
|
+
import { L as Y } from "../../LineSeries-Uiv5o56b.js";
|
|
11
|
+
import { L as F } from "../../LinearGradient-DiRq5YcI.js";
|
|
12
|
+
const q = ({
|
|
13
|
+
data: l,
|
|
14
|
+
type: p,
|
|
15
|
+
inset: d = !1,
|
|
16
|
+
gradient: m = !1
|
|
17
|
+
}) => {
|
|
18
|
+
const o = x(null), t = v();
|
|
19
|
+
return y(() => {
|
|
20
|
+
if (!o.current) return;
|
|
21
|
+
const e = u.new(o.current);
|
|
22
|
+
e.setThemes([A.new(e)]);
|
|
23
|
+
const i = e.container.children.push(
|
|
18
24
|
R.new(e, {
|
|
19
25
|
panX: !1,
|
|
20
26
|
panY: !1,
|
|
@@ -25,63 +31,72 @@ const G = ({ data: l, type: n, color: c }) => {
|
|
|
25
31
|
paddingTop: 0,
|
|
26
32
|
paddingBottom: 0
|
|
27
33
|
})
|
|
28
|
-
),
|
|
29
|
-
|
|
34
|
+
), s = i.xAxes.push(
|
|
35
|
+
T.new(e, {
|
|
30
36
|
categoryField: "t",
|
|
31
|
-
renderer:
|
|
37
|
+
renderer: b.new(e, {
|
|
32
38
|
minGridDistance: 10
|
|
33
39
|
}),
|
|
34
|
-
tooltip:
|
|
40
|
+
tooltip: g.new(e, {})
|
|
35
41
|
})
|
|
36
|
-
),
|
|
37
|
-
|
|
42
|
+
), c = s.get("renderer");
|
|
43
|
+
c.grid.template.set("visible", !1), c.labels.template.set("visible", !1), s.setAll({
|
|
38
44
|
startLocation: 0.5,
|
|
39
45
|
endLocation: 0.5
|
|
40
|
-
}),
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
renderer:
|
|
46
|
+
}), s.data.setAll(l);
|
|
47
|
+
const n = i.yAxes.push(
|
|
48
|
+
L.new(e, {
|
|
49
|
+
renderer: X.new(e, {})
|
|
44
50
|
})
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
return
|
|
49
|
-
|
|
51
|
+
), f = n.get("renderer");
|
|
52
|
+
f.grid.template.set("visible", !1), f.labels.template.set("visible", !1);
|
|
53
|
+
let r;
|
|
54
|
+
return p === "column" ? (r = i.series.push(
|
|
55
|
+
C.new(e, {
|
|
50
56
|
name: "Series",
|
|
51
|
-
xAxis:
|
|
52
|
-
yAxis:
|
|
57
|
+
xAxis: s,
|
|
58
|
+
yAxis: n,
|
|
53
59
|
valueYField: "v",
|
|
54
60
|
categoryXField: "t",
|
|
55
|
-
fill:
|
|
61
|
+
fill: a(t.palette.divider)
|
|
56
62
|
})
|
|
57
|
-
),
|
|
63
|
+
), r.columns.template.setAll({
|
|
58
64
|
cornerRadiusTL: 2,
|
|
59
65
|
cornerRadiusTR: 2,
|
|
60
66
|
strokeOpacity: 0
|
|
61
|
-
})) : (
|
|
62
|
-
|
|
67
|
+
})) : (r = i.series.push(
|
|
68
|
+
Y.new(e, {
|
|
63
69
|
name: "Series",
|
|
64
|
-
xAxis:
|
|
65
|
-
yAxis:
|
|
70
|
+
xAxis: s,
|
|
71
|
+
yAxis: n,
|
|
66
72
|
valueYField: "v",
|
|
67
73
|
categoryXField: "t",
|
|
68
74
|
// @ts-expect-error amcharts5 typing accepts string/Color; alpha returns rgba string
|
|
69
|
-
fill:
|
|
70
|
-
stroke:
|
|
75
|
+
fill: w(t.palette.divider, 0.25),
|
|
76
|
+
stroke: a(t.palette.divider)
|
|
71
77
|
})
|
|
72
|
-
),
|
|
78
|
+
), r.strokes.template.setAll({
|
|
73
79
|
strokeWidth: 1
|
|
74
|
-
}),
|
|
80
|
+
}), r.fills.template.setAll({
|
|
75
81
|
fillOpacity: 1,
|
|
76
|
-
visible: !0
|
|
77
|
-
|
|
82
|
+
visible: !0,
|
|
83
|
+
...m && {
|
|
84
|
+
fillGradient: F.new(e, {
|
|
85
|
+
rotation: 90,
|
|
86
|
+
stops: [
|
|
87
|
+
{ color: a(t.palette.divider), opacity: 0.6 },
|
|
88
|
+
{ color: a(t.palette.divider), opacity: 0 }
|
|
89
|
+
]
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
})), r.data.setAll(l), r.appear(1e3), i.appear(1e3, 100), () => {
|
|
78
93
|
e.dispose();
|
|
79
94
|
};
|
|
80
|
-
}, [l,
|
|
95
|
+
}, [l, p, d, m, t.palette.mode, t.palette.divider]), /* @__PURE__ */ h(
|
|
81
96
|
"div",
|
|
82
97
|
{
|
|
83
|
-
ref:
|
|
84
|
-
style: {
|
|
98
|
+
ref: o,
|
|
99
|
+
style: d ? { width: "100%", height: "100%" } : {
|
|
85
100
|
width: "calc(100% + 10px)",
|
|
86
101
|
height: "100%",
|
|
87
102
|
marginBottom: -21,
|
|
@@ -91,5 +106,5 @@ const G = ({ data: l, type: n, color: c }) => {
|
|
|
91
106
|
);
|
|
92
107
|
};
|
|
93
108
|
export {
|
|
94
|
-
|
|
109
|
+
q as MetricChart
|
|
95
110
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const e = (r, a = "default") => {
|
|
2
|
+
switch (a) {
|
|
3
|
+
case "primary":
|
|
4
|
+
return r.palette.primary.main;
|
|
5
|
+
case "success":
|
|
6
|
+
return r.palette.success.main;
|
|
7
|
+
case "warning":
|
|
8
|
+
return r.palette.warning.main;
|
|
9
|
+
case "danger":
|
|
10
|
+
return r.palette.error.main;
|
|
11
|
+
default:
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}, t = (r, a) => a === "up" ? r.palette.success.main : a === "down" ? r.palette.error.main : r.palette.text.secondary;
|
|
15
|
+
export {
|
|
16
|
+
t as trendColor,
|
|
17
|
+
e as variantColor
|
|
18
|
+
};
|
|
@@ -1,44 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as n, Fragment as x } from "react/jsx-runtime";
|
|
2
2
|
import { Stack as a, Skeleton as c } from "@mui/material";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
calculatedValue:
|
|
11
|
-
calculatedChange:
|
|
12
|
-
TrendIcon:
|
|
13
|
-
Icon:
|
|
14
|
-
showCornerIcon:
|
|
15
|
-
showSideIcon:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
import { MetricChart as g } from "./MetricChart.js";
|
|
4
|
+
import { useMetricCardLogic as b } from "./logic.js";
|
|
5
|
+
import { MetricCardRoot as u, MetricCardValue as j, MetricCardTrendContainer as z, MetricCardLabel as m, MetricCardPanel as k, MetricCardDescription as w, MetricCardSideChart as P, MetricCardCornerIconContainer as L, MetricCardIconContainer as f, MetricCardContent as V, MetricCardChartContainer as A } from "./styled.js";
|
|
6
|
+
const B = (e) => {
|
|
7
|
+
const { state: v } = b(e), {
|
|
8
|
+
ownerState: i,
|
|
9
|
+
layout: d,
|
|
10
|
+
calculatedValue: M,
|
|
11
|
+
calculatedChange: h,
|
|
12
|
+
TrendIcon: y,
|
|
13
|
+
Icon: r,
|
|
14
|
+
showCornerIcon: I,
|
|
15
|
+
showSideIcon: l,
|
|
16
|
+
iconPosition: o,
|
|
17
|
+
snapshotPayload: S
|
|
18
|
+
} = v, s = !!e.showChart && !!e.chartType && (e.value ?? []).length >= 2, T = (e.showChange || e.showTrend) && h !== "—";
|
|
19
|
+
if (e.loading)
|
|
20
|
+
return /* @__PURE__ */ t(u, { ownerState: i, sx: e.sx, children: /* @__PURE__ */ n(a, { spacing: 1, children: [
|
|
21
|
+
/* @__PURE__ */ t(c, { variant: "text", width: "60%" }),
|
|
22
|
+
/* @__PURE__ */ t(c, { variant: "rectangular", height: 40, width: "40%" }),
|
|
23
|
+
/* @__PURE__ */ t(c, { variant: "text", width: "80%" }),
|
|
24
|
+
e.showChart && /* @__PURE__ */ t(
|
|
25
|
+
c,
|
|
26
|
+
{
|
|
27
|
+
variant: "rectangular",
|
|
28
|
+
height: 40,
|
|
29
|
+
width: "100%",
|
|
30
|
+
sx: { mt: 2 }
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }) });
|
|
34
|
+
const C = /* @__PURE__ */ n(
|
|
35
|
+
a,
|
|
35
36
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
direction: "row",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
spacing: 1,
|
|
40
|
+
flexWrap: d === "panel" ? "nowrap" : "wrap",
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
+
/* @__PURE__ */ t(j, { variant: "h4", ownerState: i, children: M }),
|
|
43
|
+
T && /* @__PURE__ */ n(z, { ownerState: i, children: [
|
|
44
|
+
d === "overlay" && e.showTrend && /* @__PURE__ */ t(y, { size: 16 }),
|
|
45
|
+
e.showChange && h
|
|
46
|
+
] })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
return /* @__PURE__ */ t(
|
|
51
|
+
u,
|
|
52
|
+
{
|
|
53
|
+
ownerState: i,
|
|
54
|
+
sx: e.sx,
|
|
55
|
+
"data-snapshot": S,
|
|
56
|
+
children: d === "panel" ? /* @__PURE__ */ n(x, { children: [
|
|
57
|
+
/* @__PURE__ */ t(m, { variant: "body2", children: e.label }),
|
|
58
|
+
/* @__PURE__ */ n(k, { children: [
|
|
59
|
+
/* @__PURE__ */ n(a, { justifyContent: "center", spacing: 0.5, sx: { flexShrink: 0 }, children: [
|
|
60
|
+
C,
|
|
61
|
+
e.description && /* @__PURE__ */ t(w, { variant: "caption", children: e.description })
|
|
62
|
+
] }),
|
|
63
|
+
s && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(
|
|
64
|
+
g,
|
|
65
|
+
{
|
|
66
|
+
type: e.chartType,
|
|
67
|
+
data: e.value,
|
|
68
|
+
inset: !0,
|
|
69
|
+
gradient: !0
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] })
|
|
73
|
+
] }) : /* @__PURE__ */ n(x, { children: [
|
|
74
|
+
I && r && /* @__PURE__ */ t(L, { ownerState: i, children: /* @__PURE__ */ t(r, { size: 24 }) }),
|
|
42
75
|
/* @__PURE__ */ n(
|
|
43
76
|
a,
|
|
44
77
|
{
|
|
@@ -47,27 +80,12 @@ const A = (t) => {
|
|
|
47
80
|
alignItems: "flex-start",
|
|
48
81
|
sx: { flex: 1 },
|
|
49
82
|
children: [
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */ n(
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
a,
|
|
55
|
-
{
|
|
56
|
-
direction: "row",
|
|
57
|
-
alignItems: "baseline",
|
|
58
|
-
spacing: 1,
|
|
59
|
-
flexWrap: "wrap",
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ e(T, { variant: "h4", ownerState: r, children: x }),
|
|
62
|
-
(t.showChange || t.showTrend) && o !== "—" && /* @__PURE__ */ n(b, { ownerState: r, children: [
|
|
63
|
-
t.showTrend && /* @__PURE__ */ e(m, { size: 16 }),
|
|
64
|
-
t.showChange && o
|
|
65
|
-
] })
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
)
|
|
83
|
+
l && r && o === "left" && /* @__PURE__ */ t(f, { ownerState: i, children: /* @__PURE__ */ t(r, { sx: { fontSize: 24 } }) }),
|
|
84
|
+
/* @__PURE__ */ n(V, { children: [
|
|
85
|
+
/* @__PURE__ */ t(m, { variant: "body2", children: e.label }),
|
|
86
|
+
C
|
|
69
87
|
] }),
|
|
70
|
-
|
|
88
|
+
l && r && o === "right" && /* @__PURE__ */ t(f, { ownerState: i, children: /* @__PURE__ */ t(r, { sx: { fontSize: 24 } }) })
|
|
71
89
|
]
|
|
72
90
|
}
|
|
73
91
|
),
|
|
@@ -78,30 +96,22 @@ const A = (t) => {
|
|
|
78
96
|
spacing: 1,
|
|
79
97
|
sx: { width: "100%", mt: 2 },
|
|
80
98
|
children: [
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
e.description && /* @__PURE__ */ t(
|
|
100
|
+
w,
|
|
83
101
|
{
|
|
84
102
|
variant: "caption",
|
|
85
|
-
ownerState: r,
|
|
86
103
|
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
87
|
-
children:
|
|
104
|
+
children: e.description
|
|
88
105
|
}
|
|
89
106
|
),
|
|
90
|
-
|
|
91
|
-
u,
|
|
92
|
-
{
|
|
93
|
-
type: t.chartType,
|
|
94
|
-
data: t.value,
|
|
95
|
-
color: w
|
|
96
|
-
}
|
|
97
|
-
) })
|
|
107
|
+
s && /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(g, { type: e.chartType, data: e.value }) })
|
|
98
108
|
]
|
|
99
109
|
}
|
|
100
110
|
)
|
|
101
|
-
]
|
|
111
|
+
] })
|
|
102
112
|
}
|
|
103
|
-
)
|
|
113
|
+
);
|
|
104
114
|
};
|
|
105
115
|
export {
|
|
106
|
-
|
|
116
|
+
B as MetricCard
|
|
107
117
|
};
|
|
@@ -1,107 +1,95 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import { c as
|
|
1
|
+
import { useThemeProps as U } from "@mui/material";
|
|
2
|
+
import { c as p } from "../../createReactComponent-C7L-DMHj.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the MIT license.
|
|
7
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const A = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], B = p("outline", "arrow-right", "ArrowRight", A);
|
|
10
10
|
/**
|
|
11
11
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the MIT license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const O = [["path", { d: "M3 7l6 6l4 -4l8 8", key: "svg-0" }], ["path", { d: "M21 10l0 7l-7 0", key: "svg-1" }]], V = p("outline", "trending-down", "TrendingDown", O);
|
|
17
17
|
/**
|
|
18
18
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the MIT license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
value:
|
|
26
|
-
variant:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
const Z = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "M14 7l7 0l0 7", key: "svg-1" }]], H = p("outline", "trending-up", "TrendingUp", Z), j = (I) => {
|
|
24
|
+
const r = U({ props: I, name: "HCMetricCard" }), {
|
|
25
|
+
value: o = [],
|
|
26
|
+
variant: M = "default",
|
|
27
|
+
layout: u = "overlay",
|
|
28
|
+
valuePrefix: T,
|
|
29
|
+
valueSuffix: b,
|
|
30
|
+
showChange: C = !1,
|
|
31
|
+
changeType: s = "percentage",
|
|
32
|
+
showTrend: $ = !1,
|
|
33
|
+
showIcon: f = !1,
|
|
34
|
+
icon: i,
|
|
35
|
+
iconPosition: l = "right"
|
|
36
|
+
} = r, k = o.length > 0, d = o[o.length - 1], m = o[o.length - 2], e = d ? Number(d.v) : NaN, t = m ? Number(m.v) : NaN, v = !isNaN(e) && !isNaN(t);
|
|
37
|
+
let c = "—", N = "";
|
|
38
|
+
if (!isNaN(e)) {
|
|
39
|
+
const y = new Intl.NumberFormat("en-US", {
|
|
38
40
|
maximumFractionDigits: 2
|
|
39
|
-
}).format(
|
|
41
|
+
}).format(e);
|
|
42
|
+
c = `${T ?? ""}${y}${b ?? ""}`, N = d.t;
|
|
40
43
|
}
|
|
41
|
-
let o;
|
|
42
|
-
if (y)
|
|
43
|
-
if (e.length >= 2) {
|
|
44
|
-
const n = Number(e[e.length - 1].v), t = Number(e[e.length - 2].v);
|
|
45
|
-
if (isNaN(n) || isNaN(t))
|
|
46
|
-
o = "—";
|
|
47
|
-
else if (t === 0 && i === "percentage")
|
|
48
|
-
o = "—";
|
|
49
|
-
else {
|
|
50
|
-
let c = 0;
|
|
51
|
-
i === "absolute" ? c = n - t : c = (n - t) / t * 100, o = `${c > 0 ? "+" : c < 0 ? "−" : ""}${Math.abs(c).toFixed(
|
|
52
|
-
i === "percentage" ? 1 : 2
|
|
53
|
-
)}${i === "percentage" ? "%" : ""}`;
|
|
54
|
-
}
|
|
55
|
-
} else
|
|
56
|
-
o = "—";
|
|
57
44
|
let a;
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
45
|
+
if (C)
|
|
46
|
+
if (v && !(t === 0 && s === "percentage")) {
|
|
47
|
+
const h = s === "absolute" ? e - t : (e - t) / t * 100, P = h > 0 ? "+" : h < 0 ? "−" : "", F = s === "percentage" ? 1 : 2, R = s === "percentage" ? "%" : "";
|
|
48
|
+
a = `${P}${Math.abs(h).toFixed(F)}${R}`;
|
|
49
|
+
} else
|
|
50
|
+
a = "—";
|
|
51
|
+
let n;
|
|
52
|
+
$ && v && (e > t ? n = "up" : e < t ? n = "down" : n = "neutral");
|
|
53
|
+
let g = B;
|
|
54
|
+
n === "up" ? g = H : n === "down" && (g = V);
|
|
55
|
+
const w = [
|
|
56
|
+
"top-left",
|
|
57
|
+
"top-right",
|
|
58
|
+
"bottom-left",
|
|
59
|
+
"bottom-right"
|
|
60
|
+
].includes(l), _ = f && !!i && w, x = f && !!i && !w, D = JSON.stringify({
|
|
61
|
+
metric: r.label,
|
|
62
|
+
value: c,
|
|
63
|
+
change: a,
|
|
64
|
+
asOf: N
|
|
65
|
+
}), S = {
|
|
66
|
+
...r,
|
|
67
|
+
variant: M,
|
|
68
|
+
layout: u,
|
|
69
|
+
changeType: s,
|
|
70
|
+
iconPosition: l,
|
|
71
|
+
calculatedValue: c,
|
|
72
|
+
calculatedChange: a,
|
|
73
|
+
calculatedTrend: n,
|
|
74
|
+
hasData: k
|
|
83
75
|
};
|
|
84
76
|
return {
|
|
85
77
|
refs: {},
|
|
86
78
|
state: {
|
|
87
|
-
ownerState:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
chartColor: l,
|
|
98
|
-
variant: s,
|
|
99
|
-
iconPosition: g,
|
|
100
|
-
snapshotPayload: I
|
|
79
|
+
ownerState: S,
|
|
80
|
+
layout: u,
|
|
81
|
+
calculatedValue: c,
|
|
82
|
+
calculatedChange: a,
|
|
83
|
+
TrendIcon: g,
|
|
84
|
+
Icon: i,
|
|
85
|
+
showCornerIcon: _,
|
|
86
|
+
showSideIcon: x,
|
|
87
|
+
iconPosition: l,
|
|
88
|
+
snapshotPayload: D
|
|
101
89
|
},
|
|
102
90
|
actions: {}
|
|
103
91
|
};
|
|
104
92
|
};
|
|
105
93
|
export {
|
|
106
|
-
|
|
94
|
+
j as useMetricCardLogic
|
|
107
95
|
};
|