@progress/kendo-spreadsheet-common 1.0.0-develop.2 → 1.0.0-develop.3
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/dist/index-esm.js +4 -3
- package/dist/index.js +4 -3
- package/package.json +1 -1
- package/src/index.d.ts +392 -11
package/dist/index-esm.js
CHANGED
|
@@ -956,8 +956,9 @@ const options = {
|
|
|
956
956
|
headerHeight: 20,
|
|
957
957
|
headerWidth: 32,
|
|
958
958
|
excel: {
|
|
959
|
+
fileName: "Spreadsheet.xslx",
|
|
960
|
+
forceProxy: false,
|
|
959
961
|
proxyURL: "",
|
|
960
|
-
fileName: "Workbook.xlsx"
|
|
961
962
|
},
|
|
962
963
|
messages: {},
|
|
963
964
|
pdf: {
|
|
@@ -27990,8 +27991,8 @@ class Spreadsheet extends Widget {
|
|
|
27990
27991
|
return this._workbook.saveJSON();
|
|
27991
27992
|
}
|
|
27992
27993
|
|
|
27993
|
-
fromFile(blob
|
|
27994
|
-
return this._workbook.fromFile(blob
|
|
27994
|
+
fromFile(blob) {
|
|
27995
|
+
return this._workbook.fromFile(blob);
|
|
27995
27996
|
}
|
|
27996
27997
|
|
|
27997
27998
|
saveAsPDF(options) {
|
package/dist/index.js
CHANGED
|
@@ -956,8 +956,9 @@
|
|
|
956
956
|
headerHeight: 20,
|
|
957
957
|
headerWidth: 32,
|
|
958
958
|
excel: {
|
|
959
|
+
fileName: "Spreadsheet.xslx",
|
|
960
|
+
forceProxy: false,
|
|
959
961
|
proxyURL: "",
|
|
960
|
-
fileName: "Workbook.xlsx"
|
|
961
962
|
},
|
|
962
963
|
messages: {},
|
|
963
964
|
pdf: {
|
|
@@ -27990,8 +27991,8 @@
|
|
|
27990
27991
|
return this._workbook.saveJSON();
|
|
27991
27992
|
}
|
|
27992
27993
|
|
|
27993
|
-
fromFile(blob
|
|
27994
|
-
return this._workbook.fromFile(blob
|
|
27994
|
+
fromFile(blob) {
|
|
27995
|
+
return this._workbook.fromFile(blob);
|
|
27995
27996
|
}
|
|
27996
27997
|
|
|
27997
27998
|
saveAsPDF(options) {
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,20 +1,401 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
/* eslint-disable max-len */
|
|
3
|
+
export interface CellDefaultStyle {
|
|
4
|
+
/**
|
|
5
|
+
* The background [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) of the cell.
|
|
6
|
+
*/
|
|
7
|
+
background?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The text [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) of the cell.
|
|
11
|
+
*/
|
|
12
|
+
color?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The font family of the cell.
|
|
16
|
+
*/
|
|
17
|
+
fontFamily?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The font size of the cell in pixels.
|
|
21
|
+
*/
|
|
22
|
+
fontSize?: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* If set to `true`, sets the cell font to bold.
|
|
26
|
+
*/
|
|
27
|
+
bold?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* If set to `true`, sets the cell font to italic.
|
|
31
|
+
*/
|
|
32
|
+
italic?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* If set to `true`, sets the cell font to underline.
|
|
36
|
+
*/
|
|
37
|
+
underline?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* If set to `true`, sets the cell wrap.
|
|
41
|
+
*/
|
|
42
|
+
wrap?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ExcelExportSettings {
|
|
46
|
+
/**
|
|
47
|
+
* Specifies the file name of the exported Excel file.
|
|
48
|
+
*
|
|
49
|
+
* @default 'Spreadsheet.xslx'
|
|
50
|
+
*/
|
|
51
|
+
fileName?: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* If set to `true`, the content will be forwarded to proxyURL even if the browser supports the saving of files locally.
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
forceProxy?: boolean;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The URL of the server side proxy which will stream the file to the end user. A proxy will be used when the browser is not capable of saving files locally. Such browsers are IE version 9 and lower and Safari. The developer is responsible for implementing the server-side proxy. The proxy will return the decoded file with the `Content-Disposition` header set to `attachment; filename="<fileName.xslx>"`.
|
|
62
|
+
* The proxy will receive a POST request with the following parameters in the request body:
|
|
63
|
+
* - contentType - The MIME type of the file.
|
|
64
|
+
* - base64 - The base-64 encoded file content.
|
|
65
|
+
* - fileName - The file name as requested by the caller.
|
|
66
|
+
*
|
|
67
|
+
* @default null
|
|
68
|
+
*/
|
|
69
|
+
proxyURL?: string | null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface SheetColumn {
|
|
73
|
+
/**
|
|
74
|
+
* The zero-based index of the column. Required to ensure correct positioning.
|
|
75
|
+
*/
|
|
76
|
+
index?: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The width of the column in pixels. Defaults to columnWidth.
|
|
80
|
+
*/
|
|
81
|
+
width?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface CellBorder {
|
|
85
|
+
/**
|
|
86
|
+
* The border color of the cell. Many standard CSS formats are supported. However, the canonical form is #ccff00.
|
|
87
|
+
*/
|
|
88
|
+
color?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The width of the border in pixels.
|
|
91
|
+
*/
|
|
92
|
+
size?: number;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface Cell extends CellDefaultStyle {
|
|
96
|
+
/**
|
|
97
|
+
* The style information for the bottom border of the cell.
|
|
98
|
+
*/
|
|
99
|
+
borderBottom?: CellBorder;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The style information for the left border of the cell.
|
|
103
|
+
*/
|
|
104
|
+
borderLeft?: CellBorder;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The style information for the right border of the cell.
|
|
108
|
+
*/
|
|
109
|
+
borderRight?: CellBorder;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The style information for the top border of the cell.
|
|
113
|
+
*/
|
|
114
|
+
borderTop?: CellBorder;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* If set to `false`, disables the cell.
|
|
118
|
+
*/
|
|
119
|
+
enable?: boolean;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The format of the cell text. For more information, refer to the article on
|
|
123
|
+
* [creating or deleting a custom number format on MS Office](https://support.office.com/en-au/article/Create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4).
|
|
124
|
+
*/
|
|
125
|
+
format?: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The cell formula without the leading equals sign, for example, `A1 * 10`.
|
|
129
|
+
*/
|
|
130
|
+
formula?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* If set to `true`, renders the cell value as HTML.
|
|
134
|
+
* It is important to sanitize the value of the cell on the server for passing safe html because there is no client-side sanitizing.
|
|
135
|
+
* When editing a cell the new value can be checked and prevented in the client `changing` event.
|
|
136
|
+
*/
|
|
137
|
+
html?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The zero-based index of the cell. Required to ensure correct positioning.
|
|
141
|
+
*/
|
|
142
|
+
index?: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The hyperlink (URL) of the cell.
|
|
146
|
+
*/
|
|
147
|
+
link?: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The text-align setting for the cell content.
|
|
151
|
+
*
|
|
152
|
+
* The available options are: `left`, `center`, `right` or `justify`.
|
|
153
|
+
*/
|
|
154
|
+
textAlign?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The cell value.
|
|
158
|
+
*/
|
|
159
|
+
value?: number | string | boolean | Date;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The vertical align setting for the cell content.
|
|
163
|
+
*
|
|
164
|
+
* The available options are: `top`, `center` or `bottom`.
|
|
165
|
+
*/
|
|
166
|
+
verticalAlign?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface SheetRow {
|
|
170
|
+
cells?: Cell[];
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The row height in pixels. Defaults to rowHeight.
|
|
174
|
+
*/
|
|
175
|
+
height?: number;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The absolute row index. Required to ensure correct positioning.
|
|
179
|
+
*/
|
|
180
|
+
index?: number;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The table row element role in the context of the Grid table structure.
|
|
184
|
+
*/
|
|
185
|
+
type?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface SheetDescriptor {
|
|
189
|
+
/**
|
|
190
|
+
* The active cell in the sheet, for example, `A1`.
|
|
191
|
+
*/
|
|
192
|
+
activeCell?: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The name of the sheet.
|
|
196
|
+
*/
|
|
197
|
+
name?: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* An array which defines the columns in this sheet and their content.
|
|
201
|
+
*/
|
|
202
|
+
columns?: SheetColumn[];
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The number of frozen columns in this sheet.
|
|
206
|
+
*/
|
|
207
|
+
frozenColumns?: number;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The number of frozen rows in this sheet.
|
|
211
|
+
*/
|
|
212
|
+
frozenRows?: number;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* An array of merged cell ranges, for example, `B1:D2`.
|
|
216
|
+
*/
|
|
217
|
+
mergedCells?: string[];
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The row data for this sheet.
|
|
221
|
+
*/
|
|
222
|
+
rows?: SheetRow[];
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The selected range in the sheet, for example, `A1:B10`.
|
|
226
|
+
*/
|
|
227
|
+
selection?: string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* A Boolean value which indicates if the grid lines of the sheet will be displayed.
|
|
231
|
+
*
|
|
232
|
+
* @default true
|
|
233
|
+
*/
|
|
234
|
+
showGridLines?: boolean;
|
|
235
|
+
|
|
236
|
+
hyperlinks?: { ref: string; target: string; }[];
|
|
237
|
+
|
|
238
|
+
defaultCellStyle?: CellDefaultStyle;
|
|
239
|
+
|
|
240
|
+
drawings?: { topLeftCell: any; offsetX: number; offsetY: number; width: number; height: number; image: string; opacity: any; }[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface DocumentDescriptor {
|
|
244
|
+
/**
|
|
245
|
+
* The name of the currently active sheet. Must exactly match one of the sheet names.
|
|
246
|
+
*/
|
|
247
|
+
activeSheet?: string;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* An array which defines the document sheets and their content.
|
|
251
|
+
*/
|
|
252
|
+
sheets?: SheetDescriptor[];
|
|
253
|
+
names?: { value: string; name: string; sheet: string; localName: string; }[];
|
|
254
|
+
images?: { [name: string]: string };
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The default column width in pixels.
|
|
258
|
+
*
|
|
259
|
+
* @default 64
|
|
260
|
+
*/
|
|
261
|
+
columnWidth?: number;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The number of columns in the document.
|
|
265
|
+
*
|
|
266
|
+
* @default 50
|
|
267
|
+
*/
|
|
268
|
+
columns?: number;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The default cell styles that will be applied to the sheet cells.
|
|
272
|
+
*/
|
|
273
|
+
defaultCellStyle?: CellDefaultStyle;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The height of the header row in pixels.
|
|
277
|
+
*
|
|
278
|
+
* @default 20
|
|
279
|
+
*/
|
|
280
|
+
headerHeight?: number;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The width of the header column in pixels.
|
|
284
|
+
*
|
|
285
|
+
* @default 32
|
|
286
|
+
*/
|
|
287
|
+
headerWidth?: number;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The default row height in pixels.
|
|
291
|
+
*
|
|
292
|
+
* @default 20
|
|
293
|
+
*/
|
|
294
|
+
rowHeight?: number;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The number of rows in the document.
|
|
298
|
+
*
|
|
299
|
+
* @default 200
|
|
300
|
+
*/
|
|
301
|
+
rows?: number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export class View {
|
|
5
305
|
constructor(element: HTMLElement, options: any);
|
|
6
|
-
|
|
7
|
-
|
|
306
|
+
enableClipboard(enable: boolean): void;
|
|
307
|
+
workbook(workbook?: Workbook): void | Workbook;
|
|
308
|
+
sheet(sheet: Sheet): void;
|
|
309
|
+
refresh(reason: any): void;
|
|
310
|
+
nameEditor: any;
|
|
311
|
+
bind(eventName: string, handler: any, one?: boolean): void;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export class Workbook {
|
|
315
|
+
constructor(options: any, view: View);
|
|
316
|
+
execute(options: any): any;
|
|
317
|
+
refresh(reason: any): void;
|
|
318
|
+
undoRedoStack: any;
|
|
319
|
+
}
|
|
320
|
+
export class Sheet {
|
|
321
|
+
constructor();
|
|
322
|
+
resize(newRows: number, newCols: number): void;
|
|
323
|
+
name(): string;
|
|
324
|
+
range(cell: any): any;
|
|
325
|
+
activeCell(): any;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface ExternalRef<T> {
|
|
329
|
+
get current(): T | null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface SpreadsheetOptions extends DocumentDescriptor {
|
|
333
|
+
name?: string,
|
|
334
|
+
sheetsbar?: boolean,
|
|
335
|
+
/**
|
|
336
|
+
* Configures the Excel export settings of the Spreadsheet.
|
|
337
|
+
*/
|
|
338
|
+
excel?: ExcelExportSettings;
|
|
339
|
+
|
|
340
|
+
messages?: any;
|
|
341
|
+
|
|
342
|
+
locale?: string;
|
|
343
|
+
|
|
344
|
+
formulaBarInputRef?: ExternalRef<any>;
|
|
345
|
+
formulaCellInputRef?: ExternalRef<any>;
|
|
346
|
+
nameBoxRef?: ExternalRef<any>;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export class Spreadsheet {
|
|
350
|
+
constructor(element: HTMLElement, options: SpreadsheetOptions);
|
|
351
|
+
get view(): View;
|
|
352
|
+
get workbook(): Workbook;
|
|
8
353
|
|
|
9
354
|
executeCommand(options: any): void;
|
|
10
355
|
|
|
11
|
-
|
|
12
|
-
|
|
356
|
+
/**
|
|
357
|
+
* Loads the workbook data from an object with the format that is defined in the configuration.
|
|
358
|
+
*
|
|
359
|
+
* Note: All existing sheets and their data will be lost.
|
|
360
|
+
*
|
|
361
|
+
* @param json The object from where data will be loaded. This has to be the deserialized object, not the JSON string.
|
|
362
|
+
*/
|
|
363
|
+
fromJSON(json: DocumentDescriptor): void;
|
|
13
364
|
|
|
14
|
-
|
|
365
|
+
/**
|
|
366
|
+
* Serializes the workbook.
|
|
367
|
+
*/
|
|
368
|
+
toJSON(): DocumentDescriptor;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Clears the Spreadsheet and populates it with data from the specified Excel (.xlsx) file.
|
|
372
|
+
*
|
|
373
|
+
* @param blob The file or blob that is usually obtained through a file input.
|
|
374
|
+
*/
|
|
375
|
+
fromFile(file: File | Blob): void;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Initiates the Excel export. Also fires the excelExport event.
|
|
379
|
+
*
|
|
380
|
+
* Node: Calling this method may trigger the built-in popup blocker of the browser.
|
|
381
|
+
* To avoid that, always call it as a response to an end-user action, for example, a button click.
|
|
382
|
+
*/
|
|
15
383
|
saveAsExcel(options: any): void;
|
|
16
384
|
|
|
17
|
-
|
|
18
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Gets or sets the active sheet.
|
|
387
|
+
*/
|
|
388
|
+
activeSheet(sheet?: Sheet): Sheet | void;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Returns an array with the sheets in the workbook.
|
|
392
|
+
*/
|
|
393
|
+
sheets(): Sheet[];
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Re-renders all data in the Spreadsheet.
|
|
397
|
+
*/
|
|
398
|
+
refresh(): void;
|
|
399
|
+
|
|
19
400
|
destroy(): void;
|
|
20
401
|
}
|