@sapui5/sap.ui.export 1.130.0 → 1.130.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ui.export",
3
- "version": "1.130.0",
3
+ "version": "1.130.2",
4
4
  "description": "SAPUI5 Library sap.ui.export",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -5,7 +5,7 @@
5
5
  <vendor>SAP SE</vendor>
6
6
  <copyright>SAPUI5
7
7
  * (c) Copyright 2009-2024 SAP SE. All rights reserved.</copyright>
8
- <version>1.130.0</version>
8
+ <version>1.130.2</version>
9
9
 
10
10
  <documentation>UI5 library: sap.ui.export</documentation>
11
11
 
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @class 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.130.0
30
+ * @version 1.130.2
31
31
  *
32
32
  * @since 1.96
33
33
  * @alias sap.ui.export.ExportBase
@@ -7,11 +7,12 @@ sap.ui.define([
7
7
  "./ExportUtils",
8
8
  "./ExportDialog",
9
9
  "./util/PDFCapabilities",
10
+ "sap/base/Log",
10
11
  "sap/m/MessageToast",
11
12
  "sap/ui/base/EventProvider",
12
13
  "sap/ui/model/odata/v4/ODataModel",
13
14
  "sap/ui/util/openWindow"
14
- ], function(library, ExportUtils, ExportDialog, PDFCapabilities, MessageToast, EventProvider, ODataModel, openWindow) {
15
+ ], function(library, ExportUtils, ExportDialog, PDFCapabilities, Log, MessageToast, EventProvider, ODataModel, openWindow) {
15
16
  "use strict";
16
17
 
17
18
  const Destination = library.Destination;
@@ -27,7 +28,7 @@ sap.ui.define([
27
28
  * @class The <code>sap.ui.export.ExportHandler</code> class allows you to export table data from an SAPUI5 application.
28
29
  *
29
30
  * @author SAP SE
30
- * @version 1.130.0
31
+ * @version 1.130.2
31
32
  *
32
33
  * @since 1.102
33
34
  * @alias sap.ui.export.ExportHandler
@@ -185,7 +186,12 @@ sap.ui.define([
185
186
  this._oFileShareBinding = oModel.bindList("/FileShares");
186
187
  }
187
188
 
188
- return this._oFileShareBinding.requestContexts(0);
189
+ try {
190
+ return await this._oFileShareBinding.requestContexts(0);
191
+ } catch (oError) {
192
+ Log.error(oError?.message ?? oError);
193
+ return [];
194
+ }
189
195
  };
190
196
 
191
197
  /**
@@ -144,7 +144,7 @@ sap.ui.define([
144
144
  * @class Utilities related to export to enable reuse in integration scenarios (e.g. tables).
145
145
  *
146
146
  * @author SAP SE
147
- * @version 1.130.0
147
+ * @version 1.130.2
148
148
  *
149
149
  * @since 1.59
150
150
  * @alias sap.ui.export.ExportUtils
@@ -1218,7 +1218,7 @@ sap.ui.define([
1218
1218
  *
1219
1219
  * @param {object} oContext Context object
1220
1220
  * @param {string} [oContext.application] Name of the application (default: "SAP UI5")
1221
- * @param {string} [oContext.version] Application version (default: "1.130.0")
1221
+ * @param {string} [oContext.version] Application version (default: "1.130.2")
1222
1222
  * @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
1223
1223
  * @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
1224
1224
  * @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class 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.
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.130.0
29
+ * @version 1.130.2
30
30
  *
31
31
  * @since 1.96
32
32
  * @alias sap.ui.export.PortableDocument
@@ -90,7 +90,7 @@ sap.ui.define([
90
90
  * <li><code>workbook.context</code> - Context object that will be applied to the generated file. It may contain the following fields:</li>
91
91
  * <ul>
92
92
  * <li><code>application</code> (string) - The application that creates the XLSX document (default: "SAP UI5")</li>
93
- * <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.130.0")</li>
93
+ * <li><code>version</code> (string) - Application version that creates the XLSX document (default: "1.130.2")</li>
94
94
  * <li><code>title</code> (string) - Title of the XLSX document (NOT the filename)</li>
95
95
  * <li><code>modifiedBy</code> (string) - User context for the XLSX document</li>
96
96
  * <li><code>sheetName</code> (string) - The label of the data sheet</li>
@@ -174,7 +174,7 @@ sap.ui.define([
174
174
  * columns: aColumns,
175
175
  * context: {
176
176
  * application: 'Debug Test Application',
177
- * version: '1.130.0',
177
+ * version: '1.130.2',
178
178
  * title: 'Some random title',
179
179
  * modifiedBy: 'John Doe',
180
180
  * metaSheetName: 'Custom metadata',
@@ -286,7 +286,7 @@ sap.ui.define([
286
286
  * @class The <code>sap.ui.export.Spreadsheet</code> class allows you to export table data from a UI5 application to a spreadsheet file.
287
287
  *
288
288
  * @author SAP SE
289
- * @version 1.130.0
289
+ * @version 1.130.2
290
290
  *
291
291
  * @since 1.50
292
292
  * @alias sap.ui.export.Spreadsheet
@@ -21,7 +21,7 @@ sap.ui.define(['sap/base/Log', 'sap/ui/export/ExportUtils'], function(Log, Expor
21
21
  * Utility class to perform spreadsheet export.
22
22
  *
23
23
  * @author SAP SE
24
- * @version 1.130.0
24
+ * @version 1.130.2
25
25
  *
26
26
  * @alias sap.ui.export.SpreadsheetExport
27
27
  * @private
@@ -15,7 +15,7 @@ sap.ui.define(["sap/ui/core/Lib"], function(Library) {
15
15
  * @namespace
16
16
  * @alias sap.ui.export
17
17
  * @author SAP SE
18
- * @version 1.130.0
18
+ * @version 1.130.2
19
19
  * @public
20
20
  */
21
21
 
@@ -33,7 +33,7 @@ sap.ui.define(["sap/ui/core/Lib"], function(Library) {
33
33
  interfaces: [],
34
34
  controls: [],
35
35
  elements: [],
36
- version: "1.130.0"
36
+ version: "1.130.2"
37
37
  });
38
38
 
39
39
  /**
@@ -24,7 +24,7 @@
24
24
  * @param {object} mSettings Data service related part of the export configuration
25
25
  *
26
26
  * @author SAP SE
27
- * @version 1.130.0
27
+ * @version 1.130.2
28
28
  *
29
29
  * @constructor
30
30
  * @class DataProviderBase
@@ -39,6 +39,7 @@
39
39
  this.iAvailableRows = 0;
40
40
  this.mRequest = null;
41
41
  this.iCount = Math.min(mSettings.dataSource.count || DataProviderBase.MAX_ROWS, DataProviderBase.MAX_ROWS);
42
+ this.fnConvertData = DataProviderBase.getDataConverter(this.mSettings);
42
43
 
43
44
  if (this.mSettings.dataSource.downloadLimit) {
44
45
  this.iTotalRows = this.mSettings.dataSource.downloadLimit;
@@ -195,7 +196,6 @@
195
196
  DataProviderBase.prototype.requestData = function(fnProcessCallback) {
196
197
  var mDataSource = this.mSettings.dataSource;
197
198
 
198
- this.fnConvertData = DataProviderBase.getDataConverter(this.mSettings);
199
199
  this.fnProcessCallback = fnProcessCallback;
200
200
 
201
201
  // Execution
@@ -231,7 +231,7 @@
231
231
  * @private
232
232
  */
233
233
  DataProviderBase.prototype.fnOnDataReceived = function(oResult) {
234
- var aData, sNextUrl, iFetchedRows, iRemainingRows;
234
+ var aData, sNextUrl, iFetchedRows, iRemainingRows, bWasServerSidePaging;
235
235
  var mCallbackParams = {};
236
236
  this.oPendingXHR = null;
237
237
  if (this.bCanceled) {
@@ -241,6 +241,7 @@
241
241
  /* Check for OData V4 result, if not present check for OData V2 result or apply default */
242
242
  aData = (oResult && oResult.value || (oResult.d && (oResult.d.results || oResult.d))) || oResult;
243
243
  aData = (Array.isArray(aData)) ? aData : [];
244
+ bWasServerSidePaging = this.mRequest?.dataUrl.includes("$skiptoken");
244
245
  iFetchedRows = aData.length;
245
246
 
246
247
  this.iAvailableRows += iFetchedRows;
@@ -250,7 +251,7 @@
250
251
 
251
252
  iRemainingRows = this.iTotalRows - this.iAvailableRows;
252
253
 
253
- mCallbackParams.finished = this._isFinished(iFetchedRows, sNextUrl, iRemainingRows);
254
+ mCallbackParams.finished = this._isFinished(iFetchedRows, sNextUrl, iRemainingRows, bWasServerSidePaging);
254
255
  mCallbackParams.progress = this.iTotalRows;
255
256
  mCallbackParams.total = this.iTotalRows < this.iCount ? this.iTotalRows : this.iCount;
256
257
  mCallbackParams.fetched = this.iAvailableRows;
@@ -275,17 +276,36 @@
275
276
  * The function returns array of columns that need special conversion for values.
276
277
  * E.g. handling data from association/navigationProperty
277
278
  *
278
- * @param {number} iFetchedRows - Number of rows fetched
279
- * @param {string} sNextUrl - Next url to fetch data
280
- * @param {number} iRemainingRows - Remaining rows to fetch
281
- * @returns {boolean} - True if the finish condition is met
279
+ * @param {number} iFetchedRows Number of rows fetched
280
+ * @param {string} sNextUrl Next url to fetch data
281
+ * @param {number} iRemainingRows Remaining rows to fetch
282
+ * @param {boolean} bWasServerSidePaging Flag if server side paging was used
282
283
  *
283
- * @static
284
+ * @returns {boolean} True if the finish condition is met
284
285
  * @private
285
286
  */
286
- DataProviderBase.prototype._isFinished = function(iFetchedRows, sNextUrl, iRemainingRows) {
287
- const bFetchedRows = !sNextUrl && ((iFetchedRows < this.iBatchSize) || iFetchedRows > this.iBatchSize);
288
- return iFetchedRows === 0 || iRemainingRows <= 0 || bFetchedRows;
287
+ DataProviderBase.prototype._isFinished = function(iFetchedRows, sNextUrl, iRemainingRows, bWasServerSidePaging) {
288
+ if (iFetchedRows === 0 || iRemainingRows <= 0) {
289
+ return true;
290
+ }
291
+
292
+ if (sNextUrl) {
293
+ return false;
294
+ }
295
+
296
+ if (iFetchedRows > this.iBatchSize) {
297
+ return true;
298
+ }
299
+
300
+ if (iFetchedRows < this.iBatchSize && bWasServerSidePaging) {
301
+ return false;
302
+ }
303
+
304
+ if (iFetchedRows === this.iBatchSize) {
305
+ return false;
306
+ }
307
+
308
+ return true;
289
309
  };
290
310
 
291
311
  /**
@@ -20,7 +20,7 @@ sap.ui.define(['sap/ui/base/Object'], function(BaseObject) {
20
20
  * convenience functions like <code>sap.ui.export.util.Filter#setType</code> to improve the result.
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.130.0
23
+ * @version 1.130.2
24
24
  *
25
25
  * @since 1.110
26
26
  * @alias sap.ui.export.util.Filter