@sapui5/sap.ui.export 1.102.2 → 1.102.5
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/package.json +1 -1
- package/src/sap/ui/export/.library +1 -1
- package/src/sap/ui/export/ExportBase.js +1 -1
- package/src/sap/ui/export/ExportDialog.js +8 -0
- package/src/sap/ui/export/ExportHandler.js +6 -2
- package/src/sap/ui/export/ExportUtils.js +15 -15
- package/src/sap/ui/export/PortableDocument.js +1 -1
- package/src/sap/ui/export/Spreadsheet.js +3 -3
- package/src/sap/ui/export/SpreadsheetExport.js +1 -1
- package/src/sap/ui/export/library.js +2 -2
- package/src/sap/ui/export/messagebundle.properties +3 -0
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* @constructor The <code>sap.ui.export.ExportBase</code> class allows you to export table data from a UI5 application to certain formats. This class is an abstract class that requires specific implementations for each file format.
|
|
28
28
|
*
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.102.
|
|
30
|
+
* @version 1.102.5
|
|
31
31
|
*
|
|
32
32
|
* @since 1.96
|
|
33
33
|
* @name sap.ui.export.ExportBase
|
|
@@ -180,6 +180,14 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
180
180
|
* @param {string} sMessage Error message that will be shown in the error dialog
|
|
181
181
|
*/
|
|
182
182
|
function showErrorMessage(sMessage) {
|
|
183
|
+
if (!sMessage) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (sMessage instanceof Error) {
|
|
188
|
+
sMessage = sMessage.message;
|
|
189
|
+
}
|
|
190
|
+
|
|
183
191
|
oResourceBundlePromise.then(function(oResourceBundle) {
|
|
184
192
|
var errorMessage = sMessage || oResourceBundle.getText('PROGRESS_ERROR_DEFAULT');
|
|
185
193
|
|
|
@@ -6,6 +6,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
var Destination = library.Destination;
|
|
9
|
+
var FileType = library.FileType;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Any export related functionality is encapsuled in the <code>ExportHandler</code> which also stores user settings throughout the session.
|
|
@@ -14,7 +15,7 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
14
15
|
* @constructor The <code>sap.ui.export.ExportHandler</code> class allows you to export table data from a UI5 application.
|
|
15
16
|
*
|
|
16
17
|
* @author SAP SE
|
|
17
|
-
* @version 1.102.
|
|
18
|
+
* @version 1.102.5
|
|
18
19
|
*
|
|
19
20
|
* @since 1.102
|
|
20
21
|
* @name sap.ui.export.ExportHandler
|
|
@@ -397,7 +398,10 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
397
398
|
|
|
398
399
|
/* Merge export settings with user settings from the dialog */
|
|
399
400
|
Object.assign(mExportSettings, mDialogSettings);
|
|
400
|
-
|
|
401
|
+
|
|
402
|
+
if (mExportSettings.fileType !== FileType.XLSX || mExportSettings.destination !== Destination.REMOTE) {
|
|
403
|
+
ExportUtils.validateFileSettings(mExportSettings);
|
|
404
|
+
}
|
|
401
405
|
|
|
402
406
|
mUserSettings.splitCells = mDialogSettings.splitCells;
|
|
403
407
|
mUserSettings.includeFilterSettings = mDialogSettings.includeFilterSettings;
|
|
@@ -47,7 +47,6 @@ sap.ui.define([
|
|
|
47
47
|
|
|
48
48
|
/* Returns the Export Settings used by the User Settings Dialog */
|
|
49
49
|
function getDefaultSettings(oCustomConfig, oResourceBundle, oExportCapabilities, bRemoteDestination) {
|
|
50
|
-
var sSelectedKey;
|
|
51
50
|
var aSupportedFormats = Object.keys(oExportCapabilities);
|
|
52
51
|
|
|
53
52
|
var oDefaultConfig = {
|
|
@@ -81,7 +80,15 @@ sap.ui.define([
|
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
aSupportedFormats.forEach(function(sFormat) {
|
|
84
|
-
|
|
83
|
+
var sFileType, sResourceBundleKey;
|
|
84
|
+
|
|
85
|
+
sFileType = sFormat.toUpperCase();
|
|
86
|
+
sResourceBundleKey = bRemoteDestination && sFileType === FileType.XLSX ? sFileType + '_CLOUD_FILETYPE' : sFileType + '_FILETYPE';
|
|
87
|
+
|
|
88
|
+
oDefaultConfig.fileTypeCollection.push({
|
|
89
|
+
key: sFileType,
|
|
90
|
+
text: oResourceBundle.getText(sResourceBundleKey)
|
|
91
|
+
});
|
|
85
92
|
});
|
|
86
93
|
|
|
87
94
|
if (bRemoteDestination) {
|
|
@@ -93,17 +100,10 @@ sap.ui.define([
|
|
|
93
100
|
|
|
94
101
|
var oExportConfig = Object.assign({}, oDefaultConfig, oCustomConfig || {});
|
|
95
102
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
oExportConfig.fileTypeCollection[i].text = oResourceBundle.getText(oExportConfig.fileTypeCollection[i].key + '_FILETYPE');
|
|
101
|
-
}
|
|
102
|
-
if (oExportConfig.fileTypeCollection[i].key === oExportConfig.fileType) {
|
|
103
|
-
sSelectedKey = oExportConfig.fileTypeCollection[i].key;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (!sSelectedKey) {
|
|
103
|
+
/* Select first element if selected key is unavailable */
|
|
104
|
+
if (!oExportConfig.fileTypeCollection.some(function(oEntry) {
|
|
105
|
+
return oEntry.key === oExportConfig.fileType;
|
|
106
|
+
})) {
|
|
107
107
|
oExportConfig.fileType = oExportConfig.fileTypeCollection[0].key;
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -124,7 +124,7 @@ sap.ui.define([
|
|
|
124
124
|
* Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
125
125
|
*
|
|
126
126
|
* @author SAP SE
|
|
127
|
-
* @version 1.102.
|
|
127
|
+
* @version 1.102.5
|
|
128
128
|
*
|
|
129
129
|
* @since 1.59
|
|
130
130
|
* @name sap.ui.export.ExportUtils
|
|
@@ -974,7 +974,7 @@ sap.ui.define([
|
|
|
974
974
|
*
|
|
975
975
|
* @param {object} oContext Context object
|
|
976
976
|
* @param {string} [oContext.application] Name of the application (default: "SAP UI5")
|
|
977
|
-
* @param {string} [oContext.version] Application version (default: "1.102.
|
|
977
|
+
* @param {string} [oContext.version] Application version (default: "1.102.5")
|
|
978
978
|
* @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
|
|
979
979
|
* @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
|
|
980
980
|
* @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @constructor The <code>sap.ui.export.PortableDocument</code> class allows you to export table data from a UI5 application to a Portable Document Format (*.PDF) file.
|
|
18
18
|
*
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.102.
|
|
20
|
+
* @version 1.102.5
|
|
21
21
|
*
|
|
22
22
|
* @since 1.96
|
|
23
23
|
* @alias sap.ui.export.PortableDocument
|
|
@@ -83,7 +83,7 @@ sap.ui.define([
|
|
|
83
83
|
* <li><code>workbook.context</code> - Context object that will be applied to the generated file. It may contain the following fields:</li>
|
|
84
84
|
* <ul>
|
|
85
85
|
* <li><code>application</code> (string) - The application that creates the XLSX document (default: "SAP UI5")</li>
|
|
86
|
-
* <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.102.
|
|
86
|
+
* <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.102.5")</li>
|
|
87
87
|
* <li><code>title</code> (string) - Title of the XLSX document (NOT the filename)</li>
|
|
88
88
|
* <li><code>modifiedBy</code> (string) - User context for the XLSX document</li>
|
|
89
89
|
* <li><code>sheetName</code> (string) - The label of the data sheet</li>
|
|
@@ -166,7 +166,7 @@ sap.ui.define([
|
|
|
166
166
|
* columns: aColumns,
|
|
167
167
|
* context: {
|
|
168
168
|
* application: 'Debug Test Application',
|
|
169
|
-
* version: '1.102.
|
|
169
|
+
* version: '1.102.5',
|
|
170
170
|
* title: 'Some random title',
|
|
171
171
|
* modifiedBy: 'John Doe',
|
|
172
172
|
* metaSheetName: 'Custom metadata',
|
|
@@ -278,7 +278,7 @@ sap.ui.define([
|
|
|
278
278
|
* @constructor The <code>sap.ui.export.Spreadsheet</code> class allows you to export table data from a UI5 application to a spreadsheet file.
|
|
279
279
|
*
|
|
280
280
|
* @author SAP SE
|
|
281
|
-
* @version 1.102.
|
|
281
|
+
* @version 1.102.5
|
|
282
282
|
*
|
|
283
283
|
* @since 1.50
|
|
284
284
|
* @name sap.ui.export.Spreadsheet
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @namespace
|
|
18
18
|
* @alias sap.ui.export
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.102.
|
|
20
|
+
* @version 1.102.5
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
interfaces: [],
|
|
34
34
|
controls: [],
|
|
35
35
|
elements: [],
|
|
36
|
-
version: "1.102.
|
|
36
|
+
version: "1.102.5"
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
|
|
@@ -61,6 +61,9 @@ ADD_DATE_TIME=Add current date and time to the file name
|
|
|
61
61
|
#XLST: Spreadsheet file type config for spreadsheet export
|
|
62
62
|
XLSX_FILETYPE=Spreadsheet (*.xlsx)
|
|
63
63
|
|
|
64
|
+
#XLST: Spreadsheet file type for exporting to the cloud - No extensions allowed
|
|
65
|
+
XLSX_CLOUD_FILETYPE=Spreadsheet
|
|
66
|
+
|
|
64
67
|
#XMSG: File name warning text
|
|
65
68
|
FILENAME_WARNING=The file name you entered exceeds 100 characters. This may prevent the spreadsheet from opening correctly.
|
|
66
69
|
|