@hybridcore/ui 1.6.6 → 1.6.8

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.
@@ -1,17 +1,18 @@
1
- import { k as $, l as J, x as c, m as h, s as g, a as pe, n as ne, C as xe, G as K, o as le, q as ve, t as L, y as C, j as oe, z as ue, R as ye, A as be, T as U } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as Pe, useTheme as Re } from "@mui/material";
3
- import _e from "dayjs";
1
+ import { k as $, l as J, x as c, m as h, s as g, a as xe, n as ne, C as ve, G as K, o as le, q as ye, t as L, y as C, j as oe, z as ue, R as be, A as Pe, T as U } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as Re, useTheme as _e } from "@mui/material";
3
+ import we from "dayjs";
4
4
  import W from "lodash";
5
- import { useId as we, useRef as Te, useEffect as Ce } from "react";
6
- import { applyValueFormat as Le, colorSetFromPalette as Me } from "../_common/utils.js";
7
- import { m as M, x as R, b as Q, f as m, p as w, a as N, P as De, c as Y } from "../../../ColorSet-C7vpNXhM.js";
8
- import { a as I, X as he, V as Ye } from "../../../AxisRenderer-DTyLLA6c.js";
9
- import { R as ge, S as Ne, a as V } from "../../../Slice-B19rbYDZ.js";
10
- import { X as ce } from "../../../XYCursor-C8WktvKM.js";
11
- import { C as de } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { L as fe } from "../../../LineSeries-Uiv5o56b.js";
13
- import { L as Oe } from "../../../Legend-Dp_MKfS4.js";
14
- class O extends ge {
5
+ import { useId as Te, useRef as Ce, useEffect as Le } from "react";
6
+ import { humanizeLabel as de } from "../_common/format.js";
7
+ import { applyValueFormat as Me, colorSetFromPalette as De } from "../_common/utils.js";
8
+ import { m as M, x as R, b as Q, f as m, p as w, a as N, P as Ye, c as Y } from "../../../ColorSet-C7vpNXhM.js";
9
+ import { a as I, X as ge, V as Ne } from "../../../AxisRenderer-DTyLLA6c.js";
10
+ import { R as ce, S as Oe, a as V } from "../../../Slice-B19rbYDZ.js";
11
+ import { X as fe } from "../../../XYCursor-C8WktvKM.js";
12
+ import { C as he } from "../../../CategoryAxis-CwnfaGc8.js";
13
+ import { L as me } from "../../../LineSeries-Uiv5o56b.js";
14
+ import { L as Se } from "../../../Legend-Dp_MKfS4.js";
15
+ class O extends ce {
15
16
  constructor() {
16
17
  super(...arguments), Object.defineProperty(this, "_tickPoints", {
17
18
  enumerable: !0,
@@ -31,7 +32,7 @@ Object.defineProperty(O, "classNames", {
31
32
  enumerable: !0,
32
33
  configurable: !0,
33
34
  writable: !0,
34
- value: ge.classNames.concat([O.className])
35
+ value: ce.classNames.concat([O.className])
35
36
  });
36
37
  class G extends I {
37
38
  constructor() {
@@ -46,7 +47,7 @@ class G extends I {
46
47
  enumerable: !0,
47
48
  configurable: !0,
48
49
  writable: !0,
49
- value: this.addDisposer(new $(J.new({}), () => Ne._new(this._root, {
50
+ value: this.addDisposer(new $(J.new({}), () => Oe._new(this._root, {
50
51
  themeTags: M(this.axisFills.template.get("themeTags", ["fill"]), this.get("themeTags", []))
51
52
  }, [this.axisFills.template])))
52
53
  }), Object.defineProperty(this, "_fillGenerator", {
@@ -408,7 +409,7 @@ Object.defineProperty(k, "classNames", {
408
409
  writable: !0,
409
410
  value: I.classNames.concat([k.className])
410
411
  });
411
- class Se extends pe {
412
+ class Xe extends xe {
412
413
  setupDefaultRules() {
413
414
  super.setupDefaultRules();
414
415
  const e = this.rule.bind(this), t = this._root.interfaceColors;
@@ -477,13 +478,13 @@ class Se extends pe {
477
478
  }
478
479
  }
479
480
  }
480
- class B extends he {
481
+ class B extends ge {
481
482
  constructor() {
482
483
  super(...arguments), Object.defineProperty(this, "radarContainer", {
483
484
  enumerable: !0,
484
485
  configurable: !0,
485
486
  writable: !0,
486
- value: this.plotContainer.children.push(xe.new(this._root, { x: N, y: N }))
487
+ value: this.plotContainer.children.push(ve.new(this._root, { x: N, y: N }))
487
488
  }), Object.defineProperty(this, "_arcGenerator", {
488
489
  enumerable: !0,
489
490
  configurable: !0,
@@ -497,7 +498,7 @@ class B extends he {
497
498
  });
498
499
  }
499
500
  _afterNew() {
500
- this._defaultThemes.push(Se.new(this._root)), super._afterNew();
501
+ this._defaultThemes.push(Xe.new(this._root)), super._afterNew();
501
502
  const e = this.radarContainer, t = this.gridContainer, s = this.topGridContainer, i = this.seriesContainer, a = this.bulletsContainer;
502
503
  e.children.pushAll([t, i, s, a]), i.set("mask", K.new(this._root, {})), t.set("mask", K.new(this._root, {})), this._disposers.push(this.plotContainer.events.on("boundschanged", () => {
503
504
  this._updateRadius();
@@ -511,11 +512,11 @@ class B extends he {
511
512
  let n = le(0, 0, i, a, 1);
512
513
  const l = t / (n.right - n.left), u = s / (n.bottom - n.top);
513
514
  let o = { left: 0, right: 0, top: 0, bottom: 0 };
514
- if (r instanceof De) {
515
+ if (r instanceof Ye) {
515
516
  let f = r.value, T = Math.min(l, u);
516
517
  f = Math.max(T * f, T - Math.min(s, t)) / T, o = le(0, 0, i, a, f), this.setPrivateRaw("irModifyer", f / r.value);
517
518
  }
518
- n = ve([n, o]), this._maxRadius = Math.max(0, Math.min(l, u));
519
+ n = ye([n, o]), this._maxRadius = Math.max(0, Math.min(l, u));
519
520
  const y = R(this.get("radius", 0), this._maxRadius);
520
521
  this.radarContainer.setAll({
521
522
  dy: -y * (n.bottom + n.top) / 2,
@@ -583,9 +584,9 @@ Object.defineProperty(B, "classNames", {
583
584
  enumerable: !0,
584
585
  configurable: !0,
585
586
  writable: !0,
586
- value: he.classNames.concat([B.className])
587
+ value: ge.classNames.concat([B.className])
587
588
  });
588
- class F extends ce {
589
+ class F extends fe {
589
590
  constructor() {
590
591
  super(...arguments), Object.defineProperty(this, "_fillGenerator", {
591
592
  enumerable: !0,
@@ -675,9 +676,9 @@ Object.defineProperty(F, "classNames", {
675
676
  enumerable: !0,
676
677
  configurable: !0,
677
678
  writable: !0,
678
- value: ce.classNames.concat([F.className])
679
+ value: fe.classNames.concat([F.className])
679
680
  });
680
- class E extends fe {
681
+ class E extends me {
681
682
  _afterNew() {
682
683
  super._afterNew(), this.set("maskContent", !1), this.bulletsContainer.set("maskContent", !1), this.bulletsContainer.set("mask", K.new(this._root, {}));
683
684
  }
@@ -718,10 +719,10 @@ Object.defineProperty(E, "classNames", {
718
719
  enumerable: !0,
719
720
  configurable: !0,
720
721
  writable: !0,
721
- value: fe.classNames.concat([E.className])
722
+ value: me.classNames.concat([E.className])
722
723
  });
723
- const Je = (_) => {
724
- const e = Pe({ props: _, name: "HCStackedAreaRadar" }), {
724
+ const Qe = (_) => {
725
+ const e = Re({ props: _, name: "HCStackedAreaRadar" }), {
725
726
  dimensions: t,
726
727
  values: s,
727
728
  data: i,
@@ -730,15 +731,15 @@ const Je = (_) => {
730
731
  colors: n,
731
732
  sx: l,
732
733
  ...u
733
- } = e, o = Re(), f = `hc-stacked-area-radar-${we().replace(/:/g, "")}`, T = Te(null);
734
+ } = e, o = _e(), f = `hc-stacked-area-radar-${Te().replace(/:/g, "")}`, T = Ce(null);
734
735
  let S = null;
735
- t.length < 2 ? S = "StackedAreaRadar requires at least 2 dimensions" : s.length < 1 && (S = "StackedAreaRadar requires at least 1 value"), Ce(() => {
736
+ t.length < 2 ? S = "StackedAreaRadar requires at least 2 dimensions" : s.length < 1 && (S = "StackedAreaRadar requires at least 1 value"), Le(() => {
736
737
  if (S) return;
737
738
  let z;
738
739
  return z = setTimeout(() => {
739
740
  var ie, ae, re;
740
- const d = ye.new(f);
741
- T.current = d, Le(d, (ie = s == null ? void 0 : s[0]) == null ? void 0 : ie.format), d.setThemes([be.new(d)]), d.interfaceColors.setAll({
741
+ const d = be.new(f);
742
+ T.current = d, Me(d, (ie = s == null ? void 0 : s[0]) == null ? void 0 : ie.format), d.setThemes([Pe.new(d)]), d.interfaceColors.setAll({
742
743
  text: Y(o.palette.text.primary),
743
744
  grid: Y(o.palette.divider),
744
745
  stroke: Y(o.palette.divider)
@@ -754,22 +755,22 @@ const Je = (_) => {
754
755
  arrangeTooltips: !1
755
756
  })
756
757
  );
757
- b.set("colors", Me(d, n)), b.get("colors", {}).set("step", 2), b.set(
758
+ b.set("colors", De(d, n)), b.get("colors", {}).set("step", 2), b.set(
758
759
  "cursor",
759
760
  F.new(d, { behavior: "zoomX" })
760
761
  ).lineY.set("visible", !1);
761
762
  const x = t[0], Ae = t[1];
762
763
  let v = [];
763
764
  const q = W.groupBy(i, Ae.value);
764
- Object.keys(q).forEach((A) => {
765
- q[A].forEach((P) => {
766
- const p = P[x.value], H = W.findIndex(v, { [x.value]: p });
765
+ Object.keys(q).forEach((p) => {
766
+ q[p].forEach((P) => {
767
+ const A = P[x.value], H = W.findIndex(v, { [x.value]: A });
767
768
  H === -1 ? v.push({
768
- [x.value]: p,
769
- [A]: P[s[0].dataFieldName]
769
+ [x.value]: A,
770
+ [p]: P[s[0].dataFieldName]
770
771
  }) : v[H] = {
771
772
  ...v[H],
772
- [A]: P[s[0].dataFieldName]
773
+ [p]: P[s[0].dataFieldName]
773
774
  };
774
775
  });
775
776
  });
@@ -789,22 +790,22 @@ const Je = (_) => {
789
790
  });
790
791
  let D;
791
792
  if (x.type === "date") {
792
- const A = (r == null ? void 0 : r.timeUnit) || "day";
793
+ const p = (r == null ? void 0 : r.timeUnit) || "day";
793
794
  let P = "DD/MM/YYYY";
794
- A === "month" ? P = "MM YYYY" : A === "year" && (P = "YYYY"), D = b.xAxes.push(
795
- de.new(d, {
795
+ p === "month" ? P = "MM YYYY" : p === "year" && (P = "YYYY"), D = b.xAxes.push(
796
+ he.new(d, {
796
797
  maxDeviation: 0,
797
798
  categoryField: x.value,
798
799
  renderer: X,
799
800
  tooltip: U.new(d, {})
800
801
  })
801
- ), v = W.orderBy(v, [x.value]), v = v.map((p) => ({
802
- ...p,
803
- [x.value]: _e(p[x.value]).format(P)
802
+ ), v = W.orderBy(v, [x.value]), v = v.map((A) => ({
803
+ ...A,
804
+ [x.value]: we(A[x.value]).format(P)
804
805
  }));
805
806
  } else
806
807
  D = b.xAxes.push(
807
- de.new(d, {
808
+ he.new(d, {
808
809
  maxDeviation: 0,
809
810
  categoryField: x.value,
810
811
  renderer: X,
@@ -814,7 +815,7 @@ const Je = (_) => {
814
815
  const Z = k.new(d, {
815
816
  minGridDistance: 30
816
817
  }), ee = b.yAxes.push(
817
- Ye.new(d, { renderer: Z })
818
+ Ne.new(d, { renderer: Z })
818
819
  );
819
820
  Z.grid.template.setAll({ strokeDasharray: [2, 2] }), (ae = D.get("renderer")) == null || ae.grid.template.setAll({
820
821
  stroke: Y(o.palette.divider),
@@ -826,15 +827,15 @@ const Je = (_) => {
826
827
  const te = [];
827
828
  let j = "";
828
829
  const se = Object.keys(q);
829
- se.forEach((A, P) => {
830
+ se.forEach((p, P) => {
830
831
  j.length > 0 && (j += `
831
- `), j += `${A}: {${A}}`;
832
- const p = b.series.push(
832
+ `), j += `${de(p)}: {${p}}`;
833
+ const A = b.series.push(
833
834
  E.new(d, {
834
- name: A,
835
+ name: de(p),
835
836
  xAxis: D,
836
837
  yAxis: ee,
837
- valueYField: A,
838
+ valueYField: p,
838
839
  categoryXField: x.value,
839
840
  ...P === se.length - 1 && {
840
841
  stacked: !0,
@@ -842,9 +843,9 @@ const Je = (_) => {
842
843
  }
843
844
  })
844
845
  );
845
- p.strokes.template.setAll({ strokeOpacity: 0 }), p.fills.template.setAll({ visible: !0, fillOpacity: 0.5 }), p.data.setAll(v), p.appear(1e3), te.push(p);
846
+ A.strokes.template.setAll({ strokeOpacity: 0 }), A.fills.template.setAll({ visible: !0, fillOpacity: 0.5 }), A.data.setAll(v), A.appear(1e3), te.push(A);
846
847
  }), b.radarContainer.children.push(
847
- Oe.new(d, {
848
+ Se.new(d, {
848
849
  width: 150,
849
850
  centerX: N,
850
851
  centerY: N
@@ -855,9 +856,9 @@ const Je = (_) => {
855
856
  z && clearTimeout(z), (d = T.current) == null || d.dispose(), T.current = null;
856
857
  };
857
858
  }, [i, t, s, o.palette.mode, n]);
858
- const me = { ...e };
859
- return { chartId: f, ownerState: me, sx: l, error: S, other: u };
859
+ const pe = { ...e };
860
+ return { chartId: f, ownerState: pe, sx: l, error: S, other: u };
860
861
  };
861
862
  export {
862
- Je as useStackedAreaRadarLogic
863
+ Qe as useStackedAreaRadarLogic
863
864
  };
@@ -1,17 +1,18 @@
1
- import { R as q, A as I, T as L, L as N } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as P, useTheme as H } from "@mui/material";
3
- import _ from "dayjs";
1
+ import { R as q, A as I, T as R, L as N } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as P, useTheme as z } from "@mui/material";
3
+ import H from "dayjs";
4
4
  import v from "lodash";
5
- import { useId as $, useRef as z, useEffect as G } from "react";
6
- import { applyValueFormat as J, colorSetFromPalette as K } from "../_common/utils.js";
7
- import { c as m, a as f, p as Q } from "../../../ColorSet-C7vpNXhM.js";
8
- import { X as W, V as Z } from "../../../AxisRenderer-DTyLLA6c.js";
9
- import { A as ee, a as te } from "../../../AxisRendererY-C_ItLPNV.js";
5
+ import { useId as _, useRef as $, useEffect as G } from "react";
6
+ import { humanizeLabel as J } from "../_common/format.js";
7
+ import { applyValueFormat as K, colorSetFromPalette as Q } from "../_common/utils.js";
8
+ import { c as p, a as f, p as W } from "../../../ColorSet-C7vpNXhM.js";
9
+ import { X as Z, V as ee } from "../../../AxisRenderer-DTyLLA6c.js";
10
+ import { A as te, a as re } from "../../../AxisRendererY-C_ItLPNV.js";
10
11
  import { C as D } from "../../../CategoryAxis-CwnfaGc8.js";
11
- import { L as re } from "../../../Legend-Dp_MKfS4.js";
12
- import { C as oe } from "../../../ColumnSeries-CjgdJ2QL.js";
13
- import { B as ae } from "../../../Bullet-DVczI2TD.js";
14
- const ge = (O) => {
12
+ import { L as oe } from "../../../Legend-Dp_MKfS4.js";
13
+ import { C as ae } from "../../../ColumnSeries-CjgdJ2QL.js";
14
+ import { B as se } from "../../../Bullet-DVczI2TD.js";
15
+ const ve = (O) => {
15
16
  const w = P({
16
17
  props: O,
17
18
  name: "HCStackedColumnChart"
@@ -19,26 +20,26 @@ const ge = (O) => {
19
20
  dimensions: d,
20
21
  values: n,
21
22
  data: C,
22
- initDelay: B = 0,
23
+ initDelay: b = 0,
23
24
  baseInterval: h,
24
25
  colors: k,
25
- sx: E,
26
- ...M
27
- } = w, l = H(), T = `hc-stacked-column-chart-${$().replace(/:/g, "")}`, x = z(null);
26
+ sx: B,
27
+ ...E
28
+ } = w, l = z(), T = `hc-stacked-column-chart-${_().replace(/:/g, "")}`, x = $(null);
28
29
  let u = null;
29
30
  d.length < 2 ? u = "StackedColumnChart requires at least 2 dimensions" : n.length < 1 && (u = "StackedColumnChart requires at least 1 value"), G(() => {
30
31
  if (u) return;
31
32
  let y;
32
33
  return y = setTimeout(() => {
33
- var X, S, R;
34
+ var X, S, L;
34
35
  const e = q.new(T);
35
- x.current = e, J(e, (X = n == null ? void 0 : n[0]) == null ? void 0 : X.format), e.setThemes([I.new(e)]), e.interfaceColors.setAll({
36
- text: m(l.palette.text.primary),
37
- grid: m(l.palette.divider),
38
- stroke: m(l.palette.divider)
36
+ x.current = e, K(e, (X = n == null ? void 0 : n[0]) == null ? void 0 : X.format), e.setThemes([I.new(e)]), e.interfaceColors.setAll({
37
+ text: p(l.palette.text.primary),
38
+ grid: p(l.palette.divider),
39
+ stroke: p(l.palette.divider)
39
40
  });
40
41
  const s = e.container.children.push(
41
- W.new(e, {
42
+ Z.new(e, {
42
43
  panX: !1,
43
44
  panY: !1,
44
45
  wheelX: "none",
@@ -46,11 +47,11 @@ const ge = (O) => {
46
47
  layout: e.verticalLayout
47
48
  })
48
49
  );
49
- s.set("colors", K(e, k)), s.get("colors", {}).set("step", 2);
50
- const Y = ee.new(e, {});
50
+ s.set("colors", Q(e, k)), s.get("colors", {}).set("step", 2);
51
+ const Y = te.new(e, {});
51
52
  Y.grid.template.setAll({ location: 1 });
52
53
  const o = d[0], j = d[1];
53
- let c, p = C;
54
+ let c, m = C;
54
55
  if (o.type === "date") {
55
56
  const t = (h == null ? void 0 : h.timeUnit) || "day";
56
57
  let a = "DD/MM/YYYY";
@@ -58,21 +59,21 @@ const ge = (O) => {
58
59
  D.new(e, {
59
60
  categoryField: o.value,
60
61
  renderer: Y,
61
- tooltip: L.new(e, {})
62
+ tooltip: R.new(e, {})
62
63
  })
63
- ), p = v.orderBy(p, [o.value]), p = p.map((r) => ({
64
+ ), m = v.orderBy(m, [o.value]), m = m.map((r) => ({
64
65
  ...r,
65
- [o.value]: _(r[o.value]).format(a)
66
+ [o.value]: H(r[o.value]).format(a)
66
67
  }));
67
68
  } else
68
69
  c = s.xAxes.push(
69
70
  D.new(e, {
70
71
  categoryField: o.value,
71
72
  renderer: Y,
72
- tooltip: L.new(e, {})
73
+ tooltip: R.new(e, {})
73
74
  })
74
75
  );
75
- const i = [], g = v.groupBy(p, j.value);
76
+ const i = [], g = v.groupBy(m, j.value);
76
77
  Object.keys(g).forEach((t) => {
77
78
  g[t].forEach((a) => {
78
79
  const r = a[o.value], A = v.findIndex(i, { [o.value]: r });
@@ -86,26 +87,26 @@ const ge = (O) => {
86
87
  });
87
88
  }), c.data.setAll(i);
88
89
  const F = s.yAxes.push(
89
- Z.new(e, {
90
+ ee.new(e, {
90
91
  min: 0,
91
- renderer: te.new(e, { strokeOpacity: 0.1 })
92
+ renderer: re.new(e, { strokeOpacity: 0.1 })
92
93
  })
93
94
  ), U = s.children.push(
94
- re.new(e, {
95
+ oe.new(e, {
95
96
  centerX: f,
96
97
  x: f
97
98
  })
98
99
  );
99
100
  (S = c.get("renderer")) == null || S.grid.template.setAll({
100
- stroke: m(l.palette.divider),
101
+ stroke: p(l.palette.divider),
101
102
  strokeOpacity: 1
102
- }), (R = F.get("renderer")) == null || R.grid.template.setAll({
103
- stroke: m(l.palette.divider),
103
+ }), (L = F.get("renderer")) == null || L.grid.template.setAll({
104
+ stroke: p(l.palette.divider),
104
105
  strokeOpacity: 1
105
106
  });
106
107
  function V(t, a) {
107
108
  const r = s.series.push(
108
- oe.new(e, {
109
+ ae.new(e, {
109
110
  name: t,
110
111
  stacked: !0,
111
112
  xAxis: c,
@@ -116,9 +117,9 @@ const ge = (O) => {
116
117
  );
117
118
  r.columns.template.setAll({
118
119
  tooltipText: "{name}, {categoryX}: {valueY}",
119
- tooltipY: Q(10)
120
+ tooltipY: W(10)
120
121
  }), r.data.setAll(i), r.appear(), r.bullets.push(function() {
121
- return ae.new(e, {
122
+ return se.new(e, {
122
123
  sprite: N.new(e, {
123
124
  fill: e.interfaceColors.get("alternativeText"),
124
125
  centerY: f,
@@ -128,15 +129,15 @@ const ge = (O) => {
128
129
  });
129
130
  }), U.data.push(r);
130
131
  }
131
- Object.keys(g).forEach((t) => V(t, t)), s.appear(1e3, 100);
132
- }, B), () => {
132
+ Object.keys(g).forEach((t) => V(J(t), t)), s.appear(1e3, 100);
133
+ }, b), () => {
133
134
  var e;
134
135
  y && clearTimeout(y), (e = x.current) == null || e.dispose(), x.current = null;
135
136
  };
136
137
  }, [C, d, n, l.palette.mode, k]);
137
- const b = { ...w };
138
- return { chartId: T, ownerState: b, sx: E, error: u, other: M };
138
+ const M = { ...w };
139
+ return { chartId: T, ownerState: M, sx: B, error: u, other: E };
139
140
  };
140
141
  export {
141
- ge as useStackedColumnChartLogic
142
+ ve as useStackedColumnChartLogic
142
143
  };