@odoo/o-spreadsheet 14.0.1 → 14.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/o-spreadsheet.cjs.js +17880 -0
  2. package/dist/o-spreadsheet.d.ts +4119 -0
  3. package/dist/o-spreadsheet.esm.js +17845 -0
  4. package/dist/o-spreadsheet.iife.js +17882 -0
  5. package/dist/o-spreadsheet.iife.min.js +1446 -0
  6. package/package.json +32 -9
  7. package/readme.md +10 -0
  8. package/.eslintrc.json +0 -20
  9. package/.husky/post-checkout +0 -9
  10. package/.husky/pre-commit +0 -39
  11. package/.prettierignore +0 -1
  12. package/astToFormula.patch +0 -0
  13. package/demo/data.js +0 -255
  14. package/demo/index.html +0 -9
  15. package/demo/libs/Chart.bundle.js +0 -20755
  16. package/demo/main.js +0 -101
  17. package/doc/readme.md +0 -46
  18. package/rollup.config.js +0 -23
  19. package/src/base_plugin.ts +0 -102
  20. package/src/components/autofill.ts +0 -146
  21. package/src/components/bottom_bar.ts +0 -199
  22. package/src/components/color_picker.ts +0 -150
  23. package/src/components/composer/autocomplete_dropdown.ts +0 -135
  24. package/src/components/composer/composer.ts +0 -487
  25. package/src/components/composer/content_editable_helper.ts +0 -146
  26. package/src/components/figures/chart.ts +0 -70
  27. package/src/components/figures/container.ts +0 -268
  28. package/src/components/figures/text_figure.ts +0 -36
  29. package/src/components/grid.ts +0 -635
  30. package/src/components/helpers/dom_helpers.ts +0 -7
  31. package/src/components/helpers/drag_and_drop.ts +0 -17
  32. package/src/components/icons.ts +0 -36
  33. package/src/components/index.ts +0 -1
  34. package/src/components/menu.ts +0 -288
  35. package/src/components/overlay.ts +0 -457
  36. package/src/components/scrollbar.ts +0 -22
  37. package/src/components/selection_input.ts +0 -168
  38. package/src/components/side_panel/cell_is_rule_editor.ts +0 -169
  39. package/src/components/side_panel/chart_panel.ts +0 -104
  40. package/src/components/side_panel/color_scale_rule_editor.ts +0 -145
  41. package/src/components/side_panel/conditional_formatting.ts +0 -396
  42. package/src/components/side_panel/side_panel.ts +0 -127
  43. package/src/components/side_panel/translations_terms.ts +0 -45
  44. package/src/components/spreadsheet.ts +0 -198
  45. package/src/components/top_bar.ts +0 -535
  46. package/src/constants.ts +0 -26
  47. package/src/data.ts +0 -149
  48. package/src/fonts.ts +0 -41
  49. package/src/formulas/compiler.ts +0 -258
  50. package/src/formulas/composer_tokenizer.ts +0 -70
  51. package/src/formulas/index.ts +0 -15
  52. package/src/formulas/normalize.ts +0 -52
  53. package/src/formulas/parser.ts +0 -280
  54. package/src/formulas/range_tokenizer.ts +0 -97
  55. package/src/formulas/tokenizer.ts +0 -242
  56. package/src/functions/arguments.ts +0 -114
  57. package/src/functions/dates.ts +0 -302
  58. package/src/functions/helpers.ts +0 -592
  59. package/src/functions/index.ts +0 -52
  60. package/src/functions/module_database.ts +0 -282
  61. package/src/functions/module_date.ts +0 -743
  62. package/src/functions/module_info.ts +0 -69
  63. package/src/functions/module_logical.ts +0 -208
  64. package/src/functions/module_lookup.ts +0 -185
  65. package/src/functions/module_math.ts +0 -1252
  66. package/src/functions/module_operators.ts +0 -291
  67. package/src/functions/module_statistical.ts +0 -882
  68. package/src/functions/module_text.ts +0 -370
  69. package/src/helpers/color.ts +0 -30
  70. package/src/helpers/coordinates.ts +0 -71
  71. package/src/helpers/grid_manipulation.ts +0 -68
  72. package/src/helpers/index.ts +0 -7
  73. package/src/helpers/misc.ts +0 -76
  74. package/src/helpers/numbers.ts +0 -117
  75. package/src/helpers/uuid.ts +0 -19
  76. package/src/helpers/zones.ts +0 -263
  77. package/src/history.ts +0 -186
  78. package/src/index.ts +0 -84
  79. package/src/model.ts +0 -261
  80. package/src/plugins/autofill.ts +0 -412
  81. package/src/plugins/chart.ts +0 -404
  82. package/src/plugins/clipboard.ts +0 -461
  83. package/src/plugins/conditional_format.ts +0 -445
  84. package/src/plugins/core.ts +0 -1502
  85. package/src/plugins/edition.ts +0 -157
  86. package/src/plugins/evaluation.ts +0 -428
  87. package/src/plugins/figures.ts +0 -123
  88. package/src/plugins/formatting.ts +0 -630
  89. package/src/plugins/highlight.ts +0 -187
  90. package/src/plugins/index.ts +0 -32
  91. package/src/plugins/merge.ts +0 -524
  92. package/src/plugins/renderer.ts +0 -571
  93. package/src/plugins/selection.ts +0 -562
  94. package/src/plugins/selection_inputs.ts +0 -326
  95. package/src/registries/autofill_modifiers.ts +0 -76
  96. package/src/registries/autofill_rules.ts +0 -98
  97. package/src/registries/figure_registry.ts +0 -30
  98. package/src/registries/index.ts +0 -7
  99. package/src/registries/menu_items_registry.ts +0 -110
  100. package/src/registries/menus/cell_menu_registry.ts +0 -79
  101. package/src/registries/menus/col_menu_registry.ts +0 -63
  102. package/src/registries/menus/index.ts +0 -6
  103. package/src/registries/menus/menu_items_actions.ts +0 -425
  104. package/src/registries/menus/row_menu_registry.ts +0 -63
  105. package/src/registries/menus/sheet_menu_registry.ts +0 -75
  106. package/src/registries/menus/topbar_menu_registry.ts +0 -204
  107. package/src/registries/side_panel_registry.ts +0 -26
  108. package/src/registries/topbar_component_registry.ts +0 -12
  109. package/src/registry.ts +0 -51
  110. package/src/translation.ts +0 -44
  111. package/src/types/autofill.ts +0 -48
  112. package/src/types/chart.ts +0 -26
  113. package/src/types/commands.ts +0 -716
  114. package/src/types/conditional_formatting.ts +0 -124
  115. package/src/types/env.ts +0 -13
  116. package/src/types/functions.ts +0 -35
  117. package/src/types/getters.ts +0 -103
  118. package/src/types/index.ts +0 -20
  119. package/src/types/misc.ts +0 -143
  120. package/src/types/rendering.ts +0 -41
  121. package/src/types/workbook_data.ts +0 -62
  122. package/tests/__mocks__/uuid.ts +0 -7
  123. package/tests/canvas.mock.ts +0 -34
  124. package/tests/components/__mocks__/content_editable_helper.ts +0 -79
  125. package/tests/components/__mocks__/scrollbar.ts +0 -18
  126. package/tests/components/__snapshots__/autocomplete_dropdown_test.ts.snap +0 -29
  127. package/tests/components/__snapshots__/bottom_bar_test.ts.snap +0 -75
  128. package/tests/components/__snapshots__/context_menu_test.ts.snap +0 -88
  129. package/tests/components/__snapshots__/grid_test.ts.snap +0 -60
  130. package/tests/components/__snapshots__/spreadsheet_test.ts.snap +0 -455
  131. package/tests/components/__snapshots__/top_bar_test.ts.snap +0 -705
  132. package/tests/components/autocomplete_dropdown_test.ts +0 -315
  133. package/tests/components/autofill_test.ts +0 -167
  134. package/tests/components/bottom_bar_test.ts +0 -262
  135. package/tests/components/chart_side_panel_test.ts +0 -123
  136. package/tests/components/composer_test.ts +0 -400
  137. package/tests/components/context_menu_test.ts +0 -825
  138. package/tests/components/grid_manipulation_test.ts +0 -163
  139. package/tests/components/grid_test.ts +0 -581
  140. package/tests/components/overlay_test.ts +0 -541
  141. package/tests/components/selection_input_test.ts +0 -259
  142. package/tests/components/side_panel_test.ts +0 -148
  143. package/tests/components/spreadsheet_test.ts +0 -194
  144. package/tests/components/top_bar_test.ts +0 -427
  145. package/tests/data_test.ts +0 -175
  146. package/tests/dom_helper.ts +0 -42
  147. package/tests/formulas/__snapshots__/compiler_test.ts.snap +0 -302
  148. package/tests/formulas/compiler_test.ts +0 -266
  149. package/tests/formulas/composer_tokenizer_test.ts +0 -137
  150. package/tests/formulas/expressions_test.ts +0 -57
  151. package/tests/formulas/formulas_test.ts +0 -80
  152. package/tests/formulas/normalize_test.ts +0 -82
  153. package/tests/formulas/parser_test.ts +0 -224
  154. package/tests/formulas/range_tokenizer_test.ts +0 -187
  155. package/tests/formulas/tokenizer_test.ts +0 -164
  156. package/tests/functions/arguments_test.ts +0 -141
  157. package/tests/functions/dates_test.ts +0 -1081
  158. package/tests/functions/functions_test.ts +0 -53
  159. package/tests/functions/helper_test.ts +0 -98
  160. package/tests/functions/module_database_test.ts +0 -311
  161. package/tests/functions/module_date_test.ts +0 -941
  162. package/tests/functions/module_info_test.ts +0 -139
  163. package/tests/functions/module_logical_test.ts +0 -369
  164. package/tests/functions/module_lookup_test.ts +0 -541
  165. package/tests/functions/module_math_test.ts +0 -2482
  166. package/tests/functions/module_operators_test.ts +0 -955
  167. package/tests/functions/module_statistical_test.ts +0 -2014
  168. package/tests/functions/module_text_test.ts +0 -667
  169. package/tests/helpers/coordinates_test.ts +0 -25
  170. package/tests/helpers/misc_test.ts +0 -95
  171. package/tests/helpers/numbers_test.ts +0 -196
  172. package/tests/helpers/zones_test.ts +0 -97
  173. package/tests/helpers.ts +0 -384
  174. package/tests/menu_items_registry_test.ts +0 -540
  175. package/tests/model/plugins/__snapshots__/chart_test.ts.snap +0 -90
  176. package/tests/model/plugins/chart_test.ts +0 -562
  177. package/tests/model_test.ts +0 -82
  178. package/tests/plugins/__snapshots__/conditional_formatting_test.ts.snap +0 -131
  179. package/tests/plugins/__snapshots__/renderer_test.ts.snap +0 -371
  180. package/tests/plugins/autofill_test.ts +0 -457
  181. package/tests/plugins/borders_test.ts +0 -295
  182. package/tests/plugins/clipboard_test.ts +0 -1180
  183. package/tests/plugins/conditional_formatting_test.ts +0 -1253
  184. package/tests/plugins/core_test.ts +0 -614
  185. package/tests/plugins/edition_test.ts +0 -100
  186. package/tests/plugins/evaluation_async_test.ts +0 -332
  187. package/tests/plugins/evaluation_dates_test.ts +0 -79
  188. package/tests/plugins/evaluation_test.ts +0 -901
  189. package/tests/plugins/figures_test.ts +0 -327
  190. package/tests/plugins/formatting_test.ts +0 -391
  191. package/tests/plugins/grid_manipulation_test.ts +0 -1366
  192. package/tests/plugins/highlight_test.ts +0 -413
  193. package/tests/plugins/history_test.ts +0 -142
  194. package/tests/plugins/import_export_test.ts +0 -276
  195. package/tests/plugins/merges_test.ts +0 -490
  196. package/tests/plugins/navigation_test.ts +0 -181
  197. package/tests/plugins/plugins/evaluation_test.ts +0 -111
  198. package/tests/plugins/renderer_test.ts +0 -598
  199. package/tests/plugins/resizing_test.ts +0 -152
  200. package/tests/plugins/selection_input_test.ts +0 -409
  201. package/tests/plugins/selection_test.ts +0 -442
  202. package/tests/plugins/sheets_test.ts +0 -643
  203. package/tests/plugins/style_test.ts +0 -90
  204. package/tsconfig.json +0 -22
