@carbon/charts-react 1.14.1 → 1.14.3

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.
package/dist/index.mjs CHANGED
@@ -8460,7 +8460,7 @@ const ge = "cds", _n = {
8460
8460
  threshold: 16,
8461
8461
  numCharacter: 14
8462
8462
  }, P$ = {
8463
- code: (navigator == null ? void 0 : navigator.language) || "en-US",
8463
+ code: typeof navigator < "u" && (navigator == null ? void 0 : navigator.language) || "en-US",
8464
8464
  // read from browser's navigator.language
8465
8465
  number: (e, t = (navigator == null ? void 0 : navigator.language) || "en-US") => e.toLocaleString(t),
8466
8466
  // based on code property if specified
@@ -13503,7 +13503,7 @@ const ca = (e) => eh.sanitize(e, {
13503
13503
  const s = n.selectAll("div.toolbar-control").data(r, (l) => l.id);
13504
13504
  s.exit().remove();
13505
13505
  const a = s.enter().append("div").attr("class", "toolbar-control cds--overflow-menu cds--overflow-menu"), o = this;
13506
- a.merge(s).classed("disabled", (l) => l.shouldBeDisabled()).attr("aria-disabled", (l) => l.shouldBeDisabled()).attr("aria-label", (l) => l.title).html((l) => `
13506
+ a.merge(s).classed("disabled", (l) => l.shouldBeDisabled()).attr("role", "button").attr("aria-disabled", (l) => l.shouldBeDisabled()).attr("aria-label", (l) => l.title).html((l) => `
13507
13507
  <button
13508
13508
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
13509
13509
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(
@@ -18500,22 +18500,20 @@ class rP extends Ns {
18500
18500
  }
18501
18501
  // show the total for prop meter
18502
18502
  displayTotal() {
18503
- const t = this.getComponentContainer(), n = this.getOptions(), r = b(n, "meter", "proportional", "total"), i = r ? b(n, "meter", "proportional", "total") : this.model.getMaximumDomain(this.model.getDisplayData()), s = b(n, "meter", "proportional", "unit") ? b(n, "meter", "proportional", "unit") : "", a = b(n, "meter", "proportional", "totalFormatter"), { code: o, number: l } = b(n, "locale"), c = a !== null ? a(i) : `${l(r, o)} ${s} total`, u = N.getHTMLElementSize(this.services.domUtils.getMainContainer()), d = u.width ? u.width : this.parent.node().getAttribute("width"), h = t.selectAll("text.proportional-meter-total").data([c]);
18504
- h.enter().append("text").classed("proportional-meter-total", !0).merge(h).attr(
18503
+ const t = this.getComponentContainer(), n = this.getOptions(), r = b(n, "meter", "proportional", "total"), i = r ? b(n, "meter", "proportional", "total") : this.model.getMaximumDomain(this.model.getDisplayData()), s = b(n, "meter", "proportional", "unit") ? b(n, "meter", "proportional", "unit") : "", a = b(n, "meter", "proportional", "totalFormatter"), { code: o, number: l } = b(n, "locale"), c = a !== null ? a(i) : `${l(r, o)} ${s} total`, u = N.getHTMLElementSize(this.parent.node()).width, d = t.selectAll("text.proportional-meter-total").data([c]);
18504
+ d.enter().append("text").classed("proportional-meter-total", !0).merge(d).attr(
18505
18505
  "x",
18506
- this.model.getStatus() && typeof d != "string" ? d - ne.total.paddingRight : d
18507
- ).attr("y", "1em").attr("text-anchor", "end").text((f) => f), h.exit().remove();
18506
+ this.model.getStatus() && typeof u != "string" ? u - ne.total.paddingRight : u
18507
+ ).attr("y", "1em").attr("text-anchor", "end").text((h) => h), d.exit().remove();
18508
18508
  }
18509
18509
  /**
18510
18510
  * Appends the corresponding status based on the value and the peak.
18511
18511
  */
18512
18512
  displayStatus() {
18513
- const t = this, n = this.getComponentContainer(), r = N.getHTMLElementSize(
18514
- this.services.domUtils.getMainContainer()
18515
- ), i = r.width ? r.width : 0, s = this.model.getStatus(), a = ne.status.indicatorSize / 2, o = N.appendOrSelect(n, "g.status-indicator").attr("class", s !== null ? `status-indicator status--${s}` : "").attr("transform", `translate(${i - a}, 0)`), l = s ? [s] : [], c = o.selectAll("circle.status").data(l);
18516
- c.enter().append("circle").merge(c).attr("class", "status").attr("r", a).attr("cx", 0).attr("cy", 8);
18517
- const u = o.selectAll("path.innerFill").data(l);
18518
- u.enter().append("path").merge(u).attr("d", t.getStatusIconPathString(s)).attr("transform", `translate(-${a}, 0)`).attr("class", "innerFill"), u.exit().remove(), c.exit().remove();
18513
+ const t = this, n = this.getComponentContainer(), r = N.getHTMLElementSize(this.parent.node()).width || 0, i = this.model.getStatus(), s = ne.status.indicatorSize / 2, a = N.appendOrSelect(n, "g.status-indicator").attr("class", i !== null ? `status-indicator status--${i}` : "").attr("transform", `translate(${r - s}, 0)`), o = i ? [i] : [], l = a.selectAll("circle.status").data(o);
18514
+ l.enter().append("circle").merge(l).attr("class", "status").attr("r", s).attr("cx", 0).attr("cy", 8);
18515
+ const c = a.selectAll("path.innerFill").data(o);
18516
+ c.enter().append("path").merge(c).attr("d", t.getStatusIconPathString(i)).attr("transform", `translate(-${s}, 0)`).attr("class", "innerFill"), c.exit().remove(), l.exit().remove();
18519
18517
  }
18520
18518
  /**
18521
18519
  * Appends the associated percentage to the end of the title
@@ -18540,15 +18538,15 @@ class rP extends Ns {
18540
18538
  }
18541
18539
  // computes the maximum space a title can take
18542
18540
  getMaxTitleWidth() {
18543
- const t = N.getHTMLElementSize(this.services.domUtils.getMainContainer()), n = b(this.getOptions(), "meter", "proportional"), r = t.width ? t.width : this.parent.node().getBoundingClientRect().width;
18544
- if (n !== null) {
18545
- const i = N.appendOrSelect(this.parent, "text.proportional-meter-total").node(), s = N.getSVGElementSize(i, {
18541
+ const t = b(this.getOptions(), "meter", "proportional"), n = N.getHTMLElementSize(this.parent.node()).width;
18542
+ if (t !== null) {
18543
+ const r = N.appendOrSelect(this.parent, "text.proportional-meter-total").node(), i = N.getSVGElementSize(r, {
18546
18544
  useBBox: !0
18547
18545
  }).width;
18548
- return r - s - ne.total.paddingLeft;
18546
+ return n - i - ne.total.paddingLeft;
18549
18547
  } else {
18550
- const i = N.appendOrSelect(this.parent, "text.percent-value"), s = ne.statusBar.paddingRight, a = i.node().getComputedTextLength(), o = N.appendOrSelect(this.parent, "g.status-indicator").node(), l = N.getSVGElementSize(o, { useBBox: !0 }).width + ne.status.paddingLeft;
18551
- return r - a - s - l;
18548
+ const r = N.appendOrSelect(this.parent, "text.percent-value"), i = ne.statusBar.paddingRight, s = r.node().getComputedTextLength(), a = N.appendOrSelect(this.parent, "g.status-indicator").node(), o = N.getSVGElementSize(a, { useBBox: !0 }).width + ne.status.paddingLeft;
18549
+ return n - s - i - o;
18552
18550
  }
18553
18551
  }
18554
18552
  /**