@hybridcore/ui 1.6.5 → 1.6.7

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 (34) hide show
  1. package/dist/IconX-C2wmVYSK.js +11 -0
  2. package/dist/components/charts/_common/format.js +55 -0
  3. package/dist/components/charts/_common/utils.js +12 -7
  4. package/dist/components/charts/chart-wrapper/helpers.js +46 -21
  5. package/dist/components/charts/chart-wrapper/logic.js +57 -40
  6. package/dist/components/charts/column-line-mix/logic.js +87 -86
  7. package/dist/components/charts/donut-chart/logic.js +37 -36
  8. package/dist/components/charts/drill-down-treemap/logic.js +123 -123
  9. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
  10. package/dist/components/charts/heatmap/logic.js +73 -73
  11. package/dist/components/charts/line/logic.js +201 -103
  12. package/dist/components/charts/logaritmic-scale/logic.js +65 -65
  13. package/dist/components/charts/multiple-value-axes/logic.js +96 -94
  14. package/dist/components/charts/nested-pie/logic.js +43 -42
  15. package/dist/components/charts/packed-circles/logic.js +111 -110
  16. package/dist/components/charts/pie-chart/logic.js +40 -39
  17. package/dist/components/charts/stacked-area-radar/logic.js +68 -67
  18. package/dist/components/charts/stacked-column-chart/logic.js +71 -70
  19. package/dist/components/charts/xy-chart/logic.js +82 -76
  20. package/dist/components/color-picker/index.js +1645 -1602
  21. package/dist/components/color-picker/logic.js +21 -12
  22. package/dist/components/color-picker/styled.js +4 -2
  23. package/dist/components/date-range-picker/index.js +359 -365
  24. package/dist/components/metric-card/helpers.js +12 -5
  25. package/dist/components/metric-card/index.js +58 -54
  26. package/dist/components/metric-card/logic.js +78 -61
  27. package/dist/components/metric-card/styled.js +63 -45
  28. package/dist/components/simple-pivot-table/index.js +129 -54
  29. package/dist/components/simple-pivot-table/logic.js +111 -45
  30. package/dist/components/simple-pivot-table/styled.js +31 -11
  31. package/dist/main.d.ts +125 -8
  32. package/dist/main.js +145 -141
  33. package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
  34. package/package.json +1 -1
