@xlcalc/vue 0.0.0-stage → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/LICENSE +21 -0
- package/README.md +75 -2
- package/dist/abort.d.ts +6 -0
- package/dist/components/CellDraft.vue.d.ts +7 -0
- package/dist/components/CellEditor.vue.d.ts +3 -0
- package/dist/components/ColourSwatches.vue.d.ts +13 -0
- package/dist/components/DialogShell.vue.d.ts +37 -0
- package/dist/components/ExplainPanel.vue.d.ts +3 -0
- package/dist/components/FilterPopover.vue.d.ts +3 -0
- package/dist/components/FindBar.vue.d.ts +3 -0
- package/dist/components/FormatBorders.vue.d.ts +14 -0
- package/dist/components/FormatColour.vue.d.ts +19 -0
- package/dist/components/FormatDialog.vue.d.ts +24 -0
- package/dist/components/FormulaBar.vue.d.ts +3 -0
- package/dist/components/FunctionList.vue.d.ts +28 -0
- package/dist/components/FunctionTip.vue.d.ts +14 -0
- package/dist/components/InsertFunction.vue.d.ts +9 -0
- package/dist/components/OutlineCell.vue.d.ts +8 -0
- package/dist/components/OutlineLevels.vue.d.ts +7 -0
- package/dist/components/SheetGrid.vue.d.ts +3 -0
- package/dist/components/SheetMarks.vue.d.ts +3 -0
- package/dist/components/SheetMenu.vue.d.ts +3 -0
- package/dist/components/SheetRow.vue.d.ts +18 -0
- package/dist/components/SheetTabs.vue.d.ts +3 -0
- package/dist/components/SheetToolbar.vue.d.ts +43 -0
- package/dist/components/SheetView.vue.d.ts +56 -0
- package/dist/components/ValidationAlert.vue.d.ts +16 -0
- package/dist/components/ValidationDropdown.vue.d.ts +33 -0
- package/dist/components/ValidationPrompt.vue.d.ts +16 -0
- package/dist/components/cf-icons.d.ts +6 -0
- package/dist/components/context.d.ts +4 -0
- package/dist/components/dom.d.ts +7 -0
- package/dist/components/icons.d.ts +33 -0
- package/dist/components/popup.d.ts +29 -0
- package/dist/components/toolbar-icons.d.ts +24 -0
- package/dist/contract/memory.d.ts +108 -0
- package/dist/contract/messages.d.ts +260 -0
- package/dist/contract/source.d.ts +433 -0
- package/dist/contract/view.d.ts +108 -0
- package/dist/contract.d.ts +9 -0
- package/dist/core/ask.d.ts +2 -0
- package/dist/core/autocomplete.d.ts +28 -0
- package/dist/core/cell-style.d.ts +33 -0
- package/dist/core/cell-view.d.ts +104 -0
- package/dist/core/clip.d.ts +43 -0
- package/dist/core/commands.d.ts +47 -0
- package/dist/core/conditional.d.ts +16 -0
- package/dist/core/editing.d.ts +85 -0
- package/dist/core/explain.d.ts +36 -0
- package/dist/core/fill.d.ts +42 -0
- package/dist/core/filter.d.ts +72 -0
- package/dist/core/find.d.ts +53 -0
- package/dist/core/formula.d.ts +41 -0
- package/dist/core/function-tip.d.ts +34 -0
- package/dist/core/geometry.d.ts +55 -0
- package/dist/core/keys.d.ts +8 -0
- package/dist/core/list-keys.d.ts +4 -0
- package/dist/core/list.d.ts +17 -0
- package/dist/core/menu.d.ts +155 -0
- package/dist/core/merge.d.ts +19 -0
- package/dist/core/navigation.d.ts +72 -0
- package/dist/core/outline.d.ts +34 -0
- package/dist/core/point.d.ts +34 -0
- package/dist/core/ref-paint.d.ts +21 -0
- package/dist/core/selection.d.ts +45 -0
- package/dist/core/sheet.d.ts +774 -0
- package/dist/core/state.d.ts +107 -0
- package/dist/core/storage.d.ts +6 -0
- package/dist/core/totals.d.ts +16 -0
- package/dist/core/validation.d.ts +95 -0
- package/dist/core/viewport.d.ts +83 -0
- package/dist/core/windows.d.ts +102 -0
- package/dist/entry.d.ts +3 -0
- package/dist/failure.d.ts +5 -0
- package/dist/filter-key.d.ts +3 -0
- package/dist/find-match.d.ts +24 -0
- package/dist/format-cells.d.ts +85 -0
- package/dist/frame.d.ts +5 -0
- package/dist/grid-ref.d.ts +3 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12767 -0
- package/dist/lines.d.ts +16 -0
- package/dist/local/find.d.ts +15 -0
- package/dist/local/index.d.ts +3 -0
- package/dist/local/locale.d.ts +5 -0
- package/dist/local/outcome.d.ts +21 -0
- package/dist/local/query.d.ts +23 -0
- package/dist/local/source.d.ts +4 -0
- package/dist/local/types.d.ts +37 -0
- package/dist/local/validation.d.ts +8 -0
- package/dist/local/window.d.ts +16 -0
- package/dist/local/xlsx.d.ts +23 -0
- package/dist/local.js +1025 -0
- package/dist/locale-ref.d.ts +7 -0
- package/dist/locales.d.ts +3 -0
- package/dist/memory-outline.d.ts +31 -0
- package/dist/memory-query.d.ts +26 -0
- package/dist/memory-source.d.ts +3 -0
- package/dist/memory-validation.d.ts +17 -0
- package/dist/messages.d.ts +6 -0
- package/dist/number-formats.d.ts +13 -0
- package/dist/rect.d.ts +9 -0
- package/dist/ru-RU-BVeg6JGM.js +931 -0
- package/dist/sheet-query.d.ts +22 -0
- package/dist/stats.d.ts +8 -0
- package/dist/style.css +2 -0
- package/dist/toolbar.d.ts +39 -0
- package/dist/typed-entry-2l9Ay-hV.js +4559 -0
- package/dist/window-size.d.ts +4 -0
- package/docs/api.md +520 -0
- package/docs/autocomplete.md +60 -0
- package/docs/checks.md +40 -0
- package/docs/clipboard.md +48 -0
- package/docs/editing.md +97 -0
- package/docs/example-app.md +26 -0
- package/docs/find-replace.md +26 -0
- package/docs/list-mode.md +86 -0
- package/docs/local.md +94 -0
- package/docs/quick-start.md +221 -0
- package/docs/sheets.md +61 -0
- package/docs/toolbar.md +72 -0
- package/docs/validation.md +41 -0
- package/docs/view.md +50 -0
- package/package.json +92 -4
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sheet source contract: everything the component knows about its data. Rows and columns are 1-based, cells
|
|
3
|
+
* are A1 addresses. The source displays formulas in its own locale and parses what the user typed; the component knows
|
|
4
|
+
* nothing about the engine, the formula locale or HTTP. Optional methods enable features: without `edit` the sheet
|
|
5
|
+
* is read-only, without `find` there is no search, and so on.
|
|
6
|
+
*/
|
|
7
|
+
import type { CellStyle, CellValue, ConditionalAppearance, FunctionSignature, NumberFormat, StructureOp, StylePatch } from 'xlcalc/contract';
|
|
8
|
+
/** The sheet's data source; the component accesses its data only through this interface. */
|
|
9
|
+
export interface SheetSource {
|
|
10
|
+
/** The workbook's sheets in order; read again after a structure change and on a `reload` event. */
|
|
11
|
+
sheets(signal?: AbortSignal): Promise<SheetInfo[]>;
|
|
12
|
+
/** A rectangular block of a sheet's cells (a window), at most `maxCells` cells. */
|
|
13
|
+
window(req: WindowRequest, signal?: AbortSignal): Promise<SheetWindow | SheetPending>;
|
|
14
|
+
/** An edit as typed (`=SUM(A1:A3)`, `1.5`, `'007`); `null` clears. Without it the sheet is read-only. `opts.accept`: see `EditOptions`. */
|
|
15
|
+
edit?(entries: CellEntry[], opts?: EditOptions): Promise<EditOutcome>;
|
|
16
|
+
/** Clipboard text pasted at a cell as Excel pastes it, as a single undo step; `select` is the filled range. Without it the fields go to `edit`. */
|
|
17
|
+
paste?(sheet: string, cell: string, text: string): Promise<EditOutcome>;
|
|
18
|
+
/** Ctrl+Enter: the text typed into the active cell, entered into every cell of `range`. Without it only the active cell gets it. */
|
|
19
|
+
fill?(sheet: string, range: string, text: string, active: string, opts?: EditOptions): Promise<EditOutcome>;
|
|
20
|
+
/** Undoes the workbook's last change as a whole (`ok` with no changes when there is none); `select` is where it was. Without it there is no undo. */
|
|
21
|
+
undo?(): Promise<EditOutcome>;
|
|
22
|
+
/** Redoes the last undone change. */
|
|
23
|
+
redo?(): Promise<EditOutcome>;
|
|
24
|
+
/** A structure operation; without it there is no structure menu. */
|
|
25
|
+
structure?(op: SheetOp): Promise<EditOutcome>;
|
|
26
|
+
/** Column widths and row heights set with the mouse; without it a changed width lasts until the page reloads. */
|
|
27
|
+
layout?(edit: LayoutChange): Promise<EditOutcome>;
|
|
28
|
+
/**
|
|
29
|
+
* A range's plain text as Excel puts it on the clipboard: values formatted by their number formats and not clipped to
|
|
30
|
+
* the column width (a date in a narrow column is the date, not `##`), hidden rows and columns omitted, rows ending with
|
|
31
|
+
* CRLF, the last one included unless `trailingNewline` is false (Excel for Mac). A range too large to copy is rejected
|
|
32
|
+
* with an error. Without it the sheet copies the displayed text of its windows.
|
|
33
|
+
*/
|
|
34
|
+
copyText?(sheet: string, range: string, opts?: {
|
|
35
|
+
trailingNewline?: boolean;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Formats ranges (`B2:D9`, entire columns `B:D`, rows `2:5`) as a single undo step, as Excel formats a selection:
|
|
40
|
+
* style fields apply on top of each cell's displayed style (null removes a field), `style: null` removes the cells' own
|
|
41
|
+
* style, and a number format or null sets the format; several patches carry what differs by position (outside borders).
|
|
42
|
+
* Without it there is no toolbar.
|
|
43
|
+
*/
|
|
44
|
+
format?(sheet: string, patches: FormatPatch[]): Promise<EditOutcome>;
|
|
45
|
+
/** Changes made elsewhere: another tab, an agent, the clock. Returns the unsubscribe function. */
|
|
46
|
+
subscribe?(listener: (event: SourceEvent) => void): () => void;
|
|
47
|
+
/** A cell's data validation as Excel displays it on the cell: its dropdown list and its input message; null when no rule applies to the cell. */
|
|
48
|
+
validation?(sheet: string, cell: string, signal?: AbortSignal): Promise<SheetValidation | null>;
|
|
49
|
+
/**
|
|
50
|
+
* An item chosen from a list rule's dropdown: item number `item` of `validation`'s `list` (with its `text`, to detect a
|
|
51
|
+
* changed list), written as Excel writes a chosen item (its value, not parsed as typed text; the cell's number format
|
|
52
|
+
* kept), without checking the rule, as a single undo step. Without it the item goes to `edit` as typed, with `accept`.
|
|
53
|
+
*/
|
|
54
|
+
pick?(sheet: string, cell: string, item: number, text: string): Promise<EditOutcome>;
|
|
55
|
+
/** Excel's Freeze Panes: the rows above and the columns to the left of a cell kept in view (`{ rows: 2, cols: 1 }`), null unfreezes; a single undo step. Without it only the sheet's lock button hides the workbook's frozen panes. */
|
|
56
|
+
freeze?(sheet: string, panes: {
|
|
57
|
+
rows: number;
|
|
58
|
+
cols: number;
|
|
59
|
+
} | null): Promise<EditOutcome>;
|
|
60
|
+
/** The functions a formula can call, by their names as typed in the source's locale (`СУММ` in ru-RU), for Excel's Formula AutoComplete. */
|
|
61
|
+
functionNames?(signal?: AbortSignal): Promise<string[]>;
|
|
62
|
+
/**
|
|
63
|
+
* A function's arguments for Excel's argument tooltip while a formula is typed (`SUM(number1, [number2], ...)`, in ru-RU
|
|
64
|
+
* `СУММ(число1;[число2];...)`): the name as typed, in English or in the source's locale, in any letter case; null for a
|
|
65
|
+
* function the source does not know. Without it there is no tooltip.
|
|
66
|
+
*/
|
|
67
|
+
functionSignature?(name: string, signal?: AbortSignal): Promise<SheetFunctionSignature | null>;
|
|
68
|
+
/** A cell's precedent tree as text. */
|
|
69
|
+
explain?(sheet: string, cell: string): Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* Excel's Ctrl+arrow from a cell (`Range.End`): the cell it goes to (`B12`), which is the end of the block of non-empty
|
|
72
|
+
* cells, the next non-empty cell, or the edge of the sheet, skipping hidden rows or columns. Without it the sheet goes to
|
|
73
|
+
* the edge of the data known to it.
|
|
74
|
+
*/
|
|
75
|
+
end?(sheet: string, cell: string, direction: 'up' | 'down' | 'left' | 'right', signal?: AbortSignal): Promise<string>;
|
|
76
|
+
/** Totals of a range; without it the component counts over the loaded windows. */
|
|
77
|
+
stats?(sheet: string, range: string, filter?: SheetFilter, signal?: AbortSignal): Promise<RangeStats>;
|
|
78
|
+
/** Excel's Find on a sheet: matches in Excel's order, by rows or by columns (under a display filter, only its visible rows). Without it there is no search. */
|
|
79
|
+
find?(req: FindRequest, signal?: AbortSignal): Promise<FindResult>;
|
|
80
|
+
/** Excel's Replace All: every cell `find` finds for `req`, searched in formulas whatever `lookIn` says, as Excel replaces, with the matched text replaced by `by`, as a single undo step. */
|
|
81
|
+
replace?(req: FindRequest, by: string): Promise<ReplaceOutcome>;
|
|
82
|
+
/** Excel's outline commands: Group, Ungroup, a group's button and a level button. Without it the outline is drawn but cannot be changed. */
|
|
83
|
+
outline?(change: OutlineChange): Promise<EditOutcome>;
|
|
84
|
+
/** The sheet's rows in display order under the filter and sort; `rows: null` when there are no conditions. */
|
|
85
|
+
visibleRows?(sheet: string, filter: SheetFilter, signal?: AbortSignal): Promise<{
|
|
86
|
+
rows: number[] | null;
|
|
87
|
+
}>;
|
|
88
|
+
/** A column's values for the filter funnel, over the rows visible under the other columns' conditions. */
|
|
89
|
+
columnValues?(sheet: string, col: number, filter: SheetFilter, signal?: AbortSignal): Promise<{
|
|
90
|
+
values: {
|
|
91
|
+
text: string;
|
|
92
|
+
count: number;
|
|
93
|
+
}[];
|
|
94
|
+
more: number;
|
|
95
|
+
}>;
|
|
96
|
+
/** The maximum number of cells in one window, 20,000 by default. */
|
|
97
|
+
readonly maxCells?: number;
|
|
98
|
+
/** The number of steps `undo` and `redo` can take, as of the last completed call: a toolbar enables its buttons by them. */
|
|
99
|
+
readonly history?: {
|
|
100
|
+
readonly undo: number;
|
|
101
|
+
readonly redo: number;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** A function's signature as returned by a source, with what Excel's Insert Function displays under the syntax: a one-line description of the function, in the source's locale. */
|
|
105
|
+
export type SheetFunctionSignature = FunctionSignature & {
|
|
106
|
+
description?: string;
|
|
107
|
+
};
|
|
108
|
+
/** A range's formatting in `SheetSource.format`. */
|
|
109
|
+
export interface FormatPatch {
|
|
110
|
+
range: string;
|
|
111
|
+
style?: StylePatch | null;
|
|
112
|
+
numberFormat?: NumberFormat | null;
|
|
113
|
+
}
|
|
114
|
+
/** A display filter and sort: the data do not change. */
|
|
115
|
+
export interface SheetFilter {
|
|
116
|
+
/** Header rows at the top, which are never filtered. */
|
|
117
|
+
head: number;
|
|
118
|
+
cols?: Record<number, {
|
|
119
|
+
values?: string[];
|
|
120
|
+
text?: string;
|
|
121
|
+
}>;
|
|
122
|
+
sort?: {
|
|
123
|
+
col: number;
|
|
124
|
+
dir: 'asc' | 'desc';
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface RangeStats {
|
|
128
|
+
cells: number;
|
|
129
|
+
numbers: number;
|
|
130
|
+
sum: number;
|
|
131
|
+
min: number | null;
|
|
132
|
+
max: number | null;
|
|
133
|
+
}
|
|
134
|
+
export interface SheetInfo {
|
|
135
|
+
name: string;
|
|
136
|
+
maxRow: number;
|
|
137
|
+
maxCol: number;
|
|
138
|
+
freeze?: {
|
|
139
|
+
rows: number;
|
|
140
|
+
cols: number;
|
|
141
|
+
};
|
|
142
|
+
/** Not shown on the tabs; `very` (xlsx's veryHidden) is also not offered for Unhide, since Excel never offers it. */
|
|
143
|
+
hidden?: boolean | 'very';
|
|
144
|
+
/** Ranges that cannot be edited, with the reason for a tooltip (for example, ranges managed by a script). */
|
|
145
|
+
locked?: {
|
|
146
|
+
range: string;
|
|
147
|
+
reason: string;
|
|
148
|
+
}[];
|
|
149
|
+
/** List mode: column titles in the header instead of letters; `sortable` makes a header click sort. */
|
|
150
|
+
columns?: {
|
|
151
|
+
title: string;
|
|
152
|
+
align?: 'left' | 'center' | 'right';
|
|
153
|
+
sortable?: boolean;
|
|
154
|
+
}[];
|
|
155
|
+
/** Row numbers on the left, shown by default; a list has none. */
|
|
156
|
+
rowNumbers?: boolean;
|
|
157
|
+
/** A totals row pinned to the bottom: the displayed text for each of the sheet's columns (null: empty). */
|
|
158
|
+
totals?: (string | null)[];
|
|
159
|
+
/** Excel's outline (Data > Group): the sheet's groups of rows and columns; a sheet without groups has none. */
|
|
160
|
+
outline?: SheetOutline;
|
|
161
|
+
}
|
|
162
|
+
/** A sheet's groups as Excel draws them in the bars next to the row numbers and above the column letters. */
|
|
163
|
+
export interface SheetOutline {
|
|
164
|
+
/** Groups of rows by their first row, the outer group before the inner one when both start on the same row. */
|
|
165
|
+
rows: OutlineGroup[];
|
|
166
|
+
columns: OutlineGroup[];
|
|
167
|
+
/** A group's summary row, which holds its button, is below it (Excel's default) or above it. */
|
|
168
|
+
summaryBelow: boolean;
|
|
169
|
+
/** A group's summary column is to the right of it (Excel's default) or to the left of it. */
|
|
170
|
+
summaryRight: boolean;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A group: the rows or columns `from`..`to` (columns by number) at outline level `level` or deeper, with no such row
|
|
174
|
+
* or column adjacent to them; `level` is 1 to 7, so every row or column inside a level-2 group is also inside a level-1
|
|
175
|
+
* group. `collapsed`: its rows or columns are hidden and its button shows +.
|
|
176
|
+
*/
|
|
177
|
+
export interface OutlineGroup {
|
|
178
|
+
from: number;
|
|
179
|
+
to: number;
|
|
180
|
+
level: number;
|
|
181
|
+
collapsed: boolean;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Excel's outline commands on a sheet, each a single undo step: Group and Ungroup move entire rows or columns one level
|
|
185
|
+
* deeper or shallower (`rows: '3:6'`, `columns: 'B:D'`); collapse and expand are a group's button (Excel's Hide Detail
|
|
186
|
+
* and Show Detail), with the group identified by its rows or columns and level as `SheetOutline` returns it; `showLevel`
|
|
187
|
+
* is a level button: groups at `level` and deeper are collapsed, shallower ones expanded, and one past the deepest level
|
|
188
|
+
* expands all.
|
|
189
|
+
*/
|
|
190
|
+
export type OutlineChange = {
|
|
191
|
+
op: 'group' | 'ungroup';
|
|
192
|
+
sheet: string;
|
|
193
|
+
rows: string;
|
|
194
|
+
} | {
|
|
195
|
+
op: 'group' | 'ungroup';
|
|
196
|
+
sheet: string;
|
|
197
|
+
columns: string;
|
|
198
|
+
} | {
|
|
199
|
+
op: 'collapse' | 'expand';
|
|
200
|
+
sheet: string;
|
|
201
|
+
rows: string;
|
|
202
|
+
level: number;
|
|
203
|
+
} | {
|
|
204
|
+
op: 'collapse' | 'expand';
|
|
205
|
+
sheet: string;
|
|
206
|
+
columns: string;
|
|
207
|
+
level: number;
|
|
208
|
+
} | {
|
|
209
|
+
op: 'showLevel';
|
|
210
|
+
sheet: string;
|
|
211
|
+
axis: 'rows' | 'columns';
|
|
212
|
+
level: number;
|
|
213
|
+
};
|
|
214
|
+
/** What Excel's Find searches for and where, as set by the options of its dialog. */
|
|
215
|
+
export interface FindRequest {
|
|
216
|
+
sheet: string;
|
|
217
|
+
/** The text to find; `*` matches any characters, `?` one character, and `~` before either of them or before itself matches that character, as in Excel. */
|
|
218
|
+
query: string;
|
|
219
|
+
/** Only within this range, as Excel searches within a selection of more than one cell; the entire sheet without it. */
|
|
220
|
+
range?: string;
|
|
221
|
+
/** Match case; without it the case is ignored. */
|
|
222
|
+
matchCase?: boolean;
|
|
223
|
+
/** Match entire cell contents: the entire text matches the query, not a part of it. */
|
|
224
|
+
wholeCell?: boolean;
|
|
225
|
+
/** Look in: the text a cell opens with for editing (formulas as typed in the workbook's locale, Excel's default) or its displayed text. */
|
|
226
|
+
lookIn?: 'formulas' | 'values';
|
|
227
|
+
/** Search by columns: matches column by column; row by row without it. */
|
|
228
|
+
byColumns?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Find Next from this cell (`B12`), as Excel's Find continues from the active cell (`Range.Find`'s After): the matches in
|
|
231
|
+
* Find's order starting from the first one after it, wrapping around at the end, with the cell itself last. Without it they
|
|
232
|
+
* start from the range's first cell. A source that does not support it returns them from the first cell, and Find Next
|
|
233
|
+
* moves through the matches it returned.
|
|
234
|
+
*/
|
|
235
|
+
after?: string;
|
|
236
|
+
/** The display filter in effect: only its visible rows are searched. */
|
|
237
|
+
filter?: SheetFilter;
|
|
238
|
+
}
|
|
239
|
+
/** The matches of a search, at most as many as the source returns in one response; `total` counts them all. */
|
|
240
|
+
export interface FindResult {
|
|
241
|
+
hits: {
|
|
242
|
+
row: number;
|
|
243
|
+
col: number;
|
|
244
|
+
}[];
|
|
245
|
+
total: number;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* The outcome of Replace All and how many cells it changed (Excel's "We made N replacements"); `refused`: the cells whose
|
|
249
|
+
* new text Excel would not accept (a formula that no longer parses), left unchanged while the others are written, with the
|
|
250
|
+
* reason.
|
|
251
|
+
*/
|
|
252
|
+
export type ReplaceOutcome = EditOutcome & {
|
|
253
|
+
replaced: number;
|
|
254
|
+
refused?: {
|
|
255
|
+
sheet: string;
|
|
256
|
+
cell: string;
|
|
257
|
+
message: string;
|
|
258
|
+
}[];
|
|
259
|
+
};
|
|
260
|
+
/** With a filter, `row` is a display index (a position among the visible rows). */
|
|
261
|
+
export interface WindowRequest {
|
|
262
|
+
sheet: string;
|
|
263
|
+
row: number;
|
|
264
|
+
rows: number;
|
|
265
|
+
col: number;
|
|
266
|
+
cols: number;
|
|
267
|
+
filter?: SheetFilter;
|
|
268
|
+
}
|
|
269
|
+
export interface SheetWindow {
|
|
270
|
+
row: number;
|
|
271
|
+
col: number;
|
|
272
|
+
/** Displayed text, the window's rows × columns; an empty cell is ''. */
|
|
273
|
+
text: string[][];
|
|
274
|
+
/** Values of the same cells, used for selection totals and alignment. */
|
|
275
|
+
values: CellValue[][];
|
|
276
|
+
/** Formulas by address as they are displayed and edited (in the source's locale), without `=`. */
|
|
277
|
+
formulas: Record<string, string>;
|
|
278
|
+
/** The text each cell opens with for editing, as Excel's formula bar displays it; a cell missing from it opens empty. Without it the component produces the text from the value and the formula. */
|
|
279
|
+
editText?: Record<string, string>;
|
|
280
|
+
/** The color from the number format's section (`#RRGGBB`). */
|
|
281
|
+
colors: Record<string, string>;
|
|
282
|
+
styleIds: Record<string, number>;
|
|
283
|
+
styles: CellStyle[];
|
|
284
|
+
/** The number format code each cell is displayed with (its own, otherwise its row's or column's); a cell missing from it is General. For a toolbar. */
|
|
285
|
+
numberFormats?: Record<string, string>;
|
|
286
|
+
/** The window's column widths (in the units of xlcalc's `ColumnInput.width`, null for the default), row heights in points. */
|
|
287
|
+
widths: (number | null)[];
|
|
288
|
+
rowHeights: Record<number, number>;
|
|
289
|
+
merges: string[];
|
|
290
|
+
/** The default row height in points. */
|
|
291
|
+
defaultRowHeight?: number;
|
|
292
|
+
/** The sheet's tables, from which their header and border are drawn. */
|
|
293
|
+
tables?: {
|
|
294
|
+
name: string;
|
|
295
|
+
range: string;
|
|
296
|
+
headerRow: number;
|
|
297
|
+
}[];
|
|
298
|
+
/** The cells' conditional formatting as xlcalc calculates it: a style on top of the cell's own, a data bar, an icon, a hidden value. */
|
|
299
|
+
appearance?: Record<string, ConditionalAppearance>;
|
|
300
|
+
/** Hyperlinks: an external address, a location in the workbook (`Sheet!B12`), a tooltip, a host-specific target (such as a file of the host). */
|
|
301
|
+
links?: Record<string, {
|
|
302
|
+
href?: string;
|
|
303
|
+
location?: string;
|
|
304
|
+
tooltip?: string;
|
|
305
|
+
target?: string;
|
|
306
|
+
}>;
|
|
307
|
+
notes?: Record<string, {
|
|
308
|
+
author?: string;
|
|
309
|
+
text: string;
|
|
310
|
+
}>;
|
|
311
|
+
/** A notice above the grid (for example, "values calculated on the server"). */
|
|
312
|
+
notice?: string;
|
|
313
|
+
/** Drill-down cells (list mode): underlined, and a click or Enter emits `cellDrill`. */
|
|
314
|
+
drill?: Record<string, true>;
|
|
315
|
+
}
|
|
316
|
+
/** The window is not ready yet (the host's workbook is recalculating): the component waits and requests it again. */
|
|
317
|
+
export interface SheetPending {
|
|
318
|
+
pending: {
|
|
319
|
+
elapsedMs: number;
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export interface CellEntry {
|
|
323
|
+
sheet: string;
|
|
324
|
+
cell: string;
|
|
325
|
+
text: string | null;
|
|
326
|
+
}
|
|
327
|
+
/** Options of an edit. */
|
|
328
|
+
export interface EditOptions {
|
|
329
|
+
/** The user kept a value the cell's rule rejects, with Yes on a warning or OK on an information alert: write it without checking the rule again. */
|
|
330
|
+
accept?: true;
|
|
331
|
+
/** The text was edited starting from the cell's own text (F2, a double click, the formula bar), not typed over the cell: Excel's automatic percentage entry then adds no `%` (`6%` in a `0%` cell is 0.06). */
|
|
332
|
+
inPlace?: true;
|
|
333
|
+
}
|
|
334
|
+
/** A cell's data validation as the user sees it: Excel's dropdown of a list rule and the message displayed while the cell is selected. */
|
|
335
|
+
export interface SheetValidation {
|
|
336
|
+
/** A list rule that shows its dropdown: the items as text, in order; empty when its formula returns none. */
|
|
337
|
+
list?: string[];
|
|
338
|
+
/** The input message (in Excel, a title of up to 32 characters and text of up to 255). */
|
|
339
|
+
prompt?: {
|
|
340
|
+
title?: string;
|
|
341
|
+
text: string;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/** A data validation rule's alert for a value that violates it, as Excel displays it: stop (Retry, Cancel), warning (Continue? Yes, No, Cancel), information (OK, Cancel). */
|
|
345
|
+
export interface SheetValidationAlert {
|
|
346
|
+
severity: 'stop' | 'warning' | 'information';
|
|
347
|
+
/** The rule's title, otherwise the component's default ("Microsoft Excel"). */
|
|
348
|
+
title?: string;
|
|
349
|
+
/** The rule's message, otherwise the source's description of the rule. */
|
|
350
|
+
message: string;
|
|
351
|
+
/** The cell where the value was rejected. */
|
|
352
|
+
sheet: string;
|
|
353
|
+
cell: string;
|
|
354
|
+
}
|
|
355
|
+
export type SheetOp = Exclude<StructureOp, {
|
|
356
|
+
op: 'addTable' | 'renameTable' | 'deleteTable' | 'convertTable';
|
|
357
|
+
}>;
|
|
358
|
+
/** Columns or rows changed: a width or height set with the mouse, rows or columns hidden or unhidden, columns or rows fitted to their contents (Excel's double click on an edge). */
|
|
359
|
+
export type LayoutChange = {
|
|
360
|
+
sheet: string;
|
|
361
|
+
columns: string;
|
|
362
|
+
width?: number;
|
|
363
|
+
hidden?: boolean;
|
|
364
|
+
fit?: true;
|
|
365
|
+
} | {
|
|
366
|
+
sheet: string;
|
|
367
|
+
rows: string;
|
|
368
|
+
height?: number;
|
|
369
|
+
hidden?: boolean;
|
|
370
|
+
fit?: true;
|
|
371
|
+
};
|
|
372
|
+
export type EditOutcome = {
|
|
373
|
+
ok: true;
|
|
374
|
+
changes: CellUpdate[];
|
|
375
|
+
/** Where the selection goes after `paste`, `fill`, `undo` or `redo`: the range they filled or restored; `edit` returns none (the active cell has already moved). */
|
|
376
|
+
select?: {
|
|
377
|
+
sheet: string;
|
|
378
|
+
range: string;
|
|
379
|
+
};
|
|
380
|
+
} | {
|
|
381
|
+
ok: false;
|
|
382
|
+
/**
|
|
383
|
+
* conflict: the workbook changed elsewhere; refused: the cell is locked or the operation is not allowed;
|
|
384
|
+
* invalid: the formula does not parse (`at` is the position in the typed text); failed: anything else.
|
|
385
|
+
*/
|
|
386
|
+
reason: 'conflict' | 'refused' | 'invalid' | 'failed';
|
|
387
|
+
message: string;
|
|
388
|
+
/**
|
|
389
|
+
* The source's code for the reason, for a host that reacts to it rather than to the text. `memorySource` and
|
|
390
|
+
* `@xlcalc/vue/local` give xlcalc's codes: an outline command's `outline_deep`, `not_grouped` or `detail`, and in
|
|
391
|
+
* `./local` the code of any structure operation xlcalc refuses.
|
|
392
|
+
*/
|
|
393
|
+
code?: string;
|
|
394
|
+
at?: number;
|
|
395
|
+
/**
|
|
396
|
+
* For `invalid`: the formula Excel suggests instead in its "We found a typo in your formula" dialog, in the source's
|
|
397
|
+
* locale (unclosed parentheses closed, `=(1+2` → `=(1+2)`); the component offers to accept it and sends the edit again with it.
|
|
398
|
+
*/
|
|
399
|
+
correction?: string;
|
|
400
|
+
/** A value that violates a data validation rule (`refused`): the component displays Excel's alert, and sends the edit again with `accept` after Yes on a warning or OK on an information alert. */
|
|
401
|
+
alert?: SheetValidationAlert;
|
|
402
|
+
};
|
|
403
|
+
/** A cell's new state after an edit or a recalculation. */
|
|
404
|
+
export interface CellUpdate {
|
|
405
|
+
sheet: string;
|
|
406
|
+
cell: string;
|
|
407
|
+
text: string;
|
|
408
|
+
value: CellValue;
|
|
409
|
+
color?: string;
|
|
410
|
+
/** Only for edited cells: the formula as displayed, or null when the cell no longer has one. */
|
|
411
|
+
formula?: string | null;
|
|
412
|
+
/** Only for edited cells, from a source whose windows have `editText`: the text the cell now opens with for editing. */
|
|
413
|
+
editText?: string;
|
|
414
|
+
/** Only for edited cells, from a source whose windows have `numberFormats`: the format code the cell is now displayed with (null: General), as when a typed date sets one. */
|
|
415
|
+
numberFormat?: string | null;
|
|
416
|
+
}
|
|
417
|
+
export type SourceEvent = {
|
|
418
|
+
kind: 'changed';
|
|
419
|
+
changes: CellUpdate[];
|
|
420
|
+
}
|
|
421
|
+
/** Many or unknown things changed: read the sheets and windows again. */
|
|
422
|
+
| {
|
|
423
|
+
kind: 'reload';
|
|
424
|
+
message?: string;
|
|
425
|
+
}
|
|
426
|
+
/** Cells in these ranges may look different (conditional formats): windows that overlap them are re-read in place, keeping the sheets, sizes and display filter as they are. */
|
|
427
|
+
| {
|
|
428
|
+
kind: 'repaint';
|
|
429
|
+
ranges: {
|
|
430
|
+
sheet: string;
|
|
431
|
+
range: string;
|
|
432
|
+
}[];
|
|
433
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { CellStyle } from 'xlcalc/contract';
|
|
2
|
+
import type { SheetMessages } from './messages.js';
|
|
3
|
+
import type { EditOutcome, FormatPatch, OutlineChange, SheetOp, SheetSource, SheetWindow } from './source.js';
|
|
4
|
+
/** Properties of `SheetView`. */
|
|
5
|
+
export interface SheetViewProps {
|
|
6
|
+
source: SheetSource;
|
|
7
|
+
/** Interface texts; a partial set overrides the English defaults. */
|
|
8
|
+
messages?: Partial<SheetMessages>;
|
|
9
|
+
/** Key in the browser's storage for the frozen panes display choice and column widths; without it they last as long as the component. */
|
|
10
|
+
storageKey?: string;
|
|
11
|
+
/** A location to show: `Sheet!B12:D15`, `B7`, `Sheet`; each new object is a new jump. */
|
|
12
|
+
focus?: {
|
|
13
|
+
ref: string;
|
|
14
|
+
} | null;
|
|
15
|
+
/** The host page's address for a location; without it there is no "Link to the cell" button. */
|
|
16
|
+
cellUrl?: (ref: string) => string;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
/** Shows the formula bar above the grid; on by default. */
|
|
19
|
+
formulaBar?: boolean;
|
|
20
|
+
/** The workbook's locale for texts the component produces itself: a cell's edit text without `editText`, and selection totals. */
|
|
21
|
+
locale?: string;
|
|
22
|
+
/** Hides the tabs of a workbook with a single sheet, for hosts that want it; Excel always shows them, which is the default. */
|
|
23
|
+
hideLoneTab?: boolean;
|
|
24
|
+
/** Double-clicking a column edge restores the workbook's width, for hosts that want it; by default it fits the columns to their contents, as Excel does. */
|
|
25
|
+
edgeRestoresWidth?: boolean;
|
|
26
|
+
/** List mode: the order the host sorted the list in, shown as an arrow on the column's title; null for none. */
|
|
27
|
+
sort?: ListSort | null;
|
|
28
|
+
/** List mode: the first column opens its row (`rowOpen`), and so does Enter on a cell that is not a drill-down. */
|
|
29
|
+
openRows?: boolean;
|
|
30
|
+
/** The host opens links itself through `openLink`: for a host whose listener the component cannot see, such as a custom element's. */
|
|
31
|
+
hostLinks?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Why the workbook cannot be displayed: the source's error and its text. */
|
|
34
|
+
export interface SheetFailure {
|
|
35
|
+
error: unknown;
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
/** What `state` reports: the sheet, the selection, and the active cell's formula and displayed value. */
|
|
39
|
+
export interface SheetViewState {
|
|
40
|
+
sheet: string;
|
|
41
|
+
ref: string;
|
|
42
|
+
formula?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
/** The active cell's style, for a toolbar; absent while its window is not loaded or when it has none. */
|
|
45
|
+
style?: CellStyle;
|
|
46
|
+
/** The active cell's number format code, from a source whose windows include them; absent for General. */
|
|
47
|
+
numberFormat?: string;
|
|
48
|
+
/** The merged range containing the active cell (`A1:B2`), from the loaded windows: Excel's Merge & Center shows as pressed on it. */
|
|
49
|
+
merged?: string;
|
|
50
|
+
/** The merge commands are available (`SheetViewApi.merge`): the source has `structure`, the sheet is editable, and no display filter is on. */
|
|
51
|
+
canMerge?: true;
|
|
52
|
+
}
|
|
53
|
+
/** A hyperlink the component does not open itself, with the cell it belongs to. */
|
|
54
|
+
export type SheetLinkEvent = NonNullable<SheetWindow['links']>[string] & {
|
|
55
|
+
sheet: string;
|
|
56
|
+
cell: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* What `SheetView` exposes to its host (through a template `ref`): changes made as the sheet's own keyboard commands make
|
|
60
|
+
* them, with the outcome's selection set without a flash or a Back history entry. Each method resolves to the source's
|
|
61
|
+
* outcome, or to null when nothing was sent (the source lacks the method, the sheet is read-only, or an undo is pending).
|
|
62
|
+
*/
|
|
63
|
+
export interface SheetViewApi {
|
|
64
|
+
undo(): Promise<EditOutcome | null>;
|
|
65
|
+
redo(): Promise<EditOutcome | null>;
|
|
66
|
+
/** Formats the active sheet in one call to the source's `format`. */
|
|
67
|
+
format(patches: SheetFormatPatch[]): Promise<EditOutcome | null>;
|
|
68
|
+
/** A structure operation through the source; the sheet displayed afterwards is the one Excel displays. */
|
|
69
|
+
structure(op: SheetOp): Promise<EditOutcome | null>;
|
|
70
|
+
/** An outline command through the source (Group, Ungroup, a group's button, a level button); the sheet reloads afterwards. */
|
|
71
|
+
outline(change: OutlineChange): Promise<EditOutcome | null>;
|
|
72
|
+
/** Opens Excel's Format Cells dialog (Ctrl+1) for the selection, with the active cell's formatting; false when the sheet cannot be formatted. */
|
|
73
|
+
formatCells(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Excel's Freeze Panes through the source's `freeze`, as a single undo step, after which the sheet reloads: `panes` (the
|
|
76
|
+
* default) keeps the rows above and the columns to the left of the active cell in view (with A1 active, the middle of the
|
|
77
|
+
* viewport, where Excel splits it), `unfreeze` removes the workbook's panes, `topRow` and `firstColumn` freeze one row or
|
|
78
|
+
* column. Frozen panes are displayed whatever the lock button's earlier state; null when nothing was sent (no `freeze`,
|
|
79
|
+
* a read-only sheet, nothing to freeze or unfreeze).
|
|
80
|
+
*/
|
|
81
|
+
freezePanes(mode?: FreezeMode): Promise<EditOutcome | null>;
|
|
82
|
+
/** Excel's Reapply (Ctrl+Alt+L): applies the display filter's conditions and sort again to the current data; false when no filter is on. */
|
|
83
|
+
reapplyFilter(): Promise<boolean>;
|
|
84
|
+
/** Excel's Trace Precedents as a panel next to the grid: the source's tree of the active cell's precedents, following the active cell; false if the source has no `explain`. */
|
|
85
|
+
explain(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Excel's Merge & Center (`mergeCenter`), Merge Across, Merge Cells and Unmerge Cells over the selection through the
|
|
88
|
+
* source's `structure`, as a single undo step, with Excel's warning first when more than one cell would lose its value. null
|
|
89
|
+
* when nothing was sent: no `structure`, a read-only sheet, a display filter, a single cell outside a merged range, or Cancel
|
|
90
|
+
* in the warning.
|
|
91
|
+
*/
|
|
92
|
+
merge(command: MergeCommand): Promise<EditOutcome | null>;
|
|
93
|
+
}
|
|
94
|
+
/** A patch for `SheetView.format`: applied to its own range, or to the selection without one. */
|
|
95
|
+
export type SheetFormatPatch = Omit<FormatPatch, 'range'> & {
|
|
96
|
+
range?: string;
|
|
97
|
+
};
|
|
98
|
+
/** Excel's Freeze Panes commands: the panes of the active cell, Unfreeze Panes, Freeze Top Row, Freeze First Column. */
|
|
99
|
+
export type FreezeMode = 'panes' | 'unfreeze' | 'topRow' | 'firstColumn';
|
|
100
|
+
/** Excel's merge commands: Merge & Center on the button, and Merge Across, Merge Cells and Unmerge Cells in its dropdown. */
|
|
101
|
+
export type MergeCommand = 'mergeCenter' | 'mergeAcross' | 'mergeCells' | 'unmergeCells';
|
|
102
|
+
/** The order a list is sorted in, by a column of the sheet (1-based): the host sorts, and the sheet shows the arrow. */
|
|
103
|
+
export interface ListSort {
|
|
104
|
+
col: number;
|
|
105
|
+
dir: 'asc' | 'desc';
|
|
106
|
+
}
|
|
107
|
+
/** The source the toolbar formats through: a `SheetSource`, whose `history` tells whether Undo and Redo have a step. */
|
|
108
|
+
export type ToolbarSource = SheetSource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package's contract: every public type, in modules by area, with no code. `source` is the sheet source contract a
|
|
3
|
+
* host implements, `view` the sheet's props, state, events and methods, `memory` memorySource's types, `messages` the
|
|
4
|
+
* interface texts' keys. The `@xlcalc/vue/local` entry's types are in src/local/types.ts.
|
|
5
|
+
*/
|
|
6
|
+
export type * from './contract/source.js';
|
|
7
|
+
export type * from './contract/view.js';
|
|
8
|
+
export type * from './contract/memory.js';
|
|
9
|
+
export type * from './contract/messages.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Calls `call` with a new controller's signal; `take` or `fail` run only while `live()` holds. Returns the controller, to abort it. */
|
|
2
|
+
export declare function askSource<T>(call: (signal: AbortSignal) => Promise<T>, live: () => boolean, take: (value: T) => void, fail: () => void): AbortController;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { ScanOptions } from 'xlcalc/contract';
|
|
3
|
+
import type { SheetSource } from '../contract/source.js';
|
|
4
|
+
import type { EditorState } from './editing.js';
|
|
5
|
+
/** Items the list displays at once; Page Up and Page Down move by them. */
|
|
6
|
+
export declare const FUNCTION_ROWS = 8;
|
|
7
|
+
export interface AutocompleteDeps {
|
|
8
|
+
source: () => SheetSource;
|
|
9
|
+
editor: Ref<EditorState | null>;
|
|
10
|
+
/** The open editor's element, for its caret. */
|
|
11
|
+
input: () => HTMLTextAreaElement | null;
|
|
12
|
+
/** Shows the draft's new text with its caret in the editor. */
|
|
13
|
+
show: () => void;
|
|
14
|
+
/** How the workbook's formula text is parsed (its list separator); null while its locale loads. */
|
|
15
|
+
scan: () => ScanOptions | null;
|
|
16
|
+
}
|
|
17
|
+
/** The list's state over the editor's draft: what it displays, the highlighted item, the keys it handles, the name it inserts. */
|
|
18
|
+
export declare function useAutocomplete(deps: AutocompleteDeps): {
|
|
19
|
+
items: import("vue").ShallowRef<readonly string[], readonly string[]>;
|
|
20
|
+
index: Ref<number, number>;
|
|
21
|
+
open: import("vue").ComputedRef<boolean>;
|
|
22
|
+
update: (text: string, caret: number | null) => void;
|
|
23
|
+
follow: () => void;
|
|
24
|
+
accept: (i?: number) => boolean;
|
|
25
|
+
close: () => void;
|
|
26
|
+
onKey: (e: KeyboardEvent) => boolean;
|
|
27
|
+
};
|
|
28
|
+
export type Autocomplete = ReturnType<typeof useAutocomplete>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BorderLine, CellStyle, CellValue } from 'xlcalc/contract';
|
|
2
|
+
export type Horizontal = 'left' | 'center' | 'right' | 'fill' | 'justify' | 'distributed' | 'centerContinuous';
|
|
3
|
+
export type Vertical = 'top' | 'center' | 'bottom';
|
|
4
|
+
/** Excel's General alignment by value: numbers right, text left, booleans and errors centered. */
|
|
5
|
+
export declare function generalAlign(value: CellValue | undefined): 'left' | 'center' | 'right';
|
|
6
|
+
/** A cell's displayed horizontal alignment. */
|
|
7
|
+
export declare function horizontalOf(style: CellStyle | undefined, value: CellValue | undefined): Horizontal;
|
|
8
|
+
/** A cell's displayed vertical alignment; Excel's default is bottom. */
|
|
9
|
+
export declare function verticalOf(style: CellStyle | undefined): Vertical;
|
|
10
|
+
/** Whether the text wraps: by the style, and always for justify and distributed, as Excel does. */
|
|
11
|
+
export declare function wrapsOf(style: CellStyle | undefined): boolean;
|
|
12
|
+
/** The line width in pixels of an xlsx border style. */
|
|
13
|
+
export declare function borderWidth(line: BorderLine | undefined): number;
|
|
14
|
+
/** A CSS line: width, style and color, set as longhands (a shorthand with var() is not parsed everywhere). */
|
|
15
|
+
export interface CssLine {
|
|
16
|
+
width: string;
|
|
17
|
+
style: string;
|
|
18
|
+
color: string;
|
|
19
|
+
}
|
|
20
|
+
/** An xlsx border line as a CSS line; CSS has no dash-dot, so those are dashed. Without a color: Excel's automatic. */
|
|
21
|
+
export declare function borderCss(line: BorderLine | undefined): CssLine | undefined;
|
|
22
|
+
/** Puts a line on one side of a cell's CSS. */
|
|
23
|
+
export declare function setSide(css: Record<string, string>, side: 'Top' | 'Right' | 'Bottom' | 'Left', line: CssLine): void;
|
|
24
|
+
/** A cell's font, color and fill; `section` is the color from the number format's section, which takes precedence over the font's. */
|
|
25
|
+
export declare function fontCss(style: CellStyle | undefined, section: string | undefined): Record<string, string>;
|
|
26
|
+
/** Underline and strikethrough, for the element that holds the text: decorations do not reach an absolutely positioned overflow run. A link is underlined anyway. */
|
|
27
|
+
export declare function decorationCss(style: CellStyle | undefined, link: boolean): Record<string, string>;
|
|
28
|
+
/** Content box alignment: CSS for the box that holds the text, by horizontal and vertical alignment and indent. */
|
|
29
|
+
export declare function alignCss(h: Horizontal, indent: number): Record<string, string>;
|
|
30
|
+
/** Excel's Fill alignment repeats the text across the cell: enough copies to cover its width, with the rest clipped. */
|
|
31
|
+
export declare function fillText(text: string, widthPx: number): string;
|
|
32
|
+
/** Whether a value's text may overflow into empty neighbors: only text does, as in Excel. */
|
|
33
|
+
export declare const overflows: (value: CellValue | undefined) => boolean;
|