@websy/websy-designs 1.1.4 → 1.1.5

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.
@@ -1870,7 +1870,14 @@ class WebsyPDFButton {
1870
1870
  <a href='${URL.createObjectURL(blob)}' target='_blank'
1871
1871
  `
1872
1872
  if (this.options.directDownload === true) {
1873
- msg += `download='${this.options.fileName || 'Export'}.pdf'`
1873
+ let fileName
1874
+ if (typeof this.options.fileName === 'function') {
1875
+ fileName = this.options.fileName() || 'Export'
1876
+ }
1877
+ else {
1878
+ fileName = this.options.fileName || 'Export'
1879
+ }
1880
+ msg += `download='${fileName}.pdf'`
1874
1881
  }
1875
1882
  msg += `
1876
1883
  >
@@ -2142,7 +2142,15 @@ var WebsyPDFButton = /*#__PURE__*/function () {
2142
2142
  var msg = "\n <div class='text-center websy-pdf-download'>\n <div>Your file is ready to download</div>\n <a href='".concat(URL.createObjectURL(blob), "' target='_blank'\n ");
2143
2143
 
2144
2144
  if (_this16.options.directDownload === true) {
2145
- msg += "download='".concat(_this16.options.fileName || 'Export', ".pdf'");
2145
+ var fileName;
2146
+
2147
+ if (typeof _this16.options.fileName === 'function') {
2148
+ fileName = _this16.options.fileName() || 'Export';
2149
+ } else {
2150
+ fileName = _this16.options.fileName || 'Export';
2151
+ }
2152
+
2153
+ msg += "download='".concat(fileName, ".pdf'");
2146
2154
  }
2147
2155
 
2148
2156
  msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this16.options.buttonText, "</button>\n </a>\n </div>\n ");