@ztwoint/z-ui 0.1.120 → 0.1.122
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/chart-card/builders/bar-chart-builder.d.ts +1 -1
- package/dist/components/chart-card/builders/bar-chart-builder.js +78 -31
- package/dist/components/chart-card/builders/chart-builder-factory.d.ts +1 -1
- package/dist/components/chart-card/builders/chart-builder-factory.js +15 -15
- package/dist/components/chart-card/builders/line-chart-builder.d.ts +1 -1
- package/dist/components/chart-card/builders/line-chart-builder.js +85 -38
- package/dist/components/chart-card/builders/pie-chart-builder.d.ts +1 -1
- package/dist/components/chart-card/builders/pie-chart-builder.js +37 -34
- package/dist/components/chart-card/chart-card.config.types.d.ts +27 -0
- package/dist/components/chart-card/chart-card.d.ts +1 -1
- package/dist/components/chart-card/chart-card.js +25 -23
- package/dist/components/chart-card/chart-card.types.d.ts +2 -0
- package/dist/components/chart-card/config/defaults.d.ts +28 -0
- package/dist/components/chart-card/config/defaults.js +105 -88
- package/dist/components/nav-header/nav-item/nav-item.d.ts +1 -0
- package/dist/components/nav-header/nav-item/nav-item.js +14 -14
- package/dist/types/components/chart-card/builders/bar-chart-builder.d.ts +1 -1
- package/dist/types/components/chart-card/builders/chart-builder-factory.d.ts +1 -1
- package/dist/types/components/chart-card/builders/line-chart-builder.d.ts +1 -1
- package/dist/types/components/chart-card/builders/pie-chart-builder.d.ts +1 -1
- package/dist/types/components/chart-card/chart-card.config.types.d.ts +27 -0
- package/dist/types/components/chart-card/chart-card.d.ts +1 -1
- package/dist/types/components/chart-card/chart-card.types.d.ts +2 -0
- package/dist/types/components/chart-card/config/defaults.d.ts +28 -0
- package/dist/types/components/nav-header/nav-item/nav-item.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import { BarChartConfig, ChartData } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildBarChartOptions(config: BarChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildBarChartOptions(config: BarChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -1,43 +1,90 @@
|
|
|
1
|
-
import { buildYAxisConfig as
|
|
2
|
-
import { getThemePalette as
|
|
3
|
-
function
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
import { buildYAxisConfig as B, buildXAxisConfig as T, buildGridConfig as I, buildLegendConfig as V, buildTooltipConfig as L, buildTitleConfig as P } from "../config/defaults.js";
|
|
2
|
+
import { getThemePalette as W } from "../config/colors.js";
|
|
3
|
+
function G(t, d, o, u) {
|
|
4
|
+
var h, f, m, g, v, x, C, S, y, w, A, k, D, M, z;
|
|
5
|
+
const a = W("bar", t.theme), r = d.series.map((H) => H.name), i = !!t.name, e = r.length > 1, n = ((f = (h = t.options) == null ? void 0 : h.legend) == null ? void 0 : f.position) ?? "top";
|
|
6
6
|
return {
|
|
7
|
-
color:
|
|
8
|
-
title:
|
|
9
|
-
tooltip:
|
|
10
|
-
legend:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
color: a,
|
|
8
|
+
title: i ? P(t.name, (m = t.options) == null ? void 0 : m.title) : void 0,
|
|
9
|
+
tooltip: L((g = t.options) == null ? void 0 : g.tooltip),
|
|
10
|
+
legend: e ? V(r, i, {
|
|
11
|
+
...(v = t.options) == null ? void 0 : v.legend,
|
|
12
|
+
scrollable: u || ((C = (x = t.options) == null ? void 0 : x.legend) == null ? void 0 : C.scrollable)
|
|
13
|
+
}) : void 0,
|
|
14
|
+
grid: I(i, e, n, (S = t.options) == null ? void 0 : S.grid),
|
|
15
|
+
xAxis: T(d.labels, !0, (y = t.options) == null ? void 0 : y.xAxis),
|
|
16
|
+
yAxis: B((w = t.options) == null ? void 0 : w.yAxis),
|
|
17
|
+
series: X(t, d),
|
|
18
|
+
animation: ((k = (A = t.options) == null ? void 0 : A.animation) == null ? void 0 : k.enabled) ?? !0,
|
|
19
|
+
animationDuration: ((M = (D = t.options) == null ? void 0 : D.animation) == null ? void 0 : M.duration) ?? 1e3,
|
|
20
|
+
...o ? Y((z = t.options) == null ? void 0 : z.scrollable) : {}
|
|
17
21
|
};
|
|
18
22
|
}
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
const
|
|
24
|
-
...
|
|
25
|
-
...
|
|
26
|
-
},
|
|
27
|
-
name:
|
|
23
|
+
function X(t, d) {
|
|
24
|
+
var i, e;
|
|
25
|
+
const u = t.theme === "stacked" && d.series.length > 1 ? "total" : void 0, a = ((i = t.options) == null ? void 0 : i.seriesStyles) ?? {}, r = ((e = t.options) == null ? void 0 : e.defaultSeriesStyle) ?? {};
|
|
26
|
+
return d.series.map((n) => {
|
|
27
|
+
const h = {
|
|
28
|
+
...r,
|
|
29
|
+
...a[n.name] ?? {}
|
|
30
|
+
}, f = h.barWidth ?? 40, m = {
|
|
31
|
+
name: n.name,
|
|
28
32
|
type: "bar",
|
|
29
|
-
stack:
|
|
33
|
+
stack: u,
|
|
30
34
|
emphasis: {
|
|
31
35
|
focus: "series"
|
|
32
36
|
},
|
|
33
|
-
barMaxWidth:
|
|
34
|
-
data:
|
|
37
|
+
barMaxWidth: f,
|
|
38
|
+
data: n.values
|
|
35
39
|
};
|
|
36
|
-
return
|
|
37
|
-
color:
|
|
38
|
-
}),
|
|
40
|
+
return h.color && (m.itemStyle = {
|
|
41
|
+
color: h.color
|
|
42
|
+
}), m;
|
|
39
43
|
});
|
|
40
44
|
}
|
|
45
|
+
function Y(t) {
|
|
46
|
+
const d = [], o = (t == null ? void 0 : t.type) ?? "both", u = (t == null ? void 0 : t.start) ?? 0, a = (t == null ? void 0 : t.end) ?? 20, r = (t == null ? void 0 : t.height) ?? 20, i = (t == null ? void 0 : t.width) ?? 20, e = (t == null ? void 0 : t.position) ?? "bottom", n = (t == null ? void 0 : t.showDetail) ?? !1, h = (t == null ? void 0 : t.showDataShadow) ?? !1, f = (t == null ? void 0 : t.realtime) ?? !0, m = (t == null ? void 0 : t.filterMode) ?? "filter", g = (t == null ? void 0 : t.xAxisIndex) ?? [0];
|
|
47
|
+
return (o === "slider" || o === "both") && d.push({
|
|
48
|
+
type: "slider",
|
|
49
|
+
show: !0,
|
|
50
|
+
xAxisIndex: g,
|
|
51
|
+
start: u,
|
|
52
|
+
end: a,
|
|
53
|
+
height: e === "bottom" ? r : void 0,
|
|
54
|
+
width: e === "right" ? i : void 0,
|
|
55
|
+
bottom: e === "bottom" ? 10 : void 0,
|
|
56
|
+
top: e === "top" ? 10 : void 0,
|
|
57
|
+
right: e === "right" ? 10 : void 0,
|
|
58
|
+
left: e === "left" ? 10 : void 0,
|
|
59
|
+
showDetail: n,
|
|
60
|
+
showDataShadow: h,
|
|
61
|
+
realtime: f,
|
|
62
|
+
filterMode: m,
|
|
63
|
+
handleIcon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
|
|
64
|
+
handleSize: "80%",
|
|
65
|
+
handleStyle: {
|
|
66
|
+
color: "#fff",
|
|
67
|
+
shadowBlur: 3,
|
|
68
|
+
shadowColor: "rgba(0, 0, 0, 0.6)",
|
|
69
|
+
shadowOffsetX: 2,
|
|
70
|
+
shadowOffsetY: 2
|
|
71
|
+
},
|
|
72
|
+
textStyle: {
|
|
73
|
+
color: "#333"
|
|
74
|
+
},
|
|
75
|
+
borderColor: "#90979c",
|
|
76
|
+
fillerColor: "rgba(144, 151, 156, 0.2)",
|
|
77
|
+
backgroundColor: "rgba(17, 17, 17, 0.1)",
|
|
78
|
+
selectedDataBackgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
79
|
+
moveHandleColor: "#fff",
|
|
80
|
+
moveHandleSize: 7
|
|
81
|
+
}), (o === "inside" || o === "both") && d.push({
|
|
82
|
+
type: "inside",
|
|
83
|
+
xAxisIndex: g,
|
|
84
|
+
start: u,
|
|
85
|
+
end: a
|
|
86
|
+
}), { dataZoom: d };
|
|
87
|
+
}
|
|
41
88
|
export {
|
|
42
|
-
|
|
89
|
+
G as buildBarChartOptions
|
|
43
90
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import { ChartConfig, ChartData, ChartType } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildChartOptions(config: ChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildChartOptions(config: ChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
4
4
|
export declare function isChartTypeSupported(type: string): type is ChartType;
|
|
5
5
|
export declare const registeredChartTypes: readonly ChartType[];
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { buildBarChartOptions as
|
|
2
|
-
import { buildLineChartOptions as
|
|
3
|
-
import { buildPieChartOptions as
|
|
4
|
-
const
|
|
5
|
-
line:
|
|
6
|
-
bar:
|
|
7
|
-
pie:
|
|
1
|
+
import { buildBarChartOptions as p } from "./bar-chart-builder.js";
|
|
2
|
+
import { buildLineChartOptions as n } from "./line-chart-builder.js";
|
|
3
|
+
import { buildPieChartOptions as a } from "./pie-chart-builder.js";
|
|
4
|
+
const s = {
|
|
5
|
+
line: n,
|
|
6
|
+
bar: p,
|
|
7
|
+
pie: a
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
const t =
|
|
9
|
+
function h(r, i, e, o) {
|
|
10
|
+
const t = s[r.type];
|
|
11
11
|
if (!t)
|
|
12
12
|
throw new Error(`Unsupported chart type: ${r.type}`);
|
|
13
|
-
return t(r, i);
|
|
13
|
+
return t(r, i, e, o);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function l(r) {
|
|
16
16
|
return r === "line" || r === "bar" || r === "pie";
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const m = ["line", "bar", "pie"];
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
h as buildChartOptions,
|
|
21
|
+
l as isChartTypeSupported,
|
|
22
|
+
m as registeredChartTypes
|
|
23
23
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import { ChartData, LineChartConfig } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildLineChartOptions(config: LineChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildLineChartOptions(config: LineChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -1,53 +1,100 @@
|
|
|
1
|
-
import { buildYAxisConfig as
|
|
2
|
-
import { getThemePalette as
|
|
3
|
-
function
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
import { buildYAxisConfig as B, buildXAxisConfig as I, buildGridConfig as L, buildLegendConfig as V, buildTooltipConfig as k, buildTitleConfig as P } from "../config/defaults.js";
|
|
2
|
+
import { getThemePalette as W } from "../config/colors.js";
|
|
3
|
+
function G(t, o, d, y) {
|
|
4
|
+
var S, r, u, g, n, w, v, x, C, A, s, z, D, H, M;
|
|
5
|
+
const f = W("line", t.theme), m = o.series.map((T) => T.name), h = !!t.name, e = m.length > 1, i = ((r = (S = t.options) == null ? void 0 : S.legend) == null ? void 0 : r.position) ?? "top";
|
|
6
6
|
return {
|
|
7
|
-
color:
|
|
8
|
-
title:
|
|
9
|
-
tooltip:
|
|
10
|
-
legend:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
color: f,
|
|
8
|
+
title: h ? P(t.name, (u = t.options) == null ? void 0 : u.title) : void 0,
|
|
9
|
+
tooltip: k((g = t.options) == null ? void 0 : g.tooltip),
|
|
10
|
+
legend: e ? V(m, h, {
|
|
11
|
+
...(n = t.options) == null ? void 0 : n.legend,
|
|
12
|
+
scrollable: y || ((v = (w = t.options) == null ? void 0 : w.legend) == null ? void 0 : v.scrollable)
|
|
13
|
+
}) : void 0,
|
|
14
|
+
grid: L(h, e, i, (x = t.options) == null ? void 0 : x.grid),
|
|
15
|
+
xAxis: I(o.labels, !1, (C = t.options) == null ? void 0 : C.xAxis),
|
|
16
|
+
yAxis: B((A = t.options) == null ? void 0 : A.yAxis),
|
|
17
|
+
series: X(t, o),
|
|
18
|
+
animation: ((z = (s = t.options) == null ? void 0 : s.animation) == null ? void 0 : z.enabled) ?? !0,
|
|
19
|
+
animationDuration: ((H = (D = t.options) == null ? void 0 : D.animation) == null ? void 0 : H.duration) ?? 1e3,
|
|
20
|
+
...d ? Y((M = t.options) == null ? void 0 : M.scrollable) : {}
|
|
17
21
|
};
|
|
18
22
|
}
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
const
|
|
24
|
-
...
|
|
25
|
-
...
|
|
26
|
-
},
|
|
27
|
-
name:
|
|
23
|
+
function X(t, o) {
|
|
24
|
+
var m, h;
|
|
25
|
+
const d = t.theme === "smooth", y = ((m = t.options) == null ? void 0 : m.seriesStyles) ?? {}, f = ((h = t.options) == null ? void 0 : h.defaultSeriesStyle) ?? {};
|
|
26
|
+
return o.series.map((e) => {
|
|
27
|
+
const i = {
|
|
28
|
+
...f,
|
|
29
|
+
...y[e.name] ?? {}
|
|
30
|
+
}, a = i.smooth ?? d, S = i.lineWidth ?? 2, r = i.pointSize ?? (o.labels.length <= 12 ? 4 : 0), u = i.areaStyle ?? !1, g = i.opacity ?? 0.15, n = {
|
|
31
|
+
name: e.name,
|
|
28
32
|
type: "line",
|
|
29
|
-
smooth:
|
|
33
|
+
smooth: a,
|
|
30
34
|
symbol: "circle",
|
|
31
|
-
symbolSize:
|
|
32
|
-
showSymbol:
|
|
35
|
+
symbolSize: r,
|
|
36
|
+
showSymbol: o.labels.length <= 12,
|
|
33
37
|
emphasis: {
|
|
34
38
|
focus: "series"
|
|
35
39
|
},
|
|
36
40
|
lineStyle: {
|
|
37
|
-
width:
|
|
41
|
+
width: S
|
|
38
42
|
},
|
|
39
|
-
data:
|
|
43
|
+
data: e.values
|
|
40
44
|
};
|
|
41
|
-
return
|
|
42
|
-
color:
|
|
43
|
-
},
|
|
44
|
-
...
|
|
45
|
-
color:
|
|
46
|
-
}), u && (
|
|
47
|
-
opacity:
|
|
48
|
-
}),
|
|
45
|
+
return i.color && (n.itemStyle = {
|
|
46
|
+
color: i.color
|
|
47
|
+
}, n.lineStyle = {
|
|
48
|
+
...n.lineStyle,
|
|
49
|
+
color: i.color
|
|
50
|
+
}), u && (n.areaStyle = {
|
|
51
|
+
opacity: g
|
|
52
|
+
}), n;
|
|
49
53
|
});
|
|
50
54
|
}
|
|
55
|
+
function Y(t) {
|
|
56
|
+
const o = [], d = (t == null ? void 0 : t.type) ?? "both", y = (t == null ? void 0 : t.start) ?? 0, f = (t == null ? void 0 : t.end) ?? 20, m = (t == null ? void 0 : t.height) ?? 20, h = (t == null ? void 0 : t.width) ?? 20, e = (t == null ? void 0 : t.position) ?? "bottom", i = (t == null ? void 0 : t.showDetail) ?? !1, a = (t == null ? void 0 : t.showDataShadow) ?? !1, S = (t == null ? void 0 : t.realtime) ?? !0, r = (t == null ? void 0 : t.filterMode) ?? "filter", u = (t == null ? void 0 : t.xAxisIndex) ?? [0];
|
|
57
|
+
return (d === "slider" || d === "both") && o.push({
|
|
58
|
+
type: "slider",
|
|
59
|
+
show: !0,
|
|
60
|
+
xAxisIndex: u,
|
|
61
|
+
start: y,
|
|
62
|
+
end: f,
|
|
63
|
+
height: e === "bottom" ? m : void 0,
|
|
64
|
+
width: e === "right" ? h : void 0,
|
|
65
|
+
bottom: e === "bottom" ? 10 : void 0,
|
|
66
|
+
top: e === "top" ? 10 : void 0,
|
|
67
|
+
right: e === "right" ? 10 : void 0,
|
|
68
|
+
left: e === "left" ? 10 : void 0,
|
|
69
|
+
showDetail: i,
|
|
70
|
+
showDataShadow: a,
|
|
71
|
+
realtime: S,
|
|
72
|
+
filterMode: r,
|
|
73
|
+
handleIcon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
|
|
74
|
+
handleSize: "80%",
|
|
75
|
+
handleStyle: {
|
|
76
|
+
color: "#fff",
|
|
77
|
+
shadowBlur: 3,
|
|
78
|
+
shadowColor: "rgba(0, 0, 0, 0.6)",
|
|
79
|
+
shadowOffsetX: 2,
|
|
80
|
+
shadowOffsetY: 2
|
|
81
|
+
},
|
|
82
|
+
textStyle: {
|
|
83
|
+
color: "#333"
|
|
84
|
+
},
|
|
85
|
+
borderColor: "#90979c",
|
|
86
|
+
fillerColor: "rgba(144, 151, 156, 0.2)",
|
|
87
|
+
backgroundColor: "rgba(17, 17, 17, 0.1)",
|
|
88
|
+
selectedDataBackgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
89
|
+
moveHandleColor: "#fff",
|
|
90
|
+
moveHandleSize: 7
|
|
91
|
+
}), (d === "inside" || d === "both") && o.push({
|
|
92
|
+
type: "inside",
|
|
93
|
+
xAxisIndex: u,
|
|
94
|
+
start: y,
|
|
95
|
+
end: f
|
|
96
|
+
}), { dataZoom: o };
|
|
97
|
+
}
|
|
51
98
|
export {
|
|
52
|
-
|
|
99
|
+
G as buildLineChartOptions
|
|
53
100
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import { ChartData, PieChartConfig } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildPieChartOptions(config: PieChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildPieChartOptions(config: PieChartConfig, data: ChartData, _scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { buildLegendConfig as O, buildTooltipConfig as P, buildTitleConfig as T } from "../config/defaults.js";
|
|
2
2
|
import { getThemePalette as D } from "../config/colors.js";
|
|
3
|
-
function j(e,
|
|
4
|
-
var
|
|
5
|
-
const
|
|
3
|
+
function j(e, s, w, u) {
|
|
4
|
+
var p, l, c, b, h, o, a, r, d;
|
|
5
|
+
const m = D("pie", e.theme), t = s.series.map((f) => f.name), n = !!e.name, S = t.length > 1;
|
|
6
6
|
return {
|
|
7
|
-
color:
|
|
8
|
-
title:
|
|
9
|
-
tooltip: P({ ...(
|
|
10
|
-
legend:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
color: m,
|
|
8
|
+
title: n ? T(e.name, (p = e.options) == null ? void 0 : p.title) : void 0,
|
|
9
|
+
tooltip: P({ ...(l = e.options) == null ? void 0 : l.tooltip, trigger: "item" }),
|
|
10
|
+
legend: S ? O(t, n, {
|
|
11
|
+
...(c = e.options) == null ? void 0 : c.legend,
|
|
12
|
+
scrollable: u || ((h = (b = e.options) == null ? void 0 : b.legend) == null ? void 0 : h.scrollable)
|
|
13
|
+
}) : void 0,
|
|
14
|
+
series: v(e, s),
|
|
15
|
+
animation: ((a = (o = e.options) == null ? void 0 : o.animation) == null ? void 0 : a.enabled) ?? !0,
|
|
16
|
+
animationDuration: ((d = (r = e.options) == null ? void 0 : r.animation) == null ? void 0 : d.duration) ?? 1e3
|
|
14
17
|
};
|
|
15
18
|
}
|
|
16
|
-
function v(e,
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
name:
|
|
20
|
-
value:
|
|
21
|
-
}))) ?? [],
|
|
22
|
-
name: ((R =
|
|
19
|
+
function v(e, s) {
|
|
20
|
+
var r, d, f, g, R;
|
|
21
|
+
const w = e.theme === "donut", u = ((r = e.options) == null ? void 0 : r.seriesStyles) ?? {}, m = ((d = e.options) == null ? void 0 : d.defaultSeriesStyle) ?? {}, t = ((f = e.options) == null ? void 0 : f.pie) ?? {}, n = ((g = s.series[0]) == null ? void 0 : g.values.map((y, i) => ({
|
|
22
|
+
name: s.labels[i],
|
|
23
|
+
value: y
|
|
24
|
+
}))) ?? [], S = w ? ["40%", "70%"] : ["0%", "70%"], L = t.radius ?? S, p = t.center ?? ["50%", "50%"], l = t.labelPosition ?? "outside", c = t.labelRotate ?? !1, b = t.showLabel ?? !0, h = t.showLabelLine ?? !0, o = {
|
|
25
|
+
name: ((R = s.series[0]) == null ? void 0 : R.name) ?? "Data",
|
|
23
26
|
type: "pie",
|
|
24
|
-
radius:
|
|
25
|
-
center:
|
|
26
|
-
data:
|
|
27
|
+
radius: L,
|
|
28
|
+
center: p,
|
|
29
|
+
data: n,
|
|
27
30
|
emphasis: {
|
|
28
31
|
focus: "self",
|
|
29
32
|
itemStyle: {
|
|
@@ -33,15 +36,15 @@ function v(e, o) {
|
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
label: {
|
|
36
|
-
show:
|
|
37
|
-
position:
|
|
38
|
-
rotate:
|
|
39
|
+
show: b,
|
|
40
|
+
position: l,
|
|
41
|
+
rotate: c,
|
|
39
42
|
formatter: "{b}: {c} ({d}%)",
|
|
40
43
|
fontSize: 12,
|
|
41
44
|
fontFamily: "Inter Variable, sans-serif"
|
|
42
45
|
},
|
|
43
46
|
labelLine: {
|
|
44
|
-
show:
|
|
47
|
+
show: h && l === "outside",
|
|
45
48
|
length: 10,
|
|
46
49
|
length2: 5
|
|
47
50
|
},
|
|
@@ -50,21 +53,21 @@ function v(e, o) {
|
|
|
50
53
|
borderWidth: 2
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
|
-
if (Object.keys(
|
|
54
|
-
const
|
|
55
|
-
...
|
|
56
|
-
...
|
|
56
|
+
if (Object.keys(u).length > 0) {
|
|
57
|
+
const y = n.map((i) => ({
|
|
58
|
+
...m,
|
|
59
|
+
...u[i.name] ?? {}
|
|
57
60
|
}).color).filter(Boolean);
|
|
58
|
-
if (
|
|
61
|
+
if (y.length > 0) {
|
|
59
62
|
const i = D("pie", e.theme);
|
|
60
|
-
|
|
61
|
-
...
|
|
62
|
-
color: (
|
|
63
|
+
o.itemStyle = {
|
|
64
|
+
...o.itemStyle,
|
|
65
|
+
color: (C) => y[C.dataIndex] || i[C.dataIndex % i.length]
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
|
-
const
|
|
67
|
-
return
|
|
69
|
+
const a = m.pieRadius;
|
|
70
|
+
return a && (o.radius = a), [o];
|
|
68
71
|
}
|
|
69
72
|
export {
|
|
70
73
|
j as buildPieChartOptions
|
|
@@ -29,6 +29,18 @@ export interface ChartOptions {
|
|
|
29
29
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
30
30
|
align?: 'left' | 'center' | 'right';
|
|
31
31
|
orient?: 'horizontal' | 'vertical';
|
|
32
|
+
scrollable?: boolean;
|
|
33
|
+
pageButtonItemGap?: number;
|
|
34
|
+
pageButtonGap?: number;
|
|
35
|
+
pageButtonPosition?: 'start' | 'end';
|
|
36
|
+
pageFormatter?: string;
|
|
37
|
+
pageIconColor?: string;
|
|
38
|
+
pageIconInactiveColor?: string;
|
|
39
|
+
pageIconSize?: number;
|
|
40
|
+
pageTextStyle?: {
|
|
41
|
+
color?: string;
|
|
42
|
+
fontSize?: number;
|
|
43
|
+
};
|
|
32
44
|
};
|
|
33
45
|
tooltip?: {
|
|
34
46
|
show?: boolean;
|
|
@@ -67,6 +79,21 @@ export interface ChartOptions {
|
|
|
67
79
|
showLabel?: boolean;
|
|
68
80
|
showLabelLine?: boolean;
|
|
69
81
|
};
|
|
82
|
+
scrollable?: {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
type?: 'slider' | 'inside' | 'both';
|
|
85
|
+
start?: number;
|
|
86
|
+
end?: number;
|
|
87
|
+
height?: number;
|
|
88
|
+
width?: number;
|
|
89
|
+
position?: 'bottom' | 'top' | 'left' | 'right';
|
|
90
|
+
showDetail?: boolean;
|
|
91
|
+
showDataShadow?: boolean;
|
|
92
|
+
realtime?: boolean;
|
|
93
|
+
filterMode?: 'filter' | 'empty' | 'none';
|
|
94
|
+
xAxisIndex?: number[];
|
|
95
|
+
yAxisIndex?: number[];
|
|
96
|
+
};
|
|
70
97
|
}
|
|
71
98
|
interface BaseChartConfig {
|
|
72
99
|
name: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ChartCardProps } from './chart-card.types';
|
|
2
|
-
export declare function ChartCard({ config, data, loading, error, className, style, chartProps, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ChartCard({ config, data, loading, error, className, style, chartProps, scrollable, scrollableLegend, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { validateChartConfig as
|
|
5
|
-
import { buildChartOptions as
|
|
6
|
-
import { Chart as
|
|
7
|
-
import { LoadingState as
|
|
8
|
-
function
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { cn as w } from "../../lib/utils.js";
|
|
4
|
+
import { validateChartConfig as S, validateChartData as E } from "./validators/config-validator.js";
|
|
5
|
+
import { buildChartOptions as O } from "./builders/chart-builder-factory.js";
|
|
6
|
+
import { Chart as R } from "../chart/chart.js";
|
|
7
|
+
import { LoadingState as V, ErrorState as l, EmptyState as $ } from "./chart-card-states.js";
|
|
8
|
+
function D({
|
|
9
9
|
config: t,
|
|
10
10
|
data: n,
|
|
11
11
|
loading: u = !1,
|
|
12
12
|
error: m,
|
|
13
13
|
className: f,
|
|
14
14
|
style: g,
|
|
15
|
-
chartProps: e
|
|
15
|
+
chartProps: e,
|
|
16
|
+
scrollable: b = !1,
|
|
17
|
+
scrollableLegend: c = !1
|
|
16
18
|
}) {
|
|
17
|
-
const r = t.height ?? 400,
|
|
19
|
+
const r = t.height ?? 400, y = p.useMemo(() => {
|
|
18
20
|
if (!e)
|
|
19
21
|
return {};
|
|
20
|
-
const { className: s, style: i, ...
|
|
21
|
-
return
|
|
22
|
-
}, [e]),
|
|
22
|
+
const { className: s, style: i, ...v } = e;
|
|
23
|
+
return v;
|
|
24
|
+
}, [e]), C = e == null ? void 0 : e.className, N = e == null ? void 0 : e.style;
|
|
23
25
|
if (u)
|
|
24
|
-
return /* @__PURE__ */ a(
|
|
26
|
+
return /* @__PURE__ */ a(V, { height: r });
|
|
25
27
|
if (m)
|
|
26
28
|
return /* @__PURE__ */ a(l, { height: r, message: m });
|
|
27
|
-
const o =
|
|
29
|
+
const o = S(t);
|
|
28
30
|
if (!o.valid)
|
|
29
31
|
return /* @__PURE__ */ a(l, { height: r, message: o.error || "Invalid configuration" });
|
|
30
|
-
const d =
|
|
32
|
+
const d = E(n);
|
|
31
33
|
if (!d.valid)
|
|
32
34
|
return /* @__PURE__ */ a(l, { height: r, message: d.error ?? "Invalid data" });
|
|
33
35
|
if (!n.series.some(
|
|
34
36
|
(s) => s.values.some((i) => typeof i == "number" && !Number.isNaN(i) && i !== 0)
|
|
35
37
|
))
|
|
36
|
-
return /* @__PURE__ */ a(
|
|
38
|
+
return /* @__PURE__ */ a($, { height: r });
|
|
37
39
|
let h;
|
|
38
40
|
try {
|
|
39
|
-
h =
|
|
41
|
+
h = O(t, n, b, c);
|
|
40
42
|
} catch (s) {
|
|
41
43
|
const i = s instanceof Error ? s.message : "Failed to build chart";
|
|
42
44
|
return /* @__PURE__ */ a(l, { height: r, message: i });
|
|
@@ -44,7 +46,7 @@ function j({
|
|
|
44
46
|
return /* @__PURE__ */ a(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
|
-
className:
|
|
49
|
+
className: w(
|
|
48
50
|
"w-full rounded-lg bg-background-neutral-default border border-neutral-150 p-4",
|
|
49
51
|
f
|
|
50
52
|
),
|
|
@@ -52,21 +54,21 @@ function j({
|
|
|
52
54
|
role: "img",
|
|
53
55
|
"aria-label": t.ariaLabel || `${t.type} chart${t.name ? `: ${t.name}` : ""}`,
|
|
54
56
|
children: /* @__PURE__ */ a(
|
|
55
|
-
|
|
57
|
+
R,
|
|
56
58
|
{
|
|
57
59
|
option: h,
|
|
58
|
-
className:
|
|
60
|
+
className: C,
|
|
59
61
|
style: {
|
|
60
62
|
height: r,
|
|
61
63
|
width: t.width || "100%",
|
|
62
|
-
...
|
|
64
|
+
...N
|
|
63
65
|
},
|
|
64
|
-
...
|
|
66
|
+
...y
|
|
65
67
|
}
|
|
66
68
|
)
|
|
67
69
|
}
|
|
68
70
|
);
|
|
69
71
|
}
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
D as ChartCard
|
|
72
74
|
};
|
|
@@ -44,6 +44,34 @@ export declare function buildLegendConfig(data: string[], hasTitle?: boolean, op
|
|
|
44
44
|
};
|
|
45
45
|
itemWidth: number;
|
|
46
46
|
itemHeight: number;
|
|
47
|
+
} | {
|
|
48
|
+
type: string;
|
|
49
|
+
pageButtonItemGap: number;
|
|
50
|
+
pageButtonGap: number;
|
|
51
|
+
pageButtonPosition: "end" | "start";
|
|
52
|
+
pageFormatter: string;
|
|
53
|
+
pageIconColor: string;
|
|
54
|
+
pageIconInactiveColor: string;
|
|
55
|
+
pageIconSize: number;
|
|
56
|
+
pageTextStyle: {
|
|
57
|
+
color: string;
|
|
58
|
+
fontSize: number;
|
|
59
|
+
};
|
|
60
|
+
data: string[];
|
|
61
|
+
top: string | number;
|
|
62
|
+
bottom: string | number | undefined;
|
|
63
|
+
left: string | number;
|
|
64
|
+
right: string | number | undefined;
|
|
65
|
+
orient: "horizontal" | "vertical";
|
|
66
|
+
itemGap: number;
|
|
67
|
+
padding: number[];
|
|
68
|
+
textStyle: {
|
|
69
|
+
fontSize: number;
|
|
70
|
+
fontFamily: string;
|
|
71
|
+
color: "#000000";
|
|
72
|
+
};
|
|
73
|
+
itemWidth: number;
|
|
74
|
+
itemHeight: number;
|
|
47
75
|
} | undefined;
|
|
48
76
|
export declare function buildAxisLabelConfig(rotate?: number): {
|
|
49
77
|
rotate?: number | undefined;
|
|
@@ -1,156 +1,173 @@
|
|
|
1
|
-
import { UI_COLORS as
|
|
2
|
-
const
|
|
3
|
-
fontFamily:
|
|
4
|
-
color:
|
|
1
|
+
import { UI_COLORS as c } from "./colors.js";
|
|
2
|
+
const S = "Inter Variable, sans-serif", d = {
|
|
3
|
+
fontFamily: S,
|
|
4
|
+
color: c.text.primary
|
|
5
5
|
};
|
|
6
|
-
function
|
|
7
|
-
if ((
|
|
6
|
+
function T(a, r) {
|
|
7
|
+
if ((r == null ? void 0 : r.show) === !1)
|
|
8
8
|
return;
|
|
9
|
-
const
|
|
9
|
+
const e = (r == null ? void 0 : r.position) ?? "left", l = (r == null ? void 0 : r.fontSize) ?? 16, f = (r == null ? void 0 : r.color) ?? c.text.primary;
|
|
10
10
|
return {
|
|
11
|
-
text:
|
|
11
|
+
text: a,
|
|
12
12
|
textStyle: {
|
|
13
|
-
fontFamily:
|
|
14
|
-
fontSize:
|
|
13
|
+
fontFamily: S,
|
|
14
|
+
fontSize: l,
|
|
15
15
|
fontWeight: 500,
|
|
16
16
|
color: f
|
|
17
17
|
},
|
|
18
|
-
left:
|
|
18
|
+
left: e,
|
|
19
19
|
top: 12,
|
|
20
20
|
padding: [0, 0, 8, 0]
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return (
|
|
25
|
-
trigger: (
|
|
26
|
-
backgroundColor:
|
|
27
|
-
borderColor:
|
|
23
|
+
function z(a) {
|
|
24
|
+
return (a == null ? void 0 : a.show) === !1 ? void 0 : {
|
|
25
|
+
trigger: (a == null ? void 0 : a.trigger) ?? "axis",
|
|
26
|
+
backgroundColor: c.background.default,
|
|
27
|
+
borderColor: c.border.default,
|
|
28
28
|
borderWidth: 1,
|
|
29
29
|
textStyle: {
|
|
30
|
-
...
|
|
30
|
+
...d
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
34
|
+
function F(a, r = !1, e) {
|
|
35
|
+
var y, h;
|
|
36
|
+
if ((e == null ? void 0 : e.show) === !1)
|
|
36
37
|
return;
|
|
37
|
-
const
|
|
38
|
-
let u =
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const l = (e == null ? void 0 : e.position) ?? "top", f = (e == null ? void 0 : e.orient) ?? "horizontal", m = (e == null ? void 0 : e.scrollable) ?? !1;
|
|
39
|
+
let u = r ? 48 : 16, g, b = "center", x;
|
|
40
|
+
l === "bottom" ? (u = "auto", g = 10) : l === "left" ? (u = "middle", b = 10) : l === "right" && (u = "middle", b = "auto", x = 10);
|
|
41
|
+
const t = {
|
|
42
|
+
data: a,
|
|
41
43
|
top: u,
|
|
42
|
-
bottom:
|
|
43
|
-
left:
|
|
44
|
-
right:
|
|
44
|
+
bottom: g,
|
|
45
|
+
left: b,
|
|
46
|
+
right: x,
|
|
45
47
|
orient: f,
|
|
46
48
|
itemGap: 20,
|
|
47
49
|
padding: [8, 0, 12, 0],
|
|
48
50
|
textStyle: {
|
|
49
|
-
...
|
|
51
|
+
...d,
|
|
50
52
|
fontSize: 12
|
|
51
53
|
},
|
|
52
54
|
itemWidth: 25,
|
|
53
55
|
itemHeight: 14
|
|
54
56
|
};
|
|
57
|
+
return m ? {
|
|
58
|
+
...t,
|
|
59
|
+
type: "scroll",
|
|
60
|
+
pageButtonItemGap: (e == null ? void 0 : e.pageButtonItemGap) ?? 5,
|
|
61
|
+
pageButtonGap: (e == null ? void 0 : e.pageButtonGap) ?? 10,
|
|
62
|
+
pageButtonPosition: (e == null ? void 0 : e.pageButtonPosition) ?? "end",
|
|
63
|
+
pageFormatter: (e == null ? void 0 : e.pageFormatter) ?? "{current}/{total}",
|
|
64
|
+
pageIconColor: (e == null ? void 0 : e.pageIconColor) ?? "#2f4554",
|
|
65
|
+
pageIconInactiveColor: (e == null ? void 0 : e.pageIconInactiveColor) ?? "#aaa",
|
|
66
|
+
pageIconSize: (e == null ? void 0 : e.pageIconSize) ?? 12,
|
|
67
|
+
pageTextStyle: {
|
|
68
|
+
color: ((y = e == null ? void 0 : e.pageTextStyle) == null ? void 0 : y.color) ?? "#333",
|
|
69
|
+
fontSize: ((h = e == null ? void 0 : e.pageTextStyle) == null ? void 0 : h.fontSize) ?? 12
|
|
70
|
+
}
|
|
71
|
+
} : t;
|
|
55
72
|
}
|
|
56
|
-
function
|
|
73
|
+
function L(a) {
|
|
57
74
|
return {
|
|
58
|
-
color:
|
|
59
|
-
fontFamily:
|
|
75
|
+
color: c.text.secondary,
|
|
76
|
+
fontFamily: S,
|
|
60
77
|
fontSize: 11,
|
|
61
|
-
...
|
|
78
|
+
...a && { rotate: a }
|
|
62
79
|
};
|
|
63
80
|
}
|
|
64
|
-
function
|
|
81
|
+
function C(a = !0) {
|
|
65
82
|
return {
|
|
66
|
-
show:
|
|
83
|
+
show: a,
|
|
67
84
|
lineStyle: {
|
|
68
|
-
color:
|
|
85
|
+
color: c.border.default
|
|
69
86
|
}
|
|
70
87
|
};
|
|
71
88
|
}
|
|
72
|
-
function
|
|
89
|
+
function I(a = !0) {
|
|
73
90
|
return {
|
|
74
|
-
show:
|
|
91
|
+
show: a,
|
|
75
92
|
lineStyle: {
|
|
76
|
-
color:
|
|
93
|
+
color: c.border.light
|
|
77
94
|
}
|
|
78
95
|
};
|
|
79
96
|
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
97
|
+
function w(a, r = !1, e = "top", l) {
|
|
98
|
+
if (l)
|
|
82
99
|
return {
|
|
83
|
-
left:
|
|
84
|
-
right:
|
|
85
|
-
bottom:
|
|
86
|
-
top:
|
|
100
|
+
left: l.left ?? "3%",
|
|
101
|
+
right: l.right ?? "4%",
|
|
102
|
+
bottom: l.bottom ?? "3%",
|
|
103
|
+
top: l.top ?? 20,
|
|
87
104
|
containLabel: !0
|
|
88
105
|
};
|
|
89
106
|
let f = 20;
|
|
90
|
-
|
|
107
|
+
a && (f += 48), r && e === "top" && (f += 40);
|
|
108
|
+
let m = "3%";
|
|
109
|
+
r && e === "bottom" && (m = 60);
|
|
91
110
|
let u = "3%";
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
right: d,
|
|
99
|
-
bottom: u,
|
|
111
|
+
r && e === "left" && (u = 100);
|
|
112
|
+
let g = "4%";
|
|
113
|
+
return r && e === "right" && (g = 100), {
|
|
114
|
+
left: u,
|
|
115
|
+
right: g,
|
|
116
|
+
bottom: m,
|
|
100
117
|
top: f,
|
|
101
118
|
containLabel: !0
|
|
102
119
|
};
|
|
103
120
|
}
|
|
104
|
-
function
|
|
105
|
-
return (
|
|
121
|
+
function A(a, r = !0, e) {
|
|
122
|
+
return (e == null ? void 0 : e.show) === !1 ? { show: !1 } : {
|
|
106
123
|
type: "category",
|
|
107
|
-
data:
|
|
108
|
-
boundaryGap:
|
|
109
|
-
name:
|
|
110
|
-
nameLocation: (
|
|
111
|
-
nameGap:
|
|
112
|
-
nameTextStyle:
|
|
113
|
-
...
|
|
124
|
+
data: a,
|
|
125
|
+
boundaryGap: r,
|
|
126
|
+
name: e == null ? void 0 : e.name,
|
|
127
|
+
nameLocation: (e == null ? void 0 : e.nameLocation) ?? "middle",
|
|
128
|
+
nameGap: e != null && e.name ? 30 : void 0,
|
|
129
|
+
nameTextStyle: e != null && e.name ? {
|
|
130
|
+
...d,
|
|
114
131
|
fontSize: 12,
|
|
115
132
|
fontWeight: 500
|
|
116
133
|
} : void 0,
|
|
117
|
-
axisLine:
|
|
118
|
-
axisLabel:
|
|
119
|
-
splitLine:
|
|
134
|
+
axisLine: C(),
|
|
135
|
+
axisLabel: L(e == null ? void 0 : e.labelRotate),
|
|
136
|
+
splitLine: I((e == null ? void 0 : e.gridLines) ?? !1)
|
|
120
137
|
};
|
|
121
138
|
}
|
|
122
|
-
function
|
|
123
|
-
if ((
|
|
139
|
+
function B(a) {
|
|
140
|
+
if ((a == null ? void 0 : a.show) === !1)
|
|
124
141
|
return { show: !1 };
|
|
125
|
-
const
|
|
142
|
+
const r = (a == null ? void 0 : a.min) === "auto" || a == null ? void 0 : a.min, e = (a == null ? void 0 : a.max) === "auto" || a == null ? void 0 : a.max;
|
|
126
143
|
return {
|
|
127
144
|
type: "value",
|
|
128
|
-
name:
|
|
129
|
-
nameLocation: (
|
|
130
|
-
nameGap:
|
|
145
|
+
name: a == null ? void 0 : a.name,
|
|
146
|
+
nameLocation: (a == null ? void 0 : a.nameLocation) ?? "middle",
|
|
147
|
+
nameGap: a != null && a.name ? 50 : void 0,
|
|
131
148
|
nameRotate: 90,
|
|
132
|
-
nameTextStyle:
|
|
133
|
-
...
|
|
149
|
+
nameTextStyle: a != null && a.name ? {
|
|
150
|
+
...d,
|
|
134
151
|
fontSize: 12,
|
|
135
152
|
fontWeight: 500
|
|
136
153
|
} : void 0,
|
|
137
|
-
min:
|
|
138
|
-
max:
|
|
139
|
-
axisLine:
|
|
140
|
-
axisLabel:
|
|
141
|
-
splitLine:
|
|
154
|
+
min: r,
|
|
155
|
+
max: e,
|
|
156
|
+
axisLine: C(!1),
|
|
157
|
+
axisLabel: L(),
|
|
158
|
+
splitLine: I((a == null ? void 0 : a.gridLines) ?? !0)
|
|
142
159
|
};
|
|
143
160
|
}
|
|
144
161
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
d as COMMON_TEXT_STYLE,
|
|
163
|
+
S as DEFAULT_FONT_FAMILY,
|
|
164
|
+
L as buildAxisLabelConfig,
|
|
165
|
+
C as buildAxisLineConfig,
|
|
166
|
+
w as buildGridConfig,
|
|
167
|
+
F as buildLegendConfig,
|
|
168
|
+
I as buildSplitLineConfig,
|
|
169
|
+
T as buildTitleConfig,
|
|
170
|
+
z as buildTooltipConfig,
|
|
171
|
+
A as buildXAxisConfig,
|
|
172
|
+
B as buildYAxisConfig
|
|
156
173
|
};
|
|
@@ -4,5 +4,6 @@ export interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
4
4
|
leftIcon?: React.ReactNode;
|
|
5
5
|
rightIcon?: React.ReactNode;
|
|
6
6
|
label?: string;
|
|
7
|
+
asTag?: React.ElementType;
|
|
7
8
|
}
|
|
8
9
|
export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import p from "react";
|
|
3
3
|
import { cn as f } from "../../../lib/utils.js";
|
|
4
|
-
const
|
|
5
|
-
({ leftIcon: n, label:
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
4
|
+
const v = p.forwardRef(
|
|
5
|
+
({ leftIcon: n, label: t, rightIcon: o, className: i, isActive: a, children: c, asTag: l = "button", ...d }, m) => {
|
|
6
|
+
const r = t ?? c, s = "w-3.5 h-3.5 min-w-max";
|
|
7
|
+
return /* @__PURE__ */ u(
|
|
8
|
+
l,
|
|
9
9
|
{
|
|
10
|
-
ref:
|
|
10
|
+
ref: m,
|
|
11
11
|
className: f(
|
|
12
12
|
"h-7.5 inline-flex items-center justify-center p-2 gap-1 rounded-lg",
|
|
13
13
|
"hover:bg-background-inverted-elevated text-inverted-primary",
|
|
14
14
|
"leading-none-medium-sm",
|
|
15
15
|
"select-none hover:cursor-pointer disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring-default",
|
|
16
16
|
a && "bg-background-inverted-elevated",
|
|
17
|
-
|
|
17
|
+
i
|
|
18
18
|
),
|
|
19
|
-
...
|
|
19
|
+
...d,
|
|
20
20
|
children: [
|
|
21
21
|
n && /* @__PURE__ */ e("span", { className: s, children: n }),
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
r && /* @__PURE__ */ e("span", { children: r }),
|
|
23
|
+
o && /* @__PURE__ */ e("span", { className: s, children: o })
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
|
-
|
|
29
|
+
v.displayName = "NavItem";
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
v as NavItem
|
|
32
32
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EChartsOption } from 'echarts';
|
|
2
2
|
import type { BarChartConfig, ChartData } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildBarChartOptions(config: BarChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildBarChartOptions(config: BarChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EChartsOption } from 'echarts';
|
|
2
2
|
import type { ChartConfig, ChartData, ChartType } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildChartOptions(config: ChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildChartOptions(config: ChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
4
4
|
export declare function isChartTypeSupported(type: string): type is ChartType;
|
|
5
5
|
export declare const registeredChartTypes: readonly ChartType[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EChartsOption } from 'echarts';
|
|
2
2
|
import type { ChartData, LineChartConfig } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildLineChartOptions(config: LineChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildLineChartOptions(config: LineChartConfig, data: ChartData, scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EChartsOption } from 'echarts';
|
|
2
2
|
import type { ChartData, PieChartConfig } from '../chart-card.config.types';
|
|
3
|
-
export declare function buildPieChartOptions(config: PieChartConfig, data: ChartData): EChartsOption;
|
|
3
|
+
export declare function buildPieChartOptions(config: PieChartConfig, data: ChartData, _scrollable?: boolean, scrollableLegend?: boolean): EChartsOption;
|
|
@@ -29,6 +29,18 @@ export interface ChartOptions {
|
|
|
29
29
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
30
30
|
align?: 'left' | 'center' | 'right';
|
|
31
31
|
orient?: 'horizontal' | 'vertical';
|
|
32
|
+
scrollable?: boolean;
|
|
33
|
+
pageButtonItemGap?: number;
|
|
34
|
+
pageButtonGap?: number;
|
|
35
|
+
pageButtonPosition?: 'start' | 'end';
|
|
36
|
+
pageFormatter?: string;
|
|
37
|
+
pageIconColor?: string;
|
|
38
|
+
pageIconInactiveColor?: string;
|
|
39
|
+
pageIconSize?: number;
|
|
40
|
+
pageTextStyle?: {
|
|
41
|
+
color?: string;
|
|
42
|
+
fontSize?: number;
|
|
43
|
+
};
|
|
32
44
|
};
|
|
33
45
|
tooltip?: {
|
|
34
46
|
show?: boolean;
|
|
@@ -67,6 +79,21 @@ export interface ChartOptions {
|
|
|
67
79
|
showLabel?: boolean;
|
|
68
80
|
showLabelLine?: boolean;
|
|
69
81
|
};
|
|
82
|
+
scrollable?: {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
type?: 'slider' | 'inside' | 'both';
|
|
85
|
+
start?: number;
|
|
86
|
+
end?: number;
|
|
87
|
+
height?: number;
|
|
88
|
+
width?: number;
|
|
89
|
+
position?: 'bottom' | 'top' | 'left' | 'right';
|
|
90
|
+
showDetail?: boolean;
|
|
91
|
+
showDataShadow?: boolean;
|
|
92
|
+
realtime?: boolean;
|
|
93
|
+
filterMode?: 'filter' | 'empty' | 'none';
|
|
94
|
+
xAxisIndex?: number[];
|
|
95
|
+
yAxisIndex?: number[];
|
|
96
|
+
};
|
|
70
97
|
}
|
|
71
98
|
interface BaseChartConfig {
|
|
72
99
|
name: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChartCardProps } from './chart-card.types';
|
|
2
|
-
export declare function ChartCard({ config, data, loading, error, className, style, chartProps, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ChartCard({ config, data, loading, error, className, style, chartProps, scrollable, scrollableLegend, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,6 +44,34 @@ export declare function buildLegendConfig(data: string[], hasTitle?: boolean, op
|
|
|
44
44
|
};
|
|
45
45
|
itemWidth: number;
|
|
46
46
|
itemHeight: number;
|
|
47
|
+
} | {
|
|
48
|
+
type: string;
|
|
49
|
+
pageButtonItemGap: number;
|
|
50
|
+
pageButtonGap: number;
|
|
51
|
+
pageButtonPosition: "end" | "start";
|
|
52
|
+
pageFormatter: string;
|
|
53
|
+
pageIconColor: string;
|
|
54
|
+
pageIconInactiveColor: string;
|
|
55
|
+
pageIconSize: number;
|
|
56
|
+
pageTextStyle: {
|
|
57
|
+
color: string;
|
|
58
|
+
fontSize: number;
|
|
59
|
+
};
|
|
60
|
+
data: string[];
|
|
61
|
+
top: string | number;
|
|
62
|
+
bottom: string | number | undefined;
|
|
63
|
+
left: string | number;
|
|
64
|
+
right: string | number | undefined;
|
|
65
|
+
orient: "horizontal" | "vertical";
|
|
66
|
+
itemGap: number;
|
|
67
|
+
padding: number[];
|
|
68
|
+
textStyle: {
|
|
69
|
+
fontSize: number;
|
|
70
|
+
fontFamily: string;
|
|
71
|
+
color: "#000000";
|
|
72
|
+
};
|
|
73
|
+
itemWidth: number;
|
|
74
|
+
itemHeight: number;
|
|
47
75
|
} | undefined;
|
|
48
76
|
export declare function buildAxisLabelConfig(rotate?: number): {
|
|
49
77
|
rotate?: number | undefined;
|
|
@@ -4,5 +4,6 @@ export interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
4
4
|
leftIcon?: React.ReactNode;
|
|
5
5
|
rightIcon?: React.ReactNode;
|
|
6
6
|
label?: string;
|
|
7
|
+
asTag?: React.ElementType;
|
|
7
8
|
}
|
|
8
9
|
export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|