@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.
Files changed (26) hide show
  1. package/dist/components/chart-card/builders/bar-chart-builder.d.ts +1 -1
  2. package/dist/components/chart-card/builders/bar-chart-builder.js +78 -31
  3. package/dist/components/chart-card/builders/chart-builder-factory.d.ts +1 -1
  4. package/dist/components/chart-card/builders/chart-builder-factory.js +15 -15
  5. package/dist/components/chart-card/builders/line-chart-builder.d.ts +1 -1
  6. package/dist/components/chart-card/builders/line-chart-builder.js +85 -38
  7. package/dist/components/chart-card/builders/pie-chart-builder.d.ts +1 -1
  8. package/dist/components/chart-card/builders/pie-chart-builder.js +37 -34
  9. package/dist/components/chart-card/chart-card.config.types.d.ts +27 -0
  10. package/dist/components/chart-card/chart-card.d.ts +1 -1
  11. package/dist/components/chart-card/chart-card.js +25 -23
  12. package/dist/components/chart-card/chart-card.types.d.ts +2 -0
  13. package/dist/components/chart-card/config/defaults.d.ts +28 -0
  14. package/dist/components/chart-card/config/defaults.js +105 -88
  15. package/dist/components/nav-header/nav-item/nav-item.d.ts +1 -0
  16. package/dist/components/nav-header/nav-item/nav-item.js +14 -14
  17. package/dist/types/components/chart-card/builders/bar-chart-builder.d.ts +1 -1
  18. package/dist/types/components/chart-card/builders/chart-builder-factory.d.ts +1 -1
  19. package/dist/types/components/chart-card/builders/line-chart-builder.d.ts +1 -1
  20. package/dist/types/components/chart-card/builders/pie-chart-builder.d.ts +1 -1
  21. package/dist/types/components/chart-card/chart-card.config.types.d.ts +27 -0
  22. package/dist/types/components/chart-card/chart-card.d.ts +1 -1
  23. package/dist/types/components/chart-card/chart-card.types.d.ts +2 -0
  24. package/dist/types/components/chart-card/config/defaults.d.ts +28 -0
  25. package/dist/types/components/nav-header/nav-item/nav-item.d.ts +1 -0
  26. 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 A, buildXAxisConfig as g, buildGridConfig as k, buildLegendConfig as v, buildTooltipConfig as T, buildTitleConfig as B } from "../config/defaults.js";
