@odoo/o-spreadsheet 14.0.0 → 14.0.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.
- package/dist/o_spreadsheet.cjs.js +17836 -0
- package/dist/o_spreadsheet.d.ts +4102 -0
- package/dist/o_spreadsheet.esm.js +17801 -0
- package/dist/o_spreadsheet.iife.js +17838 -0
- package/dist/o_spreadsheet.iife.min.js +1440 -0
- package/package.json +16 -10
- package/readme.md +10 -0
|
@@ -0,0 +1,4102 @@
|
|
|
1
|
+
import { Env } from '@odoo/owl/dist/types/component/component';
|
|
2
|
+
import * as owl from '@odoo/owl';
|
|
3
|
+
import { Component as Component$a } from '@odoo/owl';
|
|
4
|
+
import { ChartConfiguration } from 'chart.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Registry
|
|
8
|
+
*
|
|
9
|
+
* The Registry class is basically just a mapping from a string key to an object.
|
|
10
|
+
* It is really not much more than an object. It is however useful for the
|
|
11
|
+
* following reasons:
|
|
12
|
+
*
|
|
13
|
+
* 1. it let us react and execute code when someone add something to the registry
|
|
14
|
+
* (for example, the FunctionRegistry subclass this for this purpose)
|
|
15
|
+
* 2. it throws an error when the get operation fails
|
|
16
|
+
* 3. it provides a chained API to add items to the registry.
|
|
17
|
+
*/
|
|
18
|
+
declare class Registry<T> {
|
|
19
|
+
content: {
|
|
20
|
+
[key: string]: T;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Add an item to the registry
|
|
24
|
+
*
|
|
25
|
+
* Note that this also returns the registry, so another add method call can
|
|
26
|
+
* be chained
|
|
27
|
+
*/
|
|
28
|
+
add(key: string, value: T): Registry<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Get an item from the registry
|
|
31
|
+
*/
|
|
32
|
+
get(key: string): T;
|
|
33
|
+
/**
|
|
34
|
+
* Get a list of all elements in the registry
|
|
35
|
+
*/
|
|
36
|
+
getAll(): T[];
|
|
37
|
+
/**
|
|
38
|
+
* Remove an item from the registry
|
|
39
|
+
*/
|
|
40
|
+
remove(key: string): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare type TranslationFunction = (string: string, ...values: string[] | [{
|
|
44
|
+
[key: string]: string;
|
|
45
|
+
}]) => string;
|
|
46
|
+
/***
|
|
47
|
+
* Allow to inject a translation function from outside o-spreadsheet.
|
|
48
|
+
* @param tfn the function that will do the translation
|
|
49
|
+
*/
|
|
50
|
+
declare function setTranslationMethod(tfn: TranslationFunction): void;
|
|
51
|
+
|
|
52
|
+
declare type UID = string;
|
|
53
|
+
interface Zone {
|
|
54
|
+
left: number;
|
|
55
|
+
right: number;
|
|
56
|
+
top: number;
|
|
57
|
+
bottom: number;
|
|
58
|
+
}
|
|
59
|
+
declare type Align = "left" | "right" | "center" | undefined;
|
|
60
|
+
interface Style {
|
|
61
|
+
bold?: boolean;
|
|
62
|
+
italic?: boolean;
|
|
63
|
+
strikethrough?: boolean;
|
|
64
|
+
align?: Align;
|
|
65
|
+
fillColor?: string;
|
|
66
|
+
textColor?: string;
|
|
67
|
+
fontSize?: number;
|
|
68
|
+
}
|
|
69
|
+
interface Sheet {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
cells: {
|
|
73
|
+
[key: string]: Cell;
|
|
74
|
+
};
|
|
75
|
+
colNumber: number;
|
|
76
|
+
rowNumber: number;
|
|
77
|
+
merges: {
|
|
78
|
+
[key: number]: Merge;
|
|
79
|
+
};
|
|
80
|
+
mergeCellMap: {
|
|
81
|
+
[key: string]: number;
|
|
82
|
+
};
|
|
83
|
+
cols: Col[];
|
|
84
|
+
rows: Row[];
|
|
85
|
+
}
|
|
86
|
+
declare type BorderStyle = "thin" | "medium" | "thick" | "dashed" | "dotted" | "double";
|
|
87
|
+
declare type BorderDescr = [BorderStyle, string];
|
|
88
|
+
interface Border {
|
|
89
|
+
top?: BorderDescr;
|
|
90
|
+
left?: BorderDescr;
|
|
91
|
+
bottom?: BorderDescr;
|
|
92
|
+
right?: BorderDescr;
|
|
93
|
+
}
|
|
94
|
+
interface NewCell {
|
|
95
|
+
content?: string;
|
|
96
|
+
style?: number;
|
|
97
|
+
border?: number;
|
|
98
|
+
format?: string;
|
|
99
|
+
}
|
|
100
|
+
declare type ReferenceDenormalizer = (position: number, references: string[], sheetId: UID, functionName: string, paramNumber: number) => any | any[][];
|
|
101
|
+
declare type EnsureRange = (position: number, references: string[], sheetId: UID) => any[][];
|
|
102
|
+
declare type _CompiledFormula = (deps: Dependencies, sheetId: UID, refFn: ReferenceDenormalizer, range: EnsureRange, ctx: {}) => any;
|
|
103
|
+
interface CompiledFormula extends _CompiledFormula {
|
|
104
|
+
async: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface Cell extends NewCell {
|
|
107
|
+
col: number;
|
|
108
|
+
row: number;
|
|
109
|
+
xc: string;
|
|
110
|
+
error?: string;
|
|
111
|
+
pending?: boolean;
|
|
112
|
+
value: any;
|
|
113
|
+
formula?: {
|
|
114
|
+
text: string;
|
|
115
|
+
dependencies: Dependencies;
|
|
116
|
+
compiledFormula: CompiledFormula;
|
|
117
|
+
};
|
|
118
|
+
type: "formula" | "text" | "number" | "date";
|
|
119
|
+
}
|
|
120
|
+
interface Header {
|
|
121
|
+
start: number;
|
|
122
|
+
end: number;
|
|
123
|
+
name: string;
|
|
124
|
+
size: number;
|
|
125
|
+
}
|
|
126
|
+
interface Row extends Header {
|
|
127
|
+
cells: {
|
|
128
|
+
[col: number]: Cell;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
declare type Col = Header;
|
|
132
|
+
interface Merge extends Zone {
|
|
133
|
+
id: number;
|
|
134
|
+
topLeft: string;
|
|
135
|
+
}
|
|
136
|
+
interface Highlight {
|
|
137
|
+
zone: Zone;
|
|
138
|
+
sheet: string;
|
|
139
|
+
color: string | null;
|
|
140
|
+
}
|
|
141
|
+
declare type BorderCommand = "all" | "hv" | "h" | "v" | "external" | "left" | "top" | "right" | "bottom" | "clear";
|
|
142
|
+
interface Workbook {
|
|
143
|
+
visibleSheets: string[];
|
|
144
|
+
sheets: {
|
|
145
|
+
[id: string]: Sheet;
|
|
146
|
+
};
|
|
147
|
+
activeSheet: Sheet;
|
|
148
|
+
}
|
|
149
|
+
declare const enum DIRECTION {
|
|
150
|
+
UP = 0,
|
|
151
|
+
DOWN = 1,
|
|
152
|
+
LEFT = 2,
|
|
153
|
+
RIGHT = 3
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* https://docs.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/025ea6e4-ad42-43ea-a016-16f4e4688ac8
|
|
158
|
+
*/
|
|
159
|
+
interface ConditionalFormat {
|
|
160
|
+
id: string;
|
|
161
|
+
rule: SingleColorRules | ColorScaleRule;
|
|
162
|
+
stopIfTrue?: boolean;
|
|
163
|
+
ranges: string[];
|
|
164
|
+
}
|
|
165
|
+
declare type SingleColorRules = CellIsRule | ExpressionRule | ContainsTextRule | NotContainsTextRule | BeginsWithRule | EndsWithRule | containsBlanksRule | notContainsBlanksRule | containsErrorsRule | notContainsErrorsRule | TimePeriodRule | AboveAverageRule | Top10Rule;
|
|
166
|
+
interface SingleColorRule {
|
|
167
|
+
style: Style;
|
|
168
|
+
}
|
|
169
|
+
interface TextRule extends SingleColorRule {
|
|
170
|
+
text: string;
|
|
171
|
+
}
|
|
172
|
+
interface CellIsRule extends SingleColorRule {
|
|
173
|
+
type: "CellIsRule";
|
|
174
|
+
operator: ConditionalFormattingOperatorValues;
|
|
175
|
+
values: string[];
|
|
176
|
+
}
|
|
177
|
+
interface ExpressionRule extends SingleColorRule {
|
|
178
|
+
type: "ExpressionRule";
|
|
179
|
+
}
|
|
180
|
+
declare type ThresholdTypes = "value" | "number" | "percent" | "percentile" | "formula";
|
|
181
|
+
declare type ColorScaleThreshold = {
|
|
182
|
+
color: number;
|
|
183
|
+
type: ThresholdTypes;
|
|
184
|
+
value?: number;
|
|
185
|
+
};
|
|
186
|
+
interface ColorScaleRule {
|
|
187
|
+
type: "ColorScaleRule";
|
|
188
|
+
minimum: ColorScaleThreshold;
|
|
189
|
+
maximum: ColorScaleThreshold;
|
|
190
|
+
midpoint?: ColorScaleThreshold;
|
|
191
|
+
}
|
|
192
|
+
interface ContainsTextRule extends TextRule {
|
|
193
|
+
type: "ContainsTextRule";
|
|
194
|
+
}
|
|
195
|
+
interface NotContainsTextRule extends TextRule {
|
|
196
|
+
type: "NotContainsTextRule";
|
|
197
|
+
}
|
|
198
|
+
interface BeginsWithRule extends TextRule {
|
|
199
|
+
type: "BeginsWithRule";
|
|
200
|
+
}
|
|
201
|
+
interface EndsWithRule extends TextRule {
|
|
202
|
+
type: "EndsWithRule";
|
|
203
|
+
}
|
|
204
|
+
interface containsBlanksRule extends TextRule {
|
|
205
|
+
type: "containsBlanksRule";
|
|
206
|
+
}
|
|
207
|
+
interface notContainsBlanksRule extends TextRule {
|
|
208
|
+
type: "notContainsBlanksRule";
|
|
209
|
+
}
|
|
210
|
+
interface containsErrorsRule extends SingleColorRule {
|
|
211
|
+
type: "containsErrorsRule";
|
|
212
|
+
}
|
|
213
|
+
interface notContainsErrorsRule extends SingleColorRule {
|
|
214
|
+
type: "notContainsErrorsRule";
|
|
215
|
+
}
|
|
216
|
+
interface TimePeriodRule extends SingleColorRule {
|
|
217
|
+
type: "TimePeriodRule";
|
|
218
|
+
timePeriod: string;
|
|
219
|
+
}
|
|
220
|
+
interface AboveAverageRule extends SingleColorRule {
|
|
221
|
+
type: "AboveAverageRule";
|
|
222
|
+
aboveAverage: boolean;
|
|
223
|
+
equalAverage: boolean;
|
|
224
|
+
}
|
|
225
|
+
interface Top10Rule extends SingleColorRule {
|
|
226
|
+
type: "Top10Rule";
|
|
227
|
+
percent: boolean;
|
|
228
|
+
bottom: boolean;
|
|
229
|
+
rank: number;
|
|
230
|
+
}
|
|
231
|
+
declare type ConditionalFormattingOperatorValues = "BeginsWith" | "Between" | "ContainsText" | "EndsWith" | "Equal" | "GreaterThan" | "GreaterThanOrEqual" | "LessThan" | "LessThanOrEqual" | "NotBetween" | "NotContains" | "NotEqual";
|
|
232
|
+
|
|
233
|
+
declare type Dependencies = (string | number)[];
|
|
234
|
+
/**
|
|
235
|
+
* Represents a string in which all range references, strings and numbers are
|
|
236
|
+
* replaced by dependencies references.
|
|
237
|
+
*/
|
|
238
|
+
declare type NormalizedFormulaString = string;
|
|
239
|
+
declare type NormalizedFormula = {
|
|
240
|
+
text: NormalizedFormulaString;
|
|
241
|
+
dependencies: Dependencies;
|
|
242
|
+
};
|
|
243
|
+
interface CellData {
|
|
244
|
+
content?: string;
|
|
245
|
+
formula?: NormalizedFormula;
|
|
246
|
+
style?: number;
|
|
247
|
+
border?: number;
|
|
248
|
+
format?: string;
|
|
249
|
+
}
|
|
250
|
+
interface HeaderData {
|
|
251
|
+
size?: number;
|
|
252
|
+
}
|
|
253
|
+
interface Figure<T> {
|
|
254
|
+
id: string;
|
|
255
|
+
x: number;
|
|
256
|
+
y: number;
|
|
257
|
+
width: number;
|
|
258
|
+
height: number;
|
|
259
|
+
tag: string;
|
|
260
|
+
data: T;
|
|
261
|
+
}
|
|
262
|
+
interface SheetData {
|
|
263
|
+
id: string;
|
|
264
|
+
name: string;
|
|
265
|
+
colNumber: number;
|
|
266
|
+
rowNumber: number;
|
|
267
|
+
cells: {
|
|
268
|
+
[key: string]: CellData;
|
|
269
|
+
};
|
|
270
|
+
merges: string[];
|
|
271
|
+
figures: Figure<any>[];
|
|
272
|
+
cols: {
|
|
273
|
+
[key: number]: HeaderData;
|
|
274
|
+
};
|
|
275
|
+
rows: {
|
|
276
|
+
[key: number]: HeaderData;
|
|
277
|
+
};
|
|
278
|
+
conditionalFormats: ConditionalFormat[];
|
|
279
|
+
}
|
|
280
|
+
interface WorkbookData {
|
|
281
|
+
version: number;
|
|
282
|
+
sheets: SheetData[];
|
|
283
|
+
activeSheet: string;
|
|
284
|
+
styles: {
|
|
285
|
+
[key: number]: Style;
|
|
286
|
+
};
|
|
287
|
+
borders: {
|
|
288
|
+
[key: number]: Border;
|
|
289
|
+
};
|
|
290
|
+
entities: {
|
|
291
|
+
[key: string]: {
|
|
292
|
+
[key: string]: any;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* An AutofillModifier describe the possible operations to apply to the
|
|
299
|
+
* content of a cell when we autofill this cell.
|
|
300
|
+
*
|
|
301
|
+
* It could be:
|
|
302
|
+
* - Increment: increment the content by a given step
|
|
303
|
+
* - Copy: simply copy the content
|
|
304
|
+
* - Formula: update the formula, with the same behaviour than paste
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
interface IncrementModifier {
|
|
308
|
+
type: "INCREMENT_MODIFIER";
|
|
309
|
+
increment: number;
|
|
310
|
+
current: number;
|
|
311
|
+
}
|
|
312
|
+
interface CopyModifier {
|
|
313
|
+
type: "COPY_MODIFIER";
|
|
314
|
+
}
|
|
315
|
+
interface FormulaModifier {
|
|
316
|
+
type: "FORMULA_MODIFIER";
|
|
317
|
+
increment: number;
|
|
318
|
+
current: number;
|
|
319
|
+
}
|
|
320
|
+
declare type AutofillModifier = IncrementModifier | CopyModifier | FormulaModifier;
|
|
321
|
+
interface Tooltip {
|
|
322
|
+
props: any;
|
|
323
|
+
component?: any;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare type ChartTypes = "line" | "bar" | "pie";
|
|
327
|
+
interface CreateChartDefinition {
|
|
328
|
+
type: ChartTypes;
|
|
329
|
+
title: string;
|
|
330
|
+
labelRange: string;
|
|
331
|
+
dataSets: string[];
|
|
332
|
+
seriesHasTitle: boolean;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
declare type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<STRING>" | "RANGE<DATE>";
|
|
336
|
+
interface Arg {
|
|
337
|
+
repeating?: boolean;
|
|
338
|
+
optional?: boolean;
|
|
339
|
+
lazy?: boolean;
|
|
340
|
+
description: string;
|
|
341
|
+
name: string;
|
|
342
|
+
type: ArgType[];
|
|
343
|
+
default?: any;
|
|
344
|
+
}
|
|
345
|
+
interface FunctionDescription {
|
|
346
|
+
description: string;
|
|
347
|
+
compute: (this: EvalContext, ...args: any[]) => any;
|
|
348
|
+
async?: boolean;
|
|
349
|
+
category?: string;
|
|
350
|
+
args: Arg[];
|
|
351
|
+
returns: [ArgType];
|
|
352
|
+
}
|
|
353
|
+
interface EvalContext {
|
|
354
|
+
__lastFnCalled?: string;
|
|
355
|
+
[key: string]: any;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
interface WorkbookHistory {
|
|
359
|
+
updateState(path: (string | number)[], val: any): void;
|
|
360
|
+
updateLocalState(path: (string | number)[], val: any): void;
|
|
361
|
+
updateCell<T extends keyof Cell>(cell: Cell, key: T, value: Cell[T]): void;
|
|
362
|
+
updateSheet(sheet: Sheet, path: (string | number)[], value: any): void;
|
|
363
|
+
}
|
|
364
|
+
declare type WorkbookHistoryNonLocal = Omit<WorkbookHistory, "updateLocalState">;
|
|
365
|
+
declare class WHistory implements WorkbookHistoryNonLocal, CommandHandler {
|
|
366
|
+
private workbook;
|
|
367
|
+
private current;
|
|
368
|
+
private undoStack;
|
|
369
|
+
private redoStack;
|
|
370
|
+
constructor(workbook: Workbook);
|
|
371
|
+
canUndo(): boolean;
|
|
372
|
+
canRedo(): boolean;
|
|
373
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
374
|
+
beforeHandle(cmd: Command): void;
|
|
375
|
+
handle(cmd: Command): void;
|
|
376
|
+
finalize(): void;
|
|
377
|
+
isActiveSheet(): boolean | null;
|
|
378
|
+
undo(): void;
|
|
379
|
+
redo(): void;
|
|
380
|
+
private applyChange;
|
|
381
|
+
updateStateFromRoot(root: any, path: (string | number)[], val: any): void;
|
|
382
|
+
updateState(path: (string | number)[], val: any): void;
|
|
383
|
+
updateCell<T extends keyof Cell>(cell: Cell, key: T, value: Cell[T]): void;
|
|
384
|
+
updateSheet(sheet: Sheet, path: (string | number)[], value: any): void;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Model
|
|
389
|
+
*
|
|
390
|
+
* The Model class is the owner of the state of the Spreadsheet. However, it
|
|
391
|
+
* has more a coordination role: it defers the actual state manipulation work to
|
|
392
|
+
* plugins.
|
|
393
|
+
*
|
|
394
|
+
* At creation, the Model instantiates all necessary plugins. They each have
|
|
395
|
+
* a private state (for example, the Selection plugin has the current selection),
|
|
396
|
+
* and share a common core state (named workbook).
|
|
397
|
+
*
|
|
398
|
+
* State changes are then performed through commands. Commands are dispatched
|
|
399
|
+
* to the model, which will then relay them to each plugins (and the history
|
|
400
|
+
* handler). Then, the model will trigger an 'update' event to notify whoever
|
|
401
|
+
* is concerned that the command was applied (if it was not cancelled).
|
|
402
|
+
*
|
|
403
|
+
* Also, the model has an unconventional responsibility: it actually renders the
|
|
404
|
+
* visible viewport on a canvas. This is because each plugins actually manage a
|
|
405
|
+
* specific concern about the content of the spreadsheet, and it is more natural
|
|
406
|
+
* if they are able to read data from their internal state to represent it on the
|
|
407
|
+
* screen.
|
|
408
|
+
*
|
|
409
|
+
* Note that the Model can be used in a standalone way to manipulate
|
|
410
|
+
* programmatically a spreadsheet.
|
|
411
|
+
*/
|
|
412
|
+
declare type Mode = "normal" | "headless" | "readonly";
|
|
413
|
+
interface ModelConfig {
|
|
414
|
+
mode: Mode;
|
|
415
|
+
openSidePanel: (panel: string, panelProps?: any) => void;
|
|
416
|
+
notifyUser: (content: string) => any;
|
|
417
|
+
askConfirmation: (content: string, confirm: () => any, cancel?: () => any) => any;
|
|
418
|
+
editText: (title: string, placeholder: string, callback: (text: string | null) => any) => any;
|
|
419
|
+
evalContext: EvalContext;
|
|
420
|
+
}
|
|
421
|
+
declare class Model extends owl.core.EventBus implements CommandDispatcher {
|
|
422
|
+
/**
|
|
423
|
+
* Handlers are classes that can handle a command. In practice, this is
|
|
424
|
+
* basically a list of all plugins and the history manager (not a plugin)
|
|
425
|
+
*/
|
|
426
|
+
private handlers;
|
|
427
|
+
/**
|
|
428
|
+
* A plugin can draw some contents on the canvas. But even better: it can do
|
|
429
|
+
* so multiple times. The order of the render calls will determine a list of
|
|
430
|
+
* "layers" (i.e., earlier calls will be obviously drawn below later calls).
|
|
431
|
+
* This list simply keeps the renderers+layer information so the drawing code
|
|
432
|
+
* can just iterate on it
|
|
433
|
+
*/
|
|
434
|
+
private renderers;
|
|
435
|
+
/**
|
|
436
|
+
* Internal status of the model. Important for command handling coordination
|
|
437
|
+
*/
|
|
438
|
+
private status;
|
|
439
|
+
/**
|
|
440
|
+
* The config object contains some configuration flag and callbacks
|
|
441
|
+
*/
|
|
442
|
+
private config;
|
|
443
|
+
/**
|
|
444
|
+
* The workbook is the core state, shared between all plugins.
|
|
445
|
+
*/
|
|
446
|
+
private workbook;
|
|
447
|
+
/**
|
|
448
|
+
* Getters are the main way the rest of the UI read data from the model. Also,
|
|
449
|
+
* it is shared between all plugins, so they can also communicate with each
|
|
450
|
+
* other.
|
|
451
|
+
*/
|
|
452
|
+
getters: Getters;
|
|
453
|
+
constructor(data?: any, config?: Partial<ModelConfig>);
|
|
454
|
+
destroy(): void;
|
|
455
|
+
/**
|
|
456
|
+
* Initialise and properly configure a plugin.
|
|
457
|
+
*
|
|
458
|
+
* This method is private for now, but if the need arise, there is no deep
|
|
459
|
+
* reason why the model could not add dynamically a plugin while it is running.
|
|
460
|
+
*/
|
|
461
|
+
private setupPlugin;
|
|
462
|
+
/**
|
|
463
|
+
* The dispatch method is the only entry point to manipulate date in the model.
|
|
464
|
+
* This is through this method that commands are dispatched, most of the time
|
|
465
|
+
* recursively until no plugin want to react anymore.
|
|
466
|
+
*
|
|
467
|
+
* Small technical detail: it is defined as an arrow function. There are two
|
|
468
|
+
* reasons for this:
|
|
469
|
+
* 1. this means that the dispatch method can be "detached" from the model,
|
|
470
|
+
* which is done when it is put in the environment (see the Spreadsheet
|
|
471
|
+
* component)
|
|
472
|
+
* 2. This allows us to define its type by using the interface CommandDispatcher
|
|
473
|
+
*/
|
|
474
|
+
dispatch: CommandDispatcher["dispatch"];
|
|
475
|
+
/**
|
|
476
|
+
* When the Grid component is ready (= mounted), it has a reference to its
|
|
477
|
+
* canvas and need to draw the grid on it. This is then done by calling this
|
|
478
|
+
* method, which will dispatch the call to all registered plugins.
|
|
479
|
+
*
|
|
480
|
+
* Note that nothing prevent multiple grid components from calling this method
|
|
481
|
+
* each, or one grid component calling it multiple times with a different
|
|
482
|
+
* context. This is probably the way we should do if we want to be able to
|
|
483
|
+
* freeze a part of the grid (so, we would need to render different zones)
|
|
484
|
+
*/
|
|
485
|
+
drawGrid(context: GridRenderingContext): void;
|
|
486
|
+
/**
|
|
487
|
+
* As the name of this method strongly implies, it is useful when we need to
|
|
488
|
+
* export date out of the model.
|
|
489
|
+
*/
|
|
490
|
+
exportData(): WorkbookData;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
declare type UIActions = Pick<ModelConfig, "askConfirmation" | "notifyUser" | "openSidePanel" | "editText">;
|
|
494
|
+
/**
|
|
495
|
+
* BasePlugin
|
|
496
|
+
*
|
|
497
|
+
* Since the spreadsheet internal state is quite complex, it is split into
|
|
498
|
+
* multiple parts, each managing a specific concern.
|
|
499
|
+
*
|
|
500
|
+
* This file introduce the BasePlugin, which is the common class that defines
|
|
501
|
+
* how each of these model sub parts should interact with each other.
|
|
502
|
+
*/
|
|
503
|
+
declare class BasePlugin implements CommandHandler {
|
|
504
|
+
static layers: LAYERS[];
|
|
505
|
+
static getters: string[];
|
|
506
|
+
static modes: Mode[];
|
|
507
|
+
protected workbook: Workbook;
|
|
508
|
+
protected getters: Getters;
|
|
509
|
+
protected history: WorkbookHistory;
|
|
510
|
+
protected dispatch: CommandDispatcher["dispatch"];
|
|
511
|
+
protected currentMode: Mode;
|
|
512
|
+
protected ui: UIActions;
|
|
513
|
+
constructor(workbook: Workbook, getters: Getters, history: WHistory, dispatch: CommandDispatcher["dispatch"], config: ModelConfig);
|
|
514
|
+
/**
|
|
515
|
+
* Before a command is accepted, the model will ask each plugin if the command
|
|
516
|
+
* is allowed. If all of then return true, then we can proceed. Otherwise,
|
|
517
|
+
* the command is cancelled.
|
|
518
|
+
*
|
|
519
|
+
* There should not be any side effects in this method.
|
|
520
|
+
*/
|
|
521
|
+
allowDispatch(command: Command): CommandResult;
|
|
522
|
+
/**
|
|
523
|
+
* This method is useful when a plugin need to perform some action before a
|
|
524
|
+
* command is handled in another plugin. This should only be used if it is not
|
|
525
|
+
* possible to do the work in the handle method.
|
|
526
|
+
*/
|
|
527
|
+
beforeHandle(command: Command): void;
|
|
528
|
+
/**
|
|
529
|
+
* This is the standard place to handle any command. Most of the plugin
|
|
530
|
+
* command handling work should take place here.
|
|
531
|
+
*/
|
|
532
|
+
handle(command: Command): void;
|
|
533
|
+
/**
|
|
534
|
+
* Sometimes, it is useful to perform some work after a command (and all its
|
|
535
|
+
* subcommands) has been completely handled. For example, when we paste
|
|
536
|
+
* multiple cells, we only want to reevaluate the cell values once at the end.
|
|
537
|
+
*/
|
|
538
|
+
finalize(command: Command): void;
|
|
539
|
+
drawGrid(ctx: GridRenderingContext, layer: LAYERS): void;
|
|
540
|
+
import(data: WorkbookData): void;
|
|
541
|
+
export(data: WorkbookData): void;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Autofill Plugin
|
|
546
|
+
*
|
|
547
|
+
*/
|
|
548
|
+
declare class AutofillPlugin extends BasePlugin {
|
|
549
|
+
static layers: LAYERS[];
|
|
550
|
+
static getters: string[];
|
|
551
|
+
static modes: Mode[];
|
|
552
|
+
private autofillZone;
|
|
553
|
+
private lastCellSelected;
|
|
554
|
+
private direction;
|
|
555
|
+
private tooltip;
|
|
556
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
557
|
+
handle(cmd: Command): void;
|
|
558
|
+
getAutofillTooltip(): Tooltip | undefined;
|
|
559
|
+
/**
|
|
560
|
+
* Autofill the autofillZone from the current selection
|
|
561
|
+
* @param apply Flag set to true to apply the autofill in the model. It's
|
|
562
|
+
* usefull to set it to false when we need to fill the tooltip
|
|
563
|
+
*/
|
|
564
|
+
private autofill;
|
|
565
|
+
/**
|
|
566
|
+
* Select a cell which becomes the last cell of the autofillZone
|
|
567
|
+
*/
|
|
568
|
+
private select;
|
|
569
|
+
/**
|
|
570
|
+
* Computes the autofillZone to autofill when the user double click on the
|
|
571
|
+
* autofiller
|
|
572
|
+
*/
|
|
573
|
+
private autofillAuto;
|
|
574
|
+
/**
|
|
575
|
+
* Generate the next cell
|
|
576
|
+
*/
|
|
577
|
+
private computeNewCell;
|
|
578
|
+
/**
|
|
579
|
+
* Get the rule associated to the current cell
|
|
580
|
+
*/
|
|
581
|
+
private getRule;
|
|
582
|
+
/**
|
|
583
|
+
* Create the generator to be able to autofill the next cells.
|
|
584
|
+
*/
|
|
585
|
+
private createGenerator;
|
|
586
|
+
private saveZone;
|
|
587
|
+
/**
|
|
588
|
+
* Compute the direction of the autofill from the last selected zone and
|
|
589
|
+
* a given cell (col, row)
|
|
590
|
+
*/
|
|
591
|
+
private getDirection;
|
|
592
|
+
drawGrid(renderingContext: GridRenderingContext): void;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
declare class ChartPlugin extends BasePlugin {
|
|
596
|
+
static getters: string[];
|
|
597
|
+
static layers: LAYERS[];
|
|
598
|
+
private chartFigures;
|
|
599
|
+
private chartRuntime;
|
|
600
|
+
private outOfDate;
|
|
601
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
602
|
+
handle(cmd: Command): void;
|
|
603
|
+
finalize(cmd: Command): void;
|
|
604
|
+
import(data: WorkbookData): void;
|
|
605
|
+
getChartRuntime(figureId: string): ChartConfiguration | undefined;
|
|
606
|
+
private getChartDefinition;
|
|
607
|
+
private createChartDefinition;
|
|
608
|
+
/**
|
|
609
|
+
* Create a chart dataset from a Zone.
|
|
610
|
+
* The zone should be a single column or a single row
|
|
611
|
+
*/
|
|
612
|
+
private createDataset;
|
|
613
|
+
private getDefaultConfiguration;
|
|
614
|
+
private extractDataFromRange;
|
|
615
|
+
private mapDefinitionToRuntime;
|
|
616
|
+
private addChartFigure;
|
|
617
|
+
private isCellUsedInChart;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Clipboard Plugin
|
|
622
|
+
*
|
|
623
|
+
* This clipboard manages all cut/copy/paste interactions internal to the
|
|
624
|
+
* application, and with the OS clipboard as well.
|
|
625
|
+
*/
|
|
626
|
+
declare class ClipboardPlugin extends BasePlugin {
|
|
627
|
+
static layers: LAYERS[];
|
|
628
|
+
static getters: string[];
|
|
629
|
+
static modes: Mode[];
|
|
630
|
+
private status;
|
|
631
|
+
private shouldCut?;
|
|
632
|
+
private zones;
|
|
633
|
+
private cells?;
|
|
634
|
+
private originSheet;
|
|
635
|
+
private _isPaintingFormat;
|
|
636
|
+
private pasteOnlyValue;
|
|
637
|
+
private pasteOnlyFormat;
|
|
638
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
639
|
+
handle(cmd: Command): void;
|
|
640
|
+
/**
|
|
641
|
+
* Format the current clipboard to a string suitable for being pasted in other
|
|
642
|
+
* programs.
|
|
643
|
+
*
|
|
644
|
+
* - add a tab character between each concecutive cells
|
|
645
|
+
* - add a newline character between each line
|
|
646
|
+
*
|
|
647
|
+
* Note that it returns \t if the clipboard is empty. This is necessary for the
|
|
648
|
+
* clipboard copy event to add it as data, otherwise an empty string is not
|
|
649
|
+
* considered as a copy content.
|
|
650
|
+
*/
|
|
651
|
+
getClipboardContent(): string;
|
|
652
|
+
getPasteZones(target: Zone[]): Zone[];
|
|
653
|
+
isPaintingFormat(): boolean;
|
|
654
|
+
private cutOrCopy;
|
|
655
|
+
private pasteFromClipboard;
|
|
656
|
+
private isPasteAllowed;
|
|
657
|
+
private pasteFromModel;
|
|
658
|
+
private clearCutZone;
|
|
659
|
+
private pasteZone;
|
|
660
|
+
private addMissingDimensions;
|
|
661
|
+
pasteCell(origin: Cell | null, col: number, row: number, onlyValue: boolean, onlyFormat: boolean): void;
|
|
662
|
+
private valueToContent;
|
|
663
|
+
interactivePaste(target: Zone[]): void;
|
|
664
|
+
drawGrid(renderingContext: GridRenderingContext): void;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
declare class ConditionalFormatPlugin extends BasePlugin {
|
|
668
|
+
static getters: string[];
|
|
669
|
+
private isStale;
|
|
670
|
+
private cfRules;
|
|
671
|
+
private computedStyles;
|
|
672
|
+
handle(cmd: Command): void;
|
|
673
|
+
finalize(): void;
|
|
674
|
+
import(data: WorkbookData): void;
|
|
675
|
+
export(data: Partial<WorkbookData>): void;
|
|
676
|
+
/**
|
|
677
|
+
* Returns all the conditional format rules defined for the current sheet
|
|
678
|
+
*/
|
|
679
|
+
getConditionalFormats(): ConditionalFormat[];
|
|
680
|
+
/**
|
|
681
|
+
* Returns the conditional style property for a given cell reference in the active sheet or
|
|
682
|
+
* undefined if this cell doesn't have a conditional style set.
|
|
683
|
+
*/
|
|
684
|
+
getConditionalStyle(xc: string): Style | undefined;
|
|
685
|
+
getRulesSelection(selection: [Zone]): string[];
|
|
686
|
+
getRulesByZone(zone: Zone): Set<string>;
|
|
687
|
+
getRulesByCell(cellXc: string): Set<ConditionalFormat>;
|
|
688
|
+
/**
|
|
689
|
+
* Add or replace a conditional format rule
|
|
690
|
+
*/
|
|
691
|
+
private addConditionalFormatting;
|
|
692
|
+
/**
|
|
693
|
+
* Execute the complete color scale for the range of the conditional format for a 2 colors rule
|
|
694
|
+
*/
|
|
695
|
+
private applyColorScale;
|
|
696
|
+
/**
|
|
697
|
+
* Execute the predicate to know if a conditional formatting rule should be applied to a cell
|
|
698
|
+
*/
|
|
699
|
+
private rulePredicate;
|
|
700
|
+
/**
|
|
701
|
+
* Compute the styles according to the conditional formatting.
|
|
702
|
+
* This computation must happen after the cell values are computed if they change
|
|
703
|
+
*
|
|
704
|
+
* This result of the computation will be in the state.cell[XC].conditionalStyle and will be the union of all the style
|
|
705
|
+
* properties of the rules applied (in order).
|
|
706
|
+
* So if a cell has multiple conditional formatting applied to it, and each affect a different value of the style,
|
|
707
|
+
* the resulting style will have the combination of all those values.
|
|
708
|
+
* If multiple conditional formatting use the same style value, they will be applied in order so that the last applied wins
|
|
709
|
+
*/
|
|
710
|
+
private computeStyles;
|
|
711
|
+
private adaptcfRules;
|
|
712
|
+
private removeConditionalFormatting;
|
|
713
|
+
private pasteCf;
|
|
714
|
+
private adaptRules;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Core Plugin
|
|
719
|
+
*
|
|
720
|
+
* This is the most fundamental of all plugins. It defines how to interact with
|
|
721
|
+
* cell and sheet content.
|
|
722
|
+
*/
|
|
723
|
+
declare class CorePlugin extends BasePlugin {
|
|
724
|
+
static getters: string[];
|
|
725
|
+
private sheetIds;
|
|
726
|
+
private showFormulas;
|
|
727
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
728
|
+
handle(cmd: Command): void;
|
|
729
|
+
applyOffset(formula: string, offsetX: number, offsetY: number): string;
|
|
730
|
+
getCell(col: number, row: number, sheetName?: string): Cell | null;
|
|
731
|
+
getCellText(cell: Cell): string;
|
|
732
|
+
/**
|
|
733
|
+
* Converts a zone to a XC coordinate system
|
|
734
|
+
*
|
|
735
|
+
* The conversion also treats merges as one single cell
|
|
736
|
+
*
|
|
737
|
+
* Examples:
|
|
738
|
+
* {top:0,left:0,right:0,bottom:0} ==> A1
|
|
739
|
+
* {top:0,left:0,right:1,bottom:1} ==> A1:B2
|
|
740
|
+
*
|
|
741
|
+
* if A1:B2 is a merge:
|
|
742
|
+
* {top:0,left:0,right:1,bottom:1} ==> A1
|
|
743
|
+
* {top:1,left:0,right:1,bottom:2} ==> A1:B3
|
|
744
|
+
*
|
|
745
|
+
* if A1:B2 and A4:B5 are merges:
|
|
746
|
+
* {top:1,left:0,right:1,bottom:3} ==> A1:A5
|
|
747
|
+
*/
|
|
748
|
+
zoneToXC(zone: Zone): string;
|
|
749
|
+
/**
|
|
750
|
+
* Returns the id (not the name) of the currently active sheet
|
|
751
|
+
*/
|
|
752
|
+
getActiveSheet(): string;
|
|
753
|
+
getSheetName(sheetId: string): string | undefined;
|
|
754
|
+
getSheetIdByName(name: string | undefined): string | undefined;
|
|
755
|
+
getSheets(): Sheet[];
|
|
756
|
+
getCol(sheetId: string, index: number): Col;
|
|
757
|
+
getRow(sheetId: string, index: number): Row;
|
|
758
|
+
/**
|
|
759
|
+
* Returns all the cells of a col
|
|
760
|
+
*/
|
|
761
|
+
getColCells(col: number): Cell[];
|
|
762
|
+
getNumberCols(sheetId: string): number;
|
|
763
|
+
getNumberRows(sheetId: string): number;
|
|
764
|
+
getColsZone(start: number, end: number): Zone;
|
|
765
|
+
getRowsZone(start: number, end: number): Zone;
|
|
766
|
+
getGridSize(): [number, number];
|
|
767
|
+
shouldShowFormulas(): boolean;
|
|
768
|
+
getRangeValues(reference: string, defaultSheetId: string): any[][];
|
|
769
|
+
getRangeFormattedValues(reference: string, defaultSheetId: string): string[][];
|
|
770
|
+
private getColMaxWidth;
|
|
771
|
+
private getRowMaxHeight;
|
|
772
|
+
private setColSize;
|
|
773
|
+
private setRowSize;
|
|
774
|
+
/**
|
|
775
|
+
* Delete column. This requires a lot of handling:
|
|
776
|
+
* - Update all the formulas in all sheets
|
|
777
|
+
* - Move the cells
|
|
778
|
+
* - Update the cols/rows (size, number, (cells), ...)
|
|
779
|
+
* - Reevaluate the cells
|
|
780
|
+
*
|
|
781
|
+
* @param sheetID ID of the sheet on which deletion should be applied
|
|
782
|
+
* @param columns Columns to delete
|
|
783
|
+
*/
|
|
784
|
+
private removeColumns;
|
|
785
|
+
/**
|
|
786
|
+
* Delete row. This requires a lot of handling:
|
|
787
|
+
* - Update the merges
|
|
788
|
+
* - Update all the formulas in all sheets
|
|
789
|
+
* - Move the cells
|
|
790
|
+
* - Update the cols/rows (size, number, (cells), ...)
|
|
791
|
+
* - Reevaluate the cells
|
|
792
|
+
*
|
|
793
|
+
* @param sheetID ID of the sheet on which deletion should be applied
|
|
794
|
+
* @param rows Rows to delete
|
|
795
|
+
*/
|
|
796
|
+
private removeRows;
|
|
797
|
+
private addColumns;
|
|
798
|
+
private addRows;
|
|
799
|
+
private moveCellsHorizontally;
|
|
800
|
+
/**
|
|
801
|
+
* Move all the cells that are from the row under `deleteToRow` up to `deleteFromRow`
|
|
802
|
+
*
|
|
803
|
+
* b.e.
|
|
804
|
+
* move vertically with delete from 3 and delete to 5 will first clear all the cells from lines 3 to 5,
|
|
805
|
+
* then take all the row starting at index 6 and add them back at index 3
|
|
806
|
+
*
|
|
807
|
+
* @param deleteFromRow the row index from which to start deleting
|
|
808
|
+
* @param deleteToRow the row index until which the deleting must continue
|
|
809
|
+
* @param the sheet from which to remove
|
|
810
|
+
*/
|
|
811
|
+
private moveCellVerticallyBatched;
|
|
812
|
+
private moveCellsVertically;
|
|
813
|
+
private manageColumnsHeaders;
|
|
814
|
+
private processRowsHeaderDelete;
|
|
815
|
+
private processRowsHeaderAdd;
|
|
816
|
+
private addEmptyRow;
|
|
817
|
+
private updateColumnsFormulas;
|
|
818
|
+
private updateRowsFormulas;
|
|
819
|
+
private processCellsToMove;
|
|
820
|
+
private updateCell;
|
|
821
|
+
private generateSheetName;
|
|
822
|
+
private createSheet;
|
|
823
|
+
private moveSheet;
|
|
824
|
+
private isRenameAllowed;
|
|
825
|
+
private interactiveRenameSheet;
|
|
826
|
+
private renameSheet;
|
|
827
|
+
private duplicateSheet;
|
|
828
|
+
private interactiveDeleteSheet;
|
|
829
|
+
private deleteSheet;
|
|
830
|
+
private clearZones;
|
|
831
|
+
/**
|
|
832
|
+
* Update a reference by applying an offset to the column
|
|
833
|
+
*
|
|
834
|
+
* @param ref Reference to update
|
|
835
|
+
* @param sheet Id of the sheet, if cross-sheet reference
|
|
836
|
+
* @param base Index of the element added/removed
|
|
837
|
+
* @param step Number of elements added or -1 if removed
|
|
838
|
+
*/
|
|
839
|
+
private updateColumnsRef;
|
|
840
|
+
/**
|
|
841
|
+
* Update a full range by appling an offset.
|
|
842
|
+
*
|
|
843
|
+
* @param ref Reference to update
|
|
844
|
+
* @param sheet Id of the sheet, if cross-sheet reference
|
|
845
|
+
* @param base Index of the element added/removed
|
|
846
|
+
* @param step Number of elements added or -1 if removed
|
|
847
|
+
*/
|
|
848
|
+
private updateColumnsRange;
|
|
849
|
+
/**
|
|
850
|
+
* Update a reference by applying an offset to the row
|
|
851
|
+
*
|
|
852
|
+
* @param ref Reference to update
|
|
853
|
+
* @param sheet Id of the sheet, if cross-sheet reference
|
|
854
|
+
* @param base Index of the element added/removed
|
|
855
|
+
* @param step Number of elements added or -1 if removed
|
|
856
|
+
*/
|
|
857
|
+
private updateRowsRef;
|
|
858
|
+
/**
|
|
859
|
+
* Update a full range by appling an offset.
|
|
860
|
+
*
|
|
861
|
+
* @param ref Reference to update
|
|
862
|
+
* @param sheet Id of the sheet, if cross-sheet reference
|
|
863
|
+
* @param base Index of the element added/removed
|
|
864
|
+
* @param step Number of elements added/removed (negative when removed)
|
|
865
|
+
*/
|
|
866
|
+
private updateRowsRange;
|
|
867
|
+
/**
|
|
868
|
+
* Update a range with some offsets
|
|
869
|
+
*/
|
|
870
|
+
private updateRange;
|
|
871
|
+
/**
|
|
872
|
+
* Update a reference with some offsets.
|
|
873
|
+
*/
|
|
874
|
+
private updateReference;
|
|
875
|
+
private visitAllFormulasSymbols;
|
|
876
|
+
/**
|
|
877
|
+
* Apply a function to update the formula on every cells of every sheets which
|
|
878
|
+
* contains a formula
|
|
879
|
+
* @param cb Update formula function to apply
|
|
880
|
+
*/
|
|
881
|
+
private visitFormulas;
|
|
882
|
+
import(data: WorkbookData): void;
|
|
883
|
+
importSheet(data: SheetData): void;
|
|
884
|
+
export(data: WorkbookData): void;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
declare type EditionMode = "editing" | "selecting" | "inactive";
|
|
888
|
+
declare class EditionPlugin extends BasePlugin {
|
|
889
|
+
static layers: LAYERS[];
|
|
890
|
+
static getters: string[];
|
|
891
|
+
static modes: Mode[];
|
|
892
|
+
private col;
|
|
893
|
+
private row;
|
|
894
|
+
private mode;
|
|
895
|
+
private sheet;
|
|
896
|
+
private currentContent;
|
|
897
|
+
beforeHandle(cmd: Command): void;
|
|
898
|
+
handle(cmd: Command): void;
|
|
899
|
+
getEditionMode(): EditionMode;
|
|
900
|
+
getCurrentContent(): string;
|
|
901
|
+
getEditionSheet(): string;
|
|
902
|
+
private startEdition;
|
|
903
|
+
private stopEdition;
|
|
904
|
+
private cancelEdition;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
declare class EvaluationPlugin extends BasePlugin {
|
|
908
|
+
static getters: string[];
|
|
909
|
+
static modes: Mode[];
|
|
910
|
+
private isUptodate;
|
|
911
|
+
private loadingCells;
|
|
912
|
+
private isStarted;
|
|
913
|
+
private evalContext;
|
|
914
|
+
/**
|
|
915
|
+
* For all cells that are being currently computed (asynchronously).
|
|
916
|
+
*
|
|
917
|
+
* For example: =Wait(3)
|
|
918
|
+
*/
|
|
919
|
+
private PENDING;
|
|
920
|
+
/**
|
|
921
|
+
* For all cells that are NOT being currently computed, but depend on another
|
|
922
|
+
* asynchronous computation.
|
|
923
|
+
*
|
|
924
|
+
* For example: A2 is in WAITING (initially) and A1 in PENDING
|
|
925
|
+
* A1: =Wait(3)
|
|
926
|
+
* A2: =A1
|
|
927
|
+
*/
|
|
928
|
+
private WAITING;
|
|
929
|
+
/**
|
|
930
|
+
* For all cells that have been async computed.
|
|
931
|
+
*
|
|
932
|
+
* For example:
|
|
933
|
+
* A1: =Wait(3)
|
|
934
|
+
* A2: =A1
|
|
935
|
+
*
|
|
936
|
+
* When A1 is computed, A1 is moved in COMPUTED
|
|
937
|
+
*/
|
|
938
|
+
private COMPUTED;
|
|
939
|
+
constructor(workbook: Workbook, getters: Getters, history: WHistory, dispatch: CommandDispatcher["dispatch"], config: ModelConfig);
|
|
940
|
+
handle(cmd: Command): void;
|
|
941
|
+
finalize(): void;
|
|
942
|
+
evaluateFormula(formula: string, sheet?: UID): any;
|
|
943
|
+
isIdle(): boolean;
|
|
944
|
+
private startScheduler;
|
|
945
|
+
private evaluate;
|
|
946
|
+
private evaluateCells;
|
|
947
|
+
/**
|
|
948
|
+
* Return all functions necessary to properly evaluate a formula:
|
|
949
|
+
* - a refFn function to read any reference, cell or range of a normalized formula
|
|
950
|
+
* - a range function to convert any reference to a proper value array
|
|
951
|
+
* - an evaluation context
|
|
952
|
+
*/
|
|
953
|
+
private getFormulaParameters;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
declare class FigurePlugin extends BasePlugin {
|
|
957
|
+
static getters: string[];
|
|
958
|
+
private selectedFigureId;
|
|
959
|
+
private figures;
|
|
960
|
+
private sheetFigures;
|
|
961
|
+
handle(cmd: Command): void;
|
|
962
|
+
deleteSheet(sheet: string): void;
|
|
963
|
+
getFigures(viewport: Viewport): Figure<any>[];
|
|
964
|
+
getSelectedFigureId(): string | null;
|
|
965
|
+
getFigure<T>(figureId: string): Figure<T>;
|
|
966
|
+
import(data: WorkbookData): void;
|
|
967
|
+
export(data: WorkbookData): void;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Formatting plugin.
|
|
972
|
+
*
|
|
973
|
+
* This plugin manages all things related to a cell look:
|
|
974
|
+
* - styles
|
|
975
|
+
* - borders
|
|
976
|
+
* - value formatters
|
|
977
|
+
*/
|
|
978
|
+
declare class FormattingPlugin extends BasePlugin {
|
|
979
|
+
static getters: string[];
|
|
980
|
+
private ctx;
|
|
981
|
+
private styles;
|
|
982
|
+
private borders;
|
|
983
|
+
private nextId;
|
|
984
|
+
handle(cmd: Command): void;
|
|
985
|
+
getCellWidth(cell: Cell): number;
|
|
986
|
+
getTextWidth(text: string, styleId?: number): number;
|
|
987
|
+
getCellHeight(cell: Cell): number;
|
|
988
|
+
getCellStyle(cell: Cell): Style;
|
|
989
|
+
getCellBorder(cell: Cell): Border | null;
|
|
990
|
+
getCurrentStyle(): Style;
|
|
991
|
+
private setStyle;
|
|
992
|
+
private setStyleToCell;
|
|
993
|
+
private registerStyle;
|
|
994
|
+
private setBorder;
|
|
995
|
+
private aggregateBorderCommands;
|
|
996
|
+
private clearBorder;
|
|
997
|
+
private clearSide;
|
|
998
|
+
private setBorderToMap;
|
|
999
|
+
private registerBorder;
|
|
1000
|
+
/**
|
|
1001
|
+
* Note that here, formatting refers to styles+border, not value formatters
|
|
1002
|
+
*/
|
|
1003
|
+
private clearFormatting;
|
|
1004
|
+
private setFormatter;
|
|
1005
|
+
/**
|
|
1006
|
+
* This function allows to adjust the quantity of decimal places after a decimal
|
|
1007
|
+
* point on cells containing number value. It does this by changing the cells
|
|
1008
|
+
* format. Values aren't modified.
|
|
1009
|
+
*
|
|
1010
|
+
* The change of the decimal quantity is done one by one, the sign of the step
|
|
1011
|
+
* variable indicates whether we are increasing or decreasing.
|
|
1012
|
+
*
|
|
1013
|
+
* If several cells are in the zone, the format resulting from the change of the
|
|
1014
|
+
* first cell (with number type) will be applied to the whole zone.
|
|
1015
|
+
*/
|
|
1016
|
+
private setDecimal;
|
|
1017
|
+
/**
|
|
1018
|
+
* Take a range of cells and return the format of the first cell containing a
|
|
1019
|
+
* number value. Returns a default format if the cell hasn't format. Returns
|
|
1020
|
+
* undefined if no number value in the range.
|
|
1021
|
+
*/
|
|
1022
|
+
private searchNumberFormat;
|
|
1023
|
+
/**
|
|
1024
|
+
* Function used to give the default format of a cell with a number for value.
|
|
1025
|
+
* It is considered that the default format of a number is 0 followed by as many
|
|
1026
|
+
* 0 as there are decimal places.
|
|
1027
|
+
*
|
|
1028
|
+
* Exemple:
|
|
1029
|
+
* - 1 --> '0'
|
|
1030
|
+
* - 123 --> '0'
|
|
1031
|
+
* - 12345 --> '0'
|
|
1032
|
+
* - 42.1 --> '0.0'
|
|
1033
|
+
* - 456.0001 --> '0.0000'
|
|
1034
|
+
*/
|
|
1035
|
+
private setDefaultNumberFormat;
|
|
1036
|
+
/**
|
|
1037
|
+
* This function take a cell format representation and return a new format representtion
|
|
1038
|
+
* with more or lesse decimal places.
|
|
1039
|
+
*
|
|
1040
|
+
* If the format doesn't look like a digital format (means that not contain '0')
|
|
1041
|
+
* or if this one cannot be increased or decreased, the returned format will be
|
|
1042
|
+
* the same.
|
|
1043
|
+
*
|
|
1044
|
+
* This function aims to work with all possible formats as well as custom formats.
|
|
1045
|
+
*
|
|
1046
|
+
* Examples of format changed by this function:
|
|
1047
|
+
* - "0" (step = 1) --> "0.0"
|
|
1048
|
+
* - "0.000%" (step = 1) --> "0.0000%"
|
|
1049
|
+
* - "0.00" (step = -1) --> "0.0"
|
|
1050
|
+
* - "0%" (step = -1) --> "0%"
|
|
1051
|
+
* - "#,##0.0" (step = -1) --> "#,##0"
|
|
1052
|
+
* - "#,##0;0.0%;0.000" (step = 1) --> "#,##0.0;0.00%;0.0000"
|
|
1053
|
+
*/
|
|
1054
|
+
private changeDecimalFormat;
|
|
1055
|
+
/**
|
|
1056
|
+
* This function computes the style/border of a row/col based on the neighbours.
|
|
1057
|
+
*
|
|
1058
|
+
* @param index the index of the row/col of which we will change the style
|
|
1059
|
+
* @param isColumn true if element is a column, false if row
|
|
1060
|
+
* @param upper true if the style of the upper row/col should be used, false, if the lower should be used
|
|
1061
|
+
*/
|
|
1062
|
+
private onAddElements;
|
|
1063
|
+
/**
|
|
1064
|
+
* gets the currently used style/border of a cell based on it's coordinates
|
|
1065
|
+
*
|
|
1066
|
+
* @param x column number of a cell
|
|
1067
|
+
* @param y row number of a cell
|
|
1068
|
+
*/
|
|
1069
|
+
private getFormat;
|
|
1070
|
+
import(data: WorkbookData): void;
|
|
1071
|
+
export(data: WorkbookData): void;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* HighlightPlugin
|
|
1076
|
+
*/
|
|
1077
|
+
declare class HighlightPlugin extends BasePlugin {
|
|
1078
|
+
static modes: Mode[];
|
|
1079
|
+
static layers: LAYERS[];
|
|
1080
|
+
static getters: string[];
|
|
1081
|
+
private highlights;
|
|
1082
|
+
private color;
|
|
1083
|
+
private highlightSelectionEnabled;
|
|
1084
|
+
private pendingHighlights;
|
|
1085
|
+
handle(cmd: Command): void;
|
|
1086
|
+
getHighlights(): Highlight[];
|
|
1087
|
+
private addHighlights;
|
|
1088
|
+
private addPendingHighlight;
|
|
1089
|
+
private prepareHighlights;
|
|
1090
|
+
/**
|
|
1091
|
+
*
|
|
1092
|
+
* @param ranges {"[sheet!]XC": color}
|
|
1093
|
+
* @private
|
|
1094
|
+
*/
|
|
1095
|
+
private removeHighlights;
|
|
1096
|
+
/**
|
|
1097
|
+
* Highlight selected zones (which are not already highlighted).
|
|
1098
|
+
*/
|
|
1099
|
+
private highlightSelection;
|
|
1100
|
+
private isHighlighted;
|
|
1101
|
+
/**
|
|
1102
|
+
* Remove pending highlights which are not selected.
|
|
1103
|
+
* Highlighted zones which are selected are still considered
|
|
1104
|
+
* pending.
|
|
1105
|
+
*/
|
|
1106
|
+
private removePendingHighlights;
|
|
1107
|
+
drawGrid(renderingContext: GridRenderingContext): void;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
declare class MergePlugin extends BasePlugin {
|
|
1111
|
+
static getters: string[];
|
|
1112
|
+
private nextId;
|
|
1113
|
+
private pending;
|
|
1114
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
1115
|
+
beforeHandle(cmd: Command): void;
|
|
1116
|
+
handle(cmd: Command): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* Return true if the current selection requires losing state if it is merged.
|
|
1119
|
+
* This happens when there is some textual content in other cells than the
|
|
1120
|
+
* top left.
|
|
1121
|
+
*/
|
|
1122
|
+
isMergeDestructive(zone: Zone): boolean;
|
|
1123
|
+
/**
|
|
1124
|
+
* Return true if the zone intersects an existing merge:
|
|
1125
|
+
* if they have at least a common cell
|
|
1126
|
+
*/
|
|
1127
|
+
doesIntersectMerge(zone: Zone): boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* Add all necessary merge to the current selection to make it valid
|
|
1130
|
+
*/
|
|
1131
|
+
expandZone(zone: Zone): Zone;
|
|
1132
|
+
isInMerge(xc: string): boolean;
|
|
1133
|
+
isMainCell(xc: string, sheetId: string): boolean;
|
|
1134
|
+
getMainCell(xc: string): string;
|
|
1135
|
+
/**
|
|
1136
|
+
* Verify that we can merge without losing content of other cells or
|
|
1137
|
+
* because the user gave his permission
|
|
1138
|
+
*/
|
|
1139
|
+
private isMergeAllowed;
|
|
1140
|
+
/**
|
|
1141
|
+
* Merge the current selection. Note that:
|
|
1142
|
+
* - it assumes that we have a valid selection (no intersection with other
|
|
1143
|
+
* merges)
|
|
1144
|
+
* - it does nothing if the merge is trivial: A1:A1
|
|
1145
|
+
*/
|
|
1146
|
+
private addMerge;
|
|
1147
|
+
private applyBorderMerge;
|
|
1148
|
+
private removeMerge;
|
|
1149
|
+
private interactiveMerge;
|
|
1150
|
+
private duplicateMerge;
|
|
1151
|
+
private removeAllMerges;
|
|
1152
|
+
private exportAndRemoveMerges;
|
|
1153
|
+
private updateMergesStyles;
|
|
1154
|
+
private isPasteAllowed;
|
|
1155
|
+
private autoFillMerge;
|
|
1156
|
+
import(data: WorkbookData): void;
|
|
1157
|
+
private importMerges;
|
|
1158
|
+
export(data: WorkbookData): void;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
declare class RendererPlugin extends BasePlugin {
|
|
1162
|
+
static layers: LAYERS[];
|
|
1163
|
+
static getters: string[];
|
|
1164
|
+
static modes: Mode[];
|
|
1165
|
+
private boxes;
|
|
1166
|
+
/**
|
|
1167
|
+
* Return the index of a column given an offset x and a visible left col index.
|
|
1168
|
+
* It returns -1 if no column is found.
|
|
1169
|
+
*/
|
|
1170
|
+
getColIndex(x: number, left: number): number;
|
|
1171
|
+
getRowIndex(y: number, top: number): number;
|
|
1172
|
+
getRect(zone: Zone, viewport: Viewport): Rect;
|
|
1173
|
+
/**
|
|
1174
|
+
* Snap a viewport boundaries to exactly match the start of a cell.
|
|
1175
|
+
* @param viewport
|
|
1176
|
+
*/
|
|
1177
|
+
snapViewportToCell(viewport: Viewport): Viewport;
|
|
1178
|
+
/**
|
|
1179
|
+
* Adjust the viewport until the active cell is completely visible inside it.
|
|
1180
|
+
* @param viewport the viewport that will be adjusted
|
|
1181
|
+
*/
|
|
1182
|
+
adjustViewportPosition(viewport: Viewport): Viewport;
|
|
1183
|
+
adjustViewportZone(viewport: Viewport): Viewport;
|
|
1184
|
+
private adjustViewportZoneX;
|
|
1185
|
+
private adjustViewportZoneY;
|
|
1186
|
+
drawGrid(renderingContext: GridRenderingContext, layer: LAYERS): void;
|
|
1187
|
+
private drawBackground;
|
|
1188
|
+
private drawCellBackground;
|
|
1189
|
+
private drawBorders;
|
|
1190
|
+
private drawTexts;
|
|
1191
|
+
private drawHeaders;
|
|
1192
|
+
private hasContent;
|
|
1193
|
+
private getGridBoxes;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
interface Selection {
|
|
1197
|
+
anchor: [number, number];
|
|
1198
|
+
zones: Zone[];
|
|
1199
|
+
}
|
|
1200
|
+
declare enum SelectionMode {
|
|
1201
|
+
idle = 0,
|
|
1202
|
+
selecting = 1,
|
|
1203
|
+
readyToExpand = 2,
|
|
1204
|
+
expanding = 3
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* SelectionPlugin
|
|
1208
|
+
*/
|
|
1209
|
+
declare class SelectionPlugin extends BasePlugin {
|
|
1210
|
+
static layers: LAYERS[];
|
|
1211
|
+
static modes: Mode[];
|
|
1212
|
+
static getters: string[];
|
|
1213
|
+
private selection;
|
|
1214
|
+
private activeCol;
|
|
1215
|
+
private activeRow;
|
|
1216
|
+
private activeXc;
|
|
1217
|
+
private mode;
|
|
1218
|
+
private sheetsData;
|
|
1219
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
1220
|
+
handle(cmd: Command): void;
|
|
1221
|
+
getActiveCell(): Cell | null;
|
|
1222
|
+
getActiveCols(): Set<number>;
|
|
1223
|
+
getActiveRows(): Set<number>;
|
|
1224
|
+
getSelectedZones(): Zone[];
|
|
1225
|
+
getSelectedZone(): Zone;
|
|
1226
|
+
getSelection(): Selection;
|
|
1227
|
+
getPosition(): [number, number];
|
|
1228
|
+
getAggregate(): string | null;
|
|
1229
|
+
getSelectionMode(): SelectionMode;
|
|
1230
|
+
isSelected(zone: Zone): boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* Return [col, row]
|
|
1233
|
+
*/
|
|
1234
|
+
private getReferenceCoords;
|
|
1235
|
+
private selectColumn;
|
|
1236
|
+
private selectRow;
|
|
1237
|
+
private selectAll;
|
|
1238
|
+
/**
|
|
1239
|
+
* Change the anchor of the selection active cell to an absolute col and row inded.
|
|
1240
|
+
*
|
|
1241
|
+
* This is a non trivial task. We need to stop the editing process and update
|
|
1242
|
+
* properly the current selection. Also, this method can optionally create a new
|
|
1243
|
+
* range in the selection.
|
|
1244
|
+
*/
|
|
1245
|
+
private selectCell;
|
|
1246
|
+
/**
|
|
1247
|
+
* Moves the position of either the active cell of the anchor of the current selection by a number of rows / cols delta
|
|
1248
|
+
*/
|
|
1249
|
+
movePosition(deltaX: number, deltaY: number): void;
|
|
1250
|
+
setSelection(anchor: [number, number], zones: Zone[], strict?: boolean): void;
|
|
1251
|
+
private moveSelection;
|
|
1252
|
+
private addCellToSelection;
|
|
1253
|
+
/**
|
|
1254
|
+
* Ensure selections are not outside sheet boundaries.
|
|
1255
|
+
* They are clipped to fit inside the sheet if needed.
|
|
1256
|
+
*/
|
|
1257
|
+
private ensureSelectionValidity;
|
|
1258
|
+
/**
|
|
1259
|
+
* Clip the selection if it spans outside the sheet
|
|
1260
|
+
*/
|
|
1261
|
+
private clipSelection;
|
|
1262
|
+
private onAddColumns;
|
|
1263
|
+
private onAddRows;
|
|
1264
|
+
drawGrid(renderingContext: GridRenderingContext): void;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
interface RangeInputValue {
|
|
1268
|
+
id: string;
|
|
1269
|
+
xc: string;
|
|
1270
|
+
color?: string | null;
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* Selection input Plugin
|
|
1274
|
+
*
|
|
1275
|
+
* The SelectionInput component input and output are both arrays of strings, but
|
|
1276
|
+
* it requires an intermediary internal state to work.
|
|
1277
|
+
* This plugin handles this internal state.
|
|
1278
|
+
*/
|
|
1279
|
+
declare class SelectionInputPlugin extends BasePlugin {
|
|
1280
|
+
static modes: Mode[];
|
|
1281
|
+
static layers: LAYERS[];
|
|
1282
|
+
static getters: string[];
|
|
1283
|
+
private inputs;
|
|
1284
|
+
private inputMaximums;
|
|
1285
|
+
private focusedInput;
|
|
1286
|
+
private focusedRange;
|
|
1287
|
+
private willAddNewRange;
|
|
1288
|
+
allowDispatch(cmd: Command): CommandResult;
|
|
1289
|
+
handle(cmd: Command): void;
|
|
1290
|
+
getSelectionInput(id: string): (RangeInputValue & {
|
|
1291
|
+
isFocused: boolean;
|
|
1292
|
+
})[];
|
|
1293
|
+
getSelectionInputValue(id: string): string[];
|
|
1294
|
+
private initInput;
|
|
1295
|
+
/**
|
|
1296
|
+
* Focus a given range or remove the focus.
|
|
1297
|
+
*/
|
|
1298
|
+
private focus;
|
|
1299
|
+
private focusLast;
|
|
1300
|
+
private removeAllHighlights;
|
|
1301
|
+
/**
|
|
1302
|
+
* Highlight all valid ranges.
|
|
1303
|
+
*/
|
|
1304
|
+
private highlightAllRanges;
|
|
1305
|
+
private add;
|
|
1306
|
+
/**
|
|
1307
|
+
* Add a new input at the end and focus it.
|
|
1308
|
+
*/
|
|
1309
|
+
private addNewRange;
|
|
1310
|
+
private setRange;
|
|
1311
|
+
private changeRange;
|
|
1312
|
+
private removeRange;
|
|
1313
|
+
private setPendingRange;
|
|
1314
|
+
/**
|
|
1315
|
+
* Convert highlights to the input format
|
|
1316
|
+
*/
|
|
1317
|
+
private highlightsToInput;
|
|
1318
|
+
/**
|
|
1319
|
+
* Convert highlights input format to the command format.
|
|
1320
|
+
* The first xc in the input range will keep its color.
|
|
1321
|
+
*/
|
|
1322
|
+
private inputToHighlights;
|
|
1323
|
+
private isRangeValid;
|
|
1324
|
+
private cleanInputs;
|
|
1325
|
+
/**
|
|
1326
|
+
* Return the index of a range given its id
|
|
1327
|
+
* or `null` if the range is not found.
|
|
1328
|
+
*/
|
|
1329
|
+
private getIndex;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
interface Getters {
|
|
1333
|
+
applyOffset: CorePlugin["applyOffset"];
|
|
1334
|
+
getCell: CorePlugin["getCell"];
|
|
1335
|
+
getCellText: CorePlugin["getCellText"];
|
|
1336
|
+
zoneToXC: CorePlugin["zoneToXC"];
|
|
1337
|
+
getActiveSheet: CorePlugin["getActiveSheet"];
|
|
1338
|
+
getSheetName: CorePlugin["getSheetName"];
|
|
1339
|
+
getSheetIdByName: CorePlugin["getSheetIdByName"];
|
|
1340
|
+
getSheets: CorePlugin["getSheets"];
|
|
1341
|
+
getCol: CorePlugin["getCol"];
|
|
1342
|
+
getRow: CorePlugin["getRow"];
|
|
1343
|
+
getColCells: CorePlugin["getColCells"];
|
|
1344
|
+
getNumberCols: CorePlugin["getNumberCols"];
|
|
1345
|
+
getNumberRows: CorePlugin["getNumberRows"];
|
|
1346
|
+
getColsZone: CorePlugin["getColsZone"];
|
|
1347
|
+
getRowsZone: CorePlugin["getRowsZone"];
|
|
1348
|
+
getGridSize: CorePlugin["getGridSize"];
|
|
1349
|
+
getRangeValues: CorePlugin["getRangeValues"];
|
|
1350
|
+
getRangeFormattedValues: CorePlugin["getRangeFormattedValues"];
|
|
1351
|
+
shouldShowFormulas: CorePlugin["shouldShowFormulas"];
|
|
1352
|
+
getClipboardContent: ClipboardPlugin["getClipboardContent"];
|
|
1353
|
+
isPaintingFormat: ClipboardPlugin["isPaintingFormat"];
|
|
1354
|
+
getPasteZones: ClipboardPlugin["getPasteZones"];
|
|
1355
|
+
getCellWidth: FormattingPlugin["getCellWidth"];
|
|
1356
|
+
getTextWidth: FormattingPlugin["getTextWidth"];
|
|
1357
|
+
getCellHeight: FormattingPlugin["getCellHeight"];
|
|
1358
|
+
expandZone: MergePlugin["expandZone"];
|
|
1359
|
+
isMergeDestructive: MergePlugin["isMergeDestructive"];
|
|
1360
|
+
isInMerge: MergePlugin["isInMerge"];
|
|
1361
|
+
getMainCell: MergePlugin["getMainCell"];
|
|
1362
|
+
doesIntersectMerge: MergePlugin["doesIntersectMerge"];
|
|
1363
|
+
getActiveCell: SelectionPlugin["getActiveCell"];
|
|
1364
|
+
getActiveCols: SelectionPlugin["getActiveCols"];
|
|
1365
|
+
getActiveRows: SelectionPlugin["getActiveRows"];
|
|
1366
|
+
getSelectedZones: SelectionPlugin["getSelectedZones"];
|
|
1367
|
+
getSelectedZone: SelectionPlugin["getSelectedZone"];
|
|
1368
|
+
getSelection: SelectionPlugin["getSelection"];
|
|
1369
|
+
getPosition: SelectionPlugin["getPosition"];
|
|
1370
|
+
getAggregate: SelectionPlugin["getAggregate"];
|
|
1371
|
+
getSelectionMode: SelectionPlugin["getSelectionMode"];
|
|
1372
|
+
isSelected: SelectionPlugin["isSelected"];
|
|
1373
|
+
getHighlights: HighlightPlugin["getHighlights"];
|
|
1374
|
+
getConditionalFormats: ConditionalFormatPlugin["getConditionalFormats"];
|
|
1375
|
+
getConditionalStyle: ConditionalFormatPlugin["getConditionalStyle"];
|
|
1376
|
+
getRulesSelection: ConditionalFormatPlugin["getRulesSelection"];
|
|
1377
|
+
getColIndex: RendererPlugin["getColIndex"];
|
|
1378
|
+
getRowIndex: RendererPlugin["getRowIndex"];
|
|
1379
|
+
getRect: RendererPlugin["getRect"];
|
|
1380
|
+
snapViewportToCell: RendererPlugin["snapViewportToCell"];
|
|
1381
|
+
adjustViewportPosition: RendererPlugin["adjustViewportPosition"];
|
|
1382
|
+
adjustViewportZone: RendererPlugin["adjustViewportZone"];
|
|
1383
|
+
getCurrentStyle: FormattingPlugin["getCurrentStyle"];
|
|
1384
|
+
getCellStyle: FormattingPlugin["getCellStyle"];
|
|
1385
|
+
getCellBorder: FormattingPlugin["getCellBorder"];
|
|
1386
|
+
canUndo: WHistory["canUndo"];
|
|
1387
|
+
canRedo: WHistory["canRedo"];
|
|
1388
|
+
evaluateFormula: EvaluationPlugin["evaluateFormula"];
|
|
1389
|
+
isIdle: EvaluationPlugin["isIdle"];
|
|
1390
|
+
getEditionMode: EditionPlugin["getEditionMode"];
|
|
1391
|
+
getCurrentContent: EditionPlugin["getCurrentContent"];
|
|
1392
|
+
getEditionSheet: EditionPlugin["getEditionSheet"];
|
|
1393
|
+
getAutofillTooltip: AutofillPlugin["getAutofillTooltip"];
|
|
1394
|
+
getSelectionInput: SelectionInputPlugin["getSelectionInput"];
|
|
1395
|
+
getSelectionInputValue: SelectionInputPlugin["getSelectionInputValue"];
|
|
1396
|
+
getFigures: FigurePlugin["getFigures"];
|
|
1397
|
+
getSelectedFigureId: FigurePlugin["getSelectedFigureId"];
|
|
1398
|
+
getFigure: FigurePlugin["getFigure"];
|
|
1399
|
+
getChartRuntime: ChartPlugin["getChartRuntime"];
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
declare type Rect = [number, number, number, number];
|
|
1403
|
+
interface Viewport extends Zone {
|
|
1404
|
+
width: number;
|
|
1405
|
+
height: number;
|
|
1406
|
+
offsetX: number;
|
|
1407
|
+
offsetY: number;
|
|
1408
|
+
}
|
|
1409
|
+
interface GridRenderingContext {
|
|
1410
|
+
ctx: CanvasRenderingContext2D;
|
|
1411
|
+
viewport: Viewport;
|
|
1412
|
+
dpr: number;
|
|
1413
|
+
thinLineWidth: number;
|
|
1414
|
+
}
|
|
1415
|
+
declare const enum LAYERS {
|
|
1416
|
+
Background = 0,
|
|
1417
|
+
Highlights = 1,
|
|
1418
|
+
Clipboard = 2,
|
|
1419
|
+
Chart = 3,
|
|
1420
|
+
Selection = 4,
|
|
1421
|
+
Autofill = 5,
|
|
1422
|
+
Headers = 6
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* There are two kinds of commands: Primitive and Local
|
|
1427
|
+
*
|
|
1428
|
+
* - Primitive commands are commands that
|
|
1429
|
+
* 1. manipulate the imported/exported spreadsheet state
|
|
1430
|
+
* 2. are "low level" => cannot be converted into lower level commands
|
|
1431
|
+
* 3. make sense when sent by the network to another user
|
|
1432
|
+
*
|
|
1433
|
+
* - Local commands: every other command.
|
|
1434
|
+
* 1. manipulate the local state (such as the selection, or the clipboard)
|
|
1435
|
+
* 2. can often be converted into primitive commands
|
|
1436
|
+
* 3. do not make sense to send by network to another user.
|
|
1437
|
+
*
|
|
1438
|
+
* For example, "RESIZE_COLUMNS" is a primitive command. "AUTORESIZE_COLUMNS"
|
|
1439
|
+
* can be (locally) converted into a "RESIZE_COLUMNS", and therefore, is not a
|
|
1440
|
+
* primitive command.
|
|
1441
|
+
*
|
|
1442
|
+
* Primitive commands should be "device agnostic". This means that they should
|
|
1443
|
+
* contain all the information necessary to perform their job. Local commands
|
|
1444
|
+
* can use inferred information from the local internal state, such as the
|
|
1445
|
+
* active sheet.
|
|
1446
|
+
*/
|
|
1447
|
+
interface BaseCommand {
|
|
1448
|
+
interactive?: boolean;
|
|
1449
|
+
}
|
|
1450
|
+
interface UpdateCellCommand extends BaseCommand {
|
|
1451
|
+
type: "UPDATE_CELL";
|
|
1452
|
+
sheet: string;
|
|
1453
|
+
col: number;
|
|
1454
|
+
row: number;
|
|
1455
|
+
content?: string;
|
|
1456
|
+
style?: number;
|
|
1457
|
+
border?: number;
|
|
1458
|
+
format?: string;
|
|
1459
|
+
}
|
|
1460
|
+
interface ResizeColumnsCommand extends BaseCommand {
|
|
1461
|
+
type: "RESIZE_COLUMNS";
|
|
1462
|
+
sheet: string;
|
|
1463
|
+
cols: number[];
|
|
1464
|
+
size: number;
|
|
1465
|
+
}
|
|
1466
|
+
interface ResizeRowsCommand extends BaseCommand {
|
|
1467
|
+
type: "RESIZE_ROWS";
|
|
1468
|
+
sheet: string;
|
|
1469
|
+
rows: number[];
|
|
1470
|
+
size: number;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Todo: add a string "id" field, and change the code to use internally a uuid.
|
|
1474
|
+
*/
|
|
1475
|
+
interface CreateSheetCommand extends BaseCommand {
|
|
1476
|
+
type: "CREATE_SHEET";
|
|
1477
|
+
id: string;
|
|
1478
|
+
name?: string;
|
|
1479
|
+
cols?: number;
|
|
1480
|
+
rows?: number;
|
|
1481
|
+
activate?: boolean;
|
|
1482
|
+
}
|
|
1483
|
+
interface MoveSheetCommand extends BaseCommand {
|
|
1484
|
+
type: "MOVE_SHEET";
|
|
1485
|
+
sheet: string;
|
|
1486
|
+
direction: "left" | "right";
|
|
1487
|
+
}
|
|
1488
|
+
interface RenameSheetCommand extends BaseCommand {
|
|
1489
|
+
type: "RENAME_SHEET";
|
|
1490
|
+
sheet: string;
|
|
1491
|
+
name?: string;
|
|
1492
|
+
}
|
|
1493
|
+
interface DuplicateSheetCommand extends BaseCommand {
|
|
1494
|
+
type: "DUPLICATE_SHEET";
|
|
1495
|
+
sheet: string;
|
|
1496
|
+
id: string;
|
|
1497
|
+
name: string;
|
|
1498
|
+
}
|
|
1499
|
+
interface DeleteSheetCommand extends BaseCommand {
|
|
1500
|
+
type: "DELETE_SHEET";
|
|
1501
|
+
sheet: string;
|
|
1502
|
+
}
|
|
1503
|
+
interface DeleteSheetConfirmationCommand extends BaseCommand {
|
|
1504
|
+
type: "DELETE_SHEET_CONFIRMATION";
|
|
1505
|
+
sheet: string;
|
|
1506
|
+
}
|
|
1507
|
+
interface AddMergeCommand extends BaseCommand {
|
|
1508
|
+
type: "ADD_MERGE";
|
|
1509
|
+
sheet: string;
|
|
1510
|
+
zone: Zone;
|
|
1511
|
+
force?: boolean;
|
|
1512
|
+
}
|
|
1513
|
+
interface RemoveMergeCommand extends BaseCommand {
|
|
1514
|
+
type: "REMOVE_MERGE";
|
|
1515
|
+
sheet: string;
|
|
1516
|
+
zone: Zone;
|
|
1517
|
+
}
|
|
1518
|
+
interface AddFormattingCommand extends BaseCommand {
|
|
1519
|
+
type: "SET_FORMATTING";
|
|
1520
|
+
sheet: string;
|
|
1521
|
+
target: Zone[];
|
|
1522
|
+
style?: Style;
|
|
1523
|
+
border?: BorderCommand;
|
|
1524
|
+
}
|
|
1525
|
+
interface ClearFormattingCommand extends BaseCommand {
|
|
1526
|
+
type: "CLEAR_FORMATTING";
|
|
1527
|
+
sheet: string;
|
|
1528
|
+
target: Zone[];
|
|
1529
|
+
}
|
|
1530
|
+
interface SetFormatterCommand extends BaseCommand {
|
|
1531
|
+
type: "SET_FORMATTER";
|
|
1532
|
+
sheet: string;
|
|
1533
|
+
target: Zone[];
|
|
1534
|
+
formatter: string;
|
|
1535
|
+
}
|
|
1536
|
+
interface SetDecimalCommand extends BaseCommand {
|
|
1537
|
+
type: "SET_DECIMAL";
|
|
1538
|
+
sheet: string;
|
|
1539
|
+
target: Zone[];
|
|
1540
|
+
step: number;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* todo: add sheet argument...
|
|
1544
|
+
* todo: use id instead of a list. this is not safe to serialize and send to
|
|
1545
|
+
* another user
|
|
1546
|
+
*/
|
|
1547
|
+
interface AddConditionalFormatCommand extends BaseCommand {
|
|
1548
|
+
type: "ADD_CONDITIONAL_FORMAT";
|
|
1549
|
+
cf: ConditionalFormat;
|
|
1550
|
+
sheet: string;
|
|
1551
|
+
}
|
|
1552
|
+
interface RemoveConditionalFormatCommand extends BaseCommand {
|
|
1553
|
+
type: "REMOVE_CONDITIONAL_FORMAT";
|
|
1554
|
+
id: string;
|
|
1555
|
+
sheet: string;
|
|
1556
|
+
}
|
|
1557
|
+
interface RemoveColumnsCommand extends BaseCommand {
|
|
1558
|
+
type: "REMOVE_COLUMNS";
|
|
1559
|
+
columns: number[];
|
|
1560
|
+
sheet: string;
|
|
1561
|
+
}
|
|
1562
|
+
interface RemoveRowsCommand extends BaseCommand {
|
|
1563
|
+
type: "REMOVE_ROWS";
|
|
1564
|
+
rows: number[];
|
|
1565
|
+
sheet: string;
|
|
1566
|
+
}
|
|
1567
|
+
interface AddColumnsCommand extends BaseCommand {
|
|
1568
|
+
type: "ADD_COLUMNS";
|
|
1569
|
+
column: number;
|
|
1570
|
+
sheet: string;
|
|
1571
|
+
quantity: number;
|
|
1572
|
+
position: "before" | "after";
|
|
1573
|
+
}
|
|
1574
|
+
interface AddRowsCommand extends BaseCommand {
|
|
1575
|
+
type: "ADD_ROWS";
|
|
1576
|
+
row: number;
|
|
1577
|
+
sheet: string;
|
|
1578
|
+
quantity: number;
|
|
1579
|
+
position: "before" | "after";
|
|
1580
|
+
}
|
|
1581
|
+
interface CopyCommand extends BaseCommand {
|
|
1582
|
+
type: "COPY";
|
|
1583
|
+
target: Zone[];
|
|
1584
|
+
}
|
|
1585
|
+
interface CutCommand extends BaseCommand {
|
|
1586
|
+
type: "CUT";
|
|
1587
|
+
target: Zone[];
|
|
1588
|
+
}
|
|
1589
|
+
interface PasteCommand extends BaseCommand {
|
|
1590
|
+
type: "PASTE";
|
|
1591
|
+
target: Zone[];
|
|
1592
|
+
onlyValue?: boolean;
|
|
1593
|
+
onlyFormat?: boolean;
|
|
1594
|
+
force?: boolean;
|
|
1595
|
+
}
|
|
1596
|
+
interface PasteCellCommand extends BaseCommand {
|
|
1597
|
+
type: "PASTE_CELL";
|
|
1598
|
+
origin: Cell | null;
|
|
1599
|
+
originCol: number;
|
|
1600
|
+
originRow: number;
|
|
1601
|
+
col: number;
|
|
1602
|
+
row: number;
|
|
1603
|
+
sheet: string;
|
|
1604
|
+
cut?: boolean;
|
|
1605
|
+
onlyValue: boolean;
|
|
1606
|
+
onlyFormat: boolean;
|
|
1607
|
+
}
|
|
1608
|
+
interface AutoFillCellCommand extends BaseCommand {
|
|
1609
|
+
type: "AUTOFILL_CELL";
|
|
1610
|
+
originCol: number;
|
|
1611
|
+
originRow: number;
|
|
1612
|
+
col: number;
|
|
1613
|
+
row: number;
|
|
1614
|
+
content?: string;
|
|
1615
|
+
style?: number;
|
|
1616
|
+
border?: number;
|
|
1617
|
+
format?: string;
|
|
1618
|
+
}
|
|
1619
|
+
interface ActivatePaintFormatCommand extends BaseCommand {
|
|
1620
|
+
type: "ACTIVATE_PAINT_FORMAT";
|
|
1621
|
+
target: Zone[];
|
|
1622
|
+
}
|
|
1623
|
+
interface PasteFromOSClipboardCommand extends BaseCommand {
|
|
1624
|
+
type: "PASTE_FROM_OS_CLIPBOARD";
|
|
1625
|
+
target: Zone[];
|
|
1626
|
+
text: string;
|
|
1627
|
+
}
|
|
1628
|
+
interface AutoresizeColumnsCommand extends BaseCommand {
|
|
1629
|
+
type: "AUTORESIZE_COLUMNS";
|
|
1630
|
+
sheet: string;
|
|
1631
|
+
cols: number[];
|
|
1632
|
+
}
|
|
1633
|
+
interface AutoresizeRowsCommand extends BaseCommand {
|
|
1634
|
+
type: "AUTORESIZE_ROWS";
|
|
1635
|
+
sheet: string;
|
|
1636
|
+
rows: number[];
|
|
1637
|
+
}
|
|
1638
|
+
interface MovePositionCommand extends BaseCommand {
|
|
1639
|
+
type: "MOVE_POSITION";
|
|
1640
|
+
deltaX: number;
|
|
1641
|
+
deltaY: number;
|
|
1642
|
+
}
|
|
1643
|
+
interface ActivateSheetCommand extends BaseCommand {
|
|
1644
|
+
type: "ACTIVATE_SHEET";
|
|
1645
|
+
from: string;
|
|
1646
|
+
to: string;
|
|
1647
|
+
}
|
|
1648
|
+
interface SelectCellCommand extends BaseCommand {
|
|
1649
|
+
type: "SELECT_CELL";
|
|
1650
|
+
col: number;
|
|
1651
|
+
row: number;
|
|
1652
|
+
}
|
|
1653
|
+
interface SetSelectionCommand extends BaseCommand {
|
|
1654
|
+
type: "SET_SELECTION";
|
|
1655
|
+
anchor: [number, number];
|
|
1656
|
+
zones: Zone[];
|
|
1657
|
+
strict?: boolean;
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Set the selection mode to `selecting`.
|
|
1661
|
+
* The user is currently selecting some cells.
|
|
1662
|
+
*/
|
|
1663
|
+
interface StartSelectionCommand extends BaseCommand {
|
|
1664
|
+
type: "START_SELECTION";
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Set the selection mode to `readyToExpand`.
|
|
1668
|
+
* The user is ready to expand the selected zones with a new
|
|
1669
|
+
* selection (i.e. add an other zone the to currently selected zones).
|
|
1670
|
+
* In other words, the next selection will be added to the
|
|
1671
|
+
* current selection if this mode is active.
|
|
1672
|
+
*/
|
|
1673
|
+
interface PrepareExpansionCommand extends BaseCommand {
|
|
1674
|
+
type: "PREPARE_SELECTION_EXPANSION";
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Set the selection mode to `expanding`.
|
|
1678
|
+
* This mode means that the user is currently selecting
|
|
1679
|
+
* a new zone which will be added to the current selection.
|
|
1680
|
+
*/
|
|
1681
|
+
interface StartExpansionCommand extends BaseCommand {
|
|
1682
|
+
type: "START_SELECTION_EXPANSION";
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Set the selection mode to `idle`.
|
|
1686
|
+
*/
|
|
1687
|
+
interface StopSelectionCommand extends BaseCommand {
|
|
1688
|
+
type: "STOP_SELECTION";
|
|
1689
|
+
}
|
|
1690
|
+
/**
|
|
1691
|
+
* When selection highlight is enabled, every selection will
|
|
1692
|
+
* be highlighted. Each selected zone have a different color.
|
|
1693
|
+
*/
|
|
1694
|
+
interface HighlightSelectionCommand extends BaseCommand {
|
|
1695
|
+
type: "HIGHLIGHT_SELECTION";
|
|
1696
|
+
enabled: boolean;
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Add some highlights as pending highlights.
|
|
1700
|
+
* When highlight selection is enabled, pending highlights
|
|
1701
|
+
* are removed at every new selection.
|
|
1702
|
+
*/
|
|
1703
|
+
interface AddPendingHighlightCommand extends BaseCommand {
|
|
1704
|
+
type: "ADD_PENDING_HIGHLIGHTS";
|
|
1705
|
+
ranges: {
|
|
1706
|
+
[range: string]: string;
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Removes all pending highlights.
|
|
1711
|
+
*/
|
|
1712
|
+
interface ResetPendingHighlightCommand extends BaseCommand {
|
|
1713
|
+
type: "RESET_PENDING_HIGHLIGHT";
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Set a color to be used for the next selection to highlight.
|
|
1717
|
+
* The color is only used when selection highlight is enabled.
|
|
1718
|
+
*/
|
|
1719
|
+
interface SetColorCommand extends BaseCommand {
|
|
1720
|
+
type: "SET_HIGHLIGHT_COLOR";
|
|
1721
|
+
color: string;
|
|
1722
|
+
}
|
|
1723
|
+
interface SelectColumnCommand extends BaseCommand {
|
|
1724
|
+
type: "SELECT_COLUMN";
|
|
1725
|
+
index: number;
|
|
1726
|
+
createRange?: boolean;
|
|
1727
|
+
updateRange?: boolean;
|
|
1728
|
+
}
|
|
1729
|
+
interface SelectRowCommand extends BaseCommand {
|
|
1730
|
+
type: "SELECT_ROW";
|
|
1731
|
+
index: number;
|
|
1732
|
+
createRange?: boolean;
|
|
1733
|
+
updateRange?: boolean;
|
|
1734
|
+
}
|
|
1735
|
+
interface SelectAllCommand extends BaseCommand {
|
|
1736
|
+
type: "SELECT_ALL";
|
|
1737
|
+
}
|
|
1738
|
+
interface AlterSelectionCommand extends BaseCommand {
|
|
1739
|
+
type: "ALTER_SELECTION";
|
|
1740
|
+
delta?: [number, number];
|
|
1741
|
+
cell?: [number, number];
|
|
1742
|
+
}
|
|
1743
|
+
interface EvaluateCellsCommand extends BaseCommand {
|
|
1744
|
+
type: "EVALUATE_CELLS";
|
|
1745
|
+
onlyWaiting?: boolean;
|
|
1746
|
+
}
|
|
1747
|
+
interface AddHighlightsCommand extends BaseCommand {
|
|
1748
|
+
type: "ADD_HIGHLIGHTS";
|
|
1749
|
+
ranges: {
|
|
1750
|
+
[range: string]: string;
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Remove the given highlights.
|
|
1755
|
+
*/
|
|
1756
|
+
interface RemoveHighlightsCommand extends BaseCommand {
|
|
1757
|
+
type: "REMOVE_HIGHLIGHTS";
|
|
1758
|
+
/**
|
|
1759
|
+
* Ranges to remove. Keys are ranges in XC format and values
|
|
1760
|
+
* are the associated colors.
|
|
1761
|
+
* e.g. { B4: "#e2e2e2" }
|
|
1762
|
+
*/
|
|
1763
|
+
ranges: {
|
|
1764
|
+
[range: string]: string;
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
interface RemoveAllHighlightsCommand extends BaseCommand {
|
|
1768
|
+
type: "REMOVE_ALL_HIGHLIGHTS";
|
|
1769
|
+
}
|
|
1770
|
+
interface StartComposerSelectionCommand extends BaseCommand {
|
|
1771
|
+
type: "START_COMPOSER_SELECTION";
|
|
1772
|
+
}
|
|
1773
|
+
interface StopComposerSelectionCommand extends BaseCommand {
|
|
1774
|
+
type: "STOP_COMPOSER_SELECTION";
|
|
1775
|
+
}
|
|
1776
|
+
interface StartEditionCommand extends BaseCommand {
|
|
1777
|
+
type: "START_EDITION";
|
|
1778
|
+
text?: string;
|
|
1779
|
+
}
|
|
1780
|
+
interface StopEditionCommand extends BaseCommand {
|
|
1781
|
+
type: "STOP_EDITION";
|
|
1782
|
+
cancel?: boolean;
|
|
1783
|
+
}
|
|
1784
|
+
interface SetCurrentContentCommand extends BaseCommand {
|
|
1785
|
+
type: "SET_CURRENT_CONTENT";
|
|
1786
|
+
content: string;
|
|
1787
|
+
}
|
|
1788
|
+
interface SetValueCommand extends BaseCommand {
|
|
1789
|
+
type: "SET_VALUE";
|
|
1790
|
+
xc: string;
|
|
1791
|
+
text: string;
|
|
1792
|
+
sheetId?: string;
|
|
1793
|
+
}
|
|
1794
|
+
interface ShowFormulaCommand extends BaseCommand {
|
|
1795
|
+
type: "SET_FORMULA_VISIBILITY";
|
|
1796
|
+
show: boolean;
|
|
1797
|
+
}
|
|
1798
|
+
interface DeleteContentCommand extends BaseCommand {
|
|
1799
|
+
type: "DELETE_CONTENT";
|
|
1800
|
+
sheet: string;
|
|
1801
|
+
target: Zone[];
|
|
1802
|
+
}
|
|
1803
|
+
interface ClearCellCommand extends BaseCommand {
|
|
1804
|
+
type: "CLEAR_CELL";
|
|
1805
|
+
sheet: string;
|
|
1806
|
+
col: number;
|
|
1807
|
+
row: number;
|
|
1808
|
+
}
|
|
1809
|
+
interface UndoCommand extends BaseCommand {
|
|
1810
|
+
type: "UNDO";
|
|
1811
|
+
}
|
|
1812
|
+
interface RedoCommand extends BaseCommand {
|
|
1813
|
+
type: "REDO";
|
|
1814
|
+
}
|
|
1815
|
+
interface StartCommand extends BaseCommand {
|
|
1816
|
+
type: "START";
|
|
1817
|
+
}
|
|
1818
|
+
interface AutofillCommand extends BaseCommand {
|
|
1819
|
+
type: "AUTOFILL";
|
|
1820
|
+
}
|
|
1821
|
+
interface AutofillSelectCommand extends BaseCommand {
|
|
1822
|
+
type: "AUTOFILL_SELECT";
|
|
1823
|
+
col: number;
|
|
1824
|
+
row: number;
|
|
1825
|
+
}
|
|
1826
|
+
interface AutofillAutoCommand extends BaseCommand {
|
|
1827
|
+
type: "AUTOFILL_AUTO";
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Create a new state for a SelectionInput component
|
|
1831
|
+
*/
|
|
1832
|
+
interface NewInputCommand extends BaseCommand {
|
|
1833
|
+
type: "ENABLE_NEW_SELECTION_INPUT";
|
|
1834
|
+
/**
|
|
1835
|
+
* Identifier to use to reference this state.
|
|
1836
|
+
*/
|
|
1837
|
+
id: string;
|
|
1838
|
+
/**
|
|
1839
|
+
* Initial ranges for the state.
|
|
1840
|
+
* e.g. ["B4", "A1:A3"]
|
|
1841
|
+
*/
|
|
1842
|
+
initialRanges?: string[];
|
|
1843
|
+
/**
|
|
1844
|
+
* Maximum number of ranges allowed
|
|
1845
|
+
*/
|
|
1846
|
+
maximumRanges?: number;
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Delete an identified SelectionInput state.
|
|
1850
|
+
*/
|
|
1851
|
+
interface RemoveInputCommand extends BaseCommand {
|
|
1852
|
+
type: "DISABLE_SELECTION_INPUT";
|
|
1853
|
+
/** SelectionComponent id */
|
|
1854
|
+
id: string;
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Set the focus on a given range of a SelectionComponent state.
|
|
1858
|
+
*/
|
|
1859
|
+
interface FocusInputCommand extends BaseCommand {
|
|
1860
|
+
type: "FOCUS_RANGE";
|
|
1861
|
+
/** SelectionComponent id */
|
|
1862
|
+
id: string;
|
|
1863
|
+
/**
|
|
1864
|
+
* Range to focus. If `null` is given, removes the focus entirely.
|
|
1865
|
+
*/
|
|
1866
|
+
rangeId: string | null;
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Add an empty range at the end of a SelectionComponent state
|
|
1870
|
+
* and focus it.
|
|
1871
|
+
*/
|
|
1872
|
+
interface AddEmptyRangeCommand extends BaseCommand {
|
|
1873
|
+
type: "ADD_EMPTY_RANGE";
|
|
1874
|
+
/** SelectionComponent id */
|
|
1875
|
+
id: string;
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Remove a given range in a SelectionComponent state
|
|
1879
|
+
*/
|
|
1880
|
+
interface RemoveRangeCommand extends BaseCommand {
|
|
1881
|
+
type: "REMOVE_RANGE";
|
|
1882
|
+
/** SelectionComponent id */
|
|
1883
|
+
id: string;
|
|
1884
|
+
/** The range to be removed */
|
|
1885
|
+
rangeId: string;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Set a new value for a given range of a SelectionComponent state.
|
|
1889
|
+
*/
|
|
1890
|
+
interface ChangeRangeCommand extends BaseCommand {
|
|
1891
|
+
type: "CHANGE_RANGE";
|
|
1892
|
+
/** SelectionComponent id */
|
|
1893
|
+
id: string;
|
|
1894
|
+
/** The range to be changed */
|
|
1895
|
+
rangeId: string;
|
|
1896
|
+
/**
|
|
1897
|
+
* Range to set in the input. Invalid ranges are also accepted.
|
|
1898
|
+
* e.g. "B2:B3" or the invalid "A5:"
|
|
1899
|
+
*/
|
|
1900
|
+
value: string;
|
|
1901
|
+
}
|
|
1902
|
+
interface CreateFigureCommand extends BaseCommand {
|
|
1903
|
+
type: "CREATE_FIGURE";
|
|
1904
|
+
figure: Figure<any>;
|
|
1905
|
+
sheet: string;
|
|
1906
|
+
}
|
|
1907
|
+
interface SelectFigureCommand extends BaseCommand {
|
|
1908
|
+
type: "SELECT_FIGURE";
|
|
1909
|
+
id: string;
|
|
1910
|
+
}
|
|
1911
|
+
interface UpdateFigureCommand extends BaseCommand, Partial<Figure<any>> {
|
|
1912
|
+
type: "UPDATE_FIGURE";
|
|
1913
|
+
id: string;
|
|
1914
|
+
}
|
|
1915
|
+
interface DeleteFigureCommand extends BaseCommand {
|
|
1916
|
+
type: "DELETE_FIGURE";
|
|
1917
|
+
id: string;
|
|
1918
|
+
}
|
|
1919
|
+
interface CreateChartCommand extends BaseCommand {
|
|
1920
|
+
type: "CREATE_CHART";
|
|
1921
|
+
id: string;
|
|
1922
|
+
sheetId: string;
|
|
1923
|
+
definition: CreateChartDefinition;
|
|
1924
|
+
}
|
|
1925
|
+
interface UpdateChartCommand extends BaseCommand {
|
|
1926
|
+
type: "UPDATE_CHART";
|
|
1927
|
+
id: string;
|
|
1928
|
+
definition: CreateChartDefinition;
|
|
1929
|
+
}
|
|
1930
|
+
declare type Command = NewInputCommand | RemoveInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | UpdateCellCommand | CopyCommand | CutCommand | PasteCommand | PasteCellCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | ResizeRowsCommand | ResizeColumnsCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MovePositionCommand | CreateSheetCommand | MoveSheetCommand | RenameSheetCommand | DuplicateSheetCommand | DeleteSheetCommand | DeleteSheetConfirmationCommand | ActivateSheetCommand | StartSelectionCommand | StartExpansionCommand | PrepareExpansionCommand | StopSelectionCommand | SelectCellCommand | SetSelectionCommand | SelectColumnCommand | SelectRowCommand | SelectAllCommand | AlterSelectionCommand | DeleteContentCommand | EvaluateCellsCommand | AddConditionalFormatCommand | RemoveConditionalFormatCommand | AddHighlightsCommand | RemoveHighlightsCommand | RemoveAllHighlightsCommand | HighlightSelectionCommand | AddPendingHighlightCommand | ResetPendingHighlightCommand | SetColorCommand | StartComposerSelectionCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | AddMergeCommand | RemoveMergeCommand | SetCurrentContentCommand | SetValueCommand | AddFormattingCommand | ClearFormattingCommand | SetFormatterCommand | SetDecimalCommand | ClearCellCommand | UndoCommand | RedoCommand | StartCommand | RemoveRowsCommand | RemoveColumnsCommand | AddRowsCommand | CreateChartCommand | UpdateChartCommand | AddColumnsCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | CreateFigureCommand | SelectFigureCommand | UpdateFigureCommand | DeleteFigureCommand;
|
|
1931
|
+
interface CommandSuccess {
|
|
1932
|
+
status: "SUCCESS";
|
|
1933
|
+
}
|
|
1934
|
+
interface CommandCancelled {
|
|
1935
|
+
status: "CANCELLED";
|
|
1936
|
+
reason: CancelledReason;
|
|
1937
|
+
}
|
|
1938
|
+
declare const enum CancelledReason {
|
|
1939
|
+
Unknown = 0,
|
|
1940
|
+
WillRemoveExistingMerge = 1,
|
|
1941
|
+
MergeIsDestructive = 2,
|
|
1942
|
+
EmptyUndoStack = 3,
|
|
1943
|
+
EmptyRedoStack = 4,
|
|
1944
|
+
NotEnoughColumns = 5,
|
|
1945
|
+
NotEnoughRows = 6,
|
|
1946
|
+
NotEnoughSheets = 7,
|
|
1947
|
+
WrongSheetName = 8,
|
|
1948
|
+
WrongSheetMove = 9,
|
|
1949
|
+
SelectionOutOfBound = 10,
|
|
1950
|
+
WrongPasteSelection = 11,
|
|
1951
|
+
EmptyClipboard = 12,
|
|
1952
|
+
InvalidRange = 13,
|
|
1953
|
+
InputAlreadyFocused = 14,
|
|
1954
|
+
MaximumRangesReached = 15,
|
|
1955
|
+
InvalidChartDefinition = 16,
|
|
1956
|
+
InvalidAutofillSelection = 17
|
|
1957
|
+
}
|
|
1958
|
+
declare type CommandResult = CommandSuccess | CommandCancelled;
|
|
1959
|
+
interface CommandHandler {
|
|
1960
|
+
allowDispatch(command: Command): CommandResult;
|
|
1961
|
+
beforeHandle(command: Command): void;
|
|
1962
|
+
handle(command: Command): void;
|
|
1963
|
+
finalize(command: Command): void;
|
|
1964
|
+
}
|
|
1965
|
+
interface CommandDispatcher {
|
|
1966
|
+
dispatch<T extends CommandTypes, C extends Extract<Command, {
|
|
1967
|
+
type: T;
|
|
1968
|
+
}>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
|
|
1969
|
+
dispatch<T extends CommandTypes, C extends Extract<Command, {
|
|
1970
|
+
type: T;
|
|
1971
|
+
}>>(type: T, r: Omit<C, "type">): CommandResult;
|
|
1972
|
+
}
|
|
1973
|
+
declare type CommandTypes = Command["type"];
|
|
1974
|
+
|
|
1975
|
+
interface SpreadsheetEnv extends Env {
|
|
1976
|
+
openSidePanel: (panel: string, panelProps?: any) => void;
|
|
1977
|
+
toggleSidePanel: (panel: string, panelProps?: any) => void;
|
|
1978
|
+
dispatch: CommandDispatcher["dispatch"];
|
|
1979
|
+
getters: Getters;
|
|
1980
|
+
clipboard: Clipboard;
|
|
1981
|
+
_t: TranslationFunction;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
interface TopbarComponent {
|
|
1985
|
+
component: any;
|
|
1986
|
+
isVisible?: (env: SpreadsheetEnv) => boolean;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
interface SidePanelContent {
|
|
1990
|
+
title: string | ((env: SpreadsheetEnv) => string);
|
|
1991
|
+
Body: any;
|
|
1992
|
+
Footer?: any;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
/**
|
|
1996
|
+
* This function is meant to be used as a tag for a template strings.
|
|
1997
|
+
*
|
|
1998
|
+
* Its job is to convert a textual description of the list of arguments into an
|
|
1999
|
+
* actual array of Arg, suitable for consumption.
|
|
2000
|
+
*/
|
|
2001
|
+
declare function args(strings: string): Arg[];
|
|
2002
|
+
|
|
2003
|
+
declare class FunctionRegistry extends Registry<FunctionDescription> {
|
|
2004
|
+
mapping: {
|
|
2005
|
+
[key: string]: Function;
|
|
2006
|
+
};
|
|
2007
|
+
add(name: string, descr: FunctionDescription): this;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* An ActionMenuItem represent a menu item for the menus of the topbar.
|
|
2012
|
+
* Later, it will be reused for the context menu items as well.
|
|
2013
|
+
*
|
|
2014
|
+
* An ActionMenuItem has:
|
|
2015
|
+
* - id, used for example to add child
|
|
2016
|
+
* - name, which can be a string or a function to compute it
|
|
2017
|
+
* - sequence, which represents its position inside the
|
|
2018
|
+
* menus (the lower sequence it has, the upper it is in the menu)
|
|
2019
|
+
* - isVisible, which can be defined to compute the visibility of the item
|
|
2020
|
+
* - action, the action associated to this item
|
|
2021
|
+
* - children, subitems associated to this item
|
|
2022
|
+
* NB: an item without action or children is not displayed !
|
|
2023
|
+
* - separator, whether it should add a separator below the item
|
|
2024
|
+
* NB: a separator defined on the last item is not displayed !
|
|
2025
|
+
*
|
|
2026
|
+
*/
|
|
2027
|
+
interface MenuItem {
|
|
2028
|
+
name: string | ((env: SpreadsheetEnv) => string);
|
|
2029
|
+
sequence: number;
|
|
2030
|
+
id?: string;
|
|
2031
|
+
isVisible?: (env: SpreadsheetEnv) => boolean;
|
|
2032
|
+
isEnabled?: (env: SpreadsheetEnv) => boolean;
|
|
2033
|
+
action?: (env: SpreadsheetEnv) => void;
|
|
2034
|
+
children?: menuChildren;
|
|
2035
|
+
separator?: boolean;
|
|
2036
|
+
}
|
|
2037
|
+
declare type FullMenuItem = Required<MenuItem>;
|
|
2038
|
+
declare type menuChildren = FullMenuItem[] | ((env: SpreadsheetEnv) => FullMenuItem[]);
|
|
2039
|
+
declare function createFullMenuItem(key: string, value: MenuItem): FullMenuItem;
|
|
2040
|
+
/**
|
|
2041
|
+
* The class Registry is extended in order to add the function addChild
|
|
2042
|
+
*
|
|
2043
|
+
*/
|
|
2044
|
+
declare class MenuItemRegistry extends Registry<FullMenuItem> {
|
|
2045
|
+
/**
|
|
2046
|
+
* @override
|
|
2047
|
+
*/
|
|
2048
|
+
add(key: string, value: MenuItem): MenuItemRegistry;
|
|
2049
|
+
/**
|
|
2050
|
+
* Add a subitem to an existing item
|
|
2051
|
+
* @param path Path of items to add this subitem
|
|
2052
|
+
* @param value Subitem to add
|
|
2053
|
+
*/
|
|
2054
|
+
addChild(key: string, path: string[], value: MenuItem): MenuItemRegistry;
|
|
2055
|
+
getChildren(node: FullMenuItem, env: SpreadsheetEnv): FullMenuItem[];
|
|
2056
|
+
getName(node: FullMenuItem, env: SpreadsheetEnv): string;
|
|
2057
|
+
/**
|
|
2058
|
+
* Get a list of all elements in the registry, ordered by sequence
|
|
2059
|
+
* @override
|
|
2060
|
+
*/
|
|
2061
|
+
getAll(): FullMenuItem[];
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* An AutofillRule is used to generate what to do when we need to autofill
|
|
2066
|
+
* a cell. (In a AutofillGenerator, see plugins/autofill.ts)
|
|
2067
|
+
*
|
|
2068
|
+
* When we generate the rules to autofill, we take the first matching rule
|
|
2069
|
+
* (ordered by sequence), and we generate the AutofillModifier with generateRule
|
|
2070
|
+
*/
|
|
2071
|
+
interface AutofillRule {
|
|
2072
|
+
condition: (cell: Cell, cells: (Cell | null)[]) => boolean;
|
|
2073
|
+
generateRule: (cell: Cell, cells: (Cell | null)[]) => AutofillModifier;
|
|
2074
|
+
sequence: number;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* An AutofillModifierImplementation is used to describe how to handle a
|
|
2079
|
+
* AutofillModifier.
|
|
2080
|
+
*/
|
|
2081
|
+
interface AutofillModifierImplementation {
|
|
2082
|
+
apply: (rule: AutofillModifier, data: CellData, getters: Getters, direction: DIRECTION) => {
|
|
2083
|
+
cellData: CellData;
|
|
2084
|
+
tooltip?: Tooltip;
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
declare function toNumber(value: any): number;
|
|
2089
|
+
declare function toString(value: any): string;
|
|
2090
|
+
declare function toBoolean(value: any): boolean;
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Convert a (col) number to the corresponding letter.
|
|
2094
|
+
*
|
|
2095
|
+
* Examples:
|
|
2096
|
+
* 0 => 'A'
|
|
2097
|
+
* 25 => 'Z'
|
|
2098
|
+
* 26 => 'AA'
|
|
2099
|
+
* 27 => 'AB'
|
|
2100
|
+
*/
|
|
2101
|
+
declare function numberToLetters(n: number): string;
|
|
2102
|
+
/**
|
|
2103
|
+
* Convert a "XC" coordinate to cartesian coordinates.
|
|
2104
|
+
*
|
|
2105
|
+
* Examples:
|
|
2106
|
+
* A1 => [0,0]
|
|
2107
|
+
* B3 => [1,2]
|
|
2108
|
+
*
|
|
2109
|
+
* Note: it also accepts lowercase coordinates, but not fixed references
|
|
2110
|
+
*/
|
|
2111
|
+
declare function toCartesian(xc: string): [number, number];
|
|
2112
|
+
/**
|
|
2113
|
+
* Convert from cartesian coordinate to the "XC" coordinate system.
|
|
2114
|
+
*
|
|
2115
|
+
* Examples:
|
|
2116
|
+
* [0,0] => A1
|
|
2117
|
+
* [1,2] => B3
|
|
2118
|
+
*
|
|
2119
|
+
* Note: it does not support fixed references
|
|
2120
|
+
*/
|
|
2121
|
+
declare function toXC(col: number, row: number): string;
|
|
2122
|
+
|
|
2123
|
+
declare const DEBUG: {
|
|
2124
|
+
[key: string]: any;
|
|
2125
|
+
};
|
|
2126
|
+
|
|
2127
|
+
declare function formatDecimal(n: number, decimals: number, sep?: string): string;
|
|
2128
|
+
|
|
2129
|
+
declare function uuidv4(): string;
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* Convert from a cartesian reference to a Zone
|
|
2133
|
+
*
|
|
2134
|
+
* Examples:
|
|
2135
|
+
* "A1" ==> Top 0, Bottom 0, Left: 0, Right: 0
|
|
2136
|
+
* "B1:B3" ==> Top 0, Bottom 3, Left: 1, Right: 1
|
|
2137
|
+
* "Sheet1!A1" ==> Top 0, Bottom 0, Left: 0, Right: 0
|
|
2138
|
+
* "Sheet1!B1:B3" ==> Top 0, Bottom 3, Left: 1, Right: 1
|
|
2139
|
+
*
|
|
2140
|
+
*/
|
|
2141
|
+
declare function toZone(xc: string): Zone;
|
|
2142
|
+
|
|
2143
|
+
/**
|
|
2144
|
+
* This registry is intended to map a type of figure (tag) to a class of
|
|
2145
|
+
* component, that will be used in the UI to represent the figure.
|
|
2146
|
+
*
|
|
2147
|
+
* The most important type of figure will be the Chart
|
|
2148
|
+
*/
|
|
2149
|
+
interface FigureContent {
|
|
2150
|
+
Component: any;
|
|
2151
|
+
SidePanelComponent?: string;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
interface MenuPosition {
|
|
2155
|
+
x: number;
|
|
2156
|
+
y: number;
|
|
2157
|
+
width: number;
|
|
2158
|
+
height: number;
|
|
2159
|
+
}
|
|
2160
|
+
interface Props$5 {
|
|
2161
|
+
position: MenuPosition;
|
|
2162
|
+
menuItems: FullMenuItem[];
|
|
2163
|
+
depth: number;
|
|
2164
|
+
}
|
|
2165
|
+
interface MenuState {
|
|
2166
|
+
isOpen: boolean;
|
|
2167
|
+
position: null | MenuPosition;
|
|
2168
|
+
scrollOffset?: number;
|
|
2169
|
+
menuItems: FullMenuItem[];
|
|
2170
|
+
}
|
|
2171
|
+
declare class Menu extends Component$a<Props$5, SpreadsheetEnv> {
|
|
2172
|
+
static template: string;
|
|
2173
|
+
static components: {
|
|
2174
|
+
Menu: typeof Menu;
|
|
2175
|
+
};
|
|
2176
|
+
static style: string;
|
|
2177
|
+
static defaultProps: {
|
|
2178
|
+
depth: number;
|
|
2179
|
+
};
|
|
2180
|
+
private subMenu;
|
|
2181
|
+
private subMenuRef;
|
|
2182
|
+
constructor();
|
|
2183
|
+
get subMenuPosition(): MenuPosition;
|
|
2184
|
+
private get renderRight();
|
|
2185
|
+
private get renderBottom();
|
|
2186
|
+
private get menuHeight();
|
|
2187
|
+
get style(): string;
|
|
2188
|
+
activateMenu(menu: FullMenuItem): void;
|
|
2189
|
+
private close;
|
|
2190
|
+
private menuVerticalPosition;
|
|
2191
|
+
private subMenuHorizontalPosition;
|
|
2192
|
+
private subMenuVerticalPosition;
|
|
2193
|
+
/**
|
|
2194
|
+
* Return the number of pixels between the top of the menu
|
|
2195
|
+
* and the menu item at a given index.
|
|
2196
|
+
*/
|
|
2197
|
+
private menuItemVerticalOffset;
|
|
2198
|
+
private onClick;
|
|
2199
|
+
private onContextMenu;
|
|
2200
|
+
getName(menu: FullMenuItem): string;
|
|
2201
|
+
isRoot(menu: FullMenuItem): boolean;
|
|
2202
|
+
isEnabled(menu: FullMenuItem): boolean;
|
|
2203
|
+
closeSubMenus(): void;
|
|
2204
|
+
onScroll(ev: any): void;
|
|
2205
|
+
/**
|
|
2206
|
+
* If the given menu is not disabled, open it's submenu at the
|
|
2207
|
+
* correct position according to available surrounding space.
|
|
2208
|
+
*/
|
|
2209
|
+
openSubMenu(menu: FullMenuItem, position: number): void;
|
|
2210
|
+
onClickMenu(menu: FullMenuItem, position: number): void;
|
|
2211
|
+
onMouseOver(menu: FullMenuItem, position: number): void;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
declare const Component$9: typeof owl.Component;
|
|
2215
|
+
declare class BottomBar extends Component$9<{}, SpreadsheetEnv> {
|
|
2216
|
+
static template: string;
|
|
2217
|
+
static style: string;
|
|
2218
|
+
static components: {
|
|
2219
|
+
Menu: typeof Menu;
|
|
2220
|
+
};
|
|
2221
|
+
getters: Getters;
|
|
2222
|
+
menuState: MenuState;
|
|
2223
|
+
mounted(): void;
|
|
2224
|
+
patched(): void;
|
|
2225
|
+
focusSheet(): void;
|
|
2226
|
+
addSheet(): void;
|
|
2227
|
+
listSheets(ev: MouseEvent): void;
|
|
2228
|
+
activateSheet(name: string): void;
|
|
2229
|
+
onDblClick(sheet: string): void;
|
|
2230
|
+
openContextMenu(target: HTMLElement, registry: MenuItemRegistry): void;
|
|
2231
|
+
onIconClick(sheet: string, ev: MouseEvent): void;
|
|
2232
|
+
onContextMenu(sheet: string, ev: MouseEvent): void;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
declare const Component$8: typeof owl.Component;
|
|
2236
|
+
interface Props$4 {
|
|
2237
|
+
position: Position;
|
|
2238
|
+
viewport: Viewport;
|
|
2239
|
+
}
|
|
2240
|
+
interface Position {
|
|
2241
|
+
top: number;
|
|
2242
|
+
left: number;
|
|
2243
|
+
}
|
|
2244
|
+
interface State$1 {
|
|
2245
|
+
position: Position;
|
|
2246
|
+
handler: boolean;
|
|
2247
|
+
}
|
|
2248
|
+
declare class Autofill extends Component$8<Props$4, SpreadsheetEnv> {
|
|
2249
|
+
static template: string;
|
|
2250
|
+
static style: string;
|
|
2251
|
+
state: State$1;
|
|
2252
|
+
get style(): string;
|
|
2253
|
+
get styleHandler(): string;
|
|
2254
|
+
get styleNextvalue(): string;
|
|
2255
|
+
getTooltip(): Tooltip | undefined;
|
|
2256
|
+
onMouseDown(ev: MouseEvent): void;
|
|
2257
|
+
onDblClick(): void;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
declare const functionCache: {
|
|
2261
|
+
[key: string]: CompiledFormula;
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* Enriched Token is used by the composer to add information on the tokens that
|
|
2266
|
+
* are only needed during the edition of a formula.
|
|
2267
|
+
*
|
|
2268
|
+
* The information added are:
|
|
2269
|
+
* - parenthesis matching
|
|
2270
|
+
* - range detection (replaces the tokens that composes the range with 1 token)
|
|
2271
|
+
* - length, start and end of each token
|
|
2272
|
+
*/
|
|
2273
|
+
interface EnrichedToken extends Token {
|
|
2274
|
+
start: number;
|
|
2275
|
+
end: number;
|
|
2276
|
+
length: number;
|
|
2277
|
+
parenIndex?: number;
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* parses a formula (as a string) into the same formula,
|
|
2282
|
+
* but with the references to other cells as well as strings and numbers extracted
|
|
2283
|
+
*
|
|
2284
|
+
* =sum(a3:b1) + c3 --> =sum(|0|) + |1|
|
|
2285
|
+
*
|
|
2286
|
+
* = sum(a3, 5) --> =sum(|0|, |N1|)
|
|
2287
|
+
*
|
|
2288
|
+
* =CONCAT(CONCAT(1, "beta"), A1) --> =CONCAT(CONCAT(|N0|, |S1|), |2|)
|
|
2289
|
+
*
|
|
2290
|
+
* Strings and Numbers are marked with a prefix of their type (S and N) to be detected
|
|
2291
|
+
* as their normalized form by the parser as they won't be processed like the references by the compiler.
|
|
2292
|
+
*
|
|
2293
|
+
* @param formula
|
|
2294
|
+
*/
|
|
2295
|
+
declare function normalize(formula: string): NormalizedFormula;
|
|
2296
|
+
|
|
2297
|
+
interface ASTBase {
|
|
2298
|
+
debug?: boolean;
|
|
2299
|
+
}
|
|
2300
|
+
interface ASTNumber extends ASTBase {
|
|
2301
|
+
type: "NUMBER";
|
|
2302
|
+
value: number;
|
|
2303
|
+
}
|
|
2304
|
+
interface ASTNormalizedNumber extends ASTBase {
|
|
2305
|
+
type: "NORMALIZED_NUMBER";
|
|
2306
|
+
value: string;
|
|
2307
|
+
}
|
|
2308
|
+
interface ASTReference extends ASTBase {
|
|
2309
|
+
type: "REFERENCE";
|
|
2310
|
+
value: number;
|
|
2311
|
+
}
|
|
2312
|
+
interface ASTString extends ASTBase {
|
|
2313
|
+
type: "STRING";
|
|
2314
|
+
value: string;
|
|
2315
|
+
}
|
|
2316
|
+
interface ASTNormalizedString extends ASTBase {
|
|
2317
|
+
type: "NORMALIZED_STRING";
|
|
2318
|
+
value: string;
|
|
2319
|
+
}
|
|
2320
|
+
interface ASTBoolean extends ASTBase {
|
|
2321
|
+
type: "BOOLEAN";
|
|
2322
|
+
value: boolean;
|
|
2323
|
+
}
|
|
2324
|
+
interface ASTUnaryOperation extends ASTBase {
|
|
2325
|
+
type: "UNARY_OPERATION";
|
|
2326
|
+
value: any;
|
|
2327
|
+
right: AST;
|
|
2328
|
+
}
|
|
2329
|
+
interface ASTOperation extends ASTBase {
|
|
2330
|
+
type: "BIN_OPERATION";
|
|
2331
|
+
value: any;
|
|
2332
|
+
left: AST;
|
|
2333
|
+
right: AST;
|
|
2334
|
+
}
|
|
2335
|
+
interface ASTFuncall extends ASTBase {
|
|
2336
|
+
type: "FUNCALL";
|
|
2337
|
+
value: string;
|
|
2338
|
+
args: AST[];
|
|
2339
|
+
}
|
|
2340
|
+
interface ASTAsyncFuncall extends ASTBase {
|
|
2341
|
+
type: "ASYNC_FUNCALL";
|
|
2342
|
+
value: string;
|
|
2343
|
+
args: AST[];
|
|
2344
|
+
}
|
|
2345
|
+
interface ASTUnknown extends ASTBase {
|
|
2346
|
+
type: "UNKNOWN";
|
|
2347
|
+
value: string;
|
|
2348
|
+
}
|
|
2349
|
+
declare type AST = ASTOperation | ASTUnaryOperation | ASTFuncall | ASTAsyncFuncall | ASTNumber | ASTBoolean | ASTString | ASTReference | ASTNormalizedNumber | ASTNormalizedString | ASTUnknown;
|
|
2350
|
+
/**
|
|
2351
|
+
* Parse an expression (as a string) into an AST.
|
|
2352
|
+
*/
|
|
2353
|
+
declare function parse(str: NormalizedFormulaString): AST;
|
|
2354
|
+
/**
|
|
2355
|
+
* Converts an ast formula to the corresponding string
|
|
2356
|
+
*/
|
|
2357
|
+
declare function astToFormula(ast: AST, dependencies: Dependencies): string;
|
|
2358
|
+
|
|
2359
|
+
declare type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "BOOLEAN" | "FUNCTION" | "SYMBOL" | "SPACE" | "DEBUGGER" | "COMMA" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "NORMALIZED_NUMBER" | "NORMALIZED_STRING" | "UNKNOWN";
|
|
2360
|
+
interface Token {
|
|
2361
|
+
type: TokenType;
|
|
2362
|
+
value: string;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
declare const Component$7: typeof owl.Component;
|
|
2366
|
+
interface AutocompleteValue {
|
|
2367
|
+
text: string;
|
|
2368
|
+
description: string;
|
|
2369
|
+
}
|
|
2370
|
+
interface Props$3 {
|
|
2371
|
+
provider: string;
|
|
2372
|
+
filter?: (searchTerm: string, vals: AutocompleteValue[]) => AutocompleteValue[];
|
|
2373
|
+
search: string;
|
|
2374
|
+
}
|
|
2375
|
+
declare abstract class TextValueProvider extends Component$7<Props$3> {
|
|
2376
|
+
static template: string;
|
|
2377
|
+
static style: string;
|
|
2378
|
+
state: {
|
|
2379
|
+
values: AutocompleteValue[];
|
|
2380
|
+
selectedIndex: number;
|
|
2381
|
+
};
|
|
2382
|
+
mounted(): void;
|
|
2383
|
+
willUpdateProps(nextProps: any): Promise<void>;
|
|
2384
|
+
filter(searchTerm: string): Promise<void>;
|
|
2385
|
+
fillValue(index: any): void;
|
|
2386
|
+
moveDown(): void;
|
|
2387
|
+
moveUp(): void;
|
|
2388
|
+
getValueToFill(): string | void;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
declare class ContentEditableHelper {
|
|
2392
|
+
el: HTMLElement;
|
|
2393
|
+
constructor(el: HTMLElement | null);
|
|
2394
|
+
updateEl(el: HTMLElement): void;
|
|
2395
|
+
/**
|
|
2396
|
+
* select the text at position start to end, no matter the children
|
|
2397
|
+
*/
|
|
2398
|
+
selectRange(start: number, end: number): void;
|
|
2399
|
+
/**
|
|
2400
|
+
* finds the dom element that contains the character at `offset`
|
|
2401
|
+
*/
|
|
2402
|
+
private findChildAtCharacterIndex;
|
|
2403
|
+
/**
|
|
2404
|
+
* Iterate over the dom tree starting at `el` and over all the children depth first.
|
|
2405
|
+
* */
|
|
2406
|
+
private iterateChildren;
|
|
2407
|
+
/**
|
|
2408
|
+
* insert text at the current selection point. If a selection of 1 or more elements is done,
|
|
2409
|
+
* the selection is replaced by the text to be inserted
|
|
2410
|
+
* */
|
|
2411
|
+
insertText(value: string, color?: string): void;
|
|
2412
|
+
/**
|
|
2413
|
+
* remove the current selection of the user
|
|
2414
|
+
* */
|
|
2415
|
+
removeSelection(): void;
|
|
2416
|
+
removeAll(): void;
|
|
2417
|
+
/**
|
|
2418
|
+
* finds the indexes of the current selection.
|
|
2419
|
+
* */
|
|
2420
|
+
getCurrentSelection(): {
|
|
2421
|
+
start: number;
|
|
2422
|
+
end: number;
|
|
2423
|
+
};
|
|
2424
|
+
private findSizeBeforeElement;
|
|
2425
|
+
private getStartAndEndSelection;
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
declare const Component$6: typeof owl.Component;
|
|
2429
|
+
declare class Composer extends Component$6<any, SpreadsheetEnv> {
|
|
2430
|
+
static template: string;
|
|
2431
|
+
static style: string;
|
|
2432
|
+
static components: {
|
|
2433
|
+
TextValueProvider: typeof TextValueProvider;
|
|
2434
|
+
};
|
|
2435
|
+
private composerRef;
|
|
2436
|
+
private autoCompleteRef;
|
|
2437
|
+
getters: Getters;
|
|
2438
|
+
dispatch: {
|
|
2439
|
+
<T extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C extends Extract<UpdateCellCommand, {
|
|
2440
|
+
type: T;
|
|
2441
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
2442
|
+
type: T;
|
|
2443
|
+
}> | Extract<ResizeRowsCommand, {
|
|
2444
|
+
type: T;
|
|
2445
|
+
}> | Extract<CreateSheetCommand, {
|
|
2446
|
+
type: T;
|
|
2447
|
+
}> | Extract<MoveSheetCommand, {
|
|
2448
|
+
type: T;
|
|
2449
|
+
}> | Extract<RenameSheetCommand, {
|
|
2450
|
+
type: T;
|
|
2451
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
2452
|
+
type: T;
|
|
2453
|
+
}> | Extract<DeleteSheetCommand, {
|
|
2454
|
+
type: T;
|
|
2455
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
2456
|
+
type: T;
|
|
2457
|
+
}> | Extract<AddMergeCommand, {
|
|
2458
|
+
type: T;
|
|
2459
|
+
}> | Extract<RemoveMergeCommand, {
|
|
2460
|
+
type: T;
|
|
2461
|
+
}> | Extract<AddFormattingCommand, {
|
|
2462
|
+
type: T;
|
|
2463
|
+
}> | Extract<ClearFormattingCommand, {
|
|
2464
|
+
type: T;
|
|
2465
|
+
}> | Extract<SetFormatterCommand, {
|
|
2466
|
+
type: T;
|
|
2467
|
+
}> | Extract<SetDecimalCommand, {
|
|
2468
|
+
type: T;
|
|
2469
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
2470
|
+
type: T;
|
|
2471
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
2472
|
+
type: T;
|
|
2473
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
2474
|
+
type: T;
|
|
2475
|
+
}> | Extract<RemoveRowsCommand, {
|
|
2476
|
+
type: T;
|
|
2477
|
+
}> | Extract<AddColumnsCommand, {
|
|
2478
|
+
type: T;
|
|
2479
|
+
}> | Extract<AddRowsCommand, {
|
|
2480
|
+
type: T;
|
|
2481
|
+
}> | Extract<CopyCommand, {
|
|
2482
|
+
type: T;
|
|
2483
|
+
}> | Extract<CutCommand, {
|
|
2484
|
+
type: T;
|
|
2485
|
+
}> | Extract<PasteCommand, {
|
|
2486
|
+
type: T;
|
|
2487
|
+
}> | Extract<PasteCellCommand, {
|
|
2488
|
+
type: T;
|
|
2489
|
+
}> | Extract<AutoFillCellCommand, {
|
|
2490
|
+
type: T;
|
|
2491
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
2492
|
+
type: T;
|
|
2493
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
2494
|
+
type: T;
|
|
2495
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
2496
|
+
type: T;
|
|
2497
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
2498
|
+
type: T;
|
|
2499
|
+
}> | Extract<MovePositionCommand, {
|
|
2500
|
+
type: T;
|
|
2501
|
+
}> | Extract<ActivateSheetCommand, {
|
|
2502
|
+
type: T;
|
|
2503
|
+
}> | Extract<SelectCellCommand, {
|
|
2504
|
+
type: T;
|
|
2505
|
+
}> | Extract<SetSelectionCommand, {
|
|
2506
|
+
type: T;
|
|
2507
|
+
}> | Extract<StartSelectionCommand, {
|
|
2508
|
+
type: T;
|
|
2509
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
2510
|
+
type: T;
|
|
2511
|
+
}> | Extract<StartExpansionCommand, {
|
|
2512
|
+
type: T;
|
|
2513
|
+
}> | Extract<StopSelectionCommand, {
|
|
2514
|
+
type: T;
|
|
2515
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
2516
|
+
type: T;
|
|
2517
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
2518
|
+
type: T;
|
|
2519
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
2520
|
+
type: T;
|
|
2521
|
+
}> | Extract<SetColorCommand, {
|
|
2522
|
+
type: T;
|
|
2523
|
+
}> | Extract<SelectColumnCommand, {
|
|
2524
|
+
type: T;
|
|
2525
|
+
}> | Extract<SelectRowCommand, {
|
|
2526
|
+
type: T;
|
|
2527
|
+
}> | Extract<SelectAllCommand, {
|
|
2528
|
+
type: T;
|
|
2529
|
+
}> | Extract<AlterSelectionCommand, {
|
|
2530
|
+
type: T;
|
|
2531
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
2532
|
+
type: T;
|
|
2533
|
+
}> | Extract<AddHighlightsCommand, {
|
|
2534
|
+
type: T;
|
|
2535
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
2536
|
+
type: T;
|
|
2537
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
2538
|
+
type: T;
|
|
2539
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
2540
|
+
type: T;
|
|
2541
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
2542
|
+
type: T;
|
|
2543
|
+
}> | Extract<StartEditionCommand, {
|
|
2544
|
+
type: T;
|
|
2545
|
+
}> | Extract<StopEditionCommand, {
|
|
2546
|
+
type: T;
|
|
2547
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
2548
|
+
type: T;
|
|
2549
|
+
}> | Extract<SetValueCommand, {
|
|
2550
|
+
type: T;
|
|
2551
|
+
}> | Extract<ShowFormulaCommand, {
|
|
2552
|
+
type: T;
|
|
2553
|
+
}> | Extract<DeleteContentCommand, {
|
|
2554
|
+
type: T;
|
|
2555
|
+
}> | Extract<ClearCellCommand, {
|
|
2556
|
+
type: T;
|
|
2557
|
+
}> | Extract<UndoCommand, {
|
|
2558
|
+
type: T;
|
|
2559
|
+
}> | Extract<RedoCommand, {
|
|
2560
|
+
type: T;
|
|
2561
|
+
}> | Extract<StartCommand, {
|
|
2562
|
+
type: T;
|
|
2563
|
+
}> | Extract<AutofillCommand, {
|
|
2564
|
+
type: T;
|
|
2565
|
+
}> | Extract<AutofillSelectCommand, {
|
|
2566
|
+
type: T;
|
|
2567
|
+
}> | Extract<AutofillAutoCommand, {
|
|
2568
|
+
type: T;
|
|
2569
|
+
}> | Extract<NewInputCommand, {
|
|
2570
|
+
type: T;
|
|
2571
|
+
}> | Extract<RemoveInputCommand, {
|
|
2572
|
+
type: T;
|
|
2573
|
+
}> | Extract<FocusInputCommand, {
|
|
2574
|
+
type: T;
|
|
2575
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
2576
|
+
type: T;
|
|
2577
|
+
}> | Extract<RemoveRangeCommand, {
|
|
2578
|
+
type: T;
|
|
2579
|
+
}> | Extract<ChangeRangeCommand, {
|
|
2580
|
+
type: T;
|
|
2581
|
+
}> | Extract<CreateFigureCommand, {
|
|
2582
|
+
type: T;
|
|
2583
|
+
}> | Extract<SelectFigureCommand, {
|
|
2584
|
+
type: T;
|
|
2585
|
+
}> | Extract<UpdateFigureCommand, {
|
|
2586
|
+
type: T;
|
|
2587
|
+
}> | Extract<DeleteFigureCommand, {
|
|
2588
|
+
type: T;
|
|
2589
|
+
}> | Extract<CreateChartCommand, {
|
|
2590
|
+
type: T;
|
|
2591
|
+
}> | Extract<UpdateChartCommand, {
|
|
2592
|
+
type: T;
|
|
2593
|
+
}>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
|
|
2594
|
+
<T_1 extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C_1 extends Extract<UpdateCellCommand, {
|
|
2595
|
+
type: T_1;
|
|
2596
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
2597
|
+
type: T_1;
|
|
2598
|
+
}> | Extract<ResizeRowsCommand, {
|
|
2599
|
+
type: T_1;
|
|
2600
|
+
}> | Extract<CreateSheetCommand, {
|
|
2601
|
+
type: T_1;
|
|
2602
|
+
}> | Extract<MoveSheetCommand, {
|
|
2603
|
+
type: T_1;
|
|
2604
|
+
}> | Extract<RenameSheetCommand, {
|
|
2605
|
+
type: T_1;
|
|
2606
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
2607
|
+
type: T_1;
|
|
2608
|
+
}> | Extract<DeleteSheetCommand, {
|
|
2609
|
+
type: T_1;
|
|
2610
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
2611
|
+
type: T_1;
|
|
2612
|
+
}> | Extract<AddMergeCommand, {
|
|
2613
|
+
type: T_1;
|
|
2614
|
+
}> | Extract<RemoveMergeCommand, {
|
|
2615
|
+
type: T_1;
|
|
2616
|
+
}> | Extract<AddFormattingCommand, {
|
|
2617
|
+
type: T_1;
|
|
2618
|
+
}> | Extract<ClearFormattingCommand, {
|
|
2619
|
+
type: T_1;
|
|
2620
|
+
}> | Extract<SetFormatterCommand, {
|
|
2621
|
+
type: T_1;
|
|
2622
|
+
}> | Extract<SetDecimalCommand, {
|
|
2623
|
+
type: T_1;
|
|
2624
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
2625
|
+
type: T_1;
|
|
2626
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
2627
|
+
type: T_1;
|
|
2628
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
2629
|
+
type: T_1;
|
|
2630
|
+
}> | Extract<RemoveRowsCommand, {
|
|
2631
|
+
type: T_1;
|
|
2632
|
+
}> | Extract<AddColumnsCommand, {
|
|
2633
|
+
type: T_1;
|
|
2634
|
+
}> | Extract<AddRowsCommand, {
|
|
2635
|
+
type: T_1;
|
|
2636
|
+
}> | Extract<CopyCommand, {
|
|
2637
|
+
type: T_1;
|
|
2638
|
+
}> | Extract<CutCommand, {
|
|
2639
|
+
type: T_1;
|
|
2640
|
+
}> | Extract<PasteCommand, {
|
|
2641
|
+
type: T_1;
|
|
2642
|
+
}> | Extract<PasteCellCommand, {
|
|
2643
|
+
type: T_1;
|
|
2644
|
+
}> | Extract<AutoFillCellCommand, {
|
|
2645
|
+
type: T_1;
|
|
2646
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
2647
|
+
type: T_1;
|
|
2648
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
2649
|
+
type: T_1;
|
|
2650
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
2651
|
+
type: T_1;
|
|
2652
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
2653
|
+
type: T_1;
|
|
2654
|
+
}> | Extract<MovePositionCommand, {
|
|
2655
|
+
type: T_1;
|
|
2656
|
+
}> | Extract<ActivateSheetCommand, {
|
|
2657
|
+
type: T_1;
|
|
2658
|
+
}> | Extract<SelectCellCommand, {
|
|
2659
|
+
type: T_1;
|
|
2660
|
+
}> | Extract<SetSelectionCommand, {
|
|
2661
|
+
type: T_1;
|
|
2662
|
+
}> | Extract<StartSelectionCommand, {
|
|
2663
|
+
type: T_1;
|
|
2664
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
2665
|
+
type: T_1;
|
|
2666
|
+
}> | Extract<StartExpansionCommand, {
|
|
2667
|
+
type: T_1;
|
|
2668
|
+
}> | Extract<StopSelectionCommand, {
|
|
2669
|
+
type: T_1;
|
|
2670
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
2671
|
+
type: T_1;
|
|
2672
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
2673
|
+
type: T_1;
|
|
2674
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
2675
|
+
type: T_1;
|
|
2676
|
+
}> | Extract<SetColorCommand, {
|
|
2677
|
+
type: T_1;
|
|
2678
|
+
}> | Extract<SelectColumnCommand, {
|
|
2679
|
+
type: T_1;
|
|
2680
|
+
}> | Extract<SelectRowCommand, {
|
|
2681
|
+
type: T_1;
|
|
2682
|
+
}> | Extract<SelectAllCommand, {
|
|
2683
|
+
type: T_1;
|
|
2684
|
+
}> | Extract<AlterSelectionCommand, {
|
|
2685
|
+
type: T_1;
|
|
2686
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
2687
|
+
type: T_1;
|
|
2688
|
+
}> | Extract<AddHighlightsCommand, {
|
|
2689
|
+
type: T_1;
|
|
2690
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
2691
|
+
type: T_1;
|
|
2692
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
2693
|
+
type: T_1;
|
|
2694
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
2695
|
+
type: T_1;
|
|
2696
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
2697
|
+
type: T_1;
|
|
2698
|
+
}> | Extract<StartEditionCommand, {
|
|
2699
|
+
type: T_1;
|
|
2700
|
+
}> | Extract<StopEditionCommand, {
|
|
2701
|
+
type: T_1;
|
|
2702
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
2703
|
+
type: T_1;
|
|
2704
|
+
}> | Extract<SetValueCommand, {
|
|
2705
|
+
type: T_1;
|
|
2706
|
+
}> | Extract<ShowFormulaCommand, {
|
|
2707
|
+
type: T_1;
|
|
2708
|
+
}> | Extract<DeleteContentCommand, {
|
|
2709
|
+
type: T_1;
|
|
2710
|
+
}> | Extract<ClearCellCommand, {
|
|
2711
|
+
type: T_1;
|
|
2712
|
+
}> | Extract<UndoCommand, {
|
|
2713
|
+
type: T_1;
|
|
2714
|
+
}> | Extract<RedoCommand, {
|
|
2715
|
+
type: T_1;
|
|
2716
|
+
}> | Extract<StartCommand, {
|
|
2717
|
+
type: T_1;
|
|
2718
|
+
}> | Extract<AutofillCommand, {
|
|
2719
|
+
type: T_1;
|
|
2720
|
+
}> | Extract<AutofillSelectCommand, {
|
|
2721
|
+
type: T_1;
|
|
2722
|
+
}> | Extract<AutofillAutoCommand, {
|
|
2723
|
+
type: T_1;
|
|
2724
|
+
}> | Extract<NewInputCommand, {
|
|
2725
|
+
type: T_1;
|
|
2726
|
+
}> | Extract<RemoveInputCommand, {
|
|
2727
|
+
type: T_1;
|
|
2728
|
+
}> | Extract<FocusInputCommand, {
|
|
2729
|
+
type: T_1;
|
|
2730
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
2731
|
+
type: T_1;
|
|
2732
|
+
}> | Extract<RemoveRangeCommand, {
|
|
2733
|
+
type: T_1;
|
|
2734
|
+
}> | Extract<ChangeRangeCommand, {
|
|
2735
|
+
type: T_1;
|
|
2736
|
+
}> | Extract<CreateFigureCommand, {
|
|
2737
|
+
type: T_1;
|
|
2738
|
+
}> | Extract<SelectFigureCommand, {
|
|
2739
|
+
type: T_1;
|
|
2740
|
+
}> | Extract<UpdateFigureCommand, {
|
|
2741
|
+
type: T_1;
|
|
2742
|
+
}> | Extract<DeleteFigureCommand, {
|
|
2743
|
+
type: T_1;
|
|
2744
|
+
}> | Extract<CreateChartCommand, {
|
|
2745
|
+
type: T_1;
|
|
2746
|
+
}> | Extract<UpdateChartCommand, {
|
|
2747
|
+
type: T_1;
|
|
2748
|
+
}>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
|
|
2749
|
+
};
|
|
2750
|
+
zone: Zone;
|
|
2751
|
+
rect: Rect;
|
|
2752
|
+
selectionEnd: number;
|
|
2753
|
+
selectionStart: number;
|
|
2754
|
+
contentHelper: ContentEditableHelper;
|
|
2755
|
+
autoCompleteState: {
|
|
2756
|
+
showProvider: boolean;
|
|
2757
|
+
provider: string;
|
|
2758
|
+
search: string;
|
|
2759
|
+
};
|
|
2760
|
+
tokenAtCursor: EnrichedToken | void;
|
|
2761
|
+
shouldProcessInputEvents: boolean;
|
|
2762
|
+
isDone: boolean;
|
|
2763
|
+
refSelectionStart: number;
|
|
2764
|
+
tokens: EnrichedToken[];
|
|
2765
|
+
keyMapping: {
|
|
2766
|
+
[key: string]: Function;
|
|
2767
|
+
};
|
|
2768
|
+
constructor();
|
|
2769
|
+
mounted(): void;
|
|
2770
|
+
willUnmount(): void;
|
|
2771
|
+
get containerStyle(): string;
|
|
2772
|
+
get composerStyle(): string;
|
|
2773
|
+
processArrowKeys(ev: KeyboardEvent): void;
|
|
2774
|
+
processTabKey(ev: KeyboardEvent): void;
|
|
2775
|
+
processEnterKey(ev: KeyboardEvent): void;
|
|
2776
|
+
processEscapeKey(): void;
|
|
2777
|
+
onKeydown(ev: KeyboardEvent): any;
|
|
2778
|
+
onInput(ev: KeyboardEvent): void;
|
|
2779
|
+
onKeyup(ev: KeyboardEvent): void;
|
|
2780
|
+
onClick(ev: MouseEvent): void;
|
|
2781
|
+
onCompleted(ev: CustomEvent): void;
|
|
2782
|
+
processContent(): void;
|
|
2783
|
+
/**
|
|
2784
|
+
* Compute the state of the composer from the tokenAtCursor.
|
|
2785
|
+
* If the token is a bool, function or symbol we have to initialize the autocomplete engine.
|
|
2786
|
+
* If it's a comma, left_paren or operator we have to initialize the range selection.
|
|
2787
|
+
*/
|
|
2788
|
+
processTokenAtCursor(): void;
|
|
2789
|
+
addText(text: string): void;
|
|
2790
|
+
addTextFromSelection(): void;
|
|
2791
|
+
autoComplete(value: string): void;
|
|
2792
|
+
/**
|
|
2793
|
+
* Save the current selection
|
|
2794
|
+
*/
|
|
2795
|
+
saveSelection(): void;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
interface FigureInfo {
|
|
2799
|
+
id: string;
|
|
2800
|
+
isSelected: boolean;
|
|
2801
|
+
figure: Figure<any>;
|
|
2802
|
+
}
|
|
2803
|
+
declare class FiguresContainer extends Component$a<{
|
|
2804
|
+
viewport: Viewport;
|
|
2805
|
+
}, SpreadsheetEnv> {
|
|
2806
|
+
static template: string;
|
|
2807
|
+
static style: string;
|
|
2808
|
+
static components: {};
|
|
2809
|
+
figureRegistry: Registry<FigureContent>;
|
|
2810
|
+
dnd: {
|
|
2811
|
+
figureId: string;
|
|
2812
|
+
x: number;
|
|
2813
|
+
y: number;
|
|
2814
|
+
width: number;
|
|
2815
|
+
height: number;
|
|
2816
|
+
};
|
|
2817
|
+
getters: Getters;
|
|
2818
|
+
dispatch: {
|
|
2819
|
+
<T extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C extends Extract<UpdateCellCommand, {
|
|
2820
|
+
type: T;
|
|
2821
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
2822
|
+
type: T;
|
|
2823
|
+
}> | Extract<ResizeRowsCommand, {
|
|
2824
|
+
type: T;
|
|
2825
|
+
}> | Extract<CreateSheetCommand, {
|
|
2826
|
+
type: T;
|
|
2827
|
+
}> | Extract<MoveSheetCommand, {
|
|
2828
|
+
type: T;
|
|
2829
|
+
}> | Extract<RenameSheetCommand, {
|
|
2830
|
+
type: T;
|
|
2831
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
2832
|
+
type: T;
|
|
2833
|
+
}> | Extract<DeleteSheetCommand, {
|
|
2834
|
+
type: T;
|
|
2835
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
2836
|
+
type: T;
|
|
2837
|
+
}> | Extract<AddMergeCommand, {
|
|
2838
|
+
type: T;
|
|
2839
|
+
}> | Extract<RemoveMergeCommand, {
|
|
2840
|
+
type: T;
|
|
2841
|
+
}> | Extract<AddFormattingCommand, {
|
|
2842
|
+
type: T;
|
|
2843
|
+
}> | Extract<ClearFormattingCommand, {
|
|
2844
|
+
type: T;
|
|
2845
|
+
}> | Extract<SetFormatterCommand, {
|
|
2846
|
+
type: T;
|
|
2847
|
+
}> | Extract<SetDecimalCommand, {
|
|
2848
|
+
type: T;
|
|
2849
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
2850
|
+
type: T;
|
|
2851
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
2852
|
+
type: T;
|
|
2853
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
2854
|
+
type: T;
|
|
2855
|
+
}> | Extract<RemoveRowsCommand, {
|
|
2856
|
+
type: T;
|
|
2857
|
+
}> | Extract<AddColumnsCommand, {
|
|
2858
|
+
type: T;
|
|
2859
|
+
}> | Extract<AddRowsCommand, {
|
|
2860
|
+
type: T;
|
|
2861
|
+
}> | Extract<CopyCommand, {
|
|
2862
|
+
type: T;
|
|
2863
|
+
}> | Extract<CutCommand, {
|
|
2864
|
+
type: T;
|
|
2865
|
+
}> | Extract<PasteCommand, {
|
|
2866
|
+
type: T;
|
|
2867
|
+
}> | Extract<PasteCellCommand, {
|
|
2868
|
+
type: T;
|
|
2869
|
+
}> | Extract<AutoFillCellCommand, {
|
|
2870
|
+
type: T;
|
|
2871
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
2872
|
+
type: T;
|
|
2873
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
2874
|
+
type: T;
|
|
2875
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
2876
|
+
type: T;
|
|
2877
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
2878
|
+
type: T;
|
|
2879
|
+
}> | Extract<MovePositionCommand, {
|
|
2880
|
+
type: T;
|
|
2881
|
+
}> | Extract<ActivateSheetCommand, {
|
|
2882
|
+
type: T;
|
|
2883
|
+
}> | Extract<SelectCellCommand, {
|
|
2884
|
+
type: T;
|
|
2885
|
+
}> | Extract<SetSelectionCommand, {
|
|
2886
|
+
type: T;
|
|
2887
|
+
}> | Extract<StartSelectionCommand, {
|
|
2888
|
+
type: T;
|
|
2889
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
2890
|
+
type: T;
|
|
2891
|
+
}> | Extract<StartExpansionCommand, {
|
|
2892
|
+
type: T;
|
|
2893
|
+
}> | Extract<StopSelectionCommand, {
|
|
2894
|
+
type: T;
|
|
2895
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
2896
|
+
type: T;
|
|
2897
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
2898
|
+
type: T;
|
|
2899
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
2900
|
+
type: T;
|
|
2901
|
+
}> | Extract<SetColorCommand, {
|
|
2902
|
+
type: T;
|
|
2903
|
+
}> | Extract<SelectColumnCommand, {
|
|
2904
|
+
type: T;
|
|
2905
|
+
}> | Extract<SelectRowCommand, {
|
|
2906
|
+
type: T;
|
|
2907
|
+
}> | Extract<SelectAllCommand, {
|
|
2908
|
+
type: T;
|
|
2909
|
+
}> | Extract<AlterSelectionCommand, {
|
|
2910
|
+
type: T;
|
|
2911
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
2912
|
+
type: T;
|
|
2913
|
+
}> | Extract<AddHighlightsCommand, {
|
|
2914
|
+
type: T;
|
|
2915
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
2916
|
+
type: T;
|
|
2917
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
2918
|
+
type: T;
|
|
2919
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
2920
|
+
type: T;
|
|
2921
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
2922
|
+
type: T;
|
|
2923
|
+
}> | Extract<StartEditionCommand, {
|
|
2924
|
+
type: T;
|
|
2925
|
+
}> | Extract<StopEditionCommand, {
|
|
2926
|
+
type: T;
|
|
2927
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
2928
|
+
type: T;
|
|
2929
|
+
}> | Extract<SetValueCommand, {
|
|
2930
|
+
type: T;
|
|
2931
|
+
}> | Extract<ShowFormulaCommand, {
|
|
2932
|
+
type: T;
|
|
2933
|
+
}> | Extract<DeleteContentCommand, {
|
|
2934
|
+
type: T;
|
|
2935
|
+
}> | Extract<ClearCellCommand, {
|
|
2936
|
+
type: T;
|
|
2937
|
+
}> | Extract<UndoCommand, {
|
|
2938
|
+
type: T;
|
|
2939
|
+
}> | Extract<RedoCommand, {
|
|
2940
|
+
type: T;
|
|
2941
|
+
}> | Extract<StartCommand, {
|
|
2942
|
+
type: T;
|
|
2943
|
+
}> | Extract<AutofillCommand, {
|
|
2944
|
+
type: T;
|
|
2945
|
+
}> | Extract<AutofillSelectCommand, {
|
|
2946
|
+
type: T;
|
|
2947
|
+
}> | Extract<AutofillAutoCommand, {
|
|
2948
|
+
type: T;
|
|
2949
|
+
}> | Extract<NewInputCommand, {
|
|
2950
|
+
type: T;
|
|
2951
|
+
}> | Extract<RemoveInputCommand, {
|
|
2952
|
+
type: T;
|
|
2953
|
+
}> | Extract<FocusInputCommand, {
|
|
2954
|
+
type: T;
|
|
2955
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
2956
|
+
type: T;
|
|
2957
|
+
}> | Extract<RemoveRangeCommand, {
|
|
2958
|
+
type: T;
|
|
2959
|
+
}> | Extract<ChangeRangeCommand, {
|
|
2960
|
+
type: T;
|
|
2961
|
+
}> | Extract<CreateFigureCommand, {
|
|
2962
|
+
type: T;
|
|
2963
|
+
}> | Extract<SelectFigureCommand, {
|
|
2964
|
+
type: T;
|
|
2965
|
+
}> | Extract<UpdateFigureCommand, {
|
|
2966
|
+
type: T;
|
|
2967
|
+
}> | Extract<DeleteFigureCommand, {
|
|
2968
|
+
type: T;
|
|
2969
|
+
}> | Extract<CreateChartCommand, {
|
|
2970
|
+
type: T;
|
|
2971
|
+
}> | Extract<UpdateChartCommand, {
|
|
2972
|
+
type: T;
|
|
2973
|
+
}>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
|
|
2974
|
+
<T_1 extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C_1 extends Extract<UpdateCellCommand, {
|
|
2975
|
+
type: T_1;
|
|
2976
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
2977
|
+
type: T_1;
|
|
2978
|
+
}> | Extract<ResizeRowsCommand, {
|
|
2979
|
+
type: T_1;
|
|
2980
|
+
}> | Extract<CreateSheetCommand, {
|
|
2981
|
+
type: T_1;
|
|
2982
|
+
}> | Extract<MoveSheetCommand, {
|
|
2983
|
+
type: T_1;
|
|
2984
|
+
}> | Extract<RenameSheetCommand, {
|
|
2985
|
+
type: T_1;
|
|
2986
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
2987
|
+
type: T_1;
|
|
2988
|
+
}> | Extract<DeleteSheetCommand, {
|
|
2989
|
+
type: T_1;
|
|
2990
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
2991
|
+
type: T_1;
|
|
2992
|
+
}> | Extract<AddMergeCommand, {
|
|
2993
|
+
type: T_1;
|
|
2994
|
+
}> | Extract<RemoveMergeCommand, {
|
|
2995
|
+
type: T_1;
|
|
2996
|
+
}> | Extract<AddFormattingCommand, {
|
|
2997
|
+
type: T_1;
|
|
2998
|
+
}> | Extract<ClearFormattingCommand, {
|
|
2999
|
+
type: T_1;
|
|
3000
|
+
}> | Extract<SetFormatterCommand, {
|
|
3001
|
+
type: T_1;
|
|
3002
|
+
}> | Extract<SetDecimalCommand, {
|
|
3003
|
+
type: T_1;
|
|
3004
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
3005
|
+
type: T_1;
|
|
3006
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
3007
|
+
type: T_1;
|
|
3008
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
3009
|
+
type: T_1;
|
|
3010
|
+
}> | Extract<RemoveRowsCommand, {
|
|
3011
|
+
type: T_1;
|
|
3012
|
+
}> | Extract<AddColumnsCommand, {
|
|
3013
|
+
type: T_1;
|
|
3014
|
+
}> | Extract<AddRowsCommand, {
|
|
3015
|
+
type: T_1;
|
|
3016
|
+
}> | Extract<CopyCommand, {
|
|
3017
|
+
type: T_1;
|
|
3018
|
+
}> | Extract<CutCommand, {
|
|
3019
|
+
type: T_1;
|
|
3020
|
+
}> | Extract<PasteCommand, {
|
|
3021
|
+
type: T_1;
|
|
3022
|
+
}> | Extract<PasteCellCommand, {
|
|
3023
|
+
type: T_1;
|
|
3024
|
+
}> | Extract<AutoFillCellCommand, {
|
|
3025
|
+
type: T_1;
|
|
3026
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
3027
|
+
type: T_1;
|
|
3028
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
3029
|
+
type: T_1;
|
|
3030
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
3031
|
+
type: T_1;
|
|
3032
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
3033
|
+
type: T_1;
|
|
3034
|
+
}> | Extract<MovePositionCommand, {
|
|
3035
|
+
type: T_1;
|
|
3036
|
+
}> | Extract<ActivateSheetCommand, {
|
|
3037
|
+
type: T_1;
|
|
3038
|
+
}> | Extract<SelectCellCommand, {
|
|
3039
|
+
type: T_1;
|
|
3040
|
+
}> | Extract<SetSelectionCommand, {
|
|
3041
|
+
type: T_1;
|
|
3042
|
+
}> | Extract<StartSelectionCommand, {
|
|
3043
|
+
type: T_1;
|
|
3044
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
3045
|
+
type: T_1;
|
|
3046
|
+
}> | Extract<StartExpansionCommand, {
|
|
3047
|
+
type: T_1;
|
|
3048
|
+
}> | Extract<StopSelectionCommand, {
|
|
3049
|
+
type: T_1;
|
|
3050
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
3051
|
+
type: T_1;
|
|
3052
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
3053
|
+
type: T_1;
|
|
3054
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
3055
|
+
type: T_1;
|
|
3056
|
+
}> | Extract<SetColorCommand, {
|
|
3057
|
+
type: T_1;
|
|
3058
|
+
}> | Extract<SelectColumnCommand, {
|
|
3059
|
+
type: T_1;
|
|
3060
|
+
}> | Extract<SelectRowCommand, {
|
|
3061
|
+
type: T_1;
|
|
3062
|
+
}> | Extract<SelectAllCommand, {
|
|
3063
|
+
type: T_1;
|
|
3064
|
+
}> | Extract<AlterSelectionCommand, {
|
|
3065
|
+
type: T_1;
|
|
3066
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
3067
|
+
type: T_1;
|
|
3068
|
+
}> | Extract<AddHighlightsCommand, {
|
|
3069
|
+
type: T_1;
|
|
3070
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
3071
|
+
type: T_1;
|
|
3072
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
3073
|
+
type: T_1;
|
|
3074
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
3075
|
+
type: T_1;
|
|
3076
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
3077
|
+
type: T_1;
|
|
3078
|
+
}> | Extract<StartEditionCommand, {
|
|
3079
|
+
type: T_1;
|
|
3080
|
+
}> | Extract<StopEditionCommand, {
|
|
3081
|
+
type: T_1;
|
|
3082
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
3083
|
+
type: T_1;
|
|
3084
|
+
}> | Extract<SetValueCommand, {
|
|
3085
|
+
type: T_1;
|
|
3086
|
+
}> | Extract<ShowFormulaCommand, {
|
|
3087
|
+
type: T_1;
|
|
3088
|
+
}> | Extract<DeleteContentCommand, {
|
|
3089
|
+
type: T_1;
|
|
3090
|
+
}> | Extract<ClearCellCommand, {
|
|
3091
|
+
type: T_1;
|
|
3092
|
+
}> | Extract<UndoCommand, {
|
|
3093
|
+
type: T_1;
|
|
3094
|
+
}> | Extract<RedoCommand, {
|
|
3095
|
+
type: T_1;
|
|
3096
|
+
}> | Extract<StartCommand, {
|
|
3097
|
+
type: T_1;
|
|
3098
|
+
}> | Extract<AutofillCommand, {
|
|
3099
|
+
type: T_1;
|
|
3100
|
+
}> | Extract<AutofillSelectCommand, {
|
|
3101
|
+
type: T_1;
|
|
3102
|
+
}> | Extract<AutofillAutoCommand, {
|
|
3103
|
+
type: T_1;
|
|
3104
|
+
}> | Extract<NewInputCommand, {
|
|
3105
|
+
type: T_1;
|
|
3106
|
+
}> | Extract<RemoveInputCommand, {
|
|
3107
|
+
type: T_1;
|
|
3108
|
+
}> | Extract<FocusInputCommand, {
|
|
3109
|
+
type: T_1;
|
|
3110
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
3111
|
+
type: T_1;
|
|
3112
|
+
}> | Extract<RemoveRangeCommand, {
|
|
3113
|
+
type: T_1;
|
|
3114
|
+
}> | Extract<ChangeRangeCommand, {
|
|
3115
|
+
type: T_1;
|
|
3116
|
+
}> | Extract<CreateFigureCommand, {
|
|
3117
|
+
type: T_1;
|
|
3118
|
+
}> | Extract<SelectFigureCommand, {
|
|
3119
|
+
type: T_1;
|
|
3120
|
+
}> | Extract<UpdateFigureCommand, {
|
|
3121
|
+
type: T_1;
|
|
3122
|
+
}> | Extract<DeleteFigureCommand, {
|
|
3123
|
+
type: T_1;
|
|
3124
|
+
}> | Extract<CreateChartCommand, {
|
|
3125
|
+
type: T_1;
|
|
3126
|
+
}> | Extract<UpdateChartCommand, {
|
|
3127
|
+
type: T_1;
|
|
3128
|
+
}>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
|
|
3129
|
+
};
|
|
3130
|
+
getFigures(): FigureInfo[];
|
|
3131
|
+
getDims(info: FigureInfo): string;
|
|
3132
|
+
getStyle(info: FigureInfo): string;
|
|
3133
|
+
mounted(): void;
|
|
3134
|
+
resize(figure: Figure<any>, dirX: number, dirY: number, ev: MouseEvent): void;
|
|
3135
|
+
onMouseDown(figure: Figure<any>, ev: MouseEvent): void;
|
|
3136
|
+
onKeyDown(figure: Figure<any>, ev: KeyboardEvent): void;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
declare const Component$5: typeof owl.Component;
|
|
3140
|
+
declare abstract class AbstractResizer extends Component$5<any, SpreadsheetEnv> {
|
|
3141
|
+
PADDING: number;
|
|
3142
|
+
MAX_SIZE_MARGIN: number;
|
|
3143
|
+
MIN_ELEMENT_SIZE: number;
|
|
3144
|
+
lastSelectedElement: number | null;
|
|
3145
|
+
lastElement: number | null;
|
|
3146
|
+
getters: Getters;
|
|
3147
|
+
dispatch: {
|
|
3148
|
+
<T extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C extends Extract<UpdateCellCommand, {
|
|
3149
|
+
type: T;
|
|
3150
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
3151
|
+
type: T;
|
|
3152
|
+
}> | Extract<ResizeRowsCommand, {
|
|
3153
|
+
type: T;
|
|
3154
|
+
}> | Extract<CreateSheetCommand, {
|
|
3155
|
+
type: T;
|
|
3156
|
+
}> | Extract<MoveSheetCommand, {
|
|
3157
|
+
type: T;
|
|
3158
|
+
}> | Extract<RenameSheetCommand, {
|
|
3159
|
+
type: T;
|
|
3160
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
3161
|
+
type: T;
|
|
3162
|
+
}> | Extract<DeleteSheetCommand, {
|
|
3163
|
+
type: T;
|
|
3164
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
3165
|
+
type: T;
|
|
3166
|
+
}> | Extract<AddMergeCommand, {
|
|
3167
|
+
type: T;
|
|
3168
|
+
}> | Extract<RemoveMergeCommand, {
|
|
3169
|
+
type: T;
|
|
3170
|
+
}> | Extract<AddFormattingCommand, {
|
|
3171
|
+
type: T;
|
|
3172
|
+
}> | Extract<ClearFormattingCommand, {
|
|
3173
|
+
type: T;
|
|
3174
|
+
}> | Extract<SetFormatterCommand, {
|
|
3175
|
+
type: T;
|
|
3176
|
+
}> | Extract<SetDecimalCommand, {
|
|
3177
|
+
type: T;
|
|
3178
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
3179
|
+
type: T;
|
|
3180
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
3181
|
+
type: T;
|
|
3182
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
3183
|
+
type: T;
|
|
3184
|
+
}> | Extract<RemoveRowsCommand, {
|
|
3185
|
+
type: T;
|
|
3186
|
+
}> | Extract<AddColumnsCommand, {
|
|
3187
|
+
type: T;
|
|
3188
|
+
}> | Extract<AddRowsCommand, {
|
|
3189
|
+
type: T;
|
|
3190
|
+
}> | Extract<CopyCommand, {
|
|
3191
|
+
type: T;
|
|
3192
|
+
}> | Extract<CutCommand, {
|
|
3193
|
+
type: T;
|
|
3194
|
+
}> | Extract<PasteCommand, {
|
|
3195
|
+
type: T;
|
|
3196
|
+
}> | Extract<PasteCellCommand, {
|
|
3197
|
+
type: T;
|
|
3198
|
+
}> | Extract<AutoFillCellCommand, {
|
|
3199
|
+
type: T;
|
|
3200
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
3201
|
+
type: T;
|
|
3202
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
3203
|
+
type: T;
|
|
3204
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
3205
|
+
type: T;
|
|
3206
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
3207
|
+
type: T;
|
|
3208
|
+
}> | Extract<MovePositionCommand, {
|
|
3209
|
+
type: T;
|
|
3210
|
+
}> | Extract<ActivateSheetCommand, {
|
|
3211
|
+
type: T;
|
|
3212
|
+
}> | Extract<SelectCellCommand, {
|
|
3213
|
+
type: T;
|
|
3214
|
+
}> | Extract<SetSelectionCommand, {
|
|
3215
|
+
type: T;
|
|
3216
|
+
}> | Extract<StartSelectionCommand, {
|
|
3217
|
+
type: T;
|
|
3218
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
3219
|
+
type: T;
|
|
3220
|
+
}> | Extract<StartExpansionCommand, {
|
|
3221
|
+
type: T;
|
|
3222
|
+
}> | Extract<StopSelectionCommand, {
|
|
3223
|
+
type: T;
|
|
3224
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
3225
|
+
type: T;
|
|
3226
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
3227
|
+
type: T;
|
|
3228
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
3229
|
+
type: T;
|
|
3230
|
+
}> | Extract<SetColorCommand, {
|
|
3231
|
+
type: T;
|
|
3232
|
+
}> | Extract<SelectColumnCommand, {
|
|
3233
|
+
type: T;
|
|
3234
|
+
}> | Extract<SelectRowCommand, {
|
|
3235
|
+
type: T;
|
|
3236
|
+
}> | Extract<SelectAllCommand, {
|
|
3237
|
+
type: T;
|
|
3238
|
+
}> | Extract<AlterSelectionCommand, {
|
|
3239
|
+
type: T;
|
|
3240
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
3241
|
+
type: T;
|
|
3242
|
+
}> | Extract<AddHighlightsCommand, {
|
|
3243
|
+
type: T;
|
|
3244
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
3245
|
+
type: T;
|
|
3246
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
3247
|
+
type: T;
|
|
3248
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
3249
|
+
type: T;
|
|
3250
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
3251
|
+
type: T;
|
|
3252
|
+
}> | Extract<StartEditionCommand, {
|
|
3253
|
+
type: T;
|
|
3254
|
+
}> | Extract<StopEditionCommand, {
|
|
3255
|
+
type: T;
|
|
3256
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
3257
|
+
type: T;
|
|
3258
|
+
}> | Extract<SetValueCommand, {
|
|
3259
|
+
type: T;
|
|
3260
|
+
}> | Extract<ShowFormulaCommand, {
|
|
3261
|
+
type: T;
|
|
3262
|
+
}> | Extract<DeleteContentCommand, {
|
|
3263
|
+
type: T;
|
|
3264
|
+
}> | Extract<ClearCellCommand, {
|
|
3265
|
+
type: T;
|
|
3266
|
+
}> | Extract<UndoCommand, {
|
|
3267
|
+
type: T;
|
|
3268
|
+
}> | Extract<RedoCommand, {
|
|
3269
|
+
type: T;
|
|
3270
|
+
}> | Extract<StartCommand, {
|
|
3271
|
+
type: T;
|
|
3272
|
+
}> | Extract<AutofillCommand, {
|
|
3273
|
+
type: T;
|
|
3274
|
+
}> | Extract<AutofillSelectCommand, {
|
|
3275
|
+
type: T;
|
|
3276
|
+
}> | Extract<AutofillAutoCommand, {
|
|
3277
|
+
type: T;
|
|
3278
|
+
}> | Extract<NewInputCommand, {
|
|
3279
|
+
type: T;
|
|
3280
|
+
}> | Extract<RemoveInputCommand, {
|
|
3281
|
+
type: T;
|
|
3282
|
+
}> | Extract<FocusInputCommand, {
|
|
3283
|
+
type: T;
|
|
3284
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
3285
|
+
type: T;
|
|
3286
|
+
}> | Extract<RemoveRangeCommand, {
|
|
3287
|
+
type: T;
|
|
3288
|
+
}> | Extract<ChangeRangeCommand, {
|
|
3289
|
+
type: T;
|
|
3290
|
+
}> | Extract<CreateFigureCommand, {
|
|
3291
|
+
type: T;
|
|
3292
|
+
}> | Extract<SelectFigureCommand, {
|
|
3293
|
+
type: T;
|
|
3294
|
+
}> | Extract<UpdateFigureCommand, {
|
|
3295
|
+
type: T;
|
|
3296
|
+
}> | Extract<DeleteFigureCommand, {
|
|
3297
|
+
type: T;
|
|
3298
|
+
}> | Extract<CreateChartCommand, {
|
|
3299
|
+
type: T;
|
|
3300
|
+
}> | Extract<UpdateChartCommand, {
|
|
3301
|
+
type: T;
|
|
3302
|
+
}>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
|
|
3303
|
+
<T_1 extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C_1 extends Extract<UpdateCellCommand, {
|
|
3304
|
+
type: T_1;
|
|
3305
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
3306
|
+
type: T_1;
|
|
3307
|
+
}> | Extract<ResizeRowsCommand, {
|
|
3308
|
+
type: T_1;
|
|
3309
|
+
}> | Extract<CreateSheetCommand, {
|
|
3310
|
+
type: T_1;
|
|
3311
|
+
}> | Extract<MoveSheetCommand, {
|
|
3312
|
+
type: T_1;
|
|
3313
|
+
}> | Extract<RenameSheetCommand, {
|
|
3314
|
+
type: T_1;
|
|
3315
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
3316
|
+
type: T_1;
|
|
3317
|
+
}> | Extract<DeleteSheetCommand, {
|
|
3318
|
+
type: T_1;
|
|
3319
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
3320
|
+
type: T_1;
|
|
3321
|
+
}> | Extract<AddMergeCommand, {
|
|
3322
|
+
type: T_1;
|
|
3323
|
+
}> | Extract<RemoveMergeCommand, {
|
|
3324
|
+
type: T_1;
|
|
3325
|
+
}> | Extract<AddFormattingCommand, {
|
|
3326
|
+
type: T_1;
|
|
3327
|
+
}> | Extract<ClearFormattingCommand, {
|
|
3328
|
+
type: T_1;
|
|
3329
|
+
}> | Extract<SetFormatterCommand, {
|
|
3330
|
+
type: T_1;
|
|
3331
|
+
}> | Extract<SetDecimalCommand, {
|
|
3332
|
+
type: T_1;
|
|
3333
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
3334
|
+
type: T_1;
|
|
3335
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
3336
|
+
type: T_1;
|
|
3337
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
3338
|
+
type: T_1;
|
|
3339
|
+
}> | Extract<RemoveRowsCommand, {
|
|
3340
|
+
type: T_1;
|
|
3341
|
+
}> | Extract<AddColumnsCommand, {
|
|
3342
|
+
type: T_1;
|
|
3343
|
+
}> | Extract<AddRowsCommand, {
|
|
3344
|
+
type: T_1;
|
|
3345
|
+
}> | Extract<CopyCommand, {
|
|
3346
|
+
type: T_1;
|
|
3347
|
+
}> | Extract<CutCommand, {
|
|
3348
|
+
type: T_1;
|
|
3349
|
+
}> | Extract<PasteCommand, {
|
|
3350
|
+
type: T_1;
|
|
3351
|
+
}> | Extract<PasteCellCommand, {
|
|
3352
|
+
type: T_1;
|
|
3353
|
+
}> | Extract<AutoFillCellCommand, {
|
|
3354
|
+
type: T_1;
|
|
3355
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
3356
|
+
type: T_1;
|
|
3357
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
3358
|
+
type: T_1;
|
|
3359
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
3360
|
+
type: T_1;
|
|
3361
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
3362
|
+
type: T_1;
|
|
3363
|
+
}> | Extract<MovePositionCommand, {
|
|
3364
|
+
type: T_1;
|
|
3365
|
+
}> | Extract<ActivateSheetCommand, {
|
|
3366
|
+
type: T_1;
|
|
3367
|
+
}> | Extract<SelectCellCommand, {
|
|
3368
|
+
type: T_1;
|
|
3369
|
+
}> | Extract<SetSelectionCommand, {
|
|
3370
|
+
type: T_1;
|
|
3371
|
+
}> | Extract<StartSelectionCommand, {
|
|
3372
|
+
type: T_1;
|
|
3373
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
3374
|
+
type: T_1;
|
|
3375
|
+
}> | Extract<StartExpansionCommand, {
|
|
3376
|
+
type: T_1;
|
|
3377
|
+
}> | Extract<StopSelectionCommand, {
|
|
3378
|
+
type: T_1;
|
|
3379
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
3380
|
+
type: T_1;
|
|
3381
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
3382
|
+
type: T_1;
|
|
3383
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
3384
|
+
type: T_1;
|
|
3385
|
+
}> | Extract<SetColorCommand, {
|
|
3386
|
+
type: T_1;
|
|
3387
|
+
}> | Extract<SelectColumnCommand, {
|
|
3388
|
+
type: T_1;
|
|
3389
|
+
}> | Extract<SelectRowCommand, {
|
|
3390
|
+
type: T_1;
|
|
3391
|
+
}> | Extract<SelectAllCommand, {
|
|
3392
|
+
type: T_1;
|
|
3393
|
+
}> | Extract<AlterSelectionCommand, {
|
|
3394
|
+
type: T_1;
|
|
3395
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
3396
|
+
type: T_1;
|
|
3397
|
+
}> | Extract<AddHighlightsCommand, {
|
|
3398
|
+
type: T_1;
|
|
3399
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
3400
|
+
type: T_1;
|
|
3401
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
3402
|
+
type: T_1;
|
|
3403
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
3404
|
+
type: T_1;
|
|
3405
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
3406
|
+
type: T_1;
|
|
3407
|
+
}> | Extract<StartEditionCommand, {
|
|
3408
|
+
type: T_1;
|
|
3409
|
+
}> | Extract<StopEditionCommand, {
|
|
3410
|
+
type: T_1;
|
|
3411
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
3412
|
+
type: T_1;
|
|
3413
|
+
}> | Extract<SetValueCommand, {
|
|
3414
|
+
type: T_1;
|
|
3415
|
+
}> | Extract<ShowFormulaCommand, {
|
|
3416
|
+
type: T_1;
|
|
3417
|
+
}> | Extract<DeleteContentCommand, {
|
|
3418
|
+
type: T_1;
|
|
3419
|
+
}> | Extract<ClearCellCommand, {
|
|
3420
|
+
type: T_1;
|
|
3421
|
+
}> | Extract<UndoCommand, {
|
|
3422
|
+
type: T_1;
|
|
3423
|
+
}> | Extract<RedoCommand, {
|
|
3424
|
+
type: T_1;
|
|
3425
|
+
}> | Extract<StartCommand, {
|
|
3426
|
+
type: T_1;
|
|
3427
|
+
}> | Extract<AutofillCommand, {
|
|
3428
|
+
type: T_1;
|
|
3429
|
+
}> | Extract<AutofillSelectCommand, {
|
|
3430
|
+
type: T_1;
|
|
3431
|
+
}> | Extract<AutofillAutoCommand, {
|
|
3432
|
+
type: T_1;
|
|
3433
|
+
}> | Extract<NewInputCommand, {
|
|
3434
|
+
type: T_1;
|
|
3435
|
+
}> | Extract<RemoveInputCommand, {
|
|
3436
|
+
type: T_1;
|
|
3437
|
+
}> | Extract<FocusInputCommand, {
|
|
3438
|
+
type: T_1;
|
|
3439
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
3440
|
+
type: T_1;
|
|
3441
|
+
}> | Extract<RemoveRangeCommand, {
|
|
3442
|
+
type: T_1;
|
|
3443
|
+
}> | Extract<ChangeRangeCommand, {
|
|
3444
|
+
type: T_1;
|
|
3445
|
+
}> | Extract<CreateFigureCommand, {
|
|
3446
|
+
type: T_1;
|
|
3447
|
+
}> | Extract<SelectFigureCommand, {
|
|
3448
|
+
type: T_1;
|
|
3449
|
+
}> | Extract<UpdateFigureCommand, {
|
|
3450
|
+
type: T_1;
|
|
3451
|
+
}> | Extract<DeleteFigureCommand, {
|
|
3452
|
+
type: T_1;
|
|
3453
|
+
}> | Extract<CreateChartCommand, {
|
|
3454
|
+
type: T_1;
|
|
3455
|
+
}> | Extract<UpdateChartCommand, {
|
|
3456
|
+
type: T_1;
|
|
3457
|
+
}>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
|
|
3458
|
+
};
|
|
3459
|
+
state: {
|
|
3460
|
+
isActive: boolean;
|
|
3461
|
+
isResizing: boolean;
|
|
3462
|
+
activeElement: number;
|
|
3463
|
+
styleValue: number;
|
|
3464
|
+
delta: number;
|
|
3465
|
+
};
|
|
3466
|
+
abstract _getEvOffset(ev: MouseEvent): number;
|
|
3467
|
+
abstract _getStateOffset(): number;
|
|
3468
|
+
abstract _getViewportOffset(): number;
|
|
3469
|
+
abstract _getClientPosition(ev: MouseEvent): number;
|
|
3470
|
+
abstract _getElementIndex(index: number): number;
|
|
3471
|
+
abstract _getElement(index: number): Col | Row;
|
|
3472
|
+
abstract _getHeaderSize(): number;
|
|
3473
|
+
abstract _getMaxSize(): number;
|
|
3474
|
+
abstract _updateSize(): void;
|
|
3475
|
+
abstract _selectElement(index: number, ctrlKey: boolean): void;
|
|
3476
|
+
abstract _increaseSelection(index: number): void;
|
|
3477
|
+
abstract _fitElementSize(index: number): void;
|
|
3478
|
+
abstract _getType(): ContextMenuType;
|
|
3479
|
+
abstract _getActiveElements(): Set<number>;
|
|
3480
|
+
abstract _getXY(ev: MouseEvent): {
|
|
3481
|
+
x: number;
|
|
3482
|
+
y: number;
|
|
3483
|
+
};
|
|
3484
|
+
_computeHandleDisplay(ev: MouseEvent): void;
|
|
3485
|
+
onMouseMove(ev: MouseEvent): void;
|
|
3486
|
+
onMouseLeave(): void;
|
|
3487
|
+
onDblClick(): void;
|
|
3488
|
+
onMouseDown(ev: MouseEvent): void;
|
|
3489
|
+
select(ev: MouseEvent): void;
|
|
3490
|
+
onMouseUp(ev: MouseEvent): void;
|
|
3491
|
+
onContextMenu(ev: MouseEvent): void;
|
|
3492
|
+
}
|
|
3493
|
+
declare class ColResizer extends AbstractResizer {
|
|
3494
|
+
static template: string;
|
|
3495
|
+
static style: string;
|
|
3496
|
+
constructor();
|
|
3497
|
+
_getEvOffset(ev: MouseEvent): number;
|
|
3498
|
+
_getStateOffset(): number;
|
|
3499
|
+
_getViewportOffset(): number;
|
|
3500
|
+
_getClientPosition(ev: MouseEvent): number;
|
|
3501
|
+
_getElementIndex(index: number): number;
|
|
3502
|
+
_getElement(index: number): Col;
|
|
3503
|
+
_getBottomRightValue(element: Col): number;
|
|
3504
|
+
_getHeaderSize(): number;
|
|
3505
|
+
_getMaxSize(): number;
|
|
3506
|
+
_updateSize(): void;
|
|
3507
|
+
_selectElement(index: number, ctrlKey: boolean): void;
|
|
3508
|
+
_increaseSelection(index: number): void;
|
|
3509
|
+
_fitElementSize(index: number): void;
|
|
3510
|
+
_getType(): ContextMenuType;
|
|
3511
|
+
_getActiveElements(): Set<number>;
|
|
3512
|
+
_getXY(ev: MouseEvent): {
|
|
3513
|
+
x: number;
|
|
3514
|
+
y: number;
|
|
3515
|
+
};
|
|
3516
|
+
}
|
|
3517
|
+
declare class RowResizer extends AbstractResizer {
|
|
3518
|
+
static template: string;
|
|
3519
|
+
static style: string;
|
|
3520
|
+
constructor();
|
|
3521
|
+
_getEvOffset(ev: MouseEvent): number;
|
|
3522
|
+
_getStateOffset(): number;
|
|
3523
|
+
_getViewportOffset(): number;
|
|
3524
|
+
_getClientPosition(ev: MouseEvent): number;
|
|
3525
|
+
_getElementIndex(index: number): number;
|
|
3526
|
+
_getElement(index: number): Row;
|
|
3527
|
+
_getHeaderSize(): number;
|
|
3528
|
+
_getMaxSize(): number;
|
|
3529
|
+
_updateSize(): void;
|
|
3530
|
+
_selectElement(index: number, ctrlKey: boolean): void;
|
|
3531
|
+
_increaseSelection(index: number): void;
|
|
3532
|
+
_fitElementSize(index: number): void;
|
|
3533
|
+
_getType(): ContextMenuType;
|
|
3534
|
+
_getActiveElements(): Set<number>;
|
|
3535
|
+
_getXY(ev: MouseEvent): {
|
|
3536
|
+
x: number;
|
|
3537
|
+
y: number;
|
|
3538
|
+
};
|
|
3539
|
+
}
|
|
3540
|
+
interface Props$2 {
|
|
3541
|
+
viewport: Viewport;
|
|
3542
|
+
}
|
|
3543
|
+
declare class Overlay extends Component$5<Props$2, SpreadsheetEnv> {
|
|
3544
|
+
static template: string;
|
|
3545
|
+
static style: string;
|
|
3546
|
+
static components: {
|
|
3547
|
+
ColResizer: typeof ColResizer;
|
|
3548
|
+
RowResizer: typeof RowResizer;
|
|
3549
|
+
};
|
|
3550
|
+
selectAll(): void;
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
declare const Component$4: typeof owl.Component;
|
|
3554
|
+
declare type ContextMenuType = "ROW" | "COL" | "CELL";
|
|
3555
|
+
interface ErrorTooltip {
|
|
3556
|
+
isOpen: boolean;
|
|
3557
|
+
text: string;
|
|
3558
|
+
style: string;
|
|
3559
|
+
}
|
|
3560
|
+
declare class Grid extends Component$4<{
|
|
3561
|
+
model: Model;
|
|
3562
|
+
}, SpreadsheetEnv> {
|
|
3563
|
+
static template: string;
|
|
3564
|
+
static style: string;
|
|
3565
|
+
static components: {
|
|
3566
|
+
Composer: typeof Composer;
|
|
3567
|
+
Overlay: typeof Overlay;
|
|
3568
|
+
Menu: typeof Menu;
|
|
3569
|
+
Autofill: typeof Autofill;
|
|
3570
|
+
FiguresContainer: typeof FiguresContainer;
|
|
3571
|
+
};
|
|
3572
|
+
private menuState;
|
|
3573
|
+
private composer;
|
|
3574
|
+
private vScrollbarRef;
|
|
3575
|
+
private hScrollbarRef;
|
|
3576
|
+
private vScrollbar;
|
|
3577
|
+
private hScrollbar;
|
|
3578
|
+
private canvas;
|
|
3579
|
+
private getters;
|
|
3580
|
+
private dispatch;
|
|
3581
|
+
private currentPosition;
|
|
3582
|
+
private currentSheet;
|
|
3583
|
+
private currentPositionInViewport;
|
|
3584
|
+
private clickedCol;
|
|
3585
|
+
private clickedRow;
|
|
3586
|
+
private viewport;
|
|
3587
|
+
private snappedViewport;
|
|
3588
|
+
errorTooltip: ErrorTooltip;
|
|
3589
|
+
private keyDownMapping;
|
|
3590
|
+
constructor();
|
|
3591
|
+
mounted(): void;
|
|
3592
|
+
willUpdateProps(): Promise<void>;
|
|
3593
|
+
patched(): void;
|
|
3594
|
+
focus(): void;
|
|
3595
|
+
onScroll(): void;
|
|
3596
|
+
checkChanges(): boolean;
|
|
3597
|
+
getAutofillPosition(): {
|
|
3598
|
+
left: number;
|
|
3599
|
+
top: number;
|
|
3600
|
+
};
|
|
3601
|
+
drawGrid(): void;
|
|
3602
|
+
private moveCanvas;
|
|
3603
|
+
onMouseWheel(ev: WheelEvent): void;
|
|
3604
|
+
getCartesianCoordinates(ev: MouseEvent): [number, number];
|
|
3605
|
+
onMouseDown(ev: MouseEvent): void;
|
|
3606
|
+
onDoubleClick(ev: any): void;
|
|
3607
|
+
processTabKey(ev: KeyboardEvent): void;
|
|
3608
|
+
processArrows(ev: KeyboardEvent): void;
|
|
3609
|
+
onKeydown(ev: KeyboardEvent): void;
|
|
3610
|
+
onCanvasContextMenu(ev: MouseEvent): void;
|
|
3611
|
+
onOverlayContextMenu(ev: CustomEvent): void;
|
|
3612
|
+
toggleContextMenu(type: ContextMenuType, x: number, y: number): void;
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
declare const Component$3: typeof owl.Component;
|
|
3616
|
+
interface Props$1 {
|
|
3617
|
+
component: string;
|
|
3618
|
+
panelProps: any;
|
|
3619
|
+
}
|
|
3620
|
+
declare class SidePanel extends Component$3<Props$1, SpreadsheetEnv> {
|
|
3621
|
+
static template: string;
|
|
3622
|
+
static style: string;
|
|
3623
|
+
state: {
|
|
3624
|
+
panel: SidePanelContent;
|
|
3625
|
+
};
|
|
3626
|
+
willUpdateProps(nextProps: Props$1): Promise<void>;
|
|
3627
|
+
getTitle(): string;
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
interface FontSize {
|
|
3631
|
+
pt: number;
|
|
3632
|
+
px: number;
|
|
3633
|
+
}
|
|
3634
|
+
|
|
3635
|
+
declare const Component$2: typeof owl.Component;
|
|
3636
|
+
declare class ColorPicker extends Component$2<any, SpreadsheetEnv> {
|
|
3637
|
+
static template: string;
|
|
3638
|
+
static style: string;
|
|
3639
|
+
COLORS: string[][];
|
|
3640
|
+
onColorClick(ev: MouseEvent): void;
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
declare const Component$1: typeof owl.Component;
|
|
3644
|
+
declare type Tool = "" | "formatTool" | "alignTool" | "textColorTool" | "fillColorTool" | "borderTool" | "fontSizeTool";
|
|
3645
|
+
interface State {
|
|
3646
|
+
menuState: MenuState;
|
|
3647
|
+
activeTool: Tool;
|
|
3648
|
+
}
|
|
3649
|
+
declare class TopBar extends Component$1<any, SpreadsheetEnv> {
|
|
3650
|
+
static template: string;
|
|
3651
|
+
static style: string;
|
|
3652
|
+
static components: {
|
|
3653
|
+
ColorPicker: typeof ColorPicker;
|
|
3654
|
+
Menu: typeof Menu;
|
|
3655
|
+
};
|
|
3656
|
+
formats: ({
|
|
3657
|
+
name: string;
|
|
3658
|
+
text: string;
|
|
3659
|
+
value?: undefined;
|
|
3660
|
+
} | {
|
|
3661
|
+
name: string;
|
|
3662
|
+
text: string;
|
|
3663
|
+
value: string;
|
|
3664
|
+
})[];
|
|
3665
|
+
currentFormat: string;
|
|
3666
|
+
fontSizes: FontSize[];
|
|
3667
|
+
dispatch: {
|
|
3668
|
+
<T extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C extends Extract<UpdateCellCommand, {
|
|
3669
|
+
type: T;
|
|
3670
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
3671
|
+
type: T;
|
|
3672
|
+
}> | Extract<ResizeRowsCommand, {
|
|
3673
|
+
type: T;
|
|
3674
|
+
}> | Extract<CreateSheetCommand, {
|
|
3675
|
+
type: T;
|
|
3676
|
+
}> | Extract<MoveSheetCommand, {
|
|
3677
|
+
type: T;
|
|
3678
|
+
}> | Extract<RenameSheetCommand, {
|
|
3679
|
+
type: T;
|
|
3680
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
3681
|
+
type: T;
|
|
3682
|
+
}> | Extract<DeleteSheetCommand, {
|
|
3683
|
+
type: T;
|
|
3684
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
3685
|
+
type: T;
|
|
3686
|
+
}> | Extract<AddMergeCommand, {
|
|
3687
|
+
type: T;
|
|
3688
|
+
}> | Extract<RemoveMergeCommand, {
|
|
3689
|
+
type: T;
|
|
3690
|
+
}> | Extract<AddFormattingCommand, {
|
|
3691
|
+
type: T;
|
|
3692
|
+
}> | Extract<ClearFormattingCommand, {
|
|
3693
|
+
type: T;
|
|
3694
|
+
}> | Extract<SetFormatterCommand, {
|
|
3695
|
+
type: T;
|
|
3696
|
+
}> | Extract<SetDecimalCommand, {
|
|
3697
|
+
type: T;
|
|
3698
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
3699
|
+
type: T;
|
|
3700
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
3701
|
+
type: T;
|
|
3702
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
3703
|
+
type: T;
|
|
3704
|
+
}> | Extract<RemoveRowsCommand, {
|
|
3705
|
+
type: T;
|
|
3706
|
+
}> | Extract<AddColumnsCommand, {
|
|
3707
|
+
type: T;
|
|
3708
|
+
}> | Extract<AddRowsCommand, {
|
|
3709
|
+
type: T;
|
|
3710
|
+
}> | Extract<CopyCommand, {
|
|
3711
|
+
type: T;
|
|
3712
|
+
}> | Extract<CutCommand, {
|
|
3713
|
+
type: T;
|
|
3714
|
+
}> | Extract<PasteCommand, {
|
|
3715
|
+
type: T;
|
|
3716
|
+
}> | Extract<PasteCellCommand, {
|
|
3717
|
+
type: T;
|
|
3718
|
+
}> | Extract<AutoFillCellCommand, {
|
|
3719
|
+
type: T;
|
|
3720
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
3721
|
+
type: T;
|
|
3722
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
3723
|
+
type: T;
|
|
3724
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
3725
|
+
type: T;
|
|
3726
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
3727
|
+
type: T;
|
|
3728
|
+
}> | Extract<MovePositionCommand, {
|
|
3729
|
+
type: T;
|
|
3730
|
+
}> | Extract<ActivateSheetCommand, {
|
|
3731
|
+
type: T;
|
|
3732
|
+
}> | Extract<SelectCellCommand, {
|
|
3733
|
+
type: T;
|
|
3734
|
+
}> | Extract<SetSelectionCommand, {
|
|
3735
|
+
type: T;
|
|
3736
|
+
}> | Extract<StartSelectionCommand, {
|
|
3737
|
+
type: T;
|
|
3738
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
3739
|
+
type: T;
|
|
3740
|
+
}> | Extract<StartExpansionCommand, {
|
|
3741
|
+
type: T;
|
|
3742
|
+
}> | Extract<StopSelectionCommand, {
|
|
3743
|
+
type: T;
|
|
3744
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
3745
|
+
type: T;
|
|
3746
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
3747
|
+
type: T;
|
|
3748
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
3749
|
+
type: T;
|
|
3750
|
+
}> | Extract<SetColorCommand, {
|
|
3751
|
+
type: T;
|
|
3752
|
+
}> | Extract<SelectColumnCommand, {
|
|
3753
|
+
type: T;
|
|
3754
|
+
}> | Extract<SelectRowCommand, {
|
|
3755
|
+
type: T;
|
|
3756
|
+
}> | Extract<SelectAllCommand, {
|
|
3757
|
+
type: T;
|
|
3758
|
+
}> | Extract<AlterSelectionCommand, {
|
|
3759
|
+
type: T;
|
|
3760
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
3761
|
+
type: T;
|
|
3762
|
+
}> | Extract<AddHighlightsCommand, {
|
|
3763
|
+
type: T;
|
|
3764
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
3765
|
+
type: T;
|
|
3766
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
3767
|
+
type: T;
|
|
3768
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
3769
|
+
type: T;
|
|
3770
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
3771
|
+
type: T;
|
|
3772
|
+
}> | Extract<StartEditionCommand, {
|
|
3773
|
+
type: T;
|
|
3774
|
+
}> | Extract<StopEditionCommand, {
|
|
3775
|
+
type: T;
|
|
3776
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
3777
|
+
type: T;
|
|
3778
|
+
}> | Extract<SetValueCommand, {
|
|
3779
|
+
type: T;
|
|
3780
|
+
}> | Extract<ShowFormulaCommand, {
|
|
3781
|
+
type: T;
|
|
3782
|
+
}> | Extract<DeleteContentCommand, {
|
|
3783
|
+
type: T;
|
|
3784
|
+
}> | Extract<ClearCellCommand, {
|
|
3785
|
+
type: T;
|
|
3786
|
+
}> | Extract<UndoCommand, {
|
|
3787
|
+
type: T;
|
|
3788
|
+
}> | Extract<RedoCommand, {
|
|
3789
|
+
type: T;
|
|
3790
|
+
}> | Extract<StartCommand, {
|
|
3791
|
+
type: T;
|
|
3792
|
+
}> | Extract<AutofillCommand, {
|
|
3793
|
+
type: T;
|
|
3794
|
+
}> | Extract<AutofillSelectCommand, {
|
|
3795
|
+
type: T;
|
|
3796
|
+
}> | Extract<AutofillAutoCommand, {
|
|
3797
|
+
type: T;
|
|
3798
|
+
}> | Extract<NewInputCommand, {
|
|
3799
|
+
type: T;
|
|
3800
|
+
}> | Extract<RemoveInputCommand, {
|
|
3801
|
+
type: T;
|
|
3802
|
+
}> | Extract<FocusInputCommand, {
|
|
3803
|
+
type: T;
|
|
3804
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
3805
|
+
type: T;
|
|
3806
|
+
}> | Extract<RemoveRangeCommand, {
|
|
3807
|
+
type: T;
|
|
3808
|
+
}> | Extract<ChangeRangeCommand, {
|
|
3809
|
+
type: T;
|
|
3810
|
+
}> | Extract<CreateFigureCommand, {
|
|
3811
|
+
type: T;
|
|
3812
|
+
}> | Extract<SelectFigureCommand, {
|
|
3813
|
+
type: T;
|
|
3814
|
+
}> | Extract<UpdateFigureCommand, {
|
|
3815
|
+
type: T;
|
|
3816
|
+
}> | Extract<DeleteFigureCommand, {
|
|
3817
|
+
type: T;
|
|
3818
|
+
}> | Extract<CreateChartCommand, {
|
|
3819
|
+
type: T;
|
|
3820
|
+
}> | Extract<UpdateChartCommand, {
|
|
3821
|
+
type: T;
|
|
3822
|
+
}>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
|
|
3823
|
+
<T_1 extends "UPDATE_CELL" | "RESIZE_COLUMNS" | "RESIZE_ROWS" | "CREATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "DUPLICATE_SHEET" | "DELETE_SHEET" | "DELETE_SHEET_CONFIRMATION" | "ADD_MERGE" | "REMOVE_MERGE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_FORMATTER" | "SET_DECIMAL" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "REMOVE_COLUMNS" | "REMOVE_ROWS" | "ADD_COLUMNS" | "ADD_ROWS" | "COPY" | "CUT" | "PASTE" | "PASTE_CELL" | "AUTOFILL_CELL" | "ACTIVATE_PAINT_FORMAT" | "PASTE_FROM_OS_CLIPBOARD" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_POSITION" | "ACTIVATE_SHEET" | "SELECT_CELL" | "SET_SELECTION" | "START_SELECTION" | "PREPARE_SELECTION_EXPANSION" | "START_SELECTION_EXPANSION" | "STOP_SELECTION" | "HIGHLIGHT_SELECTION" | "ADD_PENDING_HIGHLIGHTS" | "RESET_PENDING_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "SELECT_COLUMN" | "SELECT_ROW" | "SELECT_ALL" | "ALTER_SELECTION" | "EVALUATE_CELLS" | "ADD_HIGHLIGHTS" | "REMOVE_HIGHLIGHTS" | "REMOVE_ALL_HIGHLIGHTS" | "START_COMPOSER_SELECTION" | "STOP_COMPOSER_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "SET_VALUE" | "SET_FORMULA_VISIBILITY" | "DELETE_CONTENT" | "CLEAR_CELL" | "UNDO" | "REDO" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "AUTOFILL_AUTO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "CREATE_FIGURE" | "SELECT_FIGURE" | "UPDATE_FIGURE" | "DELETE_FIGURE" | "CREATE_CHART" | "UPDATE_CHART", C_1 extends Extract<UpdateCellCommand, {
|
|
3824
|
+
type: T_1;
|
|
3825
|
+
}> | Extract<ResizeColumnsCommand, {
|
|
3826
|
+
type: T_1;
|
|
3827
|
+
}> | Extract<ResizeRowsCommand, {
|
|
3828
|
+
type: T_1;
|
|
3829
|
+
}> | Extract<CreateSheetCommand, {
|
|
3830
|
+
type: T_1;
|
|
3831
|
+
}> | Extract<MoveSheetCommand, {
|
|
3832
|
+
type: T_1;
|
|
3833
|
+
}> | Extract<RenameSheetCommand, {
|
|
3834
|
+
type: T_1;
|
|
3835
|
+
}> | Extract<DuplicateSheetCommand, {
|
|
3836
|
+
type: T_1;
|
|
3837
|
+
}> | Extract<DeleteSheetCommand, {
|
|
3838
|
+
type: T_1;
|
|
3839
|
+
}> | Extract<DeleteSheetConfirmationCommand, {
|
|
3840
|
+
type: T_1;
|
|
3841
|
+
}> | Extract<AddMergeCommand, {
|
|
3842
|
+
type: T_1;
|
|
3843
|
+
}> | Extract<RemoveMergeCommand, {
|
|
3844
|
+
type: T_1;
|
|
3845
|
+
}> | Extract<AddFormattingCommand, {
|
|
3846
|
+
type: T_1;
|
|
3847
|
+
}> | Extract<ClearFormattingCommand, {
|
|
3848
|
+
type: T_1;
|
|
3849
|
+
}> | Extract<SetFormatterCommand, {
|
|
3850
|
+
type: T_1;
|
|
3851
|
+
}> | Extract<SetDecimalCommand, {
|
|
3852
|
+
type: T_1;
|
|
3853
|
+
}> | Extract<AddConditionalFormatCommand, {
|
|
3854
|
+
type: T_1;
|
|
3855
|
+
}> | Extract<RemoveConditionalFormatCommand, {
|
|
3856
|
+
type: T_1;
|
|
3857
|
+
}> | Extract<RemoveColumnsCommand, {
|
|
3858
|
+
type: T_1;
|
|
3859
|
+
}> | Extract<RemoveRowsCommand, {
|
|
3860
|
+
type: T_1;
|
|
3861
|
+
}> | Extract<AddColumnsCommand, {
|
|
3862
|
+
type: T_1;
|
|
3863
|
+
}> | Extract<AddRowsCommand, {
|
|
3864
|
+
type: T_1;
|
|
3865
|
+
}> | Extract<CopyCommand, {
|
|
3866
|
+
type: T_1;
|
|
3867
|
+
}> | Extract<CutCommand, {
|
|
3868
|
+
type: T_1;
|
|
3869
|
+
}> | Extract<PasteCommand, {
|
|
3870
|
+
type: T_1;
|
|
3871
|
+
}> | Extract<PasteCellCommand, {
|
|
3872
|
+
type: T_1;
|
|
3873
|
+
}> | Extract<AutoFillCellCommand, {
|
|
3874
|
+
type: T_1;
|
|
3875
|
+
}> | Extract<ActivatePaintFormatCommand, {
|
|
3876
|
+
type: T_1;
|
|
3877
|
+
}> | Extract<PasteFromOSClipboardCommand, {
|
|
3878
|
+
type: T_1;
|
|
3879
|
+
}> | Extract<AutoresizeColumnsCommand, {
|
|
3880
|
+
type: T_1;
|
|
3881
|
+
}> | Extract<AutoresizeRowsCommand, {
|
|
3882
|
+
type: T_1;
|
|
3883
|
+
}> | Extract<MovePositionCommand, {
|
|
3884
|
+
type: T_1;
|
|
3885
|
+
}> | Extract<ActivateSheetCommand, {
|
|
3886
|
+
type: T_1;
|
|
3887
|
+
}> | Extract<SelectCellCommand, {
|
|
3888
|
+
type: T_1;
|
|
3889
|
+
}> | Extract<SetSelectionCommand, {
|
|
3890
|
+
type: T_1;
|
|
3891
|
+
}> | Extract<StartSelectionCommand, {
|
|
3892
|
+
type: T_1;
|
|
3893
|
+
}> | Extract<PrepareExpansionCommand, {
|
|
3894
|
+
type: T_1;
|
|
3895
|
+
}> | Extract<StartExpansionCommand, {
|
|
3896
|
+
type: T_1;
|
|
3897
|
+
}> | Extract<StopSelectionCommand, {
|
|
3898
|
+
type: T_1;
|
|
3899
|
+
}> | Extract<HighlightSelectionCommand, {
|
|
3900
|
+
type: T_1;
|
|
3901
|
+
}> | Extract<AddPendingHighlightCommand, {
|
|
3902
|
+
type: T_1;
|
|
3903
|
+
}> | Extract<ResetPendingHighlightCommand, {
|
|
3904
|
+
type: T_1;
|
|
3905
|
+
}> | Extract<SetColorCommand, {
|
|
3906
|
+
type: T_1;
|
|
3907
|
+
}> | Extract<SelectColumnCommand, {
|
|
3908
|
+
type: T_1;
|
|
3909
|
+
}> | Extract<SelectRowCommand, {
|
|
3910
|
+
type: T_1;
|
|
3911
|
+
}> | Extract<SelectAllCommand, {
|
|
3912
|
+
type: T_1;
|
|
3913
|
+
}> | Extract<AlterSelectionCommand, {
|
|
3914
|
+
type: T_1;
|
|
3915
|
+
}> | Extract<EvaluateCellsCommand, {
|
|
3916
|
+
type: T_1;
|
|
3917
|
+
}> | Extract<AddHighlightsCommand, {
|
|
3918
|
+
type: T_1;
|
|
3919
|
+
}> | Extract<RemoveHighlightsCommand, {
|
|
3920
|
+
type: T_1;
|
|
3921
|
+
}> | Extract<RemoveAllHighlightsCommand, {
|
|
3922
|
+
type: T_1;
|
|
3923
|
+
}> | Extract<StartComposerSelectionCommand, {
|
|
3924
|
+
type: T_1;
|
|
3925
|
+
}> | Extract<StopComposerSelectionCommand, {
|
|
3926
|
+
type: T_1;
|
|
3927
|
+
}> | Extract<StartEditionCommand, {
|
|
3928
|
+
type: T_1;
|
|
3929
|
+
}> | Extract<StopEditionCommand, {
|
|
3930
|
+
type: T_1;
|
|
3931
|
+
}> | Extract<SetCurrentContentCommand, {
|
|
3932
|
+
type: T_1;
|
|
3933
|
+
}> | Extract<SetValueCommand, {
|
|
3934
|
+
type: T_1;
|
|
3935
|
+
}> | Extract<ShowFormulaCommand, {
|
|
3936
|
+
type: T_1;
|
|
3937
|
+
}> | Extract<DeleteContentCommand, {
|
|
3938
|
+
type: T_1;
|
|
3939
|
+
}> | Extract<ClearCellCommand, {
|
|
3940
|
+
type: T_1;
|
|
3941
|
+
}> | Extract<UndoCommand, {
|
|
3942
|
+
type: T_1;
|
|
3943
|
+
}> | Extract<RedoCommand, {
|
|
3944
|
+
type: T_1;
|
|
3945
|
+
}> | Extract<StartCommand, {
|
|
3946
|
+
type: T_1;
|
|
3947
|
+
}> | Extract<AutofillCommand, {
|
|
3948
|
+
type: T_1;
|
|
3949
|
+
}> | Extract<AutofillSelectCommand, {
|
|
3950
|
+
type: T_1;
|
|
3951
|
+
}> | Extract<AutofillAutoCommand, {
|
|
3952
|
+
type: T_1;
|
|
3953
|
+
}> | Extract<NewInputCommand, {
|
|
3954
|
+
type: T_1;
|
|
3955
|
+
}> | Extract<RemoveInputCommand, {
|
|
3956
|
+
type: T_1;
|
|
3957
|
+
}> | Extract<FocusInputCommand, {
|
|
3958
|
+
type: T_1;
|
|
3959
|
+
}> | Extract<AddEmptyRangeCommand, {
|
|
3960
|
+
type: T_1;
|
|
3961
|
+
}> | Extract<RemoveRangeCommand, {
|
|
3962
|
+
type: T_1;
|
|
3963
|
+
}> | Extract<ChangeRangeCommand, {
|
|
3964
|
+
type: T_1;
|
|
3965
|
+
}> | Extract<CreateFigureCommand, {
|
|
3966
|
+
type: T_1;
|
|
3967
|
+
}> | Extract<SelectFigureCommand, {
|
|
3968
|
+
type: T_1;
|
|
3969
|
+
}> | Extract<UpdateFigureCommand, {
|
|
3970
|
+
type: T_1;
|
|
3971
|
+
}> | Extract<DeleteFigureCommand, {
|
|
3972
|
+
type: T_1;
|
|
3973
|
+
}> | Extract<CreateChartCommand, {
|
|
3974
|
+
type: T_1;
|
|
3975
|
+
}> | Extract<UpdateChartCommand, {
|
|
3976
|
+
type: T_1;
|
|
3977
|
+
}>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
|
|
3978
|
+
};
|
|
3979
|
+
getters: Getters;
|
|
3980
|
+
style: Style;
|
|
3981
|
+
state: State;
|
|
3982
|
+
isSelectingMenu: boolean;
|
|
3983
|
+
openedEl: HTMLElement | null;
|
|
3984
|
+
inMerge: boolean;
|
|
3985
|
+
cannotMerge: boolean;
|
|
3986
|
+
undoTool: boolean;
|
|
3987
|
+
redoTool: boolean;
|
|
3988
|
+
paintFormatTool: boolean;
|
|
3989
|
+
fillColor: string;
|
|
3990
|
+
textColor: string;
|
|
3991
|
+
menus: FullMenuItem[];
|
|
3992
|
+
private menuRef;
|
|
3993
|
+
constructor();
|
|
3994
|
+
get topbarComponents(): TopbarComponent[];
|
|
3995
|
+
willStart(): Promise<void>;
|
|
3996
|
+
willUpdateProps(): Promise<void>;
|
|
3997
|
+
onClick(ev: MouseEvent): void;
|
|
3998
|
+
toogleStyle(style: string): void;
|
|
3999
|
+
toogleFormat(format: string): void;
|
|
4000
|
+
toggleAlign(align: Align): void;
|
|
4001
|
+
onMenuMouseOver(menu: FullMenuItem, ev: MouseEvent): void;
|
|
4002
|
+
toggleDropdownTool(tool: Tool, ev: MouseEvent): void;
|
|
4003
|
+
toggleContextMenu(menu: FullMenuItem, ev: MouseEvent): void;
|
|
4004
|
+
closeMenus(): void;
|
|
4005
|
+
updateCellState(): void;
|
|
4006
|
+
getMenuName(menu: FullMenuItem): string;
|
|
4007
|
+
toggleMerge(): void;
|
|
4008
|
+
setColor(target: string, ev: CustomEvent): void;
|
|
4009
|
+
setBorder(command: BorderCommand): void;
|
|
4010
|
+
setFormat(ev: MouseEvent): void;
|
|
4011
|
+
setDecimal(step: number): void;
|
|
4012
|
+
paintFormat(): void;
|
|
4013
|
+
clearFormatting(): void;
|
|
4014
|
+
setSize(ev: MouseEvent): void;
|
|
4015
|
+
doAction(action: (env: SpreadsheetEnv) => void): void;
|
|
4016
|
+
undo(): void;
|
|
4017
|
+
redo(): void;
|
|
4018
|
+
}
|
|
4019
|
+
|
|
4020
|
+
declare const Component: typeof owl.Component;
|
|
4021
|
+
interface Props {
|
|
4022
|
+
data?: any;
|
|
4023
|
+
}
|
|
4024
|
+
declare class Spreadsheet extends Component<Props> {
|
|
4025
|
+
static template: string;
|
|
4026
|
+
static style: string;
|
|
4027
|
+
static components: {
|
|
4028
|
+
TopBar: typeof TopBar;
|
|
4029
|
+
Grid: typeof Grid;
|
|
4030
|
+
BottomBar: typeof BottomBar;
|
|
4031
|
+
SidePanel: typeof SidePanel;
|
|
4032
|
+
};
|
|
4033
|
+
static _t: (s: string) => string;
|
|
4034
|
+
model: Model;
|
|
4035
|
+
private grid;
|
|
4036
|
+
sidePanel: {
|
|
4037
|
+
isOpen: boolean;
|
|
4038
|
+
component?: string | undefined;
|
|
4039
|
+
panelProps: any;
|
|
4040
|
+
};
|
|
4041
|
+
private clipBoardString;
|
|
4042
|
+
constructor();
|
|
4043
|
+
mounted(): void;
|
|
4044
|
+
willUnmount(): void;
|
|
4045
|
+
destroy(): void;
|
|
4046
|
+
openSidePanel(panel: string, panelProps: any): void;
|
|
4047
|
+
toggleSidePanel(panel: string, panelProps: any): void;
|
|
4048
|
+
focusGrid(): void;
|
|
4049
|
+
copy(cut: boolean, ev: ClipboardEvent): void;
|
|
4050
|
+
paste(ev: ClipboardEvent): void;
|
|
4051
|
+
save(): void;
|
|
4052
|
+
onKeyup(ev: KeyboardEvent): void;
|
|
4053
|
+
onKeydown(ev: KeyboardEvent): void;
|
|
4054
|
+
}
|
|
4055
|
+
|
|
4056
|
+
/**
|
|
4057
|
+
* We export here all entities that needs to be accessed publicly by Odoo.
|
|
4058
|
+
*
|
|
4059
|
+
* Note that the __info__ key is actually completed by the build process (see
|
|
4060
|
+
* the rollup.config.js file)
|
|
4061
|
+
*/
|
|
4062
|
+
declare const __info__: {};
|
|
4063
|
+
|
|
4064
|
+
declare const SPREADSHEET_DIMENSIONS: {
|
|
4065
|
+
MIN_ROW_HEIGHT: number;
|
|
4066
|
+
MIN_COL_WIDTH: number;
|
|
4067
|
+
HEADER_HEIGHT: number;
|
|
4068
|
+
HEADER_WIDTH: number;
|
|
4069
|
+
TOPBAR_HEIGHT: number;
|
|
4070
|
+
BOTTOMBAR_HEIGHT: number;
|
|
4071
|
+
DEFAULT_CELL_WIDTH: number;
|
|
4072
|
+
DEFAULT_CELL_HEIGHT: number;
|
|
4073
|
+
SCROLLBAR_WIDTH: number;
|
|
4074
|
+
};
|
|
4075
|
+
declare const registries: {
|
|
4076
|
+
autofillModifiersRegistry: Registry<AutofillModifierImplementation>;
|
|
4077
|
+
autofillRulesRegistry: Registry<AutofillRule>;
|
|
4078
|
+
cellMenuRegistry: MenuItemRegistry;
|
|
4079
|
+
colMenuRegistry: MenuItemRegistry;
|
|
4080
|
+
functionRegistry: FunctionRegistry;
|
|
4081
|
+
pluginRegistry: Registry<typeof BasePlugin>;
|
|
4082
|
+
rowMenuRegistry: MenuItemRegistry;
|
|
4083
|
+
sidePanelRegistry: Registry<SidePanelContent>;
|
|
4084
|
+
sheetMenuRegistry: MenuItemRegistry;
|
|
4085
|
+
topbarMenuRegistry: MenuItemRegistry;
|
|
4086
|
+
topbarComponentRegistry: Registry<TopbarComponent>;
|
|
4087
|
+
};
|
|
4088
|
+
declare const helpers: {
|
|
4089
|
+
args: typeof args;
|
|
4090
|
+
toBoolean: typeof toBoolean;
|
|
4091
|
+
toNumber: typeof toNumber;
|
|
4092
|
+
toString: typeof toString;
|
|
4093
|
+
toXC: typeof toXC;
|
|
4094
|
+
toZone: typeof toZone;
|
|
4095
|
+
toCartesian: typeof toCartesian;
|
|
4096
|
+
numberToLetters: typeof numberToLetters;
|
|
4097
|
+
createFullMenuItem: typeof createFullMenuItem;
|
|
4098
|
+
uuidv4: typeof uuidv4;
|
|
4099
|
+
formatDecimal: typeof formatDecimal;
|
|
4100
|
+
};
|
|
4101
|
+
|
|
4102
|
+
export { BasePlugin, Model, SPREADSHEET_DIMENSIONS, Spreadsheet, DEBUG as __DEBUG__, __info__, astToFormula, functionCache, helpers, normalize, parse, registries, setTranslationMethod };
|