@hybridcore/ui 1.5.73 → 1.5.77

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,6 +1,6 @@
1
1
  import { jsxs as we, jsx as W } from "react/jsx-runtime";
2
- import { S as oe, L as $, T as F, C as te, m as P, R as ie, k as se, X as ue, G as S, e as N, i as ne, l as Te, j as he, n as Pe, a as le, b as Fe, A as Le, c as Ae, d as De, D as Ce, f as Oe, V as Xe, h as $e, o as Ye, g as Se, p as re } from "../../../AxisRendererY-CFo972D5.js";
3
- import { useRef as ae, useLayoutEffect as Me, useEffect as je } from "react";
2
+ import { S as oe, L as $, T as F, C as te, m as P, R as ie, k as se, X as ue, G as S, e as N, i as ne, l as Te, j as he, n as Pe, a as le, b as Fe, A as Le, c as De, d as Ae, D as Ce, f as Oe, V as Xe, h as $e, o as Ye, g as Se, p as re } from "../../../AxisRendererY-CFo972D5.js";
3
+ import { useRef as ae, useLayoutEffect as Me } from "react";
4
4
  class V extends oe {
5
5
  constructor() {
6
6
  super(...arguments), Object.defineProperty(this, "itemContainers", {
@@ -87,35 +87,35 @@ class V extends oe {
87
87
  super.processDataItem(e);
88
88
  const t = this.makeItemContainer(e), i = this.get("nameField"), r = this.get("fillField"), h = this.get("strokeField");
89
89
  if (t) {
90
- const d = this.get("clickTarget", "itemContainer"), n = e.dataContext;
91
- n && n.set && n.set("legendDataItem", e), t._setDataItem(e), e.set("itemContainer", t);
90
+ const d = this.get("clickTarget", "itemContainer"), l = e.dataContext;
91
+ l && l.set && l.set("legendDataItem", e), t._setDataItem(e), e.set("itemContainer", t);
92
92
  const c = this.makeMarker();
93
93
  if (c) {
94
94
  t.children.push(c), c._setDataItem(e), e.set("marker", c);
95
95
  const s = this.get("useDefaultMarker"), o = c.children.push(this.makeMarkerRectangle());
96
96
  let f = e.get("fill"), p = e.get("stroke");
97
- e.set("markerRectangle", o), n && n.get && (f = n.get(r, f), p = n.get(h, p)), p || (p = f), s ? n.on && (n.on(r, () => {
98
- o.set("fill", n.get(r));
99
- }), n.on(h, () => {
100
- o.set("stroke", n.get(h));
101
- })) : n && n.createLegendMarker && n.createLegendMarker(), o.setAll({ fill: f, stroke: p });
102
- const m = n.component;
103
- m && m.updateLegendMarker && m.updateLegendMarker(n);
97
+ e.set("markerRectangle", o), l && l.get && (f = l.get(r, f), p = l.get(h, p)), p || (p = f), s ? l.on && (l.on(r, () => {
98
+ o.set("fill", l.get(r));
99
+ }), l.on(h, () => {
100
+ o.set("stroke", l.get(h));
101
+ })) : l && l.createLegendMarker && l.createLegendMarker(), o.setAll({ fill: f, stroke: p });
102
+ const m = l.component;
103
+ m && m.updateLegendMarker && m.updateLegendMarker(l);
104
104
  }
105
- const l = this.makeLabel();
106
- if (l) {
107
- t.children.push(l), l._setDataItem(e), e.set("label", l), l.text.on("text", () => {
108
- t.setRaw("ariaLabel", l.text._getText() + (this.get("clickTarget") !== "none" ? "; " + this._t("Press ENTER to toggle") : "")), t.markDirtyAccessibility();
109
- }), n && n.get && e.set("name", n.get(i));
105
+ const n = this.makeLabel();
106
+ if (n) {
107
+ t.children.push(n), n._setDataItem(e), e.set("label", n), n.text.on("text", () => {
108
+ t.setRaw("ariaLabel", n.text._getText() + (this.get("clickTarget") !== "none" ? "; " + this._t("Press ENTER to toggle") : "")), t.markDirtyAccessibility();
109
+ }), l && l.get && e.set("name", l.get(i));
110
110
  let s = e.get("name");
111
- s && l.set("text", s);
111
+ s && n.set("text", s);
112
112
  }
113
113
  const a = this.makeValueLabel();
114
- if (a && (t.children.push(a), a._setDataItem(e), e.set("valueLabel", a)), n && n.show && (n.on("visible", (s) => {
114
+ if (a && (t.children.push(a), a._setDataItem(e), e.set("valueLabel", a)), l && l.show && (l.on("visible", (s) => {
115
115
  t.set("disabled", !s);
116
- }), n.get("visible") || t.set("disabled", !0), d != "none")) {
116
+ }), l.get("visible") || t.set("disabled", !0), d != "none")) {
117
117
  let s = t;
118
- d == "marker" && (s = c), this._addClickEvents(s, n, e);
118
+ d == "marker" && (s = c), this._addClickEvents(s, l, e);
119
119
  }
120
120
  this.children.values.sort((s, o) => {
121
121
  const f = s.dataItem.dataContext, p = o.dataItem.dataContext;
@@ -127,7 +127,7 @@ class V extends oe {
127
127
  return -1;
128
128
  }
129
129
  return 0;
130
- }), n && n.updateLegendValue && n.updateLegendValue();
130
+ }), l && l.updateLegendValue && l.updateLegendValue();
131
131
  }
132
132
  }
133
133
  _addClickEvents(e, t, i) {
@@ -157,8 +157,8 @@ class V extends oe {
157
157
  h && (this.markerRectangles.removeValue(h), h.dispose());
158
158
  let d = e.get("label");
159
159
  d && (this.labels.removeValue(d), d.dispose());
160
- let n = e.get("valueLabel");
161
- n && (this.valueLabels.removeValue(n), n.dispose());
160
+ let l = e.get("valueLabel");
161
+ l && (this.valueLabels.removeValue(l), l.dispose());
162
162
  }
163
163
  }
164
164
  Object.defineProperty(V, "className", {
@@ -178,13 +178,13 @@ function v(u) {
178
178
  return u;
179
179
  };
180
180
  }
181
- const q = Math.PI, Z = 2 * q, M = 1e-6, Re = Z - M;
181
+ const q = Math.PI, Z = 2 * q, M = 1e-6, je = Z - M;
182
182
  function ce(u) {
183
183
  this._ += u[0];
184
184
  for (let e = 1, t = u.length; e < t; ++e)
185
185
  this._ += arguments[e] + u[e];
186
186
  }
187
- function Ee(u) {
187
+ function Re(u) {
188
188
  let e = Math.floor(u);
189
189
  if (!(e >= 0)) throw new Error(`invalid digits: ${u}`);
190
190
  if (e > 15) return ce;
@@ -195,10 +195,10 @@ function Ee(u) {
195
195
  this._ += Math.round(arguments[r] * t) / t + i[r];
196
196
  };
197
197
  }
198
- class Ge {
198
+ class Ee {
199
199
  constructor(e) {
200
200
  this._x0 = this._y0 = // start of current subpath
201
- this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ce : Ee(e);
201
+ this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ce : Re(e);
202
202
  }
203
203
  moveTo(e, t) {
204
204
  this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
@@ -217,20 +217,20 @@ class Ge {
217
217
  }
218
218
  arcTo(e, t, i, r, h) {
219
219
  if (e = +e, t = +t, i = +i, r = +r, h = +h, h < 0) throw new Error(`negative radius: ${h}`);
220
- let d = this._x1, n = this._y1, c = i - e, l = r - t, a = d - e, s = n - t, o = a * a + s * s;
220
+ let d = this._x1, l = this._y1, c = i - e, n = r - t, a = d - e, s = l - t, o = a * a + s * s;
221
221
  if (this._x1 === null)
222
222
  this._append`M${this._x1 = e},${this._y1 = t}`;
223
- else if (o > M) if (!(Math.abs(s * c - l * a) > M) || !h)
223
+ else if (o > M) if (!(Math.abs(s * c - n * a) > M) || !h)
224
224
  this._append`L${this._x1 = e},${this._y1 = t}`;
225
225
  else {
226
- let f = i - d, p = r - n, m = c * c + l * l, b = f * f + p * p, k = Math.sqrt(m), x = Math.sqrt(o), y = h * Math.tan((q - Math.acos((m + o - b) / (2 * k * x))) / 2), _ = y / x, w = y / k;
227
- Math.abs(_ - 1) > M && this._append`L${e + _ * a},${t + _ * s}`, this._append`A${h},${h},0,0,${+(s * f > a * p)},${this._x1 = e + w * c},${this._y1 = t + w * l}`;
226
+ let f = i - d, p = r - l, m = c * c + n * n, b = f * f + p * p, k = Math.sqrt(m), x = Math.sqrt(o), y = h * Math.tan((q - Math.acos((m + o - b) / (2 * k * x))) / 2), _ = y / x, w = y / k;
227
+ Math.abs(_ - 1) > M && this._append`L${e + _ * a},${t + _ * s}`, this._append`A${h},${h},0,0,${+(s * f > a * p)},${this._x1 = e + w * c},${this._y1 = t + w * n}`;
228
228
  }
229
229
  }
230
230
  arc(e, t, i, r, h, d) {
231
231
  if (e = +e, t = +t, i = +i, d = !!d, i < 0) throw new Error(`negative radius: ${i}`);
232
- let n = i * Math.cos(r), c = i * Math.sin(r), l = e + n, a = t + c, s = 1 ^ d, o = d ? r - h : h - r;
233
- this._x1 === null ? this._append`M${l},${a}` : (Math.abs(this._x1 - l) > M || Math.abs(this._y1 - a) > M) && this._append`L${l},${a}`, i && (o < 0 && (o = o % Z + Z), o > Re ? this._append`A${i},${i},0,1,${s},${e - n},${t - c}A${i},${i},0,1,${s},${this._x1 = l},${this._y1 = a}` : o > M && this._append`A${i},${i},0,${+(o >= q)},${s},${this._x1 = e + i * Math.cos(h)},${this._y1 = t + i * Math.sin(h)}`);
232
+ let l = i * Math.cos(r), c = i * Math.sin(r), n = e + l, a = t + c, s = 1 ^ d, o = d ? r - h : h - r;
233
+ this._x1 === null ? this._append`M${n},${a}` : (Math.abs(this._x1 - n) > M || Math.abs(this._y1 - a) > M) && this._append`L${n},${a}`, i && (o < 0 && (o = o % Z + Z), o > je ? this._append`A${i},${i},0,1,${s},${e - l},${t - c}A${i},${i},0,1,${s},${this._x1 = n},${this._y1 = a}` : o > M && this._append`A${i},${i},0,${+(o >= q)},${s},${this._x1 = e + i * Math.cos(h)},${this._y1 = t + i * Math.sin(h)}`);
234
234
  }
235
235
  rect(e, t, i, r) {
236
236
  this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${i = +i}v${+r}h${-i}Z`;
@@ -251,7 +251,7 @@ function fe(u) {
251
251
  e = i;
252
252
  }
253
253
  return u;
254
- }, () => new Ge(e);
254
+ }, () => new Ee(e);
255
255
  }
256
256
  function de(u) {
257
257
  return typeof u == "object" && "length" in u ? u : Array.from(u);
@@ -295,72 +295,72 @@ function be(u) {
295
295
  return u[1];
296
296
  }
297
297
  function ke(u, e) {
298
- var t = v(!0), i = null, r = me, h = null, d = fe(n);
298
+ var t = v(!0), i = null, r = me, h = null, d = fe(l);
299
299
  u = typeof u == "function" ? u : u === void 0 ? ge : v(u), e = typeof e == "function" ? e : e === void 0 ? be : v(e);
300
- function n(c) {
301
- var l, a = (c = de(c)).length, s, o = !1, f;
302
- for (i == null && (h = r(f = d())), l = 0; l <= a; ++l)
303
- !(l < a && t(s = c[l], l, c)) === o && ((o = !o) ? h.lineStart() : h.lineEnd()), o && h.point(+u(s, l, c), +e(s, l, c));
300
+ function l(c) {
301
+ var n, a = (c = de(c)).length, s, o = !1, f;
302
+ for (i == null && (h = r(f = d())), n = 0; n <= a; ++n)
303
+ !(n < a && t(s = c[n], n, c)) === o && ((o = !o) ? h.lineStart() : h.lineEnd()), o && h.point(+u(s, n, c), +e(s, n, c));
304
304
  if (f) return h = null, f + "" || null;
305
305
  }
306
- return n.x = function(c) {
307
- return arguments.length ? (u = typeof c == "function" ? c : v(+c), n) : u;
308
- }, n.y = function(c) {
309
- return arguments.length ? (e = typeof c == "function" ? c : v(+c), n) : e;
310
- }, n.defined = function(c) {
311
- return arguments.length ? (t = typeof c == "function" ? c : v(!!c), n) : t;
312
- }, n.curve = function(c) {
313
- return arguments.length ? (r = c, i != null && (h = r(i)), n) : r;
314
- }, n.context = function(c) {
315
- return arguments.length ? (c == null ? i = h = null : h = r(i = c), n) : i;
316
- }, n;
306
+ return l.x = function(c) {
307
+ return arguments.length ? (u = typeof c == "function" ? c : v(+c), l) : u;
308
+ }, l.y = function(c) {
309
+ return arguments.length ? (e = typeof c == "function" ? c : v(+c), l) : e;
310
+ }, l.defined = function(c) {
311
+ return arguments.length ? (t = typeof c == "function" ? c : v(!!c), l) : t;
312
+ }, l.curve = function(c) {
313
+ return arguments.length ? (r = c, i != null && (h = r(i)), l) : r;
314
+ }, l.context = function(c) {
315
+ return arguments.length ? (c == null ? i = h = null : h = r(i = c), l) : i;
316
+ }, l;
317
317
  }
318
- function Ne(u, e, t) {
319
- var i = null, r = v(!0), h = null, d = me, n = null, c = fe(l);
318
+ function Ge(u, e, t) {
319
+ var i = null, r = v(!0), h = null, d = me, l = null, c = fe(n);
320
320
  u = typeof u == "function" ? u : u === void 0 ? ge : v(+u), e = typeof e == "function" ? e : v(e === void 0 ? 0 : +e), t = typeof t == "function" ? t : t === void 0 ? be : v(+t);
321
- function l(s) {
321
+ function n(s) {
322
322
  var o, f, p, m = (s = de(s)).length, b, k = !1, x, y = new Array(m), _ = new Array(m);
323
- for (h == null && (n = d(x = c())), o = 0; o <= m; ++o) {
323
+ for (h == null && (l = d(x = c())), o = 0; o <= m; ++o) {
324
324
  if (!(o < m && r(b = s[o], o, s)) === k)
325
325
  if (k = !k)
326
- f = o, n.areaStart(), n.lineStart();
326
+ f = o, l.areaStart(), l.lineStart();
327
327
  else {
328
- for (n.lineEnd(), n.lineStart(), p = o - 1; p >= f; --p)
329
- n.point(y[p], _[p]);
330
- n.lineEnd(), n.areaEnd();
328
+ for (l.lineEnd(), l.lineStart(), p = o - 1; p >= f; --p)
329
+ l.point(y[p], _[p]);
330
+ l.lineEnd(), l.areaEnd();
331
331
  }
332
- k && (y[o] = +u(b, o, s), _[o] = +e(b, o, s), n.point(i ? +i(b, o, s) : y[o], t ? +t(b, o, s) : _[o]));
332
+ k && (y[o] = +u(b, o, s), _[o] = +e(b, o, s), l.point(i ? +i(b, o, s) : y[o], t ? +t(b, o, s) : _[o]));
333
333
  }
334
- if (x) return n = null, x + "" || null;
334
+ if (x) return l = null, x + "" || null;
335
335
  }
336
336
  function a() {
337
337
  return ke().defined(r).curve(d).context(h);
338
338
  }
339
- return l.x = function(s) {
340
- return arguments.length ? (u = typeof s == "function" ? s : v(+s), i = null, l) : u;
341
- }, l.x0 = function(s) {
342
- return arguments.length ? (u = typeof s == "function" ? s : v(+s), l) : u;
343
- }, l.x1 = function(s) {
344
- return arguments.length ? (i = s == null ? null : typeof s == "function" ? s : v(+s), l) : i;
345
- }, l.y = function(s) {
346
- return arguments.length ? (e = typeof s == "function" ? s : v(+s), t = null, l) : e;
347
- }, l.y0 = function(s) {
348
- return arguments.length ? (e = typeof s == "function" ? s : v(+s), l) : e;
349
- }, l.y1 = function(s) {
350
- return arguments.length ? (t = s == null ? null : typeof s == "function" ? s : v(+s), l) : t;
351
- }, l.lineX0 = l.lineY0 = function() {
339
+ return n.x = function(s) {
340
+ return arguments.length ? (u = typeof s == "function" ? s : v(+s), i = null, n) : u;
341
+ }, n.x0 = function(s) {
342
+ return arguments.length ? (u = typeof s == "function" ? s : v(+s), n) : u;
343
+ }, n.x1 = function(s) {
344
+ return arguments.length ? (i = s == null ? null : typeof s == "function" ? s : v(+s), n) : i;
345
+ }, n.y = function(s) {
346
+ return arguments.length ? (e = typeof s == "function" ? s : v(+s), t = null, n) : e;
347
+ }, n.y0 = function(s) {
348
+ return arguments.length ? (e = typeof s == "function" ? s : v(+s), n) : e;
349
+ }, n.y1 = function(s) {
350
+ return arguments.length ? (t = s == null ? null : typeof s == "function" ? s : v(+s), n) : t;
351
+ }, n.lineX0 = n.lineY0 = function() {
352
352
  return a().x(u).y(e);
353
- }, l.lineY1 = function() {
353
+ }, n.lineY1 = function() {
354
354
  return a().x(u).y(t);
355
- }, l.lineX1 = function() {
355
+ }, n.lineX1 = function() {
356
356
  return a().x(i).y(e);
357
- }, l.defined = function(s) {
358
- return arguments.length ? (r = typeof s == "function" ? s : v(!!s), l) : r;
359
- }, l.curve = function(s) {
360
- return arguments.length ? (d = s, h != null && (n = d(h)), l) : d;
361
- }, l.context = function(s) {
362
- return arguments.length ? (s == null ? h = n = null : n = d(h = s), l) : h;
363
- }, l;
357
+ }, n.defined = function(s) {
358
+ return arguments.length ? (r = typeof s == "function" ? s : v(!!s), n) : r;
359
+ }, n.curve = function(s) {
360
+ return arguments.length ? (d = s, h != null && (l = d(h)), n) : d;
361
+ }, n.context = function(s) {
362
+ return arguments.length ? (s == null ? h = l = null : l = d(h = s), n) : h;
363
+ }, n;
364
364
  }
365
365
  class I extends ue {
366
366
  constructor() {
@@ -378,7 +378,7 @@ class I extends ue {
378
378
  enumerable: !0,
379
379
  configurable: !0,
380
380
  writable: !0,
381
- value: Ne()
381
+ value: Ge()
382
382
  }), Object.defineProperty(this, "_legendStroke", {
383
383
  enumerable: !0,
384
384
  configurable: !0,
@@ -496,34 +496,34 @@ class I extends ue {
496
496
  f.setPrivate("visible", !1);
497
497
  });
498
498
  });
499
- let i = this.startIndex(), r = this.strokes.template.get("templateField"), h = this.fills.template.get("templateField"), d = !0, n = !0;
500
- r && (d = !1), h && (n = !1);
499
+ let i = this.startIndex(), r = this.strokes.template.get("templateField"), h = this.fills.template.get("templateField"), d = !0, l = !0;
500
+ r && (d = !1), h && (l = !1);
501
501
  for (let a = i - 1; a >= 0; a--) {
502
502
  let s = this.dataItems[a], o = !0, f = s.dataContext;
503
- if (r && f[r] && (d = !0), h && f[h] && (n = !0), N(this._valueFields, (p) => {
503
+ if (r && f[r] && (d = !0), h && f[h] && (l = !0), N(this._valueFields, (p) => {
504
504
  le(s.get(p)) || (o = !1);
505
- }), o && d && n) {
505
+ }), o && d && l) {
506
506
  i = a;
507
507
  break;
508
508
  }
509
509
  }
510
- let c = this.dataItems.length, l = this.endIndex();
511
- if (l < c) {
512
- l++;
513
- for (let a = l; a < c; a++) {
510
+ let c = this.dataItems.length, n = this.endIndex();
511
+ if (n < c) {
512
+ n++;
513
+ for (let a = n; a < c; a++) {
514
514
  let s = this.dataItems[a], o = !0;
515
515
  if (N(this._valueFields, (f) => {
516
516
  le(s.get(f)) || (o = !1);
517
517
  }), o) {
518
- l = a + 1;
518
+ n = a + 1;
519
519
  break;
520
520
  }
521
521
  }
522
522
  }
523
- if (i > 0 && i--, this._endIndex = l, this._clearGraphics(), this._sindex = 0, this._dindex = i, this.dataItems.length == 1)
523
+ if (i > 0 && i--, this._endIndex = n, this._clearGraphics(), this._sindex = 0, this._dindex = i, this.dataItems.length == 1)
524
524
  this._startSegment(0);
525
525
  else
526
- for (; this._dindex < l - 1; )
526
+ for (; this._dindex < n - 1; )
527
527
  this._startSegment(this._dindex), this._sindex++;
528
528
  }
529
529
  } else
@@ -537,16 +537,16 @@ class I extends ue {
537
537
  }
538
538
  _startSegment(e) {
539
539
  let t = this._endIndex, i = t;
540
- const r = this.get("autoGapCount"), h = this.get("connect"), d = this.makeFill(this.fills), n = this._fillTemplate, c = this.fills.template;
541
- n && n != c && (d.template = n), d.setPrivate("visible", !0);
542
- const l = this.makeStroke(this.strokes), a = this._strokeTemplate;
543
- a && a != this.strokes.template && (l.template = a), l.setPrivate("visible", !0);
540
+ const r = this.get("autoGapCount"), h = this.get("connect"), d = this.makeFill(this.fills), l = this._fillTemplate, c = this.fills.template;
541
+ l && l != c && (d.template = l), d.setPrivate("visible", !0);
542
+ const n = this.makeStroke(this.strokes), a = this._strokeTemplate;
543
+ a && a != this.strokes.template && (n.template = a), n.setPrivate("visible", !0);
544
544
  let s = this.get("xAxis"), o = this.get("yAxis"), f = this.get("baseAxis"), p = this.get("vcx", 1), m = this.get("vcy", 1), b = this._xField, k = this._yField, x = this._xOpenField, y = this._yOpenField;
545
545
  const _ = this.get("openValueXField"), w = this.get("openValueYField");
546
546
  _ || (x = this._xField), w || (y = this._yField);
547
- const Y = this.get("stacked"), A = s.basePosition(), L = o.basePosition();
548
- let D;
549
- f === o ? D = this._yField : D = this._xField;
547
+ const Y = this.get("stacked"), D = s.basePosition(), L = o.basePosition();
548
+ let A;
549
+ f === o ? A = this._yField : A = this._xField;
550
550
  const O = [];
551
551
  let X = [];
552
552
  O.push(X);
@@ -562,7 +562,7 @@ class I extends ue {
562
562
  segments: O,
563
563
  stacked: Y,
564
564
  getOpen: ee,
565
- basePosX: A,
565
+ basePosX: D,
566
566
  basePosY: L,
567
567
  fillVisible: K,
568
568
  xField: b,
@@ -592,7 +592,7 @@ class I extends ue {
592
592
  i = T;
593
593
  break;
594
594
  } else
595
- E = g, l.template = g;
595
+ E = g, n.template = g;
596
596
  }
597
597
  if (Q) {
598
598
  let g = C.dataContext[Q];
@@ -605,10 +605,10 @@ class I extends ue {
605
605
  }
606
606
  if (!h) {
607
607
  let g = this.dataItems[T + 1];
608
- g && f.shouldGap(C, g, r, D) && (X = [], O.push(X), z.points = X);
608
+ g && f.shouldGap(C, g, r, A) && (X = [], O.push(X), z.points = X);
609
609
  }
610
610
  }
611
- d.setRaw("userData", [e, T]), l.setRaw("userData", [e, T]), T === t && this._endLine(X, O[0][0]), l && this._drawStroke(l, O), d && this._drawFill(d, O), this.axisRanges.each((C) => {
611
+ d.setRaw("userData", [e, T]), n.setRaw("userData", [e, T]), T === t && this._endLine(X, O[0][0]), n && this._drawStroke(n, O), d && this._drawFill(d, O), this.axisRanges.each((C) => {
612
612
  const j = C.container, H = C.fills, g = this.makeFill(H);
613
613
  j && j.children.push(g), g.setPrivate("visible", !0), this._drawFill(g, O);
614
614
  const ye = C.strokes, R = this.makeStroke(ye);
@@ -617,21 +617,21 @@ class I extends ue {
617
617
  }
618
618
  _getPoints(e, t) {
619
619
  let i = t.points, r = e.get("locationX", t.locationX), h = e.get("locationY", t.locationY);
620
- const d = this.get("exactLocationX", !1), n = this.get("exactLocationY", !1);
621
- let c = t.xAxis.getDataItemPositionX(e, t.xField, r, t.vcx, d), l = t.yAxis.getDataItemPositionY(e, t.yField, h, t.vcy, n);
620
+ const d = this.get("exactLocationX", !1), l = this.get("exactLocationY", !1);
621
+ let c = t.xAxis.getDataItemPositionX(e, t.xField, r, t.vcx, d), n = t.yAxis.getDataItemPositionY(e, t.yField, h, t.vcy, l);
622
622
  if (this._shouldInclude(c)) {
623
- const a = this.getPoint(c, l), s = [a.x, a.y];
623
+ const a = this.getPoint(c, n), s = [a.x, a.y];
624
624
  if (a.x += this._x, a.y += this._y, e.set("point", a), t.fillVisible) {
625
- let o = c, f = l;
625
+ let o = c, f = n;
626
626
  if (t.baseAxis === t.xAxis ? f = t.basePosY : t.baseAxis === t.yAxis && (o = t.basePosX), t.getOpen) {
627
627
  let m = e.get(t.xOpenField), b = e.get(t.yOpenField);
628
628
  if (m != null && b != null) {
629
629
  let k = e.get("openLocationX", t.openLocationX), x = e.get("openLocationY", t.openLocationY);
630
630
  if (t.stacked) {
631
631
  let y = e.get("stackToItemX"), _ = e.get("stackToItemY");
632
- y ? (o = t.xAxis.getDataItemPositionX(y, t.xField, k, y.component.get("vcx"), d), ne(o) && (o = t.basePosX)) : t.yAxis === t.baseAxis ? o = t.basePosX : o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), _ ? (f = t.yAxis.getDataItemPositionY(_, t.yField, x, _.component.get("vcy"), n), ne(f) && (f = t.basePosY)) : t.xAxis === t.baseAxis ? f = t.basePosY : f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, n);
632
+ y ? (o = t.xAxis.getDataItemPositionX(y, t.xField, k, y.component.get("vcx"), d), ne(o) && (o = t.basePosX)) : t.yAxis === t.baseAxis ? o = t.basePosX : o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), _ ? (f = t.yAxis.getDataItemPositionY(_, t.yField, x, _.component.get("vcy"), l), ne(f) && (f = t.basePosY)) : t.xAxis === t.baseAxis ? f = t.basePosY : f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, l);
633
633
  } else
634
- o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, n);
634
+ o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, l);
635
635
  }
636
636
  }
637
637
  let p = this.getPoint(o, f);
@@ -684,14 +684,14 @@ class I extends ue {
684
684
  themeTags: ["line", "series", "legend", "marker", "fill"]
685
685
  }, [this.fills.template]));
686
686
  this._legendFill = d;
687
- const n = this._root.interfaceColors.get("disabled");
688
- if (h.states.create("disabled", { fill: n, stroke: n }), d.states.create("disabled", { fill: n, stroke: n }), this.bullets.length > 0) {
687
+ const l = this._root.interfaceColors.get("disabled");
688
+ if (h.states.create("disabled", { fill: l, stroke: l }), d.states.create("disabled", { fill: l, stroke: l }), this.bullets.length > 0) {
689
689
  const c = this.bullets.getIndex(0);
690
690
  if (c) {
691
- const l = c(i._root, this, new Pe(this, { legend: !0 }, {}));
692
- if (l) {
693
- const a = l.get("sprite");
694
- a instanceof S && a.states.create("disabled", { fill: n, stroke: n }), a && (a.setAll({
691
+ const n = c(i._root, this, new Pe(this, { legend: !0 }, {}));
692
+ if (n) {
693
+ const a = n.get("sprite");
694
+ a instanceof S && a.states.create("disabled", { fill: l, stroke: l }), a && (a.setAll({
695
695
  tooltipText: void 0,
696
696
  tooltipHTML: void 0,
697
697
  focusable: void 0,
@@ -718,7 +718,7 @@ Object.defineProperty(I, "classNames", {
718
718
  writable: !0,
719
719
  value: ue.classNames.concat([I.className])
720
720
  });
721
- function He({
721
+ function ze({
722
722
  seriesData: u,
723
723
  height: e = "500px",
724
724
  width: t = "100%",
@@ -727,12 +727,12 @@ function He({
727
727
  loading: h = !1,
728
728
  emptyMessage: d = "No data available"
729
729
  }) {
730
- const n = ae(null), c = ae(null);
730
+ const l = ae(null), c = ae(null);
731
731
  return Me(() => {
732
- const l = Fe.new(i);
733
- c.current = l, l.setThemes([Le.new(l)]);
734
- const a = l.container.children.push(
735
- Ae.new(l, {
732
+ const n = Fe.new(i);
733
+ c.current = n, n.setThemes([Le.new(n)]);
734
+ const a = n.container.children.push(
735
+ De.new(n, {
736
736
  panX: !0,
737
737
  panY: !0,
738
738
  wheelX: "panX",
@@ -740,37 +740,36 @@ function He({
740
740
  pinchZoomX: !0
741
741
  })
742
742
  );
743
- n.current = a, a.set(
743
+ l.current = a, a.set(
744
744
  "cursor",
745
- De.new(l, {
745
+ Ae.new(n, {
746
746
  behavior: "zoomX"
747
747
  })
748
748
  ).lineY.set("visible", !1);
749
749
  const s = a.xAxes.push(
750
- Ce.new(l, {
750
+ Ce.new(n, {
751
751
  maxDeviation: 0.3,
752
752
  baseInterval: { timeUnit: "day", count: 1 },
753
- renderer: Oe.new(l, {
753
+ renderer: Oe.new(n, {
754
754
  minorGridEnabled: !0
755
755
  })
756
756
  })
757
757
  ), o = a.yAxes.push(
758
- Xe.new(l, {
759
- renderer: $e.new(l, {})
758
+ Xe.new(n, {
759
+ renderer: $e.new(n, {})
760
760
  })
761
- ), f = [], p = Ye.new(l, {});
761
+ ), f = [], p = Ye.new(n, {});
762
762
  u.forEach((w, Y) => {
763
- const A = w.color ? he(w.color) : p.getIndex(Y), L = a.series.push(
764
- I.new(l, {
763
+ const D = w.color ? he(w.color) : p.getIndex(Y), L = a.series.push(
764
+ I.new(n, {
765
765
  name: w.name,
766
766
  xAxis: s,
767
767
  yAxis: o,
768
768
  valueYField: "value",
769
769
  valueXField: "date",
770
- categoryXField: "date",
771
- stroke: A,
772
- fill: A,
773
- tooltip: Se.new(l, {
770
+ stroke: D,
771
+ fill: D,
772
+ tooltip: Se.new(n, {
774
773
  labelText: "{name}: {valueY}"
775
774
  })
776
775
  })
@@ -781,37 +780,30 @@ function He({
781
780
  });
782
781
  let m = null;
783
782
  r && (m = a.children.push(
784
- V.new(l, {
783
+ V.new(n, {
785
784
  centerX: re(50),
786
785
  x: re(50),
787
- layout: l.horizontalLayout
786
+ layout: n.horizontalLayout
788
787
  })
789
788
  ), m.data.setAll(a.series.values));
790
789
  const b = 1, k = 0.2, x = 4, y = (w) => {
791
790
  var L;
792
- const A = (L = w.target.dataItem) == null ? void 0 : L.dataContext;
793
- A && (A.strokes.template.set("strokeOpacity", 1), A.strokes.template.set("strokeWidth", x), f.forEach((D) => {
794
- D !== A && (D.strokes.template.set("strokeOpacity", k), D.strokes.template.set("strokeWidth", 1));
791
+ const D = (L = w.target.dataItem) == null ? void 0 : L.dataContext;
792
+ D && (D.strokes.template.set("strokeOpacity", 1), D.strokes.template.set("strokeWidth", x), f.forEach((A) => {
793
+ A !== D && (A.strokes.template.set("strokeOpacity", k), A.strokes.template.set("strokeWidth", 1));
795
794
  }));
796
795
  }, _ = (w) => {
797
796
  var L;
798
- ((L = w.target.dataItem) == null ? void 0 : L.dataContext) && f.forEach((D) => {
799
- D.strokes.template.set("strokeOpacity", b), D.strokes.template.set("strokeWidth", 2);
797
+ ((L = w.target.dataItem) == null ? void 0 : L.dataContext) && f.forEach((A) => {
798
+ A.strokes.template.set("strokeOpacity", b), A.strokes.template.set("strokeWidth", 2);
800
799
  });
801
800
  };
802
801
  return m && (m.markers.template.events.on("pointerover", y), m.markers.template.events.on("pointerout", _)), a.appear(1e3, 100), f.forEach((w, Y) => {
803
802
  w.appear(1e3, 100 * (Y + 1));
804
803
  }), () => {
805
- l.dispose();
804
+ n.dispose();
806
805
  };
807
- }, []), je(() => {
808
- n.current && c.current && (n.current.series.clear(), u.forEach((l, a) => {
809
- const s = n.current.series.getIndex(
810
- a
811
- );
812
- s && s.data.setAll(l.data);
813
- }));
814
- }, [u]), /* @__PURE__ */ we("div", { style: { position: "relative", width: t, height: e }, children: [
806
+ }, [i, u, r]), /* @__PURE__ */ we("div", { style: { position: "relative", width: t, height: e }, children: [
815
807
  /* @__PURE__ */ W("div", { id: i, style: { width: "100%", height: "100%" } }),
816
808
  h && /* @__PURE__ */ W(
817
809
  "div",
@@ -847,5 +839,5 @@ function He({
847
839
  ] });
848
840
  }
849
841
  export {
850
- He as HighlightLineChart
842
+ ze as HighlightLineChart
851
843
  };
@@ -0,0 +1,170 @@
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { TrendingUp as w, TrendingDown as v, Remove as S } from "@mui/icons-material";
3
+ import { useTheme as C, Card as z, Box as o, Stack as m, Typography as c, alpha as t } from "@mui/material";
4
+ const V = ({
5
+ label: g,
6
+ value: h,
7
+ change: d,
8
+ changeType: u = "percentage",
9
+ trend: l,
10
+ icon: n,
11
+ iconPosition: s = "right",
12
+ description: p,
13
+ variant: b = "default",
14
+ className: x
15
+ }) => {
16
+ const e = C(), f = () => l === "up" ? /* @__PURE__ */ r(w, { sx: { fontSize: 16 } }) : l === "down" ? /* @__PURE__ */ r(v, { sx: { fontSize: 16 } }) : /* @__PURE__ */ r(S, { sx: { fontSize: 16 } }), y = () => l === "up" ? {
17
+ color: e.palette.success.main,
18
+ bgcolor: t(e.palette.success.main, 0.1)
19
+ } : l === "down" ? {
20
+ color: e.palette.error.main,
21
+ bgcolor: t(e.palette.error.main, 0.1)
22
+ } : {
23
+ color: e.palette.text.secondary,
24
+ bgcolor: e.palette.action.hover
25
+ };
26
+ return /* @__PURE__ */ i(
27
+ z,
28
+ {
29
+ sx: { ...(() => {
30
+ const a = {
31
+ p: 3,
32
+ borderRadius: 2,
33
+ boxShadow: 1,
34
+ transition: "all 0.3s",
35
+ "&:hover": { boxShadow: 3 },
36
+ border: 1
37
+ };
38
+ switch (b) {
39
+ case "primary":
40
+ return {
41
+ ...a,
42
+ bgcolor: t(e.palette.primary.main, 0.05),
43
+ borderColor: t(e.palette.primary.main, 0.2)
44
+ };
45
+ case "success":
46
+ return {
47
+ ...a,
48
+ bgcolor: t(e.palette.success.main, 0.05),
49
+ borderColor: t(e.palette.success.main, 0.2)
50
+ };
51
+ case "warning":
52
+ return {
53
+ ...a,
54
+ bgcolor: t(e.palette.warning.main, 0.05),
55
+ borderColor: t(e.palette.warning.main, 0.2)
56
+ };
57
+ case "danger":
58
+ return {
59
+ ...a,
60
+ bgcolor: t(e.palette.error.main, 0.05),
61
+ borderColor: t(e.palette.error.main, 0.2)
62
+ };
63
+ default:
64
+ return {
65
+ ...a,
66
+ bgcolor: "background.paper",
67
+ borderColor: "divider"
68
+ };
69
+ }
70
+ })(), position: "relative", overflow: "hidden" },
71
+ className: x,
72
+ children: [
73
+ n && s === "watermark" && /* @__PURE__ */ r(
74
+ o,
75
+ {
76
+ sx: {
77
+ position: "absolute",
78
+ right: -20,
79
+ bottom: -20,
80
+ opacity: 0.05,
81
+ transform: "rotate(-15deg)",
82
+ pointerEvents: "none"
83
+ },
84
+ children: /* @__PURE__ */ r(n, { sx: { fontSize: 120, color: "text.primary" } })
85
+ }
86
+ ),
87
+ /* @__PURE__ */ i(
88
+ m,
89
+ {
90
+ direction: "row",
91
+ justifyContent: "space-between",
92
+ alignItems: "flex-start",
93
+ children: [
94
+ n && s === "left" && /* @__PURE__ */ r(o, { mr: 2, children: /* @__PURE__ */ r(
95
+ o,
96
+ {
97
+ sx: {
98
+ width: 48,
99
+ height: 48,
100
+ borderRadius: "50%",
101
+ bgcolor: "action.hover",
102
+ display: "flex",
103
+ alignItems: "center",
104
+ justifyContent: "center"
105
+ },
106
+ children: /* @__PURE__ */ r(n, { sx: { fontSize: 24, color: "text.secondary" } })
107
+ }
108
+ ) }),
109
+ /* @__PURE__ */ i(o, { flex: 1, children: [
110
+ /* @__PURE__ */ r(c, { variant: "subtitle2", color: "text.secondary", mb: 0.5, children: g }),
111
+ /* @__PURE__ */ r(
112
+ c,
113
+ {
114
+ variant: "h4",
115
+ fontWeight: "bold",
116
+ color: "text.primary",
117
+ mb: 1,
118
+ children: h
119
+ }
120
+ ),
121
+ d !== void 0 && /* @__PURE__ */ i(m, { direction: "row", alignItems: "center", spacing: 1, children: [
122
+ /* @__PURE__ */ i(
123
+ o,
124
+ {
125
+ sx: {
126
+ display: "inline-flex",
127
+ alignItems: "center",
128
+ gap: 0.5,
129
+ px: 1,
130
+ py: 0.5,
131
+ borderRadius: 10,
132
+ typography: "caption",
133
+ fontWeight: "medium",
134
+ ...y()
135
+ },
136
+ children: [
137
+ f(),
138
+ d,
139
+ u === "percentage" ? "%" : ""
140
+ ]
141
+ }
142
+ ),
143
+ p && /* @__PURE__ */ r(c, { variant: "caption", color: "text.secondary", children: p })
144
+ ] })
145
+ ] }),
146
+ n && s === "right" && /* @__PURE__ */ r(o, { ml: 2, children: /* @__PURE__ */ r(
147
+ o,
148
+ {
149
+ sx: {
150
+ width: 48,
151
+ height: 48,
152
+ borderRadius: "50%",
153
+ bgcolor: "action.hover",
154
+ display: "flex",
155
+ alignItems: "center",
156
+ justifyContent: "center"
157
+ },
158
+ children: /* @__PURE__ */ r(n, { sx: { fontSize: 24, color: "text.secondary" } })
159
+ }
160
+ ) })
161
+ ]
162
+ }
163
+ )
164
+ ]
165
+ }
166
+ );
167
+ };
168
+ export {
169
+ V as MetricCard
170
+ };
package/dist/main.d.ts CHANGED
@@ -663,6 +663,32 @@ export declare namespace Map_2 {
663
663
  }
664
664
  }
665
665
 
666
+ export declare const MetricCard: ({ label, value, change, changeType, trend, icon: Icon, iconPosition, description, variant, className, }: MetricCardProps) => JSX_2.Element;
667
+
668
+ export declare interface MetricCardProps {
669
+ label: string;
670
+ value: string | number;
671
+ change?: number;
672
+ changeType?: MetricChangeType;
673
+ trend?: MetricTrend;
674
+ icon?: React.ElementType;
675
+ iconPosition?: "left" | "right" | "watermark";
676
+ description?: string;
677
+ variant?: MetricVariant;
678
+ className?: string;
679
+ }
680
+
681
+ export declare type MetricChangeType = "percentage" | "absolute";
682
+
683
+ export declare type MetricTrend = "up" | "down" | "neutral";
684
+
685
+ export declare type MetricVariant =
686
+ | "default"
687
+ | "primary"
688
+ | "success"
689
+ | "warning"
690
+ | "danger";
691
+
666
692
  declare type MousePosition = {
667
693
  top: number;
668
694
  left: number;
package/dist/main.js CHANGED
@@ -26,17 +26,18 @@ import { S as Oe } from "./utils-Bq0ye5vf.js";
26
26
  import { LinearIndicator as Se } from "./components/linear-indicator/index.js";
27
27
  import { Loading as He } from "./components/loading/index.js";
28
28
  import { i as Be } from "./index-JrtqxUdI.js";
29
- import { PaginatedList as Ie } from "./components/paginated-list/index.js";
30
- import { PhoneInput as je } from "./components/phone-input/index.js";
31
- import { SearchInput as We } from "./components/search-input/index.js";
32
- import { Tabs as Ue } from "./components/tabs/index.js";
33
- import { TemplateFilters as Ze } from "./components/template-filters/index.js";
34
- import { TemplateForm as Je } from "./components/template-form/index.js";
35
- import { TemplatePropertyFilters as _e } from "./components/template-property-filters/index.js";
36
- import { Property as Ge } from "./components/template-property-filters/property.js";
37
- import { TreeSelect as Qe } from "./components/tree-select/index.js";
38
- import { TreeViewFilter as Xe } from "./components/treeview-filter/index.js";
39
- import { Uploader as er } from "./components/uploader/index.js";
29
+ import { MetricCard as Ie } from "./components/metric-card/index.js";
30
+ import { PaginatedList as je } from "./components/paginated-list/index.js";
31
+ import { PhoneInput as We } from "./components/phone-input/index.js";
32
+ import { SearchInput as Ue } from "./components/search-input/index.js";
33
+ import { Tabs as Ze } from "./components/tabs/index.js";
34
+ import { TemplateFilters as Je } from "./components/template-filters/index.js";
35
+ import { TemplateForm as _e } from "./components/template-form/index.js";
36
+ import { TemplatePropertyFilters as Ge } from "./components/template-property-filters/index.js";
37
+ import { Property as Qe } from "./components/template-property-filters/property.js";
38
+ import { TreeSelect as Xe } from "./components/tree-select/index.js";
39
+ import { TreeViewFilter as er } from "./components/treeview-filter/index.js";
40
+ import { Uploader as sr } from "./components/uploader/index.js";
40
41
  import { a as dt } from "./objectWithoutPropertiesLoose-DJteAcBH.js";
41
42
  import C from "dayjs";
42
43
  import { h as U, j as z } from "./createTheme-DrgvKMA_.js";
@@ -418,19 +419,20 @@ export {
418
419
  He as Loading,
419
420
  Ct as LocalizationProvider,
420
421
  Be as Map,
421
- Ie as PaginatedList,
422
- je as PhoneInput,
423
- Ge as PropertyFilterInput,
424
- We as SearchInput,
422
+ Ie as MetricCard,
423
+ je as PaginatedList,
424
+ We as PhoneInput,
425
+ Qe as PropertyFilterInput,
426
+ Ue as SearchInput,
425
427
  ie as SecurityLevel,
426
- Ue as Tabs,
427
- Ze as TemplateFilters,
428
- Je as TemplateForm,
429
- _e as TemplatePropertyFilters,
428
+ Ze as Tabs,
429
+ Je as TemplateFilters,
430
+ _e as TemplateForm,
431
+ Ge as TemplatePropertyFilters,
430
432
  Ht as ThemeProvider,
431
- Qe as TreeSelect,
432
- Xe as TreeViewFilter,
433
- er as Uploader,
433
+ Xe as TreeSelect,
434
+ er as TreeViewFilter,
435
+ sr as Uploader,
434
436
  Rt as alert,
435
437
  Xt as confirm,
436
438
  Ft as createTheme
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.73",
4
+ "version": "1.5.77",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",