@hybridcore/ui 1.6.3 → 1.6.4

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.
@@ -0,0 +1,93 @@
1
+ import { E as M, e as v, f as w, u as G } from "./ColorSet-C7vpNXhM.js";
2
+ import { m as B, s as O } from "./AnimatedTheme-jnasw6rT.js";
3
+ class c extends M {
4
+ _afterNew() {
5
+ super._afterNewApplyThemes();
6
+ }
7
+ /**
8
+ * @ignore
9
+ */
10
+ getFill(t) {
11
+ return {
12
+ addColorStop: (l, e) => {
13
+ }
14
+ };
15
+ }
16
+ _changed() {
17
+ super._changed();
18
+ }
19
+ /**
20
+ * @ignore
21
+ */
22
+ getBounds(t) {
23
+ const l = this.get("target");
24
+ if (l) {
25
+ let e = l.globalBounds();
26
+ const r = t.toLocal({ x: e.left, y: e.top }), s = t.toLocal({ x: e.right, y: e.top }), a = t.toLocal({ x: e.right, y: e.bottom }), n = t.toLocal({ x: e.left, y: e.bottom });
27
+ return {
28
+ left: Math.min(r.x, s.x, a.x, n.x),
29
+ top: Math.min(r.y, s.y, a.y, n.y),
30
+ right: Math.max(r.x, s.x, a.x, n.x),
31
+ bottom: Math.max(r.y, s.y, a.y, n.y)
32
+ };
33
+ }
34
+ return t._display.getLocalBounds();
35
+ }
36
+ }
37
+ Object.defineProperty(c, "className", {
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0,
41
+ value: "Gradient"
42
+ });
43
+ Object.defineProperty(c, "classNames", {
44
+ enumerable: !0,
45
+ configurable: !0,
46
+ writable: !0,
47
+ value: M.classNames.concat([c.className])
48
+ });
49
+ class d extends c {
50
+ /**
51
+ * @ignore
52
+ */
53
+ getFill(t) {
54
+ const l = this.get("rotation", 0);
55
+ let e = this.getBounds(t), r = e.left || 0, s = e.right || 0, a = e.top || 0, n = e.bottom || 0, h = B(l), p = O(l), u = h * (s - r), f = p * (n - a);
56
+ u == 0 && (u = 1), f == 0 && (f = 1);
57
+ let y = Math.max(u, f);
58
+ const x = this._root._renderer.createLinearGradient(r, a, r + y * h, a + y * p), b = this.get("stops");
59
+ if (b) {
60
+ let N = 0;
61
+ v(b, (i) => {
62
+ let g = i.offset;
63
+ w(g) || (g = N / (b.length - 1));
64
+ let m = i.opacity;
65
+ w(m) || (m = 1);
66
+ let o = i.color;
67
+ if (o) {
68
+ const _ = i.lighten;
69
+ _ && (o = G.lighten(o, _));
70
+ const L = i.brighten;
71
+ L && (o = G.brighten(o, L)), x.addColorStop(g, "rgba(" + o.r + "," + o.g + "," + o.b + "," + m + ")");
72
+ }
73
+ N++;
74
+ });
75
+ }
76
+ return x;
77
+ }
78
+ }
79
+ Object.defineProperty(d, "className", {
80
+ enumerable: !0,
81
+ configurable: !0,
82
+ writable: !0,
83
+ value: "LinearGradient"
84
+ });
85
+ Object.defineProperty(d, "classNames", {
86
+ enumerable: !0,
87
+ configurable: !0,
88
+ writable: !0,
89
+ value: c.classNames.concat([d.className])
90
+ });
91
+ export {
92
+ d as L
93
+ };
@@ -1,44 +1,45 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { Typography as l, Divider as n } from "@mui/material";
3
- import { CandlestickChart as C } from "../candlestick/index.js";
4
- import { ColumnLineMix as h } from "../column-line-mix/index.js";
5
- import { DrillDownTreemap as c } from "../drill-down-treemap/index.js";
6
- import { DrillDownVoronoiTreemap as d } from "../drill-down-voronoi-treemap/index.js";
7
- import { Heatmap as f } from "../heatmap/index.js";
8
- import { LineChart as s } from "../line/index.js";
9
- import { LogaritmicScale as u } from "../logaritmic-scale/index.js";
10
- import { MultipleValueAxes as L } from "../multiple-value-axes/index.js";
11
- import { NestedPie as x } from "../nested-pie/index.js";
12
- import { PackedCircles as D } from "../packed-circles/index.js";
13
- import { PieChart as k } from "../pie-chart/index.js";
14
- import { StackedAreaRadar as S } from "../stacked-area-radar/index.js";
15
- import { StackedColumnChart as g } from "../stacked-column-chart/index.js";
16
- import { XYChart as P } from "../xy-chart/index.js";
17
- import { useChartWrapperLogic as w } from "./logic.js";
18
- import { ChartWrapperRoot as A, ChartWrapperHeader as T, ChartWrapperContent as W } from "./styled.js";
19
- const J = (a) => {
20
- const { title: m, type: e, chartProps: o, ownerState: t, sx: p } = w(a);
21
- return /* @__PURE__ */ i(A, { ownerState: t, sx: p, children: [
22
- /* @__PURE__ */ r(T, { ownerState: t, children: /* @__PURE__ */ r(l, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
23
- /* @__PURE__ */ r(n, {}),
24
- /* @__PURE__ */ i(W, { ownerState: t, children: [
25
- e === "MultipleValueAxes" && /* @__PURE__ */ r(L, { ...o }),
26
- e === "XYChart" && /* @__PURE__ */ r(P, { ...o }),
27
- e === "HeatLegend" && /* @__PURE__ */ r(f, { ...o }),
28
- e === "PieChart" && /* @__PURE__ */ r(k, { ...o }),
29
- e === "StackedColumnChart" && /* @__PURE__ */ r(g, { ...o }),
30
- e === "StackedAreaRadar" && /* @__PURE__ */ r(S, { ...o }),
31
- e === "LineChart" && /* @__PURE__ */ r(s, { ...o }),
32
- e === "NestedPie" && /* @__PURE__ */ r(x, { ...o }),
33
- e === "SingleLevelPackedCircles" && /* @__PURE__ */ r(D, { ...o }),
34
- e === "LogarithmicScale" && /* @__PURE__ */ r(u, { ...o }),
35
- e === "ColumnAndLineMix" && /* @__PURE__ */ r(h, { ...o }),
36
- e === "DrillDownTreemap" && /* @__PURE__ */ r(c, { ...o }),
37
- e === "DrillDownVoronoiTreemap" && /* @__PURE__ */ r(d, { ...o }),
38
- e === "CandlestickChart" && /* @__PURE__ */ r(C, { ...o })
39
- ] })
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";
4
+ import { CandlestickChart as c } from "../candlestick/index.js";
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";
8
+ import { Heatmap as L } from "../heatmap/index.js";
9
+ import { LineChart as g } from "../line/index.js";
10
+ 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 })
40
+ ] }) })
40
41
  ] });
