jspreadsheet 10.2.0 → 10.2.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +21 -10
  2. package/dist/index.js +537 -537
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ declare namespace jspreadsheet {
27
27
  let history: History;
28
28
  /** Clipboard controller */
29
29
  let clipboard: ClipBoard;
30
+ /** Pause calculations */
31
+ function calculations(state: boolean) : void;
30
32
 
31
33
  /** Define the translations from english to any other language. Ex.{ 'hello': 'Ola', 'Successfully Saved': 'Salvo com sucesso' } */
32
34
  function setDictionary(dictionary: object) : void;
@@ -37,8 +39,8 @@ declare namespace jspreadsheet {
37
39
  /** Set extensions to the JSS spreadsheet. Example { formula, parser, render } */
38
40
  function setExtensions(extensions: object) : void;
39
41
 
40
- /** Destroy the spreadsheet. Full destroy will clear all JSS controllers and it is not possible to re-create a new spreadsheet if true is used, until refresh the page. */
41
- function destroy(element: HTMLElement, fullDestroy?: boolean) : void;
42
+ /** Destroy the spreadsheet. Full destroy will clear all JSS controllers and is not possible to re-create a new spreadsheet if true is used, until refresh the page. */
43
+ function destroy(element: HTMLElement | spreadsheetInstance, fullDestroy?: boolean) : void;
42
44
 
43
45
  /** Jspreadsheet parser extension. More info at: https://jspreadsheet.com/products */
44
46
  function parser(options: any) : void;
@@ -76,12 +78,15 @@ declare namespace jspreadsheet {
76
78
  }
77
79
 
78
80
  /** Images */
79
- interface Image {
80
- src: string,
81
+ interface Media {
82
+ type: 'image' | 'chart',
83
+ src?: string,
81
84
  top?: number,
82
85
  left?: number,
83
86
  width?: number,
84
87
  height?: number,
88
+ zIndex?: number,
89
+ options?: object,
85
90
  }
86
91
 
87
92
  /** New column object */
@@ -547,8 +552,6 @@ declare namespace jspreadsheet {
547
552
  title?: string;
548
553
  /** Determines whether the row is visible or not. */
549
554
  visible?: boolean;
550
- /** Inline style for the row element (tr tag). */
551
- style?: string;
552
555
  /** ID number that identifies the row. */
553
556
  id?: number;
554
557
  /** Number of rows that this row is grouped with. */
@@ -722,6 +725,8 @@ declare namespace jspreadsheet {
722
725
  onresizerow?: (worksheet: worksheetInstance, row: number | Array<number>, height: number | Array<number>, oldHeight: number | Array<number>) => void;
723
726
  /** After a column width change for one or more columns. */
724
727
  onresizecolumn?: (worksheet: worksheetInstance, column: number | Array<number>, width: number | Array<number>, oldWidth: number | Array<number>) => void;
728
+ /** Before the selection happens */
729
+ onbeforeselection?: (worksheet: worksheetInstance, px: number, py: number, ux: number, uy: number, origin?: object) => void | boolean;
725
730
  /** When the selection is changed. */
726
731
  onselection?: (worksheet: worksheetInstance, px: number, py: number, ux: number, uy: number, origin?: object) => void;
727
732
  /** Before the comments is added or updated. Return false to cancel the event, void to accept the action or a object. */
@@ -826,6 +831,10 @@ declare namespace jspreadsheet {
826
831
  onopencolumngroup?: (worksheet: object, column: number) => void
827
832
  /** When close a column group */
828
833
  onclosecolumngroup?: (worksheet: object, column: number) => void
834
+ /** Onchangemedia brings the new values and the affected objects */
835
+ onchangemedia?: (worksheet: object, newValue: object[], oldValue: object, affectedRecords: object[]) => void
836
+ /** Update references. When a table structure changes */
837
+ onchangereferences?: (worksheet: object, affected: object, deletedTokens: string[], deletedColumns: string[]) => void;
829
838
  /** General event handler */
830
839
  onevent?: (worksheet: worksheetInstance, method: string, a?: any, b?: any, c?: any, d?: any, e?: any, f?: any) => any
831
840
  /** Return false to cancel the contextMenu event, or return custom elements for the contextmenu. */
@@ -995,8 +1004,8 @@ declare namespace jspreadsheet {
995
1004
  wrap?: boolean;
996
1005
  /** Show the worksheet gridlines. Default: true */
997
1006
  gridline?: boolean;
998
- /** Floating images */
999
- images?: Image[];
1007
+ /** Floating images or charts. */
1008
+ media?: Media[];
1000
1009
  /** Cached values. This can be used to skip calculations during onload */
1001
1010
  cache?: Record<string, string|number>;
1002
1011
  }
@@ -1122,7 +1131,7 @@ declare namespace jspreadsheet {
1122
1131
  /** Navigation down */
1123
1132
  down: (shiftKey?: boolean, ctrlKey?: boolean, jump?: boolean) => void;
1124
1133
  /** If extension render exists, execute render extension else download CSV */
1125
- download: (includeHeaders?: boolean, processed?: boolean) => void;
1134
+ download: (includeHeaders?: boolean, processed?: boolean, csv?: boolean) => void;
1126
1135
  /** Download CSV */
1127
1136
  downloadCSV: (includeHeaders?: boolean, processed?: boolean) => void;
1128
1137
  /** Edition controllers */
@@ -1571,7 +1580,9 @@ declare namespace jspreadsheet {
1571
1580
  /** Refresh the toolbar based on the current worksheet */
1572
1581
  refreshToolbar: () => void;
1573
1582
  /** Add, update or delete a new worksheet floating image */
1574
- setImage: (index: number, info: Image) => void;
1583
+ setMedia: (items: Media[]) => void;
1584
+ /** List of all guids to delete. Can be charts and images */
1585
+ deleteMedia: (items: object[]|string[]) => void;
1575
1586
  /** Add a global formula to the tracking system. Use from formula pro. Only use if necessary. */
1576
1587
  setTracking: () => void;
1577
1588
  }