@carbon/charts-vue 1.12.0 → 1.13.0

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
@@ -10233,13 +10233,21 @@ class Ue {
10233
10233
  }
10234
10234
  exportToCSV() {
10235
10235
  const t = this.getTabularDataArray().map(
10236
- (i) => i.map((s) => `"${s === "–" ? "–" : s}"`)
10236
+ (o) => o.map((l) => `"${l === "–" ? "–" : l}"`)
10237
10237
  );
10238
10238
  let n = "", r = "";
10239
- t.forEach(function(i, s) {
10240
- r = i.join(","), n += s < t.length ? r + `
10239
+ t.forEach(function(o, l) {
10240
+ r = o.join(","), n += l < t.length ? r + `
10241
10241
  ` : r;
10242
- }), this.services.files.downloadCSV(n, "myChart.csv");
10242
+ });
10243
+ const i = this.getOptions();
10244
+ let s = "myChart";
10245
+ const a = b(
10246
+ i,
10247
+ "fileDownload",
10248
+ "fileName"
10249
+ );
10250
+ typeof a == "function" ? s = a("csv") : typeof a == "string" && (s = a), this.services.files.downloadCSV(n, `${s}.csv`);
10243
10251
  }
10244
10252
  getTabularData(t) {
10245
10253
  return Array.isArray(t) ? t : this.transformToTabularData(t);
@@ -11625,27 +11633,39 @@ class L extends on {
11625
11633
  return this.model.get("holder");
11626
11634
  }
11627
11635
  exportToJPG() {
11628
- const t = this, n = this.getHolder(), r = D(n);
11629
- r.classed("filled", !0), _L(this.getMainContainer(), {
11636
+ const t = this, n = this.model.getOptions(), r = this.getHolder(), i = D(r);
11637
+ i.classed("filled", !0), _L(this.getMainContainer(), {
11630
11638
  quality: 1,
11631
11639
  // Remove toolbar
11632
- filter: (i) => !(i.classList && i.classList.contains("cds--cc--toolbar"))
11633
- }).then(function(i) {
11634
- var s;
11635
- (s = t.services.files) == null || s.downloadImage(i, "myChart.jpg"), r.classed("filled", !1);
11640
+ filter: (s) => !(s.classList && s.classList.contains("cds--cc--toolbar"))
11641
+ }).then(function(s) {
11642
+ var a;
11643
+ let o = "myChart";
11644
+ const l = b(
11645
+ n,
11646
+ "fileDownload",
11647
+ "fileName"
11648
+ );
11649
+ typeof l == "function" ? o = l("jpg") : typeof l == "string" && (o = l), (a = t.services.files) == null || a.downloadImage(s, `${o}.jpg`), i.classed("filled", !1);
11636
11650
  });
11637
11651
  }
11638
11652
  exportToPNG() {
11639
- const t = this, n = this.getHolder(), r = D(n);
11640
- r.classed("filled", !0), wL(this.getMainContainer(), {
11653
+ const t = this, n = this.model.getOptions(), r = this.getHolder(), i = D(r);
11654
+ i.classed("filled", !0), wL(this.getMainContainer(), {
11641
11655
  quality: 1,
11642
11656
  // Remove toolbar
11643
- filter: (i) => !(i.classList && i.classList.contains("cds--cc--toolbar"))
11644
- }).then(function(i) {
11645
- var s;
11646
- (s = t.services.files) == null || s.downloadImage(i, "myChart.png"), r.classed("filled", !1);
11647
- }).catch(function(i) {
11648
- console.error("oops, something went wrong!", i);
11657
+ filter: (s) => !(s.classList && s.classList.contains("cds--cc--toolbar"))
11658
+ }).then(function(s) {
11659
+ var a;
11660
+ let o = "myChart";
11661
+ const l = b(
11662
+ n,
11663
+ "fileDownload",
11664
+ "fileName"
11665
+ );
11666
+ typeof l == "function" ? o = l("png") : typeof l == "string" && (o = l), (a = t.services.files) == null || a.downloadImage(s, `${o}.png`), i.classed("filled", !1);
11667
+ }).catch(function(s) {
11668
+ console.error("oops, something went wrong!", s);
11649
11669
  });
11650
11670
  }
11651
11671
  toggleFullscreen() {