41
42
  };
42
43
  export {
43
- J as ChartWrapper
44
+ U as ChartWrapper
44
45
  };
@@ -1,7 +1,7 @@
1
1
  import { useThemeProps as v } from "@mui/material";
2
2
  import { useMemo as P } from "react";
3
- import { adaptTemporalData as g } from "./helpers.js";
4
- const x = (l) => {
3
+ import { adaptTemporalData as C } from "./helpers.js";
4
+ const M = (l) => {
5
5
  const n = v({ props: l, name: "HCChartWrapper" }), {
6
6
  title: m,
7
7
  description: d,
@@ -11,9 +11,10 @@ const x = (l) => {
11
11
  dimensions: s = [],
12
12
  values: p = [],
13
13
  series: r = [],
14
- sx: f,
15
- ...u
16
- } = n, h = {
14
+ loading: f = !1,
15
+ sx: u,
16
+ ...h
17
+ } = n, y = {
17
18
  ...P(() => {
18
19
  let t = { data: a, dimensions: s, values: p };
19
20
  if (s.length > 0) {
@@ -26,22 +27,23 @@ const x = (l) => {
26
27
  };
27
28
  }
28
29
  } else if (r.length > 0) {
29
- const o = g(r);
30
+ const o = C(r);
30
31
  t = { ...t, ...o };
31
32
  }
32
33
  return t;
33
34
  }, [i, a, s, p, r]),
34
- ...u
35
- }, y = { ...n };
35
+ ...h
36
+ }, g = { ...n };
36
37
  return {
37
38
  title: m,
38
39
  description: d,
39
40
  type: c,
40
- chartProps: h,
41
- ownerState: y,
42
- sx: f
41
+ chartProps: y,
42
+ loading: f,
43
+ ownerState: g,
44
+ sx: u
43
45
  };
44
46
  };
45
47
  export {
46
- x as useChartWrapperLogic
48
+ M as useChartWrapperLogic
47
49
  };