@carbon/charts-vue 1.6.14 → 1.7.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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.7.0](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.14...v1.7.0) (2023-04-19)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.6.14](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.13...v1.6.14) (2023-03-07)
7
15
 
8
16
  **Note:** Version bump only for package @carbon/charts-vue
@@ -12654,7 +12654,13 @@ var model_ChartModel = /** @class */ (function () {
12654
12654
  csvData = d.join(',');
12655
12655
  csvString += i < data.length ? csvData + '\n' : csvData;
12656
12656
  });
12657
- this.services.files.downloadCSV(csvString, 'myChart.csv');
12657
+ var options = this.getOptions();
12658
+ var fileName = 'myChart';
12659
+ var customFilename = getProperty(options, 'fileDownload', 'fileName');
12660
+ if (typeof customFilename === 'function') {
12661
+ fileName = customFilename('csv');
12662
+ }
12663
+ this.services.files.downloadCSV(csvString, fileName + ".csv");
12658
12664
  };
12659
12665
  ChartModel.prototype.getTabularData = function (data) {
12660
12666
  // if data is not an array
@@ -14083,6 +14089,7 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
14083
14089
  };
14084
14090
  DOMUtils.prototype.exportToJPG = function () {
14085
14091
  var self = this;
14092
+ var options = this.model.getOptions();
14086
14093
  var holder = this.getHolder();
14087
14094
  var holderSelection = src_select(holder);
14088
14095
  holderSelection.classed('filled', true);
@@ -14104,12 +14111,18 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
14104
14111
  },
14105
14112
  })
14106
14113
  .then(function (dataUrl) {
14107
- self.services.files.downloadImage(dataUrl, 'myChart.jpg');
14114
+ var fileName = 'myChart';
14115
+ var customFilename = getProperty(options, 'fileDownload', 'fileName');
14116
+ if (typeof customFilename === 'function') {
14117
+ fileName = customFilename('jpg');
14118
+ }
14119
+ self.services.files.downloadImage(dataUrl, fileName + ".jpg");
14108
14120
  holderSelection.classed('filled', false);
14109
14121
  });
14110
14122
  };
14111
14123
  DOMUtils.prototype.exportToPNG = function () {
14112
14124
  var self = this;
14125
+ var options = this.model.getOptions();
14113
14126
  var holder = this.getHolder();
14114
14127
  var holderSelection = src_select(holder);
14115
14128
  holderSelection.classed('filled', true);
@@ -14131,7 +14144,12 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
14131
14144
  },
14132
14145
  })
14133
14146
  .then(function (dataUrl) {
14134
- self.services.files.downloadImage(dataUrl, 'myChart.png');
14147
+ var fileName = 'myChart';
14148
+ var customFilename = getProperty(options, 'fileDownload', 'fileName');
14149
+ if (typeof customFilename === 'function') {
14150
+ fileName = customFilename('png');
14151
+ }
14152
+ self.services.files.downloadImage(dataUrl, fileName + ".png");
14135
14153
  holderSelection.classed('filled', false);
14136
14154
  })
14137
14155
  .catch(function (error) {