dts-backoffice-util 6.0.0 → 6.0.1

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.
@@ -1235,12 +1235,19 @@ class FileUtil {
1235
1235
  const binaryData = [file];
1236
1236
  const downloadLink = document.createElement('a');
1237
1237
  const urlDownload = window.URL.createObjectURL(new Blob(binaryData, { type: file.type }));
1238
- downloadLink.href = urlDownload;
1239
- downloadLink.setAttribute('download', fileName);
1240
- document.body.appendChild(downloadLink);
1241
- downloadLink.click();
1242
- window.URL.revokeObjectURL(urlDownload);
1243
- downloadLink.remove();
1238
+ /**Verifica se é ie ou edge, pois o mesmo tem tratamento próprio para arquivos blob */
1239
+ const nav = window.navigator;
1240
+ if (nav && nav.msSaveOrOpenBlob) {
1241
+ nav.msSaveOrOpenBlob(file, fileName);
1242
+ }
1243
+ else {
1244
+ downloadLink.href = urlDownload;
1245
+ downloadLink.setAttribute('download', fileName);
1246
+ document.body.appendChild(downloadLink);
1247
+ downloadLink.click();
1248
+ window.URL.revokeObjectURL(urlDownload);
1249
+ downloadLink.remove();
1250
+ }
1244
1251
  }
1245
1252
  static b64toBlob(b64Data, contentType, sliceSize) {
1246
1253
  contentType = contentType || '';