@sapui5/types 1.113.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/LICENSE.txt +35 -0
- package/README.md +35 -0
- package/package.json +23 -0
- package/types/index.d.ts +67 -0
- package/types/sap.apf.d.ts +1026 -0
- package/types/sap.ca.ui.d.ts +14005 -0
- package/types/sap.chart.d.ts +4815 -0
- package/types/sap.collaboration.d.ts +2704 -0
- package/types/sap.esh.search.ui.d.ts +1595 -0
- package/types/sap.f.d.ts +20085 -0
- package/types/sap.fe.core.d.ts +1508 -0
- package/types/sap.fe.macros.d.ts +975 -0
- package/types/sap.fe.navigation.d.ts +917 -0
- package/types/sap.fe.templates.d.ts +522 -0
- package/types/sap.fe.test.d.ts +3533 -0
- package/types/sap.feedback.ui.d.ts +3 -0
- package/types/sap.gantt.d.ts +51684 -0
- package/types/sap.insights.d.ts +23 -0
- package/types/sap.landvisz.d.ts +7952 -0
- package/types/sap.m.d.ts +147796 -0
- package/types/sap.makit.d.ts +4533 -0
- package/types/sap.me.d.ts +3665 -0
- package/types/sap.ndc.d.ts +774 -0
- package/types/sap.ovp.d.ts +176 -0
- package/types/sap.rules.ui.d.ts +1471 -0
- package/types/sap.sac.df.d.ts +2292 -0
- package/types/sap.sac.grid.d.ts +774 -0
- package/types/sap.suite.ui.commons.d.ts +46971 -0
- package/types/sap.suite.ui.generic.template.d.ts +3431 -0
- package/types/sap.suite.ui.microchart.d.ts +12652 -0
- package/types/sap.tnt.d.ts +2227 -0
- package/types/sap.ui.codeeditor.d.ts +693 -0
- package/types/sap.ui.commons.d.ts +30235 -0
- package/types/sap.ui.comp.d.ts +37411 -0
- package/types/sap.ui.core.d.ts +78872 -0
- package/types/sap.ui.dt.d.ts +3 -0
- package/types/sap.ui.export.d.ts +843 -0
- package/types/sap.ui.fl.d.ts +1663 -0
- package/types/sap.ui.generic.app.d.ts +2683 -0
- package/types/sap.ui.generic.template.d.ts +3 -0
- package/types/sap.ui.integration.d.ts +4032 -0
- package/types/sap.ui.layout.d.ts +14472 -0
- package/types/sap.ui.mdc.d.ts +476 -0
- package/types/sap.ui.richtexteditor.d.ts +1666 -0
- package/types/sap.ui.rta.d.ts +124 -0
- package/types/sap.ui.suite.d.ts +685 -0
- package/types/sap.ui.support.d.ts +453 -0
- package/types/sap.ui.table.d.ts +9325 -0
- package/types/sap.ui.testrecorder.d.ts +9 -0
- package/types/sap.ui.unified.d.ts +20640 -0
- package/types/sap.ui.ux3.d.ts +18288 -0
- package/types/sap.ui.vbm.d.ts +17251 -0
- package/types/sap.ui.vk.d.ts +42381 -0
- package/types/sap.ui.vtm.d.ts +10547 -0
- package/types/sap.ui.webc.common.d.ts +113 -0
- package/types/sap.ui.webc.fiori.d.ts +13850 -0
- package/types/sap.ui.webc.main.d.ts +40833 -0
- package/types/sap.uiext.inbox.d.ts +4079 -0
- package/types/sap.ushell.d.ts +10255 -0
- package/types/sap.ushell_abap.d.ts +9 -0
- package/types/sap.uxap.d.ts +7636 -0
- package/types/sap.viz.d.ts +51209 -0
- package/types/sap.webanalytics.core.d.ts +3 -0
- package/types/sap.zen.commons.d.ts +1542 -0
- package/types/sap.zen.crosstab.d.ts +1159 -0
- package/types/sap.zen.dsh.d.ts +2132 -0
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
// For Library Version: 1.113.0
|
|
2
|
+
|
|
3
|
+
declare module "sap/ui/export/library" {
|
|
4
|
+
/**
|
|
5
|
+
* @SINCE 1.50.0
|
|
6
|
+
*
|
|
7
|
+
* EDM data types for document export.
|
|
8
|
+
*/
|
|
9
|
+
export enum EdmType {
|
|
10
|
+
/**
|
|
11
|
+
* @SINCE 1.60
|
|
12
|
+
*
|
|
13
|
+
* Property of type BigNumber.
|
|
14
|
+
*/
|
|
15
|
+
BigNumber = "BigNumber",
|
|
16
|
+
/**
|
|
17
|
+
* Property of type Boolean.
|
|
18
|
+
*/
|
|
19
|
+
Boolean = "Boolean",
|
|
20
|
+
/**
|
|
21
|
+
* Property of type Currency
|
|
22
|
+
*/
|
|
23
|
+
Currency = "Currency",
|
|
24
|
+
/**
|
|
25
|
+
* Property of type Date.
|
|
26
|
+
*/
|
|
27
|
+
Date = "Date",
|
|
28
|
+
/**
|
|
29
|
+
* Property of type DateTime.
|
|
30
|
+
*/
|
|
31
|
+
DateTime = "DateTime",
|
|
32
|
+
/**
|
|
33
|
+
* @SINCE 1.58
|
|
34
|
+
*
|
|
35
|
+
* Property of type Enumeration.
|
|
36
|
+
*/
|
|
37
|
+
Enumeration = "Enumeration",
|
|
38
|
+
/**
|
|
39
|
+
* Property of type Number.
|
|
40
|
+
*/
|
|
41
|
+
Number = "Number",
|
|
42
|
+
/**
|
|
43
|
+
* @SINCE 1.87
|
|
44
|
+
*
|
|
45
|
+
* Property of type Percentage.
|
|
46
|
+
*/
|
|
47
|
+
Percentage = "Percentage",
|
|
48
|
+
/**
|
|
49
|
+
* Property of type string.
|
|
50
|
+
*/
|
|
51
|
+
String = "String",
|
|
52
|
+
/**
|
|
53
|
+
* Property of type Time.
|
|
54
|
+
*/
|
|
55
|
+
Time = "Time",
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @SINCE 1.78
|
|
59
|
+
*
|
|
60
|
+
* File types for document export.
|
|
61
|
+
*/
|
|
62
|
+
export enum FileType {
|
|
63
|
+
/**
|
|
64
|
+
* Office Open XML - SpreadsheetML file type.
|
|
65
|
+
*/
|
|
66
|
+
XLSX = "XLSX",
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare module "sap/ui/export/ExportBase" {
|
|
71
|
+
import EventProvider from "sap/ui/base/EventProvider";
|
|
72
|
+
|
|
73
|
+
import ListBinding from "sap/ui/model/ListBinding";
|
|
74
|
+
|
|
75
|
+
import { FileType } from "sap/ui/export/library";
|
|
76
|
+
|
|
77
|
+
import Metadata from "sap/ui/base/Metadata";
|
|
78
|
+
|
|
79
|
+
import TreeBinding from "sap/ui/model/TreeBinding";
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @SINCE 1.96
|
|
83
|
+
*
|
|
84
|
+
* The `sap.ui.export.ExportBase` class allows you to export table data from a UI5 application to certain
|
|
85
|
+
* formats. This class is an abstract class that requires specific implementations for each file format.
|
|
86
|
+
*/
|
|
87
|
+
export default class ExportBase extends EventProvider {
|
|
88
|
+
/**
|
|
89
|
+
* Base class for specific SAPUI5 export implementations. This class contains abstract functions that need
|
|
90
|
+
* to be implemented.
|
|
91
|
+
*/
|
|
92
|
+
constructor(
|
|
93
|
+
/**
|
|
94
|
+
* Export settings
|
|
95
|
+
*/
|
|
96
|
+
mSettings: {
|
|
97
|
+
/**
|
|
98
|
+
* Data and formatting related export settings
|
|
99
|
+
*/
|
|
100
|
+
workbook: object;
|
|
101
|
+
/**
|
|
102
|
+
* Source of export data. A data source properties map or `sap.ui.model.ListBinding` can be provided. An
|
|
103
|
+
* instance of `sap.ui.model.ListBinding` has to implement a `#getDownloadUrl` function.
|
|
104
|
+
*/
|
|
105
|
+
dataSource: object | ListBinding;
|
|
106
|
+
/**
|
|
107
|
+
* The maximal number of records to export
|
|
108
|
+
*/
|
|
109
|
+
count?: int;
|
|
110
|
+
/**
|
|
111
|
+
* Optional file name for the exported file
|
|
112
|
+
*/
|
|
113
|
+
fileName?: string;
|
|
114
|
+
/**
|
|
115
|
+
* `FileType` that is used to identify the file-ending and MIME-type of the file
|
|
116
|
+
*/
|
|
117
|
+
fileType?: FileType | keyof typeof FileType;
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates a new subclass of class sap.ui.export.ExportBase with name `sClassName` and enriches it with
|
|
123
|
+
* the information contained in `oClassInfo`.
|
|
124
|
+
*
|
|
125
|
+
* `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}.
|
|
126
|
+
*
|
|
127
|
+
* @returns Created class / constructor function
|
|
128
|
+
*/
|
|
129
|
+
static extend<T extends Record<string, unknown>>(
|
|
130
|
+
/**
|
|
131
|
+
* Name of the class being created
|
|
132
|
+
*/
|
|
133
|
+
sClassName: string,
|
|
134
|
+
/**
|
|
135
|
+
* Object literal with information about the class
|
|
136
|
+
*/
|
|
137
|
+
oClassInfo?: sap.ClassInfo<T, ExportBase>,
|
|
138
|
+
/**
|
|
139
|
+
* Constructor function for the metadata object; if not given, it defaults to the metadata implementation
|
|
140
|
+
* used by this class
|
|
141
|
+
*/
|
|
142
|
+
FNMetaImpl?: Function
|
|
143
|
+
): Function;
|
|
144
|
+
/**
|
|
145
|
+
* Returns a metadata object for class sap.ui.export.ExportBase.
|
|
146
|
+
*
|
|
147
|
+
* @returns Metadata object describing this class
|
|
148
|
+
*/
|
|
149
|
+
static getMetadata(): Metadata;
|
|
150
|
+
/**
|
|
151
|
+
* @SINCE 1.96
|
|
152
|
+
*
|
|
153
|
+
* Attaches event handler `fnFunction` to the {@link sap.ui.export.ExportBase#event:beforeExport} event
|
|
154
|
+
* of this `sap.ui.export.ExportBase`.
|
|
155
|
+
* When called, the context of the event handler (its `this`) will be bound to `oListener` if specified,
|
|
156
|
+
* otherwise it will be bound to this `sap.ui.export.ExportBase` itself.
|
|
157
|
+
* This event is fired just before the export process is started.
|
|
158
|
+
*
|
|
159
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
160
|
+
*/
|
|
161
|
+
attachBeforeExport(
|
|
162
|
+
/**
|
|
163
|
+
* An application-specific payload object that will be passed to the event handler along with the event
|
|
164
|
+
* object when firing the event
|
|
165
|
+
*/
|
|
166
|
+
oData: object,
|
|
167
|
+
/**
|
|
168
|
+
* The function to be called when the event occurs
|
|
169
|
+
*/
|
|
170
|
+
fnHandler: Function,
|
|
171
|
+
/**
|
|
172
|
+
* Context object to call the event handler with. Defaults to the `sap.ui.export.ExportBase` instance itself
|
|
173
|
+
*/
|
|
174
|
+
oListener?: object
|
|
175
|
+
): this;
|
|
176
|
+
/**
|
|
177
|
+
* @SINCE 1.96
|
|
178
|
+
*
|
|
179
|
+
* Attaches event handler `fnFunction` to the {@link sap.ui.export.ExportBase#event:beforeExport} event
|
|
180
|
+
* of this `sap.ui.export.ExportBase`.
|
|
181
|
+
* When called, the context of the event handler (its `this`) will be bound to `oListener` if specified,
|
|
182
|
+
* otherwise it will be bound to this `sap.ui.export.ExportBase` itself.
|
|
183
|
+
* This event is fired just before the export process is started.
|
|
184
|
+
*
|
|
185
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
186
|
+
*/
|
|
187
|
+
attachBeforeExport(
|
|
188
|
+
/**
|
|
189
|
+
* The function to be called when the event occurs
|
|
190
|
+
*/
|
|
191
|
+
fnHandler: Function,
|
|
192
|
+
/**
|
|
193
|
+
* Context object to call the event handler with. Defaults to the `sap.ui.export.ExportBase` instance itself
|
|
194
|
+
*/
|
|
195
|
+
oListener?: object
|
|
196
|
+
): this;
|
|
197
|
+
/**
|
|
198
|
+
* Triggers the export process of the specific format.
|
|
199
|
+
*
|
|
200
|
+
* @returns Promise that gets resolved once the data has been exported
|
|
201
|
+
*/
|
|
202
|
+
build(): Promise<any>;
|
|
203
|
+
/**
|
|
204
|
+
* Cancels the current export process.
|
|
205
|
+
*/
|
|
206
|
+
cancel(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Cleans up the internal structures and removes all event handlers.
|
|
209
|
+
*
|
|
210
|
+
* The object must not be used anymore after destroy was called.
|
|
211
|
+
* See:
|
|
212
|
+
* sap.ui.base.Object#destroy
|
|
213
|
+
*/
|
|
214
|
+
destroy(): void;
|
|
215
|
+
/**
|
|
216
|
+
* @SINCE 1.96
|
|
217
|
+
*
|
|
218
|
+
* Detaches event handler `fnFunction` from the {@link sap.ui.export.ExportBase#event:beforeExport} event
|
|
219
|
+
* of this `sap.ui.export.ExportBase`.
|
|
220
|
+
* The passed function and listener object must match the ones used for event registration.
|
|
221
|
+
*
|
|
222
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
223
|
+
*/
|
|
224
|
+
detachBeforeExport(
|
|
225
|
+
/**
|
|
226
|
+
* The function to be called when the event occurs
|
|
227
|
+
*/
|
|
228
|
+
fnHandler: Function,
|
|
229
|
+
/**
|
|
230
|
+
* Context object on which the given function had to be called
|
|
231
|
+
*/
|
|
232
|
+
oListener?: object
|
|
233
|
+
): this;
|
|
234
|
+
/**
|
|
235
|
+
* @SINCE 1.112
|
|
236
|
+
*
|
|
237
|
+
* Returns the specific MIME type
|
|
238
|
+
*/
|
|
239
|
+
getMimeType(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Sets the data source configuration that will be used for exporting the data. If the passed parameter
|
|
242
|
+
* is null, the call will be ignored.
|
|
243
|
+
*
|
|
244
|
+
* @returns - Valid dataSource object or null in case the dataSource configuration is not supported
|
|
245
|
+
*/
|
|
246
|
+
processDataSource(
|
|
247
|
+
/**
|
|
248
|
+
* Possible types are a data source configuration, a `sap.ui.model.ListBinding` or `sap.ui.model.TreeBinding`
|
|
249
|
+
*/
|
|
250
|
+
oDataSource: object | ListBinding | TreeBinding
|
|
251
|
+
): object | null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare module "sap/ui/export/Spreadsheet" {
|
|
256
|
+
import ExportBase from "sap/ui/export/ExportBase";
|
|
257
|
+
|
|
258
|
+
import ListBinding from "sap/ui/model/ListBinding";
|
|
259
|
+
|
|
260
|
+
import TreeBinding from "sap/ui/model/TreeBinding";
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* @SINCE 1.50
|
|
264
|
+
*
|
|
265
|
+
* The `sap.ui.export.Spreadsheet` class allows you to export table data from a UI5 application to a spreadsheet
|
|
266
|
+
* file.
|
|
267
|
+
*/
|
|
268
|
+
export default class Spreadsheet extends ExportBase {
|
|
269
|
+
/**
|
|
270
|
+
* Creates a new spreadsheet export object. Use this object to build and download a spreadsheet file in
|
|
271
|
+
* Office Open XML Spreadsheet format from tabular data. This functionality is normally used together with
|
|
272
|
+
* UI5 tables.
|
|
273
|
+
*
|
|
274
|
+
* Overview: The class builds a spreadsheet in an Office Open XML Spreadsheet format using tabular data
|
|
275
|
+
* from a specified data source. Data is retrieved and the document is built asynchronously in a worker
|
|
276
|
+
* thread of the browser. The status of the process is visually presented to the user in a progress dialog
|
|
277
|
+
* that can be suppressed. The user can cancel the process with the Cancel button of the dialog.
|
|
278
|
+
*
|
|
279
|
+
* This class provides a low level API for spreadsheet export. The {@link sap.ui.comp.smarttable.SmartTable}
|
|
280
|
+
* control implements it internally and provides the export functionality out of the box. For special cases,
|
|
281
|
+
* please refer to details below.
|
|
282
|
+
*
|
|
283
|
+
* Optional features:
|
|
284
|
+
* - Suppress the progress dialog.
|
|
285
|
+
* - Suppress worker and run the document generation process in a main thread.
|
|
286
|
+
* - Configure the exported file name.
|
|
287
|
+
*
|
|
288
|
+
* Export settings object: Export settings should be provided in the constructor as an `mSettings` property
|
|
289
|
+
* map with the following fields:
|
|
290
|
+
* - `workbook` - Spreadsheet properties object
|
|
291
|
+
* `workbook.columns` - Array of column configurations. Each column configuration is an object with the
|
|
292
|
+
* following fields:
|
|
293
|
+
* `label` (string) - Column header text
|
|
294
|
+
* - `property` (string) - Field name or Array of field names in the data source feed
|
|
295
|
+
* - `type` (string) - Optional data type of the field. See {@link sap.ui.export.EdmType} for the list
|
|
296
|
+
* of supported types. If this property is omitted, the property is processed as a string field.
|
|
297
|
+
* - `width` (number) - Optional width of the column in characters. There is no 1:1 correspondence between
|
|
298
|
+
* character widths in the exported spreadsheet and CSS units.The width of one character is approximately
|
|
299
|
+
* 0.5em in CSS units, depending on the fonts that are used in the table and in the resulting spreadsheet.
|
|
300
|
+
* The default value is 10 characters.
|
|
301
|
+
* - `textAlign` (string) - Horizontal alignment of cell contents. The following values of the CSS `text-align`
|
|
302
|
+
* property are accepted: `[left, right, center, begin, end]`. If not specified, the columns are horizontally
|
|
303
|
+
* aligned based on the property type.
|
|
304
|
+
* - `scale` (number) - Number of digits after decimal point for numeric values
|
|
305
|
+
* - `delimiter` (boolean) - Set to `true` to display thousands separators in numeric values. The default
|
|
306
|
+
* value is `false`.
|
|
307
|
+
* - `unit` (string) - Text to display as the unit of measurement or currency next to the numeric value.
|
|
308
|
+
* It is treated as a string and has no influence on the value itself. For example, a value of 150 with
|
|
309
|
+
* the unit "%" is still 150 and not 1.5, as a user may expect.
|
|
310
|
+
* - `unitProperty` (string) - Name of the data source field that contains the unit/currency text
|
|
311
|
+
* - `displayUnit` (boolean) - The property applies to currency values only and defines if the currency
|
|
312
|
+
* is shown in the column. The default value is `true`.
|
|
313
|
+
* - `trueValue` (string) - Textual representation of a boolean type that has the value `true`
|
|
314
|
+
* - `falseValue` (string) - Textual representation of a boolean type that has the value `false`
|
|
315
|
+
* - `template` (string) - Formatting template that supports indexed placeholders within curly brackets
|
|
316
|
+
*
|
|
317
|
+
* - `inputFormat` (string) - Formatting template for string formatted dates
|
|
318
|
+
* - `utc` (boolean) - Defines whether the `DateTime` is displayed as UTC or local time
|
|
319
|
+
* - `valueMap` (string) - Mapping object or Map containing the values that should be mapped to a particular
|
|
320
|
+
* key
|
|
321
|
+
* - `wrap` (boolean) - Indicates if wrapping is enabled for this particular column
|
|
322
|
+
* - `workbook.context` - Context object that will be applied to the generated file. It may contain the
|
|
323
|
+
* following fields:
|
|
324
|
+
* - `application` (string) - The application that creates the XLSX document (default: "SAP UI5")
|
|
325
|
+
* - `version` (string) - Application version that creates the XLSX document (default: "${version}")
|
|
326
|
+
* - `title` (string) - Title of the XLSX document (NOT the filename)
|
|
327
|
+
* - `modifiedBy` (string) - User context for the XLSX document
|
|
328
|
+
* - `sheetName` (string) - The label of the data sheet
|
|
329
|
+
* - `metaSheetName` (string) - The label of the metadata sheet. The sheet will not be shown unless metadata
|
|
330
|
+
* entries are provided
|
|
331
|
+
* - `metainfo` (Array) - An Array of metadata groups. Each group has a name property and an items Array
|
|
332
|
+
* which contains key/value pairs
|
|
333
|
+
* - `workbook.hierarchyLevel` - Name of the property that contains the hierarchy level information of
|
|
334
|
+
* each line item
|
|
335
|
+
* - `dataSource` - Source of spreadsheet data. It can be a JSON array with row data, an URL or an OData
|
|
336
|
+
* properties object with the following fields:
|
|
337
|
+
* `type` (string) - Type of the data source. Currently, only OData is supported and the value have to
|
|
338
|
+
* be set to `"odata"`.
|
|
339
|
+
* - `dataUrl` (string) - URL to table data on the server, including all select, filter, and search query
|
|
340
|
+
* parameters
|
|
341
|
+
* - `serviceUrl` (string) - URL to the OData service. The parameter is required for OData batch requests.
|
|
342
|
+
*
|
|
343
|
+
* - `count` (number) - Count of available records on the server
|
|
344
|
+
* - `useBatch` (boolean) - Set to `true` if OData batch requests are used to fetch the spreadsheet data.
|
|
345
|
+
* In this case, `serviceUrl` and `headers` have to be specified, too.
|
|
346
|
+
* - `headers` (object) - Map of HTTP request header properties. They should correspond to the HTTP request
|
|
347
|
+
* headers that are used to obtain table data for display in the browser.
|
|
348
|
+
* - `sizeLimit` (number) - Maximal allowed number of records that can be obtained from the service in
|
|
349
|
+
* a single request
|
|
350
|
+
* - `count` (number) - The maximal number of records to export. If not specified, all data from the data
|
|
351
|
+
* source is fetched.
|
|
352
|
+
* - `worker` (boolean) - Run export process in a worker thread. Set to `false` to disable worker and
|
|
353
|
+
* run export in a main thread. This is needed, for example, if a mock server is used to provide spreadsheet
|
|
354
|
+
* data.
|
|
355
|
+
* **Note:** In case of a strict content security policy, it is not always possible to create an export
|
|
356
|
+
* worker. In this case, export runs in a main thread disregarding the `worker` value.
|
|
357
|
+
* - `fileName` (string) - Optional file name for the exported file. If not specified, the spreadsheet
|
|
358
|
+
* is exported as `export.xlsx`.
|
|
359
|
+
* - `showProgress` (boolean) - Set to `false` to suppress the progress dialog
|
|
360
|
+
*
|
|
361
|
+
* Usage: To start export, create a new `sap.ui.export.Spreadsheet` object and call the `build` method.
|
|
362
|
+
* Column configuration, data source, and export settings must be provided in the constructor. The `build`
|
|
363
|
+
* method opens a progress dialog and starts an asynchronous export process. The export process fetches
|
|
364
|
+
* data rows from the data source, builds a spreadsheet in-browser in a worker thread, and finally downloads
|
|
365
|
+
* the document to the client.
|
|
366
|
+
*
|
|
367
|
+
* Example:
|
|
368
|
+
* ```javascript
|
|
369
|
+
*
|
|
370
|
+
* var oSpreadsheet = new sap.ui.export.Spreadsheet(mSettings);
|
|
371
|
+
* oSpreadsheet.build();
|
|
372
|
+
* ```
|
|
373
|
+
*
|
|
374
|
+
*
|
|
375
|
+
* Optionally, you can attach `onprogress` event listeners to be notified about the export progress and
|
|
376
|
+
* follow the completion status of the returned `Promise`.
|
|
377
|
+
*
|
|
378
|
+
* Example:
|
|
379
|
+
* ```javascript
|
|
380
|
+
*
|
|
381
|
+
* var oSpreadsheet = new sap.ui.export.Spreadsheet(mSettings);
|
|
382
|
+
* oSpreadsheet.onprogress = function(iValue) {
|
|
383
|
+
* {@link sap.base.Log#debug Log.debug}("Export: %" + iValue + " completed");
|
|
384
|
+
* };
|
|
385
|
+
* oSpreadsheet.build()
|
|
386
|
+
* .then( function() { {@link sap.base.Log#debug Log.debug}("Export is finished"); })
|
|
387
|
+
* .catch( function(sMessage) { {@link sap.base.Log#error Log.error}("Export error: " + sMessage); });
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
*
|
|
391
|
+
* Example of column configuration:
|
|
392
|
+
* ```javascript
|
|
393
|
+
*
|
|
394
|
+
* var aColumns = [];
|
|
395
|
+
* aColumns.push({
|
|
396
|
+
* label: "Name",
|
|
397
|
+
* property: "name"
|
|
398
|
+
* });
|
|
399
|
+
* aColumns.push({
|
|
400
|
+
* label: "Salary",
|
|
401
|
+
* property: "salary",
|
|
402
|
+
* type: "number",
|
|
403
|
+
* scale: 2
|
|
404
|
+
* });
|
|
405
|
+
*
|
|
406
|
+
* var mSettings = {
|
|
407
|
+
* workbook: {
|
|
408
|
+
* columns: aColumns,
|
|
409
|
+
* context: {
|
|
410
|
+
* application: 'Debug Test Application',
|
|
411
|
+
* version: '${version}',
|
|
412
|
+
* title: 'Some random title',
|
|
413
|
+
* modifiedBy: 'John Doe',
|
|
414
|
+
* metaSheetName: 'Custom metadata',
|
|
415
|
+
* metainfo: [
|
|
416
|
+
* {
|
|
417
|
+
* name: 'Grouped Properties',
|
|
418
|
+
* items: [
|
|
419
|
+
* { key: 'administrator', value: 'Foo Bar' },
|
|
420
|
+
* { key: 'user', value: 'John Doe' },
|
|
421
|
+
* { key: 'server', value: 'server.domain.local' }
|
|
422
|
+
* ]
|
|
423
|
+
* },
|
|
424
|
+
* {
|
|
425
|
+
* name: 'Another Group',
|
|
426
|
+
* items: [
|
|
427
|
+
* { key: 'property', value: 'value' },
|
|
428
|
+
* { key: 'some', value: 'text' },
|
|
429
|
+
* { key: 'fu', value: 'bar' }
|
|
430
|
+
* ]
|
|
431
|
+
* }
|
|
432
|
+
* ]
|
|
433
|
+
* },
|
|
434
|
+
* hierarchyLevel: 'level'
|
|
435
|
+
* },
|
|
436
|
+
* dataSource: mDataSource,
|
|
437
|
+
* fileName: "salary.xlsx"
|
|
438
|
+
* };
|
|
439
|
+
* var oSpreadsheet = new sap.ui.export.Spreadsheet(mSettings);
|
|
440
|
+
* oSpreadsheet.build();
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
*
|
|
444
|
+
* Restrictions: For a complete list of restrictions, see: {@link topic:2c641481649f44de9c1c22c9c3c49d13
|
|
445
|
+
* Spreadsheet Export Restrictions}
|
|
446
|
+
*
|
|
447
|
+
* You can export only the primitive cell data types that are listed in {@link sap.ui.export.EdmType}. Icons,
|
|
448
|
+
* images, check boxes, and complex controls in UI5 table cells are not supported.
|
|
449
|
+
*
|
|
450
|
+
* Custom formatters in data binding are not supported.
|
|
451
|
+
*
|
|
452
|
+
* The size of an exported table is limited by available browser memory. Export of large data sets can lead
|
|
453
|
+
* to memory overflow errors. Therefore, do not use `sap.ui.export.Spreadsheet` with data tables containing
|
|
454
|
+
* more than 2,000,000 table cells on desktop computers and more than 100,000 cells on mobile devices. Consider
|
|
455
|
+
* a specialized export solution in such cases. For example, MS Excel® can import spreadsheets from an OData
|
|
456
|
+
* services directly, without any UI.
|
|
457
|
+
*
|
|
458
|
+
* The export process runs in a worker thread whenever possible. However, code injection to native XMLHttpRequest
|
|
459
|
+
* events is not available in the worker environment. Therefore, the `worker` parameter in export settings
|
|
460
|
+
* should be set to `false` if the application uses a mock server to fetch table data.
|
|
461
|
+
*
|
|
462
|
+
* For exporting hierarchy level information, the maximum hierarchy depth is 8. This restriction results
|
|
463
|
+
* from the Office Open XML standard and the programs that can open such files. The sap.ui.export.Spreadsheet
|
|
464
|
+
* allows you to export more hierarchy levels although they might not be displayed correctly when opening
|
|
465
|
+
* the generated file if the hierarchy depth exceeds the value of 8.
|
|
466
|
+
*
|
|
467
|
+
* The column configuration must contain at least one column to execute the export process. If there is
|
|
468
|
+
* no column configured, the export will be canceled.
|
|
469
|
+
*
|
|
470
|
+
* If the export is used within a table, any row that is showing aggregated data (i.E. sum row) will not
|
|
471
|
+
* be exported.
|
|
472
|
+
*
|
|
473
|
+
* The properties sheetName and metaSheetName on the workbook.context object are limited to 31 characters
|
|
474
|
+
* each. If their value exceeds this maximum length, the value will be truncated.
|
|
475
|
+
* See:
|
|
476
|
+
* {@link topic:2691788a08fc43f7bf269ea7c6336caf Spreadsheet}
|
|
477
|
+
*/
|
|
478
|
+
constructor(
|
|
479
|
+
/**
|
|
480
|
+
* Export settings
|
|
481
|
+
*/
|
|
482
|
+
mSettings: {
|
|
483
|
+
/**
|
|
484
|
+
* Spreadsheet properties
|
|
485
|
+
*/
|
|
486
|
+
workbook: {
|
|
487
|
+
/**
|
|
488
|
+
* Column configuration
|
|
489
|
+
*/
|
|
490
|
+
columns: any[];
|
|
491
|
+
/**
|
|
492
|
+
* Export context that will be applied to the exported file
|
|
493
|
+
*/
|
|
494
|
+
context?: {
|
|
495
|
+
/**
|
|
496
|
+
* Application that created this XLSX
|
|
497
|
+
*/
|
|
498
|
+
application?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Application version that was used to create this XLSX
|
|
501
|
+
*/
|
|
502
|
+
version?: string;
|
|
503
|
+
/**
|
|
504
|
+
* Title of the XLSX document (NOT the file name)
|
|
505
|
+
*/
|
|
506
|
+
title?: string;
|
|
507
|
+
/**
|
|
508
|
+
* User context for the exported document
|
|
509
|
+
*/
|
|
510
|
+
modifiedBy?: string;
|
|
511
|
+
/**
|
|
512
|
+
* The name of the data sheet that will be shown in Excel
|
|
513
|
+
*/
|
|
514
|
+
sheetName?: string;
|
|
515
|
+
/**
|
|
516
|
+
* The name of the metadata sheet that will be shown in Excel
|
|
517
|
+
*/
|
|
518
|
+
metaSheetName?: string;
|
|
519
|
+
/**
|
|
520
|
+
* Optional Metadata that will be displayed in the additional Metadata Sheet
|
|
521
|
+
*/
|
|
522
|
+
metainfo?: any[];
|
|
523
|
+
};
|
|
524
|
+
/**
|
|
525
|
+
* Optional name of the property that contains hierarchy level information
|
|
526
|
+
*/
|
|
527
|
+
hierarchyLevel?: string;
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* Source of spreadsheet data. A JSON array, data source properties map, `sap.ui.model.ListBinding`, `sap.ui.model.TreeBinding`
|
|
531
|
+
* or URL to an OData source can be provided. For example, `"someUrl"` is an equivalent to `{dataUrl:"someUrl",
|
|
532
|
+
* type:"OData"}`. An instance of `sap.ui.model.ListBinding` or `sap.ui.model.TreeBinding` either has to
|
|
533
|
+
* implement a `#getDownloadUrl` function or needs to be a ClientListBinding. **Note:** `sap.ui.model.ClientTreeBinding`
|
|
534
|
+
* is not supported.
|
|
535
|
+
*/
|
|
536
|
+
dataSource:
|
|
537
|
+
| string
|
|
538
|
+
| {
|
|
539
|
+
/**
|
|
540
|
+
* Maximal allowed number of records that can be obtained from the service in a single request
|
|
541
|
+
*/
|
|
542
|
+
sizeLimit: int;
|
|
543
|
+
}
|
|
544
|
+
| any[]
|
|
545
|
+
| ListBinding
|
|
546
|
+
| TreeBinding;
|
|
547
|
+
/**
|
|
548
|
+
* The maximal number of records to export
|
|
549
|
+
*/
|
|
550
|
+
count?: int;
|
|
551
|
+
/**
|
|
552
|
+
* Run export process in a worker thread. Set to `false` to disable worker and run export in a main thread.
|
|
553
|
+
* This is needed, for example, if a mock server is used to provide spreadsheet data.
|
|
554
|
+
* **Note:** In case of a strict content security policy, it is not always possible to create an export
|
|
555
|
+
* worker. In this case, export runs in a main thread disregarding the `worker` value.
|
|
556
|
+
*/
|
|
557
|
+
worker?: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Optional file name for the exported file
|
|
560
|
+
*/
|
|
561
|
+
fileName?: string;
|
|
562
|
+
/**
|
|
563
|
+
* Set to `false` to suppress the progress dialog
|
|
564
|
+
*/
|
|
565
|
+
showProgress?: boolean;
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* @SINCE 1.61
|
|
571
|
+
*
|
|
572
|
+
* Attaches event handler `fnFunction` to the {@link sap.ui.export.Spreadsheet#event:beforeSave} event of
|
|
573
|
+
* this `sap.ui.export.Spreadsheet`.
|
|
574
|
+
* When called, the context of the event handler (its `this`) will be bound to `oListener` if specified,
|
|
575
|
+
* otherwise it will be bound to this `sap.ui.export.Spreadsheet` itself.
|
|
576
|
+
* This event is fired just before the generated file is saved to the file system.
|
|
577
|
+
*
|
|
578
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
579
|
+
*/
|
|
580
|
+
attachBeforeSave(
|
|
581
|
+
/**
|
|
582
|
+
* An application-specific payload object that will be passed to the event handler along with the event
|
|
583
|
+
* object when firing the event
|
|
584
|
+
*/
|
|
585
|
+
oData: object,
|
|
586
|
+
/**
|
|
587
|
+
* The function to be called when the event occurs
|
|
588
|
+
*/
|
|
589
|
+
fnHandler: Function,
|
|
590
|
+
/**
|
|
591
|
+
* Context object to call the event handler with. Defaults to this `sap.ui.export.Spreadsheet` itself
|
|
592
|
+
*/
|
|
593
|
+
oListener?: object
|
|
594
|
+
): this;
|
|
595
|
+
/**
|
|
596
|
+
* @SINCE 1.61
|
|
597
|
+
*
|
|
598
|
+
* Attaches event handler `fnFunction` to the {@link sap.ui.export.Spreadsheet#event:beforeSave} event of
|
|
599
|
+
* this `sap.ui.export.Spreadsheet`.
|
|
600
|
+
* When called, the context of the event handler (its `this`) will be bound to `oListener` if specified,
|
|
601
|
+
* otherwise it will be bound to this `sap.ui.export.Spreadsheet` itself.
|
|
602
|
+
* This event is fired just before the generated file is saved to the file system.
|
|
603
|
+
*
|
|
604
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
605
|
+
*/
|
|
606
|
+
attachBeforeSave(
|
|
607
|
+
/**
|
|
608
|
+
* The function to be called when the event occurs
|
|
609
|
+
*/
|
|
610
|
+
fnHandler: Function,
|
|
611
|
+
/**
|
|
612
|
+
* Context object to call the event handler with. Defaults to this `sap.ui.export.Spreadsheet` itself
|
|
613
|
+
*/
|
|
614
|
+
oListener?: object
|
|
615
|
+
): this;
|
|
616
|
+
/**
|
|
617
|
+
* @SINCE 1.52
|
|
618
|
+
*
|
|
619
|
+
* Cancels a running export process. This method does nothing if no export is running.
|
|
620
|
+
*
|
|
621
|
+
* @returns - Reference to `this` in order to allow method chaining
|
|
622
|
+
*/
|
|
623
|
+
cancel(): this;
|
|
624
|
+
/**
|
|
625
|
+
* @SINCE 1.61
|
|
626
|
+
*
|
|
627
|
+
* Detaches event handler `fnFunction` from the {@link sap.ui.export.Spreadsheet beforeSave} event of this
|
|
628
|
+
* `sap.ui.export.Spreadsheet`.
|
|
629
|
+
* The passed function and listener object must match the ones used for event registration.
|
|
630
|
+
*
|
|
631
|
+
* @returns Reference to `this` in order to allow method chaining
|
|
632
|
+
*/
|
|
633
|
+
detachBeforeSave(
|
|
634
|
+
/**
|
|
635
|
+
* The function to be called, when the event occurs
|
|
636
|
+
*/
|
|
637
|
+
fnHandler: Function,
|
|
638
|
+
/**
|
|
639
|
+
* Context object on which the given function had to be called
|
|
640
|
+
*/
|
|
641
|
+
oListener?: object
|
|
642
|
+
): this;
|
|
643
|
+
/**
|
|
644
|
+
* @SINCE 1.112
|
|
645
|
+
*
|
|
646
|
+
* Returns the specific MIME type
|
|
647
|
+
*
|
|
648
|
+
* @returns MIME type for Office Open XML Spreadsheet
|
|
649
|
+
*/
|
|
650
|
+
getMimeType(): string;
|
|
651
|
+
/**
|
|
652
|
+
* @SINCE 1.73
|
|
653
|
+
*
|
|
654
|
+
* Sets the data source configuration that will be used for exporting the data. If the passed parameter
|
|
655
|
+
* is null, the call will be ignored.
|
|
656
|
+
*
|
|
657
|
+
* @returns - Valid dataSource object or null in case the dataSource configuration is not supported
|
|
658
|
+
*/
|
|
659
|
+
processDataSource(
|
|
660
|
+
/**
|
|
661
|
+
* Possible types are a plain string that contains an URL of an OData service, an array of JSON objects,
|
|
662
|
+
* a data source configuration, a `sap.ui.model.ListBinding` or `sap.ui.model.TreeBinding`
|
|
663
|
+
*/
|
|
664
|
+
oDataSource: string | any[] | Object | ListBinding | TreeBinding
|
|
665
|
+
): object | null;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
declare module "sap/ui/export/util/Filter" {
|
|
670
|
+
import BaseObject from "sap/ui/base/Object";
|
|
671
|
+
|
|
672
|
+
import Metadata from "sap/ui/base/Metadata";
|
|
673
|
+
|
|
674
|
+
import SimpleType from "sap/ui/model/SimpleType";
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* @SINCE 1.110
|
|
678
|
+
*
|
|
679
|
+
* The `sap.ui.export.util.Filter` class represents filter settings that are used for the export. It provides
|
|
680
|
+
* the capability to have a visual representation of the filters in the exported document and offers convenience
|
|
681
|
+
* functions like `sap.ui.export.util.Filter#setType` to improve the result.
|
|
682
|
+
*/
|
|
683
|
+
export default class Filter extends BaseObject {
|
|
684
|
+
/**
|
|
685
|
+
* Representation of filter settings that are used for exporting.
|
|
686
|
+
*/
|
|
687
|
+
constructor(
|
|
688
|
+
/**
|
|
689
|
+
* Name of the technical filter property
|
|
690
|
+
*/
|
|
691
|
+
sProperty: string,
|
|
692
|
+
/**
|
|
693
|
+
* Raw filter object
|
|
694
|
+
*/
|
|
695
|
+
vRawFilter:
|
|
696
|
+
| {
|
|
697
|
+
/**
|
|
698
|
+
* Filter operator
|
|
699
|
+
*/
|
|
700
|
+
operator: string;
|
|
701
|
+
/**
|
|
702
|
+
* Filter value(s)
|
|
703
|
+
*/
|
|
704
|
+
value: string | string[];
|
|
705
|
+
/**
|
|
706
|
+
* Defines whether it is an exclude filter
|
|
707
|
+
*/
|
|
708
|
+
exclude?: boolean;
|
|
709
|
+
}
|
|
710
|
+
| Array<{
|
|
711
|
+
/**
|
|
712
|
+
* Filter operator
|
|
713
|
+
*/
|
|
714
|
+
operator: string;
|
|
715
|
+
/**
|
|
716
|
+
* Filter value(s)
|
|
717
|
+
*/
|
|
718
|
+
value: string | string[];
|
|
719
|
+
/**
|
|
720
|
+
* Defines whether it is an exclude filter
|
|
721
|
+
*/
|
|
722
|
+
exclude?: boolean;
|
|
723
|
+
}>,
|
|
724
|
+
/**
|
|
725
|
+
* Optional label for the filter property
|
|
726
|
+
*/
|
|
727
|
+
sLabel?: string
|
|
728
|
+
);
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Creates a new subclass of class sap.ui.export.util.Filter with name `sClassName` and enriches it with
|
|
732
|
+
* the information contained in `oClassInfo`.
|
|
733
|
+
*
|
|
734
|
+
* `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}.
|
|
735
|
+
*
|
|
736
|
+
* @returns Created class / constructor function
|
|
737
|
+
*/
|
|
738
|
+
static extend<T extends Record<string, unknown>>(
|
|
739
|
+
/**
|
|
740
|
+
* Name of the class being created
|
|
741
|
+
*/
|
|
742
|
+
sClassName: string,
|
|
743
|
+
/**
|
|
744
|
+
* Object literal with information about the class
|
|
745
|
+
*/
|
|
746
|
+
oClassInfo?: sap.ClassInfo<T, Filter>,
|
|
747
|
+
/**
|
|
748
|
+
* Constructor function for the metadata object; if not given, it defaults to the metadata implementation
|
|
749
|
+
* used by this class
|
|
750
|
+
*/
|
|
751
|
+
FNMetaImpl?: Function
|
|
752
|
+
): Function;
|
|
753
|
+
/**
|
|
754
|
+
* Returns a metadata object for class sap.ui.export.util.Filter.
|
|
755
|
+
*
|
|
756
|
+
* @returns Metadata object describing this class
|
|
757
|
+
*/
|
|
758
|
+
static getMetadata(): Metadata;
|
|
759
|
+
/**
|
|
760
|
+
* @SINCE 1.110
|
|
761
|
+
*
|
|
762
|
+
* Returns the filter label if available. Otherwise the name of the filter property will be returned.
|
|
763
|
+
*
|
|
764
|
+
* @returns Filter label
|
|
765
|
+
*/
|
|
766
|
+
getLabel(): string;
|
|
767
|
+
/**
|
|
768
|
+
* @SINCE 1.110
|
|
769
|
+
*
|
|
770
|
+
* Returns the technical name of the property on which the filter is applied.
|
|
771
|
+
*
|
|
772
|
+
* @returns Name of the property
|
|
773
|
+
*/
|
|
774
|
+
getProperty(): string;
|
|
775
|
+
/**
|
|
776
|
+
* @SINCE 1.110
|
|
777
|
+
*
|
|
778
|
+
* Returns the formatted filter value(s) as string. If there are multiple filters for the same property,
|
|
779
|
+
* which are combined via `OR`, it will return a semicolon-separated list of the filter values including
|
|
780
|
+
* their operators.
|
|
781
|
+
*
|
|
782
|
+
* @returns Formatted and semicolon-separated filter settings
|
|
783
|
+
*/
|
|
784
|
+
getValue(): string;
|
|
785
|
+
/**
|
|
786
|
+
* @SINCE 1.110
|
|
787
|
+
*
|
|
788
|
+
* Uses the given format function to format all filter values. The function has to accept a single parameter
|
|
789
|
+
* of type `string` and needs to return a string value. The function will be called for every single raw
|
|
790
|
+
* value without the corresponding filter operator.
|
|
791
|
+
*
|
|
792
|
+
* If there is a "between" filter, the function will be called twice. In case of an error, the function
|
|
793
|
+
* call will be skipped, and the raw value will be taken instead.
|
|
794
|
+
*
|
|
795
|
+
* The format function has priority over the type-dependent format. To reset the format function and return
|
|
796
|
+
* to type-dependent formatting, the format function needs to be set to `null`.
|
|
797
|
+
*/
|
|
798
|
+
setFormat(
|
|
799
|
+
/**
|
|
800
|
+
* Format function that will be applied to the raw values
|
|
801
|
+
*/
|
|
802
|
+
fnFormat: Function
|
|
803
|
+
): void;
|
|
804
|
+
/**
|
|
805
|
+
* @SINCE 1.110
|
|
806
|
+
*
|
|
807
|
+
* Takes the given string as label of the filter.
|
|
808
|
+
*/
|
|
809
|
+
setLabel(
|
|
810
|
+
/**
|
|
811
|
+
* Filter label
|
|
812
|
+
*/
|
|
813
|
+
sLabel: string
|
|
814
|
+
): void;
|
|
815
|
+
/**
|
|
816
|
+
* @SINCE 1.110
|
|
817
|
+
*
|
|
818
|
+
* Uses the given `sap.ui.model.SimpleType` instance to format the filter values accordingly.
|
|
819
|
+
*/
|
|
820
|
+
setType(
|
|
821
|
+
/**
|
|
822
|
+
* Type instance that is used for formatting
|
|
823
|
+
*/
|
|
824
|
+
oType: SimpleType
|
|
825
|
+
): void;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
declare namespace sap {
|
|
830
|
+
interface IUI5DefineDependencyNames {
|
|
831
|
+
"sap/ui/export/ExportBase": undefined;
|
|
832
|
+
|
|
833
|
+
"sap/ui/export/ExportHandler": undefined;
|
|
834
|
+
|
|
835
|
+
"sap/ui/export/ExportUtils": undefined;
|
|
836
|
+
|
|
837
|
+
"sap/ui/export/library": undefined;
|
|
838
|
+
|
|
839
|
+
"sap/ui/export/Spreadsheet": undefined;
|
|
840
|
+
|
|
841
|
+
"sap/ui/export/util/Filter": undefined;
|
|
842
|
+
}
|
|
843
|
+
}
|