dattatable 2.10.31 → 2.10.32

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.
Files changed (61) hide show
  1. package/build/common/documents.d.ts +2 -1
  2. package/build/common/documents.js +12 -6
  3. package/dist/dattatable.js +580 -580
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +3 -3
  12. package/docs/classes/Documents.html +7 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -2
  17. package/docs/classes/ItemForm.html +4 -4
  18. package/docs/classes/List.html +4 -4
  19. package/docs/classes/ListSecurity.html +2 -2
  20. package/docs/classes/LoadingDialog.html +2 -2
  21. package/docs/classes/Modal.html +2 -2
  22. package/docs/classes/Navigation.html +3 -3
  23. package/docs/classes/Tiles.html +2 -2
  24. package/docs/classes/Timeout.html +2 -2
  25. package/docs/enums/ActionButtonTypes.html +2 -2
  26. package/docs/functions/formatBytes.html +1 -1
  27. package/docs/functions/formatDateValue.html +1 -1
  28. package/docs/functions/formatTimeValue.html +1 -1
  29. package/docs/functions/getContextInfo.html +1 -1
  30. package/docs/functions/getFileExt.html +1 -1
  31. package/docs/functions/waitForTheme.html +1 -1
  32. package/docs/interfaces/IAccordion.html +2 -2
  33. package/docs/interfaces/IAccordionProps.html +2 -2
  34. package/docs/interfaces/IAuditLogItem.html +2 -2
  35. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  36. package/docs/interfaces/IAuditLogProps.html +2 -2
  37. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  38. package/docs/interfaces/ICommentsItem.html +2 -2
  39. package/docs/interfaces/IDashboardProps.html +2 -2
  40. package/docs/interfaces/IDataTable.html +2 -2
  41. package/docs/interfaces/IDataTableProps.html +2 -2
  42. package/docs/interfaces/IDocumentsProps.html +2 -2
  43. package/docs/interfaces/IFilterItem.html +2 -2
  44. package/docs/interfaces/IFilterProps.html +2 -2
  45. package/docs/interfaces/IFooterProps.html +2 -2
  46. package/docs/interfaces/IHeaderProps.html +2 -2
  47. package/docs/interfaces/IInstallProps.html +2 -2
  48. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  49. package/docs/interfaces/IItemFormEditProps.html +2 -2
  50. package/docs/interfaces/IItemFormTab.html +2 -2
  51. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  52. package/docs/interfaces/IItemFormViewProps.html +2 -2
  53. package/docs/interfaces/IListProps.html +2 -2
  54. package/docs/interfaces/IListSecurity.html +2 -2
  55. package/docs/interfaces/IListSecurityItem.html +2 -2
  56. package/docs/interfaces/IShowDialogProps.html +2 -2
  57. package/docs/interfaces/ITiles.html +2 -2
  58. package/docs/interfaces/ITilesProps.html +2 -2
  59. package/docs/variables/DattaTable.html +1 -1
  60. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  61. package/package.json +2 -2
@@ -113,9 +113,10 @@ export declare class Documents {
113
113
  private renderTable;
114
114
  private uploadFile;
115
115
  /** Public Methods */
116
+ static download(fileUrl: string, webUrl?: string): void;
116
117
  generateActionButton(btnType: number, file: Types.SP.File): HTMLElement;
117
118
  static isWopi(filename: string): boolean;
118
- static open(fileUrl: string, edit?: boolean): void;
119
+ static open(fileUrl: string, edit?: boolean, webUrl?: string): void;
119
120
  refresh(): void;
120
121
  search(value: string): void;
121
122
  }
@@ -649,8 +649,8 @@ var Documents = /** @class */ (function () {
649
649
  type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,
650
650
  onClick: function () {
651
651
  if (_this.CanView) {
652
- // Open the document
653
- window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + "/_layouts/15/download.aspx?SourceUrl=" + file.ServerRelativeUrl, "_blank");
652
+ // Download the document
653
+ Documents.download(file.ServerRelativeUrl, _this._props.webUrl);
654
654
  }
655
655
  }
656
656
  },
@@ -668,7 +668,7 @@ var Documents = /** @class */ (function () {
668
668
  onClick: function () {
669
669
  if (isWopi && _this.CanEdit) {
670
670
  // Open the file in a new tab
671
- Documents.open(file.ServerRelativeUrl, true);
671
+ Documents.open(file.ServerRelativeUrl, true, _this._props.webUrl);
672
672
  }
673
673
  }
674
674
  },
@@ -800,7 +800,7 @@ var Documents = /** @class */ (function () {
800
800
  onClick: function () {
801
801
  if (_this.CanView) {
802
802
  // Open the file
803
- Documents.open(file.ServerRelativeUrl);
803
+ Documents.open(file.ServerRelativeUrl, false, _this._props.webUrl);
804
804
  }
805
805
  }
806
806
  },
@@ -1152,6 +1152,11 @@ var Documents = /** @class */ (function () {
1152
1152
  });
1153
1153
  };
1154
1154
  /** Public Methods */
1155
+ // Downloads the document
1156
+ Documents.download = function (fileUrl, webUrl) {
1157
+ if (webUrl === void 0) { webUrl = gd_sprest_bs_1.ContextInfo.webServerRelativeUrl; }
1158
+ window.open(webUrl + "/_layouts/15/download.aspx?SourceUrl=" + fileUrl, "_blank");
1159
+ };
1155
1160
  // Generates an action button
1156
1161
  Documents.prototype.generateActionButton = function (btnType, file) {
1157
1162
  // Return the button
@@ -1184,14 +1189,15 @@ var Documents = /** @class */ (function () {
1184
1189
  }
1185
1190
  };
1186
1191
  // Opens the document
1187
- Documents.open = function (fileUrl, edit) {
1192
+ Documents.open = function (fileUrl, edit, webUrl) {
1188
1193
  if (edit === void 0) { edit = false; }
1194
+ if (webUrl === void 0) { webUrl = gd_sprest_bs_1.ContextInfo.webServerRelativeUrl; }
1189
1195
  var fileData = fileUrl.split('/');
1190
1196
  var fileName = fileData[fileData.length - 1];
1191
1197
  // See if this is an office doc
1192
1198
  if (this.isWopi(fileName)) {
1193
1199
  // Open the document
1194
- window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + "/_layouts/15/WopiFrame.aspx?sourcedoc=" + fileUrl + "&action=" + (edit ? "edit" : "view"), "_blank");
1200
+ window.open(webUrl + "/_layouts/15/WopiFrame.aspx?sourcedoc=" + fileUrl + "&action=" + (edit ? "edit" : "view"), "_blank");
1195
1201
  }
1196
1202
  else {
1197
1203
  // Open the document