@sapui5/sap.ui.export 1.102.2 → 1.104.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/ExportDialog.js +4 -0
- package/src/sap/ui/export/ExportHandler.js +26 -3
- package/src/sap/ui/export/ExportUtils.js +170 -27
- 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 +2 -2
- package/src/sap/ui/export/messagebundle.properties +9 -0
- package/src/sap/ui/export/messagebundle_ar.properties +7 -1
- package/src/sap/ui/export/messagebundle_bg.properties +7 -1
- package/src/sap/ui/export/messagebundle_ca.properties +7 -1
- package/src/sap/ui/export/messagebundle_cs.properties +7 -1
- package/src/sap/ui/export/messagebundle_cy.properties +7 -1
- package/src/sap/ui/export/messagebundle_da.properties +7 -1
- package/src/sap/ui/export/messagebundle_de.properties +7 -1
- package/src/sap/ui/export/messagebundle_el.properties +7 -1
- package/src/sap/ui/export/messagebundle_en.properties +6 -0
- package/src/sap/ui/export/messagebundle_en_GB.properties +6 -0
- package/src/sap/ui/export/messagebundle_en_US_sappsd.properties +8 -0
- package/src/sap/ui/export/messagebundle_en_US_saprigi.properties +6 -0
- package/src/sap/ui/export/messagebundle_en_US_saptrc.properties +6 -0
- package/src/sap/ui/export/messagebundle_es.properties +7 -1
- package/src/sap/ui/export/messagebundle_es_MX.properties +7 -1
- package/src/sap/ui/export/messagebundle_et.properties +7 -1
- package/src/sap/ui/export/messagebundle_fi.properties +7 -1
- package/src/sap/ui/export/messagebundle_fr.properties +7 -1
- package/src/sap/ui/export/messagebundle_fr_CA.properties +7 -1
- package/src/sap/ui/export/messagebundle_hi.properties +7 -1
- package/src/sap/ui/export/messagebundle_hr.properties +7 -1
- package/src/sap/ui/export/messagebundle_hu.properties +7 -1
- package/src/sap/ui/export/messagebundle_id.properties +7 -1
- package/src/sap/ui/export/messagebundle_it.properties +7 -1
- package/src/sap/ui/export/messagebundle_iw.properties +7 -1
- package/src/sap/ui/export/messagebundle_ja.properties +7 -1
- package/src/sap/ui/export/messagebundle_kk.properties +7 -1
- package/src/sap/ui/export/messagebundle_ko.properties +7 -1
- package/src/sap/ui/export/messagebundle_lt.properties +7 -1
- package/src/sap/ui/export/messagebundle_lv.properties +7 -1
- package/src/sap/ui/export/messagebundle_ms.properties +7 -1
- package/src/sap/ui/export/messagebundle_nl.properties +7 -1
- package/src/sap/ui/export/messagebundle_no.properties +7 -1
- package/src/sap/ui/export/messagebundle_pl.properties +7 -1
- package/src/sap/ui/export/messagebundle_pt.properties +7 -1
- package/src/sap/ui/export/messagebundle_pt_PT.properties +7 -1
- package/src/sap/ui/export/messagebundle_ro.properties +7 -1
- package/src/sap/ui/export/messagebundle_ru.properties +7 -1
- package/src/sap/ui/export/messagebundle_sh.properties +7 -1
- package/src/sap/ui/export/messagebundle_sk.properties +7 -1
- package/src/sap/ui/export/messagebundle_sl.properties +7 -1
- package/src/sap/ui/export/messagebundle_sv.properties +7 -1
- package/src/sap/ui/export/messagebundle_th.properties +7 -1
- package/src/sap/ui/export/messagebundle_tr.properties +7 -1
- package/src/sap/ui/export/messagebundle_uk.properties +7 -1
- package/src/sap/ui/export/messagebundle_vi.properties +7 -1
- package/src/sap/ui/export/messagebundle_zh_CN.properties +7 -1
- package/src/sap/ui/export/messagebundle_zh_TW.properties +7 -1
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.
|
|
30
|
+
* @version 1.104.0
|
|
31
31
|
*
|
|
32
32
|
* @since 1.96
|
|
33
33
|
* @name sap.ui.export.ExportBase
|
|
@@ -180,6 +180,10 @@ 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
|
+
|
|
183
187
|
oResourceBundlePromise.then(function(oResourceBundle) {
|
|
184
188
|
var errorMessage = sMessage || oResourceBundle.getText('PROGRESS_ERROR_DEFAULT');
|
|
185
189
|
|
|
@@ -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.104.0
|
|
18
19
|
*
|
|
19
20
|
* @since 1.102
|
|
20
21
|
* @name sap.ui.export.ExportHandler
|
|
@@ -402,8 +403,8 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
402
403
|
mUserSettings.splitCells = mDialogSettings.splitCells;
|
|
403
404
|
mUserSettings.includeFilterSettings = mDialogSettings.includeFilterSettings;
|
|
404
405
|
|
|
405
|
-
/*
|
|
406
|
-
if (mDialogSettings.splitCells) {
|
|
406
|
+
/* Enforce split cells option for fileType PDF without persisting the value in the settings dialog */
|
|
407
|
+
if (mExportSettings.fileType === FileType.PDF || mDialogSettings.splitCells) {
|
|
407
408
|
mExportSettings.workbook.columns = ExportUtils.splitColumns(mExportSettings.workbook.columns, fnResolveColumnLabel);
|
|
408
409
|
}
|
|
409
410
|
|
|
@@ -423,6 +424,28 @@ sap.ui.define(['./library', './ExportUtils', './ExportDialog', 'sap/m/MessageToa
|
|
|
423
424
|
oContext.metaSheetName = oFilterConfig.name;
|
|
424
425
|
oContext.metainfo = Array.isArray(oContext.metainfo) ? oContext.metainfo.push(oFilterConfig) : [oFilterConfig];
|
|
425
426
|
}
|
|
427
|
+
|
|
428
|
+
if (mExportSettings.includeFilterSettings) {
|
|
429
|
+
return ExportUtils.parseTechnicalConfiguration();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return Promise.resolve();
|
|
433
|
+
}).then(function(aUserConfig) {
|
|
434
|
+
if (aUserConfig) {
|
|
435
|
+
var oContext = mExportSettings.workbook.context;
|
|
436
|
+
|
|
437
|
+
if (!oContext) {
|
|
438
|
+
oContext = mExportSettings.workbook.context = {};
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (Array.isArray(oContext.metainfo)) {
|
|
442
|
+
aUserConfig.forEach(function(oUserConfig) {
|
|
443
|
+
oContext.metainfo.unshift(oUserConfig);
|
|
444
|
+
});
|
|
445
|
+
} else {
|
|
446
|
+
oContext.metainfo = aUserConfig;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
426
449
|
}).then(function() {
|
|
427
450
|
if (mExportSettings.destination === Destination.LOCAL) {
|
|
428
451
|
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;
|
|
@@ -68,12 +71,12 @@ sap.ui.define([
|
|
|
68
71
|
capabilities: oExportCapabilities,
|
|
69
72
|
fitToPage: false,
|
|
70
73
|
paperSizeCollection: [
|
|
71
|
-
{key:
|
|
72
|
-
{key:
|
|
74
|
+
{key: 'DIN_A4', text: oResourceBundle.getText('PAPER_SIZE_A4')},
|
|
75
|
+
{key: 'US_LETTER', text: oResourceBundle.getText('PAPER_SIZE_US_LETTER')}
|
|
73
76
|
],
|
|
74
77
|
orientationCollection: [
|
|
75
|
-
{key:
|
|
76
|
-
{key:
|
|
78
|
+
{key:'LANDSCAPE', text: oResourceBundle.getText('ORIENTATION_LAND')},
|
|
79
|
+
{key:'PORTRAIT', text: oResourceBundle.getText('ORIENTATION_PORT')}
|
|
77
80
|
],
|
|
78
81
|
fontSize: 10,
|
|
79
82
|
signature: false,
|
|
@@ -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.104.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
|
|
@@ -850,7 +893,7 @@ sap.ui.define([
|
|
|
850
893
|
/* *** Validation of type specific properties *** */
|
|
851
894
|
|
|
852
895
|
/* Validate boolean based properties (not column type Boolean related) */
|
|
853
|
-
['autoScale', 'delimiter', 'displayUnit', 'utc', 'wrap'].forEach(function(sProperty) {
|
|
896
|
+
['autoScale', 'delimiter', 'displayTimezone', 'displayUnit', 'utc', 'wrap'].forEach(function(sProperty) {
|
|
854
897
|
Utils._validateProperty(oColumn, sProperty, 'boolean');
|
|
855
898
|
});
|
|
856
899
|
|
|
@@ -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.104.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
|
/**
|
|
@@ -1215,6 +1297,17 @@ sap.ui.define([
|
|
|
1215
1297
|
}
|
|
1216
1298
|
}
|
|
1217
1299
|
|
|
1300
|
+
if (oColumn.timezoneProperty && oColumn.displayTimezone !== false) {
|
|
1301
|
+
oUpdatedColumn = Object.assign({}, oColumn);
|
|
1302
|
+
sColumnLabel = typeof fnResolveColumnLabel === 'function' ? fnResolveColumnLabel(oColumn.timezoneProperty) : null;
|
|
1303
|
+
aSplittedColumns = [oUpdatedColumn, {
|
|
1304
|
+
property: oColumn.timezoneProperty,
|
|
1305
|
+
label: sColumnLabel || oColumn.label + ' (1)'
|
|
1306
|
+
}];
|
|
1307
|
+
|
|
1308
|
+
oUpdatedColumn.displayTimezone = false;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1218
1311
|
aResult.push(aSplittedColumns || oColumn);
|
|
1219
1312
|
});
|
|
1220
1313
|
|
|
@@ -1236,6 +1329,56 @@ sap.ui.define([
|
|
|
1236
1329
|
});
|
|
1237
1330
|
}
|
|
1238
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;
|
|
1239
1382
|
}
|
|
1240
1383
|
};
|
|
1241
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.104.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.104.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.104.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.104.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 -->
|