@sapui5/sap.ui.export 1.103.0 → 1.105.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 +10 -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 +30 -4
- package/src/sap/ui/export/ExportUtils.js +172 -40
- 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/fragments/SettingsDialog.fragment.xml +1 -1
- 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 +4 -4
- package/src/sap/ui/export/messagebundle.properties +12 -0
- package/src/sap/ui/export/messagebundle_ar.properties +8 -0
- package/src/sap/ui/export/messagebundle_bg.properties +8 -0
- package/src/sap/ui/export/messagebundle_ca.properties +9 -1
- package/src/sap/ui/export/messagebundle_cs.properties +8 -0
- package/src/sap/ui/export/messagebundle_cy.properties +9 -1
- package/src/sap/ui/export/messagebundle_da.properties +8 -0
- package/src/sap/ui/export/messagebundle_de.properties +8 -0
- package/src/sap/ui/export/messagebundle_el.properties +9 -1
- package/src/sap/ui/export/messagebundle_en.properties +9 -1
- package/src/sap/ui/export/messagebundle_en_GB.properties +9 -1
- package/src/sap/ui/export/messagebundle_en_US_sappsd.properties +8 -0
- package/src/sap/ui/export/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/export/messagebundle_en_US_saptrc.properties +8 -0
- package/src/sap/ui/export/messagebundle_es.properties +8 -0
- package/src/sap/ui/export/messagebundle_es_MX.properties +8 -0
- package/src/sap/ui/export/messagebundle_et.properties +8 -0
- package/src/sap/ui/export/messagebundle_fi.properties +8 -0
- package/src/sap/ui/export/messagebundle_fr.properties +8 -0
- package/src/sap/ui/export/messagebundle_fr_CA.properties +9 -1
- package/src/sap/ui/export/messagebundle_hi.properties +8 -0
- package/src/sap/ui/export/messagebundle_hr.properties +8 -0
- package/src/sap/ui/export/messagebundle_hu.properties +8 -0
- package/src/sap/ui/export/messagebundle_id.properties +9 -1
- package/src/sap/ui/export/messagebundle_it.properties +8 -0
- package/src/sap/ui/export/messagebundle_iw.properties +8 -0
- package/src/sap/ui/export/messagebundle_ja.properties +8 -0
- package/src/sap/ui/export/messagebundle_kk.properties +8 -0
- package/src/sap/ui/export/messagebundle_ko.properties +8 -0
- package/src/sap/ui/export/messagebundle_lt.properties +8 -0
- package/src/sap/ui/export/messagebundle_lv.properties +8 -0
- package/src/sap/ui/export/messagebundle_ms.properties +9 -1
- package/src/sap/ui/export/messagebundle_nl.properties +8 -0
- package/src/sap/ui/export/messagebundle_no.properties +8 -0
- package/src/sap/ui/export/messagebundle_pl.properties +8 -0
- package/src/sap/ui/export/messagebundle_pt.properties +8 -0
- package/src/sap/ui/export/messagebundle_pt_PT.properties +8 -0
- package/src/sap/ui/export/messagebundle_ro.properties +8 -0
- package/src/sap/ui/export/messagebundle_ru.properties +8 -0
- package/src/sap/ui/export/messagebundle_sh.properties +8 -0
- package/src/sap/ui/export/messagebundle_sk.properties +8 -0
- package/src/sap/ui/export/messagebundle_sl.properties +8 -0
- package/src/sap/ui/export/messagebundle_sv.properties +8 -0
- package/src/sap/ui/export/messagebundle_th.properties +8 -0
- package/src/sap/ui/export/messagebundle_tr.properties +8 -0
- package/src/sap/ui/export/messagebundle_uk.properties +8 -0
- package/src/sap/ui/export/messagebundle_vi.properties +8 -0
- package/src/sap/ui/export/messagebundle_zh_CN.properties +9 -1
- package/src/sap/ui/export/messagebundle_zh_TW.properties +8 -0
- package/src/sap/ui/export/provider/DataProviderBase.js +4 -2
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.105.0</version>
|
|
9
9
|
|
|
10
10
|
<documentation>UI5 library: sap.ui.export</documentation>
|
|
11
11
|
|
|
@@ -40,6 +40,15 @@
|
|
|
40
40
|
<ownership xmlns="http://www.sap.com/ui5/buildext/ownership">
|
|
41
41
|
<component>CA-UI5-TBL</component><!-- default component for library -->
|
|
42
42
|
</ownership>
|
|
43
|
+
|
|
44
|
+
<thirdparty xmlns="http://www.sap.com/ui5/buildext/thirdparty" >
|
|
45
|
+
<lib name="JSZip3" displayName="JSZip 3.7.1" version="3.7.1" homepage="https://github.com/Stuk/jszip" id="73555000106100074228">
|
|
46
|
+
<license url="https://github.com/Stuk/jszip/blob/main/LICENSE.markdown" type="MIT"/>
|
|
47
|
+
<copyright>2009-2016 Stuart Knightley <stuart [at] stuartk.com></copyright>
|
|
48
|
+
<pattern>sap/ui/export/js/libs/JSZip3.js</pattern>
|
|
49
|
+
</lib>
|
|
50
|
+
</thirdparty>
|
|
51
|
+
|
|
43
52
|
</appData>
|
|
44
53
|
|
|
45
54
|
</library>
|
|
@@ -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.
|
|
30
|
+
* @version 1.105.0
|
|
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.
|
|
18
|
+
* @version 1.105.0
|
|
18
19
|
*
|
|
19
20
|
* @since 1.102
|
|
20
21
|
* @name sap.ui.export.ExportHandler
|
|
@@ -397,13 +398,16 @@ 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;
|
|
404
408
|
|
|
405
|
-
/*
|
|
406
|
-
if (mDialogSettings.splitCells) {
|
|
409
|
+
/* Enforce split cells option for fileType PDF without persisting the value in the settings dialog */
|
|
410
|
+
if (mExportSettings.fileType === FileType.PDF || mDialogSettings.splitCells) {
|
|
407
411
|
mExportSettings.workbook.columns = ExportUtils.splitColumns(mExportSettings.workbook.columns, fnResolveColumnLabel);
|
|
408
412
|
}
|
|
409
413
|
|
|
@@ -423,6 +427,28 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
423
427
|
oContext.metaSheetName = oFilterConfig.name;
|
|
424
428
|
oContext.metainfo = Array.isArray(oContext.metainfo) ? oContext.metainfo.push(oFilterConfig) : [oFilterConfig];
|
|
425
429
|
}
|
|
430
|
+
|
|
431
|
+
if (mExportSettings.includeFilterSettings) {
|
|
432
|
+
return ExportUtils.parseTechnicalConfiguration();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return Promise.resolve();
|
|
436
|
+
}).then(function(aUserConfig) {
|
|
437
|
+
if (aUserConfig) {
|
|
438
|
+
var oContext = mExportSettings.workbook.context;
|
|
439
|
+
|
|
440
|
+
if (!oContext) {
|
|
441
|
+
oContext = mExportSettings.workbook.context = {};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (Array.isArray(oContext.metainfo)) {
|
|
445
|
+
aUserConfig.forEach(function(oUserConfig) {
|
|
446
|
+
oContext.metainfo.unshift(oUserConfig);
|
|
447
|
+
});
|
|
448
|
+
} else {
|
|
449
|
+
oContext.metainfo = aUserConfig;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
426
452
|
}).then(function() {
|
|
427
453
|
if (mExportSettings.destination === Destination.LOCAL) {
|
|
428
454
|
return Promise.resolve();
|
|
@@ -12,8 +12,9 @@ sap.ui.define([
|
|
|
12
12
|
'sap/ui/model/json/JSONModel',
|
|
13
13
|
'sap/ui/model/resource/ResourceModel',
|
|
14
14
|
'sap/ui/util/openWindow',
|
|
15
|
-
'sap/ui/VersionInfo'
|
|
16
|
-
|
|
15
|
+
'sap/ui/VersionInfo',
|
|
16
|
+
'sap/ui/core/format/DateFormat'
|
|
17
|
+
], function(library, Log, Core, Fragment, coreLibrary, syncStyleClass, JSONModel, ResourceModel, openWindow, VersionInfo, DateFormat) {
|
|
17
18
|
'use strict';
|
|
18
19
|
|
|
19
20
|
// eslint-disable-next-line
|
|
@@ -21,10 +22,12 @@ sap.ui.define([
|
|
|
21
22
|
|
|
22
23
|
// Shortcuts
|
|
23
24
|
var ValueState = coreLibrary.ValueState;
|
|
25
|
+
var CalendarType = coreLibrary.CalendarType;
|
|
24
26
|
var FileType = library.FileType;
|
|
25
27
|
var EdmType = library.EdmType;
|
|
26
28
|
var Destination = library.Destination;
|
|
27
29
|
var uiVersion = null;
|
|
30
|
+
var oDefaultFormatSettings = null;
|
|
28
31
|
|
|
29
32
|
/* Async call to resource bundle */
|
|
30
33
|
var oResourceBundle;
|
|
@@ -47,7 +50,6 @@ sap.ui.define([
|
|
|
47
50
|
|
|
48
51
|
/* Returns the Export Settings used by the User Settings Dialog */
|
|
49
52
|
function getDefaultSettings(oCustomConfig, oResourceBundle, oExportCapabilities, bRemoteDestination) {
|
|
50
|
-
var sSelectedKey;
|
|
51
53
|
var aSupportedFormats = Object.keys(oExportCapabilities);
|
|
52
54
|
|
|
53
55
|
var oDefaultConfig = {
|
|
@@ -68,12 +70,12 @@ sap.ui.define([
|
|
|
68
70
|
capabilities: oExportCapabilities,
|
|
69
71
|
fitToPage: false,
|
|
70
72
|
paperSizeCollection: [
|
|
71
|
-
{key:
|
|
72
|
-
{key:
|
|
73
|
+
{key: 'DIN_A4', text: oResourceBundle.getText('PAPER_SIZE_A4')},
|
|
74
|
+
{key: 'US_LETTER', text: oResourceBundle.getText('PAPER_SIZE_US_LETTER')}
|
|
73
75
|
],
|
|
74
76
|
orientationCollection: [
|
|
75
|
-
{key:
|
|
76
|
-
{key:
|
|
77
|
+
{key:'LANDSCAPE', text: oResourceBundle.getText('ORIENTATION_LAND')},
|
|
78
|
+
{key:'PORTRAIT', text: oResourceBundle.getText('ORIENTATION_PORT')}
|
|
77
79
|
],
|
|
78
80
|
fontSize: 10,
|
|
79
81
|
signature: false,
|
|
@@ -81,7 +83,15 @@ sap.ui.define([
|
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
aSupportedFormats.forEach(function(sFormat) {
|
|
84
|
-
|
|
86
|
+
var sFileType, sResourceBundleKey;
|
|
87
|
+
|
|
88
|
+
sFileType = sFormat.toUpperCase();
|
|
89
|
+
sResourceBundleKey = bRemoteDestination && sFileType === FileType.XLSX ? sFileType + '_CLOUD_FILETYPE' : sFileType + '_FILETYPE';
|
|
90
|
+
|
|
91
|
+
oDefaultConfig.fileTypeCollection.push({
|
|
92
|
+
key: sFileType,
|
|
93
|
+
text: oResourceBundle.getText(sResourceBundleKey)
|
|
94
|
+
});
|
|
85
95
|
});
|
|
86
96
|
|
|
87
97
|
if (bRemoteDestination) {
|
|
@@ -93,17 +103,10 @@ sap.ui.define([
|
|
|
93
103
|
|
|
94
104
|
var oExportConfig = Object.assign({}, oDefaultConfig, oCustomConfig || {});
|
|
95
105
|
|
|
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) {
|
|
106
|
+
/* Select first element if selected key is unavailable */
|
|
107
|
+
if (!oExportConfig.fileTypeCollection.some(function(oEntry) {
|
|
108
|
+
return oEntry.key === oExportConfig.fileType;
|
|
109
|
+
})) {
|
|
107
110
|
oExportConfig.fileType = oExportConfig.fileTypeCollection[0].key;
|
|
108
111
|
}
|
|
109
112
|
|
|
@@ -113,7 +116,7 @@ sap.ui.define([
|
|
|
113
116
|
function processExportSettings(oSettings) {
|
|
114
117
|
var oFinalSettings = {};
|
|
115
118
|
|
|
116
|
-
[
|
|
119
|
+
['fileName', 'fileType', 'paperSize', 'orientation', 'splitCells', 'includeFilterSettings', 'addDateTime', 'doEnableAccessibility', 'fitToPage', 'fontSize', 'signature', 'signatureReason', 'pdfArchive', 'destination'].forEach(function(sProperty) {
|
|
117
120
|
oFinalSettings[sProperty] = oSettings[sProperty];
|
|
118
121
|
});
|
|
119
122
|
|
|
@@ -124,7 +127,7 @@ sap.ui.define([
|
|
|
124
127
|
* Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
125
128
|
*
|
|
126
129
|
* @author SAP SE
|
|
127
|
-
* @version 1.
|
|
130
|
+
* @version 1.105.0
|
|
128
131
|
*
|
|
129
132
|
* @since 1.59
|
|
130
133
|
* @name sap.ui.export.ExportUtils
|
|
@@ -135,7 +138,6 @@ sap.ui.define([
|
|
|
135
138
|
var Utils = {
|
|
136
139
|
|
|
137
140
|
_INTERCEPTSERVICE: 'sap/ushell/cloudServices/interceptor/InterceptService',
|
|
138
|
-
|
|
139
141
|
/**
|
|
140
142
|
* Uses the Launchpad Cloud Service to intercept a given URL.
|
|
141
143
|
*
|
|
@@ -219,14 +221,12 @@ sap.ui.define([
|
|
|
219
221
|
return sDestination === Destination.LOCAL ? oResourceBundle.getText('EXPORT_BUTTON') : oResourceBundle.getText('DIALOG_BUTTON_CLOUD_DESTINATION');
|
|
220
222
|
},
|
|
221
223
|
onCancel: function() {
|
|
224
|
+
oExportSettingsDialog._bSuccess = false;
|
|
222
225
|
oExportSettingsDialog.close();
|
|
223
226
|
},
|
|
224
227
|
onExport: function() {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
oExportSettingsDialog.close();
|
|
228
|
-
fnResolve(processExportSettings(oExportConfigModel.getData()));
|
|
229
|
-
}
|
|
228
|
+
oExportSettingsDialog._bSuccess = true;
|
|
229
|
+
oExportSettingsDialog.close();
|
|
230
230
|
},
|
|
231
231
|
|
|
232
232
|
/**
|
|
@@ -255,7 +255,6 @@ sap.ui.define([
|
|
|
255
255
|
onFileTypeChange: function(oEvent) {
|
|
256
256
|
var oSelectedItem = oEvent.getParameter('selectedItem');
|
|
257
257
|
if (oSelectedItem && oSelectedItem.getKey() === FileType.PDF) {
|
|
258
|
-
oExportConfigModel.setProperty('/splitCells', true);
|
|
259
258
|
oExportConfigModel.setProperty('/includeFilterSettings', false);
|
|
260
259
|
oExportConfigModel.setProperty('/destination', Destination.LOCAL);
|
|
261
260
|
} else {
|
|
@@ -280,7 +279,9 @@ sap.ui.define([
|
|
|
280
279
|
oExportBtn.setEnabled(!bValidate);
|
|
281
280
|
},
|
|
282
281
|
onAfterClose: function() {
|
|
283
|
-
if (
|
|
282
|
+
if (oExportSettingsDialog._bSuccess) {
|
|
283
|
+
fnResolve(processExportSettings(oExportConfigModel.getData()));
|
|
284
|
+
} else {
|
|
284
285
|
// Handle Cancel after close when export button was not pressed
|
|
285
286
|
// because a close could also be triggered via Esc
|
|
286
287
|
fnReject(null);
|
|
@@ -569,6 +570,48 @@ sap.ui.define([
|
|
|
569
570
|
});
|
|
570
571
|
},
|
|
571
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Promise, which resolves with an array containing username and
|
|
575
|
+
* time stamp at which the document was created
|
|
576
|
+
*
|
|
577
|
+
* @returns {Promise} Resolves when the technical information has been obtained
|
|
578
|
+
*/
|
|
579
|
+
parseTechnicalConfiguration: function() {
|
|
580
|
+
var aUserConfig, oBundle, oUshellContainer;
|
|
581
|
+
|
|
582
|
+
aUserConfig = [];
|
|
583
|
+
|
|
584
|
+
/* sap/ushell/Container is not available through module loader */
|
|
585
|
+
oUshellContainer = sap.ushell && sap.ushell.Container;
|
|
586
|
+
|
|
587
|
+
return Utils.getResourceBundle().then(function(oResourceBundle) {
|
|
588
|
+
oBundle = oResourceBundle;
|
|
589
|
+
|
|
590
|
+
aUserConfig.push({
|
|
591
|
+
name: oBundle.getText('TECHNICAL_INFORMATION'),
|
|
592
|
+
items: [
|
|
593
|
+
{
|
|
594
|
+
key: oBundle.getText('CREATED_TIME'),
|
|
595
|
+
value: DateFormat.getDateTimeWithTimezoneInstance().format(new Date())
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
});
|
|
599
|
+
}).then(function() {
|
|
600
|
+
return oUshellContainer && typeof oUshellContainer.getServiceAsync === 'function' ?
|
|
601
|
+
oUshellContainer.getServiceAsync('UserInfo') : undefined;
|
|
602
|
+
}).then(function (oUserInfo) {
|
|
603
|
+
/* Add entry if UserInfo contains a proper name */
|
|
604
|
+
if (oUserInfo && oUserInfo.getFullName()) {
|
|
605
|
+
aUserConfig[0].items.unshift({
|
|
606
|
+
key: oBundle.getText('USER_NAME'),
|
|
607
|
+
value: oUserInfo.getFullName()
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
return aUserConfig;
|
|
612
|
+
});
|
|
613
|
+
},
|
|
614
|
+
|
|
572
615
|
/**
|
|
573
616
|
* This function saves the provided Blob to the local file system.
|
|
574
617
|
* The parameter name is optional and depending on the browser it
|
|
@@ -865,6 +908,12 @@ sap.ui.define([
|
|
|
865
908
|
delete oColumn.template;
|
|
866
909
|
}
|
|
867
910
|
|
|
911
|
+
/* Only allow supported calendars */
|
|
912
|
+
if (typeof oColumn.calendar === 'string' && [CalendarType.Gregorian, CalendarType.Islamic, CalendarType.Japanese].indexOf(oColumn.calendar) < 0) {
|
|
913
|
+
Log.warning(CLASS_NAME + ': Unsupported calendar "' + oColumn.calendar + '" on column "' + (oColumn.label || oColumn.property) + '". Value will be discarded.');
|
|
914
|
+
delete oColumn.calendar;
|
|
915
|
+
}
|
|
916
|
+
|
|
868
917
|
/* Validate trueValue & falseValue properties */
|
|
869
918
|
if (oColumn.type === EdmType.Boolean && (oColumn.trueValue === null || oColumn.falseValue === null)) {
|
|
870
919
|
Log.warning(CLASS_NAME + ': The properties trueValue and falseValue have to be assigned correctly on column "' + (oColumn.label || oColumn.property) + '". Values will be discarded.');
|
|
@@ -958,15 +1007,40 @@ sap.ui.define([
|
|
|
958
1007
|
oColumn.type = sFixedType;
|
|
959
1008
|
}
|
|
960
1009
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1010
|
+
switch (oColumn.type) {
|
|
1011
|
+
case EdmType.Date:
|
|
1012
|
+
if (!oColumn.format && !oColumn.calendar) {
|
|
1013
|
+
Utils._validateString(oColumn, 'format', Utils.getFormatSettings().datePattern);
|
|
1014
|
+
Utils._validateString(oColumn, 'calendar', Utils.getFormatSettings().calendar);
|
|
1015
|
+
}
|
|
1016
|
+
break;
|
|
1017
|
+
case EdmType.DateTime:
|
|
1018
|
+
if (!oColumn.format && !oColumn.calendar) {
|
|
1019
|
+
Utils._validateString(oColumn, 'format', Utils.getFormatSettings().dateTimePattern);
|
|
1020
|
+
Utils._validateString(oColumn, 'calendar', Utils.getFormatSettings().calendar);
|
|
1021
|
+
}
|
|
1022
|
+
break;
|
|
1023
|
+
case EdmType.Time:
|
|
1024
|
+
Utils._validateString(oColumn, 'format', Utils.getFormatSettings().timePattern);
|
|
1025
|
+
break;
|
|
1026
|
+
case EdmType.Number:
|
|
1027
|
+
/* Keep default delimiter disabled until scale issue has been resolved */
|
|
1028
|
+
// Utils._validateProperty(oColumn, 'delimiter', 'boolean', Utils.getFormatSettings().delimiter);
|
|
1029
|
+
break;
|
|
1030
|
+
case EdmType.Currency:
|
|
1031
|
+
if (!oColumn.unitProperty) {
|
|
1032
|
+
Log.warning(CLASS_NAME + ': Missing unitProperty for type Currency on column "' + (oColumn.label || oColumn.property) + '". Type is reverted to "String".');
|
|
1033
|
+
oColumn.type = EdmType.String;
|
|
1034
|
+
}
|
|
1035
|
+
break;
|
|
1036
|
+
case EdmType.Enumeration:
|
|
1037
|
+
if (!oColumn.valueMap || typeof oColumn.valueMap !== 'object') {
|
|
1038
|
+
Log.warning(CLASS_NAME + ': Invalid valueMap for type Enumeration on column "' + (oColumn.label || oColumn.property) + '". Type is reverted to "String".');
|
|
1039
|
+
oColumn.type = EdmType.String;
|
|
1040
|
+
}
|
|
1041
|
+
break;
|
|
1042
|
+
default: /* Do nothing */
|
|
968
1043
|
}
|
|
969
|
-
|
|
970
1044
|
},
|
|
971
1045
|
|
|
972
1046
|
/**
|
|
@@ -974,7 +1048,7 @@ sap.ui.define([
|
|
|
974
1048
|
*
|
|
975
1049
|
* @param {object} oContext Context object
|
|
976
1050
|
* @param {string} [oContext.application] Name of the application (default: "SAP UI5")
|
|
977
|
-
* @param {string} [oContext.version] Application version (default: "1.
|
|
1051
|
+
* @param {string} [oContext.version] Application version (default: "1.105.0")
|
|
978
1052
|
* @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
|
|
979
1053
|
* @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
|
|
980
1054
|
* @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
|
|
@@ -1068,7 +1142,15 @@ sap.ui.define([
|
|
|
1068
1142
|
value = null;
|
|
1069
1143
|
}
|
|
1070
1144
|
|
|
1071
|
-
|
|
1145
|
+
if (value == null && typeof defaultValue !== 'undefined') {
|
|
1146
|
+
value = defaultValue;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
if (value == null) {
|
|
1150
|
+
delete oContext[sProperty];
|
|
1151
|
+
} else {
|
|
1152
|
+
oContext[sProperty] = value;
|
|
1153
|
+
}
|
|
1072
1154
|
},
|
|
1073
1155
|
|
|
1074
1156
|
/**
|
|
@@ -1217,7 +1299,7 @@ sap.ui.define([
|
|
|
1217
1299
|
|
|
1218
1300
|
if (oColumn.timezoneProperty && oColumn.displayTimezone !== false) {
|
|
1219
1301
|
oUpdatedColumn = Object.assign({}, oColumn);
|
|
1220
|
-
sColumnLabel = typeof fnResolveColumnLabel === 'function' ? fnResolveColumnLabel(oColumn.
|
|
1302
|
+
sColumnLabel = typeof fnResolveColumnLabel === 'function' ? fnResolveColumnLabel(oColumn.timezoneProperty) : null;
|
|
1221
1303
|
aSplittedColumns = [oUpdatedColumn, {
|
|
1222
1304
|
property: oColumn.timezoneProperty,
|
|
1223
1305
|
label: sColumnLabel || oColumn.label + ' (1)'
|
|
@@ -1247,6 +1329,56 @@ sap.ui.define([
|
|
|
1247
1329
|
});
|
|
1248
1330
|
}
|
|
1249
1331
|
return Promise.resolve(oResourceBundle);
|
|
1332
|
+
},
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Provides Office Open XML compliant default format settings
|
|
1336
|
+
* based on the UI5 Core Configuration.
|
|
1337
|
+
*
|
|
1338
|
+
* @returns {Object} Format settings
|
|
1339
|
+
* @private
|
|
1340
|
+
*/
|
|
1341
|
+
getFormatSettings: function() {
|
|
1342
|
+
if (!oDefaultFormatSettings) {
|
|
1343
|
+
var oCoreSettings, oSettings;
|
|
1344
|
+
|
|
1345
|
+
oSettings = {};
|
|
1346
|
+
oCoreSettings = Core.getConfiguration().getFormatSettings();
|
|
1347
|
+
|
|
1348
|
+
/* Reset cached format settings if formatSettings changed */
|
|
1349
|
+
Core.attachLocalizationChanged(function() {
|
|
1350
|
+
oDefaultFormatSettings = null;
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
/*
|
|
1354
|
+
* Load default format settings from UI5 Core Configuration
|
|
1355
|
+
*/
|
|
1356
|
+
oSettings.calendar = Core.getConfiguration().getCalendarType();
|
|
1357
|
+
oSettings.datePattern = oCoreSettings.getDatePattern('medium');
|
|
1358
|
+
oSettings.timePattern = oCoreSettings.getTimePattern('medium');
|
|
1359
|
+
oSettings.delimiter = !!oCoreSettings.getNumberSymbol('group');
|
|
1360
|
+
|
|
1361
|
+
/* Post processing: lower case, pattern specific replacement */
|
|
1362
|
+
if (typeof oSettings.datePattern === 'string') {
|
|
1363
|
+
oSettings.datePattern = oSettings.datePattern.toLowerCase();
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
/*
|
|
1367
|
+
* 12 hour clock period adjustment
|
|
1368
|
+
* https://unicode.org/reports/tr35/tr35-dates.html#dfst-period
|
|
1369
|
+
*/
|
|
1370
|
+
if (typeof oSettings.timePattern === 'string') {
|
|
1371
|
+
oSettings.timePattern = oSettings.timePattern.toLowerCase().replace(/ a+/, ' AM/PM');
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
if (oSettings.datePattern && oSettings.timePattern) {
|
|
1375
|
+
oSettings.dateTimePattern = oSettings.datePattern + ' ' + oSettings.timePattern;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
oDefaultFormatSettings = oSettings;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
return oDefaultFormatSettings;
|
|
1250
1382
|
}
|
|
1251
1383
|
};
|
|
1252
1384
|
|
|
@@ -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.
|
|
20
|
+
* @version 1.105.0
|
|
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.
|
|
86
|
+
* <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.105.0")</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.
|
|
169
|
+
* version: '1.105.0',
|
|
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.
|
|
281
|
+
* @version 1.105.0
|
|
282
282
|
*
|
|
283
283
|
* @since 1.50
|
|
284
284
|
* @name sap.ui.export.Spreadsheet
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<CheckBox id="exportSettingsDialog-includeFilterSettings" selected="{/includeFilterSettings}" text="{i18n>INCLUDE_FILTER_SETTINGS}" visible="{path:'/fileType', formatter: '.isXLSX'}"/>
|
|
22
22
|
<CheckBox id="exportSettingsDialog-includeFilterSettings-PDF" enabled="{/capabilities/PDF/CoverPage}" selected="{/includeFilterSettings}" text="{i18n>INCLUDE_FILTER_SETTINGS}" visible="{path:'/fileType', formatter: '.isPDF'}" tooltip="{i18n>TOOLTIP_FILTER_SETTINGS}"/>
|
|
23
23
|
<CheckBox id="exportSettingsDialog-pdfArchive" enabled="{/capabilities/PDF/ArchiveFormat}" selected="{/pdfArchive}" text="{i18n>ARCHIVE_FORMAT}" visible="{path:'/fileType', formatter: '.isPDF'}" tooltip="{i18n>TOOLTIP_ARCHIVE_FORMAT}"/>
|
|
24
|
-
<CheckBox id="exportSettingsDialog-splitCells" selected="{/splitCells}" text="{i18n>SPLIT_CELLS}" visible="{path:'/fileType', formatter: '.isXLSX'}"/> <!-- Will be hidden in case of PDF because it needs to be always true -->
|
|
24
|
+
<CheckBox id="exportSettingsDialog-splitCells" selected="{/splitCells}" text="{i18n>SPLIT_CELLS}" visible="{path:'/fileType', formatter: '.isXLSX'}"/> <!-- Will be hidden in case of PDF because it needs to be always true and is applied implicitly -->
|
|
25
25
|
<CheckBox id="exportSettingsDialog-addDateTime" selected="{/addDateTime}" text="{i18n>ADD_DATE_TIME}" visible="false"/>
|
|
26
26
|
|
|
27
27
|
<!-- PDF Specific settings -->
|