@sapui5/sap.ui.export 1.129.0 → 1.130.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 +1 -1
- package/src/sap/ui/export/ExportBase.js +1 -1
- package/src/sap/ui/export/ExportHandler.js +294 -319
- package/src/sap/ui/export/ExportUtils.js +107 -106
- package/src/sap/ui/export/PortableDocument.js +175 -167
- package/src/sap/ui/export/Spreadsheet.js +3 -3
- package/src/sap/ui/export/SpreadsheetExport.js +1 -1
- package/src/sap/ui/export/fragments/SettingsDialog.fragment.xml +2 -2
- package/src/sap/ui/export/library.js +2 -2
- package/src/sap/ui/export/messagebundle_da.properties +1 -1
- package/src/sap/ui/export/messagebundle_ru.properties +1 -1
- package/src/sap/ui/export/provider/DataProviderBase.js +22 -2
- package/src/sap/ui/export/util/Filter.js +1 -1
- package/src/sap/ui/export/util/PDFCapabilities.js +4 -2
|
@@ -37,15 +37,14 @@ sap.ui.define([
|
|
|
37
37
|
const Destination = library.Destination;
|
|
38
38
|
const MessageMode = coreLibrary.InvisibleMessageMode;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
let uiVersion = null;
|
|
41
|
+
let oDefaultFormatSettings = null;
|
|
42
42
|
|
|
43
43
|
/* Async call to resource bundle */
|
|
44
|
-
|
|
44
|
+
let oResourceBundle;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var UNSUPPORTED_SHEETNAME_CHARACTERS_REGEX = /[\\\/\?\*:\[\]]/g;
|
|
46
|
+
const CLASS_NAME = "sap.ui.export.ExportUtils";
|
|
47
|
+
const UNSUPPORTED_SHEETNAME_CHARACTERS_REGEX = /[\\\/\?\*:\[\]]/g;
|
|
49
48
|
|
|
50
49
|
/*
|
|
51
50
|
* Trigger loading of sap-ui-version.json during initialization,
|
|
@@ -53,7 +52,7 @@ sap.ui.define([
|
|
|
53
52
|
* when the variable is accessed, it is most likely the case.
|
|
54
53
|
*/
|
|
55
54
|
VersionInfo.load().then(function(oVersionInfo) {
|
|
56
|
-
|
|
55
|
+
const aMatch = /^[0-9]+\.[0-9]+/.exec(oVersionInfo.version);
|
|
57
56
|
|
|
58
57
|
uiVersion = aMatch ? aMatch[0] : null;
|
|
59
58
|
});
|
|
@@ -69,9 +68,9 @@ sap.ui.define([
|
|
|
69
68
|
|
|
70
69
|
/* Returns the Export Settings used by the User Settings Dialog */
|
|
71
70
|
function getDefaultSettings(oCustomConfig, oResourceBundle, oExportCapabilities, bRemoteDestination) {
|
|
72
|
-
|
|
71
|
+
const aSupportedFormats = Object.keys(oExportCapabilities);
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
const oDefaultConfig = {
|
|
75
74
|
fileName: "Standard",
|
|
76
75
|
fileTypeCollection: [],
|
|
77
76
|
fileType: "XLSX",
|
|
@@ -103,10 +102,8 @@ sap.ui.define([
|
|
|
103
102
|
};
|
|
104
103
|
|
|
105
104
|
aSupportedFormats.forEach(function(sFormat) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
sFileType = sFormat.toUpperCase();
|
|
109
|
-
sResourceBundleKey = `${sFileType}_FILETYPE`;
|
|
105
|
+
const sFileType = sFormat.toUpperCase();
|
|
106
|
+
const sResourceBundleKey = `${sFileType}_FILETYPE`;
|
|
110
107
|
|
|
111
108
|
oDefaultConfig.fileTypeCollection.push({
|
|
112
109
|
key: sFileType,
|
|
@@ -121,7 +118,7 @@ sap.ui.define([
|
|
|
121
118
|
});
|
|
122
119
|
}
|
|
123
120
|
|
|
124
|
-
|
|
121
|
+
const oExportConfig = Object.assign({}, oDefaultConfig, oCustomConfig || {});
|
|
125
122
|
|
|
126
123
|
/* Select first element if selected key is unavailable */
|
|
127
124
|
if (!oExportConfig.fileTypeCollection.some(function(oEntry) {
|
|
@@ -134,7 +131,7 @@ sap.ui.define([
|
|
|
134
131
|
}
|
|
135
132
|
|
|
136
133
|
function processExportSettings(oSettings) {
|
|
137
|
-
|
|
134
|
+
const oFinalSettings = {};
|
|
138
135
|
|
|
139
136
|
["fileName", "fileType", "paperSize", "orientation", "splitCells", "includeFilterSettings", "addDateTime", "doEnableAccessibility", "fitToPage", "fontSize", "signature", "signatureReason", "pdfArchive", "destination", "showPageNumber"].forEach(function(sProperty) {
|
|
140
137
|
oFinalSettings[sProperty] = oSettings[sProperty];
|
|
@@ -147,14 +144,14 @@ sap.ui.define([
|
|
|
147
144
|
* @class Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
148
145
|
*
|
|
149
146
|
* @author SAP SE
|
|
150
|
-
* @version 1.
|
|
147
|
+
* @version 1.130.0
|
|
151
148
|
*
|
|
152
149
|
* @since 1.59
|
|
153
150
|
* @alias sap.ui.export.ExportUtils
|
|
154
151
|
* @private
|
|
155
152
|
* @ui5-restricted sap.ui.comp.smarttable.SmartTable
|
|
156
153
|
*/
|
|
157
|
-
|
|
154
|
+
const Utils = {
|
|
158
155
|
|
|
159
156
|
_INTERCEPTSERVICE: "sap/ushell/cloudServices/interceptor/InterceptService",
|
|
160
157
|
/**
|
|
@@ -170,9 +167,10 @@ sap.ui.define([
|
|
|
170
167
|
interceptUrl: function(sUrl) {
|
|
171
168
|
// Check if cloud InterceptService exists (for destination routing) - See JIRA: FIORITECHP1-8941
|
|
172
169
|
// This is necessary for cloud instances e.g. SAP CP, due to some destination routing that is not known by UI5 model/client!
|
|
173
|
-
|
|
170
|
+
const InterceptService = sap.ui.require(Utils._INTERCEPTSERVICE);
|
|
174
171
|
if (InterceptService) {
|
|
175
|
-
|
|
172
|
+
const oInterceptService = InterceptService.getInstance();
|
|
173
|
+
|
|
176
174
|
if (oInterceptService && oInterceptService.interceptUrl) {
|
|
177
175
|
sUrl = oInterceptService.interceptUrl(sUrl);
|
|
178
176
|
}
|
|
@@ -194,13 +192,11 @@ sap.ui.define([
|
|
|
194
192
|
* @public
|
|
195
193
|
*/
|
|
196
194
|
fetchDataSource: function() {
|
|
197
|
-
var sFileShareSupportModuleName;
|
|
198
|
-
|
|
199
195
|
if (Utils._oDataSource) {
|
|
200
196
|
return Promise.resolve(Utils._oDataSource);
|
|
201
197
|
}
|
|
202
198
|
|
|
203
|
-
sFileShareSupportModuleName = BaseConfig.get({
|
|
199
|
+
const sFileShareSupportModuleName = BaseConfig.get({
|
|
204
200
|
name: "sapUiFileShareSupport",
|
|
205
201
|
type: BaseConfig.Type.String,
|
|
206
202
|
defaultValue: undefined
|
|
@@ -250,8 +246,12 @@ sap.ui.define([
|
|
|
250
246
|
* @private
|
|
251
247
|
*/
|
|
252
248
|
getExportSettingsViaDialog: function(mCustomConfig, oExportCapabilities, bRemoteDestination, oOpener, fnCallback) {
|
|
249
|
+
function isPDFFileShareExportEnabled() {
|
|
250
|
+
return document.location.search.includes("sap-ui-xx-pdfFileShareExport=true") && oExportCapabilities?.PDF?.UploadToFileShare;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
253
|
return new Promise(function (fnResolve, fnReject) {
|
|
254
|
-
|
|
254
|
+
let oExportSettingsDialog;
|
|
255
255
|
|
|
256
256
|
// Shift optional arguments
|
|
257
257
|
if (typeof bRemoteDestination === "object") {
|
|
@@ -266,12 +266,13 @@ sap.ui.define([
|
|
|
266
266
|
oOpener = null;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
Utils.getResourceBundle().then(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
269
|
+
Utils.getResourceBundle().then((oResourceBundle) => {
|
|
270
|
+
const oExportConfigModel = new JSONModel();
|
|
271
|
+
|
|
272
|
+
function fnSetSemanticStepName (oExportConfigModel, oExportButton) {
|
|
273
|
+
const sDestination = oExportConfigModel.getProperty("/destination");
|
|
274
|
+
const sFileType = oExportConfigModel.getProperty("/fileType");
|
|
275
|
+
let sStepName = "OI:EXP:";
|
|
275
276
|
|
|
276
277
|
sStepName += sDestination === Destination.REMOTE ? "CL:" : "LOC:";
|
|
277
278
|
|
|
@@ -290,7 +291,7 @@ sap.ui.define([
|
|
|
290
291
|
}
|
|
291
292
|
|
|
292
293
|
FESRHelper.setSemanticStepname(oExportButton, "press", sStepName);
|
|
293
|
-
}
|
|
294
|
+
}
|
|
294
295
|
|
|
295
296
|
oExportConfigModel.setData(getDefaultSettings(mCustomConfig, oResourceBundle, oExportCapabilities, bRemoteDestination));
|
|
296
297
|
|
|
@@ -305,7 +306,8 @@ sap.ui.define([
|
|
|
305
306
|
return sValue === FileType.XLSX || sValue === FileType.GSHEET;
|
|
306
307
|
},
|
|
307
308
|
isDestinationEnabled: function(sFileType) {
|
|
308
|
-
|
|
309
|
+
// URL Parameter dependend activation of PDF File Share Export
|
|
310
|
+
return isPDFFileShareExportEnabled() ? sFileType !== FileType.GSHEET : sFileType === FileType.XLSX;
|
|
309
311
|
},
|
|
310
312
|
hasDestinations: function(aDestinationCollection) {
|
|
311
313
|
return aDestinationCollection.length > 1;
|
|
@@ -328,11 +330,12 @@ sap.ui.define([
|
|
|
328
330
|
* @param {sap.ui.base.Event} oEvent LiveChange event of the Input control
|
|
329
331
|
*/
|
|
330
332
|
onFileNameChange: function(oEvent) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
const oInput = oEvent.getSource();
|
|
334
|
+
const sFileName = oEvent.getParameter("value");
|
|
335
|
+
const oRegEx = /[\\/:|?"*<>]/;
|
|
336
|
+
const oExportBtn = Element.getElementById("exportSettingsDialog-exportButton");
|
|
337
|
+
const bValidate = oRegEx.test(sFileName);
|
|
338
|
+
|
|
336
339
|
if (bValidate) {
|
|
337
340
|
oInput.setValueState(ValueState.Error);
|
|
338
341
|
oInput.setValueStateText(oResourceBundle.getText("FILENAME_ERROR"));
|
|
@@ -346,7 +349,7 @@ sap.ui.define([
|
|
|
346
349
|
oExportBtn.setEnabled(!bValidate);
|
|
347
350
|
},
|
|
348
351
|
onFileTypeChange: function(oEvent) {
|
|
349
|
-
|
|
352
|
+
const oSelectedItem = oEvent.getParameter("selectedItem");
|
|
350
353
|
|
|
351
354
|
if (!oSelectedItem) {
|
|
352
355
|
return;
|
|
@@ -354,8 +357,12 @@ sap.ui.define([
|
|
|
354
357
|
|
|
355
358
|
switch (oSelectedItem.getKey()) {
|
|
356
359
|
case FileType.PDF:
|
|
360
|
+
// URL Parameter dependend activation of PDF File Share Export
|
|
361
|
+
if (!isPDFFileShareExportEnabled()) {
|
|
362
|
+
oExportConfigModel.setProperty("/destination", Destination.LOCAL);
|
|
363
|
+
}
|
|
364
|
+
|
|
357
365
|
oExportConfigModel.setProperty("/includeFilterSettings", false);
|
|
358
|
-
oExportConfigModel.setProperty("/destination", Destination.LOCAL);
|
|
359
366
|
fnSetSemanticStepName(oExportConfigModel, oExportSettingsDialog.getBeginButton());
|
|
360
367
|
break;
|
|
361
368
|
case FileType.GSHEET:
|
|
@@ -377,11 +384,12 @@ sap.ui.define([
|
|
|
377
384
|
},
|
|
378
385
|
onFontSizeChange: function(oEvent) {
|
|
379
386
|
// user input validation for font size
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
387
|
+
const oInput = oEvent.getSource();
|
|
388
|
+
const sFontValue = oEvent.getParameter("value");
|
|
389
|
+
const oRegEx = /[^\d]/g;
|
|
390
|
+
const oExportBtn = Element.getElementById("exportSettingsDialog-exportButton");
|
|
391
|
+
const bValidate = oRegEx.test(sFontValue);
|
|
392
|
+
|
|
385
393
|
if (bValidate) {
|
|
386
394
|
oInput.setValueState(ValueState.Error);
|
|
387
395
|
oInput.setValueStateText(oResourceBundle.getText("NUMBER_ERROR"));
|
|
@@ -506,7 +514,7 @@ sap.ui.define([
|
|
|
506
514
|
* @private
|
|
507
515
|
*/
|
|
508
516
|
_parseLogical: function(oLogicalFilter) {
|
|
509
|
-
|
|
517
|
+
let aFilters;
|
|
510
518
|
|
|
511
519
|
try {
|
|
512
520
|
/*
|
|
@@ -557,7 +565,7 @@ sap.ui.define([
|
|
|
557
565
|
|
|
558
566
|
/* Group logical OR filter on the same property */
|
|
559
567
|
if (oLogicalFilter.op === "||" && aFilters.length) {
|
|
560
|
-
sProperty = aFilters[0].key;
|
|
568
|
+
const sProperty = aFilters[0].key;
|
|
561
569
|
|
|
562
570
|
if (aFilters.every(function(item) { return item.key === sProperty; })) {
|
|
563
571
|
aFilters = [
|
|
@@ -616,13 +624,11 @@ sap.ui.define([
|
|
|
616
624
|
* @private
|
|
617
625
|
*/
|
|
618
626
|
_parseUnary: function(oUnaryFilter) {
|
|
619
|
-
var result;
|
|
620
|
-
|
|
621
627
|
if (!oUnaryFilter.arg) {
|
|
622
628
|
return [];
|
|
623
629
|
}
|
|
624
630
|
|
|
625
|
-
result = Utils._parseFilter(oUnaryFilter.arg);
|
|
631
|
+
const result = Utils._parseFilter(oUnaryFilter.arg);
|
|
626
632
|
|
|
627
633
|
if (oUnaryFilter.op === "!" && result[0].value) {
|
|
628
634
|
result[0].value.exclude = true;
|
|
@@ -688,16 +694,14 @@ sap.ui.define([
|
|
|
688
694
|
* @private
|
|
689
695
|
*/
|
|
690
696
|
getFilters: function(oBinding) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
aFilters = [];
|
|
697
|
+
const aFilters = [];
|
|
694
698
|
|
|
695
699
|
if (!oBinding || !oBinding.isA(["sap.ui.model.ListBinding", "sap.ui.model.TreeBinding"])) {
|
|
696
700
|
Log.error("A ListBinding or TreeBinding is required for parsing the filter settings");
|
|
697
701
|
return aFilters;
|
|
698
702
|
}
|
|
699
703
|
|
|
700
|
-
oFilterInfo = oBinding.getFilterInfo();
|
|
704
|
+
const oFilterInfo = oBinding.getFilterInfo();
|
|
701
705
|
if (oFilterInfo) {
|
|
702
706
|
Utils._parseFilter(oFilterInfo).forEach(function(oEntry) {
|
|
703
707
|
aFilters.push(new Filter(oEntry.key, oEntry.value));
|
|
@@ -758,17 +762,16 @@ sap.ui.define([
|
|
|
758
762
|
* @public
|
|
759
763
|
*/
|
|
760
764
|
saveAsFile: function(oBlob, sFilename) {
|
|
761
|
-
|
|
765
|
+
let fnSave;
|
|
762
766
|
|
|
763
767
|
/* Ignore other formats than Blob */
|
|
764
768
|
if (!(oBlob instanceof Blob)) {
|
|
765
769
|
return;
|
|
766
770
|
}
|
|
767
771
|
|
|
768
|
-
link = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
|
|
769
|
-
downloadSupported = "download" in link;
|
|
772
|
+
const link = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
|
|
773
|
+
const downloadSupported = "download" in link;
|
|
770
774
|
|
|
771
|
-
/* Try ObjectURL Chrome, Firefox, Opera, Android, Safari (MacOS 10.1, iOS 13) */
|
|
772
775
|
if (downloadSupported) {
|
|
773
776
|
fnSave = function(data, fileName) {
|
|
774
777
|
link.download = fileName;
|
|
@@ -777,16 +780,14 @@ sap.ui.define([
|
|
|
777
780
|
};
|
|
778
781
|
}
|
|
779
782
|
|
|
780
|
-
/* In case of iOS Safari, MacOS Safari (legacy) */
|
|
783
|
+
/* In case of pre iOS 13 Safari, MacOS Safari (legacy) */
|
|
781
784
|
if (typeof fnSave === "undefined") {
|
|
782
785
|
fnSave = function(data) {
|
|
783
|
-
|
|
786
|
+
const reader = new FileReader();
|
|
784
787
|
|
|
785
788
|
reader.onloadend = function() {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
url = reader.result.replace(/^data:[^;]*;/, "data:attachment/file;");
|
|
789
|
-
opened = openWindow(url, "_blank");
|
|
789
|
+
const url = reader.result.replace(/^data:[^;]*;/, "data:attachment/file;");
|
|
790
|
+
const opened = openWindow(url, "_blank");
|
|
790
791
|
|
|
791
792
|
if (!opened) {
|
|
792
793
|
window.location.href = url;
|
|
@@ -868,10 +869,9 @@ sap.ui.define([
|
|
|
868
869
|
* @private
|
|
869
870
|
*/
|
|
870
871
|
validateFileName: function(sName, sType) {
|
|
871
|
-
|
|
872
|
+
const sExtension = "." + sType.toLowerCase();
|
|
872
873
|
|
|
873
874
|
sName = sName || "export";
|
|
874
|
-
sExtension = "." + sType.toLowerCase();
|
|
875
875
|
|
|
876
876
|
if (!sName.endsWith(sExtension) && sType !== FileType.GSHEET) {
|
|
877
877
|
sName += sExtension;
|
|
@@ -898,8 +898,6 @@ sap.ui.define([
|
|
|
898
898
|
* @private
|
|
899
899
|
*/
|
|
900
900
|
_validateDataSource: function(mDataSource) {
|
|
901
|
-
var iSizeLimit;
|
|
902
|
-
|
|
903
901
|
if (!mDataSource || typeof mDataSource !== "object") {
|
|
904
902
|
throw new Error(`${CLASS_NAME}: dataSource has not been specified`);
|
|
905
903
|
}
|
|
@@ -955,10 +953,10 @@ sap.ui.define([
|
|
|
955
953
|
}
|
|
956
954
|
}
|
|
957
955
|
|
|
958
|
-
iSizeLimit = mDataSource.sizeLimit;
|
|
956
|
+
let iSizeLimit = mDataSource.sizeLimit;
|
|
959
957
|
if (!iSizeLimit || isNaN(iSizeLimit) || iSizeLimit % 1 !== 0) {
|
|
960
|
-
|
|
961
|
-
|
|
958
|
+
const iMaxSize = 5000;
|
|
959
|
+
const iMinSize = 200;
|
|
962
960
|
|
|
963
961
|
// Try to load data in 5 steps, but each step should be at least 200 rows
|
|
964
962
|
iSizeLimit = mDataSource.count ? Math.round(mDataSource.count / (iMinSize * 5)) * iMinSize : iMinSize;
|
|
@@ -988,8 +986,6 @@ sap.ui.define([
|
|
|
988
986
|
|
|
989
987
|
/* Eliminate incorrect column definitions */
|
|
990
988
|
mWorkbook.columns = mWorkbook.columns.filter(function(oColumn, iIndex) {
|
|
991
|
-
var iWidth;
|
|
992
|
-
|
|
993
989
|
if (!(oColumn instanceof Object)) {
|
|
994
990
|
Log.error(`${CLASS_NAME}: Column ${iIndex} skipped due to invalid configuration`);
|
|
995
991
|
return false;
|
|
@@ -1011,12 +1007,11 @@ sap.ui.define([
|
|
|
1011
1007
|
oColumn.label = oColumn.label || (oColumn.property instanceof Array ? oColumn.property[0] : oColumn.property);
|
|
1012
1008
|
|
|
1013
1009
|
/* Column width calculation */
|
|
1014
|
-
iWidth = oColumn.width;
|
|
1010
|
+
let iWidth = oColumn.width;
|
|
1015
1011
|
|
|
1016
1012
|
if (typeof iWidth === "string") {
|
|
1017
|
-
|
|
1013
|
+
const sWidth = iWidth.toLowerCase();
|
|
1018
1014
|
|
|
1019
|
-
sWidth = iWidth.toLowerCase();
|
|
1020
1015
|
iWidth = parseFloat(sWidth);
|
|
1021
1016
|
|
|
1022
1017
|
/*
|
|
@@ -1045,18 +1040,15 @@ sap.ui.define([
|
|
|
1045
1040
|
|
|
1046
1041
|
oColumn.width = Math.round(iWidth);
|
|
1047
1042
|
|
|
1048
|
-
/* Type validation */
|
|
1049
1043
|
Utils._validateType(oColumn, iIndex);
|
|
1050
|
-
|
|
1051
|
-
/* TextAlign validation */
|
|
1052
1044
|
Utils._validateString(oColumn, "textAlign");
|
|
1053
1045
|
|
|
1054
1046
|
if (oColumn.textAlign) {
|
|
1055
|
-
|
|
1047
|
+
let textAlign = String(oColumn.textAlign).toLowerCase();
|
|
1056
1048
|
|
|
1057
1049
|
/* Map the values begin & end according to RTL */
|
|
1058
1050
|
if (["begin", "end"].indexOf(textAlign) > -1) {
|
|
1059
|
-
|
|
1051
|
+
const mappedAlignment = ["left", "right"];
|
|
1060
1052
|
|
|
1061
1053
|
textAlign = (Localization.getRTL() ? mappedAlignment.reverse() : mappedAlignment)[["begin", "end"].indexOf(textAlign)];
|
|
1062
1054
|
}
|
|
@@ -1130,17 +1122,17 @@ sap.ui.define([
|
|
|
1130
1122
|
}
|
|
1131
1123
|
|
|
1132
1124
|
/* Validate scale property */
|
|
1133
|
-
|
|
1134
|
-
if (oColumn.type === EdmType.Number && isNaN(
|
|
1125
|
+
let iScale = oColumn.scale;
|
|
1126
|
+
if (oColumn.type === EdmType.Number && isNaN(iScale) && iScale !== "variable") {
|
|
1135
1127
|
Log.warning(`${CLASS_NAME}: scale parameter for numerical column configuration is missing.`);
|
|
1136
1128
|
}
|
|
1137
|
-
if (typeof
|
|
1138
|
-
|
|
1129
|
+
if (typeof iScale === "string") {
|
|
1130
|
+
iScale = parseInt(iScale);
|
|
1139
1131
|
}
|
|
1140
|
-
if (isNaN(
|
|
1141
|
-
|
|
1132
|
+
if (isNaN(iScale)) {
|
|
1133
|
+
iScale = null;
|
|
1142
1134
|
}
|
|
1143
|
-
oColumn.scale =
|
|
1135
|
+
oColumn.scale = iScale;
|
|
1144
1136
|
|
|
1145
1137
|
/* Validate valueMap property */
|
|
1146
1138
|
if (oColumn.valueMap && typeof oColumn.valueMap !== "object") {
|
|
@@ -1166,18 +1158,16 @@ sap.ui.define([
|
|
|
1166
1158
|
* @private
|
|
1167
1159
|
*/
|
|
1168
1160
|
_validateType: function(oColumn) {
|
|
1169
|
-
var sType, sFixedType;
|
|
1170
|
-
|
|
1171
1161
|
if (typeof oColumn.type !== "string") {
|
|
1172
1162
|
oColumn.type = EdmType.String;
|
|
1173
1163
|
return;
|
|
1174
1164
|
}
|
|
1175
1165
|
|
|
1176
1166
|
if (!EdmType[oColumn.type]) {
|
|
1177
|
-
sFixedType = EdmType.String;
|
|
1167
|
+
let sFixedType = EdmType.String;
|
|
1178
1168
|
|
|
1179
1169
|
/* Fix type for case insensitive match */
|
|
1180
|
-
for (sType in EdmType) {
|
|
1170
|
+
for (const sType in EdmType) {
|
|
1181
1171
|
if (sType.toLowerCase() == oColumn.type.toLowerCase()) {
|
|
1182
1172
|
sFixedType = sType;
|
|
1183
1173
|
}
|
|
@@ -1228,7 +1218,7 @@ sap.ui.define([
|
|
|
1228
1218
|
*
|
|
1229
1219
|
* @param {object} oContext Context object
|
|
1230
1220
|
* @param {string} [oContext.application] Name of the application (default: "SAP UI5")
|
|
1231
|
-
* @param {string} [oContext.version] Application version (default: "1.
|
|
1221
|
+
* @param {string} [oContext.version] Application version (default: "1.130.0")
|
|
1232
1222
|
* @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
|
|
1233
1223
|
* @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
|
|
1234
1224
|
* @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
|
|
@@ -1282,11 +1272,9 @@ sap.ui.define([
|
|
|
1282
1272
|
* @private
|
|
1283
1273
|
*/
|
|
1284
1274
|
_validateString: function(oContext, sProperty, sDefaultValue, iMaxLength, sRemove) {
|
|
1285
|
-
var sValue;
|
|
1286
|
-
|
|
1287
1275
|
Utils._validateProperty(oContext, sProperty, "string", sDefaultValue);
|
|
1288
1276
|
|
|
1289
|
-
sValue = oContext[sProperty];
|
|
1277
|
+
let sValue = oContext[sProperty];
|
|
1290
1278
|
|
|
1291
1279
|
if (typeof sValue === "string" && (typeof sRemove === "string" || sRemove instanceof RegExp)) {
|
|
1292
1280
|
sValue = sValue.replace(sRemove, "");
|
|
@@ -1314,7 +1302,7 @@ sap.ui.define([
|
|
|
1314
1302
|
* @private
|
|
1315
1303
|
*/
|
|
1316
1304
|
_validateProperty: function(oContext, sProperty, sType, defaultValue) {
|
|
1317
|
-
|
|
1305
|
+
let value = oContext[sProperty];
|
|
1318
1306
|
|
|
1319
1307
|
// eslint-disable-next-line valid-typeof
|
|
1320
1308
|
if (value != null && typeof value !== sType) {
|
|
@@ -1346,19 +1334,17 @@ sap.ui.define([
|
|
|
1346
1334
|
* @private
|
|
1347
1335
|
*/
|
|
1348
1336
|
_validateScaleCustomizing: function(oCustomizing, sProperty) {
|
|
1349
|
-
var sKey, mScaleSettings;
|
|
1350
|
-
|
|
1351
1337
|
if (!oCustomizing) {
|
|
1352
1338
|
return;
|
|
1353
1339
|
}
|
|
1354
1340
|
|
|
1355
|
-
mScaleSettings = oCustomizing[sProperty];
|
|
1341
|
+
const mScaleSettings = oCustomizing[sProperty];
|
|
1356
1342
|
|
|
1357
1343
|
if (!(mScaleSettings instanceof Object) || Array.isArray(mScaleSettings)) {
|
|
1358
1344
|
Log.warning(`${CLASS_NAME}: Invalid scale customizing for ${sProperty}.`);
|
|
1359
1345
|
oCustomizing[sProperty] = {};
|
|
1360
1346
|
} else {
|
|
1361
|
-
for (sKey in mScaleSettings) {
|
|
1347
|
+
for (const sKey in mScaleSettings) {
|
|
1362
1348
|
if (!(mScaleSettings[sKey] instanceof Object)) {
|
|
1363
1349
|
Log.warning(`${CLASS_NAME}: Key ${sKey} has been removed from customizing`);
|
|
1364
1350
|
delete mScaleSettings[sKey];
|
|
@@ -1377,17 +1363,18 @@ sap.ui.define([
|
|
|
1377
1363
|
*
|
|
1378
1364
|
* @param {object} mSettings Export configuration with optional FileType
|
|
1379
1365
|
* @param {object} [mCapabilities] Export capabilities for all supported types
|
|
1366
|
+
* @param {object} [mCloudFileInfo] Information about the file that is stored in the remote FileShare
|
|
1380
1367
|
* @returns {Promise<sap.ui.export.ExportBase>} A Promise that gets resolved with the requested instance
|
|
1381
1368
|
*
|
|
1382
1369
|
* @static
|
|
1383
1370
|
* @since 1.112
|
|
1384
1371
|
* @public
|
|
1385
1372
|
*/
|
|
1386
|
-
getExportInstance: function(mSettings, mCapabilities) {
|
|
1387
|
-
|
|
1373
|
+
getExportInstance: function(mSettings, mCapabilities, mCloudFileInfo) {
|
|
1374
|
+
const sFileType = typeof mSettings.fileType === "string" ? mSettings.fileType.toUpperCase() : mSettings.fileType;
|
|
1375
|
+
let sClassName;
|
|
1388
1376
|
|
|
1389
1377
|
mCapabilities = mCapabilities ? mCapabilities : {};
|
|
1390
|
-
sFileType = typeof mSettings.fileType === "string" ? mSettings.fileType.toUpperCase() : mSettings.fileType;
|
|
1391
1378
|
|
|
1392
1379
|
switch (sFileType) {
|
|
1393
1380
|
case FileType.PDF:
|
|
@@ -1399,7 +1386,7 @@ sap.ui.define([
|
|
|
1399
1386
|
|
|
1400
1387
|
return new Promise(function(fnResolve) {
|
|
1401
1388
|
sap.ui.require([sClassName], function(ExportClass) {
|
|
1402
|
-
fnResolve(new ExportClass(mSettings, mCapabilities[sFileType]));
|
|
1389
|
+
fnResolve(new ExportClass(mSettings, mCapabilities[sFileType], mCloudFileInfo));
|
|
1403
1390
|
});
|
|
1404
1391
|
});
|
|
1405
1392
|
},
|
|
@@ -1415,7 +1402,7 @@ sap.ui.define([
|
|
|
1415
1402
|
* @private
|
|
1416
1403
|
*/
|
|
1417
1404
|
getCountFromBinding: function(oBinding) {
|
|
1418
|
-
|
|
1405
|
+
let iCount;
|
|
1419
1406
|
|
|
1420
1407
|
if (typeof oBinding.getCount === "function") {
|
|
1421
1408
|
iCount = oBinding.getCount();
|
|
@@ -1500,7 +1487,7 @@ sap.ui.define([
|
|
|
1500
1487
|
* @private
|
|
1501
1488
|
*/
|
|
1502
1489
|
splitColumns: function(aColumns, fnResolveColumnLabel) {
|
|
1503
|
-
|
|
1490
|
+
const aResult = [];
|
|
1504
1491
|
|
|
1505
1492
|
/* Assign dummy function to prevent multiple typeof checks */
|
|
1506
1493
|
if (typeof fnResolveColumnLabel !== "function") {
|
|
@@ -1508,7 +1495,7 @@ sap.ui.define([
|
|
|
1508
1495
|
}
|
|
1509
1496
|
|
|
1510
1497
|
aColumns.forEach(function(oColumn) {
|
|
1511
|
-
|
|
1498
|
+
let aSplittedColumns, oUpdatedColumn, oAdditionalColumn, sColumnLabel;
|
|
1512
1499
|
|
|
1513
1500
|
/* Split EdmType.String columns with multiple properties */
|
|
1514
1501
|
if (Array.isArray(oColumn.property) && oColumn.property.length > 1) {
|
|
@@ -1663,6 +1650,20 @@ sap.ui.define([
|
|
|
1663
1650
|
|
|
1664
1651
|
const sMessage = oBundle.getText(`MSG_INFO_EXPORT_${sExportStatus}`, oConfig?.values);
|
|
1665
1652
|
oInvisibleMessage.announce(sMessage, oConfig?.assertive ? MessageMode.Assertive : MessageMode.Polite);
|
|
1653
|
+
},
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* Loads the desired class asynchronously
|
|
1657
|
+
*
|
|
1658
|
+
* @param {string} sClassName Full qualified class name
|
|
1659
|
+
* @returns {Promise} Promise that resolves with Class reference
|
|
1660
|
+
* @static
|
|
1661
|
+
* @private
|
|
1662
|
+
*/
|
|
1663
|
+
loadClass: function(sClassName) {
|
|
1664
|
+
return new Promise((fnResolve) => {
|
|
1665
|
+
sap.ui.require([sClassName], fnResolve);
|
|
1666
|
+
});
|
|
1666
1667
|
}
|
|
1667
1668
|
};
|
|
1668
1669
|
|