@hybridcore/ui 1.6.4 → 1.6.6

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 (35) hide show
  1. package/CATALOG.md +1 -0
  2. package/dist/IconX-C2wmVYSK.js +11 -0
  3. package/dist/components/charts/_common/format.js +49 -0
  4. package/dist/components/charts/_common/utils.js +12 -7
  5. package/dist/components/charts/chart-wrapper/index.js +36 -34
  6. package/dist/components/charts/column-line-mix/logic.js +78 -78
  7. package/dist/components/charts/donut-chart/index.js +11 -0
  8. package/dist/components/charts/donut-chart/logic.js +67 -0
  9. package/dist/components/charts/donut-chart/styled.js +12 -0
  10. package/dist/components/charts/drill-down-treemap/logic.js +123 -123
  11. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
  12. package/dist/components/charts/heatmap/logic.js +73 -73
  13. package/dist/components/charts/line/logic.js +66 -66
  14. package/dist/components/charts/logaritmic-scale/logic.js +65 -65
  15. package/dist/components/charts/multiple-value-axes/logic.js +75 -74
  16. package/dist/components/charts/nested-pie/logic.js +43 -42
  17. package/dist/components/charts/packed-circles/logic.js +111 -110
  18. package/dist/components/charts/pie-chart/logic.js +40 -39
  19. package/dist/components/charts/stacked-area-radar/logic.js +51 -51
  20. package/dist/components/charts/stacked-column-chart/logic.js +79 -79
  21. package/dist/components/charts/xy-chart/logic.js +71 -71
  22. package/dist/components/color-picker/index.js +1645 -1602
  23. package/dist/components/color-picker/logic.js +21 -12
  24. package/dist/components/color-picker/styled.js +4 -2
  25. package/dist/components/date-range-picker/index.js +359 -365
  26. package/dist/components/metric-card/helpers.js +12 -5
  27. package/dist/components/metric-card/logic.js +65 -57
  28. package/dist/components/metric-card/styled.js +55 -47
  29. package/dist/components/simple-pivot-table/index.js +129 -54
  30. package/dist/components/simple-pivot-table/logic.js +111 -45
  31. package/dist/components/simple-pivot-table/styled.js +31 -11
  32. package/dist/main.d.ts +128 -8
  33. package/dist/main.js +163 -157
  34. package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
  35. package/package.json +1 -1
package/CATALOG.md CHANGED
@@ -71,6 +71,7 @@ import { ComponentName } from '@hybridcore/ui';
71
71
  | ChartWrapper | HCChartWrapper | Switches between 14 chart types from a single config | chart, wrapper |
72
72
  | CandlestickChart | HCCandlestickChart | Financial OHLC candlestick chart | chart, financial, ohlc |
73
73
  | ColumnLineMix | HCColumnLineMix | Mixed column + line chart for combined metrics | chart, column, line |
74
+ | DonutChart | HCDonutChart | Pie chart with a hollow center (donut) for an extra metric | chart, pie, donut |
74
75
  | DrillDownTreemap | HCDrillDownTreemap | Treemap with click-to-drill-down hierarchy | chart, treemap, hierarchy |
75
76
  | DrillDownVoronoiTreemap | HCDrillDownVoronoiTreemap | Voronoi-tessellation treemap with drill-down | chart, treemap, voronoi |
76
77
  | Heatmap | HCHeatmap | Categorical heatmap (X/Y axes, color-coded values) | chart, heatmap |
