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