@progress/kendo-spreadsheet-common 1.0.0-develop.8 → 1.0.0-develop.9

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 CHANGED
@@ -27744,7 +27744,7 @@ const events = [
27744
27744
  "dataBound"
27745
27745
  ];
27746
27746
 
27747
- class Spreadsheet extends Widget {
27747
+ class SpreadsheetWidget extends Widget {
27748
27748
  constructor(element, options$1) {
27749
27749
  super(element, deepExtend({}, options, options$1));
27750
27750
  this.events = events;
@@ -28225,4 +28225,4 @@ class Spreadsheet extends Widget {
28225
28225
  }
28226
28226
  }
28227
28227
 
28228
- export { Range$1 as Range, Sheet, Spreadsheet, View, Workbook };
28228
+ export { Range$1 as Range, Sheet, SpreadsheetWidget, View, Workbook };
package/dist/index.js CHANGED
@@ -27745,7 +27745,7 @@
27745
27745
  "dataBound"
27746
27746
  ];
27747
27747
 
27748
- class Spreadsheet extends Widget {
27748
+ class SpreadsheetWidget extends Widget {
27749
27749
  constructor(element, options$1) {
27750
27750
  super(element, deepExtend({}, options, options$1));
27751
27751
  this.events = events;
@@ -28228,7 +28228,7 @@
28228
28228
 
28229
28229
  exports.Range = Range$1;
28230
28230
  exports.Sheet = Sheet;
28231
- exports.Spreadsheet = Spreadsheet;
28231
+ exports.SpreadsheetWidget = SpreadsheetWidget;
28232
28232
  exports.View = View;
28233
28233
  exports.Workbook = Workbook;
28234
28234
 
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.8",
4
+ "version": "1.0.0-develop.9",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
package/src/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
 
2
2
  /* eslint-disable max-len */
3
+
4
+ /**
5
+ * Represents the default cell styles that will be applied to the sheet cells.
6
+ */
3
7
  export interface CellDefaultStyle {
4
8
  /**
5
9
  * The background [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) of the cell.
@@ -42,11 +46,14 @@ export interface CellDefaultStyle {
42
46
  wrap?: boolean;
43
47
  }
44
48
 
49
+ /**
50
+ * Configures the Excel export settings of the Spreadsheet.
51
+ */
45
52
  export interface ExcelExportSettings {
46
53
  /**
47
54
  * Specifies the file name of the exported Excel file.
48
55
  *
49
- * @default 'Spreadsheet.xslx'
56
+ * @default 'Workbook.xslx'
50
57
  */
51
58
  fileName?: string;
52
59
 
@@ -69,6 +76,9 @@ export interface ExcelExportSettings {
69
76
  proxyURL?: string | null;
70
77
  }
71
78
 
79
+ /**
80
+ * The SheetColumn object.
81
+ */
72
82
  export interface SheetColumn {
73
83
  /**
74
84
  * The zero-based index of the column. Required to ensure correct positioning.
@@ -81,6 +91,9 @@ export interface SheetColumn {
81
91
  width?: number;
82
92
  }
83
93
 
94
+ /**
95
+ * The CellBorder object.
96
+ */
84
97
  export interface CellBorder {
85
98
  /**
86
99
  * The border color of the cell. Many standard CSS formats are supported. However, the canonical form is #ccff00.
@@ -92,6 +105,9 @@ export interface CellBorder {
92
105
  size?: number;
93
106
  }
94
107
 
108
+ /**
109
+ * Represents the styles that will be applied to the cell.
110
+ */
95
111
  export interface Cell extends CellDefaultStyle {
96
112
  /**
97
113
  * The style information for the bottom border of the cell.
@@ -166,7 +182,13 @@ export interface Cell extends CellDefaultStyle {
166
182
  verticalAlign?: string;
167
183
  }
168
184
 
185
+ /**
186
+ * The SheetRow object.
187
+ */
169
188
  export interface SheetRow {
189
+ /**
190
+ * The cells in the row.
191
+ */
170
192
  cells?: Cell[];
171
193
 
172
194
  /**
@@ -185,6 +207,9 @@ export interface SheetRow {
185
207
  type?: string;
186
208
  }
187
209
 
210
+ /**
211
+ * Represents the props that will be applied a sheet and its content.
212
+ */
188
213
  export interface SheetDescriptor {
189
214
  /**
190
215
  * The active cell in the sheet, for example, `A1`.
@@ -233,13 +258,25 @@ export interface SheetDescriptor {
233
258
  */
234
259
  showGridLines?: boolean;
235
260
 
261
+ /**
262
+ * An array which contains the hyperlinks of the cells.
263
+ */
236
264
  hyperlinks?: { ref: string; target: string; }[];
237
265
 
266
+ /**
267
+ * The default cell styles that will be applied to the sheet cells.
268
+ */
238
269
  defaultCellStyle?: CellDefaultStyle;
239
270
 
271
+ /**
272
+ * An array which contains the drawings used in this sheet.
273
+ */
240
274
  drawings?: { topLeftCell: any; offsetX: number; offsetY: number; width: number; height: number; image: string; opacity: any; }[];
241
275
  }
242
276
 
277
+ /**
278
+ * Represents the configuration of a Spreadsheet document.
279
+ */
243
280
  export interface DocumentDescriptor {
244
281
  /**
245
282
  * The name of the currently active sheet. Must exactly match one of the sheet names.
@@ -250,7 +287,22 @@ export interface DocumentDescriptor {
250
287
  * An array which defines the document sheets and their content.
251
288
  */
252
289
  sheets?: SheetDescriptor[];
290
+
291
+ /**
292
+ * An array which holds the names of the sheets.
293
+ */
253
294
  names?: { value: string; name: string; sheet: string; localName: string; }[];
295
+
296
+ /**
297
+ * An object containing any images used in the Spreadsheet. The keys should be image ID-s
298
+ * (they are referenced by this ID in `sheets.drawings`) and the values should be image URLs.
299
+ * The image URLs can be either [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs), in which case the images are fully contained by the JSON,
300
+ * or can be external URLs.
301
+ * Note that when external URLs are used, they should reside on the same domain, or the server must
302
+ * be configured with the proper [CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS),
303
+ * for the Spreadsheet to be able to fetch binary image data using a XMLHttpRequest. If it cannot fetch
304
+ * the image, export to Excel or PDF might not work.
305
+ */
254
306
  images?: { [name: string]: string };
255
307
 
256
308
  /**
@@ -301,84 +353,323 @@ export interface DocumentDescriptor {
301
353
  rows?: number;
302
354
  }
303
355
 
356
+ /**
357
+ * The View object.
358
+ */
304
359
  export class View {
305
360
  constructor(element: HTMLElement, options: any);
361
+
362
+ /**
363
+ * A Boolean value which indicates if clipboard will be.
364
+ *
365
+ * @default true
366
+ */
306
367
  enableClipboard(enable: boolean): void;
368
+
369
+ /**
370
+ * Returns the workbook object of the View.
371
+ */
307
372
  workbook(workbook?: Workbook): void | Workbook;
373
+ /**
374
+ * @hidden
375
+ */
308
376
  sheet(sheet: Sheet): void;
377
+
378
+ /**
379
+ * Re-renders all data in the View.
380
+ */
309
381
  refresh(reason: any): void;
382
+ /**
383
+ * @hidden
384
+ */
310
385
  nameEditor: any;
386
+ /**
387
+ * @hidden
388
+ */
311
389
  bind(eventName: string, handler: any, one?: boolean): void;
312
390
  }
313
391
 
392
+ /**
393
+ * The props of the Workbook component.
394
+ */
314
395
  export class Workbook {
315
396
  constructor(options: any, view: View);
397
+
398
+ /**
399
+ * Executes a command with the passed options.
400
+ *
401
+ * @param options The object from where data will be loaded. This has to be the deserialized object, not the JSON string.
402
+ */
316
403
  execute(options: any): any;
404
+
405
+ /**
406
+ * Re-renders all data in the Workbook.
407
+ */
317
408
  refresh(reason: any): void;
409
+
410
+ /**
411
+ * A collection holding the commands available for undo and redo.
412
+ */
318
413
  undoRedoStack: any;
319
414
  }
320
415
 
416
+ /**
417
+ * Represents one or more rectangular regions of cells in a given Sheet.
418
+ */
321
419
  export class Range {
322
- background(value?: string): string;
420
+ /**
421
+ * Gets or sets the background color of the cells in the range.
422
+ * @param value Any valid [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
423
+ * @returns the current background color of the top-left cell of the range.
424
+ */
425
+ background(value?: Colo): string;
426
+ /**
427
+ * Gets or sets the bold state of the cells in the range.
428
+ * @param value True to make the text bold; false otherwise.
429
+ * @returns the current bold state of the top-left cell of the range.
430
+ */
323
431
  bold(value?: boolean): boolean;
432
+ /**
433
+ * Gets or sets the state of the bottom border of the cells. If the range includes more than a single cell, the setting is applied to all cells.
434
+ * @param value The border configuration object. It may contain size and color keys.
435
+ * @returns the current value of the top-left cell of the range.
436
+ */
324
437
  borderBottom(value?: CellBorder): CellBorder;
438
+ /**
439
+ * Gets or sets the state of the left border of the cells. If the range includes more than a single cell, the setting is applied to all cells.
440
+ * @param value The border configuration object. It may contain size and color keys.
441
+ * @returns the current value of the top-left cell of the range.
442
+ */
325
443
  borderLeft(value?: CellBorder): CellBorder;
444
+ /**
445
+ * Gets or sets the state of the right border of the cells. If the range includes more than a single cell, the setting is applied to all cells.
446
+ * @param value The border configuration object. It may contain size and color keys.
447
+ * @returns the current value of the top-left cell of the range.
448
+ */
326
449
  borderRight(value?: CellBorder): CellBorder;
450
+ /**
451
+ * Gets or sets the state of the top border of the cells. If the range includes more than a single cell, the setting is applied to all cells.
452
+ * @param value The border configuration object. It may contain size and color keys.
453
+ * @returns the current value of the top-left cell of the range.
454
+ */
327
455
  borderTop(value?: CellBorder): CellBorder;
456
+ /**
457
+ * Gets or sets the text color of the cells in the range.
458
+ * @param value - Any valid [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
459
+ * @returns the current text color of the top-left cell of the range.
460
+ */
328
461
  color(value?: string): string;
462
+ /**
463
+ * Clears the contents of the range cells.
464
+ * @param value An object which may contain `contentsOnly: true` or `formatOnly: true` key values. Clearing the format will remove the cell formatting and visual styles.
465
+ * If a parameter is not passed, the method will clear both the cells values and the formatting.
466
+ */
329
467
  clear(value?: { contentsOnly?: boolean; formatOnly: boolean }): void;
468
+ /**
469
+ * Gets or sets the disabled state of the cells in the range.
470
+ * @param value True to make the cell enabled; false to disable it.
471
+ * @returns the current disabled state of the top-left cell of the range.
472
+ */
330
473
  enable(value?: boolean): boolean;
474
+ /**
475
+ * Gets or sets the font family of the cells in the range.
476
+ * @param value The font family that should be set.
477
+ * @returns the font family of the top-left cell of the range.
478
+ */
331
479
  fontFamily(value?: string): string;
480
+ /**
481
+ * Gets or sets the font size of the cells in the range.
482
+ * @param value The font size (in pixels) that should be set.
483
+ * @returns the font size of the top-left cell of the range.
484
+ */
332
485
  fontSize(value?: number): number;
486
+ /**
487
+ * Executes a function for each cell in the range.
488
+ * @param value The function that will be executed against every cell. The function receives the following parameters:
489
+ * `rowIndex` - the row index of the cell,
490
+ * `columnIndex` - the column index of the cell,
491
+ * `cellProperties` - the cell properties
492
+ */
333
493
  forEachCell(value: (rowIndex: number, columnIndex: number, cellProperties: Cell) => void): void;
494
+ /**
495
+ * Gets or sets the format of the cells.
496
+ * @param value The new format for the cells.
497
+ * @returns the format of the top-left cell of the range. When used as a setter, format returns the Range object to allow chained calls.
498
+ */
334
499
  format(value?: string): string;
500
+ /**
501
+ * Gets or sets the formula of the cells.
502
+ * @param value The new formula of the cell. The string may optionally start with `=`.
503
+ * @returns the formula of the top-left cell of the range.
504
+ */
335
505
  formula(value?: string): string;
506
+ /**
507
+ * Gets or sets the value of the cells. This is similar to `value`, but it parses the argument as if it was entered through the text box:
508
+ * - if it starts with `=` (equal sign), a formula is set. This may throw an error if the formula is syntactically invalid. Example: `range("C1").input("=A1+B1")`.
509
+ * - if it looks like a number, a numeric value (not string) is set.
510
+ * - if it's `true` or `false` (case-insensitive) the respective boolean value is set.
511
+ * - if it's a `Date` object, or a string that can be parsed as a date, it is converted to the numerical representation of the date.
512
+ * - if it starts with `'` (single quote), a string containing the rest of the characters is set. Example: `range("A1").input("'TRUE")` — sets the text "TRUE", not the boolean.
513
+ * @param value The value to be set to the cells.
514
+ * @returns the current value of the top-left cell of the range.
515
+ */
336
516
  input(value?: string | number | Date): any;
517
+ /**
518
+ * Gets or sets the italic state of the cells in the range.
519
+ * @param value True will make the text of the cells italic; false otherwise.
520
+ * @returns the current italic state of the top-left cell of the range.
521
+ */
337
522
  italic(value?: boolean): boolean;
523
+ /**
524
+ * Gets or sets the hyperlink of the cells in the range.
525
+ * @param value Pass a string (the URL) to create a hyperlink. Pass `null` to remove the link. Omit argument to get the existing URL, if any.
526
+ * @returns the current hyperlink attribute of the top-left cell of the range.
527
+ */
338
528
  link(value?: string): any;
529
+ /**
530
+ * Sets the sheet selection to the range cells.
531
+ */
339
532
  select(): void;
533
+ /**
534
+ * Gets or sets the text alignment of the cells in the range.
535
+ * @param value One of the following values: "left", "center", "right" and "justify".
536
+ * @returns the current text alignment of the top-left cell of the range.
537
+ */
340
538
  textAlign(value?: string): string;
539
+ /**
540
+ * Gets or sets the value of the cells. If the cell has formula set, the value setting will clear it.
541
+ * @param value The value to be set to the cells.
542
+ * @returns the current value of the top-left cell of the range.
543
+ */
341
544
  value(value?: string | number | Date): any;
545
+ /**
546
+ * Gets or sets the vertical alignment of the cells in the range.
547
+ * @param value One of the following values: "top", "center" and "bottom".
548
+ * @returns the current text alignment of the top-left cell of the range.
549
+ */
342
550
  verticalAlign(value?: string): string;
551
+ /**
552
+ * Gets or sets the wrap of the range cells.
553
+ * @param value `true` if to enable wrapping, `false` otherwise.
554
+ * @returns the current wrap state of the top-left cell of the range.
555
+ */
343
556
  wrap(value?: boolean): boolean;
344
557
  }
345
558
 
559
+ /**
560
+ * The Sheet object.
561
+ */
346
562
  export class Sheet {
347
563
  constructor();
564
+
565
+ /**
566
+ * Changes the size of the rows and columns of the current sheet.
567
+ *
568
+ * @param newRows The rows of the sheet after the resizing.
569
+ *
570
+ * @param newCols The columns of the sheet after the resizing.
571
+ */
348
572
  resize(newRows: number, newCols: number): void;
573
+
574
+ /**
575
+ * Returns the name of the sheet.
576
+ */
349
577
  name(): string;
578
+
579
+ /**
580
+ * Returns a Range object based on the passed cells.
581
+ */
350
582
  range(cell: string): Range;
583
+
584
+ /**
585
+ * Returns the active cell in the sheet, for example, A1.
586
+ */
351
587
  activeCell(): any;
588
+
589
+ /**
590
+ * A Boolean value which indicates if the grid lines of the sheet will be displayed.
591
+ *
592
+ * @default true
593
+ */
352
594
  showGridLines(value?: any): any;
353
595
  }
354
596
 
597
+ /**
598
+ * @hidden
599
+ */
355
600
  export interface ExternalRef<T> {
356
601
  get current(): T | null;
357
602
  }
358
603
 
604
+ /**
605
+ * Represents the options that will be applied the Spreadsheet.
606
+ */
359
607
  export interface SpreadsheetOptions extends DocumentDescriptor {
608
+ /**
609
+ * The name of the sheet.
610
+ */
360
611
  name?: string,
612
+
613
+ /**
614
+ * @hidden
615
+ */
361
616
  sheetsbar?: boolean,
617
+
362
618
  /**
363
619
  * Configures the Excel export settings of the Spreadsheet.
364
620
  */
365
621
  excel?: ExcelExportSettings;
366
622
 
623
+ /**
624
+ * Sets the component messages.
625
+ */
367
626
  messages?: any;
368
627
 
628
+ /**
629
+ * Sets the component locale.
630
+ */
369
631
  locale?: string;
370
632
 
633
+ /**
634
+ * @hidden
635
+ */
371
636
  formulaBarInputRef?: ExternalRef<any>;
637
+ /**
638
+ * @hidden
639
+ */
372
640
  formulaCellInputRef?: ExternalRef<any>;
641
+ /**
642
+ * @hidden
643
+ */
373
644
  nameBoxRef?: ExternalRef<any>;
374
645
  }
375
646
 
376
- export class Spreadsheet {
647
+ /**
648
+ * Represents the Spreadsheet instance.
649
+ */
650
+ export class SpreadsheetWidget {
377
651
  constructor(element: HTMLElement, options: SpreadsheetOptions);
652
+
653
+ /**
654
+ * Returns the `View` object of the Spreadsheet.
655
+ */
378
656
  get view(): View;
657
+
658
+ /**
659
+ * Returns the `Workbook` object of the Spreadsheet.
660
+ */
379
661
  get workbook(): Workbook;
662
+
663
+ /**
664
+ * @hidden
665
+ */
380
666
  get options(): SpreadsheetOptions;
381
667
 
668
+ /**
669
+ * Executes the passed command against the selected cell/range.
670
+ *
671
+ * @param options An object containing the command name and the required by it options.
672
+ */
382
673
  executeCommand(options: any): void;
383
674
 
384
675
  /**
@@ -411,7 +702,7 @@ export class Spreadsheet {
411
702
  /**
412
703
  * Initiates the Excel export. Also fires the excelExport event.
413
704
  *
414
- * Node: Calling this method may trigger the built-in popup blocker of the browser.
705
+ * Note: Calling this method may trigger the built-in popup blocker of the browser.
415
706
  * To avoid that, always call it as a response to an end-user action, for example, a button click.
416
707
  */
417
708
  saveAsExcel(options: any): void;
@@ -431,7 +722,13 @@ export class Spreadsheet {
431
722
  */
432
723
  refresh(): void;
433
724
 
725
+ /**
726
+ * @hidden
727
+ */
434
728
  bind(eventName: string, handler: any, one?: boolean): void;
435
729
 
730
+ /**
731
+ * @hidden
732
+ */
436
733
  destroy(): void;
437
734
  }