@hybridcore/ui 1.6.30 → 1.6.32

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.
@@ -3,19 +3,19 @@ import { useThemeProps as $, useTheme as G } from "@mui/material";
3
3
  import J from "dayjs";
4
4
  import K from "lodash";
5
5
  import { useId as Q, useRef as U, useEffect as ee } from "react";
6
- import { applyValueFormat as te, colorSetFromPalette as ie } from "../_common/utils.js";
7
- import { C as x, a as F, b as I, L as ae } from "../../../Tooltip-vyZRZWih.js";
8
- import { m as M, f as O, e as j, p as C } from "../../../Entity-BJCuhdq_.js";
9
- import { a as ne, H as X } from "../../../Hierarchy-CEOK8Gzh.js";
6
+ import { applyValueFormat as te, applyInterfaceColors as ie, colorSetFromPalette as ae } from "../_common/utils.js";
7
+ import { C as x, a as F, b as I, L as ne } from "../../../Tooltip-vyZRZWih.js";
8
+ import { m as M, f as O, e as S, p as j } from "../../../Entity-BJCuhdq_.js";
9
+ import { a as se, H as X } from "../../../Hierarchy-CEOK8Gzh.js";
10
10
  import { R as z } from "../../../RoundedRectangle-BKLX1LKM.js";
