@hybridcore/ui 1.6.30 → 1.6.32

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.
@@ -2,44 +2,40 @@ import { R as M, A as O } from "../../../AnimatedTheme-ktdO3Bel.js";
2
2
  import { useThemeProps as B, useTheme as E } from "@mui/material";
3
3
  import P from "lodash";
4
4
  import { useId as V, useRef as G, useEffect as N } from "react";
5
- import { humanizeLabel as C } from "../_common/format.js";
5
+ import { humanizeLabel as k } from "../_common/format.js";
6
6
  import { attachCombinedAxisTooltip as W } from "../_common/tooltip.js";
7
- import { colorSetFromPalette as q, applyDateAxisLabelFormat as z, applyValueFormat as H } from "../_common/utils.js";
8
- import { c as l, p as U, a as D } from "../../../Entity-BJCuhdq_.js";
7
+ import { applyInterfaceColors as q, colorSetFromPalette as z, applyDateAxisLabelFormat as H, applyValueFormat as U } from "../_common/utils.js";
9
8
  import { X as _, V as $ } from "../../../AxisRenderer-BCQoUJw6.js";
10
- import { A as b, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
11
- import { C as J } from "../../../CategoryAxis-B6NqW8qd.js";
12
- import { C as K } from "../../../ColumnSeries-CtRTsn-E.js";
13
- import { D as X, G as Q } from "../../../GaplessDateAxis-B2g2jgSG.js";
14
- import { L as Z } from "../../../LineSeries-D_IL2qGF.js";
15
- import { B as ee } from "../../../Bullet-Djj7Vs9T.js";
16
- import { C as te } from "../../../Circle-BnfBNKBD.js";
17
- import { X as re } from "../../../XYCursor-CVUSpqb9.js";
18
- import { L as ae } from "../../../Legend-CFvQiIfn.js";
19
- import { D as se } from "../../../DateAxis-DEXKps1S.js";
20
- const Xe = (L) => {
9
+ import { A as D, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
10
+ import { c as u, p as J, a as b } from "../../../Entity-BJCuhdq_.js";
11
+ import { C as K } from "../../../CategoryAxis-B6NqW8qd.js";
12
+ import { C as Q } from "../../../ColumnSeries-CtRTsn-E.js";
13
+ import { D as X, G as Z } from "../../../GaplessDateAxis-B2g2jgSG.js";
14
+ import { L as ee } from "../../../LineSeries-D_IL2qGF.js";
15
+ import { B as te } from "../../../Bullet-Djj7Vs9T.js";
16
+ import { C as re } from "../../../Circle-BnfBNKBD.js";
17
+ import { X as ae } from "../../../XYCursor-CVUSpqb9.js";
18
+ import { L as se } from "../../../Legend-CFvQiIfn.js";
19
+ import { D as oe } from "../../../DateAxis-DEXKps1S.js";
20
+ const Le = (L) => {
21
21
  const f = B({ props: L, name: "HCColumnLineMix" }), {
22
22
  dimensions: t,
23
- values: n,
24
- data: p,
23
+ values: l,
24
+ data: m,
25
25
  initDelay: Y = 0,
26
- baseInterval: x,
27
- colors: h,
26
+ baseInterval: h,
27
+ colors: x,
28
28
  skipEmptyDates: A = !1,
29
29
  sx: T,
30
30
  ...R
31
- } = f, o = E(), g = `hc-column-line-mix-${V().replace(/:/g, "")}`, d = G(null), y = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
31
+ } = f, i = E(), y = `hc-column-line-mix-${V().replace(/:/g, "")}`, p = G(null), g = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
32
32
  N(() => {
33
- if (y) return;
34
- let c;
35
- return c = setTimeout(() => {
36
- var w, F, v, k;
37
- const e = M.new(g);
38
- d.current = e, e.setThemes([O.new(e)]), e.interfaceColors.setAll({
39
- text: l(o.palette.text.primary),
40
- grid: l(o.palette.divider),
41
- stroke: l(o.palette.divider)
42
- });
33
+ if (g) return;
34
+ let d;
35
+ return d = setTimeout(() => {
36
+ var w, F, v, C;
37
+ const e = M.new(y);
38
+ p.current = e, e.setThemes([O.new(e)]), q(e, i);
43
39
  const r = e.container.children.push(
44
40
  _.new(e, {
45
41
  panX: !1,
@@ -51,70 +47,70 @@ const Xe = (L) => {
51
47
  layout: e.verticalLayout
52
48
  })
53
49
  );
54
- r.set("colors", q(e, h)), r.get("colors", {}).set("step", 3);
55
- let a, m = p;
50
+ r.set("colors", z(e, x)), r.get("colors", {}).set("step", 3);
51
+ let a, n = m;
56
52
  if (t[0].type === "date") {
57
- m = P.orderBy(p, [t[0].value]);
58
- const i = A ? Q : se;
53
+ n = P.orderBy(m, [t[0].value]);
54
+ const o = A ? Z : oe;
59
55
  a = r.xAxes.push(
60
- i.new(e, {
56
+ o.new(e, {
61
57
  maxDeviation: 0.1,
62
58
  groupData: !1,
63
- baseInterval: x || { timeUnit: "day", count: 1 },
64
- renderer: b.new(e, {})
59
+ baseInterval: h || { timeUnit: "day", count: 1 },
60
+ renderer: D.new(e, {})
65
61
  })
66
62
  ), (w = a.get("renderer")) == null || w.grid.template.setAll({
67
- stroke: l(o.palette.divider),
63
+ stroke: u(i.palette.divider),
68
64
  strokeOpacity: 1
69
- }), z(a, t[0]);
65
+ }), H(a, t[0]);
70
66
  } else
71
67
  a = r.xAxes.push(
72
- J.new(e, {
68
+ K.new(e, {
73
69
  categoryField: t[0].value,
74
- renderer: b.new(e, {})
70
+ renderer: D.new(e, {})
75
71
  })
76
72
  ), (F = a.get("renderer")) == null || F.grid.template.setAll({
77
- stroke: l(o.palette.divider),
73
+ stroke: u(i.palette.divider),
78
74
  strokeOpacity: 1
79
75
  }), e.numberFormatter.setAll({
80
76
  numberFormat: "#",
81
77
  numericFields: ["valueX"]
82
- }), a.data.setAll(m);
83
- const u = r.yAxes.push(
78
+ }), a.data.setAll(n);
79
+ const c = r.yAxes.push(
84
80
  $.new(e, {
85
81
  min: 0,
86
82
  extraMax: 0.1,
87
83
  renderer: j.new(e, { strokeOpacity: 0.1 })
88
84
  })
89
85
  );
90
- (v = u.get("renderer")) == null || v.grid.template.setAll({
91
- stroke: l(o.palette.divider),
86
+ (v = c.get("renderer")) == null || v.grid.template.setAll({
87
+ stroke: u(i.palette.divider),
92
88
  strokeOpacity: 1
93
- }), n.forEach((i, I) => {
89
+ }), l.forEach((o, I) => {
94
90
  if (I === 0) {
95
91
  const s = r.series.push(
96
- K.new(e, {
97
- name: i.label ?? C(i.name),
92
+ Q.new(e, {
93
+ name: o.label ?? k(o.name),
98
94
  xAxis: a,
99
- yAxis: u,
100
- valueYField: i.dataFieldName,
95
+ yAxis: c,
96
+ valueYField: o.dataFieldName,
101
97
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
102
98
  })
103
99
  );
104
100
  s.columns.template.setAll({
105
- tooltipY: U(10),
101
+ tooltipY: J(10),
106
102
  templateField: "columnSettings"
107
103
  }), t[0].type === "date" && (s.data.processor = X.new(e, {
108
104
  dateFormat: "i",
109
105
  dateFields: [t[0].value]
110
- })), s.data.setAll(m), s.appear();
106
+ })), s.data.setAll(n), s.appear();
111
107
  } else {
112
108
  const s = r.series.push(
113
- Z.new(e, {
114
- name: i.label ?? C(i.name),
109
+ ee.new(e, {
110
+ name: o.label ?? k(o.name),
115
111
  xAxis: a,
116
- yAxis: u,
117
- valueYField: i.dataFieldName,
112
+ yAxis: c,
113
+ valueYField: o.dataFieldName,
118
114
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
119
115
  })
120
116
  );
@@ -124,9 +120,9 @@ const Xe = (L) => {
124
120
  }), t[0].type === "date" && (s.data.processor = X.new(e, {
125
121
  dateFormat: "i",
126
122
  dateFields: [t[0].value]
127
- })), s.data.setAll(m), s.bullets.push(function() {
128
- return ee.new(e, {
129
- sprite: te.new(e, {
123
+ })), s.data.setAll(n), s.bullets.push(function() {
124
+ return te.new(e, {
125
+ sprite: re.new(e, {
130
126
  strokeWidth: 3,
131
127
  stroke: s.get("stroke"),
132
128
  radius: 5,
@@ -137,29 +133,29 @@ const Xe = (L) => {
137
133
  }
138
134
  }), r.set(
139
135
  "cursor",
140
- re.new(e, { xAxis: a, behavior: "none" })
136
+ ae.new(e, { xAxis: a, behavior: "none" })
141
137
  ).lineY.set("visible", !1), W({
142
138
  root: e,
143
139
  chart: r,
144
140
  xAxis: a,
145
- theme: o,
141
+ theme: i,
146
142
  isDateAxis: t[0].type === "date",
147
- baseInterval: x,
143
+ baseInterval: h,
148
144
  follow: !0
149
145
  }), r.children.push(
150
- ae.new(e, {
151
- centerX: D,
152
- x: D
146
+ se.new(e, {
147
+ centerX: b,
148
+ x: b
153
149
  })
154
- ).data.setAll(r.series.values), H(e, (k = n == null ? void 0 : n[0]) == null ? void 0 : k.format), r.appear(1e3, 100);
150
+ ).data.setAll(r.series.values), U(e, (C = l == null ? void 0 : l[0]) == null ? void 0 : C.format), r.appear(1e3, 100);
155
151
  }, Y), () => {
156
152
  var e;
157
- c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
153
+ d && clearTimeout(d), (e = p.current) == null || e.dispose(), p.current = null;
158
154
  };
159
- }, [p, t, n, o.palette.mode, h, A]);
155
+ }, [m, t, l, i.palette.mode, x, A]);
160
156
  const S = { ...f };
161
- return { chartId: g, ownerState: S, sx: T, error: y, other: R };
157
+ return { chartId: y, ownerState: S, sx: T, error: g, other: R };
162
158
  };
163
159
  export {
164
- Xe as useColumnLineMixLogic
160
+ Le as useColumnLineMixLogic
165
161
  };
@@ -3,118 +3,115 @@ import { useThemeProps as z, useTheme as E } from "@mui/material";
3
3
  import W from "dayjs";
4
4
  import { useId as X, useRef as j, useEffect as H } from "react";
5
5
  import { formatDateValue as O } from "../_common/format.js";
6
- import { applyValueFormat as $, colorSetFromPalette as q, buildSliceText as k, applyLegendPercentFormat as G, readSharePercent as J } from "../_common/utils.js";
7
- import { P as K, a as Q } from "../../../PieSeries-CMH0Z7pz.js";
8
- import { p as c, c as d } from "../../../Entity-BJCuhdq_.js";
9
- import { L as U } from "../../../Legend-CFvQiIfn.js";
10
- import { L as Z } from "../../../Tooltip-vyZRZWih.js";
11
- const de = (A) => {
12
- const y = z({ props: A, name: "HCDonutChart" }), {
6
+ import { applyValueFormat as $, applyInterfaceColors as q, colorSetFromPalette as G, buildSliceText as P, applyLegendPercentFormat as J, readSharePercent as K } from "../_common/utils.js";
7
+ import { P as Q, a as U } from "../../../PieSeries-CMH0Z7pz.js";
8
+ import { p as i, c as v } from "../../../Entity-BJCuhdq_.js";
9
+ import { L as Z } from "../../../Legend-CFvQiIfn.js";
10
+ import { L as _ } from "../../../Tooltip-vyZRZWih.js";
11
+ const pe = (k) => {
12
+ const x = z({ props: k, name: "HCDonutChart" }), {
13
13
  dimensions: a,
14
- values: o,
15
- data: m,
16
- initDelay: P = 0,
14
+ values: r,
15
+ data: c,
16
+ initDelay: A = 0,
17
17
  colors: T,
18
18
  showDimensionLabel: Y = !1,
19
- showValueText: f = !0,
19
+ showValueText: h = !0,
20
20
  percentDecimals: p = 2,
21
21
  sx: R,
22
22
  ...C
23
- } = y, i = E(), w = `hc-donut-chart-${X().replace(/:/g, "")}`, g = j(null), l = o.length > 1;
24
- let u = null;
25
- o.length < 1 ? u = "Missing values config!" : !l && a.length < 1 && (u = "Missing dimensions config!"), H(() => {
26
- if (u) return;
27
- let v;
28
- return v = setTimeout(() => {
23
+ } = x, m = E(), w = `hc-donut-chart-${X().replace(/:/g, "")}`, f = j(null), n = r.length > 1;
24
+ let d = null;
25
+ r.length < 1 ? d = "Missing values config!" : !n && a.length < 1 && (d = "Missing dimensions config!"), H(() => {
26
+ if (d) return;
27
+ let g;
28
+ return g = setTimeout(() => {
29
29
  var M, F;
30
30
  const e = N.new(w);
31
- g.current = e, $(e, (M = o == null ? void 0 : o[0]) == null ? void 0 : M.format), e.setThemes([V.new(e)]);
32
- const x = e.container.children.push(
33
- K.new(e, {
31
+ f.current = e, $(e, (M = r == null ? void 0 : r[0]) == null ? void 0 : M.format), e.setThemes([V.new(e)]);
32
+ const y = e.container.children.push(
33
+ Q.new(e, {
34
34
  layout: e.verticalLayout,
35
- innerRadius: c(50)
35
+ innerRadius: i(50)
36
36
  })
37
37
  );
38
- e.interfaceColors.setAll({
39
- text: d(i.palette.text.primary),
40
- grid: d(i.palette.divider),
41
- stroke: d(i.palette.divider),
38
+ q(e, m, {
42
39
  // Drives the gap color between slices; tie it to the surface so the
43
40
  // beveled edges read correctly in both light and dark mode.
44
- background: d(i.palette.background.paper)
41
+ background: v(m.palette.background.paper)
45
42
  });
46
- const I = l ? o.map((r) => {
43
+ const B = n ? r.map((o) => {
47
44
  var s;
48
45
  return {
49
- category: r.label || r.name || r.fieldName,
50
- value: (s = m[0]) == null ? void 0 : s[r.dataFieldName]
46
+ category: o.label || o.name || o.fieldName,
47
+ value: (s = c[0]) == null ? void 0 : s[o.dataFieldName]
51
48
  };
52
- }) : m, t = x.series.push(
53
- Q.new(e, {
54
- valueField: l ? "value" : o[0].dataFieldName,
55
- categoryField: l ? "category" : a[0].value
49
+ }) : c, t = y.series.push(
50
+ U.new(e, {
51
+ valueField: n ? "value" : r[0].dataFieldName,
52
+ categoryField: n ? "category" : a[0].value
56
53
  })
57
54
  );
58
- t.set("colors", q(e, T));
59
- const b = k({ percentDecimals: p, showValueText: f });
55
+ t.set("colors", G(e, T));
56
+ const b = P({ percentDecimals: p, showValueText: h });
60
57
  t.slices.template.setAll({
61
58
  tooltipText: b,
62
- stroke: d(i.palette.background.paper),
59
+ stroke: v(m.palette.background.paper),
63
60
  strokeWidth: 2,
64
61
  strokeOpacity: 1,
65
62
  cornerRadius: 4
66
- }), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius", c(80)), t.labels.template.setAll({
63
+ }), t.slices.template.states.create("hover", { scale: 1.04 }), t.set("radius", i(80)), t.labels.template.setAll({
67
64
  text: b,
68
65
  maxWidth: 140,
69
66
  oversizedBehavior: "wrap"
70
67
  });
71
- const D = (r, s) => {
72
- const S = J(s);
73
- return S === void 0 ? r : k({ percentDecimals: p, showValueText: f, percent: S });
68
+ const D = (o, s) => {
69
+ const S = K(s);
70
+ return S === void 0 ? o : P({ percentDecimals: p, showValueText: h, percent: S });
74
71
  };
75
- t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !l && a[0].type === "date" && m.forEach((r) => {
72
+ t.slices.template.adapters.add("tooltipText", D), t.labels.template.adapters.add("text", D), !n && a[0].type === "date" && c.forEach((o) => {
76
73
  let s = "YYYY";
77
- a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"), r[a[0].value] = W(r[a[0].value]).format(
74
+ a[0].value.includes("month") ? s = "MMM YYYY" : a[0].value.includes("day") && (s = "DD MMM YYYY"), o[a[0].value] = W(o[a[0].value]).format(
78
75
  s
79
76
  );
80
- }), t.data.setAll(I);
81
- const L = x.children.push(
82
- U.new(e, {
83
- centerX: c(50),
84
- x: c(50),
77
+ }), t.data.setAll(B);
78
+ const L = y.children.push(
79
+ Z.new(e, {
80
+ centerX: i(50),
81
+ x: i(50),
85
82
  marginTop: 15,
86
83
  marginBottom: 15
87
84
  })
88
85
  );
89
- G(L, p), L.data.setAll(t.dataItems);
90
- const n = a[0], h = n ? (F = m[0]) == null ? void 0 : F[n.value] : void 0;
91
- Y && l && n && h != null && h !== "" && x.children.push(
92
- Z.new(e, {
93
- text: n.type === "date" ? O(h, n.dateFormat, n.value) : String(h),
94
- centerX: c(50),
95
- x: c(50),
96
- fill: d(i.palette.text.secondary),
86
+ J(L, p), L.data.setAll(t.dataItems);
87
+ const l = a[0], u = l ? (F = c[0]) == null ? void 0 : F[l.value] : void 0;
88
+ Y && n && l && u != null && u !== "" && y.children.push(
89
+ _.new(e, {
90
+ text: l.type === "date" ? O(u, l.dateFormat, l.value) : String(u),
91
+ centerX: i(50),
92
+ x: i(50),
93
+ fill: v(m.palette.text.secondary),
97
94
  fontSize: 12,
98
95
  paddingBottom: 8
99
96
  })
100
97
  ), t.appear(1e3, 100);
101
- }, P), () => {
98
+ }, A), () => {
102
99
  var e;
103
- v && clearTimeout(v), (e = g.current) == null || e.dispose(), g.current = null;
100
+ g && clearTimeout(g), (e = f.current) == null || e.dispose(), f.current = null;
104
101
  };
105
102
  }, [
106
- m,
103
+ c,
107
104
  a,
108
- o,
109
- i.palette.mode,
105
+ r,
106
+ m.palette.mode,
110
107
  T,
111
108
  Y,
112
- f,
109
+ h,
113
110
  p
114
111
  ]);
115
- const B = { ...y };
116
- return { chartId: w, ownerState: B, sx: R, error: u, other: C };
112
+ const I = { ...x };
113
+ return { chartId: w, ownerState: I, sx: R, error: d, other: C };
117
114
  };
118
115
  export {
119
- de as useDonutChartLogic
116
+ pe as useDonutChartLogic
120
117
  };