@churchillliving/se-ui-toolkit 6.53.253 → 6.53.254

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.
@@ -604,7 +604,7 @@
604
604
  }
605
605
  RequestService.prototype.download = function (endpoint, data, baseUrl) {
606
606
  if (baseUrl === void 0) { baseUrl = this.env.baseUrl; }
607
- return this.http.post("" + baseUrl + endpoint, data, { responseType: 'blob' });
607
+ return this.http.post("" + baseUrl + endpoint, data, { responseType: 'blob', observe: 'response' });
608
608
  };
609
609
  RequestService.prototype.get = function (endpoint, data, baseUrl) {
610
610
  if (baseUrl === void 0) { baseUrl = this.env.baseUrl; }
@@ -2054,6 +2054,12 @@
2054
2054
  }
2055
2055
  });
2056
2056
  }
2057
+ // returns the response header fileName
2058
+ function getResponseHeaderFileName(response) {
2059
+ var _a, _b, _c;
2060
+ var header = response.headers.get('Content-Disposition');
2061
+ return (_c = (_b = (_a = header.split('filename=')) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.split(";")[0]) === null || _c === void 0 ? void 0 : _c.replaceAll(/\"/g, '');
2062
+ }
2057
2063
  function draggableDialog(id) {
2058
2064
  setTimeout(function () {
2059
2065
  var _a, _b;
@@ -8848,7 +8854,7 @@
8848
8854
  var data = window.URL.createObjectURL(newBlob);
8849
8855
  var a = document.createElement('a');
8850
8856
  a.href = data;
8851
- a.download = 'report.pdf';
8857
+ a.download = getResponseHeaderFileName(response);
8852
8858
  document.body.appendChild(a);
8853
8859
  a.click();
8854
8860
  document.body.removeChild(a);
@@ -8942,7 +8948,7 @@
8942
8948
  var data = window.URL.createObjectURL(newBlob);
8943
8949
  var a = document.createElement('a');
8944
8950
  a.href = data;
8945
- a.download = 'report.pdf';
8951
+ a.download = getResponseHeaderFileName(response);
8946
8952
  document.body.appendChild(a);
8947
8953
  a.click();
8948
8954
  document.body.removeChild(a);
@@ -9971,6 +9977,7 @@
9971
9977
  exports.getMatchKey = getMatchKey;
9972
9978
  exports.getOrigDataFieldValue = getOrigDataFieldValue;
9973
9979
  exports.getOrigDataFieldValueAsString = getOrigDataFieldValueAsString;
9980
+ exports.getResponseHeaderFileName = getResponseHeaderFileName;
9974
9981
  exports.getSectionFieldValue = getSectionFieldValue;
9975
9982
  exports.hasRole = hasRole;
9976
9983
  exports.highlightLeftSidebar = highlightLeftSidebar;