11
- import { r as se, c as R, a as L } from "../../../constant-BiOGvlZc.js";
11
+ import { r as re, c as R, a as L } from "../../../constant-BiOGvlZc.js";
12
12
  class Y extends x {
13
13
  constructor() {
14
14
  super(...arguments), Object.defineProperty(this, "labels", {
15
15
  enumerable: !0,
16
16
  configurable: !0,
17
17
  writable: !0,
18
- value: this.addDisposer(new F(I.new({}), () => ae._new(this._root, {
18
+ value: this.addDisposer(new F(I.new({}), () => ne._new(this._root, {
19
19
  themeTags: M(this.labels.template.get("themeTags", []), ["label"]),
20
20
  background: z.new(this._root, {
21
21
  themeTags: ["background"]
@@ -39,7 +39,7 @@ class Y extends x {
39
39
  }), this.labels.push(i), i;
40
40
  }
41
41
  _afterNew() {
42
- this._defaultThemes.push(ne.new(this._root)), this._settings.themeTags = M(this._settings.themeTags, ["breadcrumb"]), super._afterNew();
42
+ this._defaultThemes.push(se.new(this._root)), this._settings.themeTags = M(this._settings.themeTags, ["breadcrumb"]), super._afterNew();
43
43
  }
44
44
  _changed() {
45
45
  if (super._changed(), this.isDirty("series")) {
@@ -71,58 +71,58 @@ Object.defineProperty(Y, "classNames", {
71
71
  writable: !0,
72
72
  value: x.classNames.concat([Y.className])
73
73
  });
74
- function re(u) {
74
+ function oe(u) {
75
75
  u.x0 = Math.round(u.x0), u.y0 = Math.round(u.y0), u.x1 = Math.round(u.x1), u.y1 = Math.round(u.y1);
76
76
  }
77
77
  function A(u, t, i, a, r) {
78
- for (var l = u.children, s, h = -1, b = l.length, c = u.value && (a - t) / u.value; ++h < b; )
79
- s = l[h], s.y0 = i, s.y1 = r, s.x0 = t, s.x1 = t += s.value * c;
78
+ for (var l = u.children, s, c = -1, y = l.length, h = u.value && (a - t) / u.value; ++c < y; )
79
+ s = l[c], s.y0 = i, s.y1 = r, s.x0 = t, s.x1 = t += s.value * h;
80
80
  }
81
81
  function H(u, t, i, a, r) {
82
- for (var l = u.children, s, h = -1, b = l.length, c = u.value && (r - i) / u.value; ++h < b; )
83
- s = l[h], s.x0 = t, s.x1 = a, s.y0 = i, s.y1 = i += s.value * c;
82
+ for (var l = u.children, s, c = -1, y = l.length, h = u.value && (r - i) / u.value; ++c < y; )
83
+ s = l[c], s.x0 = t, s.x1 = a, s.y0 = i, s.y1 = i += s.value * h;
84
84
  }
85
- var oe = (1 + Math.sqrt(5)) / 2;
86
- function le(u, t, i, a, r, l) {
87
- for (var s = [], h = t.children, b, c, o = 0, m = 0, e = h.length, d, g, p = t.value, n, f, w, v, P, y, _; o < e; ) {
85
+ var le = (1 + Math.sqrt(5)) / 2;
86
+ function de(u, t, i, a, r, l) {
87
+ for (var s = [], c = t.children, y, h, o = 0, m = 0, e = c.length, d, g, p = t.value, n, f, w, v, P, b, _; o < e; ) {
88
88
  d = r - i, g = l - a;
89
89
  do
90
- n = h[m++].value;
90
+ n = c[m++].value;
91
91
  while (!n && m < e);
92
- for (f = w = n, y = Math.max(g / d, d / g) / (p * u), _ = n * n * y, P = Math.max(w / _, _ / f); m < e; ++m) {
93
- if (n += c = h[m].value, c < f && (f = c), c > w && (w = c), _ = n * n * y, v = Math.max(w / _, _ / f), v > P) {
94
- n -= c;
92
+ for (f = w = n, b = Math.max(g / d, d / g) / (p * u), _ = n * n * b, P = Math.max(w / _, _ / f); m < e; ++m) {
93
+ if (n += h = c[m].value, h < f && (f = h), h > w && (w = h), _ = n * n * b, v = Math.max(w / _, _ / f), v > P) {
94
+ n -= h;
95
95
  break;
96
96
  }
97
97
  P = v;
98
98
  }
99
- s.push(b = { value: n, dice: d < g, children: h.slice(o, m) }), b.dice ? A(b, i, a, r, p ? a += g * n / p : l) : H(b, i, a, p ? i += d * n / p : r, l), p -= n, o = m;
99
+ s.push(y = { value: n, dice: d < g, children: c.slice(o, m) }), y.dice ? A(y, i, a, r, p ? a += g * n / p : l) : H(y, i, a, p ? i += d * n / p : r, l), p -= n, o = m;
100
100
  }
101
101
  return s;
102
102
  }
103
103
  const V = function u(t) {
104
- function i(a, r, l, s, h) {
105
- le(t, a, r, l, s, h);
104
+ function i(a, r, l, s, c) {
105
+ de(t, a, r, l, s, c);
106
106
  }
107
107
  return i.ratio = function(a) {
108
108
  return u((a = +a) > 1 ? a : 1);
109
109
  }, i;
110
- }(oe);
110
+ }(le);
111
111
  function q() {
112
- var u = V, t = !1, i = 1, a = 1, r = [0], l = R, s = R, h = R, b = R, c = R;
112
+ var u = V, t = !1, i = 1, a = 1, r = [0], l = R, s = R, c = R, y = R, h = R;
113
113
  function o(e) {
114
- return e.x0 = e.y0 = 0, e.x1 = i, e.y1 = a, e.eachBefore(m), r = [0], t && e.eachBefore(re), e;
114
+ return e.x0 = e.y0 = 0, e.x1 = i, e.y1 = a, e.eachBefore(m), r = [0], t && e.eachBefore(oe), e;
115
115
  }
116
116
  function m(e) {
117
117
  var d = r[e.depth], g = e.x0 + d, p = e.y0 + d, n = e.x1 - d, f = e.y1 - d;
118
- n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), e.x0 = g, e.y0 = p, e.x1 = n, e.y1 = f, e.children && (d = r[e.depth + 1] = l(e) / 2, g += c(e) - d, p += s(e) - d, n -= h(e) - d, f -= b(e) - d, n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), u(e, g, p, n, f));
118
+ n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), e.x0 = g, e.y0 = p, e.x1 = n, e.y1 = f, e.children && (d = r[e.depth + 1] = l(e) / 2, g += h(e) - d, p += s(e) - d, n -= c(e) - d, f -= y(e) - d, n < g && (g = n = (g + n) / 2), f < p && (p = f = (p + f) / 2), u(e, g, p, n, f));
119
119
  }
120
120
  return o.round = function(e) {
121
121
  return arguments.length ? (t = !!e, o) : t;
122
122
  }, o.size = function(e) {
123
123
  return arguments.length ? (i = +e[0], a = +e[1], o) : [i, a];
124
124
  }, o.tile = function(e) {
125
- return arguments.length ? (u = se(e), o) : u;
125
+ return arguments.length ? (u = re(e), o) : u;
126
126
  }, o.padding = function(e) {
127
127
  return arguments.length ? o.paddingInner(e).paddingOuter(e) : o.paddingInner();
128
128
  }, o.paddingInner = function(e) {
@@ -132,40 +132,40 @@ function q() {
132
132
  }, o.paddingTop = function(e) {
133
133
  return arguments.length ? (s = typeof e == "function" ? e : L(+e), o) : s;
134
134
  }, o.paddingRight = function(e) {
135
- return arguments.length ? (h = typeof e == "function" ? e : L(+e), o) : h;
135
+ return arguments.length ? (c = typeof e == "function" ? e : L(+e), o) : c;
136
136
  }, o.paddingBottom = function(e) {
137
- return arguments.length ? (b = typeof e == "function" ? e : L(+e), o) : b;
137
+ return arguments.length ? (y = typeof e == "function" ? e : L(+e), o) : y;
138
138
  }, o.paddingLeft = function(e) {
139
- return arguments.length ? (c = typeof e == "function" ? e : L(+e), o) : c;
139
+ return arguments.length ? (h = typeof e == "function" ? e : L(+e), o) : h;
140
140
  }, o;
141
141
  }
142
- function de(u, t, i, a, r) {
143
- var l = u.children, s, h = l.length, b, c = new Array(h + 1);
144
- for (c[0] = b = s = 0; s < h; ++s)
145
- c[s + 1] = b += l[s].value;
146
- o(0, h, u.value, t, i, a, r);
142
+ function ue(u, t, i, a, r) {
143
+ var l = u.children, s, c = l.length, y, h = new Array(c + 1);
144
+ for (h[0] = y = s = 0; s < c; ++s)
145
+ h[s + 1] = y += l[s].value;
146
+ o(0, c, u.value, t, i, a, r);
147
147
  function o(m, e, d, g, p, n, f) {
148
148
  if (m >= e - 1) {
149
149
  var w = l[m];
150
150
  w.x0 = g, w.y0 = p, w.x1 = n, w.y1 = f;
151
151
  return;
152
152
  }
153
- for (var v = c[m], P = d / 2 + v, y = m + 1, _ = e - 1; y < _; ) {
154
- var k = y + _ >>> 1;
155
- c[k] < P ? y = k + 1 : _ = k;
153
+ for (var v = h[m], P = d / 2 + v, b = m + 1, _ = e - 1; b < _; ) {
154
+ var k = b + _ >>> 1;
155
+ h[k] < P ? b = k + 1 : _ = k;
156
156
  }
157
- P - c[y - 1] < c[y] - P && m + 1 < y && --y;
158
- var D = c[y] - v, T = d - D;
157
+ P - h[b - 1] < h[b] - P && m + 1 < b && --b;
158
+ var D = h[b] - v, T = d - D;
159
159
  if (n - g > f - p) {
160
160
  var N = d ? (g * T + n * D) / d : n;
161
- o(m, y, D, g, p, N, f), o(y, e, T, N, p, n, f);
161
+ o(m, b, D, g, p, N, f), o(b, e, T, N, p, n, f);
162
162
  } else {
163
- var S = d ? (p * T + f * D) / d : f;
164
- o(m, y, D, g, p, n, S), o(y, e, T, g, S, n, f);
163
+ var C = d ? (p * T + f * D) / d : f;
164
+ o(m, b, D, g, p, n, C), o(b, e, T, g, C, n, f);
165
165
  }
166
166
  }
167
167
  }
168
- function ue(u, t, i, a, r) {
168
+ function he(u, t, i, a, r) {
169
169
  (u.depth & 1 ? H : A)(u, t, i, a, r);
170
170
  }
171
171
  class B extends X {
@@ -205,7 +205,7 @@ class B extends X {
205
205
  t = V;
206
206
  break;
207
207
  case "binary":
208
- t = de;
208
+ t = ue;
209
209
  break;
210
210
  case "slice":
211
211
  t = H;
@@ -214,7 +214,7 @@ class B extends X {
214
214
  t = A;
215
215
  break;
216
216
  case "sliceDice":
217
- t = ue;
217
+ t = he;
218
218
  break;
219
219
  }
220
220
  if (t) {
@@ -229,14 +229,14 @@ class B extends X {
229
229
  if (this._rootNode) {
230
230
  const t = this._treemapLayout;
231
231
  t.size([this.innerWidth(), this.innerHeight()]);
232
- const i = this.get("nodePaddingLeft"), a = this.get("nodePaddingRight"), r = this.get("nodePaddingTop"), l = this.get("nodePaddingBottom"), s = this.get("nodePaddingInner"), h = this.get("nodePaddingOuter");
233
- O(i) && t.paddingLeft(i), O(a) && t.paddingRight(a), O(r) && t.paddingTop(r), O(l) && t.paddingBottom(l), O(s) && t.paddingInner(s), O(h) && t.paddingOuter(h), t(this._rootNode), this._updateNodes(this._rootNode);
232
+ const i = this.get("nodePaddingLeft"), a = this.get("nodePaddingRight"), r = this.get("nodePaddingTop"), l = this.get("nodePaddingBottom"), s = this.get("nodePaddingInner"), c = this.get("nodePaddingOuter");
233
+ O(i) && t.paddingLeft(i), O(a) && t.paddingRight(a), O(r) && t.paddingTop(r), O(l) && t.paddingBottom(l), O(s) && t.paddingInner(s), O(c) && t.paddingOuter(c), t(this._rootNode), this._updateNodes(this._rootNode);
234
234
  }
235
235
  }
236
236
  _updateNode(t) {
237
237
  super._updateNode(t);
238
- const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = r.x0 * l, b = r.x1 * l, c = r.y0 * s, o = r.y1 * s, m = b - h, e = o - c, d = this.get("animationDuration", 0), g = this.get("animationEasing");
239
- if (i.animate({ key: "x", to: h, duration: d, easing: g }), i.animate({ key: "y", to: c, duration: d, easing: g }), i.animate({ key: "width", to: m, duration: d, easing: g }), i.animate({ key: "height", to: e, duration: d, easing: g }), a) {
238
+ const i = t.get("node"), a = t.get("rectangle"), r = t.get("d3HierarchyNode"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), c = r.x0 * l, y = r.x1 * l, h = r.y0 * s, o = r.y1 * s, m = y - c, e = o - h, d = this.get("animationDuration", 0), g = this.get("animationEasing");
239
+ if (i.animate({ key: "x", to: c, duration: d, easing: g }), i.animate({ key: "y", to: h, duration: d, easing: g }), i.animate({ key: "width", to: m, duration: d, easing: g }), i.animate({ key: "height", to: e, duration: d, easing: g }), a) {
240
240
  const p = t.get("fill"), n = t.get("fillPattern");
241
241
  a.animate({ key: "width", to: m, duration: d, easing: g }), a.animate({ key: "height", to: e, duration: d, easing: g }), a._setDefault("fill", p), a._setDefault("fillPattern", n), a._setDefault("stroke", p);
242
242
  }
@@ -244,10 +244,10 @@ class B extends X {
244
244
  _updateNodesScale(t) {
245
245
  const i = t.data.dataItem;
246
246
  if (i) {
247
- const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), h = t.x0 * l, b = t.x1 * l, c = t.y0 * s, o = t.y1 * s, m = b - h, e = o - c;
248
- a.setAll({ x: h, y: c, width: m, height: e }), r.setAll({ width: m, height: e });
247
+ const a = i.get("node"), r = i.get("rectangle"), l = this.getPrivate("scaleX", 1), s = this.getPrivate("scaleY", 1), c = t.x0 * l, y = t.x1 * l, h = t.y0 * s, o = t.y1 * s, m = y - c, e = o - h;
248
+ a.setAll({ x: c, y: h, width: m, height: e }), r.setAll({ width: m, height: e });
249
249
  const d = t.children;
250
- d && j(d, (g) => {
250
+ d && S(d, (g) => {
251
251
  this._updateNodesScale(g);
252
252
  });
253
253
  }
@@ -268,10 +268,10 @@ class B extends X {
268
268
  _zoom(t) {
269
269
  if (this.width() > 0 && this.height() > 0) {
270
270
  const i = t.get("d3HierarchyNode"), a = this.get("nodePaddingOuter", 0);
271
- let r = i.x0 + a, l = i.x1 - a, s = i.y0 + a, h = i.y1 - a, b = (this.innerWidth() - a * 2) / (l - r), c = (this.innerHeight() - a * 2) / (h - s);
271
+ let r = i.x0 + a, l = i.x1 - a, s = i.y0 + a, c = i.y1 - a, y = (this.innerWidth() - a * 2) / (l - r), h = (this.innerHeight() - a * 2) / (c - s);
272
272
  const o = this.get("animationEasing");
273
273
  let m = this.get("animationDuration", 0);
274
- this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: b, duration: m, easing: o }), this.animatePrivate({ key: "scaleY", to: c, duration: m, easing: o }), this.nodesContainer.animate({ key: "x", to: a - r * b, duration: m, easing: o }), this.nodesContainer.animate({ key: "y", to: a - s * c, duration: m, easing: o });
274
+ this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: y, duration: m, easing: o }), this.animatePrivate({ key: "scaleY", to: h, duration: m, easing: o }), this.nodesContainer.animate({ key: "x", to: a - r * y, duration: m, easing: o }), this.nodesContainer.animate({ key: "y", to: a - s * h, duration: m, easing: o });
275
275
  }
276
276
  }
277
277
  _selectDataItem(t, i, a) {
@@ -288,7 +288,7 @@ class B extends X {
288
288
  _getVisibleNodes(t, i) {
289
289
  const a = t.get("children");
290
290
  let r = [];
291
- return a && j(a, (l) => {
291
+ return a && S(a, (l) => {
292
292
  l.get("depth") == i || !l.get("children") ? r.push(l) : r = r.concat(this._getVisibleNodes(l, i));
293
293
  }), r;
294
294
  }
@@ -305,30 +305,30 @@ Object.defineProperty(B, "classNames", {
305
305
  writable: !0,
306
306
  value: X.classNames.concat([B.className])
307
307
  });
308
- const De = (u) => {
308
+ const Pe = (u) => {
309
309
  const t = $({ props: u, name: "HCDrillDownTreemap" }), {
310
310
  dimensions: i,
311
311
  values: a,
312
312
  data: r,
313
313
  initDelay: l = 0,
314
314
  colors: s,
315
- sx: h,
316
- ...b
317
- } = t, c = G(), m = `hc-drill-down-treemap-${Q().replace(/:/g, "")}`, e = U(null);
315
+ sx: c,
316
+ ...y
317
+ } = t, h = G(), m = `hc-drill-down-treemap-${Q().replace(/:/g, "")}`, e = U(null);
318
318
  let d = null;
319
319
  i.length < 2 ? d = "DrillDownTreemap requires at least 2 dimensions" : a.length < 1 && (d = "DrillDownTreemap requires at least 1 value"), ee(() => {
320
320
  if (d) return;
321
321
  let p;
322
322
  return p = setTimeout(() => {
323
- var y, _;
323
+ var b, _;
324
324
  const n = W.new(m);
325
- e.current = n, te(n, (y = a == null ? void 0 : a[0]) == null ? void 0 : y.format);
325
+ e.current = n, te(n, (b = a == null ? void 0 : a[0]) == null ? void 0 : b.format);
326
326
  const f = E.new(n);
327
- f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth1"]).setAll({ strokeWidth: 2 }), f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth2"]).setAll({ strokeWidth: 1, strokeOpacity: 0.2 }), f.rule("Label", ["node", "depth1"]).setAll({ fontSize: 10 }), f.rule("Label", ["node", "depth2"]).setAll({ fontSize: 10 }), n.setThemes([Z.new(n), f]);
327
+ f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth1"]).setAll({ strokeWidth: 2 }), f.rule("RoundedRectangle", ["hierarchy", "node", "shape", "depth2"]).setAll({ strokeWidth: 1, strokeOpacity: 0.2 }), f.rule("Label", ["node", "depth1"]).setAll({ fontSize: 10 }), f.rule("Label", ["node", "depth2"]).setAll({ fontSize: 10 }), n.setThemes([Z.new(n), f]), ie(n, h);
328
328
  const w = n.container.children.push(
329
329
  x.new(n, {
330
- width: C(100),
331
- height: C(100),
330
+ width: j(100),
331
+ height: j(100),
332
332
  layout: n.verticalLayout
333
333
  })
334
334
  ), v = w.children.push(
@@ -345,7 +345,7 @@ const De = (u) => {
345
345
  nodePaddingInner: 0
346
346
  })
347
347
  );
348
- v.nodes.template.setPrivate("trustBounds", !0), v.set("colors", ie(n, s)), (_ = v.get("colors")) == null || _.set("step", 1), w.children.moveValue(
348
+ v.nodes.template.setPrivate("trustBounds", !0), v.set("colors", ae(n, s)), (_ = v.get("colors")) == null || _.set("step", 1), w.children.moveValue(
349
349
  Y.new(n, { series: v }),
350
350
  0
351
351
  );
@@ -377,10 +377,10 @@ const De = (u) => {
377
377
  var n;
378
378
  p && clearTimeout(p), (n = e.current) == null || n.dispose(), e.current = null;
379
379
  };
380
- }, [r, i, a, c.palette.mode, s]);
380
+ }, [r, i, a, h.palette.mode, s]);
381
381
  const g = { ...t };
382
- return { chartId: m, ownerState: g, sx: h, error: d, other: b };
382
+ return { chartId: m, ownerState: g, sx: c, error: d, other: y };
383
383
  };
384
384
  export {
385
- De as useDrillDownTreemapLogic
385
+ Pe as useDrillDownTreemapLogic
386
386
  };