@hybridcore/ui 1.6.14 → 1.6.16
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/tooltip.js +44 -35
- package/dist/components/charts/chart-wrapper/index.js +44 -43
- package/dist/components/charts/donut-chart/logic.js +53 -40
- package/dist/components/charts/xy-chart/logic.js +135 -134
- package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +8737 -8722
- package/dist/main.d.ts +9 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T
|
|
2
|
-
import { c as p, p as
|
|
3
|
-
const
|
|
1
|
+
import { T } from "../../../Tooltip-vyZRZWih.js";
|
|
2
|
+
import { c as p, p as S } from "../../../Entity-BJCuhdq_.js";
|
|
3
|
+
const w = {
|
|
4
4
|
millisecond: "d MMM, yyyy HH:mm:ss.SSS",
|
|
5
5
|
second: "d MMM, yyyy HH:mm:ss",
|
|
6
6
|
minute: "d MMM, yyyy HH:mm",
|
|
@@ -9,7 +9,7 @@ const F = {
|
|
|
9
9
|
week: "d MMM, yyyy",
|
|
10
10
|
month: "MMM yyyy",
|
|
11
11
|
year: "yyyy"
|
|
12
|
-
},
|
|
12
|
+
}, A = (o) => w[(o == null ? void 0 : o.timeUnit) ?? "day"], F = (o, t) => {
|
|
13
13
|
var i;
|
|
14
14
|
(i = o.get("background")) == null || i.setAll({
|
|
15
15
|
fill: p(t.palette.background.paper),
|
|
@@ -18,56 +18,65 @@ const F = {
|
|
|
18
18
|
}), o.label.setAll({
|
|
19
19
|
fill: p(t.palette.text.primary),
|
|
20
20
|
textAlign: "left",
|
|
21
|
-
lineHeight:
|
|
21
|
+
lineHeight: S(160)
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
const { root: t, chart: i, theme: s, getText:
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
const {
|
|
33
|
-
|
|
23
|
+
}, k = (o) => {
|
|
24
|
+
const { root: t, chart: i, theme: s, getText: c } = o, e = T.new(t, { getFillFromSprite: !1 });
|
|
25
|
+
F(e, s), e.label.adapters.add("text", c), t.tooltipContainer.children.push(e);
|
|
26
|
+
const a = i.get("cursor");
|
|
27
|
+
return a == null || a.events.on("cursormoved", () => {
|
|
28
|
+
const y = a.getPrivate("point");
|
|
29
|
+
y && (e.label.text.markDirtyText(), e.set("pointTo", a.toGlobal(y)), e.show());
|
|
30
|
+
}), a == null || a.events.on("cursorhidden", () => e.hide()), e;
|
|
31
|
+
}, O = (o) => {
|
|
32
|
+
const {
|
|
33
|
+
root: t,
|
|
34
|
+
chart: i,
|
|
35
|
+
xAxis: s,
|
|
36
|
+
theme: c,
|
|
37
|
+
isDateAxis: e,
|
|
38
|
+
baseInterval: a,
|
|
39
|
+
follow: y,
|
|
40
|
+
horizontal: u
|
|
41
|
+
} = o, g = A(a), v = p(c.palette.text.secondary).toCSSHex(), b = u ? "valueX" : "valueY", H = u ? "valueY" : "valueX", $ = u ? "categoryY" : "categoryX", M = () => {
|
|
42
|
+
let n = "";
|
|
34
43
|
const m = [];
|
|
35
44
|
if (i.series.each((r) => {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
45
|
+
const l = r.get("tooltipDataItem"), f = l == null ? void 0 : l.get(b);
|
|
46
|
+
if (l === void 0 || f === void 0 || f === null)
|
|
38
47
|
return;
|
|
39
|
-
if (!
|
|
48
|
+
if (!n)
|
|
40
49
|
if (e) {
|
|
41
|
-
const
|
|
42
|
-
typeof
|
|
50
|
+
const x = l.get(H);
|
|
51
|
+
typeof x == "number" && (n = t.dateFormatter.format(new Date(x), g));
|
|
43
52
|
} else
|
|
44
|
-
|
|
45
|
-
const
|
|
53
|
+
n = `${l.get($) ?? ""}`;
|
|
54
|
+
const h = r.get("fill") ?? r.get("stroke"), D = h ? `[${h.toCSSHex()}]●[/] ` : "";
|
|
46
55
|
m.push(
|
|
47
|
-
`${
|
|
56
|
+
`${D}${r.get("name")}: ${t.numberFormatter.format(f)}`
|
|
48
57
|
);
|
|
49
58
|
}), m.length === 0) {
|
|
50
59
|
if (e) {
|
|
51
|
-
const
|
|
60
|
+
const l = s.positionToValue(
|
|
52
61
|
s.getPrivate("tooltipPosition", 0)
|
|
53
62
|
);
|
|
54
|
-
typeof
|
|
63
|
+
typeof l == "number" && !Number.isNaN(l) && (n = t.dateFormatter.format(new Date(l), g));
|
|
55
64
|
}
|
|
56
|
-
const r = `[${
|
|
57
|
-
return
|
|
65
|
+
const r = `[${v}]No data[/]`;
|
|
66
|
+
return n ? `[bold]${n}[/]
|
|
58
67
|
${r}` : r;
|
|
59
68
|
}
|
|
60
|
-
return
|
|
69
|
+
return n ? `[bold]${n}[/]
|
|
61
70
|
${m.join(`
|
|
62
71
|
`)}` : m.join(`
|
|
63
72
|
`);
|
|
64
73
|
};
|
|
65
|
-
if (
|
|
66
|
-
const d =
|
|
67
|
-
return
|
|
74
|
+
if (y) return k({ root: t, chart: i, theme: c, getText: M });
|
|
75
|
+
const d = T.new(t, { getFillFromSprite: !1 });
|
|
76
|
+
return F(d, c), d.label.adapters.add("text", M), s.set("tooltip", d), d;
|
|
68
77
|
};
|
|
69
78
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
O as attachCombinedAxisTooltip,
|
|
80
|
+
k as attachCursorTooltip,
|
|
81
|
+
A as getTooltipDateFormat
|
|
73
82
|
};
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsxs as a, jsx as r, Fragment as
|
|
2
|
-
import { Typography as C, Divider as
|
|
3
|
-
import { Loading as
|
|
4
|
-
import { CandlestickChart as
|
|
5
|
-
import { ColumnLineMix as
|
|
6
|
-
import { DonutChart as
|
|
7
|
-
import { DrillDownTreemap as
|
|
8
|
-
import { DrillDownVoronoiTreemap as
|
|
9
|
-
import { ForecastConeChart as
|
|
10
|
-
import { Heatmap as
|
|
11
|
-
import { LineChart as
|
|
12
|
-
import { LogaritmicScale as
|
|
13
|
-
import { MultipleValueAxes as
|
|
14
|
-
import { NestedPie as
|
|
15
|
-
import { PackedCircles as
|
|
16
|
-
import { PieChart as
|
|
17
|
-
import { StackedAreaRadar as
|
|
18
|
-
import { StackedColumnChart as
|
|
19
|
-
import { XYChart as
|
|
20
|
-
import { useChartWrapperLogic as
|
|
21
|
-
import { ChartWrapperRoot as
|
|
22
|
-
const rr = (
|
|
23
|
-
const { title:
|
|
24
|
-
return /* @__PURE__ */ a(
|
|
25
|
-
/* @__PURE__ */ r(
|
|
26
|
-
/* @__PURE__ */ r(
|
|
27
|
-
/* @__PURE__ */ r(
|
|
28
|
-
o === "MultipleValueAxes" && /* @__PURE__ */ r(
|
|
29
|
-
o === "XYChart" && /* @__PURE__ */ r(
|
|
30
|
-
o === "
|
|
31
|
-
o === "
|
|
32
|
-
o === "
|
|
33
|
-
o === "
|
|
34
|
-
o === "
|
|
35
|
-
o === "
|
|
36
|
-
o === "
|
|
37
|
-
o === "
|
|
38
|
-
o === "
|
|
39
|
-
o === "
|
|
40
|
-
o === "
|
|
41
|
-
o === "
|
|
42
|
-
o === "
|
|
43
|
-
o === "
|
|
1
|
+
import { jsxs as a, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as C, Divider as c } from "@mui/material";
|
|
3
|
+
import { Loading as d } from "../../loading/index.js";
|
|
4
|
+
import { CandlestickChart as f } from "../candlestick/index.js";
|
|
5
|
+
import { ColumnLineMix as s } from "../column-line-mix/index.js";
|
|
6
|
+
import { DonutChart as u } from "../donut-chart/index.js";
|
|
7
|
+
import { DrillDownTreemap as D } from "../drill-down-treemap/index.js";
|
|
8
|
+
import { DrillDownVoronoiTreemap as L } from "../drill-down-voronoi-treemap/index.js";
|
|
9
|
+
import { ForecastConeChart as g } from "../forecast-cone/index.js";
|
|
10
|
+
import { Heatmap as x } from "../heatmap/index.js";
|
|
11
|
+
import { LineChart as k } from "../line/index.js";
|
|
12
|
+
import { LogaritmicScale as S } from "../logaritmic-scale/index.js";
|
|
13
|
+
import { MultipleValueAxes as P } from "../multiple-value-axes/index.js";
|
|
14
|
+
import { NestedPie as w } from "../nested-pie/index.js";
|
|
15
|
+
import { PackedCircles as A } from "../packed-circles/index.js";
|
|
16
|
+
import { PieChart as T } from "../pie-chart/index.js";
|
|
17
|
+
import { StackedAreaRadar as W } from "../stacked-area-radar/index.js";
|
|
18
|
+
import { StackedColumnChart as H } from "../stacked-column-chart/index.js";
|
|
19
|
+
import { XYChart as i } from "../xy-chart/index.js";
|
|
20
|
+
import { useChartWrapperLogic as M } from "./logic.js";
|
|
21
|
+
import { ChartWrapperRoot as V, ChartWrapperHeader as v, ChartWrapperContent as y } from "./styled.js";
|
|
22
|
+
const rr = (m) => {
|
|
23
|
+
const { title: p, type: o, chartProps: t, loading: n, ownerState: e, sx: l } = M(m);
|
|
24
|
+
return /* @__PURE__ */ a(V, { ownerState: e, sx: l, children: [
|
|
25
|
+
/* @__PURE__ */ r(v, { ownerState: e, children: /* @__PURE__ */ r(C, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: p }) }),
|
|
26
|
+
/* @__PURE__ */ r(c, {}),
|
|
27
|
+
/* @__PURE__ */ r(y, { ownerState: e, children: n ? /* @__PURE__ */ r(d, { show: !0, position: "absolute" }) : /* @__PURE__ */ a(h, { children: [
|
|
28
|
+
o === "MultipleValueAxes" && /* @__PURE__ */ r(P, { ...t }),
|
|
29
|
+
o === "XYChart" && /* @__PURE__ */ r(i, { ...t }),
|
|
30
|
+
o === "XYChartHorizontal" && /* @__PURE__ */ r(i, { ...t, orientation: "horizontal" }),
|
|
31
|
+
o === "HeatLegend" && /* @__PURE__ */ r(x, { ...t }),
|
|
32
|
+
o === "PieChart" && /* @__PURE__ */ r(T, { ...t }),
|
|
33
|
+
o === "DonutChart" && /* @__PURE__ */ r(u, { ...t }),
|
|
34
|
+
o === "StackedColumnChart" && /* @__PURE__ */ r(H, { ...t }),
|
|
35
|
+
o === "StackedAreaRadar" && /* @__PURE__ */ r(W, { ...t }),
|
|
36
|
+
o === "LineChart" && /* @__PURE__ */ r(k, { ...t }),
|
|
37
|
+
o === "NestedPie" && /* @__PURE__ */ r(w, { ...t }),
|
|
38
|
+
o === "SingleLevelPackedCircles" && /* @__PURE__ */ r(A, { ...t }),
|
|
39
|
+
o === "LogarithmicScale" && /* @__PURE__ */ r(S, { ...t }),
|
|
40
|
+
o === "ColumnAndLineMix" && /* @__PURE__ */ r(s, { ...t }),
|
|
41
|
+
o === "DrillDownTreemap" && /* @__PURE__ */ r(D, { ...t }),
|
|
42
|
+
o === "DrillDownVoronoiTreemap" && /* @__PURE__ */ r(L, { ...t }),
|
|
43
|
+
o === "CandlestickChart" && /* @__PURE__ */ r(f, { ...t }),
|
|
44
|
+
o === "ForecastCone" && /* @__PURE__ */ r(g, { ...t })
|
|
44
45
|
] }) })
|
|
45
46
|
] });
|
|
46
47
|
};
|
|
@@ -1,69 +1,82 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { applyValueFormat as
|
|
6
|
-
import { P as
|
|
7
|
-
import { p as
|
|
8
|
-
import { L as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
1
|
+
import { R as w, A } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as P, useTheme as R } from "@mui/material";
|
|
3
|
+
import b from "dayjs";
|
|
4
|
+
import { useId as C, useRef as D, useEffect as F } from "react";
|
|
5
|
+
import { applyValueFormat as L, colorSetFromPalette as I } from "../_common/utils.js";
|
|
6
|
+
import { P as S, a as B } from "../../../PieSeries-CMH0Z7pz.js";
|
|
7
|
+
import { p as l, c as s } from "../../../Entity-BJCuhdq_.js";
|
|
8
|
+
import { L as E } from "../../../Legend-CFvQiIfn.js";
|
|
9
|
+
const G = (y) => {
|
|
10
|
+
const u = P({ props: y, name: "HCDonutChart" }), {
|
|
11
11
|
dimensions: t,
|
|
12
12
|
values: o,
|
|
13
|
-
data:
|
|
13
|
+
data: n,
|
|
14
14
|
initDelay: T = 0,
|
|
15
15
|
colors: d,
|
|
16
16
|
sx: x,
|
|
17
17
|
...M
|
|
18
|
-
} =
|
|
19
|
-
let
|
|
20
|
-
t.length < 1 ?
|
|
21
|
-
if (
|
|
22
|
-
let
|
|
23
|
-
return
|
|
24
|
-
var
|
|
25
|
-
const e =
|
|
26
|
-
|
|
18
|
+
} = u, a = R(), f = `hc-donut-chart-${C().replace(/:/g, "")}`, c = D(null);
|
|
19
|
+
let i = null;
|
|
20
|
+
t.length < 1 ? i = "Missing dimensions config!" : o.length < 1 && (i = "Missing values config!"), F(() => {
|
|
21
|
+
if (i) return;
|
|
22
|
+
let m;
|
|
23
|
+
return m = setTimeout(() => {
|
|
24
|
+
var v;
|
|
25
|
+
const e = w.new(f);
|
|
26
|
+
c.current = e, L(e, (v = o == null ? void 0 : o[0]) == null ? void 0 : v.format), e.setThemes([A.new(e)]);
|
|
27
27
|
const h = e.container.children.push(
|
|
28
|
-
|
|
28
|
+
S.new(e, {
|
|
29
29
|
layout: e.verticalLayout,
|
|
30
|
-
innerRadius:
|
|
30
|
+
innerRadius: l(50)
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
33
|
e.interfaceColors.setAll({
|
|
34
|
-
text:
|
|
35
|
-
grid:
|
|
36
|
-
stroke:
|
|
34
|
+
text: s(a.palette.text.primary),
|
|
35
|
+
grid: s(a.palette.divider),
|
|
36
|
+
stroke: s(a.palette.divider),
|
|
37
|
+
// Drives the gap color between slices; tie it to the surface so the
|
|
38
|
+
// beveled edges read correctly in both light and dark mode.
|
|
39
|
+
background: s(a.palette.background.paper)
|
|
37
40
|
});
|
|
38
41
|
const r = h.series.push(
|
|
39
|
-
|
|
42
|
+
B.new(e, {
|
|
40
43
|
valueField: o[0].dataFieldName,
|
|
41
44
|
categoryField: t[0].value
|
|
42
45
|
})
|
|
43
46
|
);
|
|
44
|
-
r.set("colors",
|
|
47
|
+
r.set("colors", I(e, d));
|
|
45
48
|
const g = "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})";
|
|
46
|
-
r.slices.template.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
r.slices.template.setAll({
|
|
50
|
+
tooltipText: g,
|
|
51
|
+
stroke: s(a.palette.background.paper),
|
|
52
|
+
strokeWidth: 2,
|
|
53
|
+
strokeOpacity: 1,
|
|
54
|
+
cornerRadius: 4
|
|
55
|
+
}), r.slices.template.states.create("hover", { scale: 1.04 }), r.set("radius", l(80)), r.labels.template.setAll({
|
|
56
|
+
text: g,
|
|
57
|
+
maxWidth: 140,
|
|
58
|
+
oversizedBehavior: "wrap"
|
|
59
|
+
}), t[0].type === "date" && n.forEach((Y) => {
|
|
60
|
+
let p = "YYYY";
|
|
61
|
+
t[0].value.includes("month") ? p = "MMM YYYY" : t[0].value.includes("day") && (p = "DD MMM YYYY"), Y[t[0].value] = b(Y[t[0].value]).format(
|
|
62
|
+
p
|
|
50
63
|
);
|
|
51
|
-
}), r.data.setAll(
|
|
52
|
-
|
|
53
|
-
centerX:
|
|
54
|
-
x:
|
|
64
|
+
}), r.data.setAll(n), h.children.push(
|
|
65
|
+
E.new(e, {
|
|
66
|
+
centerX: l(50),
|
|
67
|
+
x: l(50),
|
|
55
68
|
marginTop: 15,
|
|
56
69
|
marginBottom: 15
|
|
57
70
|
})
|
|
58
71
|
).data.setAll(r.dataItems), r.appear(1e3, 100);
|
|
59
72
|
}, T), () => {
|
|
60
73
|
var e;
|
|
61
|
-
|
|
74
|
+
m && clearTimeout(m), (e = c.current) == null || e.dispose(), c.current = null;
|
|
62
75
|
};
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
return { chartId: f, ownerState:
|
|
76
|
+
}, [n, t, o, a.palette.mode, d]);
|
|
77
|
+
const k = { ...u };
|
|
78
|
+
return { chartId: f, ownerState: k, sx: x, error: i, other: M };
|
|
66
79
|
};
|
|
67
80
|
export {
|
|
68
|
-
|
|
81
|
+
G as useDonutChartLogic
|
|
69
82
|
};
|