@@ -0,0 +1,11 @@
1
+ import { c as o } from "./createReactComponent-C7L-DMHj.js";
2
+ /**
3
+ * @license @tabler/icons-react v3.44.0 - MIT
4
+ *
5
+ * This source code is licensed under the MIT license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const t = [["path", { d: "M18 6l-12 12", key: "svg-0" }], ["path", { d: "M6 6l12 12", key: "svg-1" }]], c = o("outline", "x", "X", t);
9
+ export {
10
+ c as I
11
+ };
@@ -0,0 +1,49 @@
1
+ const s = "—", o = (n) => new Intl.NumberFormat(
2
+ "en-US",
3
+ n === void 0 ? { maximumFractionDigits: 2 } : { minimumFractionDigits: n, maximumFractionDigits: n }
4
+ ), l = (n, e, i = s) => {
5
+ if (n == null || n === "") return i;
6
+ const t = Number(n);
7
+ if (Number.isNaN(t)) return String(n);
8
+ const r = o(e == null ? void 0 : e.decimals).format(t);
9
+ return `${(e == null ? void 0 : e.prefix) ?? ""}${r}${(e == null ? void 0 : e.suffix) ?? ""}`;
10
+ }, d = (n) => {
11
+ if (!n) return;
12
+ const { prefix: e, suffix: i, decimals: t } = n;
13
+ if (e === void 0 && i === void 0 && t === void 0)
14
+ return;
15
+ const r = t === void 0 ? "#,###.##" : t <= 0 ? "#,##0" : `#,##0.${"0".repeat(t)}`, c = (u) => u ? `'${u.replace(/'/g, "")}'` : "";
16
+ return `${c(e)}${r}${c(i)}`;
17
+ }, v = (n) => n && n.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), a = (n, e) => {
18
+ switch (e.op) {
19
+ case "lt":
20
+ return n < e.value;
21
+ case "lte":
22
+ return n <= e.value;
23
+ case "gt":
24
+ return n > e.value;
25
+ case "gte":
26
+ return n >= e.value;
27
+ case "eq":
28
+ return n === e.value;
29
+ case "neq":
30
+ return n !== e.value;
31
+ case "between":
32
+ return e.value2 !== void 0 && n >= e.value && n <= e.value2;
33
+ default:
34
+ return !1;
35
+ }
36
+ }, b = (n, e) => {
37
+ const i = e == null ? void 0 : e.conditionalRules;
38
+ if (!(i != null && i.length)) return {};
39
+ const t = Number(n);
40
+ if (Number.isNaN(t)) return {};
41
+ const r = i.find((c) => a(t, c));
42
+ return r ? { color: r.color, backgroundColor: r.backgroundColor } : {};
43
+ };
44
+ export {
45
+ d as buildAmNumberFormat,
46
+ l as formatValue,
47
+ v as humanizeLabel,
48
+ b as resolveConditionalStyle
49
+ };
@@ -1,5 +1,6 @@
1
- import { C as t, c as F } from "../../../ColorSet-C7vpNXhM.js";
2
- const c = [
1
+ import { buildAmNumberFormat as t } from "./format.js";
2
+ import { C as m, c as F } from "../../../ColorSet-C7vpNXhM.js";
3
+ const a = [
3
4
  "#294D94",
4
5
  "#375F97",
5
6
  "#44729C",
@@ -10,11 +11,15 @@ const c = [
10
11
  "#9FCFBF",
11
12
  "#B9E1C9",
12
13
  "#D6F1D5"
13
- ], C = (o, r = c) => t.new(o, {
14
- colors: r.map((e) => F(e)),
14
+ ], u = (r, e = a) => m.new(r, {
15
+ colors: e.map((o) => F(o)),
15
16
  reuse: !0
16
- });
17
+ }), c = (r, e) => {
18
+ const o = t(e);
19
+ o && (r.numberFormatter.set("numericFields", void 0), r.numberFormatter.set("numberFormat", o));
20
+ };
17
21
  export {
18
- c as DEFAULT_VIRIDIS_COOL,
19
- C as colorSetFromPalette
22
+ a as DEFAULT_VIRIDIS_COOL,
23
+ c as applyValueFormat,
24
+ u as colorSetFromPalette
20
25
  };
@@ -1,45 +1,47 @@
1
1
  import { jsxs as i, jsx as r, Fragment as l } from "react/jsx-runtime";
2
- import { Typography as d, Divider as h } from "@mui/material";
3
- import { Loading as C } from "../../loading/index.js";
2
+ import { Typography as h, Divider as C } from "@mui/material";
3
+ import { Loading as d } from "../../loading/index.js";
4
4
  import { CandlestickChart as c } from "../candlestick/index.js";
5
5
  import { ColumnLineMix as f } from "../column-line-mix/index.js";
6
- import { DrillDownTreemap as s } from "../drill-down-treemap/index.js";
7
- import { DrillDownVoronoiTreemap as u } from "../drill-down-voronoi-treemap/index.js";
6
+ import { DonutChart as s } from "../donut-chart/index.js";
7
+ import { DrillDownTreemap as u } from "../drill-down-treemap/index.js";
8
+ import { DrillDownVoronoiTreemap as D } from "../drill-down-voronoi-treemap/index.js";
8
9
  import { Heatmap as L } from "../heatmap/index.js";
9
10
  import { LineChart as g } from "../line/index.js";
10
11
  import { LogaritmicScale as x } from "../logaritmic-scale/index.js";
11
- import { MultipleValueAxes as D } from "../multiple-value-axes/index.js";
12
- import { NestedPie as k } from "../nested-pie/index.js";
13
- import { PackedCircles as S } from "../packed-circles/index.js";
14
- import { PieChart as P } from "../pie-chart/index.js";
15
- import { StackedAreaRadar as w } from "../stacked-area-radar/index.js";
16
- import { StackedColumnChart as A } from "../stacked-column-chart/index.js";
17
- import { XYChart as T } from "../xy-chart/index.js";
18
- import { useChartWrapperLogic as W } from "./logic.js";
19
- import { ChartWrapperRoot as M, ChartWrapperHeader as V, ChartWrapperContent as v } from "./styled.js";
20
- const U = (a) => {
21
- const { title: m, type: e, chartProps: o, loading: p, ownerState: t, sx: n } = W(a);
22
- return /* @__PURE__ */ i(M, { ownerState: t, sx: n, children: [
23
- /* @__PURE__ */ r(V, { ownerState: t, children: /* @__PURE__ */ r(d, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
24
- /* @__PURE__ */ r(h, {}),
25
- /* @__PURE__ */ r(v, { ownerState: t, children: p ? /* @__PURE__ */ r(C, { show: !0, position: "absolute" }) : /* @__PURE__ */ i(l, { children: [
26
- e === "MultipleValueAxes" && /* @__PURE__ */ r(D, { ...o }),
27
- e === "XYChart" && /* @__PURE__ */ r(T, { ...o }),
28
- e === "HeatLegend" && /* @__PURE__ */ r(L, { ...o }),
29
- e === "PieChart" && /* @__PURE__ */ r(P, { ...o }),
30
- e === "StackedColumnChart" && /* @__PURE__ */ r(A, { ...o }),
31
- e === "StackedAreaRadar" && /* @__PURE__ */ r(w, { ...o }),
32
- e === "LineChart" && /* @__PURE__ */ r(g, { ...o }),
33
- e === "NestedPie" && /* @__PURE__ */ r(k, { ...o }),
34
- e === "SingleLevelPackedCircles" && /* @__PURE__ */ r(S, { ...o }),
35
- e === "LogarithmicScale" && /* @__PURE__ */ r(x, { ...o }),
36
- e === "ColumnAndLineMix" && /* @__PURE__ */ r(f, { ...o }),
37
- e === "DrillDownTreemap" && /* @__PURE__ */ r(s, { ...o }),
38
- e === "DrillDownVoronoiTreemap" && /* @__PURE__ */ r(u, { ...o }),
39
- e === "CandlestickChart" && /* @__PURE__ */ r(c, { ...o })
12
+ import { MultipleValueAxes as k } from "../multiple-value-axes/index.js";
13
+ import { NestedPie as S } from "../nested-pie/index.js";
14
+ import { PackedCircles as P } from "../packed-circles/index.js";
15
+ import { PieChart as w } from "../pie-chart/index.js";
16
+ import { StackedAreaRadar as A } from "../stacked-area-radar/index.js";
17
+ import { StackedColumnChart as T } from "../stacked-column-chart/index.js";
18
+ import { XYChart as W } from "../xy-chart/index.js";
19
+ import { useChartWrapperLogic as M } from "./logic.js";
20
+ import { ChartWrapperRoot as V, ChartWrapperHeader as v, ChartWrapperContent as y } from "./styled.js";
21
+ const _ = (a) => {
22
+ const { title: m, type: o, chartProps: e, loading: p, ownerState: t, sx: n } = M(a);
23
+ return /* @__PURE__ */ i(V, { ownerState: t, sx: n, children: [
24
+ /* @__PURE__ */ r(v, { ownerState: t, children: /* @__PURE__ */ r(h, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
25
+ /* @__PURE__ */ r(C, {}),
26
+ /* @__PURE__ */ r(y, { ownerState: t, children: p ? /* @__PURE__ */ r(d, { show: !0, position: "absolute" }) : /* @__PURE__ */ i(l, { children: [
27
+ o === "MultipleValueAxes" && /* @__PURE__ */ r(k, { ...e }),
28
+ o === "XYChart" && /* @__PURE__ */ r(W, { ...e }),
29
+ o === "HeatLegend" && /* @__PURE__ */ r(L, { ...e }),
30
+ o === "PieChart" && /* @__PURE__ */ r(w, { ...e }),
31
+ o === "DonutChart" && /* @__PURE__ */ r(s, { ...e }),
32
+ o === "StackedColumnChart" && /* @__PURE__ */ r(T, { ...e }),
33
+ o === "StackedAreaRadar" && /* @__PURE__ */ r(A, { ...e }),
34
+ o === "LineChart" && /* @__PURE__ */ r(g, { ...e }),
35
+ o === "NestedPie" && /* @__PURE__ */ r(S, { ...e }),
36
+ o === "SingleLevelPackedCircles" && /* @__PURE__ */ r(P, { ...e }),
37
+ o === "LogarithmicScale" && /* @__PURE__ */ r(x, { ...e }),
38
+ o === "ColumnAndLineMix" && /* @__PURE__ */ r(f, { ...e }),
39
+ o === "DrillDownTreemap" && /* @__PURE__ */ r(u, { ...e }),
40
+ o === "DrillDownVoronoiTreemap" && /* @__PURE__ */ r(D, { ...e }),
41
+ o === "CandlestickChart" && /* @__PURE__ */ r(c, { ...e })
40
42
  ] }) })
41
43
  ] });
42
44
  };
43
45
  export {
44
- U as ChartWrapper
46
+ _ as ChartWrapper
45
47
  };
@@ -1,45 +1,45 @@
1
- import { R, A as B, T as p } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as I, useTheme as M } from "@mui/material";
3
- import F from "lodash";
4
- import { useId as z, useRef as P, useEffect as E } from "react";
5
- import { colorSetFromPalette as N } from "../_common/utils.js";
6
- import { c as i, p as V, a as X } from "../../../ColorSet-C7vpNXhM.js";
7
- import { X as W, V as q } from "../../../AxisRenderer-DTyLLA6c.js";
8
- import { S as H } from "../../../Scrollbar-D86MJyr2.js";
9
- import { D as U } from "../../../DateAxis-YX3QNIB-.js";
10
- import { A as k, a as _ } from "../../../AxisRendererY-C_ItLPNV.js";
11
- import { C as $ } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { C as j } from "../../../ColumnSeries-CjgdJ2QL.js";
13
- import { D as C } from "../../../DataProcessor-CHDO51q4.js";
14
- import { L as G } from "../../../LineSeries-Uiv5o56b.js";
15
- import { B as J } from "../../../Bullet-DVczI2TD.js";
16
- import { C as K } from "../../../Circle-Cy5s-pVc.js";
17
- import { X as Q } from "../../../XYCursor-C8WktvKM.js";
18
- import { L as Z } from "../../../Legend-Dp_MKfS4.js";
19
- const ye = (b) => {
20
- const f = I({ props: b, name: "HCColumnLineMix" }), {
1
+ import { R as B, A as I, T as d } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as M, useTheme as z } from "@mui/material";
3
+ import X from "lodash";
4
+ import { useId as P, useRef as V, useEffect as E } from "react";
5
+ import { colorSetFromPalette as N, applyValueFormat as W } from "../_common/utils.js";
6
+ import { c as i, p as q, a as k } from "../../../ColorSet-C7vpNXhM.js";
7
+ import { X as H, V as U } from "../../../AxisRenderer-DTyLLA6c.js";
8
+ import { S as _ } from "../../../Scrollbar-D86MJyr2.js";
9
+ import { D as $ } from "../../../DateAxis-YX3QNIB-.js";
10
+ import { A as C, a as j } from "../../../AxisRendererY-C_ItLPNV.js";
11
+ import { C as G } from "../../../CategoryAxis-CwnfaGc8.js";
12
+ import { C as J } from "../../../ColumnSeries-CjgdJ2QL.js";
13
+ import { D as b } from "../../../DataProcessor-CHDO51q4.js";
14
+ import { L as K } from "../../../LineSeries-Uiv5o56b.js";
15
+ import { B as Q } from "../../../Bullet-DVczI2TD.js";
16
+ import { C as Z } from "../../../Circle-Cy5s-pVc.js";
17
+ import { X as ee } from "../../../XYCursor-C8WktvKM.js";
18
+ import { L as te } from "../../../Legend-Dp_MKfS4.js";
19
+ const Fe = (L) => {
20
+ const h = M({ props: L, name: "HCColumnLineMix" }), {
21
21
  dimensions: t,
22
- values: h,
23
- data: n,
24
- initDelay: L = 0,
25
- baseInterval: T,
22
+ values: l,
23
+ data: m,
24
+ initDelay: T = 0,
25
+ baseInterval: Y,
26
26
  colors: g,
27
- sx: Y,
28
- ...D
29
- } = f, a = M(), x = `hc-column-line-mix-${z().replace(/:/g, "")}`, d = P(null), w = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
27
+ sx: D,
28
+ ...S
29
+ } = h, a = z(), x = `hc-column-line-mix-${P().replace(/:/g, "")}`, c = V(null), w = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
30
30
  E(() => {
31
31
  if (w) return;
32
32
  let u;
33
33
  return u = setTimeout(() => {
34
- var v, y, A;
35
- const e = R.new(x);
36
- d.current = e, e.setThemes([B.new(e)]), e.interfaceColors.setAll({
34
+ var y, A, v, F;
35
+ const e = B.new(x);
36
+ c.current = e, e.setThemes([I.new(e)]), e.interfaceColors.setAll({
37
37
  text: i(a.palette.text.primary),
38
38
  grid: i(a.palette.divider),
39
39
  stroke: i(a.palette.divider)
40
40
  });
41
41
  const r = e.container.children.push(
42
- W.new(e, {
42
+ H.new(e, {
43
43
  panX: !1,
44
44
  panY: !1,
45
45
  wheelX: "none",
@@ -50,74 +50,74 @@ const ye = (b) => {
50
50
  );
51
51
  r.set("colors", N(e, g)), r.get("colors", {}).set("step", 3), r.set(
52
52
  "scrollbarX",
53
- H.new(e, { orientation: "horizontal" })
53
+ _.new(e, { orientation: "horizontal" })
54
54
  );
55
- let s, l = n;
56
- t[0].type === "date" ? (l = F.orderBy(n, [t[0].value]), s = r.xAxes.push(
57
- U.new(e, {
55
+ let s, n = m;
56
+ t[0].type === "date" ? (n = X.orderBy(m, [t[0].value]), s = r.xAxes.push(
57
+ $.new(e, {
58
58
  maxDeviation: 0.1,
59
59
  groupData: !1,
60
- baseInterval: T || { timeUnit: "day", count: 1 },
61
- renderer: k.new(e, {}),
62
- tooltip: p.new(e, {})
60
+ baseInterval: Y || { timeUnit: "day", count: 1 },
61
+ renderer: C.new(e, {}),
62
+ tooltip: d.new(e, {})
63
63
  })
64
- ), (v = s.get("renderer")) == null || v.grid.template.setAll({
64
+ ), (y = s.get("renderer")) == null || y.grid.template.setAll({
65
65
  stroke: i(a.palette.divider),
66
66
  strokeOpacity: 1
67
67
  })) : (s = r.xAxes.push(
68
- $.new(e, {
68
+ G.new(e, {
69
69
  categoryField: t[0].value,
70
- renderer: k.new(e, {}),
71
- tooltip: p.new(e, {})
70
+ renderer: C.new(e, {}),
71
+ tooltip: d.new(e, {})
72
72
  })
73
- ), (y = s.get("renderer")) == null || y.grid.template.setAll({
73
+ ), (A = s.get("renderer")) == null || A.grid.template.setAll({
74
74
  stroke: i(a.palette.divider),
75
75
  strokeOpacity: 1
76
76
  }), e.numberFormatter.setAll({
77
77
  numberFormat: "#",
78
78
  numericFields: ["valueX"]
79
- }), l = F.orderBy(n, [t[0].value]), s.data.setAll(l));
80
- const c = r.yAxes.push(
81
- q.new(e, {
79
+ }), n = X.orderBy(m, [t[0].value]), s.data.setAll(n));
80
+ const f = r.yAxes.push(
81
+ U.new(e, {
82
82
  min: 0,
83
83
  extraMax: 0.1,
84
- renderer: _.new(e, { strokeOpacity: 0.1 })
84
+ renderer: j.new(e, { strokeOpacity: 0.1 })
85
85
  })
86
86
  );
87
- (A = c.get("renderer")) == null || A.grid.template.setAll({
87
+ (v = f.get("renderer")) == null || v.grid.template.setAll({
88
88
  stroke: i(a.palette.divider),
89
89
  strokeOpacity: 1
90
- }), h.forEach((m, O) => {
91
- if (O === 0) {
90
+ }), l.forEach((p, R) => {
91
+ if (R === 0) {
92
92
  const o = r.series.push(
93
- j.new(e, {
94
- name: m.name,
93
+ J.new(e, {
94
+ name: p.name,
95
95
  xAxis: s,
96
- yAxis: c,
97
- valueYField: m.dataFieldName,
96
+ yAxis: f,
97
+ valueYField: p.dataFieldName,
98
98
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
99
- tooltip: p.new(e, {
99
+ tooltip: d.new(e, {
100
100
  pointerOrientation: "horizontal",
101
101
  labelText: "{name} in {categoryX}: {valueY} {info}"
102
102
  })
103
103
  })
104
104
  );
105
105
  o.columns.template.setAll({
106
- tooltipY: V(10),
106
+ tooltipY: q(10),
107
107
  templateField: "columnSettings"
108
- }), t[0].type === "date" && (o.data.processor = C.new(e, {
108
+ }), t[0].type === "date" && (o.data.processor = b.new(e, {
109
109
  dateFormat: "i",
110
110
  dateFields: [t[0].value]
111
- })), o.data.setAll(l), o.appear();
111
+ })), o.data.setAll(n), o.appear();
112
112
  } else {
113
113
  const o = r.series.push(
114
- G.new(e, {
115
- name: m.name,
114
+ K.new(e, {
115
+ name: p.name,
116
116
  xAxis: s,
117
- yAxis: c,
118
- valueYField: m.dataFieldName,
117
+ yAxis: f,
118
+ valueYField: p.dataFieldName,
119
119
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
120
- tooltip: p.new(e, {
120
+ tooltip: d.new(e, {
121
121
  pointerOrientation: "horizontal",
122
122
  labelText: "{name} in {categoryX}: {valueY} {info}"
123
123
  })
@@ -126,12 +126,12 @@ const ye = (b) => {
126
126
  o.strokes.template.setAll({
127
127
  strokeWidth: 3,
128
128
  templateField: "strokeSettings"
129
- }), t[0].type === "date" && (o.data.processor = C.new(e, {
129
+ }), t[0].type === "date" && (o.data.processor = b.new(e, {
130
130
  dateFormat: "i",
131
131
  dateFields: [t[0].value]
132
- })), o.data.setAll(l), o.bullets.push(function() {
133
- return J.new(e, {
134
- sprite: K.new(e, {
132
+ })), o.data.setAll(n), o.bullets.push(function() {
133
+ return Q.new(e, {
134
+ sprite: Z.new(e, {
135
135
  strokeWidth: 3,
136
136
  stroke: o.get("stroke"),
137
137
  radius: 5,
@@ -140,20 +140,20 @@ const ye = (b) => {
140
140
  });
141
141
  });
142
142
  }
143
- }), r.set("cursor", Q.new(e, {})), r.children.push(
144
- Z.new(e, {
145
- centerX: X,
146
- x: X
143
+ }), r.set("cursor", ee.new(e, {})), r.children.push(
144
+ te.new(e, {
145
+ centerX: k,
146
+ x: k
147
147
  })
148
- ).data.setAll(r.series.values), r.appear(1e3, 100);
149
- }, L), () => {
148
+ ).data.setAll(r.series.values), W(e, (F = l == null ? void 0 : l[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
149
+ }, T), () => {
150
150
  var e;
151
- u && clearTimeout(u), (e = d.current) == null || e.dispose(), d.current = null;
151
+ u && clearTimeout(u), (e = c.current) == null || e.dispose(), c.current = null;
152
152
  };
153
- }, [n, t, h, a.palette.mode, g]);
154
- const S = { ...f };
155
- return { chartId: x, ownerState: S, sx: Y, error: w, other: D };
153
+ }, [m, t, l, a.palette.mode, g]);
154
+ const O = { ...h };
155
+ return { chartId: x, ownerState: O, sx: D, error: w, other: S };
156
156
  };
157
157
  export {
158
- ye as useColumnLineMixLogic
158
+ Fe as useColumnLineMixLogic
159
159
  };
@@ -0,0 +1,11 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { ChartError as n } from "../_common/chart-error.js";
3
+ import { useDonutChartLogic as s } from "./logic.js";
4
+ import { DonutChartRoot as a } from "./styled.js";
5
+ const f = (o) => {
6
+ const { chartId: e, ownerState: h, sx: i, error: t, other: m } = s(o);
7
+ return /* @__PURE__ */ r(a, { ownerState: h, sx: i, ...m, children: t ? /* @__PURE__ */ r(n, { message: t }) : /* @__PURE__ */ r("div", { id: e, style: { width: "100%", height: "100%" } }) });
8
+ };
9
+ export {
10
+ f as DonutChart
11
+ };
@@ -0,0 +1,67 @@
1
+ import { R as x, A } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as C, useTheme as D } from "@mui/material";
3
+ import F from "dayjs";
4
+ import { useId as P, useRef as R, useEffect as L } from "react";
5
+ import { applyValueFormat as I, colorSetFromPalette as S } from "../_common/utils.js";
6
+ import { P as E, a as j } from "../../../PieSeries-B2fW3z0s.js";
7
+ import { p as m, c as u } from "../../../ColorSet-C7vpNXhM.js";
8
+ import { L as k } from "../../../Legend-Dp_MKfS4.js";
9
+ const J = (v) => {
10
+ const d = C({ props: v, name: "HCDonutChart" }), {
11
+ dimensions: t,
12
+ values: o,
13
+ data: n,
14
+ initDelay: y = 0,
15
+ colors: p,
16
+ sx: M,
17
+ ...T
18
+ } = d, r = D(), f = `hc-donut-chart-${P().replace(/:/g, "")}`, i = R(null);
19
+ let s = null;
20
+ t.length < 1 ? s = "Missing dimensions config!" : o.length < 1 && (s = "Missing values config!"), L(() => {
21
+ if (s) return;
22
+ let l;
23
+ return l = setTimeout(() => {
24
+ var g;
25
+ const e = x.new(f);
26
+ i.current = e, I(e, (g = o == null ? void 0 : o[0]) == null ? void 0 : g.format), e.setThemes([A.new(e)]);
27
+ const h = e.container.children.push(
28
+ E.new(e, {
29
+ layout: e.verticalLayout,
30
+ innerRadius: m(50)
31
+ })
32
+ );
33
+ e.interfaceColors.setAll({
34
+ text: u(r.palette.text.primary),
35
+ grid: u(r.palette.divider),
36
+ stroke: u(r.palette.divider)
37
+ });
38
+ const a = h.series.push(
39
+ j.new(e, {
40
+ valueField: o[0].dataFieldName,
41
+ categoryField: t[0].value
42
+ })
43
+ );
44
+ a.set("colors", S(e, p)), t[0].type === "date" && n.forEach((Y) => {
45
+ let c = "YYYY";
46
+ t[0].value.includes("month") ? c = "MMM YYYY" : t[0].value.includes("day") && (c = "DD MMM YYYY"), Y[t[0].value] = F(Y[t[0].value]).format(
47
+ c
48
+ );
49
+ }), a.data.setAll(n), h.children.push(
50
+ k.new(e, {
51
+ centerX: m(50),
52
+ x: m(50),
53
+ marginTop: 15,
54
+ marginBottom: 15
55
+ })
56
+ ).data.setAll(a.dataItems), a.appear(1e3, 100);
57
+ }, y), () => {
58
+ var e;
59
+ l && clearTimeout(l), (e = i.current) == null || e.dispose(), i.current = null;
60
+ };
61
+ }, [n, t, o, r.palette.mode, p]);
62
+ const w = { ...d };
63
+ return { chartId: f, ownerState: w, sx: M, error: s, other: T };
64
+ };
65
+ export {
66
+ J as useDonutChartLogic
67
+ };
@@ -0,0 +1,12 @@
1
+ import { styled as t, Box as r } from "@mui/material";
2
+ const h = t(r, {
3
+ name: "HCDonutChart",
4
+ slot: "Root",
5
+ shouldForwardProp: (o) => o !== "ownerState"
6
+ })(() => ({
7
+ width: "100%",
8
+ height: "100%"
9
+ }));
10
+ export {
11
+ h as DonutChartRoot
12
+ };