@@ -0,0 +1,4119 @@
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
+ /**
2425
+ * Computes the text 'index' inside this.el based on the currently selected node and its offset.
2426
+ * The selected node is either a Text node or an Element node.
2427
+ *
2428
+ * case 1 -Text node:
2429
+ * the offset is the number of characters from the start of the node. We have to add this offset to the
2430
+ * content length of all previous nodes.
2431
+ *
2432
+ * case 2 - Element node:
2433
+ * the offset is the number of child nodes before the selected node. We have to add the content length of
2434
+ * all the bnodes prior to the selected node as well as the content of the child node before the offset.
2435
+ *
2436
+ * See the MDN documentation for more details.
2437
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/startOffset
2438
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/endOffset
2439
+ *
2440
+ */
2441
+ private findSelectionIndex;
2442
+ private getStartAndEndSelection;
2443
+ }
2444
+
2445
+ declare const Component$6: typeof owl.Component;
2446
+ declare class Composer extends Component$6<any, SpreadsheetEnv> {
2447
+ static template: string;
2448
+ static style: string;
2449
+ static components: {
2450
+ TextValueProvider: typeof TextValueProvider;
2451
+ };
2452
+ private composerRef;
2453
+ private autoCompleteRef;
2454
+ getters: Getters;
2455
+ dispatch: {
2456
+ <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, {
2457
+ type: T;
2458
+ }> | Extract<ResizeColumnsCommand, {
2459
+ type: T;
2460
+ }> | Extract<ResizeRowsCommand, {
2461
+ type: T;
2462
+ }> | Extract<CreateSheetCommand, {
2463
+ type: T;
2464
+ }> | Extract<MoveSheetCommand, {
2465
+ type: T;
2466
+ }> | Extract<RenameSheetCommand, {
2467
+ type: T;
2468
+ }> | Extract<DuplicateSheetCommand, {
2469
+ type: T;
2470
+ }> | Extract<DeleteSheetCommand, {
2471
+ type: T;
2472
+ }> | Extract<DeleteSheetConfirmationCommand, {
2473
+ type: T;
2474
+ }> | Extract<AddMergeCommand, {
2475
+ type: T;
2476
+ }> | Extract<RemoveMergeCommand, {
2477
+ type: T;
2478
+ }> | Extract<AddFormattingCommand, {
2479
+ type: T;
2480
+ }> | Extract<ClearFormattingCommand, {
2481
+ type: T;
2482
+ }> | Extract<SetFormatterCommand, {
2483
+ type: T;
2484
+ }> | Extract<SetDecimalCommand, {
2485
+ type: T;
2486
+ }> | Extract<AddConditionalFormatCommand, {
2487
+ type: T;
2488
+ }> | Extract<RemoveConditionalFormatCommand, {
2489
+ type: T;
2490
+ }> | Extract<RemoveColumnsCommand, {
2491
+ type: T;
2492
+ }> | Extract<RemoveRowsCommand, {
2493
+ type: T;
2494
+ }> | Extract<AddColumnsCommand, {
2495
+ type: T;
2496
+ }> | Extract<AddRowsCommand, {
2497
+ type: T;
2498
+ }> | Extract<CopyCommand, {
2499
+ type: T;
2500
+ }> | Extract<CutCommand, {
2501
+ type: T;
2502
+ }> | Extract<PasteCommand, {
2503
+ type: T;
2504
+ }> | Extract<PasteCellCommand, {
2505
+ type: T;
2506
+ }> | Extract<AutoFillCellCommand, {
2507
+ type: T;
2508
+ }> | Extract<ActivatePaintFormatCommand, {
2509
+ type: T;
2510
+ }> | Extract<PasteFromOSClipboardCommand, {
2511
+ type: T;
2512
+ }> | Extract<AutoresizeColumnsCommand, {
2513
+ type: T;
2514
+ }> | Extract<AutoresizeRowsCommand, {
2515
+ type: T;
2516
+ }> | Extract<MovePositionCommand, {
2517
+ type: T;
2518
+ }> | Extract<ActivateSheetCommand, {
2519
+ type: T;
2520
+ }> | Extract<SelectCellCommand, {
2521
+ type: T;
2522
+ }> | Extract<SetSelectionCommand, {
2523
+ type: T;
2524
+ }> | Extract<StartSelectionCommand, {
2525
+ type: T;
2526
+ }> | Extract<PrepareExpansionCommand, {
2527
+ type: T;
2528
+ }> | Extract<StartExpansionCommand, {
2529
+ type: T;
2530
+ }> | Extract<StopSelectionCommand, {
2531
+ type: T;
2532
+ }> | Extract<HighlightSelectionCommand, {
2533
+ type: T;
2534
+ }> | Extract<AddPendingHighlightCommand, {
2535
+ type: T;
2536
+ }> | Extract<ResetPendingHighlightCommand, {
2537
+ type: T;
2538
+ }> | Extract<SetColorCommand, {
2539
+ type: T;
2540
+ }> | Extract<SelectColumnCommand, {
2541
+ type: T;
2542
+ }> | Extract<SelectRowCommand, {
2543
+ type: T;
2544
+ }> | Extract<SelectAllCommand, {
2545
+ type: T;
2546
+ }> | Extract<AlterSelectionCommand, {
2547
+ type: T;
2548
+ }> | Extract<EvaluateCellsCommand, {
2549
+ type: T;
2550
+ }> | Extract<AddHighlightsCommand, {
2551
+ type: T;
2552
+ }> | Extract<RemoveHighlightsCommand, {
2553
+ type: T;
2554
+ }> | Extract<RemoveAllHighlightsCommand, {
2555
+ type: T;
2556
+ }> | Extract<StartComposerSelectionCommand, {
2557
+ type: T;
2558
+ }> | Extract<StopComposerSelectionCommand, {
2559
+ type: T;
2560
+ }> | Extract<StartEditionCommand, {
2561
+ type: T;
2562
+ }> | Extract<StopEditionCommand, {
2563
+ type: T;
2564
+ }> | Extract<SetCurrentContentCommand, {
2565
+ type: T;
2566
+ }> | Extract<SetValueCommand, {
2567
+ type: T;
2568
+ }> | Extract<ShowFormulaCommand, {
2569
+ type: T;
2570
+ }> | Extract<DeleteContentCommand, {
2571
+ type: T;
2572
+ }> | Extract<ClearCellCommand, {
2573
+ type: T;
2574
+ }> | Extract<UndoCommand, {
2575
+ type: T;
2576
+ }> | Extract<RedoCommand, {
2577
+ type: T;
2578
+ }> | Extract<StartCommand, {
2579
+ type: T;
2580
+ }> | Extract<AutofillCommand, {
2581
+ type: T;
2582
+ }> | Extract<AutofillSelectCommand, {
2583
+ type: T;
2584
+ }> | Extract<AutofillAutoCommand, {
2585
+ type: T;
2586
+ }> | Extract<NewInputCommand, {
2587
+ type: T;
2588
+ }> | Extract<RemoveInputCommand, {
2589
+ type: T;
2590
+ }> | Extract<FocusInputCommand, {
2591
+ type: T;
2592
+ }> | Extract<AddEmptyRangeCommand, {
2593
+ type: T;
2594
+ }> | Extract<RemoveRangeCommand, {
2595
+ type: T;
2596
+ }> | Extract<ChangeRangeCommand, {
2597
+ type: T;
2598
+ }> | Extract<CreateFigureCommand, {
2599
+ type: T;
2600
+ }> | Extract<SelectFigureCommand, {
2601
+ type: T;
2602
+ }> | Extract<UpdateFigureCommand, {
2603
+ type: T;
2604
+ }> | Extract<DeleteFigureCommand, {
2605
+ type: T;
2606
+ }> | Extract<CreateChartCommand, {
2607
+ type: T;
2608
+ }> | Extract<UpdateChartCommand, {
2609
+ type: T;
2610
+ }>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
2611
+ <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, {
2612
+ type: T_1;
2613
+ }> | Extract<ResizeColumnsCommand, {
2614
+ type: T_1;
2615
+ }> | Extract<ResizeRowsCommand, {
2616
+ type: T_1;
2617
+ }> | Extract<CreateSheetCommand, {
2618
+ type: T_1;
2619
+ }> | Extract<MoveSheetCommand, {
2620
+ type: T_1;
2621
+ }> | Extract<RenameSheetCommand, {
2622
+ type: T_1;
2623
+ }> | Extract<DuplicateSheetCommand, {
2624
+ type: T_1;
2625
+ }> | Extract<DeleteSheetCommand, {
2626
+ type: T_1;
2627
+ }> | Extract<DeleteSheetConfirmationCommand, {
2628
+ type: T_1;
2629
+ }> | Extract<AddMergeCommand, {
2630
+ type: T_1;
2631
+ }> | Extract<RemoveMergeCommand, {
2632
+ type: T_1;
2633
+ }> | Extract<AddFormattingCommand, {
2634
+ type: T_1;
2635
+ }> | Extract<ClearFormattingCommand, {
2636
+ type: T_1;
2637
+ }> | Extract<SetFormatterCommand, {
2638
+ type: T_1;
2639
+ }> | Extract<SetDecimalCommand, {
2640
+ type: T_1;
2641
+ }> | Extract<AddConditionalFormatCommand, {
2642
+ type: T_1;
2643
+ }> | Extract<RemoveConditionalFormatCommand, {
2644
+ type: T_1;
2645
+ }> | Extract<RemoveColumnsCommand, {
2646
+ type: T_1;
2647
+ }> | Extract<RemoveRowsCommand, {
2648
+ type: T_1;
2649
+ }> | Extract<AddColumnsCommand, {
2650
+ type: T_1;
2651
+ }> | Extract<AddRowsCommand, {
2652
+ type: T_1;
2653
+ }> | Extract<CopyCommand, {
2654
+ type: T_1;
2655
+ }> | Extract<CutCommand, {
2656
+ type: T_1;
2657
+ }> | Extract<PasteCommand, {
2658
+ type: T_1;
2659
+ }> | Extract<PasteCellCommand, {
2660
+ type: T_1;
2661
+ }> | Extract<AutoFillCellCommand, {
2662
+ type: T_1;
2663
+ }> | Extract<ActivatePaintFormatCommand, {
2664
+ type: T_1;
2665
+ }> | Extract<PasteFromOSClipboardCommand, {
2666
+ type: T_1;
2667
+ }> | Extract<AutoresizeColumnsCommand, {
2668
+ type: T_1;
2669
+ }> | Extract<AutoresizeRowsCommand, {
2670
+ type: T_1;
2671
+ }> | Extract<MovePositionCommand, {
2672
+ type: T_1;
2673
+ }> | Extract<ActivateSheetCommand, {
2674
+ type: T_1;
2675
+ }> | Extract<SelectCellCommand, {
2676
+ type: T_1;
2677
+ }> | Extract<SetSelectionCommand, {
2678
+ type: T_1;
2679
+ }> | Extract<StartSelectionCommand, {
2680
+ type: T_1;
2681
+ }> | Extract<PrepareExpansionCommand, {
2682
+ type: T_1;
2683
+ }> | Extract<StartExpansionCommand, {
2684
+ type: T_1;
2685
+ }> | Extract<StopSelectionCommand, {
2686
+ type: T_1;
2687
+ }> | Extract<HighlightSelectionCommand, {
2688
+ type: T_1;
2689
+ }> | Extract<AddPendingHighlightCommand, {
2690
+ type: T_1;
2691
+ }> | Extract<ResetPendingHighlightCommand, {
2692
+ type: T_1;
2693
+ }> | Extract<SetColorCommand, {
2694
+ type: T_1;
2695
+ }> | Extract<SelectColumnCommand, {
2696
+ type: T_1;
2697
+ }> | Extract<SelectRowCommand, {
2698
+ type: T_1;
2699
+ }> | Extract<SelectAllCommand, {
2700
+ type: T_1;
2701
+ }> | Extract<AlterSelectionCommand, {
2702
+ type: T_1;
2703
+ }> | Extract<EvaluateCellsCommand, {
2704
+ type: T_1;
2705
+ }> | Extract<AddHighlightsCommand, {
2706
+ type: T_1;
2707
+ }> | Extract<RemoveHighlightsCommand, {
2708
+ type: T_1;
2709
+ }> | Extract<RemoveAllHighlightsCommand, {
2710
+ type: T_1;
2711
+ }> | Extract<StartComposerSelectionCommand, {
2712
+ type: T_1;
2713
+ }> | Extract<StopComposerSelectionCommand, {
2714
+ type: T_1;
2715
+ }> | Extract<StartEditionCommand, {
2716
+ type: T_1;
2717
+ }> | Extract<StopEditionCommand, {
2718
+ type: T_1;
2719
+ }> | Extract<SetCurrentContentCommand, {
2720
+ type: T_1;
2721
+ }> | Extract<SetValueCommand, {
2722
+ type: T_1;
2723
+ }> | Extract<ShowFormulaCommand, {
2724
+ type: T_1;
2725
+ }> | Extract<DeleteContentCommand, {
2726
+ type: T_1;
2727
+ }> | Extract<ClearCellCommand, {
2728
+ type: T_1;
2729
+ }> | Extract<UndoCommand, {
2730
+ type: T_1;
2731
+ }> | Extract<RedoCommand, {
2732
+ type: T_1;
2733
+ }> | Extract<StartCommand, {
2734
+ type: T_1;
2735
+ }> | Extract<AutofillCommand, {
2736
+ type: T_1;
2737
+ }> | Extract<AutofillSelectCommand, {
2738
+ type: T_1;
2739
+ }> | Extract<AutofillAutoCommand, {
2740
+ type: T_1;
2741
+ }> | Extract<NewInputCommand, {
2742
+ type: T_1;
2743
+ }> | Extract<RemoveInputCommand, {
2744
+ type: T_1;
2745
+ }> | Extract<FocusInputCommand, {
2746
+ type: T_1;
2747
+ }> | Extract<AddEmptyRangeCommand, {
2748
+ type: T_1;
2749
+ }> | Extract<RemoveRangeCommand, {
2750
+ type: T_1;
2751
+ }> | Extract<ChangeRangeCommand, {
2752
+ type: T_1;
2753
+ }> | Extract<CreateFigureCommand, {
2754
+ type: T_1;
2755
+ }> | Extract<SelectFigureCommand, {
2756
+ type: T_1;
2757
+ }> | Extract<UpdateFigureCommand, {
2758
+ type: T_1;
2759
+ }> | Extract<DeleteFigureCommand, {
2760
+ type: T_1;
2761
+ }> | Extract<CreateChartCommand, {
2762
+ type: T_1;
2763
+ }> | Extract<UpdateChartCommand, {
2764
+ type: T_1;
2765
+ }>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
2766
+ };
2767
+ zone: Zone;
2768
+ rect: Rect;
2769
+ selectionEnd: number;
2770
+ selectionStart: number;
2771
+ contentHelper: ContentEditableHelper;
2772
+ autoCompleteState: {
2773
+ showProvider: boolean;
2774
+ provider: string;
2775
+ search: string;
2776
+ };
2777
+ tokenAtCursor: EnrichedToken | void;
2778
+ shouldProcessInputEvents: boolean;
2779
+ isDone: boolean;
2780
+ refSelectionStart: number;
2781
+ tokens: EnrichedToken[];
2782
+ keyMapping: {
2783
+ [key: string]: Function;
2784
+ };
2785
+ constructor();
2786
+ mounted(): void;
2787
+ willUnmount(): void;
2788
+ get containerStyle(): string;
2789
+ get composerStyle(): string;
2790
+ processArrowKeys(ev: KeyboardEvent): void;
2791
+ processTabKey(ev: KeyboardEvent): void;
2792
+ processEnterKey(ev: KeyboardEvent): void;
2793
+ processEscapeKey(): void;
2794
+ onKeydown(ev: KeyboardEvent): any;
2795
+ onInput(ev: KeyboardEvent): void;
2796
+ onKeyup(ev: KeyboardEvent): void;
2797
+ onClick(ev: MouseEvent): void;
2798
+ onCompleted(ev: CustomEvent): void;
2799
+ processContent(): void;
2800
+ /**
2801
+ * Compute the state of the composer from the tokenAtCursor.
2802
+ * If the token is a bool, function or symbol we have to initialize the autocomplete engine.
2803
+ * If it's a comma, left_paren or operator we have to initialize the range selection.
2804
+ */
2805
+ processTokenAtCursor(): void;
2806
+ addText(text: string): void;
2807
+ addTextFromSelection(): void;
2808
+ autoComplete(value: string): void;
2809
+ /**
2810
+ * Save the current selection
2811
+ */
2812
+ saveSelection(): void;
2813
+ }
2814
+
2815
+ interface FigureInfo {
2816
+ id: string;
2817
+ isSelected: boolean;
2818
+ figure: Figure<any>;
2819
+ }
2820
+ declare class FiguresContainer extends Component$a<{
2821
+ viewport: Viewport;
2822
+ }, SpreadsheetEnv> {
2823
+ static template: string;
2824
+ static style: string;
2825
+ static components: {};
2826
+ figureRegistry: Registry<FigureContent>;
2827
+ dnd: {
2828
+ figureId: string;
2829
+ x: number;
2830
+ y: number;
2831
+ width: number;
2832
+ height: number;
2833
+ };
2834
+ getters: Getters;
2835
+ dispatch: {
2836
+ <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, {
2837
+ type: T;
2838
+ }> | Extract<ResizeColumnsCommand, {
2839
+ type: T;
2840
+ }> | Extract<ResizeRowsCommand, {
2841
+ type: T;
2842
+ }> | Extract<CreateSheetCommand, {
2843
+ type: T;
2844
+ }> | Extract<MoveSheetCommand, {
2845
+ type: T;
2846
+ }> | Extract<RenameSheetCommand, {
2847
+ type: T;
2848
+ }> | Extract<DuplicateSheetCommand, {
2849
+ type: T;
2850
+ }> | Extract<DeleteSheetCommand, {
2851
+ type: T;
2852
+ }> | Extract<DeleteSheetConfirmationCommand, {
2853
+ type: T;
2854
+ }> | Extract<AddMergeCommand, {
2855
+ type: T;
2856
+ }> | Extract<RemoveMergeCommand, {
2857
+ type: T;
2858
+ }> | Extract<AddFormattingCommand, {
2859
+ type: T;
2860
+ }> | Extract<ClearFormattingCommand, {
2861
+ type: T;
2862
+ }> | Extract<SetFormatterCommand, {
2863
+ type: T;
2864
+ }> | Extract<SetDecimalCommand, {
2865
+ type: T;
2866
+ }> | Extract<AddConditionalFormatCommand, {
2867
+ type: T;
2868
+ }> | Extract<RemoveConditionalFormatCommand, {
2869
+ type: T;
2870
+ }> | Extract<RemoveColumnsCommand, {
2871
+ type: T;
2872
+ }> | Extract<RemoveRowsCommand, {
2873
+ type: T;
2874
+ }> | Extract<AddColumnsCommand, {
2875
+ type: T;
2876
+ }> | Extract<AddRowsCommand, {
2877
+ type: T;
2878
+ }> | Extract<CopyCommand, {
2879
+ type: T;
2880
+ }> | Extract<CutCommand, {
2881
+ type: T;
2882
+ }> | Extract<PasteCommand, {
2883
+ type: T;
2884
+ }> | Extract<PasteCellCommand, {
2885
+ type: T;
2886
+ }> | Extract<AutoFillCellCommand, {
2887
+ type: T;
2888
+ }> | Extract<ActivatePaintFormatCommand, {
2889
+ type: T;
2890
+ }> | Extract<PasteFromOSClipboardCommand, {
2891
+ type: T;
2892
+ }> | Extract<AutoresizeColumnsCommand, {
2893
+ type: T;
2894
+ }> | Extract<AutoresizeRowsCommand, {
2895
+ type: T;
2896
+ }> | Extract<MovePositionCommand, {
2897
+ type: T;
2898
+ }> | Extract<ActivateSheetCommand, {
2899
+ type: T;
2900
+ }> | Extract<SelectCellCommand, {
2901
+ type: T;
2902
+ }> | Extract<SetSelectionCommand, {
2903
+ type: T;
2904
+ }> | Extract<StartSelectionCommand, {
2905
+ type: T;
2906
+ }> | Extract<PrepareExpansionCommand, {
2907
+ type: T;
2908
+ }> | Extract<StartExpansionCommand, {
2909
+ type: T;
2910
+ }> | Extract<StopSelectionCommand, {
2911
+ type: T;
2912
+ }> | Extract<HighlightSelectionCommand, {
2913
+ type: T;
2914
+ }> | Extract<AddPendingHighlightCommand, {
2915
+ type: T;
2916
+ }> | Extract<ResetPendingHighlightCommand, {
2917
+ type: T;
2918
+ }> | Extract<SetColorCommand, {
2919
+ type: T;
2920
+ }> | Extract<SelectColumnCommand, {
2921
+ type: T;
2922
+ }> | Extract<SelectRowCommand, {
2923
+ type: T;
2924
+ }> | Extract<SelectAllCommand, {
2925
+ type: T;
2926
+ }> | Extract<AlterSelectionCommand, {
2927
+ type: T;
2928
+ }> | Extract<EvaluateCellsCommand, {
2929
+ type: T;
2930
+ }> | Extract<AddHighlightsCommand, {
2931
+ type: T;
2932
+ }> | Extract<RemoveHighlightsCommand, {
2933
+ type: T;
2934
+ }> | Extract<RemoveAllHighlightsCommand, {
2935
+ type: T;
2936
+ }> | Extract<StartComposerSelectionCommand, {
2937
+ type: T;
2938
+ }> | Extract<StopComposerSelectionCommand, {
2939
+ type: T;
2940
+ }> | Extract<StartEditionCommand, {
2941
+ type: T;
2942
+ }> | Extract<StopEditionCommand, {
2943
+ type: T;
2944
+ }> | Extract<SetCurrentContentCommand, {
2945
+ type: T;
2946
+ }> | Extract<SetValueCommand, {
2947
+ type: T;
2948
+ }> | Extract<ShowFormulaCommand, {
2949
+ type: T;
2950
+ }> | Extract<DeleteContentCommand, {
2951
+ type: T;
2952
+ }> | Extract<ClearCellCommand, {
2953
+ type: T;
2954
+ }> | Extract<UndoCommand, {
2955
+ type: T;
2956
+ }> | Extract<RedoCommand, {
2957
+ type: T;
2958
+ }> | Extract<StartCommand, {
2959
+ type: T;
2960
+ }> | Extract<AutofillCommand, {
2961
+ type: T;
2962
+ }> | Extract<AutofillSelectCommand, {
2963
+ type: T;
2964
+ }> | Extract<AutofillAutoCommand, {
2965
+ type: T;
2966
+ }> | Extract<NewInputCommand, {
2967
+ type: T;
2968
+ }> | Extract<RemoveInputCommand, {
2969
+ type: T;
2970
+ }> | Extract<FocusInputCommand, {
2971
+ type: T;
2972
+ }> | Extract<AddEmptyRangeCommand, {
2973
+ type: T;
2974
+ }> | Extract<RemoveRangeCommand, {
2975
+ type: T;
2976
+ }> | Extract<ChangeRangeCommand, {
2977
+ type: T;
2978
+ }> | Extract<CreateFigureCommand, {
2979
+ type: T;
2980
+ }> | Extract<SelectFigureCommand, {
2981
+ type: T;
2982
+ }> | Extract<UpdateFigureCommand, {
2983
+ type: T;
2984
+ }> | Extract<DeleteFigureCommand, {
2985
+ type: T;
2986
+ }> | Extract<CreateChartCommand, {
2987
+ type: T;
2988
+ }> | Extract<UpdateChartCommand, {
2989
+ type: T;
2990
+ }>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
2991
+ <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, {
2992
+ type: T_1;
2993
+ }> | Extract<ResizeColumnsCommand, {
2994
+ type: T_1;
2995
+ }> | Extract<ResizeRowsCommand, {
2996
+ type: T_1;
2997
+ }> | Extract<CreateSheetCommand, {
2998
+ type: T_1;
2999
+ }> | Extract<MoveSheetCommand, {
3000
+ type: T_1;
3001
+ }> | Extract<RenameSheetCommand, {
3002
+ type: T_1;
3003
+ }> | Extract<DuplicateSheetCommand, {
3004
+ type: T_1;
3005
+ }> | Extract<DeleteSheetCommand, {
3006
+ type: T_1;
3007
+ }> | Extract<DeleteSheetConfirmationCommand, {
3008
+ type: T_1;
3009
+ }> | Extract<AddMergeCommand, {
3010
+ type: T_1;
3011
+ }> | Extract<RemoveMergeCommand, {
3012
+ type: T_1;
3013
+ }> | Extract<AddFormattingCommand, {
3014
+ type: T_1;
3015
+ }> | Extract<ClearFormattingCommand, {
3016
+ type: T_1;
3017
+ }> | Extract<SetFormatterCommand, {
3018
+ type: T_1;
3019
+ }> | Extract<SetDecimalCommand, {
3020
+ type: T_1;
3021
+ }> | Extract<AddConditionalFormatCommand, {
3022
+ type: T_1;
3023
+ }> | Extract<RemoveConditionalFormatCommand, {
3024
+ type: T_1;
3025
+ }> | Extract<RemoveColumnsCommand, {
3026
+ type: T_1;
3027
+ }> | Extract<RemoveRowsCommand, {
3028
+ type: T_1;
3029
+ }> | Extract<AddColumnsCommand, {
3030
+ type: T_1;
3031
+ }> | Extract<AddRowsCommand, {
3032
+ type: T_1;
3033
+ }> | Extract<CopyCommand, {
3034
+ type: T_1;
3035
+ }> | Extract<CutCommand, {
3036
+ type: T_1;
3037
+ }> | Extract<PasteCommand, {
3038
+ type: T_1;
3039
+ }> | Extract<PasteCellCommand, {
3040
+ type: T_1;
3041
+ }> | Extract<AutoFillCellCommand, {
3042
+ type: T_1;
3043
+ }> | Extract<ActivatePaintFormatCommand, {
3044
+ type: T_1;
3045
+ }> | Extract<PasteFromOSClipboardCommand, {
3046
+ type: T_1;
3047
+ }> | Extract<AutoresizeColumnsCommand, {
3048
+ type: T_1;
3049
+ }> | Extract<AutoresizeRowsCommand, {
3050
+ type: T_1;
3051
+ }> | Extract<MovePositionCommand, {
3052
+ type: T_1;
3053
+ }> | Extract<ActivateSheetCommand, {
3054
+ type: T_1;
3055
+ }> | Extract<SelectCellCommand, {
3056
+ type: T_1;
3057
+ }> | Extract<SetSelectionCommand, {
3058
+ type: T_1;
3059
+ }> | Extract<StartSelectionCommand, {
3060
+ type: T_1;
3061
+ }> | Extract<PrepareExpansionCommand, {
3062
+ type: T_1;
3063
+ }> | Extract<StartExpansionCommand, {
3064
+ type: T_1;
3065
+ }> | Extract<StopSelectionCommand, {
3066
+ type: T_1;
3067
+ }> | Extract<HighlightSelectionCommand, {
3068
+ type: T_1;
3069
+ }> | Extract<AddPendingHighlightCommand, {
3070
+ type: T_1;
3071
+ }> | Extract<ResetPendingHighlightCommand, {
3072
+ type: T_1;
3073
+ }> | Extract<SetColorCommand, {
3074
+ type: T_1;
3075
+ }> | Extract<SelectColumnCommand, {
3076
+ type: T_1;
3077
+ }> | Extract<SelectRowCommand, {
3078
+ type: T_1;
3079
+ }> | Extract<SelectAllCommand, {
3080
+ type: T_1;
3081
+ }> | Extract<AlterSelectionCommand, {
3082
+ type: T_1;
3083
+ }> | Extract<EvaluateCellsCommand, {
3084
+ type: T_1;
3085
+ }> | Extract<AddHighlightsCommand, {
3086
+ type: T_1;
3087
+ }> | Extract<RemoveHighlightsCommand, {
3088
+ type: T_1;
3089
+ }> | Extract<RemoveAllHighlightsCommand, {
3090
+ type: T_1;
3091
+ }> | Extract<StartComposerSelectionCommand, {
3092
+ type: T_1;
3093
+ }> | Extract<StopComposerSelectionCommand, {
3094
+ type: T_1;
3095
+ }> | Extract<StartEditionCommand, {
3096
+ type: T_1;
3097
+ }> | Extract<StopEditionCommand, {
3098
+ type: T_1;
3099
+ }> | Extract<SetCurrentContentCommand, {
3100
+ type: T_1;
3101
+ }> | Extract<SetValueCommand, {
3102
+ type: T_1;
3103
+ }> | Extract<ShowFormulaCommand, {
3104
+ type: T_1;
3105
+ }> | Extract<DeleteContentCommand, {
3106
+ type: T_1;
3107
+ }> | Extract<ClearCellCommand, {
3108
+ type: T_1;
3109
+ }> | Extract<UndoCommand, {
3110
+ type: T_1;
3111
+ }> | Extract<RedoCommand, {
3112
+ type: T_1;
3113
+ }> | Extract<StartCommand, {
3114
+ type: T_1;
3115
+ }> | Extract<AutofillCommand, {
3116
+ type: T_1;
3117
+ }> | Extract<AutofillSelectCommand, {
3118
+ type: T_1;
3119
+ }> | Extract<AutofillAutoCommand, {
3120
+ type: T_1;
3121
+ }> | Extract<NewInputCommand, {
3122
+ type: T_1;
3123
+ }> | Extract<RemoveInputCommand, {
3124
+ type: T_1;
3125
+ }> | Extract<FocusInputCommand, {
3126
+ type: T_1;
3127
+ }> | Extract<AddEmptyRangeCommand, {
3128
+ type: T_1;
3129
+ }> | Extract<RemoveRangeCommand, {
3130
+ type: T_1;
3131
+ }> | Extract<ChangeRangeCommand, {
3132
+ type: T_1;
3133
+ }> | Extract<CreateFigureCommand, {
3134
+ type: T_1;
3135
+ }> | Extract<SelectFigureCommand, {
3136
+ type: T_1;
3137
+ }> | Extract<UpdateFigureCommand, {
3138
+ type: T_1;
3139
+ }> | Extract<DeleteFigureCommand, {
3140
+ type: T_1;
3141
+ }> | Extract<CreateChartCommand, {
3142
+ type: T_1;
3143
+ }> | Extract<UpdateChartCommand, {
3144
+ type: T_1;
3145
+ }>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
3146
+ };
3147
+ getFigures(): FigureInfo[];
3148
+ getDims(info: FigureInfo): string;
3149
+ getStyle(info: FigureInfo): string;
3150
+ mounted(): void;
3151
+ resize(figure: Figure<any>, dirX: number, dirY: number, ev: MouseEvent): void;
3152
+ onMouseDown(figure: Figure<any>, ev: MouseEvent): void;
3153
+ onKeyDown(figure: Figure<any>, ev: KeyboardEvent): void;
3154
+ }
3155
+
3156
+ declare const Component$5: typeof owl.Component;
3157
+ declare abstract class AbstractResizer extends Component$5<any, SpreadsheetEnv> {
3158
+ PADDING: number;
3159
+ MAX_SIZE_MARGIN: number;
3160
+ MIN_ELEMENT_SIZE: number;
3161
+ lastSelectedElement: number | null;
3162
+ lastElement: number | null;
3163
+ getters: Getters;
3164
+ dispatch: {
3165
+ <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, {
3166
+ type: T;
3167
+ }> | Extract<ResizeColumnsCommand, {
3168
+ type: T;
3169
+ }> | Extract<ResizeRowsCommand, {
3170
+ type: T;
3171
+ }> | Extract<CreateSheetCommand, {
3172
+ type: T;
3173
+ }> | Extract<MoveSheetCommand, {
3174
+ type: T;
3175
+ }> | Extract<RenameSheetCommand, {
3176
+ type: T;
3177
+ }> | Extract<DuplicateSheetCommand, {
3178
+ type: T;
3179
+ }> | Extract<DeleteSheetCommand, {
3180
+ type: T;
3181
+ }> | Extract<DeleteSheetConfirmationCommand, {
3182
+ type: T;
3183
+ }> | Extract<AddMergeCommand, {
3184
+ type: T;
3185
+ }> | Extract<RemoveMergeCommand, {
3186
+ type: T;
3187
+ }> | Extract<AddFormattingCommand, {
3188
+ type: T;
3189
+ }> | Extract<ClearFormattingCommand, {
3190
+ type: T;
3191
+ }> | Extract<SetFormatterCommand, {
3192
+ type: T;
3193
+ }> | Extract<SetDecimalCommand, {
3194
+ type: T;
3195
+ }> | Extract<AddConditionalFormatCommand, {
3196
+ type: T;
3197
+ }> | Extract<RemoveConditionalFormatCommand, {
3198
+ type: T;
3199
+ }> | Extract<RemoveColumnsCommand, {
3200
+ type: T;
3201
+ }> | Extract<RemoveRowsCommand, {
3202
+ type: T;
3203
+ }> | Extract<AddColumnsCommand, {
3204
+ type: T;
3205
+ }> | Extract<AddRowsCommand, {
3206
+ type: T;
3207
+ }> | Extract<CopyCommand, {
3208
+ type: T;
3209
+ }> | Extract<CutCommand, {
3210
+ type: T;
3211
+ }> | Extract<PasteCommand, {
3212
+ type: T;
3213
+ }> | Extract<PasteCellCommand, {
3214
+ type: T;
3215
+ }> | Extract<AutoFillCellCommand, {
3216
+ type: T;
3217
+ }> | Extract<ActivatePaintFormatCommand, {
3218
+ type: T;
3219
+ }> | Extract<PasteFromOSClipboardCommand, {
3220
+ type: T;
3221
+ }> | Extract<AutoresizeColumnsCommand, {
3222
+ type: T;
3223
+ }> | Extract<AutoresizeRowsCommand, {
3224
+ type: T;
3225
+ }> | Extract<MovePositionCommand, {
3226
+ type: T;
3227
+ }> | Extract<ActivateSheetCommand, {
3228
+ type: T;
3229
+ }> | Extract<SelectCellCommand, {
3230
+ type: T;
3231
+ }> | Extract<SetSelectionCommand, {
3232
+ type: T;
3233
+ }> | Extract<StartSelectionCommand, {
3234
+ type: T;
3235
+ }> | Extract<PrepareExpansionCommand, {
3236
+ type: T;
3237
+ }> | Extract<StartExpansionCommand, {
3238
+ type: T;
3239
+ }> | Extract<StopSelectionCommand, {
3240
+ type: T;
3241
+ }> | Extract<HighlightSelectionCommand, {
3242
+ type: T;
3243
+ }> | Extract<AddPendingHighlightCommand, {
3244
+ type: T;
3245
+ }> | Extract<ResetPendingHighlightCommand, {
3246
+ type: T;
3247
+ }> | Extract<SetColorCommand, {
3248
+ type: T;
3249
+ }> | Extract<SelectColumnCommand, {
3250
+ type: T;
3251
+ }> | Extract<SelectRowCommand, {
3252
+ type: T;
3253
+ }> | Extract<SelectAllCommand, {
3254
+ type: T;
3255
+ }> | Extract<AlterSelectionCommand, {
3256
+ type: T;
3257
+ }> | Extract<EvaluateCellsCommand, {
3258
+ type: T;
3259
+ }> | Extract<AddHighlightsCommand, {
3260
+ type: T;
3261
+ }> | Extract<RemoveHighlightsCommand, {
3262
+ type: T;
3263
+ }> | Extract<RemoveAllHighlightsCommand, {
3264
+ type: T;
3265
+ }> | Extract<StartComposerSelectionCommand, {
3266
+ type: T;
3267
+ }> | Extract<StopComposerSelectionCommand, {
3268
+ type: T;
3269
+ }> | Extract<StartEditionCommand, {
3270
+ type: T;
3271
+ }> | Extract<StopEditionCommand, {
3272
+ type: T;
3273
+ }> | Extract<SetCurrentContentCommand, {
3274
+ type: T;
3275
+ }> | Extract<SetValueCommand, {
3276
+ type: T;
3277
+ }> | Extract<ShowFormulaCommand, {
3278
+ type: T;
3279
+ }> | Extract<DeleteContentCommand, {
3280
+ type: T;
3281
+ }> | Extract<ClearCellCommand, {
3282
+ type: T;
3283
+ }> | Extract<UndoCommand, {
3284
+ type: T;
3285
+ }> | Extract<RedoCommand, {
3286
+ type: T;
3287
+ }> | Extract<StartCommand, {
3288
+ type: T;
3289
+ }> | Extract<AutofillCommand, {
3290
+ type: T;
3291
+ }> | Extract<AutofillSelectCommand, {
3292
+ type: T;
3293
+ }> | Extract<AutofillAutoCommand, {
3294
+ type: T;
3295
+ }> | Extract<NewInputCommand, {
3296
+ type: T;
3297
+ }> | Extract<RemoveInputCommand, {
3298
+ type: T;
3299
+ }> | Extract<FocusInputCommand, {
3300
+ type: T;
3301
+ }> | Extract<AddEmptyRangeCommand, {
3302
+ type: T;
3303
+ }> | Extract<RemoveRangeCommand, {
3304
+ type: T;
3305
+ }> | Extract<ChangeRangeCommand, {
3306
+ type: T;
3307
+ }> | Extract<CreateFigureCommand, {
3308
+ type: T;
3309
+ }> | Extract<SelectFigureCommand, {
3310
+ type: T;
3311
+ }> | Extract<UpdateFigureCommand, {
3312
+ type: T;
3313
+ }> | Extract<DeleteFigureCommand, {
3314
+ type: T;
3315
+ }> | Extract<CreateChartCommand, {
3316
+ type: T;
3317
+ }> | Extract<UpdateChartCommand, {
3318
+ type: T;
3319
+ }>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
3320
+ <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, {
3321
+ type: T_1;
3322
+ }> | Extract<ResizeColumnsCommand, {
3323
+ type: T_1;
3324
+ }> | Extract<ResizeRowsCommand, {
3325
+ type: T_1;
3326
+ }> | Extract<CreateSheetCommand, {
3327
+ type: T_1;
3328
+ }> | Extract<MoveSheetCommand, {
3329
+ type: T_1;
3330
+ }> | Extract<RenameSheetCommand, {
3331
+ type: T_1;
3332
+ }> | Extract<DuplicateSheetCommand, {
3333
+ type: T_1;
3334
+ }> | Extract<DeleteSheetCommand, {
3335
+ type: T_1;
3336
+ }> | Extract<DeleteSheetConfirmationCommand, {
3337
+ type: T_1;
3338
+ }> | Extract<AddMergeCommand, {
3339
+ type: T_1;
3340
+ }> | Extract<RemoveMergeCommand, {
3341
+ type: T_1;
3342
+ }> | Extract<AddFormattingCommand, {
3343
+ type: T_1;
3344
+ }> | Extract<ClearFormattingCommand, {
3345
+ type: T_1;
3346
+ }> | Extract<SetFormatterCommand, {
3347
+ type: T_1;
3348
+ }> | Extract<SetDecimalCommand, {
3349
+ type: T_1;
3350
+ }> | Extract<AddConditionalFormatCommand, {
3351
+ type: T_1;
3352
+ }> | Extract<RemoveConditionalFormatCommand, {
3353
+ type: T_1;
3354
+ }> | Extract<RemoveColumnsCommand, {
3355
+ type: T_1;
3356
+ }> | Extract<RemoveRowsCommand, {
3357
+ type: T_1;
3358
+ }> | Extract<AddColumnsCommand, {
3359
+ type: T_1;
3360
+ }> | Extract<AddRowsCommand, {
3361
+ type: T_1;
3362
+ }> | Extract<CopyCommand, {
3363
+ type: T_1;
3364
+ }> | Extract<CutCommand, {
3365
+ type: T_1;
3366
+ }> | Extract<PasteCommand, {
3367
+ type: T_1;
3368
+ }> | Extract<PasteCellCommand, {
3369
+ type: T_1;
3370
+ }> | Extract<AutoFillCellCommand, {
3371
+ type: T_1;
3372
+ }> | Extract<ActivatePaintFormatCommand, {
3373
+ type: T_1;
3374
+ }> | Extract<PasteFromOSClipboardCommand, {
3375
+ type: T_1;
3376
+ }> | Extract<AutoresizeColumnsCommand, {
3377
+ type: T_1;
3378
+ }> | Extract<AutoresizeRowsCommand, {
3379
+ type: T_1;
3380
+ }> | Extract<MovePositionCommand, {
3381
+ type: T_1;
3382
+ }> | Extract<ActivateSheetCommand, {
3383
+ type: T_1;
3384
+ }> | Extract<SelectCellCommand, {
3385
+ type: T_1;
3386
+ }> | Extract<SetSelectionCommand, {
3387
+ type: T_1;
3388
+ }> | Extract<StartSelectionCommand, {
3389
+ type: T_1;
3390
+ }> | Extract<PrepareExpansionCommand, {
3391
+ type: T_1;
3392
+ }> | Extract<StartExpansionCommand, {
3393
+ type: T_1;
3394
+ }> | Extract<StopSelectionCommand, {
3395
+ type: T_1;
3396
+ }> | Extract<HighlightSelectionCommand, {
3397
+ type: T_1;
3398
+ }> | Extract<AddPendingHighlightCommand, {
3399
+ type: T_1;
3400
+ }> | Extract<ResetPendingHighlightCommand, {
3401
+ type: T_1;
3402
+ }> | Extract<SetColorCommand, {
3403
+ type: T_1;
3404
+ }> | Extract<SelectColumnCommand, {
3405
+ type: T_1;
3406
+ }> | Extract<SelectRowCommand, {
3407
+ type: T_1;
3408
+ }> | Extract<SelectAllCommand, {
3409
+ type: T_1;
3410
+ }> | Extract<AlterSelectionCommand, {
3411
+ type: T_1;
3412
+ }> | Extract<EvaluateCellsCommand, {
3413
+ type: T_1;
3414
+ }> | Extract<AddHighlightsCommand, {
3415
+ type: T_1;
3416
+ }> | Extract<RemoveHighlightsCommand, {
3417
+ type: T_1;
3418
+ }> | Extract<RemoveAllHighlightsCommand, {
3419
+ type: T_1;
3420
+ }> | Extract<StartComposerSelectionCommand, {
3421
+ type: T_1;
3422
+ }> | Extract<StopComposerSelectionCommand, {
3423
+ type: T_1;
3424
+ }> | Extract<StartEditionCommand, {
3425
+ type: T_1;
3426
+ }> | Extract<StopEditionCommand, {
3427
+ type: T_1;
3428
+ }> | Extract<SetCurrentContentCommand, {
3429
+ type: T_1;
3430
+ }> | Extract<SetValueCommand, {
3431
+ type: T_1;
3432
+ }> | Extract<ShowFormulaCommand, {
3433
+ type: T_1;
3434
+ }> | Extract<DeleteContentCommand, {
3435
+ type: T_1;
3436
+ }> | Extract<ClearCellCommand, {
3437
+ type: T_1;
3438
+ }> | Extract<UndoCommand, {
3439
+ type: T_1;
3440
+ }> | Extract<RedoCommand, {
3441
+ type: T_1;
3442
+ }> | Extract<StartCommand, {
3443
+ type: T_1;
3444
+ }> | Extract<AutofillCommand, {
3445
+ type: T_1;
3446
+ }> | Extract<AutofillSelectCommand, {
3447
+ type: T_1;
3448
+ }> | Extract<AutofillAutoCommand, {
3449
+ type: T_1;
3450
+ }> | Extract<NewInputCommand, {
3451
+ type: T_1;
3452
+ }> | Extract<RemoveInputCommand, {
3453
+ type: T_1;
3454
+ }> | Extract<FocusInputCommand, {
3455
+ type: T_1;
3456
+ }> | Extract<AddEmptyRangeCommand, {
3457
+ type: T_1;
3458
+ }> | Extract<RemoveRangeCommand, {
3459
+ type: T_1;
3460
+ }> | Extract<ChangeRangeCommand, {
3461
+ type: T_1;
3462
+ }> | Extract<CreateFigureCommand, {
3463
+ type: T_1;
3464
+ }> | Extract<SelectFigureCommand, {
3465
+ type: T_1;
3466
+ }> | Extract<UpdateFigureCommand, {
3467
+ type: T_1;
3468
+ }> | Extract<DeleteFigureCommand, {
3469
+ type: T_1;
3470
+ }> | Extract<CreateChartCommand, {
3471
+ type: T_1;
3472
+ }> | Extract<UpdateChartCommand, {
3473
+ type: T_1;
3474
+ }>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
3475
+ };
3476
+ state: {
3477
+ isActive: boolean;
3478
+ isResizing: boolean;
3479
+ activeElement: number;
3480
+ styleValue: number;
3481
+ delta: number;
3482
+ };
3483
+ abstract _getEvOffset(ev: MouseEvent): number;
3484
+ abstract _getStateOffset(): number;
3485
+ abstract _getViewportOffset(): number;
3486
+ abstract _getClientPosition(ev: MouseEvent): number;
3487
+ abstract _getElementIndex(index: number): number;
3488
+ abstract _getElement(index: number): Col | Row;
3489
+ abstract _getHeaderSize(): number;
3490
+ abstract _getMaxSize(): number;
3491
+ abstract _updateSize(): void;
3492
+ abstract _selectElement(index: number, ctrlKey: boolean): void;
3493
+ abstract _increaseSelection(index: number): void;
3494
+ abstract _fitElementSize(index: number): void;
3495
+ abstract _getType(): ContextMenuType;
3496
+ abstract _getActiveElements(): Set<number>;
3497
+ abstract _getXY(ev: MouseEvent): {
3498
+ x: number;
3499
+ y: number;
3500
+ };
3501
+ _computeHandleDisplay(ev: MouseEvent): void;
3502
+ onMouseMove(ev: MouseEvent): void;
3503
+ onMouseLeave(): void;
3504
+ onDblClick(): void;
3505
+ onMouseDown(ev: MouseEvent): void;
3506
+ select(ev: MouseEvent): void;
3507
+ onMouseUp(ev: MouseEvent): void;
3508
+ onContextMenu(ev: MouseEvent): void;
3509
+ }
3510
+ declare class ColResizer extends AbstractResizer {
3511
+ static template: string;
3512
+ static style: string;
3513
+ constructor();
3514
+ _getEvOffset(ev: MouseEvent): number;
3515
+ _getStateOffset(): number;
3516
+ _getViewportOffset(): number;
3517
+ _getClientPosition(ev: MouseEvent): number;
3518
+ _getElementIndex(index: number): number;
3519
+ _getElement(index: number): Col;
3520
+ _getBottomRightValue(element: Col): number;
3521
+ _getHeaderSize(): number;
3522
+ _getMaxSize(): number;
3523
+ _updateSize(): void;
3524
+ _selectElement(index: number, ctrlKey: boolean): void;
3525
+ _increaseSelection(index: number): void;
3526
+ _fitElementSize(index: number): void;
3527
+ _getType(): ContextMenuType;
3528
+ _getActiveElements(): Set<number>;
3529
+ _getXY(ev: MouseEvent): {
3530
+ x: number;
3531
+ y: number;
3532
+ };
3533
+ }
3534
+ declare class RowResizer extends AbstractResizer {
3535
+ static template: string;
3536
+ static style: string;
3537
+ constructor();
3538
+ _getEvOffset(ev: MouseEvent): number;
3539
+ _getStateOffset(): number;
3540
+ _getViewportOffset(): number;
3541
+ _getClientPosition(ev: MouseEvent): number;
3542
+ _getElementIndex(index: number): number;
3543
+ _getElement(index: number): Row;
3544
+ _getHeaderSize(): number;
3545
+ _getMaxSize(): number;
3546
+ _updateSize(): void;
3547
+ _selectElement(index: number, ctrlKey: boolean): void;
3548
+ _increaseSelection(index: number): void;
3549
+ _fitElementSize(index: number): void;
3550
+ _getType(): ContextMenuType;
3551
+ _getActiveElements(): Set<number>;
3552
+ _getXY(ev: MouseEvent): {
3553
+ x: number;
3554
+ y: number;
3555
+ };
3556
+ }
3557
+ interface Props$2 {
3558
+ viewport: Viewport;
3559
+ }
3560
+ declare class Overlay extends Component$5<Props$2, SpreadsheetEnv> {
3561
+ static template: string;
3562
+ static style: string;
3563
+ static components: {
3564
+ ColResizer: typeof ColResizer;
3565
+ RowResizer: typeof RowResizer;
3566
+ };
3567
+ selectAll(): void;
3568
+ }
3569
+
3570
+ declare const Component$4: typeof owl.Component;
3571
+ declare type ContextMenuType = "ROW" | "COL" | "CELL";
3572
+ interface ErrorTooltip {
3573
+ isOpen: boolean;
3574
+ text: string;
3575
+ style: string;
3576
+ }
3577
+ declare class Grid extends Component$4<{
3578
+ model: Model;
3579
+ }, SpreadsheetEnv> {
3580
+ static template: string;
3581
+ static style: string;
3582
+ static components: {
3583
+ Composer: typeof Composer;
3584
+ Overlay: typeof Overlay;
3585
+ Menu: typeof Menu;
3586
+ Autofill: typeof Autofill;
3587
+ FiguresContainer: typeof FiguresContainer;
3588
+ };
3589
+ private menuState;
3590
+ private composer;
3591
+ private vScrollbarRef;
3592
+ private hScrollbarRef;
3593
+ private vScrollbar;
3594
+ private hScrollbar;
3595
+ private canvas;
3596
+ private getters;
3597
+ private dispatch;
3598
+ private currentPosition;
3599
+ private currentSheet;
3600
+ private currentPositionInViewport;
3601
+ private clickedCol;
3602
+ private clickedRow;
3603
+ private viewport;
3604
+ private snappedViewport;
3605
+ errorTooltip: ErrorTooltip;
3606
+ private keyDownMapping;
3607
+ constructor();
3608
+ mounted(): void;
3609
+ willUpdateProps(): Promise<void>;
3610
+ patched(): void;
3611
+ focus(): void;
3612
+ onScroll(): void;
3613
+ checkChanges(): boolean;
3614
+ getAutofillPosition(): {
3615
+ left: number;
3616
+ top: number;
3617
+ };
3618
+ drawGrid(): void;
3619
+ private moveCanvas;
3620
+ onMouseWheel(ev: WheelEvent): void;
3621
+ getCartesianCoordinates(ev: MouseEvent): [number, number];
3622
+ onMouseDown(ev: MouseEvent): void;
3623
+ onDoubleClick(ev: any): void;
3624
+ processTabKey(ev: KeyboardEvent): void;
3625
+ processArrows(ev: KeyboardEvent): void;
3626
+ onKeydown(ev: KeyboardEvent): void;
3627
+ onCanvasContextMenu(ev: MouseEvent): void;
3628
+ onOverlayContextMenu(ev: CustomEvent): void;
3629
+ toggleContextMenu(type: ContextMenuType, x: number, y: number): void;
3630
+ }
3631
+
3632
+ declare const Component$3: typeof owl.Component;
3633
+ interface Props$1 {
3634
+ component: string;
3635
+ panelProps: any;
3636
+ }
3637
+ declare class SidePanel extends Component$3<Props$1, SpreadsheetEnv> {
3638
+ static template: string;
3639
+ static style: string;
3640
+ state: {
3641
+ panel: SidePanelContent;
3642
+ };
3643
+ willUpdateProps(nextProps: Props$1): Promise<void>;
3644
+ getTitle(): string;
3645
+ }
3646
+
3647
+ interface FontSize {
3648
+ pt: number;
3649
+ px: number;
3650
+ }
3651
+
3652
+ declare const Component$2: typeof owl.Component;
3653
+ declare class ColorPicker extends Component$2<any, SpreadsheetEnv> {
3654
+ static template: string;
3655
+ static style: string;
3656
+ COLORS: string[][];
3657
+ onColorClick(ev: MouseEvent): void;
3658
+ }
3659
+
3660
+ declare const Component$1: typeof owl.Component;
3661
+ declare type Tool = "" | "formatTool" | "alignTool" | "textColorTool" | "fillColorTool" | "borderTool" | "fontSizeTool";
3662
+ interface State {
3663
+ menuState: MenuState;
3664
+ activeTool: Tool;
3665
+ }
3666
+ declare class TopBar extends Component$1<any, SpreadsheetEnv> {
3667
+ static template: string;
3668
+ static style: string;
3669
+ static components: {
3670
+ ColorPicker: typeof ColorPicker;
3671
+ Menu: typeof Menu;
3672
+ };
3673
+ formats: ({
3674
+ name: string;
3675
+ text: string;
3676
+ value?: undefined;
3677
+ } | {
3678
+ name: string;
3679
+ text: string;
3680
+ value: string;
3681
+ })[];
3682
+ currentFormat: string;
3683
+ fontSizes: FontSize[];
3684
+ dispatch: {
3685
+ <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, {
3686
+ type: T;
3687
+ }> | Extract<ResizeColumnsCommand, {
3688
+ type: T;
3689
+ }> | Extract<ResizeRowsCommand, {
3690
+ type: T;
3691
+ }> | Extract<CreateSheetCommand, {
3692
+ type: T;
3693
+ }> | Extract<MoveSheetCommand, {
3694
+ type: T;
3695
+ }> | Extract<RenameSheetCommand, {
3696
+ type: T;
3697
+ }> | Extract<DuplicateSheetCommand, {
3698
+ type: T;
3699
+ }> | Extract<DeleteSheetCommand, {
3700
+ type: T;
3701
+ }> | Extract<DeleteSheetConfirmationCommand, {
3702
+ type: T;
3703
+ }> | Extract<AddMergeCommand, {
3704
+ type: T;
3705
+ }> | Extract<RemoveMergeCommand, {
3706
+ type: T;
3707
+ }> | Extract<AddFormattingCommand, {
3708
+ type: T;
3709
+ }> | Extract<ClearFormattingCommand, {
3710
+ type: T;
3711
+ }> | Extract<SetFormatterCommand, {
3712
+ type: T;
3713
+ }> | Extract<SetDecimalCommand, {
3714
+ type: T;
3715
+ }> | Extract<AddConditionalFormatCommand, {
3716
+ type: T;
3717
+ }> | Extract<RemoveConditionalFormatCommand, {
3718
+ type: T;
3719
+ }> | Extract<RemoveColumnsCommand, {
3720
+ type: T;
3721
+ }> | Extract<RemoveRowsCommand, {
3722
+ type: T;
3723
+ }> | Extract<AddColumnsCommand, {
3724
+ type: T;
3725
+ }> | Extract<AddRowsCommand, {
3726
+ type: T;
3727
+ }> | Extract<CopyCommand, {
3728
+ type: T;
3729
+ }> | Extract<CutCommand, {
3730
+ type: T;
3731
+ }> | Extract<PasteCommand, {
3732
+ type: T;
3733
+ }> | Extract<PasteCellCommand, {
3734
+ type: T;
3735
+ }> | Extract<AutoFillCellCommand, {
3736
+ type: T;
3737
+ }> | Extract<ActivatePaintFormatCommand, {
3738
+ type: T;
3739
+ }> | Extract<PasteFromOSClipboardCommand, {
3740
+ type: T;
3741
+ }> | Extract<AutoresizeColumnsCommand, {
3742
+ type: T;
3743
+ }> | Extract<AutoresizeRowsCommand, {
3744
+ type: T;
3745
+ }> | Extract<MovePositionCommand, {
3746
+ type: T;
3747
+ }> | Extract<ActivateSheetCommand, {
3748
+ type: T;
3749
+ }> | Extract<SelectCellCommand, {
3750
+ type: T;
3751
+ }> | Extract<SetSelectionCommand, {
3752
+ type: T;
3753
+ }> | Extract<StartSelectionCommand, {
3754
+ type: T;
3755
+ }> | Extract<PrepareExpansionCommand, {
3756
+ type: T;
3757
+ }> | Extract<StartExpansionCommand, {
3758
+ type: T;
3759
+ }> | Extract<StopSelectionCommand, {
3760
+ type: T;
3761
+ }> | Extract<HighlightSelectionCommand, {
3762
+ type: T;
3763
+ }> | Extract<AddPendingHighlightCommand, {
3764
+ type: T;
3765
+ }> | Extract<ResetPendingHighlightCommand, {
3766
+ type: T;
3767
+ }> | Extract<SetColorCommand, {
3768
+ type: T;
3769
+ }> | Extract<SelectColumnCommand, {
3770
+ type: T;
3771
+ }> | Extract<SelectRowCommand, {
3772
+ type: T;
3773
+ }> | Extract<SelectAllCommand, {
3774
+ type: T;
3775
+ }> | Extract<AlterSelectionCommand, {
3776
+ type: T;
3777
+ }> | Extract<EvaluateCellsCommand, {
3778
+ type: T;
3779
+ }> | Extract<AddHighlightsCommand, {
3780
+ type: T;
3781
+ }> | Extract<RemoveHighlightsCommand, {
3782
+ type: T;
3783
+ }> | Extract<RemoveAllHighlightsCommand, {
3784
+ type: T;
3785
+ }> | Extract<StartComposerSelectionCommand, {
3786
+ type: T;
3787
+ }> | Extract<StopComposerSelectionCommand, {
3788
+ type: T;
3789
+ }> | Extract<StartEditionCommand, {
3790
+ type: T;
3791
+ }> | Extract<StopEditionCommand, {
3792
+ type: T;
3793
+ }> | Extract<SetCurrentContentCommand, {
3794
+ type: T;
3795
+ }> | Extract<SetValueCommand, {
3796
+ type: T;
3797
+ }> | Extract<ShowFormulaCommand, {
3798
+ type: T;
3799
+ }> | Extract<DeleteContentCommand, {
3800
+ type: T;
3801
+ }> | Extract<ClearCellCommand, {
3802
+ type: T;
3803
+ }> | Extract<UndoCommand, {
3804
+ type: T;
3805
+ }> | Extract<RedoCommand, {
3806
+ type: T;
3807
+ }> | Extract<StartCommand, {
3808
+ type: T;
3809
+ }> | Extract<AutofillCommand, {
3810
+ type: T;
3811
+ }> | Extract<AutofillSelectCommand, {
3812
+ type: T;
3813
+ }> | Extract<AutofillAutoCommand, {
3814
+ type: T;
3815
+ }> | Extract<NewInputCommand, {
3816
+ type: T;
3817
+ }> | Extract<RemoveInputCommand, {
3818
+ type: T;
3819
+ }> | Extract<FocusInputCommand, {
3820
+ type: T;
3821
+ }> | Extract<AddEmptyRangeCommand, {
3822
+ type: T;
3823
+ }> | Extract<RemoveRangeCommand, {
3824
+ type: T;
3825
+ }> | Extract<ChangeRangeCommand, {
3826
+ type: T;
3827
+ }> | Extract<CreateFigureCommand, {
3828
+ type: T;
3829
+ }> | Extract<SelectFigureCommand, {
3830
+ type: T;
3831
+ }> | Extract<UpdateFigureCommand, {
3832
+ type: T;
3833
+ }> | Extract<DeleteFigureCommand, {
3834
+ type: T;
3835
+ }> | Extract<CreateChartCommand, {
3836
+ type: T;
3837
+ }> | Extract<UpdateChartCommand, {
3838
+ type: T;
3839
+ }>>(type: {} extends Omit<C, "type"> ? T : never): CommandResult;
3840
+ <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, {
3841
+ type: T_1;
3842
+ }> | Extract<ResizeColumnsCommand, {
3843
+ type: T_1;
3844
+ }> | Extract<ResizeRowsCommand, {
3845
+ type: T_1;
3846
+ }> | Extract<CreateSheetCommand, {
3847
+ type: T_1;
3848
+ }> | Extract<MoveSheetCommand, {
3849
+ type: T_1;
3850
+ }> | Extract<RenameSheetCommand, {
3851
+ type: T_1;
3852
+ }> | Extract<DuplicateSheetCommand, {
3853
+ type: T_1;
3854
+ }> | Extract<DeleteSheetCommand, {
3855
+ type: T_1;
3856
+ }> | Extract<DeleteSheetConfirmationCommand, {
3857
+ type: T_1;
3858
+ }> | Extract<AddMergeCommand, {
3859
+ type: T_1;
3860
+ }> | Extract<RemoveMergeCommand, {
3861
+ type: T_1;
3862
+ }> | Extract<AddFormattingCommand, {
3863
+ type: T_1;
3864
+ }> | Extract<ClearFormattingCommand, {
3865
+ type: T_1;
3866
+ }> | Extract<SetFormatterCommand, {
3867
+ type: T_1;
3868
+ }> | Extract<SetDecimalCommand, {
3869
+ type: T_1;
3870
+ }> | Extract<AddConditionalFormatCommand, {
3871
+ type: T_1;
3872
+ }> | Extract<RemoveConditionalFormatCommand, {
3873
+ type: T_1;
3874
+ }> | Extract<RemoveColumnsCommand, {
3875
+ type: T_1;
3876
+ }> | Extract<RemoveRowsCommand, {
3877
+ type: T_1;
3878
+ }> | Extract<AddColumnsCommand, {
3879
+ type: T_1;
3880
+ }> | Extract<AddRowsCommand, {
3881
+ type: T_1;
3882
+ }> | Extract<CopyCommand, {
3883
+ type: T_1;
3884
+ }> | Extract<CutCommand, {
3885
+ type: T_1;
3886
+ }> | Extract<PasteCommand, {
3887
+ type: T_1;
3888
+ }> | Extract<PasteCellCommand, {
3889
+ type: T_1;
3890
+ }> | Extract<AutoFillCellCommand, {
3891
+ type: T_1;
3892
+ }> | Extract<ActivatePaintFormatCommand, {
3893
+ type: T_1;
3894
+ }> | Extract<PasteFromOSClipboardCommand, {
3895
+ type: T_1;
3896
+ }> | Extract<AutoresizeColumnsCommand, {
3897
+ type: T_1;
3898
+ }> | Extract<AutoresizeRowsCommand, {
3899
+ type: T_1;
3900
+ }> | Extract<MovePositionCommand, {
3901
+ type: T_1;
3902
+ }> | Extract<ActivateSheetCommand, {
3903
+ type: T_1;
3904
+ }> | Extract<SelectCellCommand, {
3905
+ type: T_1;
3906
+ }> | Extract<SetSelectionCommand, {
3907
+ type: T_1;
3908
+ }> | Extract<StartSelectionCommand, {
3909
+ type: T_1;
3910
+ }> | Extract<PrepareExpansionCommand, {
3911
+ type: T_1;
3912
+ }> | Extract<StartExpansionCommand, {
3913
+ type: T_1;
3914
+ }> | Extract<StopSelectionCommand, {
3915
+ type: T_1;
3916
+ }> | Extract<HighlightSelectionCommand, {
3917
+ type: T_1;
3918
+ }> | Extract<AddPendingHighlightCommand, {
3919
+ type: T_1;
3920
+ }> | Extract<ResetPendingHighlightCommand, {
3921
+ type: T_1;
3922
+ }> | Extract<SetColorCommand, {
3923
+ type: T_1;
3924
+ }> | Extract<SelectColumnCommand, {
3925
+ type: T_1;
3926
+ }> | Extract<SelectRowCommand, {
3927
+ type: T_1;
3928
+ }> | Extract<SelectAllCommand, {
3929
+ type: T_1;
3930
+ }> | Extract<AlterSelectionCommand, {
3931
+ type: T_1;
3932
+ }> | Extract<EvaluateCellsCommand, {
3933
+ type: T_1;
3934
+ }> | Extract<AddHighlightsCommand, {
3935
+ type: T_1;
3936
+ }> | Extract<RemoveHighlightsCommand, {
3937
+ type: T_1;
3938
+ }> | Extract<RemoveAllHighlightsCommand, {
3939
+ type: T_1;
3940
+ }> | Extract<StartComposerSelectionCommand, {
3941
+ type: T_1;
3942
+ }> | Extract<StopComposerSelectionCommand, {
3943
+ type: T_1;
3944
+ }> | Extract<StartEditionCommand, {
3945
+ type: T_1;
3946
+ }> | Extract<StopEditionCommand, {
3947
+ type: T_1;
3948
+ }> | Extract<SetCurrentContentCommand, {
3949
+ type: T_1;
3950
+ }> | Extract<SetValueCommand, {
3951
+ type: T_1;
3952
+ }> | Extract<ShowFormulaCommand, {
3953
+ type: T_1;
3954
+ }> | Extract<DeleteContentCommand, {
3955
+ type: T_1;
3956
+ }> | Extract<ClearCellCommand, {
3957
+ type: T_1;
3958
+ }> | Extract<UndoCommand, {
3959
+ type: T_1;
3960
+ }> | Extract<RedoCommand, {
3961
+ type: T_1;
3962
+ }> | Extract<StartCommand, {
3963
+ type: T_1;
3964
+ }> | Extract<AutofillCommand, {
3965
+ type: T_1;
3966
+ }> | Extract<AutofillSelectCommand, {
3967
+ type: T_1;
3968
+ }> | Extract<AutofillAutoCommand, {
3969
+ type: T_1;
3970
+ }> | Extract<NewInputCommand, {
3971
+ type: T_1;
3972
+ }> | Extract<RemoveInputCommand, {
3973
+ type: T_1;
3974
+ }> | Extract<FocusInputCommand, {
3975
+ type: T_1;
3976
+ }> | Extract<AddEmptyRangeCommand, {
3977
+ type: T_1;
3978
+ }> | Extract<RemoveRangeCommand, {
3979
+ type: T_1;
3980
+ }> | Extract<ChangeRangeCommand, {
3981
+ type: T_1;
3982
+ }> | Extract<CreateFigureCommand, {
3983
+ type: T_1;
3984
+ }> | Extract<SelectFigureCommand, {
3985
+ type: T_1;
3986
+ }> | Extract<UpdateFigureCommand, {
3987
+ type: T_1;
3988
+ }> | Extract<DeleteFigureCommand, {
3989
+ type: T_1;
3990
+ }> | Extract<CreateChartCommand, {
3991
+ type: T_1;
3992
+ }> | Extract<UpdateChartCommand, {
3993
+ type: T_1;
3994
+ }>>(type: T_1, r: Omit<C_1, "type">): CommandResult;
3995
+ };
3996
+ getters: Getters;
3997
+ style: Style;
3998
+ state: State;
3999
+ isSelectingMenu: boolean;
4000
+ openedEl: HTMLElement | null;
4001
+ inMerge: boolean;
4002
+ cannotMerge: boolean;
4003
+ undoTool: boolean;
4004
+ redoTool: boolean;
4005
+ paintFormatTool: boolean;
4006
+ fillColor: string;
4007
+ textColor: string;
4008
+ menus: FullMenuItem[];
4009
+ private menuRef;
4010
+ constructor();
4011
+ get topbarComponents(): TopbarComponent[];
4012
+ willStart(): Promise<void>;
4013
+ willUpdateProps(): Promise<void>;
4014
+ onClick(ev: MouseEvent): void;
4015
+ toogleStyle(style: string): void;
4016
+ toogleFormat(format: string): void;
4017
+ toggleAlign(align: Align): void;
4018
+ onMenuMouseOver(menu: FullMenuItem, ev: MouseEvent): void;
4019
+ toggleDropdownTool(tool: Tool, ev: MouseEvent): void;
4020
+ toggleContextMenu(menu: FullMenuItem, ev: MouseEvent): void;
4021
+ closeMenus(): void;
4022
+ updateCellState(): void;
4023
+ getMenuName(menu: FullMenuItem): string;
4024
+ toggleMerge(): void;
4025
+ setColor(target: string, ev: CustomEvent): void;
4026
+ setBorder(command: BorderCommand): void;
4027
+ setFormat(ev: MouseEvent): void;
4028
+ setDecimal(step: number): void;
4029
+ paintFormat(): void;
4030
+ clearFormatting(): void;
4031
+ setSize(ev: MouseEvent): void;
4032
+ doAction(action: (env: SpreadsheetEnv) => void): void;
4033
+ undo(): void;
4034
+ redo(): void;
4035
+ }
4036
+
4037
+ declare const Component: typeof owl.Component;
4038
+ interface Props {
4039
+ data?: any;
4040
+ }
4041
+ declare class Spreadsheet extends Component<Props> {
4042
+ static template: string;
4043
+ static style: string;
4044
+ static components: {
4045
+ TopBar: typeof TopBar;
4046
+ Grid: typeof Grid;
4047
+ BottomBar: typeof BottomBar;
4048
+ SidePanel: typeof SidePanel;
4049
+ };
4050
+ static _t: (s: string) => string;
4051
+ model: Model;
4052
+ private grid;
4053
+ sidePanel: {
4054
+ isOpen: boolean;
4055
+ component?: string | undefined;
4056
+ panelProps: any;
4057
+ };
4058
+ private clipBoardString;
4059
+ constructor();
4060
+ mounted(): void;
4061
+ willUnmount(): void;
4062
+ destroy(): void;
4063
+ openSidePanel(panel: string, panelProps: any): void;
4064
+ toggleSidePanel(panel: string, panelProps: any): void;
4065
+ focusGrid(): void;
4066
+ copy(cut: boolean, ev: ClipboardEvent): void;
4067
+ paste(ev: ClipboardEvent): void;
4068
+ save(): void;
4069
+ onKeyup(ev: KeyboardEvent): void;
4070
+ onKeydown(ev: KeyboardEvent): void;
4071
+ }
4072
+
4073
+ /**
4074
+ * We export here all entities that needs to be accessed publicly by Odoo.
4075
+ *
4076
+ * Note that the __info__ key is actually completed by the build process (see
4077
+ * the rollup.config.js file)
4078
+ */
4079
+ declare const __info__: {};
4080
+
4081
+ declare const SPREADSHEET_DIMENSIONS: {
4082
+ MIN_ROW_HEIGHT: number;
4083
+ MIN_COL_WIDTH: number;
4084
+ HEADER_HEIGHT: number;
4085
+ HEADER_WIDTH: number;
4086
+ TOPBAR_HEIGHT: number;
4087
+ BOTTOMBAR_HEIGHT: number;
4088
+ DEFAULT_CELL_WIDTH: number;
4089
+ DEFAULT_CELL_HEIGHT: number;
4090
+ SCROLLBAR_WIDTH: number;
4091
+ };
4092
+ declare const registries: {
4093
+ autofillModifiersRegistry: Registry<AutofillModifierImplementation>;
4094
+ autofillRulesRegistry: Registry<AutofillRule>;
4095
+ cellMenuRegistry: MenuItemRegistry;
4096
+ colMenuRegistry: MenuItemRegistry;
4097
+ functionRegistry: FunctionRegistry;
4098
+ pluginRegistry: Registry<typeof BasePlugin>;
4099
+ rowMenuRegistry: MenuItemRegistry;
4100
+ sidePanelRegistry: Registry<SidePanelContent>;
4101
+ sheetMenuRegistry: MenuItemRegistry;
4102
+ topbarMenuRegistry: MenuItemRegistry;
4103
+ topbarComponentRegistry: Registry<TopbarComponent>;
4104
+ };
4105
+ declare const helpers: {
4106
+ args: typeof args;
4107
+ toBoolean: typeof toBoolean;
4108
+ toNumber: typeof toNumber;
4109
+ toString: typeof toString;
4110
+ toXC: typeof toXC;
4111
+ toZone: typeof toZone;
4112
+ toCartesian: typeof toCartesian;
4113
+ numberToLetters: typeof numberToLetters;
4114
+ createFullMenuItem: typeof createFullMenuItem;
4115
+ uuidv4: typeof uuidv4;
4116
+ formatDecimal: typeof formatDecimal;
4117
+ };
4118
+
4119
+ export { BasePlugin, Model, SPREADSHEET_DIMENSIONS, Spreadsheet, DEBUG as __DEBUG__, __info__, astToFormula, functionCache, helpers, normalize, parse, registries, setTranslationMethod };