@hybridcore/ui 1.6.21 → 1.6.23

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,211 @@
1
- import { R as Y, A as R } from "../../../AnimatedTheme-ktdO3Bel.js";
2
- import { useThemeProps as E, useTheme as I } from "@mui/material";
3
- import F from "lodash";
4
- import { useId as G, useRef as O, useEffect as P } from "react";
5
- import { humanizeLabel as V } from "../_common/format.js";
1
+ import { R as O, A as L } from "../../../AnimatedTheme-ktdO3Bel.js";
2
+ import { useThemeProps as X, useTheme as S } from "@mui/material";
3
+ import j from "lodash";
4
+ import { useId as E, useRef as Y, useEffect as z } from "react";
5
+ import { humanizeLabel as I } from "../_common/format.js";
6
6
  import { attachCombinedAxisTooltip as q } from "../_common/tooltip.js";
7
- import { colorSetFromPalette as z, applyDateAxisLabelFormat as B, applyValueFormat as H } from "../_common/utils.js";
8
- import { c as i } from "../../../Entity-BJCuhdq_.js";
9
- import { X as N, V as U } from "../../../AxisRenderer-BCQoUJw6.js";
10
- import { X as W } from "../../../XYCursor-CVUSpqb9.js";
11
- import { A as X, a as Z } from "../../../AxisRendererY-AXWvGU6r.js";
12
- import { C as _ } from "../../../CategoryAxis-B6NqW8qd.js";
13
- import { L as $ } from "../../../LineSeries-D_IL2qGF.js";
14
- import { D as j, G as J } from "../../../GaplessDateAxis-B2g2jgSG.js";
15
- import { S as K } from "../../../Scrollbar-CTI7_8Qw.js";
16
- import { D as M } from "../../../DateAxis-DEXKps1S.js";
17
- const xe = (k) => {
18
- const f = E({ props: k, name: "HCLogaritmicScale" }), {
19
- dimensions: t,
20
- values: s,
21
- data: n,
22
- initDelay: L = 0,
23
- baseInterval: h,
24
- colors: A,
25
- skipEmptyDates: x = !1,
26
- sx: S,
27
- ...C
28
- } = f, a = I(), g = `hc-logaritmic-scale-${G().replace(/:/g, "")}`, d = O(null);
29
- let m = null;
30
- t.length < 1 ? m = "LogaritmicScale requires at least 1 dimension" : s.length < 1 && (m = "LogaritmicScale requires at least 1 value"), P(() => {
31
- if (m) return;
32
- let u;
33
- return u = setTimeout(() => {
34
- var v, w, D, b;
35
- const e = Y.new(g);
36
- d.current = e, e.setThemes([R.new(e)]), e.interfaceColors.setAll({
37
- text: i(a.palette.text.primary),
38
- grid: i(a.palette.divider),
39
- stroke: i(a.palette.divider)
7
+ import { colorSetFromPalette as H, applyDateAxisLabelFormat as U, applyValueFormat as W } from "../_common/utils.js";
8
+ import { m as R, q as Z, f as x, c as f } from "../../../Entity-BJCuhdq_.js";
9
+ import { X as $, V as J } from "../../../AxisRenderer-BCQoUJw6.js";
10
+ import { X as K } from "../../../XYCursor-CVUSpqb9.js";
11
+ import { A as N, a as Q } from "../../../AxisRendererY-AXWvGU6r.js";
12
+ import { C as tt } from "../../../CategoryAxis-B6NqW8qd.js";
13
+ import { L as et } from "../../../LineSeries-D_IL2qGF.js";
14
+ import { D as st, G as it } from "../../../GaplessDateAxis-B2g2jgSG.js";
15
+ import { R as V } from "../../../RoundedRectangle-BKLX1LKM.js";
16
+ import { C, G as rt } from "../../../Tooltip-vyZRZWih.js";
17
+ import { B as at } from "../../../Button-BLY4PVJC.js";
18
+ import { D as nt } from "../../../DateAxis-DEXKps1S.js";
19
+ class D extends C {
20
+ constructor() {
21
+ super(...arguments), Object.defineProperty(this, "thumb", {
22
+ enumerable: !0,
23
+ configurable: !0,
24
+ writable: !0,
25
+ value: this._makeThumb()
26
+ }), Object.defineProperty(this, "startGrip", {
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0,
30
+ value: this._makeButton()
31
+ }), Object.defineProperty(this, "endGrip", {
32
+ enumerable: !0,
33
+ configurable: !0,
34
+ writable: !0,
35
+ value: this._makeButton()
36
+ }), Object.defineProperty(this, "_thumbBusy", {
37
+ enumerable: !0,
38
+ configurable: !0,
39
+ writable: !0,
40
+ value: !1
41
+ }), Object.defineProperty(this, "_startDown", {
42
+ enumerable: !0,
43
+ configurable: !0,
44
+ writable: !0,
45
+ value: !1
46
+ }), Object.defineProperty(this, "_endDown", {
47
+ enumerable: !0,
48
+ configurable: !0,
49
+ writable: !0,
50
+ value: !1
51
+ }), Object.defineProperty(this, "_thumbDown", {
52
+ enumerable: !0,
53
+ configurable: !0,
54
+ writable: !0,
55
+ value: !1
56
+ }), Object.defineProperty(this, "_gripDown", {
57
+ enumerable: !0,
58
+ configurable: !0,
59
+ writable: !0,
60
+ value: void 0
61
+ });
62
+ }
63
+ _addOrientationClass() {
64
+ this._settings.themeTags = R(this._settings.themeTags, ["scrollbar", this._settings.orientation]), this._settings.background || (this._settings.background = V.new(this._root, {
65
+ themeTags: R(this._settings.themeTags, ["main", "background"])
66
+ }));
67
+ }
68
+ _makeButton() {
69
+ return this.children.push(at.new(this._root, {
70
+ themeTags: ["resize", "button", this.get("orientation")],
71
+ icon: rt.new(this._root, {
72
+ themeTags: ["icon"]
73
+ })
74
+ }));
75
+ }
76
+ _makeThumb() {
77
+ return this.children.push(V.new(this._root, {
78
+ themeTags: ["thumb", this.get("orientation")]
79
+ }));
80
+ }
81
+ _handleAnimation(t) {
82
+ t && this._disposers.push(t.events.on("stopped", () => {
83
+ this.setPrivateRaw("isBusy", !1), this._thumbBusy = !1;
84
+ }));
85
+ }
86
+ _afterNew() {
87
+ this._addOrientationClass(), super._afterNew();
88
+ const t = this.startGrip, e = this.endGrip, i = this.thumb, o = this.get("background");
89
+ o && this._disposers.push(o.events.on("click", (s) => {
90
+ this.setPrivateRaw("isBusy", !0);
91
+ const n = this._display.toLocal(s.point), h = this.width(), l = this.height(), d = this.get("orientation");
92
+ let u;
93
+ d == "vertical" ? u = (n.y - i.height() / 2) / l : u = (n.x - i.width() / 2) / h;
94
+ let a, p;
95
+ d == "vertical" ? (a = u * l, p = "y") : (a = u * h, p = "x");
96
+ const m = this.get("animationDuration", 0);
97
+ m > 0 ? (this._thumbBusy = !0, this._handleAnimation(this.thumb.animate({ key: p, to: a, duration: m, easing: this.get("animationEasing") }))) : (this.thumb.set(p, a), this._root.events.once("frameended", () => {
98
+ this.setPrivateRaw("isBusy", !1);
99
+ }));
100
+ })), this._disposers.push(i.events.on("dblclick", (s) => {
101
+ if (!Z(s.originalEvent, this))
102
+ return;
103
+ const n = this.get("animationDuration", 0), h = this.get("animationEasing");
104
+ this.animate({ key: "start", to: 0, duration: n, easing: h }), this.animate({ key: "end", to: 1, duration: n, easing: h });
105
+ })), this._disposers.push(t.events.on("pointerdown", () => {
106
+ this.setPrivateRaw("isBusy", !0), this._startDown = !0, this._gripDown = "start";
107
+ })), this._disposers.push(e.events.on("pointerdown", () => {
108
+ this.setPrivateRaw("isBusy", !0), this._endDown = !0, this._gripDown = "end";
109
+ })), this._disposers.push(i.events.on("pointerdown", () => {
110
+ this.setPrivateRaw("isBusy", !0), this._thumbDown = !0, this._gripDown = void 0;
111
+ })), this._disposers.push(t.events.on("globalpointerup", () => {
112
+ this._startDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._startDown = !1;
113
+ })), this._disposers.push(e.events.on("globalpointerup", () => {
114
+ this._endDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._endDown = !1;
115
+ })), this._disposers.push(i.events.on("globalpointerup", () => {
116
+ this._thumbDown && (this.setPrivateRaw("isBusy", !1), this._released()), this._thumbDown = !1;
117
+ })), this._disposers.push(t.on("x", () => {
118
+ this._updateThumb();
119
+ })), this._disposers.push(e.on("x", () => {
120
+ this._updateThumb();
121
+ })), this._disposers.push(t.on("y", () => {
122
+ this._updateThumb();
123
+ })), this._disposers.push(e.on("y", () => {
124
+ this._updateThumb();
125
+ })), this._disposers.push(i.events.on("positionchanged", () => {
126
+ this._updateGripsByThumb();
127
+ })), this.get("orientation") == "vertical" ? (t.set("x", 0), e.set("x", 0), this._disposers.push(i.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height() - i.height()), 0))), this._disposers.push(i.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(t.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(e.adapters.add("x", (s) => this.width() / 2)), this._disposers.push(t.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height()), 0))), this._disposers.push(e.adapters.add("y", (s) => Math.max(Math.min(Number(s), this.height()), 0)))) : (t.set("y", 0), e.set("y", 0), this._disposers.push(i.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width() - i.width()), 0))), this._disposers.push(i.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(t.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(e.adapters.add("y", (s) => this.height() / 2)), this._disposers.push(t.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width()), 0))), this._disposers.push(e.adapters.add("x", (s) => Math.max(Math.min(Number(s), this.width()), 0))));
128
+ }
129
+ _updateChildren() {
130
+ super._updateChildren(), (this.isDirty("end") || this.isDirty("start") || this._sizeDirty) && this.updateGrips();
131
+ }
132
+ _changed() {
133
+ if (super._changed(), this.isDirty("start") || this.isDirty("end")) {
134
+ const t = "rangechanged";
135
+ this.events.isEnabled(t) && this.events.dispatch(t, { type: t, target: this, start: this.get("start", 0), end: this.get("end", 1), grip: this._gripDown });
136
+ }
137
+ }
138
+ _released() {
139
+ const t = "released";
140
+ this.events.isEnabled(t) && this.events.dispatch(t, { type: t, target: this });
141
+ }
142
+ /**
143
+ * @ignore
144
+ */
145
+ updateGrips() {
146
+ const t = this.startGrip, e = this.endGrip, i = this.get("orientation"), o = this.height(), s = this.width();
147
+ i == "vertical" ? (t.set("y", o * this.get("start", 0)), e.set("y", o * this.get("end", 1))) : (t.set("x", s * this.get("start", 0)), e.set("x", s * this.get("end", 1)));
148
+ const n = this.getPrivate("positionTextFunction"), h = Math.round(this.get("start", 0) * 100), l = Math.round(this.get("end", 0) * 100);
149
+ let d, u;
150
+ n ? (d = n.call(this, this.get("start", 0)), u = n.call(this, this.get("end", 0))) : (d = h + "%", u = l + "%"), t.set("ariaLabel", this._t("From %1", void 0, d)), t.set("ariaValueNow", "" + h), t.set("ariaValueText", h + "%"), t.set("ariaValueMin", "0"), t.set("ariaValueMax", "100"), e.set("ariaLabel", this._t("To %1", void 0, u)), e.set("ariaValueNow", "" + l), e.set("ariaValueText", l + "%"), e.set("ariaValueMin", "0"), e.set("ariaValueMax", "100");
151
+ }
152
+ _updateThumb() {
153
+ const t = this.thumb, e = this.startGrip, i = this.endGrip, o = this.height(), s = this.width();
154
+ let n = e.x(), h = i.x(), l = e.y(), d = i.y(), u = 0, a = 1;
155
+ this.get("orientation") == "vertical" ? x(l) && x(d) && (!this._thumbBusy && !t.isDragging() && (t.set("height", d - l), t.set("y", l)), u = l / o, a = d / o) : x(n) && x(h) && (!this._thumbBusy && !t.isDragging() && (t.set("width", h - n), t.set("x", n)), u = n / s, a = h / s), this.getPrivate("isBusy") && (this.get("start") != u || this.get("end") != a) && (this.set("start", u), this.set("end", a));
156
+ const p = this.getPrivate("positionTextFunction"), m = Math.round(this.get("start", 0) * 100), _ = Math.round(this.get("end", 0) * 100);
157
+ let g, w;
158
+ p ? (g = p.call(this, this.get("start", 0)), w = p.call(this, this.get("end", 0))) : (g = m + "%", w = _ + "%"), t.set("ariaLabel", this._t("From %1 to %2", void 0, g, w)), t.set("ariaValueNow", "" + m), t.set("ariaValueText", m + "%");
159
+ }
160
+ _updateGripsByThumb() {
161
+ const t = this.thumb, e = this.startGrip, i = this.endGrip;
162
+ if (this.get("orientation") == "vertical") {
163
+ const o = t.height();
164
+ e.set("y", t.y()), i.set("y", t.y() + o);
165
+ } else {
166
+ const o = t.width();
167
+ e.set("x", t.x()), i.set("x", t.x() + o);
168
+ }
169
+ }
170
+ }
171
+ Object.defineProperty(D, "className", {
172
+ enumerable: !0,
173
+ configurable: !0,
174
+ writable: !0,
175
+ value: "Scrollbar"
176
+ });
177
+ Object.defineProperty(D, "classNames", {
178
+ enumerable: !0,
179
+ configurable: !0,
180
+ writable: !0,
181
+ value: C.classNames.concat([D.className])
182
+ });
183
+ const Gt = (G) => {
184
+ const t = X({ props: G, name: "HCLogaritmicScale" }), {
185
+ dimensions: e,
186
+ values: i,
187
+ data: o,
188
+ initDelay: s = 0,
189
+ baseInterval: n,
190
+ colors: h,
191
+ skipEmptyDates: l = !1,
192
+ sx: d,
193
+ ...u
194
+ } = t, a = S(), m = `hc-logaritmic-scale-${E().replace(/:/g, "")}`, _ = Y(null);
195
+ let g = null;
196
+ e.length < 1 ? g = "LogaritmicScale requires at least 1 dimension" : i.length < 1 && (g = "LogaritmicScale requires at least 1 value"), z(() => {
197
+ if (g) return;
198
+ let T;
199
+ return T = setTimeout(() => {
200
+ var P, B, M, F;
201
+ const r = O.new(m);
202
+ _.current = r, r.setThemes([L.new(r)]), r.interfaceColors.setAll({
203
+ text: f(a.palette.text.primary),
204
+ grid: f(a.palette.divider),
205
+ stroke: f(a.palette.divider)
40
206
  });
41
- const r = e.container.children.push(
42
- N.new(e, {
207
+ const c = r.container.children.push(
208
+ $.new(r, {
43
209
  panX: !0,
44
210
  panY: !0,
45
211
  wheelX: "none",
@@ -48,81 +214,81 @@ const xe = (k) => {
48
214
  pinchZoomX: !0
49
215
  })
50
216
  );
51
- r.set("colors", z(e, A)), r.set(
217
+ c.set("colors", H(r, h)), c.set(
52
218
  "cursor",
53
- W.new(e, { behavior: "none" })
219
+ K.new(r, { behavior: "none" })
54
220
  ).lineY.set("visible", !1);
55
- let o, p = n;
56
- if (t[0].type === "date") {
57
- p = F.orderBy(n, [t[0].value]);
58
- const l = x ? J : M;
59
- o = r.xAxes.push(
60
- l.new(e, {
221
+ let b, A = o;
222
+ if (e[0].type === "date") {
223
+ A = j.orderBy(o, [e[0].value]);
224
+ const y = l ? it : nt;
225
+ b = c.xAxes.push(
226
+ y.new(r, {
61
227
  maxDeviation: 0.1,
62
228
  groupData: !1,
63
- baseInterval: h || { timeUnit: "day", count: 1 },
64
- renderer: X.new(e, {})
229
+ baseInterval: n || { timeUnit: "day", count: 1 },
230
+ renderer: N.new(r, {})
65
231
  })
66
- ), (v = o.get("renderer")) == null || v.grid.template.setAll({
67
- stroke: i(a.palette.divider),
232
+ ), (P = b.get("renderer")) == null || P.grid.template.setAll({
233
+ stroke: f(a.palette.divider),
68
234
  strokeOpacity: 1
69
- }), B(o, t[0]);
235
+ }), U(b, e[0]);
70
236
  } else
71
- o = r.xAxes.push(
72
- _.new(e, {
73
- categoryField: t[0].value,
74
- renderer: X.new(e, {})
237
+ b = c.xAxes.push(
238
+ tt.new(r, {
239
+ categoryField: e[0].value,
240
+ renderer: N.new(r, {})
75
241
  })
76
- ), e.numberFormatter.setAll({
242
+ ), r.numberFormatter.setAll({
77
243
  numberFormat: "#",
78
244
  numericFields: ["valueX"]
79
- }), p = F.orderBy(n, [t[0].value]), o.data.setAll(p), (w = o.get("renderer")) == null || w.grid.template.setAll({
80
- stroke: i(a.palette.divider),
245
+ }), b.data.setAll(A), (B = b.get("renderer")) == null || B.grid.template.setAll({
246
+ stroke: f(a.palette.divider),
81
247
  strokeOpacity: 1
82
248
  });
83
- const y = r.yAxes.push(
84
- U.new(e, {
249
+ const k = c.yAxes.push(
250
+ J.new(r, {
85
251
  logarithmic: !0,
86
- renderer: Z.new(e, { minorGridEnabled: !0 })
252
+ renderer: Q.new(r, { minorGridEnabled: !0 })
87
253
  })
88
254
  );
89
- (D = y.get("renderer")) == null || D.grid.template.setAll({
90
- stroke: i(a.palette.divider),
255
+ (M = k.get("renderer")) == null || M.grid.template.setAll({
256
+ stroke: f(a.palette.divider),
91
257
  strokeOpacity: 1
92
- }), s.forEach((l) => {
93
- const c = r.series.push(
94
- $.new(e, {
95
- name: l.label ?? V(l.name),
96
- xAxis: o,
97
- yAxis: y,
98
- valueYField: l.dataFieldName,
99
- ...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
258
+ }), i.forEach((y) => {
259
+ const v = c.series.push(
260
+ et.new(r, {
261
+ name: y.label ?? I(y.name),
262
+ xAxis: b,
263
+ yAxis: k,
264
+ valueYField: y.dataFieldName,
265
+ ...e[0].type === "date" ? { valueXField: e[0].value } : { categoryXField: e[0].value }
100
266
  })
101
267
  );
102
- c.strokes.template.setAll({ strokeWidth: 3 }), t[0].type === "date" && (c.data.processor = j.new(e, {
268
+ v.strokes.template.setAll({ strokeWidth: 3 }), e[0].type === "date" && (v.data.processor = st.new(r, {
103
269
  dateFormat: "i",
104
- dateFields: [t[0].value]
105
- })), c.data.setAll(p), c.appear(1e3);
270
+ dateFields: [e[0].value]
271
+ })), v.data.setAll(A), v.appear(1e3);
106
272
  }), q({
107
- root: e,
108
- chart: r,
109
- xAxis: o,
273
+ root: r,
274
+ chart: c,
275
+ xAxis: b,
110
276
  theme: a,
111
- isDateAxis: t[0].type === "date",
112
- baseInterval: h,
277
+ isDateAxis: e[0].type === "date",
278
+ baseInterval: n,
113
279
  follow: !0
114
- }), r.set(
280
+ }), c.set(
115
281
  "scrollbarX",
116
- K.new(e, { orientation: "horizontal" })
117
- ), H(e, (b = s == null ? void 0 : s[0]) == null ? void 0 : b.format), r.appear(1e3, 100);
118
- }, L), () => {
119
- var e;
120
- u && clearTimeout(u), (e = d.current) == null || e.dispose(), d.current = null;
282
+ D.new(r, { orientation: "horizontal" })
283
+ ), W(r, (F = i == null ? void 0 : i[0]) == null ? void 0 : F.format), c.appear(1e3, 100);
284
+ }, s), () => {
285
+ var r;
286
+ T && clearTimeout(T), (r = _.current) == null || r.dispose(), _.current = null;
121
287
  };
122
- }, [n, t, s, a.palette.mode, A, x]);
123
- const T = { ...f };
124
- return { chartId: g, ownerState: T, sx: S, error: m, other: C };
288
+ }, [o, e, i, a.palette.mode, h, l]);
289
+ const w = { ...t };
290
+ return { chartId: m, ownerState: w, sx: d, error: g, other: u };
125
291
  };
126
292
  export {
127
- xe as useLogaritmicScaleLogic
293
+ Gt as useLogaritmicScaleLogic
128
294
  };
@@ -1,11 +1,11 @@
1
1
  import { R as j, A as q } from "../../../AnimatedTheme-ktdO3Bel.js";
2
2
  import { useThemeProps as z, useTheme as U } from "@mui/material";
3
- import v from "lodash";
3
+ import N from "lodash";
4
4
  import { useId as H, useRef as $, useEffect as J } from "react";
5
5
  import { humanizeLabel as P } from "../_common/format.js";
6
6
  import { attachCombinedAxisTooltip as K } from "../_common/tooltip.js";
7
7
  import { colorSetFromPalette as Q, applyDateAxisLabelFormat as Z, applyValueFormat as ee } from "../_common/utils.js";
8
- import { c as C, a as A } from "../../../Entity-BJCuhdq_.js";
8
+ import { c as v, a as g } from "../../../Entity-BJCuhdq_.js";
9
9
  import { X as te, V as re } from "../../../AxisRenderer-BCQoUJw6.js";
10
10
  import { L as se } from "../../../Legend-CFvQiIfn.js";
11
11
  import { A as X, a as ae } from "../../../AxisRendererY-AXWvGU6r.js";
@@ -14,10 +14,10 @@ import { X as oe } from "../../../XYCursor-CVUSpqb9.js";
14
14
  import { G as le, D as ne } from "../../../GaplessDateAxis-B2g2jgSG.js";
15
15
  import { D as ce } from "../../../DateAxis-DEXKps1S.js";
16
16
  import { L as me } from "../../../LineSeries-D_IL2qGF.js";
17
- import { G, R as ue } from "../../../Tooltip-vyZRZWih.js";
18
- import { C as pe } from "../../../Circle-BnfBNKBD.js";
17
+ import { G, R as pe } from "../../../Tooltip-vyZRZWih.js";
18
+ import { C as ue } from "../../../Circle-BnfBNKBD.js";
19
19
  import { B as de } from "../../../Bullet-Djj7Vs9T.js";
20
- class y extends G {
20
+ class x extends G {
21
21
  _beforeChanged() {
22
22
  super._beforeChanged(), (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && (this._clear = !0);
23
23
  }
@@ -32,41 +32,41 @@ class y extends G {
32
32
  this.markDirty(), this._clear = !0;
33
33
  }
34
34
  }
35
- Object.defineProperty(y, "className", {
35
+ Object.defineProperty(x, "className", {
36
36
  enumerable: !0,
37
37
  configurable: !0,
38
38
  writable: !0,
39
39
  value: "Triangle"
40
40
  });
41
- Object.defineProperty(y, "classNames", {
41
+ Object.defineProperty(x, "classNames", {
42
42
  enumerable: !0,
43
43
  configurable: !0,
44
44
  writable: !0,
45
- value: G.classNames.concat([y.className])
45
+ value: G.classNames.concat([x.className])
46
46
  });
47
- const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
48
- const c = z({ props: T, name: "HCMultipleValueAxes" }), {
47
+ const A = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (C) => {
48
+ const c = z({ props: C, name: "HCMultipleValueAxes" }), {
49
49
  dimensions: s,
50
50
  values: t,
51
- data: d,
51
+ data: y,
52
52
  initDelay: I = 0,
53
- baseInterval: L,
54
- colors: R,
55
- skipEmptyDates: E = !1,
53
+ baseInterval: T,
54
+ colors: L,
55
+ skipEmptyDates: R = !1,
56
56
  sx: Y,
57
57
  ...V
58
- } = c, u = U(), _ = `hc-multiple-value-axes-${H().replace(/:/g, "")}`, w = $(null);
59
- let h = null;
60
- s.length < 1 ? h = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (h = "MultipleValueAxes requires at least 1 value"), J(() => {
61
- if (h) return;
58
+ } = c, p = U(), E = `hc-multiple-value-axes-${H().replace(/:/g, "")}`, w = $(null);
59
+ let u = null;
60
+ s.length < 1 ? u = "MultipleValueAxes requires at least 1 dimension" : t.length < 1 && (u = "MultipleValueAxes requires at least 1 value"), J(() => {
61
+ if (u) return;
62
62
  let b;
63
63
  return b = setTimeout(() => {
64
- var N;
65
- const e = j.new(_);
64
+ var F;
65
+ const e = j.new(E);
66
66
  w.current = e, e.setThemes([q.new(e)]), e.interfaceColors.setAll({
67
- text: C(u.palette.text.primary),
68
- grid: C(u.palette.divider),
69
- stroke: C(u.palette.divider)
67
+ text: v(p.palette.text.primary),
68
+ grid: v(p.palette.divider),
69
+ stroke: v(p.palette.divider)
70
70
  });
71
71
  const r = e.container.children.push(
72
72
  te.new(e, {
@@ -78,75 +78,75 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
78
78
  layout: e.verticalLayout
79
79
  })
80
80
  );
81
- r.set("colors", Q(e, R)), r.get("colors", {}).set("step", 3);
82
- const O = r.children.push(
83
- se.new(e, { centerX: A, x: A })
84
- ), i = s[0];
85
- let l, p = d;
86
- if (i.type === "date") {
87
- const a = E ? le : ce;
81
+ r.set("colors", Q(e, L)), r.get("colors", {}).set("step", 3);
82
+ const S = r.children.push(
83
+ se.new(e, { centerX: g, x: g })
84
+ ), o = s[0];
85
+ let l, d = y;
86
+ if (o.type === "date") {
87
+ const a = R ? le : ce;
88
88
  l = r.xAxes.push(
89
89
  a.new(e, {
90
90
  maxDeviation: 0.1,
91
91
  groupData: !1,
92
- baseInterval: L || { timeUnit: "day", count: 1 },
92
+ baseInterval: T || { timeUnit: "day", count: 1 },
93
93
  renderer: X.new(e, {})
94
94
  })
95
- ), Z(l, i), p = v.orderBy(d, [i.value]);
95
+ ), Z(l, o), d = N.orderBy(y, [o.value]);
96
96
  } else
97
97
  l = r.xAxes.push(
98
98
  ie.new(e, {
99
- categoryField: i.value,
99
+ categoryField: o.value,
100
100
  renderer: X.new(e, {})
101
101
  })
102
102
  ), e.numberFormatter.setAll({
103
103
  numberFormat: "#",
104
104
  numericFields: ["valueX"]
105
- }), p = v.orderBy(d, [i.value]), l.data.setAll(p);
106
- function F(a, n, m, S, W, D, M) {
107
- const f = ae.new(e, { opposite: W }), k = r.yAxes.push(
108
- re.new(e, { maxDeviation: 1, renderer: f })
105
+ }), l.data.setAll(d);
106
+ function _(a, n, m, B, W, D, M) {
107
+ const h = ae.new(e, { opposite: W }), k = r.yAxes.push(
108
+ re.new(e, { maxDeviation: 1, renderer: h })
109
109
  );
110
110
  r.yAxes.indexOf(k) > 0 && k.set("syncWithAxis", r.yAxes.getIndex(0));
111
- const o = r.series.push(
111
+ const i = r.series.push(
112
112
  me.new(e, {
113
113
  name: n,
114
114
  xAxis: l,
115
115
  yAxis: k,
116
- valueYField: S,
117
- ...i.type === "date" ? { valueXField: m } : { categoryXField: m }
116
+ valueYField: B,
117
+ ...o.type === "date" ? { valueXField: m } : { categoryXField: m }
118
118
  })
119
119
  );
120
- o.strokes.template.setAll({ strokeWidth: 2 }), f.grid.template.set("strokeOpacity", 0.05), f.labels.template.set("fill", o.get("fill")), f.setAll({
121
- stroke: o.get("fill"),
120
+ i.strokes.template.setAll({ strokeWidth: 2 }), h.grid.template.set("strokeOpacity", 0.05), h.labels.template.set("fill", i.get("fill")), h.setAll({
121
+ stroke: i.get("fill"),
122
122
  strokeOpacity: 1,
123
123
  opacity: 1
124
- }), M === "date" && (o.data.processor = ne.new(e, {
124
+ }), M === "date" && (i.data.processor = ne.new(e, {
125
125
  dateFormat: "i",
126
126
  dateFields: [m]
127
- })), D !== void 0 && o.bullets.push(function() {
128
- let g;
129
- return D === "RECTANGLE" ? g = ue.new(e, {
127
+ })), D !== void 0 && i.bullets.push(function() {
128
+ let f;
129
+ return D === "RECTANGLE" ? f = pe.new(e, {
130
130
  width: 10,
131
131
  height: 10,
132
- centerX: A,
133
- centerY: A,
132
+ centerX: g,
133
+ centerY: g,
134
134
  strokeWidth: 2,
135
- stroke: o.get("stroke"),
135
+ stroke: i.get("stroke"),
136
136
  fill: e.interfaceColors.get("background")
137
- }) : D === "TRIANGLE" ? g = y.new(e, {
137
+ }) : D === "TRIANGLE" ? f = x.new(e, {
138
138
  width: 10,
139
139
  height: 10,
140
140
  strokeWidth: 2,
141
- stroke: o.get("stroke"),
141
+ stroke: i.get("stroke"),
142
142
  fill: e.interfaceColors.get("background")
143
- }) : g = pe.new(e, {
143
+ }) : f = ue.new(e, {
144
144
  strokeWidth: 2,
145
145
  radius: 4,
146
- stroke: o.get("stroke"),
146
+ stroke: i.get("stroke"),
147
147
  fill: e.interfaceColors.get("background")
148
- }), de.new(e, { sprite: g });
149
- }), o.data.setAll(a);
148
+ }), de.new(e, { sprite: f });
149
+ }), i.data.setAll(a);
150
150
  }
151
151
  if (r.set(
152
152
  "cursor",
@@ -155,42 +155,42 @@ const x = ["CIRCLE", "RECTANGLE", "TRIANGLE"], Ge = (T) => {
155
155
  root: e,
156
156
  chart: r,
157
157
  xAxis: l,
158
- theme: u,
159
- isDateAxis: i.type === "date",
160
- baseInterval: L,
158
+ theme: p,
159
+ isDateAxis: o.type === "date",
160
+ baseInterval: T,
161
161
  follow: !0
162
162
  }), s.length > 1) {
163
- const a = v.groupBy(p, s[1].value);
163
+ const a = N.groupBy(d, s[1].value);
164
164
  Object.keys(a).forEach((n, m) => {
165
- F(
165
+ _(
166
166
  a[n],
167
167
  P(n),
168
168
  s[0].value,
169
169
  t[0].dataFieldName,
170
170
  m !== 0,
171
- x[m % x.length]
171
+ A[m % A.length]
172
172
  );
173
173
  });
174
174
  } else
175
175
  t.forEach((a, n) => {
176
- F(
177
- p,
176
+ _(
177
+ d,
178
178
  a.label ?? P(a.name),
179
- i.value,
179
+ o.value,
180
180
  a.dataFieldName,
181
181
  n !== 0,
182
- x[n % x.length],
183
- i.type
182
+ A[n % A.length],
183
+ o.type
184
184
  );
185
185
  });
186
- O.data.setAll(r.series.values), ee(e, (N = t == null ? void 0 : t[0]) == null ? void 0 : N.format), r.appear(1e3, 100);
186
+ S.data.setAll(r.series.values), ee(e, (F = t == null ? void 0 : t[0]) == null ? void 0 : F.format), r.appear(1e3, 100);
187
187
  }, I), () => {
188
188
  var e;
189
189
  b && clearTimeout(b), (e = w.current) == null || e.dispose(), w.current = null;
190
190
  };
191
- }, [d, s, t, u.palette.mode, R, E]);
192
- const B = { ...c };
193
- return { chartId: _, ownerState: B, sx: Y, error: h, other: V };
191
+ }, [y, s, t, p.palette.mode, L, R]);
192
+ const O = { ...c };
193
+ return { chartId: E, ownerState: O, sx: Y, error: u, other: V };
194
194
  };
195
195
  export {
196
196
  Ge as useMultipleValueAxesLogic