@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,41 +1,42 @@
1
- import { R as I, A as P, T as x, b as W, L as G } from "../../../AnimatedTheme-jnasw6rT.js";
2
- import { useThemeProps as N, useTheme as V } from "@mui/material";
3
- import g from "lodash";
4
- import { useId as j, useRef as z, useEffect as H } from "react";
5
- import { colorSetFromPalette as M } from "../_common/utils.js";
6
- import { c as l, a as w, p as U } from "../../../ColorSet-C7vpNXhM.js";
7
- import { X as _, V as $ } from "../../../AxisRenderer-DTyLLA6c.js";
8
- import { L as q } from "../../../Legend-Dp_MKfS4.js";
9
- import { D as J } from "../../../DateAxis-YX3QNIB-.js";
10
- import { A as X, a as K } from "../../../AxisRendererY-C_ItLPNV.js";
11
- import { C as Q } from "../../../CategoryAxis-CwnfaGc8.js";
12
- import { C as Z } from "../../../ColumnSeries-CjgdJ2QL.js";
13
- import { D as ee } from "../../../DataProcessor-CHDO51q4.js";
14
- import { B as te } from "../../../Bullet-DVczI2TD.js";
15
- const ge = (k) => {
16
- const y = N({ props: k, name: "HCXYChart" }), {
1
+ import { R as V, A as W, T as x, b as z, L as G } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as N, useTheme as j } from "@mui/material";
3
+ import X from "lodash";
4
+ import { useId as H, useRef as M, useEffect as U } from "react";
5
+ import { humanizeLabel as k } from "../_common/format.js";
6
+ import { colorSetFromPalette as _, applyValueFormat as $ } from "../_common/utils.js";
7
+ import { c as p, a as g, p as q } from "../../../ColorSet-C7vpNXhM.js";
8
+ import { X as J, V as K } from "../../../AxisRenderer-DTyLLA6c.js";
9
+ import { L as Q } from "../../../Legend-Dp_MKfS4.js";
10
+ import { D as Z } from "../../../DateAxis-YX3QNIB-.js";
11
+ import { A as F, a as ee } from "../../../AxisRendererY-C_ItLPNV.js";
12
+ import { C as te } from "../../../CategoryAxis-CwnfaGc8.js";
13
+ import { C as re } from "../../../ColumnSeries-CjgdJ2QL.js";
14
+ import { D as oe } from "../../../DataProcessor-CHDO51q4.js";
15
+ import { B as ae } from "../../../Bullet-DVczI2TD.js";
16
+ const be = (L) => {
17
+ const y = N({ props: L, name: "HCXYChart" }), {
17
18
  dimensions: c,
18
- values: m,
19
+ values: n,
19
20
  data: d,
20
- initDelay: F = 0,
21
- baseInterval: L,
22
- colors: A,
23
- sx: R,
24
- ...O
25
- } = y, n = V(), v = `hc-xy-chart-${j().replace(/:/g, "")}`, u = z(null), b = c.length < 1 ? "Missing dimensions config!" : null;
26
- H(() => {
21
+ initDelay: R = 0,
22
+ baseInterval: O,
23
+ colors: w,
24
+ sx: B,
25
+ ...S
26
+ } = y, i = j(), A = `hc-xy-chart-${H().replace(/:/g, "")}`, u = M(null), b = c.length < 1 ? "Missing dimensions config!" : null;
27
+ U(() => {
27
28
  if (b) return;
28
29
  let f;
29
30
  return f = setTimeout(() => {
30
- var Y, D;
31
- const e = I.new(v);
32
- u.current = e, e.setThemes([P.new(e)]), e.interfaceColors.setAll({
33
- text: l(n.palette.text.primary),
34
- grid: l(n.palette.divider),
35
- stroke: l(n.palette.divider)
31
+ var C, Y, D;
32
+ const e = V.new(A);
33
+ u.current = e, e.setThemes([W.new(e)]), e.interfaceColors.setAll({
34
+ text: p(i.palette.text.primary),
35
+ grid: p(i.palette.divider),
36
+ stroke: p(i.palette.divider)
36
37
  });
37
38
  const o = e.container.children.push(
38
- _.new(e, {
39
+ J.new(e, {
39
40
  panX: !1,
40
41
  panY: !1,
41
42
  wheelX: "none",
@@ -43,31 +44,31 @@ const ge = (k) => {
43
44
  layout: e.verticalLayout
44
45
  })
45
46
  );
46
- o.set("colors", M(e, A));
47
- const S = o.children.push(
48
- q.new(e, {
49
- centerX: w,
50
- x: w
47
+ o.set("colors", _(e, w));
48
+ const I = o.children.push(
49
+ Q.new(e, {
50
+ centerX: g,
51
+ x: g
51
52
  })
52
53
  ), a = c[0];
53
- let s, p = d;
54
+ let s, m = d;
54
55
  if (a.type === "date")
55
56
  s = o.xAxes.push(
56
- J.new(e, {
57
+ Z.new(e, {
57
58
  maxDeviation: 0,
58
- baseInterval: L || { timeUnit: "day", count: 1 },
59
- renderer: X.new(e, { minGridDistance: 60 }),
59
+ baseInterval: O || { timeUnit: "day", count: 1 },
60
+ renderer: F.new(e, { minGridDistance: 60 }),
60
61
  tooltip: x.new(e, {})
61
62
  })
62
- ), p = g.orderBy(d, [a.value]);
63
+ ), m = X.orderBy(d, [a.value]);
63
64
  else {
64
- const t = X.new(e, {
65
+ const t = F.new(e, {
65
66
  cellStartLocation: 0.1,
66
67
  cellEndLocation: 0.9,
67
68
  minGridDistance: 30
68
69
  });
69
70
  s = o.xAxes.push(
70
- Q.new(e, {
71
+ te.new(e, {
71
72
  categoryField: a.value,
72
73
  renderer: t,
73
74
  tooltip: x.new(e, {})
@@ -82,8 +83,8 @@ const ge = (k) => {
82
83
  }), t.labels.template.setup = function(r) {
83
84
  r.set(
84
85
  "background",
85
- W.new(e, {
86
- fill: l(0),
86
+ z.new(e, {
87
+ fill: p(0),
87
88
  fillOpacity: 0
88
89
  })
89
90
  );
@@ -92,75 +93,80 @@ const ge = (k) => {
92
93
  }), e.numberFormatter.setAll({
93
94
  numberFormat: "#",
94
95
  numericFields: ["valueX"]
95
- }), s.data.setAll(p);
96
+ }), s.data.setAll(m);
96
97
  }
97
- const C = o.yAxes.push(
98
- $.new(e, {
99
- renderer: K.new(e, { strokeOpacity: 0.1 })
98
+ const v = o.yAxes.push(
99
+ K.new(e, {
100
+ renderer: ee.new(e, { strokeOpacity: 0.1 })
100
101
  })
101
102
  );
102
- (Y = s.get("renderer")) == null || Y.grid.template.setAll({
103
- stroke: l(n.palette.divider),
103
+ (C = s.get("renderer")) == null || C.grid.template.setAll({
104
+ stroke: p(i.palette.divider),
104
105
  strokeOpacity: 1
105
- }), (D = C.get("renderer")) == null || D.grid.template.setAll({
106
- stroke: l(n.palette.divider),
106
+ }), (Y = v.get("renderer")) == null || Y.grid.template.setAll({
107
+ stroke: p(i.palette.divider),
107
108
  strokeOpacity: 1
108
109
  });
109
- function T(t, r, h, E) {
110
- const i = o.series.push(
111
- Z.new(e, {
110
+ function T(t, r, h, P) {
111
+ const l = o.series.push(
112
+ re.new(e, {
112
113
  name: t,
113
114
  xAxis: s,
114
- yAxis: C,
115
- valueYField: E,
115
+ yAxis: v,
116
+ valueYField: P,
116
117
  ...a.type === "date" ? { valueXField: h } : { categoryXField: h }
117
118
  })
118
119
  );
119
- i.columns.template.setAll({
120
+ l.columns.template.setAll({
120
121
  tooltipText: "{name}, {categoryX}:{valueY}",
121
- width: U(90),
122
+ width: q(90),
122
123
  tooltipY: 0,
123
124
  strokeOpacity: 0
124
- }), a.type === "date" && (i.data.processor = ee.new(e, {
125
+ }), a.type === "date" && (l.data.processor = oe.new(e, {
125
126
  dateFormat: "i",
126
127
  dateFields: [h]
127
- })), i.data.setAll(r), i.appear(), i.bullets.push(function() {
128
- return te.new(e, {
128
+ })), l.data.setAll(r), l.appear(), l.bullets.push(function() {
129
+ return ae.new(e, {
129
130
  locationY: 0,
130
131
  sprite: G.new(e, {
131
132
  text: "{valueY}",
132
133
  fill: e.interfaceColors.get("alternativeText"),
133
134
  centerY: 0,
134
- centerX: w,
135
+ centerX: g,
135
136
  populateText: !0
136
137
  })
137
138
  });
138
- }), S.data.push(i);
139
+ }), I.data.push(l);
139
140
  }
140
141
  if (c.length === 1)
141
- m.forEach((t) => {
142
- T(t.name, p, a.value, t.dataFieldName);
142
+ n.forEach((t) => {
143
+ T(
144
+ t.label ?? k(t.name),
145
+ m,
146
+ a.value,
147
+ t.dataFieldName
148
+ );
143
149
  });
144
150
  else {
145
- const t = g.groupBy(p, c[1].value);
151
+ const t = X.groupBy(m, c[1].value);
146
152
  Object.keys(t).forEach((r) => {
147
153
  T(
148
- g.startCase(r),
154
+ k(r),
149
155
  t[r],
150
156
  a.value,
151
- m[0].dataFieldName
157
+ n[0].dataFieldName
152
158
  );
153
159
  });
154
160
  }
155
- o.appear(1e3, 100);
156
- }, F), () => {
161
+ $(e, (D = n == null ? void 0 : n[0]) == null ? void 0 : D.format), o.appear(1e3, 100);
162
+ }, R), () => {
157
163
  var e;
158
164
  f && clearTimeout(f), (e = u.current) == null || e.dispose(), u.current = null;
159
165
  };
160
- }, [d, c, m, n.palette.mode, A]);
161
- const B = { ...y };
162
- return { chartId: v, ownerState: B, sx: R, error: b, other: O };
166
+ }, [d, c, n, i.palette.mode, w]);
167
+ const E = { ...y };
168
+ return { chartId: A, ownerState: E, sx: B, error: b, other: S };
163
169
  };
164
170
  export {
165
- ge as useXYChartLogic
171
+ be as useXYChartLogic
166
172
  };