@progress/kendo-spreadsheet-common 1.0.0-develop.1 → 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/README.md CHANGED
@@ -1,9 +1,34 @@
1
- # Kendo UI for Angular
1
+ ![Kendo UI Logo](/kendo-ui-banner.svg)
2
2
 
3
- This package is part of the [Kendo UI for Angular](http://www.telerik.com/kendo-angular-ui/) suite.
3
+ ## Professional Grade UI Components
4
+
5
+ This package is part of the [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/) and [KendoReact](https://www.telerik.com/kendo-react-ui/components/#react-components) suites.
4
6
 
5
7
  ## License
6
8
 
7
- This is commercial software. To use it, you need to agree to the [**Telerik End User License Agreement for Kendo UI Complete**](http://www.telerik.com/purchase/license-agreement/kendo-ui-complete). If you do not own a commercial license, this file shall be governed by the trial license terms.
9
+ This is commercial software. To use it, you need to agree to the [**Telerik End User License Agreement for Kendo UI** (for Kendo UI for Angular)](http://www.telerik.com/purchase/license-agreement/kendo-ui) or to the [**End User License Agreement for Progress KendoReact** (for KendoReact)](https://www.telerik.com/purchase/license-agreement/progress-kendoreact). If you do not own a commercial license, this file shall be governed by the trial license terms.
8
10
 
9
11
  All available Kendo UI commercial licenses may be obtained at http://www.telerik.com/purchase/kendo-ui.
12
+
13
+ ## Kendo UI for Angular Resources and Feedback
14
+
15
+ - [Get Started](https://www.telerik.com/kendo-angular-ui/getting-started)
16
+ - [Component References](https://www.telerik.com/kendo-angular-ui/components)
17
+ - [Blogs](http://www.telerik.com/blogs/kendo-ui)
18
+ - [FAQ](https://www.telerik.com/kendo-angular-ui/components/faq/)
19
+ - [GitHub Issues](https://github.com/telerik/kendo-angular/issues)
20
+ - [Feedback Portal](http://kendoui-feedback.telerik.com/forums/555517-kendo-ui-for-angular-2-feedback)
21
+ - [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-ui-angular2)
22
+
23
+ ## KendoReact Resources and Feedback
24
+
25
+ - [Get Started](https://www.telerik.com/kendo-react-ui/getting-started)
26
+ - [Component References](https://www.telerik.com/kendo-react-ui/components/#react-components)
27
+ - [Blogs](http://www.telerik.com/blogs/kendo-ui)
28
+ - [GitHub Issues](https://github.com/telerik/kendo-react/issues)
29
+ - [Feedback Portal](http://kendoui-feedback.telerik.com/forums/908425-kendo-ui-for-react-feedback)
30
+ - [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-react-ui)
31
+
32
+ *Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
33
+
34
+ *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
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: {
@@ -27778,6 +27779,14 @@ class Spreadsheet extends Widget {
27778
27779
  this.element.addEventListener("keydown", this._keyDown.bind(this));
27779
27780
  }
27780
27781
 
27782
+ get view() {
27783
+ return this._view;
27784
+ }
27785
+
27786
+ get workbook () {
27787
+ return this._workbook;
27788
+ }
27789
+
27781
27790
  _keyDown(e) {
27782
27791
  let key = e.keyCode;
27783
27792
 
@@ -27982,8 +27991,8 @@ class Spreadsheet extends Widget {
27982
27991
  return this._workbook.saveJSON();
27983
27992
  }
27984
27993
 
27985
- fromFile(blob, name) {
27986
- return this._workbook.fromFile(blob, name);
27994
+ fromFile(blob) {
27995
+ return this._workbook.fromFile(blob);
27987
27996
  }
27988
27997
 
27989
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: {
@@ -27778,6 +27779,14 @@
27778
27779
  this.element.addEventListener("keydown", this._keyDown.bind(this));
27779
27780
  }
27780
27781
 
27782
+ get view() {
27783
+ return this._view;
27784
+ }
27785
+
27786
+ get workbook () {
27787
+ return this._workbook;
27788
+ }
27789
+
27781
27790
  _keyDown(e) {
27782
27791
  let key = e.keyCode;
27783
27792
 
@@ -27982,8 +27991,8 @@
27982
27991
  return this._workbook.saveJSON();
27983
27992
  }
27984
27993
 
27985
- fromFile(blob, name) {
27986
- return this._workbook.fromFile(blob, name);
27994
+ fromFile(blob) {
27995
+ return this._workbook.fromFile(blob);
27987
27996
  }
27988
27997
 
27989
27998
  saveAsPDF(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-spreadsheet-common",
3
3
  "description": "Kendo UI platform-independent Spreadsheet library",
4
- "version": "1.0.0-develop.1",
4
+ "version": "1.0.0-develop.3",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
@@ -19,20 +19,18 @@
19
19
  "e2e:visual": "jest --config ./jest.e2e.visual.config.json",
20
20
  "prepare": "husky install"
21
21
  },
22
- "dependencies": {
22
+ "dependencies": {},
23
+ "peerDependencies": {
23
24
  "@progress/kendo-common": "^0.2.2",
24
25
  "@progress/kendo-date-math": "^1.5.10",
25
- "@progress/jszip-esm": "^1.0.3"
26
- },
27
- "peerDependencies": {
28
- "@progress/kendo-drawing": "^1.17.1",
26
+ "@progress/kendo-drawing": "^1.17.5",
27
+ "@progress/jszip-esm": "^1.0.3",
29
28
  "@progress/kendo-intl": "^3.1.1"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@commitlint/cli": "^17.3.0",
33
32
  "@commitlint/config-conventional": "^17.3.0",
34
- "@progress/kendo-e2e": "^1.2.2",
35
- "@progress/kendo-theme-default": "^5.0.0",
33
+ "@progress/kendo-e2e": "^1.3.0",
36
34
  "@types/jest": "^29.0.0",
37
35
  "es-jest": "^2.1.0",
38
36
  "eslint": "^8.28.0",
package/src/index.d.ts CHANGED
@@ -1 +1,401 @@
1
- export { Spreadsheet } from './spreadsheet';
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 {
305
+ constructor(element: HTMLElement, options: any);
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;
353
+
354
+ executeCommand(options: any): void;
355
+
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;
364
+
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
+ */
383
+ saveAsExcel(options: any): void;
384
+
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
+
400
+ destroy(): void;
401
+ }