jspreadsheet 8.0.41 → 8.0.42
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.d.ts +936 -884
- package/dist/index.js +504 -504
- package/dist/jspreadsheet.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,909 +3,961 @@
|
|
|
3
3
|
* https://jspreadsheet.com
|
|
4
4
|
* Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
5
|
*/
|
|
6
|
+
interface jspreadsheet {
|
|
7
|
+
(element?: HTMLElement, options?: Spreadsheet): Array<worksheetInstance>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
/** Set extensions to the JSS spreadsheet. Example { formula, parser, render } */
|
|
10
|
+
setExtensions(extensions: object) : void
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
[key: string]: any
|
|
13
|
+
}
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
interface Tabs {
|
|
16
|
+
/** Allow to create new tabs */
|
|
17
|
+
allowCreate?: boolean;
|
|
18
|
+
/** Hide headers */
|
|
19
|
+
hideHeaders?: boolean;
|
|
20
|
+
/** Allow drag and drop to change tabs position */
|
|
21
|
+
allowChangePosition?: boolean;
|
|
22
|
+
}
|
|
13
23
|
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
interface Toolbar {
|
|
25
|
+
/** Array of items for the toolbar */
|
|
26
|
+
items: Array<ToolbarItem>;
|
|
27
|
+
/** Responsive toolbar. Default: true. */
|
|
28
|
+
responsive?: boolean;
|
|
29
|
+
}
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
interface ToolbarItem {
|
|
32
|
+
/** Toolbar item type */
|
|
33
|
+
type?: 'icon' | 'divisor' | 'label' | 'select';
|
|
34
|
+
/** Content of the toolbar element */
|
|
35
|
+
content?: string;
|
|
36
|
+
/** Tooltip for the toolbar element */
|
|
37
|
+
tooltip?: string;
|
|
38
|
+
/** Toolbar element width */
|
|
39
|
+
width?: number;
|
|
40
|
+
/** The initial selected option for the type: select */
|
|
41
|
+
value?: string;
|
|
42
|
+
/** Render method parser for the elements in the dropdown when type: select */
|
|
43
|
+
render?: Function;
|
|
44
|
+
/** When a item is clicked */
|
|
45
|
+
onclick?: Function;
|
|
46
|
+
/** For the type select when a new item is selected */
|
|
47
|
+
onchange?: Function;
|
|
48
|
+
/** To update the state of this item **/
|
|
49
|
+
updateState?: Function;
|
|
50
|
+
}
|
|
19
51
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
52
|
+
interface Dropdown {
|
|
53
|
+
/** Render type: default | picker | searchbar */
|
|
54
|
+
type?: 'default' | 'picker' | 'searchbar';
|
|
55
|
+
/** Dropdown input placeholder */
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
/** The user can add new options to the dropdown. */
|
|
58
|
+
newOptions?: boolean;
|
|
59
|
+
/** Enabled the remote search features. */
|
|
60
|
+
remoteSearch?: boolean;
|
|
61
|
+
/** Remote backend to respond to the search. */
|
|
62
|
+
url?: string;
|
|
63
|
+
/** When the user add a new item to the dropdown. */
|
|
64
|
+
oninsert?: Function;
|
|
65
|
+
}
|
|
24
66
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
updateState?: Function;
|
|
44
|
-
}
|
|
67
|
+
interface DropdownItem {
|
|
68
|
+
/** Value of the selected item. */
|
|
69
|
+
id?: string | number;
|
|
70
|
+
/** Label for the selected item. */
|
|
71
|
+
name?: string;
|
|
72
|
+
/** Description of the item */
|
|
73
|
+
title?: string;
|
|
74
|
+
/** Icon of the item */
|
|
75
|
+
image?: string;
|
|
76
|
+
/** Name of the group where the item belongs to */
|
|
77
|
+
group?: string;
|
|
78
|
+
/** Keywords to help finding one item */
|
|
79
|
+
synonym?: Array<string>;
|
|
80
|
+
/** Item is disabled */
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/** Color for the item */
|
|
83
|
+
color?: string;
|
|
84
|
+
}
|
|
45
85
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
86
|
+
interface Calendar {
|
|
87
|
+
/** Render type. Default: 'default' */
|
|
88
|
+
type?: 'default' | 'year-month-picker';
|
|
89
|
+
/** Disable the dates out of the defined range. */
|
|
90
|
+
validRange?: Array<number>;
|
|
91
|
+
/** The calendar starts in a day of week (0 for Sunday - 6 for Saturday). Default: 0 (Sunday) */
|
|
92
|
+
format?: string;
|
|
93
|
+
/** Calendar input is readonly */
|
|
94
|
+
readonly?: boolean;
|
|
95
|
+
/** Select today automatically when no date value is defined. */
|
|
96
|
+
today?: boolean;
|
|
97
|
+
/** Show hour and minute dropdown. */
|
|
98
|
+
time?: boolean;
|
|
99
|
+
/** Show reset button. Default: true */
|
|
100
|
+
resetButton?: boolean;
|
|
101
|
+
/** Calendar input placeholder. */
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
}
|
|
60
104
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
interface Column {
|
|
106
|
+
/** Define the column type. Can be a string to define a native editor, or a method to define the custom editor plugin. */
|
|
107
|
+
type?: Editor | 'autocomplete' | 'calendar' | 'checkbox' | 'color' | 'dropdown' | 'hidden' | 'html' | 'image' | 'numeric' | 'radio' | 'text';
|
|
108
|
+
/** Column title */
|
|
109
|
+
title?: string;
|
|
110
|
+
/** Name or a path of a property when the data is a JSON object. */
|
|
111
|
+
name?: string;
|
|
112
|
+
/** Define the onmouseover tooltip for the column header. */
|
|
113
|
+
tooltip?: string;
|
|
114
|
+
/** Width of the column */
|
|
115
|
+
width?: number;
|
|
116
|
+
/** Visibility of a column */
|
|
117
|
+
visible?: boolean,
|
|
118
|
+
/** Column alignment. Default: center */
|
|
119
|
+
align?: 'center' | 'left' | 'right' | 'justify';
|
|
120
|
+
/** It is a method to overwrite the column definitions in real-time just before the column edition. */
|
|
121
|
+
filterOptions?: Function;
|
|
122
|
+
/** Load the items from the dropdown from a remote URL. */
|
|
123
|
+
url?: string;
|
|
124
|
+
/** Define the items in the dropdown and autocomplete column type. */
|
|
125
|
+
source?: Array<DropdownItem>;
|
|
126
|
+
/** Define the dropdown or autocomplete to accept multiple options. */
|
|
127
|
+
multiple?: boolean;
|
|
128
|
+
/** Define the input mask for the data cell. @see https://jsuites.net/v4/javascript-mask */
|
|
129
|
+
mask?: string;
|
|
130
|
+
/** Decimal representation character. */
|
|
131
|
+
decimal?: '.' | ',';
|
|
132
|
+
/** Truncate the string in the cell by any number of characters. */
|
|
133
|
+
truncate?: number,
|
|
134
|
+
/** Disable the mask when editing. */
|
|
135
|
+
disabledMaskOnEdition?: boolean;
|
|
136
|
+
/** It defines a renderer method or rule for the cell content. */
|
|
137
|
+
render?: string | Function;
|
|
138
|
+
/** Define the format of the date or numbers in the cell. Default for the calendar: DD/MM/YYYY */
|
|
139
|
+
format?: string;
|
|
140
|
+
/** Define the column as primaryKey. */
|
|
141
|
+
primaryKey?: boolean;
|
|
142
|
+
/** Extended configuration for one column. */
|
|
143
|
+
options?: Calendar | Dropdown;
|
|
144
|
+
/** The column is read-only */
|
|
145
|
+
readOnly?: boolean;
|
|
146
|
+
/** Wrap the text in the column */
|
|
147
|
+
wordWrap?: boolean;
|
|
148
|
+
/** Process the raw data when copy or download. Default: true */
|
|
149
|
+
process?: boolean;
|
|
150
|
+
}
|
|
79
151
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
format?: string;
|
|
87
|
-
/** Calendar input is readonly */
|
|
88
|
-
readonly?: boolean;
|
|
89
|
-
/** Select today automatically when no date value is defined. */
|
|
90
|
-
today?: boolean;
|
|
91
|
-
/** Show hour and minute dropdown. */
|
|
92
|
-
time?: boolean;
|
|
93
|
-
/** Show reset button. Default: true */
|
|
94
|
-
resetButton?: boolean;
|
|
95
|
-
/** Calendar input placeholder. */
|
|
96
|
-
placeholder?: string;
|
|
97
|
-
}
|
|
152
|
+
interface Row {
|
|
153
|
+
/** Row height in pixels. */
|
|
154
|
+
height?: number;
|
|
155
|
+
/** Row identification. */
|
|
156
|
+
title?: string;
|
|
157
|
+
}
|
|
98
158
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
visible?: boolean,
|
|
112
|
-
/** Column alignment. Default: center */
|
|
113
|
-
align?: 'center' | 'left' | 'right' | 'justify';
|
|
114
|
-
/** It is a method to overwrite the column definitions in real-time just before the column edition. */
|
|
115
|
-
filterOptions?: Function;
|
|
116
|
-
/** Load the items from the dropdown from a remote URL. */
|
|
117
|
-
url?: string;
|
|
118
|
-
/** Define the items in the dropdown and autocomplete column type. */
|
|
119
|
-
source?: Array<DropdownItem>;
|
|
120
|
-
/** Define the dropdown or autocomplete to accept multiple options. */
|
|
121
|
-
multiple?: boolean;
|
|
122
|
-
/** Define the input mask for the data cell. @see https://jsuites.net/v4/javascript-mask */
|
|
123
|
-
mask?: string;
|
|
124
|
-
/** Decimal representation character. */
|
|
125
|
-
decimal?: '.' | ',';
|
|
126
|
-
/** Truncate the string in the cell by any number of characters. */
|
|
127
|
-
truncate?: number,
|
|
128
|
-
/** Disable the mask when editing. */
|
|
129
|
-
disabledMaskOnEdition?: boolean;
|
|
130
|
-
/** It defines a renderer method or rule for the cell content. */
|
|
131
|
-
render?: string | Function;
|
|
132
|
-
/** Define the format of the date or numbers in the cell. Default for the calendar: DD/MM/YYYY */
|
|
133
|
-
format?: string;
|
|
134
|
-
/** Define the column as primaryKey. */
|
|
135
|
-
primaryKey?: boolean;
|
|
136
|
-
/** Extended configuration for one column. */
|
|
137
|
-
options?: Calendar | Dropdown;
|
|
138
|
-
/** The column is read-only */
|
|
139
|
-
readOnly?: boolean;
|
|
140
|
-
/** Wrap the text in the column */
|
|
141
|
-
wordWrap?: boolean;
|
|
142
|
-
/** Process the raw data when copy or download. Default: true */
|
|
143
|
-
process?: boolean;
|
|
144
|
-
}
|
|
159
|
+
interface Editor {
|
|
160
|
+
/** createCell When a new cell is created. */
|
|
161
|
+
createCell: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
162
|
+
/** updateCell When the cell value changes. */
|
|
163
|
+
updateCell: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
164
|
+
/** openEditor When the user starts the edition of a cell. */
|
|
165
|
+
openEditor: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
166
|
+
/** closeEditor When the user finalizes the edition of a cell. */
|
|
167
|
+
closeEditor: (cell: HTMLElement, confirmChanges: boolean, x: number, y: number, instance: object, options: object) => any;
|
|
168
|
+
/** get Transform the raw data into processed data. It will shown a text instead of an id in the type dropdown for example. */
|
|
169
|
+
get: (options: object, value: any) => String
|
|
170
|
+
}
|
|
145
171
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
172
|
+
interface Plugin {
|
|
173
|
+
/** When a new worksheet is added. */
|
|
174
|
+
init?: (worksheet: Object) => void;
|
|
175
|
+
/** It would receive a call for every spreadsheet event. */
|
|
176
|
+
onevent?: (event: String, a?: any, b?: any, c?: any, d?: any) => void;
|
|
177
|
+
/** When the spreadsheet needs to save something in the server. */
|
|
178
|
+
persistence?: (method: String, args: Object) => void;
|
|
179
|
+
/** When the user opens the context menu. */
|
|
180
|
+
contextMenu?: (instance: Object, x: Number, y: Number, e: MouseEvent, items: [], section: String, a: any, b?: any) => void;
|
|
181
|
+
/** When the toolbar is create and clicked. */
|
|
182
|
+
toolbar?: (instance: Object, items: []) => void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface Nested {
|
|
186
|
+
/** Nested header title */
|
|
187
|
+
title?: string;
|
|
188
|
+
/** Nested header tooltip */
|
|
189
|
+
tooltip?: string;
|
|
190
|
+
/** Nested header colspan */
|
|
191
|
+
colspan?: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
interface Spreadsheet {
|
|
195
|
+
/** Your application name */
|
|
196
|
+
application? : string;
|
|
197
|
+
/** Render a remote spreadsheet from Jspreadsheet Cloud, which is a serveless hosting service. That can be generate at https://jspreadsheet.com/cloud */
|
|
198
|
+
cloud? : string;
|
|
199
|
+
/** DOM element for binding the javascript events. This property is normally used when JSS is running as a web component. */
|
|
200
|
+
root? : HTMLElement;
|
|
201
|
+
/** Global defined names. It defines global range variables. **/
|
|
202
|
+
definedNames?: Record<string, string>,
|
|
203
|
+
/** Global sorting handler. **/
|
|
204
|
+
sorting?: (direction: boolean, column: number) => number;
|
|
205
|
+
/** Remote URL for the persistence server **/
|
|
206
|
+
server?: string;
|
|
207
|
+
|
|
208
|
+
/** Toolbar */
|
|
209
|
+
toolbar?: boolean | Toolbar;
|
|
210
|
+
|
|
211
|
+
/** Allow table edition */
|
|
212
|
+
editable?: boolean;
|
|
213
|
+
/** Allow data export */
|
|
214
|
+
allowExport?: boolean;
|
|
215
|
+
/** Include the table headers in the first row of the data */
|
|
216
|
+
includeHeadersOnDownload?: boolean;
|
|
217
|
+
/** Force update on paste for read-only cells */
|
|
218
|
+
forceUpdateOnPaste?: boolean;
|
|
219
|
+
/** Enable loading spin when loading data. Default: false. */
|
|
220
|
+
loadingSpin?: boolean;
|
|
221
|
+
/** Render jspreadsheet spreadsheet on full screen mode. Default: false */
|
|
222
|
+
fullscreen?: boolean;
|
|
223
|
+
/** Make sure the formulas are capital letter. Default: true */
|
|
224
|
+
secureFormulas?: boolean;
|
|
225
|
+
/** Enable formula debug. Default: false **/
|
|
226
|
+
debugFormulas?: boolean,
|
|
227
|
+
/** Execute formulas. Default: true */
|
|
228
|
+
parseFormulas?: boolean;
|
|
229
|
+
/** Disable the formula editor. Default: true **/
|
|
230
|
+
editorFormulas?: boolean;
|
|
231
|
+
/** Auto increment cell data when using the corner copy, including formulas, numbers and dates. Default: true */
|
|
232
|
+
autoIncrement?: boolean;
|
|
233
|
+
/** Try to cast numbers from cell values when executing formulas. Default: true */
|
|
234
|
+
autoCasting?: boolean;
|
|
235
|
+
/** Remove any HTML from the data and headers. Default: true */
|
|
236
|
+
stripHTML?: boolean;
|
|
237
|
+
/** Allow tabs. Default: false */
|
|
238
|
+
tabs?: boolean | Tabs;
|
|
239
|
+
/** Allow the user to delete worksheets. Default: true **/
|
|
240
|
+
allowDeleteWorksheet?: boolean;
|
|
241
|
+
/** Allow the user to rename worksheets. Default: true **/
|
|
242
|
+
allowRenameWorksheet?: boolean;
|
|
243
|
+
/** Allow the user to drag and drop the worksheets. Default: true **/
|
|
244
|
+
allowMoveWorksheet?: boolean;
|
|
245
|
+
/** This method is called when the data in the spreadsheet is ready. */
|
|
246
|
+
onload?: (spreadsheet: spreadsheetInstance) => void;
|
|
247
|
+
/** Spreadsheet is clicked **/
|
|
248
|
+
onclick?: (worksheet: worksheetInstance, section: string, x: number, y: number) => void;
|
|
249
|
+
/** When undo is applied */
|
|
250
|
+
onundo?: (worksheet: worksheetInstance, historyRecord: object) => void;
|
|
251
|
+
/** When redo is applied */
|
|
252
|
+
onredo?: (worksheet: worksheetInstance, historyRecord: object) => void;
|
|
253
|
+
/** Before any data is sent to the backend. Can be used to overwrite the data or to cancel the action when return false. */
|
|
254
|
+
onbeforesave?: (spreadsheet: spreadsheetInstance, worksheet: worksheetInstance, data: object) => boolean | object;
|
|
255
|
+
/** After something is saved */
|
|
256
|
+
onsave?: (spreadsheet: spreadsheetInstance, worksheet: worksheetInstance, data: []) => void;
|
|
257
|
+
/** Before a column value is changed. NOTE: It is possible to overwrite the original value, by return a new value on this method. */
|
|
258
|
+
onbeforechange?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number, value: any) => boolean | any;
|
|
259
|
+
/** After a column value is changed. */
|
|
260
|
+
onchange?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number, newValue: any, oldValue: any) => void;
|
|
261
|
+
/** Event: onafterchanges(jspreadsheetHTMLElement, jspreadsheetInstance) */
|
|
262
|
+
onafterchanges?: (worksheet: worksheetInstance, records: Array<any>) => void;
|
|
263
|
+
/** When a copy is performed in the spreadsheet. Any string returned will overwrite the user data or return null to progress with the default behavior. */
|
|
264
|
+
oncopy?: (worksheet: worksheetInstance, selectedCells: [], data: string) => boolean | string;
|
|
265
|
+
/** Before the paste action is performed. Can return parsed or filtered data. It is possible to cancel the action when the return is false. */
|
|
266
|
+
onbeforepaste?: (worksheet: worksheetInstance, data: [], x: number, y: number, style: [], processedData: string) => boolean | [];
|
|
267
|
+
/** After a paste action is performed in the spreadsheet. */
|
|
268
|
+
onpaste?: (worksheet: worksheetInstance, records: Array<any>) => void;
|
|
269
|
+
/** Before a new row is inserted. You can cancel the insert event by returning false. */
|
|
270
|
+
onbeforeinsertrow?: (worksheet: worksheetInstance, rowNumber: number, numOfRows: number, insertBefore: boolean) => boolean | void;
|
|
271
|
+
/** After a new row is inserted. */
|
|
272
|
+
oninsertrow?: (worksheet: worksheetInstance, rowNumber: number, numOfRows: number, rowData: [], insertBefore: boolean) => void;
|
|
273
|
+
/** Before a row is deleted. You can cancel the delete event by returning false. */
|
|
274
|
+
onbeforedeleterow?: (worksheet: worksheetInstance, rowNumber: number, numOfRows: number) => boolean | void;
|
|
275
|
+
/** After a row is excluded. */
|
|
276
|
+
ondeleterow?: (worksheet: worksheetInstance, rowNumber: number, numOfRows: number, rowHTMLElements: [], rowData: [], cellAttributes: []) => void;
|
|
277
|
+
/** Before a new column is inserted. You can cancel the insert event by returning false. */
|
|
278
|
+
onbeforeinsertcolumn?: (worksheet: worksheetInstance, columnNumber: number, numOfColumns: number, insertBefore: boolean) => boolean | void;
|
|
279
|
+
/** After a new column is inserted. */
|
|
280
|
+
oninsertcolumn?: (worksheet: worksheetInstance, columnNumber: number, numOfColumns: number, historyRecords: [], insertBefore: boolean) => void;
|
|
281
|
+
/** Before a column is excluded. You can cancel the insert event by returning false. */
|
|
282
|
+
onbeforedeletecolumn?: (worksheet: worksheetInstance, columnNumber: number, numOfColumns: number) => boolean | void;
|
|
283
|
+
/** After a column is excluded. */
|
|
284
|
+
ondeletecolumn?: (worksheet: worksheetInstance, columnNumber: number, numOfColumns: number, affectedHTMLElements: [], historyProperties: [], cellAttributes: []) => void;
|
|
285
|
+
/** After a row is moved to a new position. */
|
|
286
|
+
onmoverow?: (worksheet: worksheetInstance, origin: number, destination: number) => void;
|
|
287
|
+
/** After a column is moved to a new position. */
|
|
288
|
+
onmovecolumn?: (worksheet: worksheetInstance, origin: number, destination: number) => void;
|
|
289
|
+
/** After a height change for one or more rows. */
|
|
290
|
+
onresizerow?: (worksheet: worksheetInstance, row: number | Array<number>, height: number | Array<number>, oldHeight: number | Array<number>) => void;
|
|
291
|
+
/** After a column width change for one or more columns. */
|
|
292
|
+
onresizecolumn?: (worksheet: worksheetInstance, column: number | Array<number>, width: number | Array<number>, oldWidth: number | Array<number>) => void;
|
|
293
|
+
/** When the selection is changed. */
|
|
294
|
+
onselection?: (worksheet: worksheetInstance, px: number, py: number, ux: number, uy: number, origin?: object) => void;
|
|
295
|
+
/** Before a new comment is added or updated. Return false to cancel the event. */
|
|
296
|
+
onbeforecomments?: (worksheet: worksheetInstance, cells: object) => boolean | void;
|
|
297
|
+
/** After a new comment is added or updated. */
|
|
298
|
+
oncomments?: (worksheet: worksheetInstance, newValues: object, previousValues: object) => void;
|
|
299
|
+
/** It runs before sorting a column. It should return an array with a custom sorting or false to cancel the user action. */
|
|
300
|
+
onbeforesort?: (worksheet: worksheetInstance, column: number, direction: number, newOrderValues: []) => boolean | [] | void;
|
|
301
|
+
/** When a column is sorted. */
|
|
302
|
+
onsort?: (worksheet: worksheetInstance, column: number, direction: number, newOrderValues: []) => void;
|
|
303
|
+
/** When the spreadsheed gets the focus. */
|
|
304
|
+
onfocus?: (worksheet: worksheetInstance) => void;
|
|
305
|
+
/** When the spreadsheet loses the focus. */
|
|
306
|
+
onblur?: (worksheet: worksheetInstance) => void;
|
|
307
|
+
/** When merge cells is executed. */
|
|
308
|
+
onmerge?: (worksheet: worksheetInstance, newValue: object, oldValue: object) => void;
|
|
309
|
+
/** When the header title is changed. */
|
|
310
|
+
onchangeheader?: (worksheet: worksheetInstance, column: number, newValue: string, oldValue: string) => void;
|
|
311
|
+
/** When the footers are created or updated. */
|
|
312
|
+
onchangefooter?: (worksheet: worksheetInstance, newValue: string, oldValue: string) => void;
|
|
313
|
+
/** When the value in a cell footer is changed. */
|
|
314
|
+
onchangefootervalue?: (worksheet: worksheetInstance, x: number, y: number, value: String) => void;
|
|
152
315
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
createCell: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
156
|
-
/** updateCell When the cell value changes. */
|
|
157
|
-
updateCell: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
158
|
-
/** openEditor When the user starts the edition of a cell. */
|
|
159
|
-
openEditor: (cell: HTMLElement, value: any, x: number, y: number, instance: object, options: object) => any;
|
|
160
|
-
/** closeEditor When the user finalizes the edition of a cell. */
|
|
161
|
-
closeEditor: (cell: HTMLElement, confirmChanges: boolean, x: number, y: number, instance: object, options: object) => any;
|
|
162
|
-
/** get Transform the raw data into processed data. It will shown a text instead of an id in the type dropdown for example. */
|
|
163
|
-
get: (options: object, value: any) => String
|
|
164
|
-
}
|
|
316
|
+
/** On change nested headers */
|
|
317
|
+
onchangenested?: (worksheet: worksheetInstance, options: object) => void;
|
|
165
318
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
init?: (worksheet: Object) => void;
|
|
169
|
-
/** It would receive a call for every spreadsheet event. */
|
|
170
|
-
onevent?: (event: String, a?: any, b?: any, c?: any, d?: any) => void;
|
|
171
|
-
/** When the spreadsheet needs to save something in the server. */
|
|
172
|
-
persistence?: (method: String, args: Object) => void;
|
|
173
|
-
/** When the user opens the context menu. */
|
|
174
|
-
contextMenu?: (instance: Object, x: Number, y: Number, e: MouseEvent, items: [], section: String, a: any, b?: any) => void;
|
|
175
|
-
/** When the toolbar is create and clicked. */
|
|
176
|
-
toolbar?: (instance: Object, items: []) => void;
|
|
177
|
-
}
|
|
319
|
+
/** On change nested cell properties */
|
|
320
|
+
onchangenestedcell?: (worksheet: worksheetInstance, x: number, y: number, properties: object) => void;
|
|
178
321
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
322
|
+
/** When an editor is created. */
|
|
323
|
+
oncreateeditor?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number, element: HTMLElement, options: object) => void;
|
|
324
|
+
/** When the editor is opened. **/
|
|
325
|
+
oneditionstart?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number) => void;
|
|
326
|
+
/** When the editor is closed. **/
|
|
327
|
+
oneditionend?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number, newValue: any, save: boolean) => void;
|
|
328
|
+
/** When the style of a cell is changed. */
|
|
329
|
+
onchangestyle?: (worksheet: worksheetInstance, newValue: object, oldValue: object) => void;
|
|
330
|
+
/** When a cell meta information is added or updated. */
|
|
331
|
+
onchangemeta?: (worksheet: worksheetInstance, newValue: object) => void;
|
|
332
|
+
/** Before the page is changed. Can cancel the action when return is false. */
|
|
333
|
+
onbeforechangepage?: (worksheet: worksheetInstance, pageNumber: number, oldPage: number, quantityPerPage: number) => boolean | void;
|
|
334
|
+
/** When pagination is enabled and the user changes the page. */
|
|
335
|
+
onchangepage?: (worksheet: worksheetInstance, pageNumber: number, oldPageNumber: number, quantityPerPage: number) => void;
|
|
336
|
+
/** Add or change the options of a new worksheet. */
|
|
337
|
+
onbeforecreateworksheet?: (worksheetOptions: Worksheet, position: number) => Object;
|
|
338
|
+
/** When the user creates a new worksheet. */
|
|
339
|
+
oncreateworksheet?: (worksheet: worksheetInstance, worksheetOptions: Worksheet, position: number) => void;
|
|
340
|
+
/** When the user renames a worksheet. */
|
|
341
|
+
onrenameworksheet?: (worksheet: worksheetInstance, position: number, newValue: string, oldValue: string) => void;
|
|
342
|
+
/** When the user deletes a worksheet. */
|
|
343
|
+
ondeleteworksheet?: (worksheet: worksheetInstance, position: number) => void;
|
|
344
|
+
/** When the user updates the worksheet tab position. */
|
|
345
|
+
onmoveworksheet?: (worksheet: worksheetInstance, from: number, to: number) => void;
|
|
346
|
+
/** When the user opens a worksheet. */
|
|
347
|
+
onopenworksheet?: (worksheet: worksheetInstance, index: number) => void;
|
|
348
|
+
/** When there is a row id update */
|
|
349
|
+
onchangerowid?: (worksheet: worksheetInstance, rows: []) => void;
|
|
350
|
+
/** Action to be executed before searching. The accepted method return would be: null to continue with the default behavior, false to cancel the user action or an array with the row numbers to overwrite the default result. */
|
|
351
|
+
onbeforesearch?: (worksheet: worksheetInstance, query: string, results: []) => [] | boolean | void;
|
|
352
|
+
/** After the search is applied to the rows. */
|
|
353
|
+
onsearch?: (worksheet: worksheetInstance, query: string, results: []) => void;
|
|
354
|
+
/** Action to be executed before filtering rows. It can cancel the action by returning false. */
|
|
355
|
+
onbeforefilter?: (worksheet: worksheetInstance, filters: [], data: []) => void;
|
|
356
|
+
/** After the filter has been applied to the rows. */
|
|
357
|
+
onfilter?: (worksheet: worksheetInstance, filters: [], data: []) => void;
|
|
358
|
+
/** When a new cell is created **/
|
|
359
|
+
oncreatecell?: (worksheet: worksheetInstance, cell: HTMLElement, x: number, y: number, value: any) => void;
|
|
360
|
+
/** Run every single table update action. Can bring performance issues if perform too much changes. */
|
|
361
|
+
updateTable?: (worksheet: worksheetInstance, cell: Object, x: number, y: number, value: String) => void;
|
|
362
|
+
/** Return false to cancel the contextMenu event, or return custom elements for the contextmenu. */
|
|
363
|
+
contextmenu?: (worksheet: worksheetInstance, x: number, y: number, e: Event, section: string, section_argument1?: any, section_argument2?: any) => [] | boolean;
|
|
364
|
+
/** The first row is the header titles when parsing a HTML table */
|
|
365
|
+
parseTableFirstRowAsHeader?: boolean,
|
|
366
|
+
/** Try to identify a column type when parsing a HTML table */
|
|
367
|
+
parseTableAutoCellType?: boolean,
|
|
368
|
+
/** Global cell wrapping. Default: false */
|
|
369
|
+
wordWrap?: boolean;
|
|
370
|
+
/** About information */
|
|
371
|
+
about?: string | Function,
|
|
372
|
+
/** License string */
|
|
373
|
+
license?: string,
|
|
374
|
+
/** Worksheets */
|
|
375
|
+
worksheets?: Array<Worksheet>;
|
|
376
|
+
}
|
|
187
377
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/** Before a column is excluded. You can cancel the insert event by returning false. */
|
|
272
|
-
onbeforedeletecolumn?: (worksheet: worksheetInstance, columnNumber: Number, numOfColumns: Number) => Boolean | undefined;
|
|
273
|
-
/** After a column is excluded. */
|
|
274
|
-
ondeletecolumn?: (worksheet: worksheetInstance, columnNumber: Number, numOfColumns: Number, affectedHTMLElements: [], historyProperties: [], cellAttributes: []) => void;
|
|
275
|
-
/** After a row is moved to a new position. */
|
|
276
|
-
onmoverow?: (worksheet: worksheetInstance, origin: Number, destination: Number) => void;
|
|
277
|
-
/** After a column is moved to a new position. */
|
|
278
|
-
onmovecolumn?: (worksheet: worksheetInstance, origin: Number, destination: Number) => void;
|
|
279
|
-
/** After a height change for one or more rows. */
|
|
280
|
-
onresizerow?: (worksheet: worksheetInstance, row: Number | [], height: Number | [], oldHeight: Number | []) => void;
|
|
281
|
-
/** After a column width change for one or more columns. */
|
|
282
|
-
onresizecolumn?: (worksheet: worksheetInstance, column: Number | [], width: Number | [], oldWidth: Number | []) => void;
|
|
283
|
-
/** When the selection is changed. */
|
|
284
|
-
onselection?: (worksheet: worksheetInstance, px: Number, py: Number, ux: Number, uy: Number, origin: Number) => void;
|
|
285
|
-
/** Before a new comment is added or updated. Return false to cancel the event. */
|
|
286
|
-
onbeforecomments?: (worksheet: worksheetInstance, cells: Object) => Boolean | undefined;
|
|
287
|
-
/** After a new comment is added or updated. */
|
|
288
|
-
oncomments?: (worksheet: worksheetInstance, cells: Object) => void;
|
|
289
|
-
/** It runs before sorting a column. It should return an array with a custom sorting or false to cancel the user action. */
|
|
290
|
-
onbeforesort?: (worksheet: worksheetInstance, column: Number, direction: Number, newOrderValues: []) => Boolean | [] | undefined;
|
|
291
|
-
/** When a column is sorted. */
|
|
292
|
-
onsort?: (worksheet: worksheetInstance, column: Number, direction: Number, newOrderValues: []) => void;
|
|
293
|
-
/** When the spreadsheed gets the focus. */
|
|
294
|
-
onfocus?: (worksheet: worksheetInstance) => void;
|
|
295
|
-
/** When the spreadsheet loses the focus. */
|
|
296
|
-
onblur?: (worksheet: worksheetInstance) => void;
|
|
297
|
-
/** When merge cells is executed. */
|
|
298
|
-
onmerge?: (worksheet: worksheetInstance, cellName: String, colspan: Number, rowspan: Number) => void;
|
|
299
|
-
/** When the header title is changed. */
|
|
300
|
-
onchangeheader?: (worksheet: worksheetInstance, column: Number, newValue: String, oldValue: String) => void;
|
|
301
|
-
/** When the footers are created or updated. */
|
|
302
|
-
onchangefooter?: (worksheet: worksheetInstance, column: Number, newValue: String, oldValue: String) => void;
|
|
303
|
-
/** When the value in a cell footer is changed. */
|
|
304
|
-
onchangefootervalue?: (worksheet: worksheetInstance, x: Number, y: Number, value: String) => void;
|
|
305
|
-
/** When an editor is created. */
|
|
306
|
-
oncreateeditor?: (worksheet: worksheetInstance, cell: HTMLElement, x: Number, y: Number, element: HTMLElement, options: Object) => void;
|
|
307
|
-
/** When the editor is opened. **/
|
|
308
|
-
oneditionstart?: (worksheet: worksheetInstance, cell: HTMLElement, x: Number, y: Number) => void;
|
|
309
|
-
/** When the editor is closed. **/
|
|
310
|
-
oneditionend?: (worksheet: worksheetInstance, cell: HTMLElement, x: Number, y: Number, newValue: [], save: Boolean) => void;
|
|
311
|
-
/** When the style of a cell is changed. */
|
|
312
|
-
onchangestyle?: (worksheet: worksheetInstance, mixed: [], key: String, value: String) => void;
|
|
313
|
-
/** When a cell meta information is added or updated. */
|
|
314
|
-
onchangemeta?: (worksheet: worksheetInstance, mixed: [], key: String, value: String) => void;
|
|
315
|
-
/** Before the page is changed. Can cancel the action when return is false. */
|
|
316
|
-
onbeforechangepage?: (worksheet: worksheetInstance, pageNumber: Number, oldPage: Number, quantityPerPage: Number) => Boolean | undefined;
|
|
317
|
-
/** When pagination is enabled and the user changes the page. */
|
|
318
|
-
onchangepage?: (worksheet: worksheetInstance, pageNumber: Number, oldPageNumber: Number) => void;
|
|
319
|
-
/** Add or change the options of a new worksheet. */
|
|
320
|
-
onbeforecreateworksheet?: (worksheet: Worksheet, index: Number) => Object;
|
|
321
|
-
/** When the user creates a new worksheet. */
|
|
322
|
-
oncreateworksheet?: (worksheet: worksheetInstance, options: Worksheet, index: Number) => void;
|
|
323
|
-
/** When the user renames a worksheet. */
|
|
324
|
-
onrenameworksheet?: (worksheet: worksheetInstance, worksheetNumber: Number, newValue: String, oldValue: String) => void;
|
|
325
|
-
/** >When the user deletes a worksheet. */
|
|
326
|
-
ondeleteworksheet?: (worksheet: worksheetInstance, worksheetNumber: Number) => void;
|
|
327
|
-
/** When the user updates the worksheet tab position. */
|
|
328
|
-
onmoveworksheet?: (worksheet: worksheetInstance, from: Number, to: Number) => void;
|
|
329
|
-
/** When the user opens a worksheet. */
|
|
330
|
-
onopenworksheet?: (worksheet: worksheetInstance, index: Number) => void;
|
|
331
|
-
/** When there is a row id update */
|
|
332
|
-
onchangerowid?: (worksheet: worksheetInstance, rows: []) => void;
|
|
333
|
-
/** Action to be executed before searching. The accepted method return would be: null to continue with the default behavior, false to cancel the user action or an array with the row numbers to overwrite the default result. */
|
|
334
|
-
onbeforesearch?: (worksheet: worksheetInstance, query: String, results: []) => [];
|
|
335
|
-
/** After the search is applied to the rows. */
|
|
336
|
-
onsearch?: (worksheet: worksheetInstance, query: String, results: []) => void;
|
|
337
|
-
/** Action to be executed before filtering rows. It can cancel the action by returning false. */
|
|
338
|
-
onbeforefilter?: (worksheet: worksheetInstance, filters: [], data: []) => void;
|
|
339
|
-
/** After the filter has been applied to the rows. */
|
|
340
|
-
onfilter?: (worksheet: worksheetInstance, filters: [], data: []) => void;
|
|
341
|
-
/** When a new cell is created **/
|
|
342
|
-
oncreatecell?: (worksheet: worksheetInstance, cell: HTMLElement, x: Number, y: Number, value: any) => void;
|
|
343
|
-
/** Run every single table update action. Can bring performance issues if perform too much changes. */
|
|
344
|
-
updateTable?: (worksheet: worksheetInstance, cell: Object, x: Number, y: Number, value: String) => void;
|
|
345
|
-
/** Return false to cancel the contextMenu event, or return custom elements for the contextmenu. */
|
|
346
|
-
contextmenu?: (worksheet: worksheetInstance, x: Number, y: Number, e: Event, section: String, section_argument1: String | Number, section_argument2: String | Number) => [];
|
|
347
|
-
/** The first row is the header titles when parsing a HTML table */
|
|
348
|
-
parseTableFirstRowAsHeader?: boolean,
|
|
349
|
-
/** Try to identify a column type when parsing a HTML table */
|
|
350
|
-
parseTableAutoCellType?: boolean,
|
|
351
|
-
/** Global cell wrapping. Default: false */
|
|
352
|
-
wordWrap?: boolean;
|
|
353
|
-
/** About information */
|
|
354
|
-
about?: string | Function,
|
|
355
|
-
/** License string */
|
|
356
|
-
license?: string,
|
|
357
|
-
/** Worksheets */
|
|
358
|
-
worksheets?: Array<Worksheet>;
|
|
359
|
-
}
|
|
378
|
+
interface Worksheet {
|
|
379
|
+
/** Logo URL **/
|
|
380
|
+
logo?: string
|
|
381
|
+
/** Load the data from an external server URL */
|
|
382
|
+
url?: string;
|
|
383
|
+
/** Persitence URL or true when the URL is the same of the URL of the data source */
|
|
384
|
+
persistence? : string | boolean;
|
|
385
|
+
/** Allow internal sequence for new rows */
|
|
386
|
+
sequence? : boolean;
|
|
387
|
+
/** Load the data into a new spreadsheet from an array of rows or objects */
|
|
388
|
+
data? : Array<any> ;
|
|
389
|
+
/** Deprected. Please use the data property. */
|
|
390
|
+
json? : Array<Record<string, any>>;
|
|
391
|
+
/** Array with the rows properties definitions such as title, height. */
|
|
392
|
+
rows? : Row[];
|
|
393
|
+
/** The column properties define the behavior of a column and the associated editor */
|
|
394
|
+
columns? : Array<Column>;
|
|
395
|
+
/** Define the properties of a cell. This property overwrite the column definitions */
|
|
396
|
+
cells?: Record<string, Column>;
|
|
397
|
+
/** Role of this worksheet **/
|
|
398
|
+
role?: string,
|
|
399
|
+
/** Nested headers definition */
|
|
400
|
+
nestedHeaders?: Array<Nested>;
|
|
401
|
+
/** Default column width. Default: 50px */
|
|
402
|
+
defaultColWidth?: number | string;
|
|
403
|
+
/** Default row height. Default: null */
|
|
404
|
+
defaultRowHeight?: number | string;
|
|
405
|
+
/** Default alignment for a new column: [center, left, right] */
|
|
406
|
+
defaultColAlign?: 'center' | 'left' | 'right' | 'justify';
|
|
407
|
+
/** Minimum number of spare rows. Default: 0 */
|
|
408
|
+
minSpareRows?: number;
|
|
409
|
+
/** Minimum number of spare cols. Default: 0 */
|
|
410
|
+
minSpareCols?: number;
|
|
411
|
+
/** Minimum table dimensions: [numberOfColumns, numberOfRows] */
|
|
412
|
+
minDimensions?: [number, number];
|
|
413
|
+
/** CSV data source URL */
|
|
414
|
+
csv?: string;
|
|
415
|
+
/** CSV default filename for the jspreadsheet exports. Default: 'jspreadsheet' */
|
|
416
|
+
csvFileName?: string;
|
|
417
|
+
/** Consider first line as header. Default: true */
|
|
418
|
+
csvHeaders?: boolean;
|
|
419
|
+
/** Delimiter to consider when dealing with the CSV data. Default: ',' */
|
|
420
|
+
csvDelimiter?: boolean;
|
|
421
|
+
/** Allow column sorting */
|
|
422
|
+
columnSorting?: boolean;
|
|
423
|
+
/** Allow column dragging */
|
|
424
|
+
columnDrag?: boolean;
|
|
425
|
+
/** Allow column resizing */
|
|
426
|
+
columnResize?: boolean;
|
|
427
|
+
/** Allow row resizing */
|
|
428
|
+
rowResize?: boolean;
|
|
429
|
+
/** Allow row dragging */
|
|
430
|
+
rowDrag?: boolean;
|
|
431
|
+
/** Allow table edition */
|
|
432
|
+
editable?: boolean;
|
|
433
|
+
/** Allow new rows */
|
|
434
|
+
allowInsertRow?: boolean;
|
|
435
|
+
/** Allow new rows to be added using tab key. Default: true */
|
|
436
|
+
allowManualInsertRow?: boolean;
|
|
437
|
+
/** Allow new columns to be added using enter key. Default: true */
|
|
438
|
+
allowInsertColumn?: boolean;
|
|
439
|
+
/** Allow new rows to be added via script. Default: true */
|
|
440
|
+
allowManualInsertColumn?: boolean;
|
|
441
|
+
/** Allow rows to be deleted. Default: true */
|
|
442
|
+
allowDeleteRow?: boolean;
|
|
443
|
+
/** Allow all rows to be deleted. Warning: no rows left can lead to undesirabled behavior. Default: false */
|
|
444
|
+
allowDeletingAllRows?: boolean;
|
|
445
|
+
/** Allow columns to be deleted. Default: true */
|
|
446
|
+
allowDeleteColumn?: boolean;
|
|
447
|
+
/** Allow rename column. Default: true */
|
|
448
|
+
allowRenameColumn?: boolean;
|
|
449
|
+
/** Allow users to add comments to the cells. Default: false */
|
|
450
|
+
allowComments?: boolean;
|
|
451
|
+
/** Corner selection and corner data cloning. Default: true */
|
|
452
|
+
selectionCopy?: boolean;
|
|
453
|
+
/** Merged cells. Default: null */
|
|
454
|
+
mergeCells?: Record<string, []>;
|
|
455
|
+
/** Allow search on the spreadsheet */
|
|
456
|
+
search?: boolean;
|
|
457
|
+
/** Activate pagination and defines the number of records per page. Default: false */
|
|
458
|
+
pagination?: number;
|
|
459
|
+
/** Dropdown for the user to change the number of records per page. Example: [10,25,50,100]. Default: false */
|
|
460
|
+
paginationOptions?: boolean | Array<number>;
|
|
360
461
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
/** Consider first line as header. Default: true */
|
|
401
|
-
csvHeaders?: boolean;
|
|
402
|
-
/** Delimiter to consider when dealing with the CSV data. Default: ',' */
|
|
403
|
-
csvDelimiter?: boolean;
|
|
404
|
-
/** Allow column sorting */
|
|
405
|
-
columnSorting?: boolean;
|
|
406
|
-
/** Allow column dragging */
|
|
407
|
-
columnDrag?: boolean;
|
|
408
|
-
/** Allow column resizing */
|
|
409
|
-
columnResize?: boolean;
|
|
410
|
-
/** Allow row resizing */
|
|
411
|
-
rowResize?: boolean;
|
|
412
|
-
/** Allow row dragging */
|
|
413
|
-
rowDrag?: boolean;
|
|
414
|
-
/** Allow table edition */
|
|
415
|
-
editable?: boolean;
|
|
416
|
-
/** Allow new rows */
|
|
417
|
-
allowInsertRow?: boolean;
|
|
418
|
-
/** Allow new rows to be added using tab key. Default: true */
|
|
419
|
-
allowManualInsertRow?: boolean;
|
|
420
|
-
/** Allow new columns to be added using enter key. Default: true */
|
|
421
|
-
allowInsertColumn?: boolean;
|
|
422
|
-
/** Allow new rows to be added via script. Default: true */
|
|
423
|
-
allowManualInsertColumn?: boolean;
|
|
424
|
-
/** Allow rows to be deleted. Default: true */
|
|
425
|
-
allowDeleteRow?: boolean;
|
|
426
|
-
/** Allow all rows to be deleted. Warning: no rows left can lead to undesirabled behavior. Default: false */
|
|
427
|
-
allowDeletingAllRows?: boolean;
|
|
428
|
-
/** Allow columns to be deleted. Default: true */
|
|
429
|
-
allowDeleteColumn?: boolean;
|
|
430
|
-
/** Allow rename column. Default: true */
|
|
431
|
-
allowRenameColumn?: boolean;
|
|
432
|
-
/** Allow users to add comments to the cells. Default: false */
|
|
433
|
-
allowComments?: boolean;
|
|
434
|
-
/** Corner selection and corner data cloning. Default: true */
|
|
435
|
-
selectionCopy?: boolean,
|
|
436
|
-
/** Merged cells. Default: null */
|
|
437
|
-
mergeCells?: Record<string, []>,
|
|
438
|
-
/** Allow search on the spreadsheet */
|
|
439
|
-
search?: boolean;
|
|
440
|
-
/** Activate pagination and defines the number of records per page. Default: false */
|
|
441
|
-
pagination?: number;
|
|
442
|
-
/** Dropdown for the user to change the number of records per page. Example: [10,25,50,100]. Default: false */
|
|
443
|
-
paginationOptions?: boolean | Array<number> ;
|
|
444
|
-
/** Table overflow. Default: false */
|
|
445
|
-
tableOverflow?: boolean;
|
|
446
|
-
/** Allow the user to resize the table when tableOverflow is active. Default: false */
|
|
447
|
-
tableOverflowResizable?: boolean;
|
|
448
|
-
/** Define the table overflow height. Example: '300px' */
|
|
449
|
-
tableHeight?: number | string;
|
|
450
|
-
/** Define the table overflow width. Example: '800px' */
|
|
451
|
-
tableWidth?: number | string;
|
|
452
|
-
/** Initial comments. Default: null */
|
|
453
|
-
comments?: Record<string, string>;
|
|
454
|
-
/** Initial meta information. Default: null */
|
|
455
|
-
meta?: Record<string, any>;
|
|
456
|
-
/** Style */
|
|
457
|
-
style?: Record<string, string>;
|
|
458
|
-
/** Freeze columns. Default: 0 */
|
|
459
|
-
freezeColumns?: number;
|
|
460
|
-
/** Initial sorting [colNumber, direction]. Default: null */
|
|
461
|
-
orderBy?: [number, boolean];
|
|
462
|
-
/** Worksheet Unique Id. **/
|
|
463
|
-
worksheetId?: string;
|
|
464
|
-
/** Worksheet Name. **/
|
|
465
|
-
worksheetName?: string;
|
|
466
|
-
/** Worksheet state: hidden | null. Hide a worksheet **/
|
|
467
|
-
worksheetState?: 'hidden' | undefined;
|
|
468
|
-
/** Enable the column filters */
|
|
469
|
-
filters?: boolean;
|
|
470
|
-
/** Footers */
|
|
471
|
-
footers?: Array<any>;
|
|
472
|
-
/** Apply mask on footers */
|
|
473
|
-
applyMaskOnFooters?: boolean;
|
|
474
|
-
/** Define options for the plugins. Each key should be the pluginName. */
|
|
475
|
-
pluginOptions?: Record<string, any>;
|
|
476
|
-
/** This is a internal controller for the spreadsheet locked properties. Please use editable to make it readonly. */
|
|
477
|
-
locked?: boolean;
|
|
478
|
-
/** Allow the selection of unlocked cells. Default: true. */
|
|
479
|
-
selectUnLockedCells?: boolean;
|
|
480
|
-
/** Allow the selection of locked cells. Default: true. */
|
|
481
|
-
selectLockedCells?: boolean;
|
|
482
|
-
}
|
|
462
|
+
/** Text Overflow. Default: false */
|
|
463
|
+
textOverflow?: boolean;
|
|
464
|
+
/** Table overflow. Default: false */
|
|
465
|
+
tableOverflow?: boolean;
|
|
466
|
+
/** Define the table overflow height. Example: '300px' */
|
|
467
|
+
tableHeight?: number | string;
|
|
468
|
+
/** Define the table overflow width. Example: '800px' */
|
|
469
|
+
tableWidth?: number | string;
|
|
470
|
+
/** Initial comments. Default: null */
|
|
471
|
+
comments?: Record<string, string>;
|
|
472
|
+
/** Initial meta information. Default: null */
|
|
473
|
+
meta?: Record<string, any>;
|
|
474
|
+
/** Style */
|
|
475
|
+
style?: Record<string, string>;
|
|
476
|
+
/** Freeze columns. Default: 0 */
|
|
477
|
+
freezeColumns?: number;
|
|
478
|
+
/** Initial sorting [colNumber, direction]. Default: null */
|
|
479
|
+
orderBy?: [number, boolean];
|
|
480
|
+
/** Worksheet Unique Id. **/
|
|
481
|
+
worksheetId?: string;
|
|
482
|
+
/** Worksheet Name. **/
|
|
483
|
+
worksheetName?: string;
|
|
484
|
+
/** Worksheet state: hidden | null. Hide a worksheet **/
|
|
485
|
+
worksheetState?: 'hidden' | undefined;
|
|
486
|
+
/** Enable the column filters */
|
|
487
|
+
filters?: boolean;
|
|
488
|
+
/** Footers */
|
|
489
|
+
footers?: Array<any>;
|
|
490
|
+
/** Apply mask on footers */
|
|
491
|
+
applyMaskOnFooters?: boolean;
|
|
492
|
+
/** Define options for the plugins. Each key should be the pluginName. */
|
|
493
|
+
pluginOptions?: Record<string, any>;
|
|
494
|
+
/** This is a internal controller for the spreadsheet locked properties. Please use editable to make it readonly. */
|
|
495
|
+
locked?: boolean;
|
|
496
|
+
/** Allow the selection of unlocked cells. Default: true. */
|
|
497
|
+
selectUnLockedCells?: boolean;
|
|
498
|
+
/** Allow the selection of locked cells. Default: true. */
|
|
499
|
+
selectLockedCells?: boolean;
|
|
500
|
+
}
|
|
483
501
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
502
|
+
interface spreadsheetInstance {
|
|
503
|
+
/** Spreadsheet configuration */
|
|
504
|
+
config: Spreadsheet;
|
|
505
|
+
/** Contextmenu HTMLElement */
|
|
506
|
+
contextmenu: HTMLElement;
|
|
507
|
+
/** Create a new worksheet from the given settings */
|
|
508
|
+
createWorksheet: (options: Worksheet) => void;
|
|
509
|
+
/** Delete an existing worksheet by its position */
|
|
510
|
+
deleteWorksheet: (position: Number) => void;
|
|
511
|
+
/** DOM Element */
|
|
512
|
+
el: HTMLElement;
|
|
513
|
+
/** DOM Element. Alias for el */
|
|
514
|
+
element: HTMLElement;
|
|
515
|
+
/** DOM Element container for the filters */
|
|
516
|
+
filters: HTMLElement;
|
|
517
|
+
/** Toggle the fullscreen mode */
|
|
518
|
+
fullscreen: (state: Boolean) => void;
|
|
519
|
+
/** Get the toolbar object definitions */
|
|
520
|
+
getToolbar: Toolbar,
|
|
521
|
+
/** Set the toolbar */
|
|
522
|
+
setToolbar: (toolbar: Toolbar) => void;
|
|
523
|
+
/** Show the toolbar for the worksheet */
|
|
524
|
+
showToolbar: () => void;
|
|
525
|
+
/** Hide the toolbar for the worksheet */
|
|
526
|
+
hideToolbar: () => void;
|
|
527
|
+
/** Get the worksheet by its id */
|
|
528
|
+
getWorksheet: (id: String) => Number;
|
|
529
|
+
/** Get the active worksheet when applicable */
|
|
530
|
+
getWorksheetActive: () => worksheetInstance;
|
|
531
|
+
/** Get the worksheet instance by its position */
|
|
532
|
+
getWorksheetInstance: (position: Number) => worksheetInstance;
|
|
533
|
+
/** HTMLElement Helper */
|
|
534
|
+
helper: HTMLElement,
|
|
535
|
+
/** Array with the history information */
|
|
536
|
+
history: [];
|
|
537
|
+
/** Internal history index position */
|
|
538
|
+
historyIndex: Boolean;
|
|
539
|
+
/** Ignore events */
|
|
540
|
+
ignoreEvents: Boolean;
|
|
541
|
+
/** Ignore history events */
|
|
542
|
+
ignoreHistory: Boolean;
|
|
543
|
+
/** Ignore persistence events */
|
|
544
|
+
ignorePersistence: Boolean;
|
|
545
|
+
/** HTMLElement editor container **/
|
|
546
|
+
input: HTMLElement;
|
|
547
|
+
/** HTMLElement loading element **/
|
|
548
|
+
loading: HTMLElement;
|
|
549
|
+
/** Rename an existing worksheet by its position */
|
|
550
|
+
renameWorksheet: (position: Number, title: String) => void;
|
|
551
|
+
/** Move the position of a worksheet tab */
|
|
552
|
+
moveWorksheet: (from: Number, to: Number, updateDom: Boolean) => void;
|
|
553
|
+
/** Open a worksheet */
|
|
554
|
+
openWorksheet: (position: Number) => void;
|
|
555
|
+
/** Get the worksheet name */
|
|
556
|
+
getWorksheetName: () => String;
|
|
557
|
+
/** Spreadsheet unique name */
|
|
558
|
+
name: string;
|
|
559
|
+
/** List of plugins loaded to the spreadsheet */
|
|
560
|
+
plugins: Record<number, Plugin>;
|
|
561
|
+
/** Processing flag. It would be true when the spreadsheet is loading. */
|
|
562
|
+
processing: boolean;
|
|
563
|
+
/** Show progressbar */
|
|
564
|
+
progress: (state: boolean) => void;
|
|
565
|
+
/** Queue of formulas used during the loading */
|
|
566
|
+
queue: Array<string>;
|
|
567
|
+
/** Undo */
|
|
568
|
+
undo: () => void;
|
|
569
|
+
/** Redo */
|
|
570
|
+
redo: () => void;
|
|
571
|
+
/** DOM Textarea helper */
|
|
572
|
+
textarea: HTMLElement;
|
|
573
|
+
/** DOM toolbar */
|
|
574
|
+
toolbar: HTMLElement;
|
|
575
|
+
/** Tools HTMLElement container */
|
|
576
|
+
tools: HTMLElement;
|
|
577
|
+
/** Worksheets container */
|
|
578
|
+
worksheets: Array<Worksheet>;
|
|
579
|
+
}
|
|
562
580
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
581
|
+
interface worksheetInstance {
|
|
582
|
+
/** Array with the borders information */
|
|
583
|
+
borders: [];
|
|
584
|
+
/** Close the editon for one cell */
|
|
585
|
+
closeEditor: (cell: HTMLElement, save: boolean) => void;
|
|
586
|
+
/** Close the filters */
|
|
587
|
+
closeFilters: (update: boolean) => void;
|
|
588
|
+
/** Array with the column width controllers */
|
|
589
|
+
colgroup: [];
|
|
590
|
+
/** Hold the colgroup container */
|
|
591
|
+
colgroupContainer: HTMLElement;
|
|
592
|
+
/** DOM Worksheet container */
|
|
593
|
+
content: HTMLElement;
|
|
594
|
+
/** Copy */
|
|
595
|
+
copy: (cut?: boolean) => void;
|
|
596
|
+
/** DOM Corner square */
|
|
597
|
+
corner: HTMLElement;
|
|
598
|
+
/** Create a new worksheet */
|
|
599
|
+
createWorksheet: (worksheetOptions: Worksheet) => void;
|
|
600
|
+
/** Internal selected cell */
|
|
601
|
+
cursor: object;
|
|
602
|
+
/** Cut */
|
|
603
|
+
cut: () => void;
|
|
604
|
+
/**
|
|
605
|
+
* Get the worksheet data
|
|
606
|
+
*
|
|
607
|
+
* @param {boolean} only the selected cells
|
|
608
|
+
* @param {boolean} get the raw or processed data
|
|
609
|
+
* @param {string} Null the return will be an array. With this argument, the return will be a string separated by the character defined.
|
|
610
|
+
* @return {array} array of data
|
|
611
|
+
*/
|
|
612
|
+
data: (highlighted?: boolean, processedData?: boolean, delimiter?: string) => Array<Array<any>> | string
|
|
613
|
+
/** Internal use control type to defined JSON or ARRAY. */
|
|
614
|
+
dataType: boolean,
|
|
615
|
+
/** Delete an existing column */
|
|
616
|
+
deleteColumn: (columnnumber: number, numOfColumns?: number) => void;
|
|
617
|
+
/** Delete an existing row */
|
|
618
|
+
deleteRow: (rownumber: number, numOfRows?: number) => void;
|
|
619
|
+
/** Destroy all merged cells */
|
|
620
|
+
destroyMerged: () => void;
|
|
621
|
+
/** Internal method: event dispatch controllers */
|
|
622
|
+
dispatch: (event?: string) => void;
|
|
623
|
+
/** Navigation down */
|
|
624
|
+
down: (shiftKey?: boolean, ctrlKey?: boolean, jump?: boolean) => void;
|
|
625
|
+
/** Download CSV */
|
|
626
|
+
download: (includeHeaders?: boolean, processed?: boolean) => void;
|
|
627
|
+
/** Edition controllers */
|
|
628
|
+
edition: [];
|
|
629
|
+
/** DOM Worksheet. Alias for worksheet */
|
|
630
|
+
element: HTMLElement;
|
|
631
|
+
/** Internal method: Execute a formula */
|
|
632
|
+
executeFormula: (expression: string, x?: number, y?: number, caching?: boolean) => void;
|
|
633
|
+
/** Navigation first */
|
|
634
|
+
first: (shiftKey?: boolean, ctrlKey?: boolean) => void;
|
|
635
|
+
/** Footers */
|
|
636
|
+
footers: Record<string, string>;
|
|
637
|
+
/** Formula chain. Internal use. */
|
|
638
|
+
formula: [];
|
|
639
|
+
/** Toggle the fullscreen mode */
|
|
640
|
+
fullscreen: (state: boolean) => void;
|
|
641
|
+
/** Get the border */
|
|
642
|
+
getBorder: (alias: string) => object;
|
|
643
|
+
/** Get the cell element from the cellname */
|
|
644
|
+
getCell: (cellName: string) => Object;
|
|
645
|
+
/** Get the cell element from its coordinates */
|
|
646
|
+
getCellFromCoords: (x: number, y: number) => [];
|
|
647
|
+
/** Get attributes from one cell when applicable */
|
|
648
|
+
getCells: (cellName: string) => Column;
|
|
649
|
+
/** Get the column object by its position */
|
|
650
|
+
getColumn: (position: number) => Object;
|
|
651
|
+
/** Get the column data from its number */
|
|
652
|
+
getColumnData: (col: number, processed?: boolean) => [];
|
|
653
|
+
/** Get the column position by its name */
|
|
654
|
+
getColumnIdByName: (name: string) => number;
|
|
655
|
+
/** Get the settings for one column. Row its optional when need to get the information from one specific cell. */
|
|
656
|
+
getColumnOptions: (x: number, y: number) => void;
|
|
657
|
+
/** Get the comments from one cell. Example: getComments('A1') */
|
|
658
|
+
getComments: (cellName?: string) => string;
|
|
659
|
+
/** Get the worksheet settings */
|
|
660
|
+
getConfig: () => boolean;
|
|
661
|
+
/**
|
|
662
|
+
* Get the worksheet data
|
|
663
|
+
*
|
|
664
|
+
* @param {boolean} only the selected cells
|
|
665
|
+
* @param {boolean} get the raw or processed data
|
|
666
|
+
* @return {array} array of data
|
|
667
|
+
*/
|
|
668
|
+
getData: (highlighted?: boolean, processed?: boolean, delimiter?: string) => [];
|
|
669
|
+
/** Get the defined name or defined names when key is null */
|
|
670
|
+
getDefinedNames: (key?: string) => object;
|
|
671
|
+
/** Internal method: Get the editor for one cell */
|
|
672
|
+
getEditor: (x: number, y: number) => Object;
|
|
673
|
+
/** Internal method: Get the filter */
|
|
674
|
+
getFilter: (column: number) => Array<any>;
|
|
675
|
+
/** Get the footers configuration */
|
|
676
|
+
getFooter: () => Array<any>;
|
|
677
|
+
/** Get the footer value */
|
|
678
|
+
getFooterValue: (x: number, y: number) => any;
|
|
679
|
+
/** Get the header title */
|
|
680
|
+
getHeader: (columnnumber: number) => string;
|
|
681
|
+
/** Get all header elements */
|
|
682
|
+
getHeaders: (asArray: boolean) => [];
|
|
683
|
+
/** Get the height of one row by its position */
|
|
684
|
+
getHeight: (row: number) => void;
|
|
685
|
+
/** Get the highlighted coordinates **/
|
|
686
|
+
getHighlighted: () => [];
|
|
687
|
+
/** Get json */
|
|
688
|
+
getJson: (h?: boolean, processed?: boolean) => [];
|
|
689
|
+
/** Get the processed data cell shown to the user by the cell name */
|
|
690
|
+
getLabel: (cellName: string) => Object;
|
|
691
|
+
/** Get the processed data cell shown to the user by its coordinates */
|
|
692
|
+
getLabelFromCoords: (x: number, y: number) => [];
|
|
693
|
+
/** Get the merged cells. Cellname: A1, A2, etc */
|
|
694
|
+
getMerge: (cellName: string) => void;
|
|
695
|
+
/** Get one or all meta information for one cell. */
|
|
696
|
+
getMeta: (cellName: string, property: string) => Object;
|
|
697
|
+
/** Get the nested cells */
|
|
698
|
+
getNestedCell: (x: number, y: number, properties?: any) => Object;
|
|
699
|
+
/** Get the nested header columns */
|
|
700
|
+
getNestedColumns: (x: number, y: number) => [];
|
|
701
|
+
/** Get the nested headers */
|
|
702
|
+
getNestedHeaders: () => [];
|
|
703
|
+
/** Get the next available number in the sequence */
|
|
704
|
+
getNextSequence: () => number;
|
|
705
|
+
/** Get the column or cell options by coordinates */
|
|
706
|
+
getOptions: (x: number, y: number) => object;
|
|
707
|
+
/** Get the primaryKey column when applicable. */
|
|
708
|
+
getPrimaryKey: () => number;
|
|
709
|
+
/** Get processed data by the coordinates of the cell */
|
|
710
|
+
getProcessed: (x: number, y: number, extended: boolean) => void;
|
|
711
|
+
/** Get the properties for one column or cell */
|
|
712
|
+
getProperties: (x: number, y: number) => void;
|
|
713
|
+
/** Get a row data or meta information by Id. */
|
|
714
|
+
getRowById: (row: number, element: boolean) => Object;
|
|
715
|
+
/** Get the data from one row */
|
|
716
|
+
getRowData: (row: number, processed: boolean) => [];
|
|
717
|
+
/** Get the row id from its position */
|
|
718
|
+
getRowId: (row: number) => number;
|
|
719
|
+
/** Get all selected cells */
|
|
720
|
+
getSelected: (columnNameOnly: boolean) => [];
|
|
721
|
+
/** Get the selected columns */
|
|
722
|
+
getSelectedColumns: () => [];
|
|
723
|
+
/** Get the selected rows */
|
|
724
|
+
getSelectedRows: () => [];
|
|
725
|
+
/** Get the style from one cell. Ex. getStyle('A1') */
|
|
726
|
+
getStyle: (cell: string) => Object;
|
|
727
|
+
/** Get value by the cellname or object. The value can be the raw or processed value. */
|
|
728
|
+
getValue: (cell: string, processed: boolean) => String;
|
|
729
|
+
/** Get value by the coordinates. The value can be the raw or processed value. */
|
|
730
|
+
getValueFromCoords: (x: number, y: number, processed: boolean) => void;
|
|
731
|
+
/** Get the width of one column by its position */
|
|
732
|
+
getWidth: (x: number) => void;
|
|
733
|
+
/** Get the editor type for one column or cell */
|
|
734
|
+
getType: (x: number, y: number) => void;
|
|
735
|
+
/** Go to the row number, [col number] **/
|
|
736
|
+
goto: (y: number, x?: number) => void;
|
|
737
|
+
/** Hold the header container */
|
|
738
|
+
headerContainer: HTMLElement;
|
|
739
|
+
/** Array with the header DOM elements */
|
|
740
|
+
headers: Array<HTMLElement>;
|
|
741
|
+
/** Hide column */
|
|
742
|
+
hideColumn: (column: number) => void;
|
|
743
|
+
/** Hide the filters */
|
|
744
|
+
hideFilter: () => void;
|
|
745
|
+
/** Hide index column */
|
|
746
|
+
hideIndex: () => void;
|
|
747
|
+
/** Hide row */
|
|
748
|
+
hideRow: (row: number) => void;
|
|
749
|
+
/** Hide the search container */
|
|
750
|
+
hideSearch: () => void;
|
|
751
|
+
/** Add a new column */
|
|
752
|
+
insertColumn: (numOfColumns: number, columnnumber: number, insertBefore: boolean, properties: Column, data: []) => void;
|
|
753
|
+
/** Add a new row */
|
|
754
|
+
insertRow: (numOfRows: number, rownumber: number, insertBefore: boolean, data: []) => void;
|
|
755
|
+
/** Check if cell is attached to the DOM */
|
|
756
|
+
isAttached: (x: number, y: number) => boolean;
|
|
757
|
+
/** The worksheet is editable */
|
|
758
|
+
isEditable: () => boolean;
|
|
759
|
+
/** Check if cell is readonly or not */
|
|
760
|
+
isReadOnly: (cell: Object) => boolean;
|
|
761
|
+
/** Cell is selected */
|
|
762
|
+
isSelected: (x: number, y: number) => boolean;
|
|
763
|
+
/** Navigation last */
|
|
764
|
+
last: () => void;
|
|
765
|
+
/** Navigation left */
|
|
766
|
+
left: () => void;
|
|
767
|
+
/** Change a column position */
|
|
768
|
+
moveColumn: (from: number, to: number) => void;
|
|
769
|
+
/** Change a row position */
|
|
770
|
+
moveRow: (from: number, to: number) => void;
|
|
771
|
+
/** Get the column name */
|
|
772
|
+
name: (col: number) => string;
|
|
773
|
+
/** Start the edition for one cell */
|
|
774
|
+
openEditor: (cell: HTMLElement, empty?: boolean, mouseEvent?: Object) => void;
|
|
775
|
+
/** Open the filters */
|
|
776
|
+
openFilter: (column: number) => void;
|
|
777
|
+
/** Worksheet configuration */
|
|
778
|
+
options: Worksheet;
|
|
779
|
+
/** Sort one column by its position. ASC (0) or DESC (1) */
|
|
780
|
+
orderBy: (column: number, direction: boolean) => void;
|
|
781
|
+
/** Change page when using pagination */
|
|
782
|
+
page: (pagenumber: number) => void;
|
|
783
|
+
/** Current page number */
|
|
784
|
+
pagenumber: number;
|
|
785
|
+
/** Pagination DOM containr */
|
|
786
|
+
pagination: Object;
|
|
787
|
+
/** Spreadsheet object */
|
|
788
|
+
parent: spreadsheetInstance;
|
|
789
|
+
/** Paste */
|
|
790
|
+
paste: (x: number, y: number, data: string) => void;
|
|
791
|
+
/** Get the quantity of pages when pagination is active */
|
|
792
|
+
quantityOfPages?: () => number;
|
|
793
|
+
/** Array with the cell DOM elements */
|
|
794
|
+
records: Array<HTMLElement>;
|
|
795
|
+
/** Refresh the whole data or from a single row */
|
|
796
|
+
refresh: (y: number | undefined) => void;
|
|
797
|
+
/** Refresh the borders by the border name */
|
|
798
|
+
refreshBorders: (border?: string) => void;
|
|
799
|
+
/** Refresh footers */
|
|
800
|
+
refreshFooter: () => void;
|
|
801
|
+
/** Remove the merged cells by the cellname */
|
|
802
|
+
removeMerge: (cellName: String) => void;
|
|
803
|
+
/** Reset the borders by name border name */
|
|
804
|
+
resetBorders: (border: String, resetPosition: boolean) => void;
|
|
805
|
+
/** Close the filters */
|
|
806
|
+
resetFilters: () => void;
|
|
807
|
+
/** Destroy the footers */
|
|
808
|
+
resetFooter: () => void;
|
|
809
|
+
/** Destroy freeze columns */
|
|
810
|
+
resetFreezeColumns: () => void;
|
|
811
|
+
/** Reset meta data */
|
|
812
|
+
resetMeta: () => void;
|
|
813
|
+
/** Reset nested headers */
|
|
814
|
+
resetNestedHeaders: () => void;
|
|
815
|
+
/** Reset the search */
|
|
816
|
+
resetSearch: () => void;
|
|
817
|
+
/** Reset the main selection */
|
|
818
|
+
resetSelection: () => void;
|
|
819
|
+
/** Get the style from one cell. Ex. resetStyle('A1') */
|
|
820
|
+
resetStyle: (cell?: String) => void;
|
|
821
|
+
/** DOM array of results */
|
|
822
|
+
results: Array<number>;
|
|
823
|
+
/** Navigation right */
|
|
824
|
+
right: () => void;
|
|
825
|
+
/** DOM array of rows */
|
|
826
|
+
rows: Array<HTMLElement>;
|
|
827
|
+
/** Persistence helper method. The callback is executed with a JSON from the server */
|
|
828
|
+
save: (url: String, data: Object, token?: String, callback?: (result: Object) => void) => void;
|
|
829
|
+
/** ScrollX DOM Element */
|
|
830
|
+
scrollX: HTMLElement;
|
|
831
|
+
/** ScrollY DOM Element */
|
|
832
|
+
scrollY: HTMLElement;
|
|
833
|
+
/** Search for something */
|
|
834
|
+
search: (str: String) => void;
|
|
835
|
+
/** Search HTML container */
|
|
836
|
+
searchContainer: HTMLElement;
|
|
837
|
+
/** Search HTML input */
|
|
838
|
+
searchInput: HTMLElement;
|
|
839
|
+
/** Select All */
|
|
840
|
+
selectAll: () => void;
|
|
841
|
+
/** Selected cells */
|
|
842
|
+
selectedCell: [];
|
|
843
|
+
/** Internal record id sequence */
|
|
844
|
+
sequence: number;
|
|
845
|
+
/** Set borders with a border name and color. */
|
|
846
|
+
setBorder: (x1: number, y1: number, x2: number, y2: number, border?: string, color?: string) => void;
|
|
847
|
+
/** Set attributes for one cell */
|
|
848
|
+
setCells: (cellName: string, settings: Column) => void;
|
|
849
|
+
/** Set the column data from its number */
|
|
850
|
+
setColumnData: (col: number, data: [], force?: boolean) => void;
|
|
851
|
+
/** Set the comments for one cell */
|
|
852
|
+
setComments: (cellName: String, comments: String) => void;
|
|
853
|
+
/** Change the worksheet settings */
|
|
854
|
+
setConfig: (config: Worksheet) => void;
|
|
855
|
+
/** Reset the table data */
|
|
856
|
+
setData: (data: []) => void;
|
|
857
|
+
/** Set the defined name */
|
|
858
|
+
setDefinedNames: (key: string, value: string) => void;
|
|
859
|
+
/** Set filter */
|
|
860
|
+
setFilter: (colnumber: number, keywords: []) => void;
|
|
861
|
+
/** Set the footers */
|
|
862
|
+
setFooter: (data: []) => void;
|
|
863
|
+
/** Set the footer value */
|
|
864
|
+
setFooterValue: (col: number, row: number, value: any) => void;
|
|
865
|
+
/** Freeze x number of columns */
|
|
866
|
+
setFreezeColumns: (num: number) => void;
|
|
867
|
+
/** Set the header title */
|
|
868
|
+
setHeader: (x: number, title: String) => void;
|
|
869
|
+
/** Set the height of one row by its position */
|
|
870
|
+
setHeight: (row: number, width: number) => void;
|
|
871
|
+
/** Get the merged cells. Cellname: A1, A2, etc */
|
|
872
|
+
setMerge: (cellName: String, colspan: number, rowspan: number, forceOverwrite?: boolean) => void;
|
|
873
|
+
/** Get one or various meta information for one cell. */
|
|
874
|
+
setMeta: (cell: string | object, property?: string, value?: string) => void;
|
|
875
|
+
/** Set the nested headers */
|
|
876
|
+
setNestedHeaders: (config: []) => void;
|
|
877
|
+
/** Set plugins for the spreadsheet */
|
|
878
|
+
setPlugins: (plugins: []) => void;
|
|
879
|
+
/** Set the properties for one column */
|
|
880
|
+
setProperties: (column: number, settings: Object) => void;
|
|
881
|
+
/** Set or reset the cell as readonly */
|
|
882
|
+
setReadOnly: (cell: Object, state: boolean) => void;
|
|
883
|
+
/** Set the data from one row */
|
|
884
|
+
setRowData: (row: number, data: [], force: boolean) => void;
|
|
885
|
+
/** Set the row id from its position */
|
|
886
|
+
setRowId: (row: number, newId: number) => void;
|
|
887
|
+
/** Set the style for one cell. Ex. setStyle('A1', 'background-color', 'red') */
|
|
888
|
+
setStyle: (cell: string | object, property?: string, value?: string, forceOverwrite?: boolean) => void;
|
|
889
|
+
/**
|
|
890
|
+
* Set a cell value
|
|
891
|
+
*
|
|
892
|
+
* @param {mixed} cell destination cell
|
|
893
|
+
* @param {string} value value
|
|
894
|
+
* @param {string} force value over readonly cells
|
|
895
|
+
* @return void
|
|
896
|
+
*/
|
|
897
|
+
setValue: (cell: string, value?: String, forceOverwrite?: boolean) => void;
|
|
898
|
+
/**
|
|
899
|
+
* Set a cell value
|
|
900
|
+
*
|
|
901
|
+
* @param {number} x
|
|
902
|
+
* @param {number} y
|
|
903
|
+
* @param {string} value value
|
|
904
|
+
* @param {string} force value over readonly cells
|
|
905
|
+
* @return void
|
|
906
|
+
*/
|
|
907
|
+
setValueFromCoords: (x: number, y: number, value: string, force?: boolean) => void;
|
|
908
|
+
/** Set viewport width and height */
|
|
909
|
+
setViewport: (width: number, height: number) => void;
|
|
910
|
+
/** Set the width of one column by its position */
|
|
911
|
+
setWidth: (col: number, width: number) => void;
|
|
912
|
+
/** Show column */
|
|
913
|
+
showColumn: (column: number) => void;
|
|
914
|
+
/** Show filter controls */
|
|
915
|
+
showFilter: () => void;
|
|
916
|
+
/** Show index column */
|
|
917
|
+
showIndex: () => void;
|
|
918
|
+
/** Show row */
|
|
919
|
+
showRow: (row: number) => void;
|
|
920
|
+
/** Hide the search container */
|
|
921
|
+
showSearch: () => void;
|
|
922
|
+
/** DOM Worksheet table */
|
|
923
|
+
table: HTMLElement;
|
|
924
|
+
/** DOM Worksheet table thead */
|
|
925
|
+
thead: HTMLElement;
|
|
926
|
+
/** DOM Worksheet table tbody */
|
|
927
|
+
tbody: HTMLElement;
|
|
928
|
+
/** DOM Worksheet table tfoot */
|
|
929
|
+
tfoot: HTMLElement;
|
|
930
|
+
/** Verify if one col + row is merged and return or not the merge cell */
|
|
931
|
+
isMerged: (x: number, y: number, getParent: boolean) => boolean | [];
|
|
932
|
+
/** Verify if the col has any merged cells */
|
|
933
|
+
isColMerged: (x: number) => boolean;
|
|
934
|
+
/** Verify if the col has any merged cells */
|
|
935
|
+
isRowMerged: (y: number) => boolean;
|
|
936
|
+
/** Navigation up */
|
|
937
|
+
up: () => void;
|
|
938
|
+
/**
|
|
939
|
+
* Internal method: Internal method: Set a cell value
|
|
940
|
+
*
|
|
941
|
+
* @param {number} x
|
|
942
|
+
* @param {number} y
|
|
943
|
+
* @param {string} value value
|
|
944
|
+
* @param {string} force value over readonly cells
|
|
945
|
+
* @return void
|
|
946
|
+
*/
|
|
947
|
+
updateCell: (x: number, y: number, value: string, force?: boolean) => void;
|
|
948
|
+
/** Internal method: update cells in a batch */
|
|
949
|
+
updateCells: (o: Object) => void;
|
|
950
|
+
/** Update the selection based on two DOM cell selements */
|
|
951
|
+
updateSelection: (el1: number, el2: number, origin: boolean) => void;
|
|
952
|
+
/** Update the selection based on coordinates */
|
|
953
|
+
updateSelectionFromCoords: (x1: number, y1: number, x2: number, y2: number, origin: boolean) => void;
|
|
954
|
+
/** Getter/setter the value by coordinates */
|
|
955
|
+
value?: (x: number, y: number, value?: any) => void;
|
|
956
|
+
/** Which page the row number is */
|
|
957
|
+
whichPage?: (row: number) => number;
|
|
909
958
|
}
|
|
910
959
|
|
|
960
|
+
declare let jspreadsheet: jspreadsheet
|
|
961
|
+
|
|
911
962
|
export = jspreadsheet;
|
|
963
|
+
|