@hybridcore/ui 1.6.28 → 1.6.30
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/components/charts/_common/format.js +64 -54
- package/dist/components/charts/_common/utils.js +39 -20
- package/dist/components/charts/donut-chart/logic.js +96 -58
- package/dist/components/charts/line/logic.js +124 -101
- package/dist/components/charts/pie-chart/logic.js +88 -50
- package/dist/components/data-list/logic.js +131 -137
- package/dist/components/metric-card/MetricChart.js +60 -58
- package/dist/components/metric-card/index.js +53 -40
- package/dist/components/metric-card/logic.js +66 -57
- package/dist/components/metric-card/styled.js +13 -9
- package/dist/components/paginated-list/helpers.js +8 -0
- package/dist/components/paginated-list/index.js +144 -61
- package/dist/components/paginated-list/logic.js +84 -47
- package/dist/components/paginated-list/styled.js +154 -17
- package/dist/hooks/useInfinitePaging.js +51 -0
- package/dist/main.d.ts +165 -5
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import S from "dayjs";
|
|
2
2
|
import { c as k, g as q } from "../../../_commonjsHelpers-BkfeUUK-.js";
|
|
3
|
-
var
|
|
3
|
+
var E = { exports: {} };
|
|
4
4
|
(function(t, e) {
|
|
5
5
|
(function(r, n) {
|
|
6
6
|
t.exports = n();
|
|
7
7
|
})(k, function() {
|
|
8
8
|
return function(r, n, s) {
|
|
9
9
|
r = r || {};
|
|
10
|
-
var i = n.prototype,
|
|
10
|
+
var i = n.prototype, h = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
11
11
|
function d(o, c, m, f) {
|
|
12
12
|
return i.fromToBase(o, c, m, f);
|
|
13
13
|
}
|
|
14
|
-
s.en.relativeTime =
|
|
15
|
-
for (var N,
|
|
16
|
-
var u = D[
|
|
14
|
+
s.en.relativeTime = h, i.fromToBase = function(o, c, m, f, $) {
|
|
15
|
+
for (var N, p, M, y = m.$locale().relativeTime || h, D = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], L = D.length, b = 0; b < L; b += 1) {
|
|
16
|
+
var u = D[b];
|
|
17
17
|
u.d && (N = f ? s(o).diff(m, u.d, !0) : m.diff(o, u.d, !0));
|
|
18
18
|
var a = (r.rounding || Math.round)(Math.abs(N));
|
|
19
|
-
if (
|
|
20
|
-
a <= 1 &&
|
|
21
|
-
var
|
|
22
|
-
$ && (a = $("" + a)),
|
|
19
|
+
if (M = N > 0, a <= u.r || !u.r) {
|
|
20
|
+
a <= 1 && b > 0 && (u = D[b - 1]);
|
|
21
|
+
var x = y[u.l];
|
|
22
|
+
$ && (a = $("" + a)), p = typeof x == "string" ? x.replace("%d", a) : x(a, c, u.l, M);
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
if (c) return
|
|
27
|
-
var
|
|
28
|
-
return typeof
|
|
26
|
+
if (c) return p;
|
|
27
|
+
var w = M ? y.future : y.past;
|
|
28
|
+
return typeof w == "function" ? w(p) : w.replace("%s", p);
|
|
29
29
|
}, i.to = function(o, c) {
|
|
30
30
|
return d(o, c, this, !0);
|
|
31
31
|
}, i.from = function(o, c) {
|
|
@@ -41,10 +41,10 @@ var S = { exports: {} };
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
|
-
})(
|
|
45
|
-
var
|
|
46
|
-
const B = /* @__PURE__ */ q(
|
|
47
|
-
|
|
44
|
+
})(E);
|
|
45
|
+
var A = E.exports;
|
|
46
|
+
const B = /* @__PURE__ */ q(A);
|
|
47
|
+
S.extend(B);
|
|
48
48
|
const W = "—", j = (t) => {
|
|
49
49
|
const { decimals: e, notation: r } = t ?? {};
|
|
50
50
|
return r === "compact" ? new Intl.NumberFormat("en-US", {
|
|
@@ -56,7 +56,7 @@ const W = "—", j = (t) => {
|
|
|
56
56
|
"en-US",
|
|
57
57
|
e === void 0 ? { maximumFractionDigits: 2 } : { minimumFractionDigits: e, maximumFractionDigits: e }
|
|
58
58
|
);
|
|
59
|
-
},
|
|
59
|
+
}, C = (t) => {
|
|
60
60
|
if (typeof t == "boolean") return t;
|
|
61
61
|
if (typeof t == "number") return t === 1;
|
|
62
62
|
if (typeof t == "string") {
|
|
@@ -64,38 +64,47 @@ const W = "—", j = (t) => {
|
|
|
64
64
|
return e === "true" || e === "1";
|
|
65
65
|
}
|
|
66
66
|
return !1;
|
|
67
|
-
},
|
|
67
|
+
}, I = (t) => {
|
|
68
68
|
const e = t.toLowerCase();
|
|
69
69
|
return e.includes("year") ? "YYYY" : e.includes("month") ? "MMM YYYY" : e.includes("hour") || e.includes("minute") || e.includes("time") ? "DD MMM YYYY HH:mm" : "DD MMM YYYY";
|
|
70
|
-
},
|
|
71
|
-
const n =
|
|
72
|
-
return n.isValid() ? e === "relative" ? n.fromNow() : n.format(e ||
|
|
73
|
-
},
|
|
70
|
+
}, P = (t, e, r = "") => {
|
|
71
|
+
const n = S(t);
|
|
72
|
+
return n.isValid() ? e === "relative" ? n.fromNow() : n.format(e || I(r)) : String(t);
|
|
73
|
+
}, F = (t, e) => `${(t == null ? void 0 : t.prefix) ?? ""}${e}${(t == null ? void 0 : t.suffix) ?? ""}`, X = (t, e, r = W, n = "") => {
|
|
74
74
|
if (t == null || t === "") return r;
|
|
75
75
|
switch ((e == null ? void 0 : e.valueType) ?? (e != null && e.dateFormat ? "date" : "number")) {
|
|
76
76
|
case "date":
|
|
77
|
-
return
|
|
77
|
+
return P(t, e == null ? void 0 : e.dateFormat, n);
|
|
78
78
|
case "boolean":
|
|
79
|
-
return
|
|
79
|
+
return C(t) ? (e == null ? void 0 : e.trueLabel) ?? "true" : (e == null ? void 0 : e.falseLabel) ?? "false";
|
|
80
80
|
case "text":
|
|
81
|
-
return
|
|
81
|
+
return F(e, String(t));
|
|
82
82
|
case "number":
|
|
83
83
|
default: {
|
|
84
84
|
const i = Number(t);
|
|
85
|
-
return Number.isNaN(i) ?
|
|
85
|
+
return Number.isNaN(i) ? F(e, String(t)) : F(e, j(e).format(i));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, Z = (t) => {
|
|
89
89
|
if (!t) return;
|
|
90
90
|
const { prefix: e, suffix: r, decimals: n, notation: s } = t, i = s === "compact";
|
|
91
91
|
if (e === void 0 && r === void 0 && n === void 0 && !i)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
return `${d(e)}${
|
|
95
|
-
},
|
|
93
|
+
const h = i ? n === void 0 ? "#,###.#a" : n <= 0 ? "#,##0a" : `#,##0.${"0".repeat(n)}a` : n === void 0 ? "#,###.##" : n <= 0 ? "#,##0" : `#,##0.${"0".repeat(n)}`, d = (l) => l ? `'${l.replace(/'/g, "")}'` : "";
|
|
94
|
+
return `${d(e)}${h}${d(r)}`;
|
|
95
|
+
}, Y = 4, J = (t, e = 2) => {
|
|
96
|
+
if (!Number.isFinite(t)) return "";
|
|
97
|
+
const r = Math.max(0, Math.trunc(e)), n = t.toFixed(r);
|
|
98
|
+
if (Number(n) !== 0 || t === 0) return n;
|
|
99
|
+
for (let s = r + 1; s <= Y; s++) {
|
|
100
|
+
const i = t.toFixed(s);
|
|
101
|
+
if (Number(i) !== 0) return i;
|
|
102
|
+
}
|
|
103
|
+
return `<${(10 ** -Y).toFixed(Y)}`;
|
|
104
|
+
}, K = (t) => t && t.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), T = (t) => t instanceof Date ? t.getTime() : typeof t == "number" ? t : typeof t == "string" && t !== "" ? Date.parse(t) : NaN, v = (t, e) => {
|
|
96
105
|
const r = new Date(t), n = new Date(e);
|
|
97
106
|
return r.getFullYear() === n.getFullYear() && r.getMonth() === n.getMonth() && r.getDate() === n.getDate();
|
|
98
|
-
},
|
|
107
|
+
}, U = (t, e) => {
|
|
99
108
|
const r = Number(t);
|
|
100
109
|
if (Number.isNaN(r)) return !1;
|
|
101
110
|
const n = Number(e.value);
|
|
@@ -119,8 +128,8 @@ const W = "—", j = (t) => {
|
|
|
119
128
|
default:
|
|
120
129
|
return !1;
|
|
121
130
|
}
|
|
122
|
-
},
|
|
123
|
-
const r =
|
|
131
|
+
}, V = (t, e) => {
|
|
132
|
+
const r = T(t), n = T(e.value);
|
|
124
133
|
if (Number.isNaN(r) || Number.isNaN(n)) return !1;
|
|
125
134
|
switch (e.op) {
|
|
126
135
|
case "lt":
|
|
@@ -132,17 +141,17 @@ const W = "—", j = (t) => {
|
|
|
132
141
|
case "gte":
|
|
133
142
|
return r >= n;
|
|
134
143
|
case "eq":
|
|
135
|
-
return
|
|
144
|
+
return v(r, n);
|
|
136
145
|
case "neq":
|
|
137
|
-
return !
|
|
146
|
+
return !v(r, n);
|
|
138
147
|
case "between": {
|
|
139
|
-
const s =
|
|
148
|
+
const s = T(e.value2);
|
|
140
149
|
return !Number.isNaN(s) && r >= n && r <= s;
|
|
141
150
|
}
|
|
142
151
|
default:
|
|
143
152
|
return !1;
|
|
144
153
|
}
|
|
145
|
-
},
|
|
154
|
+
}, _ = (t, e) => {
|
|
146
155
|
const r = String(t ?? "").toLowerCase(), n = String(e.value ?? "").toLowerCase();
|
|
147
156
|
switch (e.op) {
|
|
148
157
|
case "eq":
|
|
@@ -164,44 +173,45 @@ const W = "—", j = (t) => {
|
|
|
164
173
|
default:
|
|
165
174
|
return !1;
|
|
166
175
|
}
|
|
167
|
-
},
|
|
176
|
+
}, z = (t, e) => {
|
|
168
177
|
switch (e.op) {
|
|
169
178
|
case "isTrue":
|
|
170
|
-
return
|
|
179
|
+
return C(t);
|
|
171
180
|
case "isFalse":
|
|
172
|
-
return !
|
|
181
|
+
return !C(t);
|
|
173
182
|
default:
|
|
174
183
|
return !1;
|
|
175
184
|
}
|
|
176
|
-
},
|
|
185
|
+
}, H = (t, e) => {
|
|
177
186
|
switch (e.type ?? "number") {
|
|
178
187
|
case "date":
|
|
179
|
-
return
|
|
188
|
+
return V(t, e);
|
|
180
189
|
case "text":
|
|
181
|
-
return
|
|
190
|
+
return _(t, e);
|
|
182
191
|
case "boolean":
|
|
183
|
-
return
|
|
192
|
+
return z(t, e);
|
|
184
193
|
case "number":
|
|
185
194
|
default:
|
|
186
|
-
return
|
|
195
|
+
return U(t, e);
|
|
187
196
|
}
|
|
188
|
-
}, g = (t) => t || void 0,
|
|
197
|
+
}, g = (t) => t || void 0, O = (t, e) => {
|
|
189
198
|
const r = {
|
|
190
199
|
color: g(e == null ? void 0 : e.color),
|
|
191
200
|
backgroundColor: g(e == null ? void 0 : e.backgroundColor)
|
|
192
201
|
}, n = e == null ? void 0 : e.conditionalRules;
|
|
193
202
|
if (!(n != null && n.length)) return r;
|
|
194
|
-
const s = n.find((i) =>
|
|
203
|
+
const s = n.find((i) => H(t, i));
|
|
195
204
|
return s ? {
|
|
196
205
|
color: g(s.color) ?? r.color,
|
|
197
206
|
backgroundColor: g(s.backgroundColor) ?? r.backgroundColor
|
|
198
207
|
} : r;
|
|
199
208
|
};
|
|
200
209
|
export {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
K as
|
|
210
|
+
Z as buildAmNumberFormat,
|
|
211
|
+
I as defaultDateFormat,
|
|
212
|
+
P as formatDateValue,
|
|
213
|
+
J as formatPercent,
|
|
214
|
+
X as formatValue,
|
|
215
|
+
K as humanizeLabel,
|
|
216
|
+
O as resolveConditionalStyle
|
|
207
217
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { buildAmNumberFormat as
|
|
2
|
-
import { C as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { buildAmNumberFormat as c, formatDateValue as m, formatPercent as s } from "./format.js";
|
|
2
|
+
import { C as l } from "../../../ColorSet-cyPmWGwh.js";
|
|
3
|
+
import { c as p } from "../../../Entity-BJCuhdq_.js";
|
|
4
|
+
const b = [
|
|
5
5
|
"#294D94",
|
|
6
6
|
"#375F97",
|
|
7
7
|
"#44729C",
|
|
@@ -12,30 +12,49 @@ const n = [
|
|
|
12
12
|
"#9FCFBF",
|
|
13
13
|
"#B9E1C9",
|
|
14
14
|
"#D6F1D5"
|
|
15
|
-
],
|
|
16
|
-
colors: e.map((
|
|
15
|
+
], v = (t, e = b) => l.new(t, {
|
|
16
|
+
colors: e.map((r) => p(r)),
|
|
17
17
|
reuse: !0
|
|
18
|
-
}),
|
|
18
|
+
}), F = [
|
|
19
19
|
{ number: 1e3, suffix: "K" },
|
|
20
20
|
{ number: 1e6, suffix: "M" },
|
|
21
21
|
{ number: 1e9, suffix: "B" },
|
|
22
22
|
{ number: 1e12, suffix: "T" }
|
|
23
|
-
],
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
e.type !== "date" || !e.dateFormat ||
|
|
23
|
+
], P = (t, e) => {
|
|
24
|
+
const r = c(e) ?? "#,###.##";
|
|
25
|
+
t.numberFormatter.set("numericFields", void 0), t.numberFormatter.set("numberFormat", r), (e == null ? void 0 : e.notation) === "compact" && t.numberFormatter.set("bigNumberPrefixes", F);
|
|
26
|
+
}, D = (t, e) => {
|
|
27
|
+
e.type !== "date" || !e.dateFormat || t.get("renderer").labels.template.adapters.add(
|
|
28
28
|
"text",
|
|
29
|
-
(
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
return typeof
|
|
29
|
+
(r, a) => {
|
|
30
|
+
var u;
|
|
31
|
+
const o = (u = a == null ? void 0 : a.dataItem) == null ? void 0 : u.get("value");
|
|
32
|
+
return typeof o == "number" ? m(o, e.dateFormat, e.value) : r;
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
|
+
}, n = (t) => {
|
|
36
|
+
const { percentDecimals: e, percent: r } = t, a = e <= 0 ? "0" : `0.${"0".repeat(e)}`;
|
|
37
|
+
return r === void 0 ? `{valuePercentTotal.formatNumber('${a}')}%` : `${s(r, e)}%`;
|
|
38
|
+
}, y = (t) => {
|
|
39
|
+
const { percentDecimals: e, showValueText: r, percent: a } = t, o = n({ percentDecimals: e, percent: a });
|
|
40
|
+
return r ? `{category}: ${o} ({value})` : `{category}: ${o}`;
|
|
41
|
+
}, d = (t) => {
|
|
42
|
+
var r;
|
|
43
|
+
const e = (r = t == null ? void 0 : t.dataItem) == null ? void 0 : r.get("valuePercentTotal");
|
|
44
|
+
return typeof e == "number" ? e : void 0;
|
|
45
|
+
}, A = (t, e) => {
|
|
46
|
+
t.valueLabels.template.set("text", n({ percentDecimals: e })), t.valueLabels.template.adapters.add("text", (r, a) => {
|
|
47
|
+
const o = d(a);
|
|
48
|
+
return o === void 0 ? r : n({ percentDecimals: e, percent: o });
|
|
49
|
+
});
|
|
35
50
|
};
|
|
36
51
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
b as DEFAULT_VIRIDIS_COOL,
|
|
53
|
+
D as applyDateAxisLabelFormat,
|
|
54
|
+
A as applyLegendPercentFormat,
|
|
55
|
+
P as applyValueFormat,
|
|
56
|
+
n as buildPercentText,
|
|
57
|
+
y as buildSliceText,
|
|
58
|
+
v as colorSetFromPalette,
|
|
59
|
+
d as readSharePercent
|
|
41
60
|
};
|
|
@@ -1,82 +1,120 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { R as N, A as V } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as z, useTheme as E } from "@mui/material";
|
|
3
|
+
import W from "dayjs";
|
|
4
|
+
import { useId as X, useRef as j, useEffect as H } from "react";
|
|
5
|
+
import { formatDateValue as O } from "../_common/format.js";
|
|
6
|
+
import { applyValueFormat as $, colorSetFromPalette as q, buildSliceText as k, applyLegendPercentFormat as G, readSharePercent as J } from "../_common/utils.js";
|
|
7
|
+
import { P as K, a as Q } from "../../../PieSeries-CMH0Z7pz.js";
|
|
8
|
+
import { p as c, c as d } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { L as U } from "../../../Legend-CFvQiIfn.js";
|
|
10
|
+
import { L as Z } from "../../../Tooltip-vyZRZWih.js";
|
|
11
|
+
const de = (A) => {
|
|
12
|
+
const y = z({ props: A, name: "HCDonutChart" }), {
|
|
13
|
+
dimensions: a,
|
|
12
14
|
values: o,
|
|
13
|
-
data:
|
|
14
|
-
initDelay:
|
|
15
|
-
colors:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
data: m,
|
|
16
|
+
initDelay: P = 0,
|
|
17
|
+
colors: T,
|
|
18
|
+
showDimensionLabel: Y = !1,
|
|
19
|
+
showValueText: f = !0,
|
|
20
|
+
percentDecimals: p = 2,
|
|
21
|
+
sx: R,
|
|
22
|
+
...C
|
|
23
|
+
} = y, i = E(), w = `hc-donut-chart-${X().replace(/:/g, "")}`, g = j(null), l = o.length > 1;
|
|
24
|
+
let u = null;
|
|
25
|
+
o.length < 1 ? u = "Missing values config!" : !l && a.length < 1 && (u = "Missing dimensions config!"), H(() => {
|
|
26
|
+
if (u) return;
|
|
27
|
+
let v;
|
|
28
|
+
return v = setTimeout(() => {
|
|
29
|
+
var M, F;
|
|
30
|
+
const e = N.new(w);
|
|
31
|
+
g.current = e, $(e, (M = o == null ? void 0 : o[0]) == null ? void 0 : M.format), e.setThemes([V.new(e)]);
|
|
32
|
+
const x = e.container.children.push(
|
|
33
|
+
K.new(e, {
|
|
29
34
|
layout: e.verticalLayout,
|
|
30
|
-
innerRadius:
|
|
35
|
+
innerRadius: c(50)
|
|
31
36
|
})
|
|
32
37
|
);
|
|
33
38
|
e.interfaceColors.setAll({
|
|
34
|
-
text:
|
|
35
|
-
grid:
|
|
36
|
-
stroke:
|
|
39
|
+
text: d(i.palette.text.primary),
|
|
40
|
+
grid: d(i.palette.divider),
|
|
41
|
+
stroke: d(i.palette.divider),
|
|
37
42
|
// Drives the gap color between slices; tie it to the surface so the
|
|
38
43
|
// beveled edges read correctly in both light and dark mode.
|
|
39
|
-
background:
|
|
44
|
+
background: d(i.palette.background.paper)
|
|
40
45
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
const I = l ? o.map((r) => {
|
|
47
|
+
var s;
|
|
48
|
+
return {
|
|
49
|
+
category: r.label || r.name || r.fieldName,
|
|
50
|
+
value: (s = m[0]) == null ? void 0 : s[r.dataFieldName]
|
|
51
|
+
};
|
|
52
|
+
}) : m, t = x.series.push(
|
|
53
|
+
Q.new(e, {
|
|
54
|
+
valueField: l ? "value" : o[0].dataFieldName,
|
|
55
|
+
categoryField: l ? "category" : a[0].value
|
|
45
56
|
})
|
|
46
57
|
);
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
tooltipText:
|
|
51
|
-
stroke:
|
|
58
|
+
t.set("colors", q(e, T));
|
|
59
|
+
const b = k({ percentDecimals: p, showValueText: f });
|
|
60
|
+
t.slices.template.setAll({
|
|
61
|
+
tooltipText: b,
|
|
62
|
+
stroke: d(i.palette.background.paper),
|
|
52
63
|
strokeWidth: 2,
|
|
53
64
|
strokeOpacity: 1,
|
|
54
65
|
cornerRadius: 4
|
|
55
|
-
}),
|
|
56
|
-
text:
|
|
66
|
+
}), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius", c(80)), t.labels.template.setAll({
|
|
67
|
+
text: b,
|
|
57
68
|
maxWidth: 140,
|
|
58
69
|
oversizedBehavior: "wrap"
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
});
|
|
71
|
+
const D = (r, s) => {
|
|
72
|
+
const S = J(s);
|
|
73
|
+
return S === void 0 ? r : k({ percentDecimals: p, showValueText: f, percent: S });
|
|
74
|
+
};
|
|
75
|
+
t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !l && a[0].type === "date" && m.forEach((r) => {
|
|
76
|
+
let s = "YYYY";
|
|
77
|
+
a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"), r[a[0].value] = W(r[a[0].value]).format(
|
|
78
|
+
s
|
|
63
79
|
);
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
}), t.data.setAll(I);
|
|
81
|
+
const L = x.children.push(
|
|
82
|
+
U.new(e, {
|
|
83
|
+
centerX: c(50),
|
|
84
|
+
x: c(50),
|
|
68
85
|
marginTop: 15,
|
|
69
86
|
marginBottom: 15
|
|
70
87
|
})
|
|
71
|
-
)
|
|
72
|
-
|
|
88
|
+
);
|
|
89
|
+
G(L, p), L.data.setAll(t.dataItems);
|
|
90
|
+
const n = a[0], h = n ? (F = m[0]) == null ? void 0 : F[n.value] : void 0;
|
|
91
|
+
Y && l && n && h != null && h !== "" && x.children.push(
|
|
92
|
+
Z.new(e, {
|
|
93
|
+
text: n.type === "date" ? O(h, n.dateFormat, n.value) : String(h),
|
|
94
|
+
centerX: c(50),
|
|
95
|
+
x: c(50),
|
|
96
|
+
fill: d(i.palette.text.secondary),
|
|
97
|
+
fontSize: 12,
|
|
98
|
+
paddingBottom: 8
|
|
99
|
+
})
|
|
100
|
+
), t.appear(1e3, 100);
|
|
101
|
+
}, P), () => {
|
|
73
102
|
var e;
|
|
74
|
-
|
|
103
|
+
v && clearTimeout(v), (e = g.current) == null || e.dispose(), g.current = null;
|
|
75
104
|
};
|
|
76
|
-
}, [
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
}, [
|
|
106
|
+
m,
|
|
107
|
+
a,
|
|
108
|
+
o,
|
|
109
|
+
i.palette.mode,
|
|
110
|
+
T,
|
|
111
|
+
Y,
|
|
112
|
+
f,
|
|
113
|
+
p
|
|
114
|
+
]);
|
|
115
|
+
const B = { ...y };
|
|
116
|
+
return { chartId: w, ownerState: B, sx: R, error: u, other: C };
|
|
79
117
|
};
|
|
80
118
|
export {
|
|
81
|
-
|
|
119
|
+
de as useDonutChartLogic
|
|
82
120
|
};
|