@hybridcore/ui 1.6.20 → 1.6.22
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/CATALOG.md +1 -0
- package/dist/components/button/index.js +10 -7
- package/dist/components/charts/chart-wrapper/index.js +34 -32
- package/dist/components/charts/column-line-mix/logic.js +27 -27
- package/dist/components/charts/histogram/index.js +11 -0
- package/dist/components/charts/histogram/logic.js +133 -0
- package/dist/components/charts/histogram/styled.js +12 -0
- package/dist/components/charts/line/logic.js +48 -48
- package/dist/components/charts/logaritmic-scale/logic.js +33 -33
- package/dist/components/charts/multiple-value-axes/logic.js +70 -70
- package/dist/components/charts/xy-chart/logic.js +9 -1
- package/dist/components/metric-card/index.js +68 -58
- package/dist/components/metric-card/styled.js +79 -60
- package/dist/components/status-indicator/index.js +25 -25
- package/dist/components/status-indicator/styled.js +77 -41
- package/dist/main.d.ts +49 -1
- package/dist/main.js +158 -156
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
1
|
+
import { R as T, A as Y } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as R, useTheme as E } from "@mui/material";
|
|
3
|
+
import I from "lodash";
|
|
4
4
|
import { useId as G, useRef as O, useEffect as P } from "react";
|
|
5
5
|
import { humanizeLabel as V } from "../_common/format.js";
|
|
6
6
|
import { attachCombinedAxisTooltip as q } from "../_common/tooltip.js";
|
|
@@ -8,32 +8,32 @@ import { colorSetFromPalette as z, applyDateAxisLabelFormat as B, applyValueForm
|
|
|
8
8
|
import { c as i } from "../../../Entity-BJCuhdq_.js";
|
|
9
9
|
import { X as N, V as U } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
10
|
import { X as W } from "../../../XYCursor-CVUSpqb9.js";
|
|
11
|
-
import { A as
|
|
11
|
+
import { A as F, a as Z } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
12
12
|
import { C as _ } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
13
13
|
import { L as $ } from "../../../LineSeries-D_IL2qGF.js";
|
|
14
14
|
import { D as j, G as J } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
15
15
|
import { S as K } from "../../../Scrollbar-CTI7_8Qw.js";
|
|
16
16
|
import { D as M } from "../../../DateAxis-DEXKps1S.js";
|
|
17
|
-
const xe = (
|
|
18
|
-
const f =
|
|
17
|
+
const xe = (X) => {
|
|
18
|
+
const f = R({ props: X, name: "HCLogaritmicScale" }), {
|
|
19
19
|
dimensions: t,
|
|
20
20
|
values: s,
|
|
21
|
-
data:
|
|
22
|
-
initDelay:
|
|
21
|
+
data: p,
|
|
22
|
+
initDelay: k = 0,
|
|
23
23
|
baseInterval: h,
|
|
24
24
|
colors: A,
|
|
25
25
|
skipEmptyDates: x = !1,
|
|
26
|
-
sx:
|
|
27
|
-
...
|
|
28
|
-
} = f, a =
|
|
29
|
-
let
|
|
30
|
-
t.length < 1 ?
|
|
31
|
-
if (
|
|
32
|
-
let
|
|
33
|
-
return
|
|
34
|
-
var
|
|
35
|
-
const e =
|
|
36
|
-
|
|
26
|
+
sx: L,
|
|
27
|
+
...S
|
|
28
|
+
} = f, a = E(), g = `hc-logaritmic-scale-${G().replace(/:/g, "")}`, c = O(null);
|
|
29
|
+
let n = null;
|
|
30
|
+
t.length < 1 ? n = "LogaritmicScale requires at least 1 dimension" : s.length < 1 && (n = "LogaritmicScale requires at least 1 value"), P(() => {
|
|
31
|
+
if (n) return;
|
|
32
|
+
let d;
|
|
33
|
+
return d = setTimeout(() => {
|
|
34
|
+
var w, v, D, b;
|
|
35
|
+
const e = T.new(g);
|
|
36
|
+
c.current = e, e.setThemes([Y.new(e)]), e.interfaceColors.setAll({
|
|
37
37
|
text: i(a.palette.text.primary),
|
|
38
38
|
grid: i(a.palette.divider),
|
|
39
39
|
stroke: i(a.palette.divider)
|
|
@@ -52,18 +52,18 @@ const xe = (k) => {
|
|
|
52
52
|
"cursor",
|
|
53
53
|
W.new(e, { behavior: "none" })
|
|
54
54
|
).lineY.set("visible", !1);
|
|
55
|
-
let o,
|
|
55
|
+
let o, u = p;
|
|
56
56
|
if (t[0].type === "date") {
|
|
57
|
-
|
|
57
|
+
u = I.orderBy(p, [t[0].value]);
|
|
58
58
|
const l = x ? J : M;
|
|
59
59
|
o = r.xAxes.push(
|
|
60
60
|
l.new(e, {
|
|
61
61
|
maxDeviation: 0.1,
|
|
62
62
|
groupData: !1,
|
|
63
63
|
baseInterval: h || { timeUnit: "day", count: 1 },
|
|
64
|
-
renderer:
|
|
64
|
+
renderer: F.new(e, {})
|
|
65
65
|
})
|
|
66
|
-
), (
|
|
66
|
+
), (w = o.get("renderer")) == null || w.grid.template.setAll({
|
|
67
67
|
stroke: i(a.palette.divider),
|
|
68
68
|
strokeOpacity: 1
|
|
69
69
|
}), B(o, t[0]);
|
|
@@ -71,12 +71,12 @@ const xe = (k) => {
|
|
|
71
71
|
o = r.xAxes.push(
|
|
72
72
|
_.new(e, {
|
|
73
73
|
categoryField: t[0].value,
|
|
74
|
-
renderer:
|
|
74
|
+
renderer: F.new(e, {})
|
|
75
75
|
})
|
|
76
76
|
), e.numberFormatter.setAll({
|
|
77
77
|
numberFormat: "#",
|
|
78
78
|
numericFields: ["valueX"]
|
|
79
|
-
}),
|
|
79
|
+
}), o.data.setAll(u), (v = o.get("renderer")) == null || v.grid.template.setAll({
|
|
80
80
|
stroke: i(a.palette.divider),
|
|
81
81
|
strokeOpacity: 1
|
|
82
82
|
});
|
|
@@ -90,7 +90,7 @@ const xe = (k) => {
|
|
|
90
90
|
stroke: i(a.palette.divider),
|
|
91
91
|
strokeOpacity: 1
|
|
92
92
|
}), s.forEach((l) => {
|
|
93
|
-
const
|
|
93
|
+
const m = r.series.push(
|
|
94
94
|
$.new(e, {
|
|
95
95
|
name: l.label ?? V(l.name),
|
|
96
96
|
xAxis: o,
|
|
@@ -99,10 +99,10 @@ const xe = (k) => {
|
|
|
99
99
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
100
100
|
})
|
|
101
101
|
);
|
|
102
|
-
|
|
102
|
+
m.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (m.data.processor = j.new(e, {
|
|
103
103
|
dateFormat: "i",
|
|
104
104
|
dateFields: [t[0].value]
|
|
105
|
-
})),
|
|
105
|
+
})), m.data.setAll(u), m.appear(1e3);
|
|
106
106
|
}), q({
|
|
107
107
|
root: e,
|
|
108
108
|
chart: r,
|
|
@@ -115,13 +115,13 @@ const xe = (k) => {
|
|
|
115
115
|
"scrollbarX",
|
|
116
116
|
K.new(e, { orientation: "horizontal" })
|
|
117
117
|
), H(e, (b = s == null ? void 0 : s[0]) == null ? void 0 : b.format), r.appear(1e3, 100);
|
|
118
|
-
},
|
|
118
|
+
}, k), () => {
|
|
119
119
|
var e;
|
|
120
|
-
|
|
120
|
+
d && clearTimeout(d), (e = c.current) == null || e.dispose(), c.current = null;
|
|
121
121
|
};
|
|
122
|
-
}, [
|
|
123
|
-
const
|
|
124
|
-
return { chartId: g, ownerState:
|
|
122
|
+
}, [p, t, s, a.palette.mode, A, x]);
|
|
123
|
+
const C = { ...f };
|
|
124
|
+
return { chartId: g, ownerState: C, sx: L, error: n, other: S };
|
|
125
125
|
};
|
|
126
126
|
export {
|
|
127
127
|
xe as useLogaritmicScaleLogic
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { R as j, A as q } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
2
|
import { useThemeProps as z, useTheme as U } from "@mui/material";
|
|
3
|
-
import
|
|
3
|
+
import N from "lodash";
|
|
4
4
|
import { useId as H, useRef as $, useEffect as J } from "react";
|
|
5
5
|
import { humanizeLabel as P } from "../_common/format.js";
|
|
6
6
|
import { attachCombinedAxisTooltip as K } from "../_common/tooltip.js";
|
|
7
7
|
import { colorSetFromPalette as Q, applyDateAxisLabelFormat as Z, applyValueFormat as ee } from "../_common/utils.js";
|
|
8
|
-
import { c as
|
|
8
|
+
import { c as v, a as g } from "../../../Entity-BJCuhdq_.js";
|
|
9
9
|
import { X as te, V as re } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
10
|
import { L as se } from "../../../Legend-CFvQiIfn.js";
|
|
11
11
|
import { A as X, a as ae } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
@@ -14,10 +14,10 @@ import { X as oe } from "../../../XYCursor-CVUSpqb9.js";
|
|
|
14
14
|
import { G as le, D as ne } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
15
15
|
import { D as ce } from "../../../DateAxis-DEXKps1S.js";
|
|
16
16
|
import { L as me } from "../../../LineSeries-D_IL2qGF.js";
|
|
17
|
-
import { G, R as
|
|
18
|
-
import { C as
|
|
17
|
+
import { G, R as pe } from "../../../Tooltip-vyZRZWih.js";
|
|
18
|
+
import { C as ue } from "../../../Circle-BnfBNKBD.js";
|
|
19
19
|
import { B as de } from "../../../Bullet-Djj7Vs9T.js";
|
|
20
|
-
class
|
|
20
|
+
class x extends G {
|
|
21
21
|
_beforeChanged() {
|
|
22
22
|
super._beforeChanged(), (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && (this._clear = !0);
|
|
23
23
|
}
|
|
@@ -32,41 +32,41 @@ class y extends G {
|
|
|
32
32
|
this.markDirty(), this._clear = !0;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
Object.defineProperty(
|
|
35
|
+
Object.defineProperty(x, "className", {
|
|
36
36
|
enumerable: !0,
|
|
37
37
|
configurable: !0,
|
|
38
38
|
writable: !0,
|
|
39
39
|
value: "Triangle"
|
|
40
40
|
});
|
|
41
|
-
Object.defineProperty(
|
|
41
|
+
Object.defineProperty(x, "classNames", {
|
|
42
42
|
enumerable: !0,
|
|
43
43
|
configurable: !0,
|
|
44
44
|
writable: !0,
|
|
45
|
-
value: G.classNames.concat([
|
|
45
|
+
value: G.classNames.concat([x.className])
|
|
46
46
|
});
|
|
47
|
-
const
|
|
48
|
-
const c = z({ props:
|
|
47
|
+
const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (C) => {
|
|
48
|
+
const c = z({ props: C, name: "HCMultipleValueAxes" }), {
|
|
49
49
|
dimensions: s,
|
|
50
50
|
values: t,
|
|
51
|
-
data:
|
|
51
|
+
data: y,
|
|
52
52
|
initDelay: I = 0,
|
|
53
|
-
baseInterval:
|
|
54
|
-
colors:
|
|
55
|
-
skipEmptyDates:
|
|
53
|
+
baseInterval: T,
|
|
54
|
+
colors: L,
|
|
55
|
+
skipEmptyDates: R = !1,
|
|
56
56
|
sx: Y,
|
|
57
57
|
...V
|
|
58
|
-
} = c,
|
|
59
|
-
let
|
|
60
|
-
s.length < 1 ?
|
|
61
|
-
if (
|
|
58
|
+
} = c, p = U(), E = `hc-multiple-value-axes-${H().replace(/:/g, "")}`, w = $(null);
|
|
59
|
+
let u = null;
|
|
60
|
+
s.length < 1 ? u = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (u = "MultipleValueAxes requires at least 1 value"), J(() => {
|
|
61
|
+
if (u) return;
|
|
62
62
|
let b;
|
|
63
63
|
return b = setTimeout(() => {
|
|
64
|
-
var
|
|
65
|
-
const e = j.new(
|
|
64
|
+
var F;
|
|
65
|
+
const e = j.new(E);
|
|
66
66
|
w.current = e, e.setThemes([q.new(e)]), e.interfaceColors.setAll({
|
|
67
|
-
text:
|
|
68
|
-
grid:
|
|
69
|
-
stroke:
|
|
67
|
+
text: v(p.palette.text.primary),
|
|
68
|
+
grid: v(p.palette.divider),
|
|
69
|
+
stroke: v(p.palette.divider)
|
|
70
70
|
});
|
|
71
71
|
const r = e.container.children.push(
|
|
72
72
|
te.new(e, {
|
|
@@ -78,75 +78,75 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
|
|
|
78
78
|
layout: e.verticalLayout
|
|
79
79
|
})
|
|
80
80
|
);
|
|
81
|
-
r.set("colors", Q(e,
|
|
82
|
-
const
|
|
83
|
-
se.new(e, { centerX:
|
|
84
|
-
),
|
|
85
|
-
let l,
|
|
86
|
-
if (
|
|
87
|
-
const a =
|
|
81
|
+
r.set("colors", Q(e, L)), r.get("colors", {}).set("step", 3);
|
|
82
|
+
const S = r.children.push(
|
|
83
|
+
se.new(e, { centerX: g, x: g })
|
|
84
|
+
), o = s[0];
|
|
85
|
+
let l, d = y;
|
|
86
|
+
if (o.type === "date") {
|
|
87
|
+
const a = R ? le : ce;
|
|
88
88
|
l = r.xAxes.push(
|
|
89
89
|
a.new(e, {
|
|
90
90
|
maxDeviation: 0.1,
|
|
91
91
|
groupData: !1,
|
|
92
|
-
baseInterval:
|
|
92
|
+
baseInterval: T || { timeUnit: "day", count: 1 },
|
|
93
93
|
renderer: X.new(e, {})
|
|
94
94
|
})
|
|
95
|
-
), Z(l,
|
|
95
|
+
), Z(l, o), d = N.orderBy(y, [o.value]);
|
|
96
96
|
} else
|
|
97
97
|
l = r.xAxes.push(
|
|
98
98
|
ie.new(e, {
|
|
99
|
-
categoryField:
|
|
99
|
+
categoryField: o.value,
|
|
100
100
|
renderer: X.new(e, {})
|
|
101
101
|
})
|
|
102
102
|
), e.numberFormatter.setAll({
|
|
103
103
|
numberFormat: "#",
|
|
104
104
|
numericFields: ["valueX"]
|
|
105
|
-
}),
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
re.new(e, { maxDeviation: 1, renderer:
|
|
105
|
+
}), l.data.setAll(d);
|
|
106
|
+
function _(a, n, m, B, W, D, M) {
|
|
107
|
+
const h = ae.new(e, { opposite: W }), k = r.yAxes.push(
|
|
108
|
+
re.new(e, { maxDeviation: 1, renderer: h })
|
|
109
109
|
);
|
|
110
110
|
r.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", r.yAxes.getIndex(0));
|
|
111
|
-
const
|
|
111
|
+
const i = r.series.push(
|
|
112
112
|
me.new(e, {
|
|
113
113
|
name: n,
|
|
114
114
|
xAxis: l,
|
|
115
115
|
yAxis: k,
|
|
116
|
-
valueYField:
|
|
117
|
-
...
|
|
116
|
+
valueYField: B,
|
|
117
|
+
...o.type === "date" ? { valueXField: m } : { categoryXField: m }
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
|
-
|
|
121
|
-
stroke:
|
|
120
|
+
i.strokes.template.setAll({ strokeWidth: 2 }), h.grid.template.set("strokeOpacity", 0.05), h.labels.template.set("fill", i.get("fill")), h.setAll({
|
|
121
|
+
stroke: i.get("fill"),
|
|
122
122
|
strokeOpacity: 1,
|
|
123
123
|
opacity: 1
|
|
124
|
-
}), M === "date" && (
|
|
124
|
+
}), M === "date" && (i.data.processor = ne.new(e, {
|
|
125
125
|
dateFormat: "i",
|
|
126
126
|
dateFields: [m]
|
|
127
|
-
})), D !== void 0 &&
|
|
128
|
-
let
|
|
129
|
-
return D === "RECTANGLE" ?
|
|
127
|
+
})), D !== void 0 && i.bullets.push(function() {
|
|
128
|
+
let f;
|
|
129
|
+
return D === "RECTANGLE" ? f = pe.new(e, {
|
|
130
130
|
width: 10,
|
|
131
131
|
height: 10,
|
|
132
|
-
centerX:
|
|
133
|
-
centerY:
|
|
132
|
+
centerX: g,
|
|
133
|
+
centerY: g,
|
|
134
134
|
strokeWidth: 2,
|
|
135
|
-
stroke:
|
|
135
|
+
stroke: i.get("stroke"),
|
|
136
136
|
fill: e.interfaceColors.get("background")
|
|
137
|
-
}) : D === "TRIANGLE" ?
|
|
137
|
+
}) : D === "TRIANGLE" ? f = x.new(e, {
|
|
138
138
|
width: 10,
|
|
139
139
|
height: 10,
|
|
140
140
|
strokeWidth: 2,
|
|
141
|
-
stroke:
|
|
141
|
+
stroke: i.get("stroke"),
|
|
142
142
|
fill: e.interfaceColors.get("background")
|
|
143
|
-
}) :
|
|
143
|
+
}) : f = ue.new(e, {
|
|
144
144
|
strokeWidth: 2,
|
|
145
145
|
radius: 4,
|
|
146
|
-
stroke:
|
|
146
|
+
stroke: i.get("stroke"),
|
|
147
147
|
fill: e.interfaceColors.get("background")
|
|
148
|
-
}), de.new(e, { sprite:
|
|
149
|
-
}),
|
|
148
|
+
}), de.new(e, { sprite: f });
|
|
149
|
+
}), i.data.setAll(a);
|
|
150
150
|
}
|
|
151
151
|
if (r.set(
|
|
152
152
|
"cursor",
|
|
@@ -155,42 +155,42 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
|
|
|
155
155
|
root: e,
|
|
156
156
|
chart: r,
|
|
157
157
|
xAxis: l,
|
|
158
|
-
theme:
|
|
159
|
-
isDateAxis:
|
|
160
|
-
baseInterval:
|
|
158
|
+
theme: p,
|
|
159
|
+
isDateAxis: o.type === "date",
|
|
160
|
+
baseInterval: T,
|
|
161
161
|
follow: !0
|
|
162
162
|
}), s.length > 1) {
|
|
163
|
-
const a =
|
|
163
|
+
const a = N.groupBy(d, s[1].value);
|
|
164
164
|
Object.keys(a).forEach((n, m) => {
|
|
165
|
-
|
|
165
|
+
_(
|
|
166
166
|
a[n],
|
|
167
167
|
P(n),
|
|
168
168
|
s[0].value,
|
|
169
169
|
t[0].dataFieldName,
|
|
170
170
|
m !== 0,
|
|
171
|
-
|
|
171
|
+
A[m % A.length]
|
|
172
172
|
);
|
|
173
173
|
});
|
|
174
174
|
} else
|
|
175
175
|
t.forEach((a, n) => {
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
_(
|
|
177
|
+
d,
|
|
178
178
|
a.label ?? P(a.name),
|
|
179
|
-
|
|
179
|
+
o.value,
|
|
180
180
|
a.dataFieldName,
|
|
181
181
|
n !== 0,
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
A[n % A.length],
|
|
183
|
+
o.type
|
|
184
184
|
);
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
S.data.setAll(r.series.values), ee(e, (F = t == null ? void 0 : t[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
|
|
187
187
|
}, I), () => {
|
|
188
188
|
var e;
|
|
189
189
|
b && clearTimeout(b), (e = w.current) == null || e.dispose(), w.current = null;
|
|
190
190
|
};
|
|
191
|
-
}, [
|
|
192
|
-
const
|
|
193
|
-
return { chartId:
|
|
191
|
+
}, [y, s, t, p.palette.mode, L, R]);
|
|
192
|
+
const O = { ...c };
|
|
193
|
+
return { chartId: E, ownerState: O, sx: Y, error: u, other: V };
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
196
|
Ge as useMultipleValueAxesLogic
|
|
@@ -178,7 +178,15 @@ const Be = (I) => {
|
|
|
178
178
|
var t;
|
|
179
179
|
x && clearTimeout(x), (t = h.current) == null || t.dispose(), h.current = null;
|
|
180
180
|
};
|
|
181
|
-
}, [
|
|
181
|
+
}, [
|
|
182
|
+
f,
|
|
183
|
+
l,
|
|
184
|
+
c,
|
|
185
|
+
n.palette.mode,
|
|
186
|
+
w,
|
|
187
|
+
b,
|
|
188
|
+
D
|
|
189
|
+
]);
|
|
182
190
|
const j = { ...g };
|
|
183
191
|
return { chartId: X, ownerState: j, sx: W, error: C, other: N };
|
|
184
192
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { MetricChart as
|
|
4
|
-
import { useMetricCardLogic as
|
|
5
|
-
import { MetricCardRoot as
|
|
6
|
-
const
|
|
7
|
-
const { state:
|
|
8
|
-
ownerState:
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as a, Skeleton as l, Tooltip as c } from "@mui/material";
|
|
3
|
+
import { MetricChart as w } from "./MetricChart.js";
|
|
4
|
+
import { useMetricCardLogic as z } from "./logic.js";
|
|
5
|
+
import { MetricCardRoot as f, MetricCardValue as V, MetricCardSecondValue as k, MetricCardTrendContainer as P, MetricCardLabel as v, MetricCardPanel as W, MetricCardDescription as M, MetricCardSideChart as L, MetricCardCornerIconContainer as A, MetricCardIconContainer as y, MetricCardContent as D, MetricCardChartContainer as F } from "./styled.js";
|
|
6
|
+
const H = (t) => {
|
|
7
|
+
const { state: S } = z(t), {
|
|
8
|
+
ownerState: n,
|
|
9
9
|
layout: d,
|
|
10
|
-
calculatedValue:
|
|
11
|
-
calculatedSecondValue:
|
|
12
|
-
calculatedChange:
|
|
13
|
-
TrendIcon:
|
|
14
|
-
Icon:
|
|
10
|
+
calculatedValue: o,
|
|
11
|
+
calculatedSecondValue: h,
|
|
12
|
+
calculatedChange: s,
|
|
13
|
+
TrendIcon: b,
|
|
14
|
+
Icon: r,
|
|
15
15
|
showCornerIcon: I,
|
|
16
|
-
showSideIcon:
|
|
17
|
-
iconPosition:
|
|
18
|
-
snapshotPayload:
|
|
19
|
-
} =
|
|
16
|
+
showSideIcon: C,
|
|
17
|
+
iconPosition: x,
|
|
18
|
+
snapshotPayload: T
|
|
19
|
+
} = S, g = !!t.showChart && !!t.chartType && (t.value ?? []).length >= 2, j = (t.showChange || t.showTrend) && s !== "—";
|
|
20
20
|
if (t.loading)
|
|
21
|
-
return /* @__PURE__ */ e(
|
|
22
|
-
/* @__PURE__ */ e(
|
|
23
|
-
/* @__PURE__ */ e(
|
|
24
|
-
/* @__PURE__ */ e(
|
|
21
|
+
return /* @__PURE__ */ e(f, { ownerState: n, sx: t.sx, children: /* @__PURE__ */ i(a, { spacing: 1, children: [
|
|
22
|
+
/* @__PURE__ */ e(l, { variant: "text", width: "60%" }),
|
|
23
|
+
/* @__PURE__ */ e(l, { variant: "rectangular", height: 40, width: "40%" }),
|
|
24
|
+
/* @__PURE__ */ e(l, { variant: "text", width: "80%" }),
|
|
25
25
|
t.showChart && /* @__PURE__ */ e(
|
|
26
|
-
|
|
26
|
+
l,
|
|
27
27
|
{
|
|
28
28
|
variant: "rectangular",
|
|
29
29
|
height: 40,
|
|
@@ -32,40 +32,50 @@ const G = (t) => {
|
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
] }) });
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const u = /* @__PURE__ */ i(
|
|
36
|
+
a,
|
|
37
37
|
{
|
|
38
38
|
direction: "row",
|
|
39
39
|
alignItems: "center",
|
|
40
40
|
spacing: 1,
|
|
41
41
|
flexWrap: d === "panel" ? "nowrap" : "wrap",
|
|
42
|
+
sx: { minWidth: 0 },
|
|
42
43
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
/* @__PURE__ */ i(
|
|
45
|
+
a,
|
|
46
|
+
{
|
|
47
|
+
direction: "row",
|
|
48
|
+
alignItems: "baseline",
|
|
49
|
+
spacing: 0.5,
|
|
50
|
+
sx: { minWidth: 0 },
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ e(c, { title: o, children: /* @__PURE__ */ e(V, { variant: "h4", ownerState: n, children: o }) }),
|
|
53
|
+
h && /* @__PURE__ */ e(c, { title: h, children: /* @__PURE__ */ e(k, { variant: "h5", ownerState: n, children: h }) })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
j && /* @__PURE__ */ i(P, { ownerState: n, children: [
|
|
58
|
+
d === "overlay" && t.showTrend && /* @__PURE__ */ e(b, { size: 16 }),
|
|
59
|
+
t.showChange && s
|
|
50
60
|
] })
|
|
51
61
|
]
|
|
52
62
|
}
|
|
53
63
|
);
|
|
54
64
|
return /* @__PURE__ */ e(
|
|
55
|
-
|
|
65
|
+
f,
|
|
56
66
|
{
|
|
57
|
-
ownerState:
|
|
67
|
+
ownerState: n,
|
|
58
68
|
sx: t.sx,
|
|
59
|
-
"data-snapshot":
|
|
60
|
-
children: d === "panel" ? /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
t.description && /* @__PURE__ */ e(
|
|
69
|
+
"data-snapshot": T,
|
|
70
|
+
children: d === "panel" ? /* @__PURE__ */ i(m, { children: [
|
|
71
|
+
/* @__PURE__ */ e(c, { title: t.label, children: /* @__PURE__ */ e(v, { variant: "body2", children: t.label }) }),
|
|
72
|
+
/* @__PURE__ */ i(W, { children: [
|
|
73
|
+
/* @__PURE__ */ i(a, { justifyContent: "center", spacing: 0.5, sx: { flexShrink: 0 }, children: [
|
|
74
|
+
u,
|
|
75
|
+
t.description && /* @__PURE__ */ e(c, { title: t.description, children: /* @__PURE__ */ e(M, { variant: "caption", children: t.description }) })
|
|
66
76
|
] }),
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
g && /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
|
|
78
|
+
w,
|
|
69
79
|
{
|
|
70
80
|
type: t.chartType,
|
|
71
81
|
data: t.value,
|
|
@@ -74,41 +84,41 @@ const G = (t) => {
|
|
|
74
84
|
}
|
|
75
85
|
) })
|
|
76
86
|
] })
|
|
77
|
-
] }) : /* @__PURE__ */
|
|
78
|
-
I &&
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
87
|
+
] }) : /* @__PURE__ */ i(m, { children: [
|
|
88
|
+
I && r && /* @__PURE__ */ e(A, { ownerState: n, children: /* @__PURE__ */ e(r, { size: 24 }) }),
|
|
89
|
+
/* @__PURE__ */ i(
|
|
90
|
+
a,
|
|
81
91
|
{
|
|
82
92
|
direction: "row",
|
|
83
93
|
justifyContent: "space-between",
|
|
84
94
|
alignItems: "flex-start",
|
|
85
95
|
sx: { flex: 1 },
|
|
86
96
|
children: [
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */ e(
|
|
90
|
-
|
|
97
|
+
C && r && x === "left" && /* @__PURE__ */ e(y, { ownerState: n, children: /* @__PURE__ */ e(r, { sx: { fontSize: 24 } }) }),
|
|
98
|
+
/* @__PURE__ */ i(D, { children: [
|
|
99
|
+
/* @__PURE__ */ e(c, { title: t.label, children: /* @__PURE__ */ e(v, { variant: "body2", children: t.label }) }),
|
|
100
|
+
u
|
|
91
101
|
] }),
|
|
92
|
-
|
|
102
|
+
C && r && x === "right" && /* @__PURE__ */ e(y, { ownerState: n, children: /* @__PURE__ */ e(r, { sx: { fontSize: 24 } }) })
|
|
93
103
|
]
|
|
94
104
|
}
|
|
95
105
|
),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
106
|
+
/* @__PURE__ */ i(
|
|
107
|
+
a,
|
|
98
108
|
{
|
|
99
109
|
direction: { xs: "column-reverse", sm: "column" },
|
|
100
110
|
spacing: 1,
|
|
101
111
|
sx: { width: "100%", mt: 2 },
|
|
102
112
|
children: [
|
|
103
|
-
t.description && /* @__PURE__ */ e(
|
|
104
|
-
|
|
113
|
+
t.description && /* @__PURE__ */ e(c, { title: t.description, children: /* @__PURE__ */ e(
|
|
114
|
+
M,
|
|
105
115
|
{
|
|
106
116
|
variant: "caption",
|
|
107
117
|
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
108
118
|
children: t.description
|
|
109
119
|
}
|
|
110
|
-
),
|
|
111
|
-
|
|
120
|
+
) }),
|
|
121
|
+
g && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(w, { type: t.chartType, data: t.value }) })
|
|
112
122
|
]
|
|
113
123
|
}
|
|
114
124
|
)
|
|
@@ -117,5 +127,5 @@ const G = (t) => {
|
|
|
117
127
|
);
|
|
118
128
|
};
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
H as MetricCard
|
|
121
131
|
};
|