@egovernments/digit-ui-libraries 1.5.0-beta.3 → 1.5.0-beta.6

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.js CHANGED
@@ -34143,12 +34143,13 @@ var Download = {
34143
34143
  });
34144
34144
  },
34145
34145
  Excel: function Excel(data, filename) {
34146
+ var file = filename.substring(0, 30);
34146
34147
  var wb = XLSX.utils.book_new();
34147
34148
  var ws = null;
34148
34149
  ws = XLSX.utils.json_to_sheet(data);
34149
- wb.SheetNames.push(filename);
34150
- wb.Sheets[filename] = ws;
34151
- XLSX.writeFile(wb, filename + ".xlsx");
34150
+ wb.SheetNames.push(file);
34151
+ wb.Sheets[file] = ws;
34152
+ XLSX.writeFile(wb, file + ".xlsx");
34152
34153
  },
34153
34154
  PDF: function PDF(node, fileName, share, resolve) {
34154
34155
  if (resolve === void 0) {
@@ -34156,6 +34157,10 @@ var Download = {
34156
34157
  }
34157
34158
 
34158
34159
  var saveAs = function saveAs(uri, filename) {
34160
+ if (window.mSewaApp && window.mSewaApp.isMsewaApp()) {
34161
+ window.mSewaApp.downloadBase64File(uri, filename);
34162
+ }
34163
+
34159
34164
  var link = document.createElement("a");
34160
34165
 
34161
34166
  if (typeof link.download === "string") {
@@ -34212,6 +34217,10 @@ var Download = {
34212
34217
  }
34213
34218
 
34214
34219
  var saveAs = function saveAs(uri, filename) {
34220
+ if (window.mSewaApp && window.mSewaApp.isMsewaApp()) {
34221
+ window.mSewaApp.downloadBase64File(uri, filename);
34222
+ }
34223
+
34215
34224
  var link = document.createElement("a");
34216
34225
 
34217
34226
  if (typeof link.download === "string") {
@@ -37124,14 +37133,18 @@ var UrlShortener = function UrlShortener(fileStoreId) {
37124
37133
  });
37125
37134
  };
37126
37135
 
37136
+ var isMobileOrTablet = function isMobileOrTablet() {
37137
+ return /(android|iphone|ipad|mobile)/i.test(navigator.userAgent);
37138
+ };
37139
+
37127
37140
  var ShareFiles = {
37128
37141
  targetLink: function targetLink(target, shortUrl) {
37129
37142
  switch (target) {
37130
37143
  case "mail":
37131
- return window.open("mailto:?body=" + shortUrl, "_blank");
37144
+ return window.open("mailto:?body=" + encodeURIComponent(shortUrl), "_blank");
37132
37145
 
37133
37146
  case "whatsapp":
37134
- return window.open("https://web.whatsapp.com/send?text=" + shortUrl, "_blank");
37147
+ return window.open('https://' + (isMobileOrTablet() ? 'api' : 'web') + '.whatsapp.com/send?text=' + encodeURIComponent(shortUrl), "_blank");
37135
37148
 
37136
37149
  default:
37137
37150
  return window.open(shortUrl, "_blank");
@@ -37155,7 +37168,7 @@ var ShareFiles = {
37155
37168
  files: [pdfData],
37156
37169
  title: filename
37157
37170
  }) : Promise.resolve(ShareFiles.getShortener(tenantId, pdfData)).then(function (shortUrl) {
37158
- ShareFiles.targetLink(target, shortUrl);
37171
+ return ShareFiles.targetLink(target, shortUrl);
37159
37172
  });
37160
37173
  });
37161
37174
  } catch (e) {
@@ -37171,7 +37184,7 @@ var ShareFiles = {
37171
37184
  files: [imageData],
37172
37185
  title: filename
37173
37186
  }) : Promise.resolve(ShareFiles.getShortener(tenantId, imageData)).then(function (shortUrl) {
37174
- ShareFiles.targetLink(target, shortUrl);
37187
+ return ShareFiles.targetLink(target, shortUrl);
37175
37188
  });
37176
37189
  });
37177
37190
  } catch (e) {
@@ -37187,7 +37200,7 @@ var ShareFiles = {
37187
37200
  files: [imageData],
37188
37201
  title: filename
37189
37202
  }) : Promise.resolve(ShareFiles.getShortener(tenantId, imageData)).then(function (shortUrl) {
37190
- ShareFiles.targetLink(target, shortUrl);
37203
+ return ShareFiles.targetLink(target, shortUrl);
37191
37204
  });
37192
37205
  });
37193
37206
  } catch (e) {
@@ -37203,7 +37216,7 @@ var ShareFiles = {
37203
37216
  files: [imageData],
37204
37217
  title: filename
37205
37218
  }) : Promise.resolve(ShareFiles.getShortener(tenantId, imageData)).then(function (shortUrl) {
37206
- ShareFiles.targetLink(target, shortUrl);
37219
+ return ShareFiles.targetLink(target, shortUrl);
37207
37220
  });
37208
37221
  });
37209
37222
  } catch (e) {