@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,104 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { Icon } from 'xlcalc/contract';
|
|
3
|
+
import type { Editing, EditorState } from './editing.js';
|
|
4
|
+
import type { Formula, Highlight } from './formula.js';
|
|
5
|
+
import type { Geometry } from './geometry.js';
|
|
6
|
+
import type { Navigation } from './navigation.js';
|
|
7
|
+
import type { Selection } from './selection.js';
|
|
8
|
+
import type { SheetState } from './state.js';
|
|
9
|
+
import type { Viewport } from './viewport.js';
|
|
10
|
+
import type { CellData, Windows } from './windows.js';
|
|
11
|
+
/** A merged range as drawn: its size in the workbook (box height) and in drawn rows and columns (hidden ones are not in the DOM). */
|
|
12
|
+
export interface MergeSpan {
|
|
13
|
+
rs: number;
|
|
14
|
+
cs: number;
|
|
15
|
+
rsDom: number;
|
|
16
|
+
csDom: number;
|
|
17
|
+
}
|
|
18
|
+
export type ContentKind = 'text' | 'fill' | 'overflow' | 'href' | 'place' | 'host' | 'dead' | 'icon';
|
|
19
|
+
export interface CellView {
|
|
20
|
+
attrs: {
|
|
21
|
+
class: string[];
|
|
22
|
+
style: Record<string, string>;
|
|
23
|
+
title: string;
|
|
24
|
+
rowspan?: number;
|
|
25
|
+
colspan?: number;
|
|
26
|
+
'data-cell': string;
|
|
27
|
+
};
|
|
28
|
+
box: {
|
|
29
|
+
class: string[];
|
|
30
|
+
style: Record<string, string>;
|
|
31
|
+
};
|
|
32
|
+
kind: ContentKind;
|
|
33
|
+
text: string;
|
|
34
|
+
/** Underline and strikethrough, set on the element that holds the text. */
|
|
35
|
+
deco: Record<string, string>;
|
|
36
|
+
/** Overflow into empty neighbors: the pixels taken on the left and right, the text's position, its background (hides crossed gridlines, as in Excel). */
|
|
37
|
+
ov?: {
|
|
38
|
+
left: number;
|
|
39
|
+
right: number;
|
|
40
|
+
justify: string;
|
|
41
|
+
bg: string;
|
|
42
|
+
};
|
|
43
|
+
link?: CellData['link'];
|
|
44
|
+
/** A conditional format's icon, drawn at the left of the cell before its text. */
|
|
45
|
+
icon?: Icon;
|
|
46
|
+
/** The draft typed in the formula bar replaces `text`, drawn separately so typing does not redraw the grid; `fill`: the width Excel's Fill alignment repeats it across. */
|
|
47
|
+
draft?: {
|
|
48
|
+
fill?: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** The frequently changing state that a drawn row's cells need, computed per row: a change redraws only the rows it affects. */
|
|
52
|
+
export interface RowState {
|
|
53
|
+
/** The row's height in pixels. */
|
|
54
|
+
height: number;
|
|
55
|
+
/** The selection over the row: its columns, whether the row is its top, how many rows below this one it ends (counted only as far as the row's merges reach), several cells or one; null when it does not cross the row. */
|
|
56
|
+
sel: {
|
|
57
|
+
left: number;
|
|
58
|
+
right: number;
|
|
59
|
+
top: boolean;
|
|
60
|
+
below: number;
|
|
61
|
+
multi: boolean;
|
|
62
|
+
} | null;
|
|
63
|
+
/** The active cell's column in the row; 0 for none. */
|
|
64
|
+
active: number;
|
|
65
|
+
/** The formula's ranges over the row. */
|
|
66
|
+
hl: readonly Highlight[];
|
|
67
|
+
/** Columns of the search matches in the row, and of the current one (0: not in the row). */
|
|
68
|
+
hits: ReadonlySet<number> | undefined;
|
|
69
|
+
hitNow: number;
|
|
70
|
+
/** The columns of the range just jumped to, over the row. */
|
|
71
|
+
flash: {
|
|
72
|
+
left: number;
|
|
73
|
+
right: number;
|
|
74
|
+
} | null;
|
|
75
|
+
/** The editor open on a cell of the row: its column, and whether it is the formula bar's. */
|
|
76
|
+
editor: {
|
|
77
|
+
col: number;
|
|
78
|
+
bar: boolean;
|
|
79
|
+
} | null;
|
|
80
|
+
}
|
|
81
|
+
/** Whether two states of a row draw the same. */
|
|
82
|
+
export declare function sameRowState(a: RowState, b: RowState): boolean;
|
|
83
|
+
/** Links a browser may open on its own; anything else (`javascript:` and the like) goes to the host or is only displayed. */
|
|
84
|
+
export declare const safeHref: (href: string | undefined) => boolean;
|
|
85
|
+
interface CellViewDeps {
|
|
86
|
+
editor: Ref<EditorState | null>;
|
|
87
|
+
/** Search matches by `row:col`, and the current one. */
|
|
88
|
+
find: {
|
|
89
|
+
hitSet: ComputedRef<Set<string>>;
|
|
90
|
+
current: ComputedRef<string>;
|
|
91
|
+
};
|
|
92
|
+
/** Whether the host listens to `openLink`. */
|
|
93
|
+
hostLinks: () => boolean;
|
|
94
|
+
/** List mode's `openRows`: the first column's cells open their rows. */
|
|
95
|
+
openRows: () => boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare function useCellView(s: SheetState, geo: Geometry, v: Viewport, w: Windows, sel: Selection, f: Formula, nav: Navigation, ed: Editing, deps: CellViewDeps): {
|
|
98
|
+
spanOf: (r: number, c: number) => MergeSpan | null | undefined;
|
|
99
|
+
coveredByMerge: (r: number, c: number) => boolean;
|
|
100
|
+
rowState: (d: number, r: number) => RowState;
|
|
101
|
+
cellView: (d: number, r: number, c: number, frozen: boolean, row: RowState) => CellView;
|
|
102
|
+
};
|
|
103
|
+
export type CellViews = ReturnType<typeof useCellView>;
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { CellRect } from 'xlcalc/contract';
|
|
3
|
+
import type { Commands } from './commands.js';
|
|
4
|
+
import type { Editing, EditorState } from './editing.js';
|
|
5
|
+
import type { Selection } from './selection.js';
|
|
6
|
+
import type { SheetState } from './state.js';
|
|
7
|
+
import { type Totals } from './totals.js';
|
|
8
|
+
import type { Viewport } from './viewport.js';
|
|
9
|
+
import type { Windows } from './windows.js';
|
|
10
|
+
/** The range copied or cut on the grid, as Excel's copy mode holds it; `text` is what went to the clipboard, null while it is read. */
|
|
11
|
+
export interface ClipMark {
|
|
12
|
+
sheet: string;
|
|
13
|
+
rect: CellRect;
|
|
14
|
+
text: string | null;
|
|
15
|
+
cut: boolean;
|
|
16
|
+
/** The displayed text the copy event put on the clipboard, when the source's own copy text replaced it there: pasting either counts as this copy. */
|
|
17
|
+
shown?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ClipDeps {
|
|
20
|
+
notify: (text: string) => void;
|
|
21
|
+
editor: Ref<EditorState | null>;
|
|
22
|
+
/** Whether a column is visible: Excel omits hidden ones from a copy. */
|
|
23
|
+
colShown: (col: number) => boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function useClip(s: SheetState, w: Windows, sel: Selection, v: Viewport, ed: Editing, cmd: Commands, totals: Totals, deps: ClipDeps): {
|
|
26
|
+
mark: import("vue").ShallowRef<ClipMark | null, ClipMark | null>;
|
|
27
|
+
ants: import("vue").ComputedRef<{
|
|
28
|
+
top: number;
|
|
29
|
+
left: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
frozen: boolean;
|
|
33
|
+
} | null>;
|
|
34
|
+
canCut: import("vue").ComputedRef<boolean>;
|
|
35
|
+
canPaste: import("vue").ComputedRef<boolean>;
|
|
36
|
+
clear: () => void;
|
|
37
|
+
onCopy: (e: ClipboardEvent) => void;
|
|
38
|
+
onCut: (e: ClipboardEvent) => void;
|
|
39
|
+
onPaste: (e: ClipboardEvent) => void;
|
|
40
|
+
copy: (cut: boolean) => void;
|
|
41
|
+
paste: () => Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
export type Clip = ReturnType<typeof useClip>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CellStyle } from 'xlcalc/contract';
|
|
2
|
+
import type { EditOutcome, LayoutChange, OutlineChange, SheetOp } from '../contract/source.js';
|
|
3
|
+
import type { Editing } from './editing.js';
|
|
4
|
+
import type { FreezeMode, SheetFormatPatch } from '../contract/view.js';
|
|
5
|
+
import type { Selection } from './selection.js';
|
|
6
|
+
import type { SheetState } from './state.js';
|
|
7
|
+
/** The sheet to display once the sheets are read again: by name, keeping the selection or starting over on it. */
|
|
8
|
+
export interface SheetTarget {
|
|
9
|
+
name: string;
|
|
10
|
+
keep: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CommandsDeps {
|
|
13
|
+
/** Reads the sheets and windows again; counters of reloads started and of `repaint` events received, to tell whether the source sent either during a call. */
|
|
14
|
+
reload: () => Promise<void>;
|
|
15
|
+
reloads: () => number;
|
|
16
|
+
repaints: () => number;
|
|
17
|
+
/** The sheet the next read displays. */
|
|
18
|
+
target: (t: SheetTarget | null) => void;
|
|
19
|
+
/** The active cell's displayed style. */
|
|
20
|
+
activeStyle: () => CellStyle | undefined;
|
|
21
|
+
/** Whether the workbook freezes panes on the displayed sheet, the panes Excel freezes with A1 active, and the view after a freeze. */
|
|
22
|
+
frozen: () => boolean;
|
|
23
|
+
middlePanes: () => {
|
|
24
|
+
rows: number;
|
|
25
|
+
cols: number;
|
|
26
|
+
};
|
|
27
|
+
showFreeze: (sheet: string, on: boolean) => void;
|
|
28
|
+
/** A structure operation succeeded: rows or columns may have moved, so what the sheet stores by row or column number no longer holds. */
|
|
29
|
+
structured: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** The source's methods that change the workbook beyond cells. */
|
|
32
|
+
type ChangeMethod = 'format' | 'structure' | 'layout' | 'outline' | 'freeze';
|
|
33
|
+
export declare function useCommands(s: SheetState, sel: Selection, ed: Editing, deps: CommandsDeps): {
|
|
34
|
+
can: (name: ChangeMethod) => boolean;
|
|
35
|
+
canRanges: import("vue").ComputedRef<boolean>;
|
|
36
|
+
format: (patches: SheetFormatPatch[]) => Promise<EditOutcome | null>;
|
|
37
|
+
structure: (op: SheetOp, endsCopy?: boolean) => Promise<EditOutcome | null>;
|
|
38
|
+
layout: (edit: LayoutChange) => Promise<EditOutcome | null>;
|
|
39
|
+
outline: (command: OutlineChange) => Promise<EditOutcome | null>;
|
|
40
|
+
freeze: (mode?: FreezeMode) => Promise<EditOutcome | null>;
|
|
41
|
+
fontKey: (e: KeyboardEvent) => boolean;
|
|
42
|
+
formatOpen: import("vue").Ref<boolean, boolean>;
|
|
43
|
+
openFormat: () => boolean;
|
|
44
|
+
closeFormat: () => void;
|
|
45
|
+
};
|
|
46
|
+
export type Commands = ReturnType<typeof useCommands>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BarLook, CellStyle, ConditionalStyle } from 'xlcalc/contract';
|
|
2
|
+
/** A background layer of a cell: its image, size and position. */
|
|
3
|
+
export interface Layer {
|
|
4
|
+
img: string;
|
|
5
|
+
size: string;
|
|
6
|
+
pos: string;
|
|
7
|
+
}
|
|
8
|
+
/** A rule's style on top of the cell's displayed style, as Excel applies a differential format: each field the rule sets replaces the cell's. */
|
|
9
|
+
export declare function lookStyle(style: CellStyle | undefined, rule: ConditionalStyle | undefined): CellStyle | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* A data bar as background layers, top first: the axis, the fill, the border under it. Excel draws a bar 1 px inside the
|
|
12
|
+
* cell's sides, 1 px below its top and 3 px above its bottom line (1 and 2 points at 15 points tall); a gradient is the
|
|
13
|
+
* bar's color at its axis (or start) fading toward white, the border a 1 px line around the bar, the axis a dashed 1 px
|
|
14
|
+
* line across the entire cell.
|
|
15
|
+
*/
|
|
16
|
+
export declare function barLayers(bar: BarLook): Layer[];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { CellPosition, CellRect } from 'xlcalc/contract';
|
|
3
|
+
import type { CellEntry, EditOutcome, EditOptions } from '../contract/source.js';
|
|
4
|
+
import type { AlertAnswer, SheetAlert } from './validation.js';
|
|
5
|
+
import type { Formula } from './formula.js';
|
|
6
|
+
import type { Selection } from './selection.js';
|
|
7
|
+
import type { SheetState } from './state.js';
|
|
8
|
+
import type { Windows } from './windows.js';
|
|
9
|
+
/** The cell being edited and its draft. `enter` was started by typing (arrows insert references or commit), `edit` by F2 or a double click (arrows move the caret). */
|
|
10
|
+
export interface EditorState {
|
|
11
|
+
sheet: string;
|
|
12
|
+
row: number;
|
|
13
|
+
col: number;
|
|
14
|
+
text: string;
|
|
15
|
+
initial: string;
|
|
16
|
+
mode: 'enter' | 'edit';
|
|
17
|
+
place: 'cell' | 'bar';
|
|
18
|
+
/** Where to put the caret once the editor shows; null after that. */
|
|
19
|
+
caret: number | null;
|
|
20
|
+
/** The other end of a selection to set with the caret (text dragged over in the formula bar), otherwise the caret alone. */
|
|
21
|
+
caretEnd?: number;
|
|
22
|
+
/** The editor opened with the cell's own text (F2, a double click, the formula bar), not with a key typed over the cell. */
|
|
23
|
+
inPlace: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface EditingDeps {
|
|
26
|
+
notify: (text: string) => void;
|
|
27
|
+
/** Reads the sheets and windows again (after a conflict). */
|
|
28
|
+
reload: () => Promise<void>;
|
|
29
|
+
/** Makes another sheet active: an outcome's selection on it. */
|
|
30
|
+
pickSheet: (index: number) => Promise<void>;
|
|
31
|
+
cellInput: Ref<HTMLTextAreaElement | null>;
|
|
32
|
+
barInput: Ref<HTMLTextAreaElement | null>;
|
|
33
|
+
/** A key that belongs to the sheet inside the editor too (Ctrl+Shift+U for the formula bar): true when handled. */
|
|
34
|
+
barKey?: (e: KeyboardEvent) => boolean;
|
|
35
|
+
/** Excel's Enter mode for a key in the editor: an arrow inserts a reference, enters the draft or does nothing (`refAt`); true when handled. */
|
|
36
|
+
point?: (e: KeyboardEvent) => boolean;
|
|
37
|
+
/** Excel's alert of a data validation rule for a rejected value, or the prompt for a formula that cannot be parsed, and the user's answer; without it the rejection goes to the message line. */
|
|
38
|
+
alert?: (alert: SheetAlert) => Promise<AlertAnswer>;
|
|
39
|
+
}
|
|
40
|
+
export declare function useEditing(s: SheetState, w: Windows, sel: Selection, f: Formula, editor: Ref<EditorState | null>, deps: EditingDeps): {
|
|
41
|
+
pendingAt: (row: number, col: number) => string | null | undefined;
|
|
42
|
+
forget: () => void;
|
|
43
|
+
lockIn: (rect: CellRect) => string | null;
|
|
44
|
+
lockAt: (row: number, col: number) => string | null;
|
|
45
|
+
editText: (row: number, col: number) => string;
|
|
46
|
+
startEdit: (opts: {
|
|
47
|
+
text?: string;
|
|
48
|
+
mode: "enter" | "edit";
|
|
49
|
+
place?: "cell" | "bar";
|
|
50
|
+
caret?: number;
|
|
51
|
+
caretEnd?: number;
|
|
52
|
+
}) => boolean;
|
|
53
|
+
inputOf: () => HTMLTextAreaElement | null;
|
|
54
|
+
focusEditor: () => void;
|
|
55
|
+
insertFunction: (name: string) => void;
|
|
56
|
+
ac: {
|
|
57
|
+
items: import("vue").ShallowRef<readonly string[], readonly string[]>;
|
|
58
|
+
index: Ref<number, number>;
|
|
59
|
+
open: import("vue").ComputedRef<boolean>;
|
|
60
|
+
update: (text: string, caret: number | null) => void;
|
|
61
|
+
follow: () => void;
|
|
62
|
+
accept: (i?: number) => boolean;
|
|
63
|
+
close: () => void;
|
|
64
|
+
onKey: (e: KeyboardEvent) => boolean;
|
|
65
|
+
};
|
|
66
|
+
tip: {
|
|
67
|
+
parts: import("vue").ComputedRef<import("./function-tip.js").TipPart[] | null>;
|
|
68
|
+
update: (text: string, caret: number | null) => void;
|
|
69
|
+
follow: () => void;
|
|
70
|
+
close: () => void;
|
|
71
|
+
signature: (name: string) => Promise<import("../index.js").SheetFunctionSignature | null>;
|
|
72
|
+
};
|
|
73
|
+
onEditorInput: (e: Event) => void;
|
|
74
|
+
onEditorClick: () => void;
|
|
75
|
+
commit: (dr: -1 | 0 | 1, dc: -1 | 0 | 1, refocus?: boolean) => void;
|
|
76
|
+
cancel: () => void;
|
|
77
|
+
send: (entries: CellEntry[], draft: EditorState | null, opts?: EditOptions, retype?: (text: string) => Promise<EditOutcome | undefined>) => Promise<EditOutcome | undefined>;
|
|
78
|
+
run: (call: (opts?: EditOptions) => Promise<EditOutcome>, marks: CellEntry[], draft: EditorState | null, extent: CellPosition | null, endsCopy?: boolean, retype?: (text: string) => Promise<EditOutcome | undefined>) => Promise<EditOutcome>;
|
|
79
|
+
stepHistory: (kind: "undo" | "redo") => Promise<EditOutcome | null>;
|
|
80
|
+
pasteText: (text: string) => void;
|
|
81
|
+
onGridKey: (e: KeyboardEvent) => void;
|
|
82
|
+
onEditorKey: (e: KeyboardEvent) => void;
|
|
83
|
+
onEditorBlur: (e: FocusEvent, place: "cell" | "bar") => void;
|
|
84
|
+
};
|
|
85
|
+
export type Editing = ReturnType<typeof useEditing>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { GridReference } from 'xlcalc/contract';
|
|
2
|
+
import type { Formula } from './formula.js';
|
|
3
|
+
import type { SheetState } from './state.js';
|
|
4
|
+
/** The pause after the active cell moves before the source is queried, so held-down keys do not request every cell they pass. */
|
|
5
|
+
export declare const EXPLAIN_DELAY_MS = 150;
|
|
6
|
+
/** A piece of a tree line: a reference with the sheet it is on, or text; `from` when it is after the node's arrow (its formula, where the value came from). */
|
|
7
|
+
export interface ExplainPart {
|
|
8
|
+
text: string;
|
|
9
|
+
ref?: GridReference & {
|
|
10
|
+
sheet: string;
|
|
11
|
+
};
|
|
12
|
+
from?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ExplainLine {
|
|
15
|
+
depth: number;
|
|
16
|
+
parts: ExplainPart[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The source's text as the tree's lines, as xlcalc's `explain` writes it: one node per line, each two-space indent one
|
|
20
|
+
* level, the node's reference first (`'Q 4'!A2 = 60 ← Data!A4*2`). References to cells, columns or rows on a single sheet
|
|
21
|
+
* become pieces, parsed as stored formula text, which parses addresses the same in every locale; one without a sheet name
|
|
22
|
+
* is on the sheet of its line's node, otherwise on `sheet`. Anything else (a table, a 3D reference, another workbook's) stays text.
|
|
23
|
+
*/
|
|
24
|
+
export declare function explainLines(text: string, sheet: string): ExplainLine[];
|
|
25
|
+
export declare function useExplain(s: SheetState, f: Formula): {
|
|
26
|
+
available: import("vue").ComputedRef<boolean>;
|
|
27
|
+
open: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
place: import("vue").Ref<string, string>;
|
|
29
|
+
lines: import("vue").ShallowRef<ExplainLine[], ExplainLine[]>;
|
|
30
|
+
busy: import("vue").Ref<boolean, boolean>;
|
|
31
|
+
failed: import("vue").Ref<boolean, boolean>;
|
|
32
|
+
show: () => boolean;
|
|
33
|
+
close: () => void;
|
|
34
|
+
refresh: () => void;
|
|
35
|
+
};
|
|
36
|
+
export type Explain = ReturnType<typeof useExplain>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { CellRect } from 'xlcalc/contract';
|
|
3
|
+
import type { Commands } from './commands.js';
|
|
4
|
+
import type { Editing, EditorState } from './editing.js';
|
|
5
|
+
import type { Geometry } from './geometry.js';
|
|
6
|
+
import type { Selection } from './selection.js';
|
|
7
|
+
import { type SheetState } from './state.js';
|
|
8
|
+
import type { Viewport } from './viewport.js';
|
|
9
|
+
export interface FillDeps {
|
|
10
|
+
notify: (text: string) => void;
|
|
11
|
+
editor: Ref<EditorState | null>;
|
|
12
|
+
}
|
|
13
|
+
/** A drag of the handle: the selection it fills from, the cells added so far, the pointer. */
|
|
14
|
+
export interface FillDrag {
|
|
15
|
+
from: CellRect;
|
|
16
|
+
to: CellRect | null;
|
|
17
|
+
pointer: number;
|
|
18
|
+
touch: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function useFill(s: SheetState, geo: Geometry, v: Viewport, sel: Selection, ed: Editing, cmd: Commands, deps: FillDeps): {
|
|
21
|
+
source: import("vue").ComputedRef<CellRect | null>;
|
|
22
|
+
drag: import("vue").ShallowRef<FillDrag | null, FillDrag | null>;
|
|
23
|
+
handle: import("vue").ComputedRef<{
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
frozen: boolean;
|
|
27
|
+
dragging: boolean;
|
|
28
|
+
} | null>;
|
|
29
|
+
frame: import("vue").ComputedRef<{
|
|
30
|
+
top: number;
|
|
31
|
+
left: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
frozen: boolean;
|
|
35
|
+
} | null>;
|
|
36
|
+
onDown: (e: PointerEvent) => void;
|
|
37
|
+
onMove: (e: PointerEvent) => void;
|
|
38
|
+
onUp: (e: PointerEvent) => void;
|
|
39
|
+
onCancel: () => void;
|
|
40
|
+
autofill: () => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
export type Fill = ReturnType<typeof useFill>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { SheetFilter } from '../contract/source.js';
|
|
2
|
+
import type { SheetState } from './state.js';
|
|
3
|
+
import type { Windows } from './windows.js';
|
|
4
|
+
export declare function useFilter(s: SheetState, w: Windows, notify: (text: string) => void): {
|
|
5
|
+
cols: import("vue").Ref<Record<number, {
|
|
6
|
+
values?: string[];
|
|
7
|
+
text?: string;
|
|
8
|
+
}>, Record<number, {
|
|
9
|
+
values?: string[];
|
|
10
|
+
text?: string;
|
|
11
|
+
}>>;
|
|
12
|
+
sort: import("vue").Ref<{
|
|
13
|
+
col: number;
|
|
14
|
+
dir: "asc" | "desc";
|
|
15
|
+
} | null, {
|
|
16
|
+
col: number;
|
|
17
|
+
dir: "asc" | "desc";
|
|
18
|
+
} | {
|
|
19
|
+
col: number;
|
|
20
|
+
dir: "asc" | "desc";
|
|
21
|
+
} | null>;
|
|
22
|
+
available: import("vue").ComputedRef<boolean>;
|
|
23
|
+
head: import("vue").ComputedRef<number>;
|
|
24
|
+
active: import("vue").ComputedRef<boolean>;
|
|
25
|
+
spec: import("vue").ComputedRef<SheetFilter | null>;
|
|
26
|
+
status: import("vue").ComputedRef<string>;
|
|
27
|
+
restore: () => void;
|
|
28
|
+
refresh: () => Promise<void>;
|
|
29
|
+
reapply: () => Promise<boolean>;
|
|
30
|
+
clear: () => void;
|
|
31
|
+
open: import("vue").Ref<number | null, number | null>;
|
|
32
|
+
pos: import("vue").Ref<{
|
|
33
|
+
left: number;
|
|
34
|
+
top: number;
|
|
35
|
+
}, {
|
|
36
|
+
left: number;
|
|
37
|
+
top: number;
|
|
38
|
+
} | {
|
|
39
|
+
left: number;
|
|
40
|
+
top: number;
|
|
41
|
+
}>;
|
|
42
|
+
values: import("vue").Ref<{
|
|
43
|
+
text: string;
|
|
44
|
+
count: number;
|
|
45
|
+
}[], {
|
|
46
|
+
text: string;
|
|
47
|
+
count: number;
|
|
48
|
+
}[] | {
|
|
49
|
+
text: string;
|
|
50
|
+
count: number;
|
|
51
|
+
}[]>;
|
|
52
|
+
more: import("vue").Ref<number, number>;
|
|
53
|
+
busy: import("vue").Ref<boolean, boolean>;
|
|
54
|
+
draftText: import("vue").Ref<string, string>;
|
|
55
|
+
draftSearch: import("vue").Ref<string, string>;
|
|
56
|
+
title: import("vue").ComputedRef<string>;
|
|
57
|
+
shownValues: import("vue").ComputedRef<{
|
|
58
|
+
text: string;
|
|
59
|
+
count: number;
|
|
60
|
+
}[]>;
|
|
61
|
+
isChecked: (text: string) => boolean;
|
|
62
|
+
allChecked: import("vue").ComputedRef<boolean>;
|
|
63
|
+
openFunnel: (col: number, anchor?: DOMRect) => Promise<void>;
|
|
64
|
+
close: () => void;
|
|
65
|
+
toggleValue: (text: string) => void;
|
|
66
|
+
toggleAll: () => void;
|
|
67
|
+
applyDraft: () => void;
|
|
68
|
+
clearColumn: (c: number) => void;
|
|
69
|
+
sortBy: (c: number, dir: "asc" | "desc") => void;
|
|
70
|
+
onFunnelKey: (e: KeyboardEvent) => void;
|
|
71
|
+
};
|
|
72
|
+
export type Filter = ReturnType<typeof useFilter>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CellPosition } from 'xlcalc/contract';
|
|
2
|
+
import type { EditOutcome } from '../contract/source.js';
|
|
3
|
+
import type { Selection } from './selection.js';
|
|
4
|
+
import type { SheetState } from './state.js';
|
|
5
|
+
/** The options of Excel's Find dialog. */
|
|
6
|
+
export interface FindOptions {
|
|
7
|
+
matchCase: boolean;
|
|
8
|
+
wholeCell: boolean;
|
|
9
|
+
lookIn: 'formulas' | 'values';
|
|
10
|
+
byColumns: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A change sent to the source as an edit is sent (`Editing.run`): its outcome applied to the windows, a rejection reported. */
|
|
13
|
+
export type FindRunner = (call: () => Promise<EditOutcome>) => Promise<EditOutcome>;
|
|
14
|
+
export declare function useFind(s: SheetState, sel: Selection, notify: (text: string) => void): {
|
|
15
|
+
available: import("vue").ComputedRef<boolean>;
|
|
16
|
+
canReplace: import("vue").ComputedRef<boolean>;
|
|
17
|
+
isOpen: import("vue").Ref<boolean, boolean>;
|
|
18
|
+
replacing: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
optionsOpen: import("vue").Ref<boolean, boolean>;
|
|
20
|
+
text: import("vue").Ref<string, string>;
|
|
21
|
+
by: import("vue").Ref<string, string>;
|
|
22
|
+
options: {
|
|
23
|
+
matchCase: boolean;
|
|
24
|
+
wholeCell: boolean;
|
|
25
|
+
lookIn: "formulas" | "values";
|
|
26
|
+
byColumns: boolean;
|
|
27
|
+
};
|
|
28
|
+
lookIn: import("vue").ComputedRef<"formulas" | "values">;
|
|
29
|
+
scope: import("vue").Ref<string | null, string | null>;
|
|
30
|
+
hits: import("vue").Ref<{
|
|
31
|
+
row: number;
|
|
32
|
+
col: number;
|
|
33
|
+
}[], CellPosition[] | {
|
|
34
|
+
row: number;
|
|
35
|
+
col: number;
|
|
36
|
+
}[]>;
|
|
37
|
+
total: import("vue").Ref<number, number>;
|
|
38
|
+
index: import("vue").ComputedRef<number>;
|
|
39
|
+
busy: import("vue").Ref<boolean, boolean>;
|
|
40
|
+
writing: import("vue").Ref<boolean, boolean>;
|
|
41
|
+
input: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
42
|
+
hitSet: import("vue").ComputedRef<Set<string>>;
|
|
43
|
+
current: import("vue").ComputedRef<string>;
|
|
44
|
+
openFind: () => void;
|
|
45
|
+
openReplace: () => void;
|
|
46
|
+
closeFind: () => void;
|
|
47
|
+
step: (dir: 1 | -1) => void;
|
|
48
|
+
replaceOne: (run: FindRunner) => Promise<void>;
|
|
49
|
+
replaceAll: (run: FindRunner) => Promise<void>;
|
|
50
|
+
onFindKey: (e: KeyboardEvent) => void;
|
|
51
|
+
status: import("vue").ComputedRef<string>;
|
|
52
|
+
};
|
|
53
|
+
export type Find = ReturnType<typeof useFind>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { GridReference, ScanOptions } from 'xlcalc/contract';
|
|
3
|
+
import type { Selection } from './selection.js';
|
|
4
|
+
import type { SheetState } from './state.js';
|
|
5
|
+
import type { Windows } from './windows.js';
|
|
6
|
+
/** A piece of a formula as the formula bar displays it; a reference carries its range and color. */
|
|
7
|
+
export interface FormulaPart {
|
|
8
|
+
text: string;
|
|
9
|
+
ref?: GridReference;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function useFormula(s: SheetState, w: Windows, sel: Selection, draft: Ref<string | null>): {
|
|
13
|
+
formulaAt: (row: number, col: number) => string | undefined;
|
|
14
|
+
selectedFormula: import("vue").ComputedRef<string>;
|
|
15
|
+
selectedValue: import("vue").ComputedRef<string>;
|
|
16
|
+
shownFormula: import("vue").ComputedRef<string>;
|
|
17
|
+
scanOptions: () => ScanOptions | null;
|
|
18
|
+
formulaParts: import("vue").ComputedRef<FormulaPart[]>;
|
|
19
|
+
refSheet: (ref: {
|
|
20
|
+
sheet?: string;
|
|
21
|
+
}) => number;
|
|
22
|
+
sheetIndexByName: (name: string) => number;
|
|
23
|
+
highlights: import("vue").ComputedRef<{
|
|
24
|
+
ref: GridReference;
|
|
25
|
+
color: string;
|
|
26
|
+
bottom: number;
|
|
27
|
+
right: number;
|
|
28
|
+
top: string;
|
|
29
|
+
under: string;
|
|
30
|
+
start: string;
|
|
31
|
+
end: string;
|
|
32
|
+
tint: string;
|
|
33
|
+
}[]>;
|
|
34
|
+
highlightAt: (row: number, col: number, hl?: readonly Highlight[]) => {
|
|
35
|
+
edges: string[];
|
|
36
|
+
tints: string[];
|
|
37
|
+
} | null;
|
|
38
|
+
};
|
|
39
|
+
export type Formula = ReturnType<typeof useFormula>;
|
|
40
|
+
/** A highlighted range with its border sides and tint. */
|
|
41
|
+
export type Highlight = Formula['highlights']['value'][number];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { ScanOptions } from 'xlcalc/contract';
|
|
3
|
+
import type { SheetFunctionSignature, SheetSource } from '../contract/source.js';
|
|
4
|
+
import type { EditorState } from './editing.js';
|
|
5
|
+
/** A piece of the tooltip's text; the argument at the caret is `current`. */
|
|
6
|
+
export interface TipPart {
|
|
7
|
+
text: string;
|
|
8
|
+
current?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The tooltip in pieces with the argument at `index` current; beyond the list, the repeating group continues with its
|
|
12
|
+
* numbers counted up until it includes the argument (`SUM(number1, [number2], [number3], ...)`), as Excel's tooltip does.
|
|
13
|
+
* A text that does not contain the names in order is displayed as a whole, with nothing current.
|
|
14
|
+
*/
|
|
15
|
+
export declare function tipParts(sig: SheetFunctionSignature, index: number): TipPart[];
|
|
16
|
+
export interface FunctionTipDeps {
|
|
17
|
+
source: () => SheetSource;
|
|
18
|
+
editor: Ref<EditorState | null>;
|
|
19
|
+
/** The open editor's element, for its caret. */
|
|
20
|
+
input: () => HTMLTextAreaElement | null;
|
|
21
|
+
/** How the workbook's formula text is parsed; null while its locale loads. */
|
|
22
|
+
scan: () => ScanOptions | null;
|
|
23
|
+
/** The function list is open: it takes precedence, and the tooltip waits under it. */
|
|
24
|
+
listOpen: () => boolean;
|
|
25
|
+
}
|
|
26
|
+
/** The tooltip's state over the editor's draft: the signature of the call at the caret and its argument, requested once per name. */
|
|
27
|
+
export declare function useFunctionTip(deps: FunctionTipDeps): {
|
|
28
|
+
parts: import("vue").ComputedRef<TipPart[] | null>;
|
|
29
|
+
update: (text: string, caret: number | null) => void;
|
|
30
|
+
follow: () => void;
|
|
31
|
+
close: () => void;
|
|
32
|
+
signature: (name: string) => Promise<SheetFunctionSignature | null>;
|
|
33
|
+
};
|
|
34
|
+
export type FunctionTip = ReturnType<typeof useFunctionTip>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Ref, type ShallowRef } from 'vue';
|
|
2
|
+
/** A column's resizing limits, in pixels. */
|
|
3
|
+
export declare const MIN_COL_PX = 20;
|
|
4
|
+
export declare const MAX_COL_PX = 900;
|
|
5
|
+
/** A column width as xlsx stores it, in whole pixels in the library's geometry (Excel for Mac's, 53 points without a width), the one xlcalc uses to lay out `####`, overflow and wrapping. */
|
|
6
|
+
export declare function colPx(width: number | null | undefined): number;
|
|
7
|
+
/** Pixels back to the stored width, in whole points as the library stores them. */
|
|
8
|
+
export declare const widthFromPx: (px: number) => number;
|
|
9
|
+
/** Points to pixels at 96 dpi. */
|
|
10
|
+
export declare const rowPx: (pt: number) => number;
|
|
11
|
+
/** A row dragged by its edge: down to 2 px, up to Excel's tallest row. */
|
|
12
|
+
export declare const MIN_ROW_PX = 2;
|
|
13
|
+
export declare const MAX_ROW_PX: number;
|
|
14
|
+
/** Pixels back to points, rounded to Excel's quarter point. */
|
|
15
|
+
export declare const ptFromPx: (px: number) => number;
|
|
16
|
+
/** A font size in points to the grid's pixels: 11 pt is the grid's base 12.5 px, the rest in proportion. */
|
|
17
|
+
export declare const fontPx: (pt: number) => number;
|
|
18
|
+
/** Prefix sums: out[i] is the far edge of item i (out[0] = 0). */
|
|
19
|
+
export declare function prefixSums(count: number, sizeOf: (i: number) => number): Float64Array;
|
|
20
|
+
/** The item under an offset, by binary search over prefix sums; clamped to 1..count. */
|
|
21
|
+
export declare function indexAt(offsets: Float64Array, count: number, x: number): number;
|
|
22
|
+
interface GeometryInput {
|
|
23
|
+
rowCount: Readonly<Ref<number>>;
|
|
24
|
+
colCount: Readonly<Ref<number>>;
|
|
25
|
+
/** Column widths as the workbook stores them (null: the default). */
|
|
26
|
+
bookWidths: ShallowRef<Map<number, number | null>>;
|
|
27
|
+
/** Widths set with the mouse, in pixels by column; they take precedence over the workbook's. */
|
|
28
|
+
userWidths: ShallowRef<Record<number, number>>;
|
|
29
|
+
/** Row heights in pixels that differ from the default (0 hides a row): changed in place through `setHeights`, or replaced as a whole. */
|
|
30
|
+
heights: ShallowRef<Map<number, number>>;
|
|
31
|
+
defaultRowPx: Ref<number>;
|
|
32
|
+
/** The display filter in effect: another one is another order of rows. */
|
|
33
|
+
visible: Readonly<Ref<unknown>>;
|
|
34
|
+
/** The sheet row displayed at a display index (heights are the sheet rows') and back. */
|
|
35
|
+
rowOf: (d: number) => number;
|
|
36
|
+
indexOf: (r: number) => number | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Offsets of columns and rows, and the item under an offset; rows are display indexes (`d`). */
|
|
39
|
+
export declare function useGeometry(i: GeometryInput): {
|
|
40
|
+
widthOf: (c: number) => number;
|
|
41
|
+
heightOf: (d: number) => number;
|
|
42
|
+
offsets: import("vue").ComputedRef<Float64Array<ArrayBufferLike>>;
|
|
43
|
+
setHeights: (rows: Iterable<readonly [number, number | undefined]>) => boolean;
|
|
44
|
+
rowOffsets: import("vue").ComputedRef<Float64Array<ArrayBufferLike>>;
|
|
45
|
+
colAt: (x: number) => number;
|
|
46
|
+
rowAt: (y: number) => number;
|
|
47
|
+
nextRow: (d: number, dir: 1 | -1) => number;
|
|
48
|
+
nextCol: (c: number, dir: 1 | -1) => number;
|
|
49
|
+
hasRow: (d: number, dir: 1 | -1) => boolean;
|
|
50
|
+
hasCol: (c: number, dir: 1 | -1) => boolean;
|
|
51
|
+
spanHeight: (d: number, rs?: number) => number;
|
|
52
|
+
spanWidth: (c: number, cs?: number) => number;
|
|
53
|
+
};
|
|
54
|
+
export type Geometry = ReturnType<typeof useGeometry>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A shortcut's Latin letter: the key's own, otherwise its position on the keyboard (`KeyB` under Russian `и`); '' for anything else. */
|
|
2
|
+
export declare function shortcutLetter(e: KeyboardEvent): string;
|
|
3
|
+
/** Whether it is a Mac, where Excel ends a copy's text without a line break (Windows with CRLF), drags a series with Option and names Cmd in tooltips. */
|
|
4
|
+
export declare const onMac: () => boolean;
|
|
5
|
+
/** Ctrl or Cmd held: Excel's shortcuts accept either, Cmd on a Mac. */
|
|
6
|
+
export declare const isMod: (e: KeyboardEvent | MouseEvent) => boolean;
|
|
7
|
+
/** A shortcut and not a character: Ctrl alone or Cmd; AltGr arrives as Ctrl+Alt and types characters (`@`, `[` on many layouts). */
|
|
8
|
+
export declare const isShortcut: (e: KeyboardEvent) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** How far a key moves a list's highlight: one item, a page of `page` items, or the entire list (Home, End); null for another key. */
|
|
2
|
+
export declare function listStep(key: string, count: number, page: number): number | null;
|
|
3
|
+
/** The item `by` steps from `index` among `count` (at least one), clamped to the list; from none (-1), Down goes to the first and Up to the last. */
|
|
4
|
+
export declare function stepIndex(index: number, by: number, count: number): number;
|