@sapui5/sap.ui.export 1.99.1 → 1.102.0
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 +2 -2
- package/src/sap/ui/export/ExportBase.js +29 -7
- package/src/sap/ui/export/ExportDialog.js +30 -22
- package/src/sap/ui/export/ExportHandler.js +453 -0
- package/src/sap/ui/export/ExportUtils.js +220 -102
- package/src/sap/ui/export/PortableDocument.js +96 -58
- package/src/sap/ui/export/Spreadsheet.js +35 -22
- package/src/sap/ui/export/SpreadsheetExport.js +2 -3
- package/src/sap/ui/export/fragments/SettingsDialog.fragment.xml +25 -15
- package/src/sap/ui/export/js/XLSXBuilder.js +1 -1
- package/src/sap/ui/export/js/XLSXBuilder.js.map +1 -1
- package/src/sap/ui/export/library.js +42 -15
- package/src/sap/ui/export/messagebundle.properties +59 -8
- package/src/sap/ui/export/messagebundle_ar.properties +38 -4
- package/src/sap/ui/export/messagebundle_bg.properties +41 -7
- package/src/sap/ui/export/messagebundle_ca.properties +38 -4
- package/src/sap/ui/export/messagebundle_cs.properties +38 -4
- package/src/sap/ui/export/messagebundle_cy.properties +38 -4
- package/src/sap/ui/export/messagebundle_da.properties +38 -4
- package/src/sap/ui/export/messagebundle_de.properties +38 -4
- package/src/sap/ui/export/messagebundle_el.properties +38 -4
- package/src/sap/ui/export/messagebundle_en.properties +36 -2
- package/src/sap/ui/export/messagebundle_en_GB.properties +36 -2
- package/src/sap/ui/export/messagebundle_en_US_sappsd.properties +35 -3
- package/src/sap/ui/export/messagebundle_en_US_saprigi.properties +36 -2
- package/src/sap/ui/export/messagebundle_en_US_saptrc.properties +37 -3
- package/src/sap/ui/export/messagebundle_es.properties +38 -4
- package/src/sap/ui/export/messagebundle_es_MX.properties +38 -4
- package/src/sap/ui/export/messagebundle_et.properties +38 -4
- package/src/sap/ui/export/messagebundle_fi.properties +39 -5
- package/src/sap/ui/export/messagebundle_fr.properties +43 -9
- package/src/sap/ui/export/messagebundle_fr_CA.properties +38 -4
- package/src/sap/ui/export/messagebundle_hi.properties +38 -4
- package/src/sap/ui/export/messagebundle_hr.properties +38 -4
- package/src/sap/ui/export/messagebundle_hu.properties +38 -4
- package/src/sap/ui/export/messagebundle_id.properties +39 -5
- package/src/sap/ui/export/messagebundle_it.properties +38 -4
- package/src/sap/ui/export/messagebundle_iw.properties +38 -4
- package/src/sap/ui/export/messagebundle_ja.properties +38 -4
- package/src/sap/ui/export/messagebundle_kk.properties +38 -4
- package/src/sap/ui/export/messagebundle_ko.properties +38 -4
- package/src/sap/ui/export/messagebundle_lt.properties +38 -4
- package/src/sap/ui/export/messagebundle_lv.properties +38 -4
- package/src/sap/ui/export/messagebundle_ms.properties +38 -4
- package/src/sap/ui/export/messagebundle_nl.properties +38 -4
- package/src/sap/ui/export/messagebundle_no.properties +38 -4
- package/src/sap/ui/export/messagebundle_pl.properties +38 -4
- package/src/sap/ui/export/messagebundle_pt.properties +38 -4
- package/src/sap/ui/export/messagebundle_pt_PT.properties +38 -4
- package/src/sap/ui/export/messagebundle_ro.properties +38 -4
- package/src/sap/ui/export/messagebundle_ru.properties +38 -4
- package/src/sap/ui/export/messagebundle_sh.properties +38 -4
- package/src/sap/ui/export/messagebundle_sk.properties +38 -4
- package/src/sap/ui/export/messagebundle_sl.properties +38 -4
- package/src/sap/ui/export/messagebundle_sv.properties +38 -4
- package/src/sap/ui/export/messagebundle_th.properties +38 -4
- package/src/sap/ui/export/messagebundle_tr.properties +38 -4
- package/src/sap/ui/export/messagebundle_uk.properties +38 -4
- package/src/sap/ui/export/messagebundle_vi.properties +38 -4
- package/src/sap/ui/export/messagebundle_zh_CN.properties +38 -4
- package/src/sap/ui/export/messagebundle_zh_TW.properties +38 -4
- package/src/sap/ui/export/provider/DataProviderBase.js +10 -10
- package/src/sap/ui/export/themes/sap_horizon_dark/library.source.less +8 -0
- package/src/sap/ui/export/themes/sap_horizon_hcb/library.source.less +8 -0
- package/src/sap/ui/export/themes/sap_horizon_hcw/library.source.less +8 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<vendor>SAP SE</vendor>
|
|
6
6
|
<copyright>SAPUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE. All rights reserved.</copyright>
|
|
8
|
-
<version>1.
|
|
8
|
+
<version>1.102.0</version>
|
|
9
9
|
|
|
10
10
|
<documentation>UI5 library: sap.ui.export</documentation>
|
|
11
11
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</module-infos>
|
|
35
35
|
<all-in-one>
|
|
36
36
|
<!-- exclude third party bundles and the worker code -->
|
|
37
|
-
<exclude name="sap/ui/export/js
|
|
37
|
+
<exclude name="sap/ui/export/js/" />
|
|
38
38
|
</all-in-one>
|
|
39
39
|
</packaging>
|
|
40
40
|
<ownership xmlns="http://www.sap.com/ui5/buildext/ownership">
|
|
@@ -12,10 +12,22 @@ sap.ui.define([
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Base class for specific SAPUI5 export implementations. This class contains abstract functions that need to be implemented.
|
|
16
|
+
*
|
|
17
|
+
* @param {object} mSettings - Export settings
|
|
18
|
+
* @param {object} mSettings.workbook - Data and formatting related export settings
|
|
19
|
+
* @param {object|sap.ui.model.ListBinding} mSettings.dataSource - Source of export data.
|
|
20
|
+
* A data source properties map or <code>sap.ui.model.ListBinding</code> can be provided.
|
|
21
|
+
* An instance of <code>sap.ui.model.ListBinding</code> has to implement a
|
|
22
|
+
* <code>#getDownloadUrl</code> function.
|
|
23
|
+
* @param {int} [mSettings.count] - The maximal number of records to export
|
|
24
|
+
* @param {string} [mSettings.fileName] - Optional file name for the exported file
|
|
25
|
+
* @param {sap.ui.export.FileType} [mSettings.fileType] - <code>FileType</code> that is used to identify the file-ending and MIME-type of the file
|
|
26
|
+
*
|
|
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.
|
|
16
28
|
*
|
|
17
29
|
* @author SAP SE
|
|
18
|
-
* @version 1.
|
|
30
|
+
* @version 1.102.0
|
|
19
31
|
*
|
|
20
32
|
* @since 1.96
|
|
21
33
|
* @name sap.ui.export.ExportBase
|
|
@@ -50,7 +62,7 @@ sap.ui.define([
|
|
|
50
62
|
* @param {sap.ui.base.Event} oEvent
|
|
51
63
|
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
52
64
|
* @param {object} oEvent.getParameters
|
|
53
|
-
* @param {
|
|
65
|
+
* @param {object} oEvent.getParameter.exportSettings - Contains export-related configuration
|
|
54
66
|
*
|
|
55
67
|
* @since 1.96
|
|
56
68
|
* @public
|
|
@@ -128,9 +140,9 @@ sap.ui.define([
|
|
|
128
140
|
* Sets the data source configuration that will be used for exporting the data. If the passed parameter is null,
|
|
129
141
|
* the call will be ignored.
|
|
130
142
|
*
|
|
131
|
-
* @param {
|
|
143
|
+
* @param {object|sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oDataSource Possible types are a data
|
|
132
144
|
* source configuration, a <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
133
|
-
* @returns {
|
|
145
|
+
* @returns {object|null} - Valid dataSource object or null in case the dataSource configuration is not supported
|
|
134
146
|
*
|
|
135
147
|
* @function
|
|
136
148
|
* @abstract
|
|
@@ -144,7 +156,7 @@ sap.ui.define([
|
|
|
144
156
|
/**
|
|
145
157
|
* Applies default settings to the export configuration.
|
|
146
158
|
*
|
|
147
|
-
* @param {
|
|
159
|
+
* @param {object} mSettings Export settings that will be adjusted
|
|
148
160
|
*
|
|
149
161
|
* @function
|
|
150
162
|
* @abstract
|
|
@@ -156,7 +168,7 @@ sap.ui.define([
|
|
|
156
168
|
/**
|
|
157
169
|
* Creates a Promise that will be resolved after the export has been finished.
|
|
158
170
|
*
|
|
159
|
-
* @param {
|
|
171
|
+
* @param {object} mSettings Validated export configuration
|
|
160
172
|
*
|
|
161
173
|
* @function
|
|
162
174
|
* @abstract
|
|
@@ -165,6 +177,16 @@ sap.ui.define([
|
|
|
165
177
|
throw new Error('Abstract function not implemented');
|
|
166
178
|
};
|
|
167
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Returns the specific MIME type
|
|
182
|
+
*
|
|
183
|
+
* @function
|
|
184
|
+
* @abstract
|
|
185
|
+
*/
|
|
186
|
+
ExportBase.prototype.getMimeType = function() {
|
|
187
|
+
throw new Error('Abstract function not implemented');
|
|
188
|
+
};
|
|
189
|
+
|
|
168
190
|
/**
|
|
169
191
|
* Triggers the export process of the specific format.
|
|
170
192
|
*
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
* Export progress dialog
|
|
8
8
|
* @private
|
|
9
9
|
*/
|
|
10
|
-
sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Button', 'sap/m/ProgressIndicator', 'sap/m/Text', 'sap/m/MessageBox', 'sap/ui/core/format/NumberFormat'],
|
|
11
|
-
function(coreLibrary, MLibrary, Dialog, Button, ProgressIndicator, Text, MessageBox, NumberFormat) {
|
|
10
|
+
sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Button', 'sap/m/ProgressIndicator', 'sap/m/Text', 'sap/m/Link', 'sap/m/VBox', 'sap/m/MessageBox', 'sap/ui/core/format/NumberFormat'],
|
|
11
|
+
function(coreLibrary, MLibrary, Dialog, Button, ProgressIndicator, Text, Link, VBox, MessageBox, NumberFormat) {
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var ValueState = coreLibrary.ValueState;
|
|
15
15
|
|
|
16
16
|
var DialogType = MLibrary.DialogType;
|
|
17
|
+
var ButtonType = MLibrary.ButtonType;
|
|
17
18
|
|
|
18
19
|
/* Async call to resource bundle */
|
|
19
20
|
var oResourceBundlePromise = sap.ui.getCore().getLibraryResourceBundle("sap.ui.export", true);
|
|
@@ -28,9 +29,9 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
28
29
|
return new Promise(function(fnResolve, fnReject) {
|
|
29
30
|
var dialog;
|
|
30
31
|
|
|
31
|
-
oResourceBundlePromise.then(function(
|
|
32
|
+
oResourceBundlePromise.then(function(oResourceBundle) {
|
|
32
33
|
var cancelButton = new Button({
|
|
33
|
-
text :
|
|
34
|
+
text : oResourceBundle.getText("CANCEL_BUTTON"),
|
|
34
35
|
press : function() {
|
|
35
36
|
if (dialog && dialog.oncancel) {
|
|
36
37
|
dialog.oncancel();
|
|
@@ -48,9 +49,9 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
48
49
|
});
|
|
49
50
|
progressIndicator.addStyleClass("sapUiMediumMarginTop");
|
|
50
51
|
|
|
51
|
-
var oMessage = new Text({text :
|
|
52
|
+
var oMessage = new Text({text : oResourceBundle.getText("PROGRESS_FETCHING_MSG")});
|
|
52
53
|
dialog = new Dialog({
|
|
53
|
-
title :
|
|
54
|
+
title : oResourceBundle.getText("PROGRESS_TITLE"),
|
|
54
55
|
type : DialogType.Message,
|
|
55
56
|
contentWidth : "500px",
|
|
56
57
|
content : [
|
|
@@ -61,9 +62,14 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
61
62
|
ariaLabelledBy: [oMessage]
|
|
62
63
|
});
|
|
63
64
|
|
|
64
|
-
dialog.updateStatus = function(iFetched, iTotal) {
|
|
65
|
+
dialog.updateStatus = function(iFetched, iTotal, sMessage) {
|
|
65
66
|
var iPercentage;
|
|
66
67
|
|
|
68
|
+
if (typeof iFetched === 'string' && iFetched) {
|
|
69
|
+
sMessage = iFetched;
|
|
70
|
+
oMessage.setText(sMessage);
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
if (!isNaN(iFetched) & !isNaN(iTotal)) {
|
|
68
74
|
iPercentage = iFetched / iTotal * 100;
|
|
69
75
|
}
|
|
@@ -71,7 +77,7 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
71
77
|
/* Update status text to reflect the current step (bundle instead of fetching data) */
|
|
72
78
|
if (iPercentage >= 100) {
|
|
73
79
|
cancelButton.setEnabled(false);
|
|
74
|
-
oMessage.setText(
|
|
80
|
+
oMessage.setText(sMessage || oResourceBundle.getText("PROGRESS_BUNDLE_MSG"));
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
progressIndicator.setPercentValue(iPercentage);
|
|
@@ -111,7 +117,7 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
111
117
|
function showWarningDialog(mParams) {
|
|
112
118
|
return new Promise(function(fnResolve, fnReject) {
|
|
113
119
|
|
|
114
|
-
oResourceBundlePromise.then(function(
|
|
120
|
+
oResourceBundlePromise.then(function(oResourceBundle) {
|
|
115
121
|
var bContinue, oWarningDialog, oWarningText, sWarningText, oNumberFormat, sRowsFormatted;
|
|
116
122
|
|
|
117
123
|
oNumberFormat = NumberFormat.getIntegerInstance({groupingEnabled: true});
|
|
@@ -119,17 +125,17 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
119
125
|
sWarningText = '';
|
|
120
126
|
|
|
121
127
|
if (!mParams.rows) {
|
|
122
|
-
sWarningText =
|
|
128
|
+
sWarningText = oResourceBundle.getText("NO_COUNT_WARNING_MSG");
|
|
123
129
|
} else {
|
|
124
130
|
sRowsFormatted = oNumberFormat.format(mParams.rows);
|
|
125
131
|
|
|
126
132
|
if (mParams.sizeLimit) {
|
|
127
|
-
sWarningText =
|
|
133
|
+
sWarningText = oResourceBundle.getText("SIZE_WARNING_MSG", [sRowsFormatted, mParams.columns]);
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
if (mParams.cutOff) {
|
|
131
137
|
sWarningText += sWarningText === '' ? '' : '\n\n'; // Add line breaks if there is already a message
|
|
132
|
-
sWarningText +=
|
|
138
|
+
sWarningText += oResourceBundle.getText("MSG_WARNING_CUT_OFF", [sRowsFormatted]);
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
|
|
@@ -137,19 +143,21 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
137
143
|
text: sWarningText
|
|
138
144
|
});
|
|
139
145
|
oWarningDialog = new Dialog({
|
|
140
|
-
title:
|
|
146
|
+
title: oResourceBundle.getText('PROGRESS_TITLE'),
|
|
141
147
|
type: DialogType.Message,
|
|
142
148
|
state: ValueState.Warning,
|
|
143
149
|
content: oWarningText,
|
|
144
150
|
ariaLabelledBy: oWarningText,
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
endButton: new Button({
|
|
152
|
+
type: ButtonType.Transparent,
|
|
153
|
+
text: oResourceBundle.getText("CANCEL_BUTTON"),
|
|
147
154
|
press: function () {
|
|
148
155
|
oWarningDialog.close();
|
|
149
156
|
}
|
|
150
157
|
}),
|
|
151
|
-
|
|
152
|
-
|
|
158
|
+
beginButton: new Button({
|
|
159
|
+
type: ButtonType.Emphasized,
|
|
160
|
+
text: oResourceBundle.getText("EXPORT_BUTTON"),
|
|
153
161
|
press: function () {
|
|
154
162
|
bContinue = true;
|
|
155
163
|
oWarningDialog.close();
|
|
@@ -172,16 +180,16 @@ sap.ui.define(['sap/ui/core/library', 'sap/m/library', 'sap/m/Dialog', 'sap/m/Bu
|
|
|
172
180
|
* @param {string} sMessage Error message that will be shown in the error dialog
|
|
173
181
|
*/
|
|
174
182
|
function showErrorMessage(sMessage) {
|
|
175
|
-
oResourceBundlePromise.then(function(
|
|
176
|
-
var errorMessage = sMessage ||
|
|
183
|
+
oResourceBundlePromise.then(function(oResourceBundle) {
|
|
184
|
+
var errorMessage = sMessage || oResourceBundle.getText('PROGRESS_ERROR_DEFAULT');
|
|
177
185
|
|
|
178
186
|
// Replace technical error message in case of "out of memory"
|
|
179
187
|
if (sMessage.toLowerCase().indexOf('invalid string length') > -1) {
|
|
180
|
-
errorMessage =
|
|
188
|
+
errorMessage = oResourceBundle.getText('MSG_ERROR_OUT_OF_MEMORY');
|
|
181
189
|
}
|
|
182
190
|
|
|
183
|
-
MessageBox.error(
|
|
184
|
-
title :
|
|
191
|
+
MessageBox.error(oResourceBundle.getText("PROGRESS_ERROR_MSG") + "\n\n" + errorMessage, {
|
|
192
|
+
title : oResourceBundle.getText("PROGRESS_ERROR_TITLE")
|
|
185
193
|
});
|
|
186
194
|
});
|
|
187
195
|
}
|