@hybridcore/ui 1.6.22 → 1.6.24

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,45 +1,44 @@
1
1
  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
- import { useId as V, useRef as z, useEffect as G } from "react";
4
+ import { useId as V, useRef as G, useEffect as N } from "react";
5
5
  import { humanizeLabel as C } from "../_common/format.js";
6
- import { attachCombinedAxisTooltip as N } from "../_common/tooltip.js";
7
- import { colorSetFromPalette as W, applyDateAxisLabelFormat as q, applyValueFormat as H } from "../_common/utils.js";
8
- import { c as l, p as U, a as b } from "../../../Entity-BJCuhdq_.js";
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";
9
9
  import { X as _, V as $ } from "../../../AxisRenderer-BCQoUJw6.js";
10
- import { S as j } from "../../../Scrollbar-CTI7_8Qw.js";
11
- import { A as D, a as J } from "../../../AxisRendererY-AXWvGU6r.js";
12
- import { C as K } from "../../../CategoryAxis-B6NqW8qd.js";
13
- import { C as Q } from "../../../ColumnSeries-CtRTsn-E.js";
14
- import { D as X, G as Z } from "../../../GaplessDateAxis-B2g2jgSG.js";
15
- import { L as ee } from "../../../LineSeries-D_IL2qGF.js";
16
- import { B as te } from "../../../Bullet-Djj7Vs9T.js";
17
- import { C as re } from "../../../Circle-BnfBNKBD.js";
18
- import { X as ae } from "../../../XYCursor-CVUSpqb9.js";
19
- import { L as oe } from "../../../Legend-CFvQiIfn.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";
20
19
  import { D as se } from "../../../DateAxis-DEXKps1S.js";
