@carbon/charts-vue 1.15.1 → 1.15.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.15.2 (2024-03-08)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **tabular-rep:** better handling of null values
11
+ ([#1779](https://github.com/carbon-design-system/carbon-charts/issues/1779))
12
+ ([011f3b4](https://github.com/carbon-design-system/carbon-charts/commit/011f3b424c97cb22434bcb1f88d75acf6e272b9d))
13
+
14
+ # Change Log
15
+
16
+ All notable changes to this project will be documented in this file. See
17
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
18
+
6
19
  ## 1.15.1 (2024-03-06)
7
20
 
8
21
  **Note:** Version bump only for package @carbon/charts-vue
package/dist/index.mjs CHANGED
@@ -10556,7 +10556,7 @@ let tn = class {
10556
10556
  ...t.map((a) => [
10557
10557
  a.source,
10558
10558
  a.target,
10559
- n(a.value, r)
10559
+ a.value === null ? "–" : n(a.value, r)
10560
10560
  ])
10561
10561
  ];
10562
10562
  return super.formatTable({ headers: i, cells: s });
@@ -10687,7 +10687,7 @@ let tn = class {
10687
10687
  ...t.map((a) => [
10688
10688
  a.id === null ? "–" : a.id,
10689
10689
  a.name,
10690
- n(a.value, r)
10690
+ a.value === null ? "–" : n(a.value, r)
10691
10691
  ])
10692
10692
  ];
10693
10693
  return super.formatTable({ headers: i, cells: s });
@@ -10956,7 +10956,7 @@ let tn = class {
10956
10956
  ...t.map((l) => [
10957
10957
  l[n.identifier] === null ? "–" : l[n.identifier],
10958
10958
  l[r.identifier] === null ? "–" : l[r.identifier],
10959
- i(l.value, s)
10959
+ l.value === null ? "–" : i(l.value, s)
10960
10960
  ])
10961
10961
  ];
10962
10962
  return super.formatTable({ headers: a, cells: o });
@@ -11037,17 +11037,19 @@ let tn = class {
11037
11037
  l = ["Group", "Value", ...i ? ["Status"] : []], c = [
11038
11038
  [
11039
11039
  d[r],
11040
- a(d.value, o),
11040
+ d.value === null ? "–" : a(d.value, o),
11041
11041
  ...i ? [i] : []
11042
11042
  ]
11043
11043
  ];
11044
11044
  } else
11045
11045
  u = x(s, "total") || this.getMaximumDomain(t), l = ["Group", "Value", "Percentage of total"], c = [
11046
11046
  ...t.map((h) => {
11047
- const f = h.value, p = Number((h.value / u * 100).toFixed(2));
11047
+ let f;
11048
+ h.value !== null && h.value !== void 0 ? f = Number(h.value) : f = 0;
11049
+ let p = Number((h.value / u * 100).toFixed(2));
11048
11050
  return [
11049
11051
  h[r],
11050
- a(f, o),
11052
+ h.value === null ? "–" : a(f, o),
11051
11053
  a(p, o) + " %"
11052
11054
  ];
11053
11055
  })
@@ -11097,7 +11099,11 @@ let tn = class {
11097
11099
  const t = this.getDisplayData(), { number: n, code: r } = x(this.getOptions(), "locale"), i = ["Child", "Group", "Value"], s = [];
11098
11100
  return t.forEach((a) => {
11099
11101
  Array.isArray(a.children) ? a.children.forEach((o) => {
11100
- s.push([o.name, a.name, n(o.value, r)]);
11102
+ s.push([
11103
+ o.name,
11104
+ a.name,
11105
+ o.value === null ? "–" : n(o.value, r)
11106
+ ]);
11101
11107
  }) : x(a.name) !== null && x(a.value) && s.push(["–", a.name, n(a.value, r)]);
11102
11108
  }), super.formatTable({ headers: i, cells: s });
11103
11109
  }
@@ -18565,7 +18571,7 @@ class jN extends ds {
18565
18571
  */
18566
18572
  appendPercentage() {
18567
18573
  const t = x(this.model.getDisplayData(), 0, "value"), { code: n, number: r } = x(this.getOptions(), "locale"), i = this.getComponentContainer(), s = I.appendOrSelect(i, "text.meter-title"), a = x(this.getOptions(), "meter", "statusBar", "percentageIndicator", "enabled") === !0 ? [t] : [], o = i.selectAll("text.percent-value").data(a), l = Zt.statusBar.paddingRight;
18568
- o.enter().append("text").classed("percent-value", !0).merge(o).text((c) => `${r(c, n)}%`).attr("x", +s.attr("x") + s.node().getComputedTextLength() + l).attr("y", s.attr("y")), o.exit().remove();
18574
+ o.enter().append("text").classed("percent-value", !0).merge(o).text((c) => `${c != null ? r(c, n) : 0}%`).attr("x", +s.attr("x") + s.node().getComputedTextLength() + l).attr("y", s.attr("y")), o.exit().remove();
18569
18575
  }
18570
18576
  /**
18571
18577
  * Uses the parent class truncate logic