2
- import { getThemePalette as L } from "../config/colors.js";
3
- function D(e, t) {
4
- var n, o, i, p, l, u, b, c, h, x, S, y;
5
- const m = L("bar", e.theme), r = t.series.map((C) => C.name), s = !!e.name, a = r.length > 1, d = ((o = (n = e.options) == null ? void 0 : n.legend) == null ? void 0 : o.position) ?? "top";
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: m,
8
- title: s ? B(e.name, (i = e.options) == null ? void 0 : i.title) : void 0,
9
- tooltip: T((p = e.options) == null ? void 0 : p.tooltip),
10
- legend: a ? v(r, s, (l = e.options) == null ? void 0 : l.legend) : void 0,
11
- grid: k(s, a, d, (u = e.options) == null ? void 0 : u.grid),
12
- xAxis: g(t.labels, !0, (b = e.options) == null ? void 0 : b.xAxis),
13
- yAxis: A((c = e.options) == null ? void 0 : c.yAxis),
14
- series: P(e, t),
15
- animation: ((x = (h = e.options) == null ? void 0 : h.animation) == null ? void 0 : x.enabled) ?? !0,
16
- animationDuration: ((y = (S = e.options) == null ? void 0 : S.animation) == null ? void 0 : y.duration) ?? 1e3
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 P(e, t) {
20
- var d, n;
21
- const r = e.theme === "stacked" && t.series.length > 1 ? "total" : void 0, s = ((d = e.options) == null ? void 0 : d.seriesStyles) ?? {}, a = ((n = e.options) == null ? void 0 : n.defaultSeriesStyle) ?? {};
22
- return t.series.map((o) => {
23
- const i = {
24
- ...a,
25
- ...s[o.name] ?? {}
26
- }, p = i.barWidth ?? 40, l = {
27
- name: o.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: r,
33
+ stack: u,
30
34
  emphasis: {
31
35
  focus: "series"
32
36
  },
33
- barMaxWidth: p,
34
- data: o.values
37
+ barMaxWidth: f,
38
+ data: n.values
35
39
  };
36
- return i.color && (l.itemStyle = {
37
- color: i.color
38
- }), l;
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
- D as buildBarChartOptions
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 e } from "./bar-chart-builder.js";
2
- import { buildLineChartOptions as o } from "./line-chart-builder.js";
3
- import { buildPieChartOptions as p } from "./pie-chart-builder.js";
4
- const n = {
5
- line: o,
6
- bar: e,
7
- pie: p
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 b(r, i) {
10
- const t = n[r.type];
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 d(r) {
15
+ function l(r) {
16
16
  return r === "line" || r === "bar" || r === "pie";
17
17
  }
18
- const h = ["line", "bar", "pie"];
18
+ const m = ["line", "bar", "pie"];
19
19
  export {
20
- b as buildChartOptions,
21
- d as isChartTypeSupported,
22
- h as registeredChartTypes
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 g, buildXAxisConfig as f, buildGridConfig as T, buildLegendConfig as v, buildTooltipConfig as w, buildTitleConfig as L } from "../config/defaults.js";
2
- import { getThemePalette as z } from "../config/colors.js";
3
- function B(e, i) {
4
- var o, p, m, d, u, y, t, c, S, b, x, C;
5
- const h = z("line", e.theme), l = i.series.map((A) => A.name), s = !!e.name, n = l.length > 1, r = ((p = (o = e.options) == null ? void 0 : o.legend) == null ? void 0 : p.position) ?? "top";
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: h,
8
- title: s ? L(e.name, (m = e.options) == null ? void 0 : m.title) : void 0,
9
- tooltip: w((d = e.options) == null ? void 0 : d.tooltip),
10
- legend: n ? v(l, s, (u = e.options) == null ? void 0 : u.legend) : void 0,
11
- grid: T(s, n, r, (y = e.options) == null ? void 0 : y.grid),
12
- xAxis: f(i.labels, !1, (t = e.options) == null ? void 0 : t.xAxis),
13
- yAxis: g((c = e.options) == null ? void 0 : c.yAxis),
14
- series: O(e, i),
15
- animation: ((b = (S = e.options) == null ? void 0 : S.animation) == null ? void 0 : b.enabled) ?? !0,
16
- animationDuration: ((C = (x = e.options) == null ? void 0 : x.animation) == null ? void 0 : C.duration) ?? 1e3
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 O(e, i) {
20
- var n, r;
21
- const h = e.theme === "smooth", l = ((n = e.options) == null ? void 0 : n.seriesStyles) ?? {}, s = ((r = e.options) == null ? void 0 : r.defaultSeriesStyle) ?? {};
22
- return i.series.map((a) => {
23
- const o = {
24
- ...s,
25
- ...l[a.name] ?? {}
26
- }, p = o.smooth ?? h, m = o.lineWidth ?? 2, d = o.pointSize ?? (i.labels.length <= 12 ? 4 : 0), u = o.areaStyle ?? !1, y = o.opacity ?? 0.15, t = {
27
- name: a.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: p,
33
+ smooth: a,
30
34
  symbol: "circle",
31
- symbolSize: d,
32
- showSymbol: i.labels.length <= 12,
35
+ symbolSize: r,
36
+ showSymbol: o.labels.length <= 12,
33
37
  emphasis: {
34
38
  focus: "series"
35
39
  },
36
40
  lineStyle: {
37
- width: m
41
+ width: S
38
42
  },
39
- data: a.values
43
+ data: e.values
40
44
  };
41
- return o.color && (t.itemStyle = {
42
- color: o.color
43
- }, t.lineStyle = {
44
- ...t.lineStyle,
45
- color: o.color
46
- }), u && (t.areaStyle = {
47
- opacity: y
48
- }), t;
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
- B as buildLineChartOptions
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, o) {
4
- var r, u, d, a, m, p, c;
5
- const b = D("pie", e.theme), n = o.series.map((s) => s.name), l = !!e.name, t = n.length > 1;
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: b,
8
- title: l ? T(e.name, (r = e.options) == null ? void 0 : r.title) : void 0,
9
- tooltip: P({ ...(u = e.options) == null ? void 0 : u.tooltip, trigger: "item" }),
10
- legend: t ? O(n, l, (d = e.options) == null ? void 0 : d.legend) : void 0,
11
- series: v(e, o),
12
- animation: ((m = (a = e.options) == null ? void 0 : a.animation) == null ? void 0 : m.enabled) ?? !0,
13
- animationDuration: ((c = (p = e.options) == null ? void 0 : p.animation) == null ? void 0 : c.duration) ?? 1e3
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, o) {
17
- var C, w, L, g, R;
18
- const b = e.theme === "donut", n = ((C = e.options) == null ? void 0 : C.seriesStyles) ?? {}, l = ((w = e.options) == null ? void 0 : w.defaultSeriesStyle) ?? {}, t = ((L = e.options) == null ? void 0 : L.pie) ?? {}, f = ((g = o.series[0]) == null ? void 0 : g.values.map((h, i) => ({
19
- name: o.labels[i],
20
- value: h
21
- }))) ?? [], r = b ? ["40%", "70%"] : ["0%", "70%"], u = t.radius ?? r, d = t.center ?? ["50%", "50%"], a = t.labelPosition ?? "outside", m = t.labelRotate ?? !1, p = t.showLabel ?? !0, c = t.showLabelLine ?? !0, s = {
22
- name: ((R = o.series[0]) == null ? void 0 : R.name) ?? "Data",
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: u,
25
- center: d,
26
- data: f,
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: p,
37
- position: a,
38
- rotate: m,
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: c && a === "outside",
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(n).length > 0) {
54
- const h = f.map((i) => ({
55
- ...l,
56
- ...n[i.name] ?? {}
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 (h.length > 0) {
61
+ if (y.length > 0) {
59
62
  const i = D("pie", e.theme);
60
- s.itemStyle = {
61
- ...s.itemStyle,
62
- color: (y) => h[y.dataIndex] || i[y.dataIndex % i.length]
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 S = l.pieRadius;
67
- return S && (s.radius = S), [s];
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 N from "react";
3
- import { cn as v } from "../../lib/utils.js";
4
- import { validateChartConfig as p, validateChartData as w } from "./validators/config-validator.js";
5
- import { buildChartOptions as S } from "./builders/chart-builder-factory.js";
6
- import { Chart as E } from "../chart/chart.js";
7
- import { LoadingState as O, ErrorState as l, EmptyState as R } from "./chart-card-states.js";
8
- function j({
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, b = N.useMemo(() => {
19
+ const r = t.height ?? 400, y = p.useMemo(() => {
18
20
  if (!e)
19
21
  return {};
20
- const { className: s, style: i, ...C } = e;
21
- return C;
22
- }, [e]), c = e == null ? void 0 : e.className, y = e == null ? void 0 : e.style;
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(O, { height: r });
26
+ return /* @__PURE__ */ a(V, { height: r });
25
27
  if (m)
26
28
  return /* @__PURE__ */ a(l, { height: r, message: m });
27
- const o = p(t);
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 = w(n);
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(R, { height: r });
38
+ return /* @__PURE__ */ a($, { height: r });
37
39
  let h;
38
40
  try {
39
- h = S(t, n);
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: v(
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
- E,
57
+ R,
56
58
  {
57
59
  option: h,
58
- className: c,
60
+ className: C,
59
61
  style: {
60
62
  height: r,
61
63
  width: t.width || "100%",
62
- ...y
64
+ ...N
63
65
  },
64
- ...b
66
+ ...y
65
67
  }
66
68
  )
67
69
  }
68
70
  );
69
71
  }
70
72
  export {
71
- j as ChartCard
73
+ D as ChartCard
72
74
  };
@@ -9,4 +9,6 @@ export interface ChartCardProps {
9
9
  className?: string;
10
10
  style?: CSSProperties;
11
11
  chartProps?: Omit<EChartsReactProps, 'option'>;
12
+ scrollable?: boolean;
13
+ scrollableLegend?: boolean;
12
14
  }
@@ -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 m } from "./colors.js";
2
- const g = "Inter Variable, sans-serif", c = {
3
- fontFamily: g,
4
- color: m.text.primary
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 y(e, l) {
7
- if ((l == null ? void 0 : l.show) === !1)
6
+ function T(a, r) {
7
+ if ((r == null ? void 0 : r.show) === !1)
8
8
  return;
9
- const r = (l == null ? void 0 : l.position) ?? "left", a = (l == null ? void 0 : l.fontSize) ?? 16, f = (l == null ? void 0 : l.color) ?? m.text.primary;
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: e,
11
+ text: a,
12
12
  textStyle: {
13
- fontFamily: g,
14
- fontSize: a,
13
+ fontFamily: S,
14
+ fontSize: l,
15
15
  fontWeight: 500,
16
16
  color: f
17
17
  },
18
- left: r,
18
+ left: e,
19
19
  top: 12,
20
20
  padding: [0, 0, 8, 0]
21
21
  };
22
22
  }
23
- function C(e) {
24
- return (e == null ? void 0 : e.show) === !1 ? void 0 : {
25
- trigger: (e == null ? void 0 : e.trigger) ?? "axis",
26
- backgroundColor: m.background.default,
27
- borderColor: m.border.default,
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
- ...c
30
+ ...d
31
31
  }
32
32
  };
33
33
  }
34
- function v(e, l = !1, r) {
35
- if ((r == null ? void 0 : r.show) === !1)
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 a = (r == null ? void 0 : r.position) ?? "top", f = (r == null ? void 0 : r.orient) ?? "horizontal";
38
- let u = l ? 48 : 16, t, d = "center", b;
39
- return a === "bottom" ? (u = "auto", t = 10) : a === "left" ? (u = "middle", d = 10) : a === "right" && (u = "middle", d = "auto", b = 10), {
40
- data: e,
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: t,
43
- left: d,
44
- right: b,
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
- ...c,
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 x(e) {
73
+ function L(a) {
57
74
  return {
58
- color: m.text.secondary,
59
- fontFamily: g,
75
+ color: c.text.secondary,
76
+ fontFamily: S,
60
77
  fontSize: 11,
61
- ...e && { rotate: e }
78
+ ...a && { rotate: a }
62
79
  };
63
80
  }
64
- function S(e = !0) {
81
+ function C(a = !0) {
65
82
  return {
66
- show: e,
83
+ show: a,
67
84
  lineStyle: {
68
- color: m.border.default
85
+ color: c.border.default
69
86
  }
70
87
  };
71
88
  }
72
- function h(e = !0) {
89
+ function I(a = !0) {
73
90
  return {
74
- show: e,
91
+ show: a,
75
92
  lineStyle: {
76
- color: m.border.light
93
+ color: c.border.light
77
94
  }
78
95
  };
79
96
  }
80
- function T(e, l = !1, r = "top", a) {
81
- if (a)
97
+ function w(a, r = !1, e = "top", l) {
98
+ if (l)
82
99
  return {
83
- left: a.left ?? "3%",
84
- right: a.right ?? "4%",
85
- bottom: a.bottom ?? "3%",
86
- top: a.top ?? 20,
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
- e && (f += 48), l && r === "top" && (f += 40);
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
- l && r === "bottom" && (u = 60);
93
- let t = "3%";
94
- l && r === "left" && (t = 100);
95
- let d = "4%";
96
- return l && r === "right" && (d = 100), {
97
- left: t,
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 w(e, l = !0, r) {
105
- return (r == null ? void 0 : r.show) === !1 ? { show: !1 } : {
121
+ function A(a, r = !0, e) {
122
+ return (e == null ? void 0 : e.show) === !1 ? { show: !1 } : {
106
123
  type: "category",
107
- data: e,
108
- boundaryGap: l,
109
- name: r == null ? void 0 : r.name,
110
- nameLocation: (r == null ? void 0 : r.nameLocation) ?? "middle",
111
- nameGap: r != null && r.name ? 30 : void 0,
112
- nameTextStyle: r != null && r.name ? {
113
- ...c,
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: S(),
118
- axisLabel: x(r == null ? void 0 : r.labelRotate),
119
- splitLine: h((r == null ? void 0 : r.gridLines) ?? !1)
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 z(e) {
123
- if ((e == null ? void 0 : e.show) === !1)
139
+ function B(a) {
140
+ if ((a == null ? void 0 : a.show) === !1)
124
141
  return { show: !1 };
125
- const l = (e == null ? void 0 : e.min) === "auto" || e == null ? void 0 : e.min, r = (e == null ? void 0 : e.max) === "auto" || e == null ? void 0 : e.max;
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: e == null ? void 0 : e.name,
129
- nameLocation: (e == null ? void 0 : e.nameLocation) ?? "middle",
130
- nameGap: e != null && e.name ? 50 : void 0,
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: e != null && e.name ? {
133
- ...c,
149
+ nameTextStyle: a != null && a.name ? {
150
+ ...d,
134
151
  fontSize: 12,
135
152
  fontWeight: 500
136
153
  } : void 0,
137
- min: l,
138
- max: r,
139
- axisLine: S(!1),
140
- axisLabel: x(),
141
- splitLine: h((e == null ? void 0 : e.gridLines) ?? !0)
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
- c as COMMON_TEXT_STYLE,
146
- g as DEFAULT_FONT_FAMILY,
147
- x as buildAxisLabelConfig,
148
- S as buildAxisLineConfig,
149
- T as buildGridConfig,
150
- v as buildLegendConfig,
151
- h as buildSplitLineConfig,
152
- y as buildTitleConfig,
153
- C as buildTooltipConfig,
154
- w as buildXAxisConfig,
155
- z as buildYAxisConfig
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 m, jsx as e } from "react/jsx-runtime";
2
- import u from "react";
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 p = u.forwardRef(
5
- ({ leftIcon: n, label: o, rightIcon: r, className: t, isActive: a, children: l, ...c }, d) => {
6
- const i = o ?? l, s = "w-3.5 h-3.5 min-w-max";
7
- return /* @__PURE__ */ m(
8
- "button",
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: d,
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
- t
17
+ i
18
18
  ),
19
- ...c,
19
+ ...d,
20
20
  children: [
21
21
  n && /* @__PURE__ */ e("span", { className: s, children: n }),
22
- i && /* @__PURE__ */ e("span", { children: i }),
23
- r && /* @__PURE__ */ e("span", { className: s, children: r })
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
- p.displayName = "NavItem";
29
+ v.displayName = "NavItem";
30
30
  export {
31
- p as NavItem
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;
@@ -9,4 +9,6 @@ export interface ChartCardProps {
9
9
  className?: string;
10
10
  style?: CSSProperties;
11
11
  chartProps?: Omit<EChartsReactProps, 'option'>;
12
+ scrollable?: boolean;
13
+ scrollableLegend?: boolean;
12
14
  }
@@ -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>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",