21
- const Ye = (L) => {
20
+ const Xe = (L) => {
22
21
  const f = B({ props: L, name: "HCColumnLineMix" }), {
23
22
  dimensions: t,
24
23
  values: n,
25
24
  data: p,
26
25
  initDelay: Y = 0,
27
- baseInterval: h,
28
- colors: x,
26
+ baseInterval: x,
27
+ colors: h,
29
28
  skipEmptyDates: A = !1,
30
- sx: S,
31
- ...T
32
- } = f, s = E(), g = `hc-column-line-mix-${V().replace(/:/g, "")}`, d = z(null), y = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
33
- G(() => {
29
+ sx: T,
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;
32
+ N(() => {
34
33
  if (y) return;
35
34
  let c;
36
35
  return c = setTimeout(() => {
37
36
  var w, F, v, k;
38
37
  const e = M.new(g);
39
38
  d.current = e, e.setThemes([O.new(e)]), e.interfaceColors.setAll({
40
- text: l(s.palette.text.primary),
41
- grid: l(s.palette.divider),
42
- stroke: l(s.palette.divider)
39
+ text: l(o.palette.text.primary),
40
+ grid: l(o.palette.divider),
41
+ stroke: l(o.palette.divider)
43
42
  });
44
43
  const r = e.container.children.push(
45
44
  _.new(e, {
@@ -52,33 +51,30 @@ const Ye = (L) => {
52
51
  layout: e.verticalLayout
53
52
  })
54
53
  );
55
- r.set("colors", W(e, x)), r.get("colors", {}).set("step", 3), r.set(
56
- "scrollbarX",
57
- j.new(e, { orientation: "horizontal" })
58
- );
54
+ r.set("colors", q(e, h)), r.get("colors", {}).set("step", 3);
59
55
  let a, m = p;
60
56
  if (t[0].type === "date") {
61
57
  m = P.orderBy(p, [t[0].value]);
62
- const i = A ? Z : se;
58
+ const i = A ? Q : se;
63
59
  a = r.xAxes.push(
64
60
  i.new(e, {
65
61
  maxDeviation: 0.1,
66
62
  groupData: !1,
67
- baseInterval: h || { timeUnit: "day", count: 1 },
68
- renderer: D.new(e, {})
63
+ baseInterval: x || { timeUnit: "day", count: 1 },
64
+ renderer: b.new(e, {})
69
65
  })
70
66
  ), (w = a.get("renderer")) == null || w.grid.template.setAll({
71
- stroke: l(s.palette.divider),
67
+ stroke: l(o.palette.divider),
72
68
  strokeOpacity: 1
73
- }), q(a, t[0]);
69
+ }), z(a, t[0]);
74
70
  } else
75
71
  a = r.xAxes.push(
76
- K.new(e, {
72
+ J.new(e, {
77
73
  categoryField: t[0].value,
78
- renderer: D.new(e, {})
74
+ renderer: b.new(e, {})
79
75
  })
80
76
  ), (F = a.get("renderer")) == null || F.grid.template.setAll({
81
- stroke: l(s.palette.divider),
77
+ stroke: l(o.palette.divider),
82
78
  strokeOpacity: 1
83
79
  }), e.numberFormatter.setAll({
84
80
  numberFormat: "#",
@@ -88,16 +84,16 @@ const Ye = (L) => {
88
84
  $.new(e, {
89
85
  min: 0,
90
86
  extraMax: 0.1,
91
- renderer: J.new(e, { strokeOpacity: 0.1 })
87
+ renderer: j.new(e, { strokeOpacity: 0.1 })
92
88
  })
93
89
  );
94
90
  (v = u.get("renderer")) == null || v.grid.template.setAll({
95
- stroke: l(s.palette.divider),
91
+ stroke: l(o.palette.divider),
96
92
  strokeOpacity: 1
97
93
  }), n.forEach((i, I) => {
98
94
  if (I === 0) {
99
- const o = r.series.push(
100
- Q.new(e, {
95
+ const s = r.series.push(
96
+ K.new(e, {
101
97
  name: i.label ?? C(i.name),
102
98
  xAxis: a,
103
99
  yAxis: u,
@@ -105,16 +101,16 @@ const Ye = (L) => {
105
101
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
106
102
  })
107
103
  );
108
- o.columns.template.setAll({
104
+ s.columns.template.setAll({
109
105
  tooltipY: U(10),
110
106
  templateField: "columnSettings"
111
- }), t[0].type === "date" && (o.data.processor = X.new(e, {
107
+ }), t[0].type === "date" && (s.data.processor = X.new(e, {
112
108
  dateFormat: "i",
113
109
  dateFields: [t[0].value]
114
- })), o.data.setAll(m), o.appear();
110
+ })), s.data.setAll(m), s.appear();
115
111
  } else {
116
- const o = r.series.push(
117
- ee.new(e, {
112
+ const s = r.series.push(
113
+ Z.new(e, {
118
114
  name: i.label ?? C(i.name),
119
115
  xAxis: a,
120
116
  yAxis: u,
@@ -122,17 +118,17 @@ const Ye = (L) => {
122
118
  ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
123
119
  })
124
120
  );
125
- o.strokes.template.setAll({
121
+ s.strokes.template.setAll({
126
122
  strokeWidth: 3,
127
123
  templateField: "strokeSettings"
128
- }), t[0].type === "date" && (o.data.processor = X.new(e, {
124
+ }), t[0].type === "date" && (s.data.processor = X.new(e, {
129
125
  dateFormat: "i",
130
126
  dateFields: [t[0].value]
131
- })), o.data.setAll(m), o.bullets.push(function() {
132
- return te.new(e, {
133
- sprite: re.new(e, {
127
+ })), s.data.setAll(m), s.bullets.push(function() {
128
+ return ee.new(e, {
129
+ sprite: te.new(e, {
134
130
  strokeWidth: 3,
135
- stroke: o.get("stroke"),
131
+ stroke: s.get("stroke"),
136
132
  radius: 5,
137
133
  fill: e.interfaceColors.get("background")
138
134
  })
@@ -141,29 +137,29 @@ const Ye = (L) => {
141
137
  }
142
138
  }), r.set(
143
139
  "cursor",
144
- ae.new(e, { xAxis: a, behavior: "none" })
145
- ).lineY.set("visible", !1), N({
140
+ re.new(e, { xAxis: a, behavior: "none" })
141
+ ).lineY.set("visible", !1), W({
146
142
  root: e,
147
143
  chart: r,
148
144
  xAxis: a,
149
- theme: s,
145
+ theme: o,
150
146
  isDateAxis: t[0].type === "date",
151
- baseInterval: h,
147
+ baseInterval: x,
152
148
  follow: !0
153
149
  }), r.children.push(
154
- oe.new(e, {
155
- centerX: b,
156
- x: b
150
+ ae.new(e, {
151
+ centerX: D,
152
+ x: D
157
153
  })
158
154
  ).data.setAll(r.series.values), H(e, (k = n == null ? void 0 : n[0]) == null ? void 0 : k.format), r.appear(1e3, 100);
159
155
  }, Y), () => {
160
156
  var e;
161
157
  c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
162
158
  };
163
- }, [p, t, n, s.palette.mode, x, A]);
164
- const R = { ...f };
165
- return { chartId: g, ownerState: R, sx: S, error: y, other: T };
159
+ }, [p, t, n, o.palette.mode, h, A]);
160
+ const S = { ...f };
161
+ return { chartId: g, ownerState: S, sx: T, error: y, other: R };
166
162
  };
167
163
  export {
168
- Ye as useColumnLineMixLogic
164
+ Xe as useColumnLineMixLogic
169
165
  };
@@ -1,47 +1,49 @@
1
- import c, { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { i as h } from "../../../styled-Ckq8ALHh.js";
3
- import { r as u } from "../../../createSvgIcon-jKAqRXE2.js";
4
- import { IconButton as s, Typography as d } from "@mui/material";
5
- import { useForecastConeChartLogic as z } from "./logic.js";
6
- import { ForecastConeChartRoot as I, ForecastConeChartCanvas as R, ForecastConeChartPager as $ } from "./styled.js";
7
- var a = {}, S = h;
8
- Object.defineProperty(a, "__esModule", {
1
+ import h, { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { i as u } from "../../../styled-Ckq8ALHh.js";
3
+ import { r as f } from "../../../createSvgIcon-jKAqRXE2.js";
4
+ import { IconButton as d, Typography as c } from "@mui/material";
5
+ import { useForecastConeChartLogic as R } from "./logic.js";
6
+ import { ForecastConeChartRoot as $, ForecastConeChartCanvas as S, ForecastConeChartPager as F } from "./styled.js";
7
+ var i = {}, L = u;
8
+ Object.defineProperty(i, "__esModule", {
9
9
  value: !0
10
10
  });
11
- var f = a.default = void 0, F = S(u()), L = c;
12
- f = a.default = (0, F.default)(/* @__PURE__ */ (0, L.jsx)("path", {
11
+ var v = i.default = void 0, M = L(f()), q = h;
12
+ v = i.default = (0, M.default)(/* @__PURE__ */ (0, q.jsx)("path", {
13
13
  d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
14
14
  }), "ChevronLeft");
15
- var i = {}, M = h;
16
- Object.defineProperty(i, "__esModule", {
15
+ var a = {}, w = u;
16
+ Object.defineProperty(a, "__esModule", {
17
17
  value: !0
18
18
  });
19
- var v = i.default = void 0, q = M(u()), D = c;
20
- v = i.default = (0, q.default)(/* @__PURE__ */ (0, D.jsx)("path", {
19
+ var p = a.default = void 0, O = w(f()), P = h;
20
+ p = a.default = (0, O.default)(/* @__PURE__ */ (0, P.jsx)("path", {
21
21
  d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
22
22
  }), "ChevronRight");
23
- const N = (p) => {
23
+ const A = (g) => {
24
24
  const {
25
- chartDivRef: g,
26
- data: m,
27
- chartId: C,
25
+ chartDivRef: m,
26
+ data: C,
27
+ chartId: x,
28
28
  loading: n,
29
- emptyMessage: x,
30
- isMulti: y,
29
+ emptyMessage: y,
30
+ isMulti: _,
31
31
  origins: r,
32
- selectedOriginIndex: t,
33
- onOriginChange: l,
34
- sx: _,
35
- other: b,
36
- ownerState: j
37
- } = z(p);
38
- return /* @__PURE__ */ o(I, { ownerState: j, sx: _, ...b, children: [
39
- /* @__PURE__ */ o(R, { children: [
32
+ selectedOriginIndex: o,
33
+ shownOriginIndex: l,
34
+ isPreviewing: b,
35
+ onOriginChange: s,
36
+ sx: I,
37
+ other: j,
38
+ ownerState: z
39
+ } = R(g);
40
+ return /* @__PURE__ */ t($, { ownerState: z, sx: I, ...j, children: [
41
+ /* @__PURE__ */ t(S, { children: [
40
42
  /* @__PURE__ */ e(
41
43
  "div",
42
44
  {
43
- ref: g,
44
- id: C,
45
+ ref: m,
46
+ id: x,
45
47
  style: { width: "100%", height: "100%" }
46
48
  }
47
49
  ),
@@ -62,7 +64,7 @@ const N = (p) => {
62
64
  children: "Loading..."
63
65
  }
64
66
  ),
65
- !n && m.length === 0 && /* @__PURE__ */ e(
67
+ !n && C.length === 0 && /* @__PURE__ */ e(
66
68
  "div",
67
69
  {
68
70
  style: {
@@ -75,38 +77,49 @@ const N = (p) => {
75
77
  fontSize: "1.1rem",
76
78
  zIndex: 10
77
79
  },
78
- children: x
80
+ children: y
79
81
  }
80
82
  )
81
83
  ] }),
82
- y && r.length > 1 && /* @__PURE__ */ o($, { children: [
84
+ _ && r.length > 1 && /* @__PURE__ */ t(F, { children: [
83
85
  /* @__PURE__ */ e(
84
- s,
86
+ d,
85
87
  {
86
88
  size: "small",
87
89
  "aria-label": "Previous forecast",
88
- disabled: t <= 0,
89
- onClick: () => l(t - 1),
90
- children: /* @__PURE__ */ e(f, { fontSize: "small" })
90
+ disabled: o <= 0,
91
+ onClick: () => s(o - 1),
92
+ children: /* @__PURE__ */ e(v, { fontSize: "small" })
91
93
  }
92
94
  ),
93
- /* @__PURE__ */ o(d, { variant: "caption", color: "text.secondary", component: "div", children: [
94
- `Forecast origin: ${r[t] ?? ""}`,
95
- /* @__PURE__ */ e(d, { variant: "caption", color: "text.disabled", component: "span", children: ` (${t + 1} / ${r.length})` })
95
+ /* @__PURE__ */ t(c, { variant: "caption", color: "text.secondary", component: "div", children: [
96
+ `Forecast origin: ${r[l] ?? ""}`,
97
+ /* @__PURE__ */ t(
98
+ c,
99
+ {
100
+ variant: "caption",
101
+ color: "text.disabled",
102
+ component: "span",
103
+ children: [
104
+ ` (${l + 1} / ${r.length})`,
105
+ b ? " · preview" : ""
106
+ ]
107
+ }
108
+ )
96
109
  ] }),
97
110
  /* @__PURE__ */ e(
98
- s,
111
+ d,
99
112
  {
100
113
  size: "small",
101
114
  "aria-label": "Next forecast",
102
- disabled: t >= r.length - 1,
103
- onClick: () => l(t + 1),
104
- children: /* @__PURE__ */ e(v, { fontSize: "small" })
115
+ disabled: o >= r.length - 1,
116
+ onClick: () => s(o + 1),
117
+ children: /* @__PURE__ */ e(p, { fontSize: "small" })
105
118
  }
106
119
  )
107
120
  ] })
108
121
  ] });
109
122
  };
110
123
  export {
111
- N as ForecastConeChart
124
+ A as ForecastConeChart
112
125
  };