dattatable 2.10.19 → 2.10.20
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/build/common/documents.d.ts +2 -1
- package/build/common/documents.js +45 -29
- package/dist/dattatable.js +580 -580
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Accordion.html +2 -2
- package/docs/classes/AuditLog.html +2 -2
- package/docs/classes/CanvasForm.html +2 -2
- package/docs/classes/Comments.html +2 -2
- package/docs/classes/Dashboard.html +4 -4
- package/docs/classes/DataTable.html +3 -3
- package/docs/classes/Documents.html +7 -6
- package/docs/classes/FilterSlideout.html +2 -2
- package/docs/classes/Footer.html +2 -2
- package/docs/classes/Header.html +2 -2
- package/docs/classes/InstallationRequired.html +2 -2
- package/docs/classes/ItemForm.html +4 -4
- package/docs/classes/List.html +4 -4
- package/docs/classes/ListSecurity.html +2 -2
- package/docs/classes/LoadingDialog.html +2 -2
- package/docs/classes/Modal.html +2 -2
- package/docs/classes/Navigation.html +3 -3
- package/docs/classes/Tiles.html +2 -2
- package/docs/classes/Timeout.html +2 -2
- package/docs/enums/ActionButtonTypes.html +2 -2
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getContextInfo.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/functions/waitForTheme.html +1 -1
- package/docs/interfaces/IAccordion.html +2 -2
- package/docs/interfaces/IAccordionProps.html +2 -2
- package/docs/interfaces/IAuditLogItem.html +2 -2
- package/docs/interfaces/IAuditLogItemCreation.html +2 -2
- package/docs/interfaces/IAuditLogProps.html +2 -2
- package/docs/interfaces/IAuditLogViewProps.html +2 -2
- package/docs/interfaces/ICommentsItem.html +2 -2
- package/docs/interfaces/IDashboardProps.html +2 -2
- package/docs/interfaces/IDataTable.html +2 -2
- package/docs/interfaces/IDataTableProps.html +2 -2
- package/docs/interfaces/IDocumentsProps.html +2 -2
- package/docs/interfaces/IFilterItem.html +2 -2
- package/docs/interfaces/IFilterProps.html +2 -2
- package/docs/interfaces/IFooterProps.html +2 -2
- package/docs/interfaces/IHeaderProps.html +2 -2
- package/docs/interfaces/IInstallProps.html +2 -2
- package/docs/interfaces/IItemFormCreateProps.html +2 -2
- package/docs/interfaces/IItemFormEditProps.html +2 -2
- package/docs/interfaces/IItemFormTab.html +2 -2
- package/docs/interfaces/IItemFormTabInfo.html +2 -2
- package/docs/interfaces/IItemFormViewProps.html +2 -2
- package/docs/interfaces/IListProps.html +2 -2
- package/docs/interfaces/IListSecurity.html +2 -2
- package/docs/interfaces/IListSecurityItem.html +2 -2
- package/docs/interfaces/IShowDialogProps.html +2 -2
- package/docs/interfaces/ITiles.html +2 -2
- package/docs/interfaces/ITilesProps.html +2 -2
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +2 -2
|
@@ -104,7 +104,6 @@ export declare class Documents {
|
|
|
104
104
|
private generateItems;
|
|
105
105
|
private generateTableProps;
|
|
106
106
|
private getFileName;
|
|
107
|
-
static isWopi(filename: string): boolean;
|
|
108
107
|
private load;
|
|
109
108
|
private render;
|
|
110
109
|
private renderActionButtons;
|
|
@@ -115,6 +114,8 @@ export declare class Documents {
|
|
|
115
114
|
private uploadFile;
|
|
116
115
|
/** Public Methods */
|
|
117
116
|
generateActionButton(btnType: number, file: Types.SP.File): HTMLElement;
|
|
117
|
+
static isWopi(filename: string): boolean;
|
|
118
|
+
static open(fileUrl: string, edit?: boolean): void;
|
|
118
119
|
refresh(): void;
|
|
119
120
|
search(value: string): void;
|
|
120
121
|
}
|
|
@@ -473,32 +473,6 @@ var Documents = /** @class */ (function () {
|
|
|
473
473
|
// Return the file name
|
|
474
474
|
return file.Name || file.FileName;
|
|
475
475
|
};
|
|
476
|
-
// Determines if the document can be viewed in office online servers
|
|
477
|
-
Documents.isWopi = function (filename) {
|
|
478
|
-
switch ((0, methods_1.getFileExt)(filename)) {
|
|
479
|
-
// Excel
|
|
480
|
-
case "csv":
|
|
481
|
-
case "doc":
|
|
482
|
-
case "docx":
|
|
483
|
-
case "dot":
|
|
484
|
-
case "dotx":
|
|
485
|
-
case "pot":
|
|
486
|
-
case "potx":
|
|
487
|
-
case "pps":
|
|
488
|
-
case "ppsx":
|
|
489
|
-
case "ppt":
|
|
490
|
-
case "pptx":
|
|
491
|
-
case "xls":
|
|
492
|
-
case "xlsx":
|
|
493
|
-
case "xlt":
|
|
494
|
-
case "xltx":
|
|
495
|
-
return true;
|
|
496
|
-
// Default
|
|
497
|
-
default: {
|
|
498
|
-
return false;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
476
|
// Loads the data
|
|
503
477
|
Documents.prototype.load = function () {
|
|
504
478
|
var _this = this;
|
|
@@ -659,6 +633,7 @@ var Documents = /** @class */ (function () {
|
|
|
659
633
|
type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,
|
|
660
634
|
onClick: function () {
|
|
661
635
|
if (_this.CanView) {
|
|
636
|
+
// Open the document
|
|
662
637
|
window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + "/_layouts/15/download.aspx?SourceUrl=" + file.ServerRelativeUrl, "_blank");
|
|
663
638
|
}
|
|
664
639
|
}
|
|
@@ -677,7 +652,7 @@ var Documents = /** @class */ (function () {
|
|
|
677
652
|
onClick: function () {
|
|
678
653
|
if (isWopi && _this.CanEdit) {
|
|
679
654
|
// Open the file in a new tab
|
|
680
|
-
|
|
655
|
+
Documents.open(file.ServerRelativeUrl, true);
|
|
681
656
|
}
|
|
682
657
|
}
|
|
683
658
|
},
|
|
@@ -808,8 +783,8 @@ var Documents = /** @class */ (function () {
|
|
|
808
783
|
type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSecondary,
|
|
809
784
|
onClick: function () {
|
|
810
785
|
if (_this.CanView) {
|
|
811
|
-
// Open the file
|
|
812
|
-
|
|
786
|
+
// Open the file
|
|
787
|
+
Documents.open(file.ServerRelativeUrl);
|
|
813
788
|
}
|
|
814
789
|
}
|
|
815
790
|
},
|
|
@@ -1166,6 +1141,47 @@ var Documents = /** @class */ (function () {
|
|
|
1166
1141
|
// Return the button
|
|
1167
1142
|
return this.generateButton(btnType, file);
|
|
1168
1143
|
};
|
|
1144
|
+
// Determines if the document can be viewed in office online servers
|
|
1145
|
+
Documents.isWopi = function (filename) {
|
|
1146
|
+
switch ((0, methods_1.getFileExt)(filename)) {
|
|
1147
|
+
// Excel
|
|
1148
|
+
case "csv":
|
|
1149
|
+
case "doc":
|
|
1150
|
+
case "docx":
|
|
1151
|
+
case "dot":
|
|
1152
|
+
case "dotx":
|
|
1153
|
+
case "pot":
|
|
1154
|
+
case "potx":
|
|
1155
|
+
case "pps":
|
|
1156
|
+
case "ppsx":
|
|
1157
|
+
case "ppt":
|
|
1158
|
+
case "pptx":
|
|
1159
|
+
case "xls":
|
|
1160
|
+
case "xlsx":
|
|
1161
|
+
case "xlt":
|
|
1162
|
+
case "xltx":
|
|
1163
|
+
return true;
|
|
1164
|
+
// Default
|
|
1165
|
+
default: {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
// Opens the document
|
|
1171
|
+
Documents.open = function (fileUrl, edit) {
|
|
1172
|
+
if (edit === void 0) { edit = false; }
|
|
1173
|
+
var fileData = fileUrl.split('/');
|
|
1174
|
+
var fileName = fileData[fileData.length - 1];
|
|
1175
|
+
// See if this is an office doc
|
|
1176
|
+
if (this.isWopi(fileName)) {
|
|
1177
|
+
// Open the document
|
|
1178
|
+
window.open(gd_sprest_bs_1.ContextInfo.webServerRelativeUrl + "/_layouts/15/WopiFrame.aspx?sourcedoc=" + fileUrl + "&action=" + (edit ? "edit" : "view"), "_blank");
|
|
1179
|
+
}
|
|
1180
|
+
else {
|
|
1181
|
+
// Open the document
|
|
1182
|
+
window.open(fileUrl, "_blank");
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1169
1185
|
// Refreshes the documents
|
|
1170
1186
|
Documents.prototype.refresh = function () {
|
|
1171
1187
|
var _this = this;
|