@@ -1,42 +1,42 @@
1
- import { R as L, A as C, T as u } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as R, useTheme as I } from "@mui/material";
3
- import y from "lodash";
4
- import { useId as E, useRef as O, useEffect as P } from "react";
5
- import { colorSetFromPalette as q } from "../_common/utils.js";
6
- import { c as s } from "../../../ColorSet-C7vpNXhM.js";
7
- import { X as B, V } from "../../../AxisRenderer-DTyLLA6c.js";
8
- import { X as z } from "../../../XYCursor-C8WktvKM.js";
9
- import { D as G } from "../../../DateAxis-YX3QNIB-.js";
10
- import { A as X, a as H } from "../../../AxisRendererY-C_ItLPNV.js";
11
- import { C as N } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { L as U } from "../../../LineSeries-Uiv5o56b.js";
13
- import { D as W } from "../../../DataProcessor-CHDO51q4.js";
14
- import { S as Z } from "../../../Scrollbar-D86MJyr2.js";
15
- const me = (F) => {
16
- const f = R({ props: F, name: "HCLogaritmicScale" }), {
1
+ import { R as C, A as R, T as u } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as I, useTheme as E } from "@mui/material";
3
+ import F from "lodash";
4
+ import { useId as O, useRef as P, useEffect as V } from "react";
5
+ import { colorSetFromPalette as q, applyValueFormat as B } from "../_common/utils.js";
6
+ import { c as i } from "../../../ColorSet-C7vpNXhM.js";
7
+ import { X as z, V as G } from "../../../AxisRenderer-DTyLLA6c.js";
8
+ import { X as H } from "../../../XYCursor-C8WktvKM.js";
9
+ import { D as N } from "../../../DateAxis-YX3QNIB-.js";
10
+ import { A as X, a as U } from "../../../AxisRendererY-C_ItLPNV.js";
11
+ import { C as W } from "../../../CategoryAxis-CwnfaGc8.js";
12
+ import { L as Z } from "../../../LineSeries-Uiv5o56b.js";
13
+ import { D as _ } from "../../../DataProcessor-CHDO51q4.js";
14
+ import { S as $ } from "../../../Scrollbar-D86MJyr2.js";
15
+ const ce = (b) => {
16
+ const f = I({ props: b, name: "HCLogaritmicScale" }), {
17
17
  dimensions: t,
18
- values: c,
19
- data: i,
20
- initDelay: b = 0,
21
- baseInterval: k,
18
+ values: a,
19
+ data: l,
20
+ initDelay: k = 0,
21
+ baseInterval: S,
22
22
  colors: h,
23
- sx: S,
24
- ...T
25
- } = f, o = I(), v = `hc-logaritmic-scale-${E().replace(/:/g, "")}`, p = O(null);
26
- let l = null;
27
- t.length < 1 ? l = "LogaritmicScale requires at least 1 dimension" : c.length < 1 && (l = "LogaritmicScale requires at least 1 value"), P(() => {
28
- if (l) return;
23
+ sx: T,
24
+ ...D
25
+ } = f, o = E(), g = `hc-logaritmic-scale-${O().replace(/:/g, "")}`, c = P(null);
26
+ let n = null;
27
+ t.length < 1 ? n = "LogaritmicScale requires at least 1 dimension" : a.length < 1 && (n = "LogaritmicScale requires at least 1 value"), V(() => {
28
+ if (n) return;
29
29
  let d;
30
30
  return d = setTimeout(() => {
31
- var A, w, x;
32
- const e = L.new(v);
33
- p.current = e, e.setThemes([C.new(e)]), e.interfaceColors.setAll({
34
- text: s(o.palette.text.primary),
35
- grid: s(o.palette.divider),
36
- stroke: s(o.palette.divider)
31
+ var v, w, x, y;
32
+ const e = C.new(g);
33
+ c.current = e, e.setThemes([R.new(e)]), e.interfaceColors.setAll({
34
+ text: i(o.palette.text.primary),
35
+ grid: i(o.palette.divider),
36
+ stroke: i(o.palette.divider)
37
37
  });
38
38
  const r = e.container.children.push(
39
- B.new(e, {
39
+ z.new(e, {
40
40
  panX: !0,
41
41
  panY: !0,
42
42
  wheelX: "none",
@@ -46,22 +46,22 @@ const me = (F) => {
46
46
  );
47
47
  r.set("colors", q(e, h)), r.set(
48
48
  "cursor",
49
- z.new(e, { behavior: "none" })
49
+ H.new(e, { behavior: "none" })
50
50
  ).lineY.set("visible", !1);
51
- let a, n = i;
52
- t[0].type === "date" ? (n = y.orderBy(i, [t[0].value]), a = r.xAxes.push(
53
- G.new(e, {
51
+ let s, m = l;
52
+ t[0].type === "date" ? (m = F.orderBy(l, [t[0].value]), s = r.xAxes.push(
53
+ N.new(e, {
54
54
  maxDeviation: 0.1,
55
55
  groupData: !1,
56
- baseInterval: k || { timeUnit: "day", count: 1 },
56
+ baseInterval: S || { timeUnit: "day", count: 1 },
57
57
  renderer: X.new(e, {}),
58
58
  tooltip: u.new(e, {})
59
59
  })
60
- ), (A = a.get("renderer")) == null || A.grid.template.setAll({
61
- stroke: s(o.palette.divider),
60
+ ), (v = s.get("renderer")) == null || v.grid.template.setAll({
61
+ stroke: i(o.palette.divider),
62
62
  strokeOpacity: 1
63
- })) : (a = r.xAxes.push(
64
- N.new(e, {
63
+ })) : (s = r.xAxes.push(
64
+ W.new(e, {
65
65
  categoryField: t[0].value,
66
66
  renderer: X.new(e, {}),
67
67
  tooltip: u.new(e, {})
@@ -69,45 +69,45 @@ const me = (F) => {
69
69
  ), e.numberFormatter.setAll({
70
70
  numberFormat: "#",
71
71
  numericFields: ["valueX"]
72
- }), n = y.orderBy(i, [t[0].value]), a.data.setAll(n), (w = a.get("renderer")) == null || w.grid.template.setAll({
73
- stroke: s(o.palette.divider),
72
+ }), m = F.orderBy(l, [t[0].value]), s.data.setAll(m), (w = s.get("renderer")) == null || w.grid.template.setAll({
73
+ stroke: i(o.palette.divider),
74
74
  strokeOpacity: 1
75
75
  }));
76
- const g = r.yAxes.push(
77
- V.new(e, {
76
+ const A = r.yAxes.push(
77
+ G.new(e, {
78
78
  logarithmic: !0,
79
- renderer: H.new(e, { minorGridEnabled: !0 })
79
+ renderer: U.new(e, { minorGridEnabled: !0 })
80
80
  })
81
81
  );
82
- (x = g.get("renderer")) == null || x.grid.template.setAll({
83
- stroke: s(o.palette.divider),
82
+ (x = A.get("renderer")) == null || x.grid.template.setAll({
83
+ stroke: i(o.palette.divider),
84
84
  strokeOpacity: 1
85
- }), c.forEach((Y) => {
86
- const m = r.series.push(
87
- U.new(e, {
88
- xAxis: a,
89
- yAxis: g,
90
- valueYField: Y.dataFieldName,
85
+ }), a.forEach((L) => {
86
+ const p = r.series.push(
87
+ Z.new(e, {
88
+ xAxis: s,
89
+ yAxis: A,
90
+ valueYField: L.dataFieldName,
91
91
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value },
92
92
  tooltip: u.new(e, { labelText: "{valueY}" })
93
93
  })
94
94
  );
95
- m.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (m.data.processor = W.new(e, {
95
+ p.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (p.data.processor = _.new(e, {
96
96
  dateFormat: "i",
97
97
  dateFields: [t[0].value]
98
- })), m.data.setAll(n), m.appear(1e3);
98
+ })), p.data.setAll(m), p.appear(1e3);
99
99
  }), r.set(
100
100
  "scrollbarX",
101
- Z.new(e, { orientation: "horizontal" })
102
- ), r.appear(1e3, 100);
103
- }, b), () => {
101
+ $.new(e, { orientation: "horizontal" })
102
+ ), B(e, (y = a == null ? void 0 : a[0]) == null ? void 0 : y.format), r.appear(1e3, 100);
103
+ }, k), () => {
104
104
  var e;
105
- d && clearTimeout(d), (e = p.current) == null || e.dispose(), p.current = null;
105
+ d && clearTimeout(d), (e = c.current) == null || e.dispose(), c.current = null;
106
106
  };
107
- }, [i, t, c, o.palette.mode, h]);
108
- const D = { ...f };
109
- return { chartId: v, ownerState: D, sx: S, error: l, other: T };
107
+ }, [l, t, a, o.palette.mode, h]);
108
+ const Y = { ...f };
109
+ return { chartId: g, ownerState: Y, sx: T, error: n, other: D };
110
110
  };
111
111
  export {
112
- me as useLogaritmicScaleLogic
112
+ ce as useLogaritmicScaleLogic
113
113
  };
@@ -1,20 +1,21 @@
1
- import { G as P, R as W, A as M, T, b as j } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as q, useTheme as z } from "@mui/material";
1
+ import { G as X, R as j, A as z, T, b as q } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as U, useTheme as $ } from "@mui/material";
3
3
  import C from "lodash";
4
- import { useId as U, useRef as $, useEffect as H } from "react";
5
- import { colorSetFromPalette as J } from "../_common/utils.js";
4
+ import { useId as H, useRef as J, useEffect as K } from "react";
5
+ import { humanizeLabel as F } from "../_common/format.js";
6
+ import { colorSetFromPalette as Q, applyValueFormat as Z } from "../_common/utils.js";
6
7
  import { c as D, a as w } from "../../../ColorSet-C7vpNXhM.js";
7
- import { X as K, V as Q } from "../../../AxisRenderer-DTyLLA6c.js";
8
- import { L as Z } from "../../../Legend-Dp_MKfS4.js";
9
- import { D as ee } from "../../../DateAxis-YX3QNIB-.js";
10
- import { A as N, a as te } from "../../../AxisRendererY-C_ItLPNV.js";
11
- import { C as re } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { X as se } from "../../../XYCursor-C8WktvKM.js";
13
- import { L as ae } from "../../../LineSeries-Uiv5o56b.js";
14
- import { D as ie } from "../../../DataProcessor-CHDO51q4.js";
15
- import { C as oe } from "../../../Circle-Cy5s-pVc.js";
16
- import { B as le } from "../../../Bullet-DVczI2TD.js";
17
- class x extends P {
8
+ import { X as ee, V as te } from "../../../AxisRenderer-DTyLLA6c.js";
9
+ import { L as re } from "../../../Legend-Dp_MKfS4.js";
10
+ import { D as se } from "../../../DateAxis-YX3QNIB-.js";
11
+ import { A as P, a as ae } from "../../../AxisRendererY-C_ItLPNV.js";
12
+ import { C as ie } from "../../../CategoryAxis-CwnfaGc8.js";
13
+ import { X as oe } from "../../../XYCursor-C8WktvKM.js";
14
+ import { L as le } from "../../../LineSeries-Uiv5o56b.js";
15
+ import { D as ne } from "../../../DataProcessor-CHDO51q4.js";
16
+ import { C as ce } from "../../../Circle-Cy5s-pVc.js";
17
+ import { B as ue } from "../../../Bullet-DVczI2TD.js";
18
+ class x extends X {
18
19
  _beforeChanged() {
19
20
  super._beforeChanged(), (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && (this._clear = !0);
20
21
  }
@@ -22,8 +23,8 @@ class x extends P {
22
23
  super._changed(), this._clear && !this.get("draw") && this._draw();
23
24
  }
24
25
  _draw() {
25
- const n = this.width(), r = this.height(), s = this._display;
26
- s.moveTo(-n / 2, r / 2), s.lineTo(0, -r / 2), s.lineTo(n / 2, r / 2), s.lineTo(-n / 2, r / 2), s.closePath();
26
+ const n = this.width(), s = this.height(), t = this._display;
27
+ t.moveTo(-n / 2, s / 2), t.lineTo(0, -s / 2), t.lineTo(n / 2, s / 2), t.lineTo(-n / 2, s / 2), t.closePath();
27
28
  }
28
29
  _updateSize() {
29
30
  this.markDirty(), this._clear = !0;
@@ -39,32 +40,33 @@ Object.defineProperty(x, "classNames", {
39
40
  enumerable: !0,
40
41
  configurable: !0,
41
42
  writable: !0,
42
- value: P.classNames.concat([x.className])
43
+ value: X.classNames.concat([x.className])
43
44
  });
44
- const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
45
- const n = q({ props: L, name: "HCMultipleValueAxes" }), {
46
- dimensions: r,
47
- values: s,
45
+ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ee = (L) => {
46
+ const n = U({ props: L, name: "HCMultipleValueAxes" }), {
47
+ dimensions: s,
48
+ values: t,
48
49
  data: p,
49
- initDelay: X = 0,
50
- baseInterval: Y,
50
+ initDelay: Y = 0,
51
+ baseInterval: I,
51
52
  colors: R,
52
- sx: F,
53
- ...I
54
- } = n, h = z(), _ = `hc-multiple-value-axes-${U().replace(/:/g, "")}`, y = $(null);
55
- let m = null;
56
- r.length < 1 ? m = "MultipleValueAxes requires at least 1 dimension" : s.length < 1 && (m = "MultipleValueAxes requires at least 1 value"), H(() => {
57
- if (m) return;
58
- let v;
59
- return v = setTimeout(() => {
60
- const e = W.new(_);
61
- y.current = e, e.setThemes([M.new(e)]), e.interfaceColors.setAll({
62
- text: D(h.palette.text.primary),
63
- grid: D(h.palette.divider),
64
- stroke: D(h.palette.divider)
53
+ sx: O,
54
+ ...V
55
+ } = n, d = $(), _ = `hc-multiple-value-axes-${H().replace(/:/g, "")}`, y = J(null);
56
+ let h = null;
57
+ s.length < 1 ? h = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (h = "MultipleValueAxes requires at least 1 value"), K(() => {
58
+ if (h) return;
59
+ let b;
60
+ return b = setTimeout(() => {
61
+ var N;
62
+ const e = j.new(_);
63
+ y.current = e, e.setThemes([z.new(e)]), e.interfaceColors.setAll({
64
+ text: D(d.palette.text.primary),
65
+ grid: D(d.palette.divider),
66
+ stroke: D(d.palette.divider)
65
67
  });
66
- const t = e.container.children.push(
67
- K.new(e, {
68
+ const r = e.container.children.push(
69
+ ee.new(e, {
68
70
  panX: !1,
69
71
  panY: !1,
70
72
  wheelX: "none",
@@ -72,44 +74,44 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
72
74
  layout: e.verticalLayout
73
75
  })
74
76
  );
75
- t.set("colors", J(e, R)), t.get("colors", {}).set("step", 3);
76
- const B = t.children.push(
77
- Z.new(e, { centerX: w, x: w })
78
- ), o = r[0];
79
- let u, d = p;
80
- o.type === "date" ? (u = t.xAxes.push(
81
- ee.new(e, {
77
+ r.set("colors", Q(e, R)), r.get("colors", {}).set("step", 3);
78
+ const G = r.children.push(
79
+ re.new(e, { centerX: w, x: w })
80
+ ), l = s[0];
81
+ let u, m = p;
82
+ l.type === "date" ? (u = r.xAxes.push(
83
+ se.new(e, {
82
84
  maxDeviation: 0.1,
83
85
  groupData: !1,
84
- baseInterval: Y || { timeUnit: "day", count: 1 },
85
- renderer: N.new(e, {}),
86
+ baseInterval: I || { timeUnit: "day", count: 1 },
87
+ renderer: P.new(e, {}),
86
88
  tooltip: T.new(e, {})
87
89
  })
88
- ), d = C.orderBy(p, [o.value])) : (u = t.xAxes.push(
89
- re.new(e, {
90
- categoryField: o.value,
91
- renderer: N.new(e, {}),
90
+ ), m = C.orderBy(p, [l.value])) : (u = r.xAxes.push(
91
+ ie.new(e, {
92
+ categoryField: l.value,
93
+ renderer: P.new(e, {}),
92
94
  tooltip: T.new(e, {})
93
95
  })
94
96
  ), e.numberFormatter.setAll({
95
97
  numberFormat: "#",
96
98
  numericFields: ["valueX"]
97
- }), d = C.orderBy(p, [o.value]), u.data.setAll(d));
98
- function E(l, i, c, G, S, b, V) {
99
- const f = te.new(e, { opposite: S }), k = t.yAxes.push(
100
- Q.new(e, { maxDeviation: 1, renderer: f })
99
+ }), m = C.orderBy(p, [l.value]), u.data.setAll(m));
100
+ function E(i, o, c, S, W, v, M) {
101
+ const f = ae.new(e, { opposite: W }), k = r.yAxes.push(
102
+ te.new(e, { maxDeviation: 1, renderer: f })
101
103
  );
102
- t.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", t.yAxes.getIndex(0));
103
- const a = t.series.push(
104
- ae.new(e, {
105
- name: i,
104
+ r.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", r.yAxes.getIndex(0));
105
+ const a = r.series.push(
106
+ le.new(e, {
107
+ name: o,
106
108
  xAxis: u,
107
109
  yAxis: k,
108
- valueYField: G,
109
- ...o.type === "date" ? { valueXField: c } : { categoryXField: c },
110
+ valueYField: S,
111
+ ...l.type === "date" ? { valueXField: c } : { categoryXField: c },
110
112
  tooltip: T.new(e, {
111
113
  pointerOrientation: "horizontal",
112
- labelText: `${i}: {valueY}`
114
+ labelText: `${o}: {valueY}`
113
115
  })
114
116
  })
115
117
  );
@@ -117,12 +119,12 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
117
119
  stroke: a.get("fill"),
118
120
  strokeOpacity: 1,
119
121
  opacity: 1
120
- }), V === "date" && (a.data.processor = ie.new(e, {
122
+ }), M === "date" && (a.data.processor = ne.new(e, {
121
123
  dateFormat: "i",
122
124
  dateFields: [c]
123
- })), b !== void 0 && a.bullets.push(function() {
125
+ })), v !== void 0 && a.bullets.push(function() {
124
126
  let g;
125
- return b === "RECTANGLE" ? g = j.new(e, {
127
+ return v === "RECTANGLE" ? g = q.new(e, {
126
128
  width: 10,
127
129
  height: 10,
128
130
  centerX: w,
@@ -130,56 +132,56 @@ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], De = (L) => {
130
132
  strokeWidth: 2,
131
133
  stroke: a.get("stroke"),
132
134
  fill: e.interfaceColors.get("background")
133
- }) : b === "TRIANGLE" ? g = x.new(e, {
135
+ }) : v === "TRIANGLE" ? g = x.new(e, {
134
136
  width: 10,
135
137
  height: 10,
136
138
  strokeWidth: 2,
137
139
  stroke: a.get("stroke"),
138
140
  fill: e.interfaceColors.get("background")
139
- }) : g = oe.new(e, {
141
+ }) : g = ce.new(e, {
140
142
  strokeWidth: 2,
141
143
  radius: 4,
142
144
  stroke: a.get("stroke"),
143
145
  fill: e.interfaceColors.get("background")
144
- }), le.new(e, { sprite: g });
145
- }), a.data.setAll(l);
146
+ }), ue.new(e, { sprite: g });
147
+ }), a.data.setAll(i);
146
148
  }
147
- if (t.set(
149
+ if (r.set(
148
150
  "cursor",
149
- se.new(e, { xAxis: u, behavior: "none" })
150
- ).lineY.set("visible", !1), r.length > 1) {
151
- const l = C.groupBy(d, r[1].value);
152
- Object.keys(l).forEach((i, c) => {
151
+ oe.new(e, { xAxis: u, behavior: "none" })
152
+ ).lineY.set("visible", !1), s.length > 1) {
153
+ const i = C.groupBy(m, s[1].value);
154
+ Object.keys(i).forEach((o, c) => {
153
155
  E(
154
- l[i],
155
- i,
156
- r[0].value,
157
- s[0].dataFieldName,
156
+ i[o],
157
+ F(o),
158
+ s[0].value,
159
+ t[0].dataFieldName,
158
160
  c !== 0,
159
161
  A[c % A.length]
160
162
  );
161
163
  });
162
164
  } else
163
- s.forEach((l, i) => {
165
+ t.forEach((i, o) => {
164
166
  E(
165
- d,
166
- l.name,
167
- o.value,
168
- l.dataFieldName,
169
- i !== 0,
170
- A[i % A.length],
171
- o.type
167
+ m,
168
+ i.label ?? F(i.name),
169
+ l.value,
170
+ i.dataFieldName,
171
+ o !== 0,
172
+ A[o % A.length],
173
+ l.type
172
174
  );
173
175
  });
174
- B.data.setAll(t.series.values), t.appear(1e3, 100);
175
- }, X), () => {
176
+ G.data.setAll(r.series.values), Z(e, (N = t == null ? void 0 : t[0]) == null ? void 0 : N.format), r.appear(1e3, 100);
177
+ }, Y), () => {
176
178
  var e;
177
- v && clearTimeout(v), (e = y.current) == null || e.dispose(), y.current = null;
179
+ b && clearTimeout(b), (e = y.current) == null || e.dispose(), y.current = null;
178
180
  };
179
- }, [p, r, s, h.palette.mode, R]);
180
- const O = { ...n };
181
- return { chartId: _, ownerState: O, sx: F, error: m, other: I };
181
+ }, [p, s, t, d.palette.mode, R]);
182
+ const B = { ...n };
183
+ return { chartId: _, ownerState: B, sx: O, error: h, other: V };
182
184
  };
183
185
  export {
184
- De as useMultipleValueAxesLogic
186
+ Ee as useMultipleValueAxesLogic
185
187
  };
@@ -1,52 +1,53 @@
1
- import { R as C, A as S } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as E, useTheme as L } from "@mui/material";
3
- import j from "dayjs";
1
+ import { R as S, A as E } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as L, useTheme as j } from "@mui/material";
3
+ import q from "dayjs";
4
4
  import T from "lodash";
5
- import { useId as q, useRef as B, useEffect as H } from "react";
6
- import { colorSetFromPalette as I } from "../_common/utils.js";
5
+ import { useId as B, useRef as H, useEffect as I } from "react";
6
+ import { applyValueFormat as W, colorSetFromPalette as O } from "../_common/utils.js";
7
7
  import { c as n, p as o } from "../../../ColorSet-C7vpNXhM.js";
8
- import { P as W, a as F } from "../../../PieSeries-B2fW3z0s.js";
9
- const U = (N) => {
10
- const v = E({ props: N, name: "HCNestedPie" }), {
8
+ import { P as V, a as N } from "../../../PieSeries-B2fW3z0s.js";
9
+ const Z = (b) => {
10
+ const g = L({ props: b, name: "HCNestedPie" }), {
11
11
  dimensions: a,
12
- values: s,
12
+ values: r,
13
13
  data: d,
14
- initDelay: b = 0,
15
- colors: g,
16
- sx: x,
17
- ...k
18
- } = v, i = L(), y = `hc-nested-pie-${q().replace(/:/g, "")}`, m = B(null);
14
+ initDelay: x = 0,
15
+ colors: v,
16
+ sx: k,
17
+ ...w
18
+ } = g, i = j(), y = `hc-nested-pie-${B().replace(/:/g, "")}`, m = H(null);
19
19
  let c = null;
20
- a.length < 2 ? c = "NestedPie requires at least 2 dimensions" : s.length < 1 && (c = "NestedPie requires at least 1 value"), H(() => {
20
+ a.length < 2 ? c = "NestedPie requires at least 2 dimensions" : r.length < 1 && (c = "NestedPie requires at least 1 value"), I(() => {
21
21
  if (c) return;
22
22
  let p;
23
23
  return p = setTimeout(() => {
24
- const e = C.new(y);
25
- m.current = e, e.setThemes([S.new(e)]), e.interfaceColors.setAll({
24
+ var Y;
25
+ const e = S.new(y);
26
+ m.current = e, W(e, (Y = r == null ? void 0 : r[0]) == null ? void 0 : Y.format), e.setThemes([E.new(e)]), e.interfaceColors.setAll({
26
27
  text: n(i.palette.text.primary),
27
28
  grid: n(i.palette.divider),
28
29
  stroke: n(i.palette.divider)
29
30
  });
30
31
  const f = e.container.children.push(
31
- W.new(e, {
32
+ V.new(e, {
32
33
  layout: e.verticalLayout,
33
34
  radius: o(100)
34
35
  })
35
36
  );
36
- a[0].type === "date" && d.forEach((r) => {
37
+ a[0].type === "date" && d.forEach((s) => {
37
38
  let l = "YYYY";
38
- a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), r[a[0].value] = j(r[a[0].value]).format(
39
+ a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] = q(s[a[0].value]).format(
39
40
  l
40
41
  );
41
42
  });
42
- const h = T.orderBy(d, (r) => r[a[0].value]);
43
- a.forEach((r, l) => {
44
- const Y = e.interfaceColors.get("background");
43
+ const h = T.orderBy(d, (s) => s[a[0].value]);
44
+ a.forEach((s, l) => {
45
+ const A = e.interfaceColors.get("background");
45
46
  if (l === 0) {
46
47
  const t = f.series.push(
47
- F.new(e, {
48
- valueField: s[0].dataFieldName,
49
- categoryField: r.value,
48
+ N.new(e, {
49
+ valueField: r[0].dataFieldName,
50
+ categoryField: s.value,
50
51
  alignLabels: !1,
51
52
  radius: o(80),
52
53
  innerRadius: o(25)
@@ -58,47 +59,47 @@ const U = (N) => {
58
59
  textType: "radial",
59
60
  centerX: o(100)
60
61
  }), t.slices.template.setAll({
61
- stroke: Y,
62
+ stroke: A,
62
63
  strokeWidth: 2,
63
64
  fill: n(11184810),
64
65
  tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
65
66
  }), t.slices.template.states.create("hover", { scale: 0.95 }), a.length > 1) {
66
- const u = [], A = T.groupBy(h, r.value);
67
- Object.keys(A).forEach((P) => {
68
- const D = A[P].reduce((M, R) => M + R[s[0].dataFieldName], 0);
67
+ const u = [], F = T.groupBy(h, s.value);
68
+ Object.keys(F).forEach((P) => {
69
+ const M = F[P].reduce((R, C) => R + C[r[0].dataFieldName], 0);
69
70
  u.push({
70
- [r.value]: P,
71
- [s[0].dataFieldName]: D
71
+ [s.value]: P,
72
+ [r[0].dataFieldName]: M
72
73
  });
73
74
  }), t.data.setAll(u);
74
75
  } else
75
76
  t.data.setAll(h);
76
77
  } else if (l === 1) {
77
78
  const t = f.series.push(
78
- F.new(e, {
79
- valueField: s[0].dataFieldName,
80
- categoryField: r.value,
79
+ N.new(e, {
80
+ valueField: r[0].dataFieldName,
81
+ categoryField: s.value,
81
82
  alignLabels: !0,
82
83
  innerRadius: o(80),
83
84
  radius: o(100)
84
85
  })
85
- ), u = I(e, g);
86
+ ), u = O(e, v);
86
87
  t.set("colors", u), t.slices.template.setAll({
87
- stroke: Y,
88
+ stroke: A,
88
89
  strokeWidth: 2,
89
90
  templateField: "settings",
90
91
  tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
91
92
  }), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(h);
92
93
  }
93
94
  }), f.appear(1e3, 100);
94
- }, b), () => {
95
+ }, x), () => {
95
96
  var e;
96
97
  p && clearTimeout(p), (e = m.current) == null || e.dispose(), m.current = null;
97
98
  };
98
- }, [d, a, s, i.palette.mode, g]);
99
- const w = { ...v };
100
- return { chartId: y, ownerState: w, sx: x, error: c, other: k };
99
+ }, [d, a, r, i.palette.mode, v]);
100
+ const D = { ...g };
101
+ return { chartId: y, ownerState: D, sx: k, error: c, other: w };
101
102
  };
102
103
  export {
103
- U as useNestedPieLogic
104
+ Z as useNestedPieLogic
104
105
  };