@aiquants/spreadsheet 0.20.3 → 0.21.1
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 +67 -0
- package/README.md +56 -15
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +60 -20
- package/dist/index.d.ts +60 -20
- package/dist/index.js +4764 -4682
- package/dist/styles/spreadsheet.css +1 -1
- package/dist/styles/spreadsheet.standalone.css +1 -1
- package/package.json +6 -3
- package/src/Spreadsheet.tsx +117 -10
- package/src/index.ts +1 -1
- package/src/keyboard/compositionGuard.ts +15 -9
- package/src/model/dataAdapter.ts +48 -0
- package/src/overlay/SelectionOverlay.tsx +9 -8
- package/src/selection/useSelectionEngine.ts +192 -21
- package/src/styles/spreadsheet.css +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@aiquants/spreadsheet` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.21.1 (2026-11-19)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **The keydown guard's composition clause is `@aiquants/input-method`'s `isInputMethodKey`** (a new dependency,
|
|
10
|
+
installed with the package): a keydown of a composition (`isComposing`, or keyCode 229) is still never a command, in
|
|
11
|
+
the grid's keymap and in every popover alike, now under the rule the workspace's packages share. The guard's other
|
|
12
|
+
clause — Enter / Escape within 50 ms after `compositionend` (Safari's order) — stays the package's own and is
|
|
13
|
+
unchanged.
|
|
14
|
+
|
|
15
|
+
## 0.21.0 (2026-11-19)
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **Finger and pen editing — the `touchEditing` prop** (default `false`). A finger or a pen (`pointerType` `"touch"` /
|
|
20
|
+
`"pen"`) used to scroll only. With the prop:
|
|
21
|
+
- A tap on a body cell selects it alone, through the gates of a mouse click: an open editor commits first (a refused
|
|
22
|
+
commit keeps it open and the tap stops), and a tap on the editing cell itself keeps editing. A press that pans 6 px
|
|
23
|
+
or more (the tap slop of the header taps), a press the browser cancels, a press released on another cell, a press a
|
|
24
|
+
second finger interrupts and a press that only stopped the moving list (`didPressStopScrollMotion` of
|
|
25
|
+
`@aiquants/virtualscroll` 3.28.0 — as in a native list, a tap during a fling only stops it) are no tap. The tap's
|
|
26
|
+
own press has its default prevented, so the compatibility mouse press cannot pull the focus onto the grid root; the
|
|
27
|
+
pan is decided by `touch-action` and still scrolls.
|
|
28
|
+
- A tap on the active cell (the second tap of a double tap too) opens its editor through the same invitation gate as
|
|
29
|
+
the mouse double-click (G2: none on a read-only cell, where G1 refuses and `onReadOnlyRejected` speaks), and inside
|
|
30
|
+
the tap it writes the attribute (`flushSync`) and moves the focus from the hidden input to the root and back
|
|
31
|
+
(`onRootFocus` returns it within the event — an in-grid move, no grid exit, no commit). iOS shows the on-screen
|
|
32
|
+
keyboard only for a focus inside a user gesture and Chromium only for a focus-driven update. `raiseVirtualKeyboard`
|
|
33
|
+
stays the one raising funnel.
|
|
34
|
+
- A long-press — held still within the tap slop for 500 ms — calls `onCellContextMenu(cell, { kind: "pointer", event })`
|
|
35
|
+
the way a right-click does (an open editor commits first, a cell outside the selection becomes the selection, then
|
|
36
|
+
the menu; `event` is the press, at the pressed point); the release after it moves nothing. The native `contextmenu`
|
|
37
|
+
of a touch / pen press has its default prevented, and the rows carry `-webkit-touch-callout: none` and
|
|
38
|
+
`user-select: none`, so the menu has one channel.
|
|
39
|
+
- While a formula points, a tap does nothing (references are inserted by mouse and keyboard). Range selection, the fill
|
|
40
|
+
handle, the resize grips and formula pointing stay mouse-only; the sort header's tap is unchanged.
|
|
41
|
+
Without the prop the DOM and the behaviour are those of 0.20.3 (the engine records no body-cell touch / pen press, reads
|
|
42
|
+
no extra layout, and leaves the native `contextmenu` alone).
|
|
43
|
+
- **`getCellInputMode(row, col)` — the 13th optional adapter member** (a non-aspect capability) returning a `CellInputMode`
|
|
44
|
+
(`"text"` / `"decimal"` / `"numeric"` / `"tel"` / `"search"` / `"email"` / `"url"` — the new public type). While the grid
|
|
45
|
+
invites a keyboard (the mouse double-click or a `touchEditing` tap), the hidden input's `inputmode` is the active cell's
|
|
46
|
+
answer instead of the fixed `"text"`; any other value is a `RangeError` at render naming the cell and the value. The
|
|
47
|
+
attribute changes only with the invitation's raise and withdrawal and with the active cell moving while invited (after
|
|
48
|
+
a commit), so it never changes inside a composition. Undeclared = `"text"` = the previous attribute.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- **Breaking (0.x): `@aiquants/virtualscroll` 3.28.0 or later.** The peer range rises from `^3.24.0` to `^3.28.0`, the
|
|
53
|
+
first engine that marks the press that stopped a pane's running inertia (`didPressStopScrollMotion`). The
|
|
54
|
+
`touchEditing` tap reads it so that a tap during a fling only stops the list; the package imports the function, so a
|
|
55
|
+
host that never turns `touchEditing` on needs the newer engine too.
|
|
56
|
+
|
|
57
|
+
### Verification
|
|
58
|
+
|
|
59
|
+
- **公開面**: 公開面は `index.ts` の値 44 + 型 112 = 156 export (型 `CellInputMode` を追加)。
|
|
60
|
+
- **DOM 属性**: `data-aqsp-touch-editing` (`touchEditing` の表の根) の 1 種を追加 — リテラル census は 99 種 (dataset 直書きの同値抑止
|
|
61
|
+
署名キー 4 種を加えた総数は 103。分冊 05 §10・分冊 00 §3.2)。渡さない表には付かない。
|
|
62
|
+
- **検証 — 走行台帳 (census の錨は本未リリース節)**: 単体 / 統合 **108 ファイル 4,517 テスト** 全緑 — 0.20.3 出荷時の
|
|
63
|
+
106 ファイル 4,492 に v0.21.0 進行分 +25 (新規 `touchEditing` 20 — 渡さない表・叩きで選ぶ・叩きにならない押下・選んでいる
|
|
64
|
+
マスの叩きで属性を書いてから焦点を当て直す・二度叩き・読み取り専用のマス・編集中の叩き・数式の参照の指し示しの間の叩き・
|
|
65
|
+
`getCellInputMode`・長押し・素の contextmenu・アンマウント、新規デモ `touchPage` 4 — `/touch` のカタログ、0.20.3 節の出荷時凍結ピンで `hxCensus` +1)。
|
|
66
|
+
- **検証 — E2E**: 新規 `touch-editing` 4 (デモ `/touch` — Chromium の `hasTouch` と CDP の指の出来事で、叩きで選び、選んで
|
|
67
|
+
いるマスの叩きでエディタと受け口の焦点と `inputmode="decimal"`、長押しの品書き、なぞり、はじいた流れを止める叩き)。E2E の
|
|
68
|
+
総数は 28 ファイル 313 テスト。
|
|
69
|
+
- **触れていないこと**: 実機の指 (iOS Safari・Android Chrome) — 画面のキーボードが本当に出るか、素の長押しの品書きと
|
|
70
|
+
吹き出しが出ないか、二度叩きで頁が拡大しないか。
|
|
71
|
+
|
|
5
72
|
## 0.20.3 (2026-11-19)
|
|
6
73
|
|
|
7
74
|
### Added
|
package/README.md
CHANGED
|
@@ -59,7 +59,8 @@ deep-reach proof route.
|
|
|
59
59
|
pnpm add @aiquants/spreadsheet @aiquants/virtualscroll
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
`react` / `react-dom` (`^19.2`) and `@aiquants/virtualscroll` are peer dependencies (the ranges are `peerDependencies` in the published `package.json`; the code itself needs virtualscroll 3.
|
|
62
|
+
`react` / `react-dom` (`^19.2`) and `@aiquants/virtualscroll` are peer dependencies (the ranges are `peerDependencies` in the published `package.json`; the code itself needs virtualscroll 3.28.0 or later, which marks the press that stopped a fling — `didPressStopScrollMotion`, read by the `touchEditing` tap; 3.24.0 brought the bars that can leave their arrow buttons out for `scrollBarControls`).
|
|
63
|
+
`@aiquants/input-method` is a dependency, installed with the package: the keydown guard of the grid and its popovers takes from it whether a key belongs to an IME composition.
|
|
63
64
|
|
|
64
65
|
> **Browser floor**: the built-in cell display formats (v0.7) require `Intl.NumberFormat` v3
|
|
65
66
|
> (string mathematical-value input + `signDisplay: "negative"`) — **Chrome/Edge 106+, Firefox 116+,
|
|
@@ -129,6 +130,7 @@ The host element must have a resolvable height — the grid fills its parent.
|
|
|
129
130
|
| `getRangeExtrema(range)` / `evaluateFormula(formula, cell)` | **Optional capabilities** (v0.8) consumed by the rules above: `getRangeExtrema` returns `{ min, max }` (or `null` = no numeric value) for a `colorScale` point without `value` — called once per rule range per render version and memoised; `evaluateFormula` receives a `customFormula` verbatim (no reference shifting — you own relative semantics) and a `custom` validation formula at commit, truth = `true` or a finite non-zero number. Undeclared ⇒ the rules that need them are skipped (nothing is substituted). |
|
|
130
131
|
| `isCellReadOnly(row, col)` | **Optional capability** (v0.10 — the 11th optional member, a non-aspect capability). `true` marks the cell read-only: no edit session can open on it (all six entries, including the touch on-screen-keyboard invitation, refuse **before** any side effect), an already-open session's commit is live re-checked, and every write producer whose target set contains one read-only cell — Delete, paste, cut (both the Ctrl+X arming and the move-time source re-check), fill (diagonal L-legs decomposed exactly), format, self-calc, annotations — refuses the **whole operation** before the adapter is reached (Excel-style, never a per-cell skip). Painted read-only cells carry `aria-readonly="true"` + `data-aqsp-readonly` (no package CSS — style the attribute yourself); refusals fire the single sealed callback `onReadOnlyRejected` (+ opt-in `formatReadOnlyAnnouncement` for the live region) and never reuse `onEditRejected` / `onOperationRejected`. Reading stays legal: copying from read-only cells, filling **from** a read-only source into editable cells, and viewing existing notes / comments / links (content-aware chords open viewer-mode popovers with the commit affordance disabled). The predicate is a **live read** — no memoization; publish changes through `dataVersion` (or an adapter swap) like every other read. It is called with in-grid coordinates only, on gesture paths and for painted cells, so budget O(1) per call without allocating; a throw propagates uncaught (fail-fast, never swallowed). Undeclared ⇒ every cell is editable and the DOM / callbacks are byte-identical to v0.9 (a capability branch, not a fallback). Reference: the `/readonly` demo. |
|
|
131
132
|
| `getCellAttributes(row, col)` | **Optional capability** (v0.12 — the 12th optional member, a non-aspect capability, ADR-32). Returns host-owned `data-*` attributes for one cell (or `null` for none); they are stamped **verbatim** onto the package-owned cell element (`[data-aqsp-cell]`), so host CSS can target cell state, `:hover` and theme tokens without wrapper elements inside the cell — the package never interprets the values. Validated fail-fast at render (RangeError): the return must be a plain record or `null`, keys are lowercase `data-[a-z0-9-]+` only, the package- and engine-emitted cell attributes (`data-aqsp*`, `data-aqvs*`, `data-row`, `data-col`) are reserved, and values must be strings. It is read once per painted cell per slice (the `getCellText` cost budget — keep it O(1)); publish changes through `dataVersion`. Undeclared ⇒ the cell DOM is byte-identical to v0.11. |
|
|
133
|
+
| `getCellInputMode(row, col)` | **Optional capability** (v0.21 — the 13th optional member, a non-aspect capability). The on-screen keyboard the cell asks for, a `CellInputMode` (`"text"` / `"decimal"` / `"numeric"` / `"tel"` / `"search"` / `"email"` / `"url"`): while the grid invites a keyboard (an editor opened by a pointer — the mouse double-click or a `touchEditing` tap) the hidden input's `inputmode` is the active cell's answer, so a numeric column can bring up the number pad. Undeclared = `"text"`. Any other value is a `RangeError` at render naming the cell and the value. Read at every render (publish changes via `dataVersion`); O(1), allocation-free. |
|
|
132
134
|
|
|
133
135
|
- **Adapter identity is the sheet identity.** Replacing the adapter object means "sheet switch": selection resets to A1, any in-flight drag, editing session and open popover are terminated (value-discarding, exactly like Excel switching sheets — nothing is ever committed across a swap), an armed
|
|
134
136
|
**copy** is discarded, and an armed **cut** is kept as a *foreign* clip (`onClipChange({ kind: "cut", range, foreign: true })`, its marquee hidden) so the next `Ctrl+V` on the new sheet is a **cross-sheet move** — the target sheet is written first, then the source sheet is cleared under the same
|
|
@@ -518,9 +520,11 @@ keyboard input — this is what makes IME composition, clipboard events, and 16M
|
|
|
518
520
|
- The hidden input's `inputmode` is a **virtual-keyboard invitation**, not a mirror of the editing session — and not an idle
|
|
519
521
|
/ editing predicate. It starts as `inputmode="none"`, and for keyboard and IME users it stays `"none"` forever (F2, a
|
|
520
522
|
printable key, or a composition opens the editor without touching the attribute): a touch / pen tap does not summon a
|
|
521
|
-
virtual keyboard (touch / pen is scroll-only — a tap never selects a cell or opens the
|
|
522
|
-
`onCellContextMenu`, and every press gate is mouse-only
|
|
523
|
-
|
|
523
|
+
virtual keyboard by itself (without `touchEditing` touch / pen is scroll-only — a tap never selects a cell or opens the
|
|
524
|
+
editor, a long-press never fires `onCellContextMenu`, and every press gate is mouse-only; with it, see "Finger and pen").
|
|
525
|
+
Only an editor opened by pointer (the double-click, or a `touchEditing` tap on the active cell — the ways a
|
|
526
|
+
keyboard-less device can open one) raises the invitation (the attribute becomes the active cell's `getCellInputMode`,
|
|
527
|
+
`"text"` when undeclared), so a pointer-driven session on a
|
|
524
528
|
keyboard-less device whose pointer reports as `mouse` (iPad + trackpad, a tablet mode with a mouse) can get the on-screen
|
|
525
529
|
keyboard. The invitation then outlives the session: it stays `"text"` through Enter / Tab commits and Escape and through
|
|
526
530
|
the idle state after them ("type → Enter → type" keeps the keyboard), and is withdrawn only when focus really leaves the
|
|
@@ -528,9 +532,9 @@ keyboard input — this is what makes IME composition, clipboard events, and 16M
|
|
|
528
532
|
input must not summon the keyboard). A touch / pen press during an open session — caret placement or scrolling — leaves it
|
|
529
533
|
alone, so a user typing on the on-screen keyboard is not robbed of it; the withdrawal comes with the next idle touch / pen
|
|
530
534
|
press after the session ends. Because the imperative `startEdit` deliberately opens the editor **without** raising the invitation (it never
|
|
531
|
-
touches `inputmode`), the mouse double-click
|
|
532
|
-
button calling `handle.startEdit`) opens the editor but cannot summon the
|
|
533
|
-
a defect. The attribute therefore changes only on pointer and focus events (the double-click, whose press
|
|
535
|
+
touches `inputmode`), the pointer channels (the mouse double-click and the `touchEditing` tap) are the only invitations: a
|
|
536
|
+
consumer-rendered "Edit" control (a toolbar button calling `handle.startEdit`) opens the editor but cannot summon the
|
|
537
|
+
on-screen keyboard — a documented limitation, not a defect; with `touchEditing` a tap on the active cell is the way. The attribute therefore changes only on pointer and focus events (the double-click, whose press
|
|
534
538
|
gate has already committed any composition; an idle touch / pen press; a real grid exit, whose blur finishes a composition
|
|
535
539
|
before the focusout) and never inside an IME composition that has a session (the only session-less composition is one
|
|
536
540
|
started while a drag is in flight — `startEdit` bails on `isDragging` — and the idle sink's self-heal re-arms on every
|
|
@@ -689,10 +693,46 @@ The grid's own resize affordances are small on purpose, and the grid does not tr
|
|
|
689
693
|
row of 45 px or more makes it 44 × 44 — see "Sorting and filtering from the header"), and Alt+↓ on the header cell
|
|
690
694
|
opens the same menu.
|
|
691
695
|
|
|
696
|
+
## Finger and pen (`touchEditing`)
|
|
697
|
+
|
|
698
|
+
By default a finger or a pen only scrolls the grid: a tap never selects a cell or opens the editor, and a long-press never
|
|
699
|
+
fires `onCellContextMenu`. Pass `touchEditing` to let them select, write and open the row menu:
|
|
700
|
+
|
|
701
|
+
```tsx
|
|
702
|
+
<Spreadsheet adapter={adapter} touchEditing onCellContextMenu={openRowMenu} />
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
| Gesture (finger or pen) | Without `touchEditing` | With `touchEditing` |
|
|
706
|
+
| --- | --- | --- |
|
|
707
|
+
| Tap a cell | Nothing (the press scrolls) | Selects the cell alone, through the gates of a mouse click (an open editor commits first; a refused commit keeps it open) |
|
|
708
|
+
| Tap the active cell (the second tap of a double tap too) | Nothing | Opens its editor and, inside the same tap, the on-screen keyboard |
|
|
709
|
+
| Long-press a cell (500 ms, held within 6 px) | Nothing | `onCellContextMenu(cell, { kind: "pointer", event })` — a cell outside the selection becomes the selection first; the release after it moves nothing |
|
|
710
|
+
| Pan | Scrolls | Scrolls; the release after a pan is no tap |
|
|
711
|
+
| Tap while a fling still moves the list | Stops the fling | Stops the fling and selects nothing (`didPressStopScrollMotion` of `@aiquants/virtualscroll`) |
|
|
712
|
+
|
|
713
|
+
- **The editor's keyboard**: the hidden input's `inputmode` becomes the active cell's `getCellInputMode` (`"text"` when the
|
|
714
|
+
adapter does not declare it), so a numeric column can ask for `"decimal"`. iOS shows the on-screen keyboard only for a
|
|
715
|
+
focus inside a user gesture, and Chromium only for a focus-driven update, so the grid writes the attribute and moves the
|
|
716
|
+
focus back to the hidden input inside the tap (an in-grid move: no grid exit, no commit).
|
|
717
|
+
- **The same paths as the mouse**: read-only cells, the editing rejections (`onEditRejected`, `onReadOnlyRejected`,
|
|
718
|
+
`onValidationRejected`) and the undo history. A tap on a read-only active cell does not invite the keyboard.
|
|
719
|
+
- **While a formula points** (inserting references), a tap does nothing: references are inserted by mouse and keyboard, and
|
|
720
|
+
Enter finishes the formula.
|
|
721
|
+
- **Still mouse-only**: range selection, the fill handle, the resize grips and formula pointing; no selection handles are
|
|
722
|
+
drawn. A tap on a sort header cell still sorts, as without the prop.
|
|
723
|
+
- **Native long-press**: on a `touchEditing` grid only, the native long-press menu, the iOS callout and long-press text
|
|
724
|
+
selection are suppressed on the cells (`-webkit-touch-callout` / `user-select` on the rows), so the menu has one channel.
|
|
725
|
+
- **DOM**: the root carries `data-aqsp-touch-editing` while the prop is on. Without the prop the DOM and the behaviour are
|
|
726
|
+
those of 0.20.
|
|
727
|
+
|
|
692
728
|
## Context-menu constraint (right-click)
|
|
693
729
|
|
|
694
730
|
Right-clicking a cell moves the selection (Excel-style) and calls `onCellContextMenu` with the cell and the native event —
|
|
695
731
|
**the package renders no menu**; suppress the native menu and show your own, or ignore the callback to keep the browser menu.
|
|
732
|
+
How a finger or a pen reaches it depends on `touchEditing`: without it, a touch / pen long-press never fires `onCellContextMenu`
|
|
733
|
+
(touch / pen only scrolls); with it, holding a body cell still for 500 ms fires it with a `pointer` origin whose `event` is
|
|
734
|
+
the press (its coordinates are the pressed point), after the same selection move, and the native long-press menu and callout
|
|
735
|
+
are suppressed on the cells (the menu has one channel, the package's clock).
|
|
696
736
|
`Shift+F10` / the ContextMenu key deliver the same callback with a `keyboard` origin and the active cell's viewport
|
|
697
737
|
rectangle. Right-clicking column/row headers is intentionally native (no column-select-plus-menu — see deviations).
|
|
698
738
|
|
|
@@ -720,13 +760,13 @@ A middle click never pastes into the grid: the middle-button release is cancelle
|
|
|
720
760
|
also when the middle button was chorded onto a held primary; a touch tap while the middle button is held does not disarm
|
|
721
761
|
it) so Linux's primary-selection paste cannot reach the hidden input; the cell editor itself keeps native middle-click paste.
|
|
722
762
|
The hidden input carries `inputmode="none"` from mount and throughout every keyboard / IME session (the attribute is a
|
|
723
|
-
virtual-keyboard invitation, not an idle / editing predicate), so a touch / pen tap does not summon a
|
|
724
|
-
|
|
725
|
-
raises the invitation
|
|
726
|
-
the
|
|
727
|
-
touch / pen press during a session leaves it alone (see
|
|
728
|
-
|
|
729
|
-
|
|
763
|
+
virtual-keyboard invitation, not an idle / editing predicate), so a touch / pen tap that only selects does not summon a
|
|
764
|
+
virtual keyboard; only a pointer-opened editor (the mouse double-click, or with `touchEditing` a tap on the active cell)
|
|
765
|
+
raises the invitation (the attribute becomes the active cell's `getCellInputMode`, `"text"` when undeclared), which then
|
|
766
|
+
outlives the session — it stays up through commits, Escape and the idle state after them — until focus really leaves the
|
|
767
|
+
grid or an idle (no session open) touch / pen press withdraws it; a touch / pen press during a session leaves it alone (see
|
|
768
|
+
Accessibility). The press gates above are mouse-only; touch / pen presses are the scroll machine's, and only `touchEditing`
|
|
769
|
+
adds its tap and long-press (see "Finger and pen").
|
|
730
770
|
|
|
731
771
|
## Keymap (contract table)
|
|
732
772
|
|
|
@@ -953,6 +993,7 @@ The grid's own UI chrome ships in English (`"en"`, the default) and Japanese (`"
|
|
|
953
993
|
| `renderCell` | `(ctx: RenderCellContext) => ReactNode` — `RenderCellContext = { row; col; text; displayText }` (exported) | Custom cell rendering. **Must be identity-stable** (`useCallback`) — an inline arrow defeats the cell memo and re-renders every visible cell each pass. **Per-cell opt-out** (v0.12 — ADR-32): return `undefined` and that one cell falls back to the package default rendering, value-format engine included (only `undefined` opts out — `null`, `false` and any other ReactNode are custom output, i.e. an empty custom cell). `ctx.text` is the raw canonical string; `ctx.displayText` is the value-format display — the exact string the default rendering, announcements, the HTML clipboard and autofit share, so a custom cell that renders it can never drift from what gets copied. Autofit stays a whole-grid no-op while `renderCell` is set. |
|
|
954
994
|
| `maxOperationCells` | `number` | Bulk-operation ceiling (default 100,000). Row fan-out resize gates at 1/10 of it and autofit at 1/4 — see "Operation limits". |
|
|
955
995
|
| `enableResizeUI` | `boolean` | Default `true`. `false` removes resize strips **and unhide markers**, makes the keyboard resize and hide / unhide commands unavailable, and keeps pastes from writing sizes (copies still carry them) — sizes then change, and hidden tracks come back, only through the imperative API. |
|
|
996
|
+
| `touchEditing` | `boolean` | v0.21 — default `false`. `true` lets a finger or a pen select, write and open the row menu (see "Finger and pen"): a tap selects a cell, a tap on the active cell opens its editor with the on-screen keyboard, a long-press (500 ms) calls `onCellContextMenu` with a `pointer` origin. `false` keeps touch / pen scroll-only, byte-for-byte. |
|
|
956
997
|
| `headings` | `boolean` | v0.17 — default `true`: shows the column letters, the row numbers and the corner (Excel's "headings"; not `headerRows`). `false` draws none of the three and collapses their grid tracks to 0, so the cells start at the grid's top-left corner; the gestures that live only on them go with them (header presses, the corner's select-all, the resize strips and unhide markers) and their keyboard twins stay (Ctrl+Space, Shift+Space, Ctrl+A, Alt+Shift+Arrow, Alt+Shift+=). The bands are `aria-hidden`, so assistive technology meets the same grid. The root carries `data-aqsp-headings-hidden` while they are hidden. LIVE prop. |
|
|
957
998
|
| `onContentSizeChange` | `(size: SpreadsheetContentSize) => void` | v0.17 — receives the size of the grid's content in CSS px: the bands (when shown), every column and row at its current size and the two scroll bars the grid always reserves, all scaled by the zoom (the scroll bars live inside the zoom wrapper, so they scale too). Called after the first layout and after every change of it — a track's size (a resize, an autofit, a hide or unhide, the imperative `resizeRow` / `resizeColumn`), the row or column count, the default sizes, the zoom or `headings` — never with an unchanged size. The bands count on whichever side of the cells they sit (a right-to-left grid too) and in a box smaller than them; a grid with no rows or no columns draws nothing and reports 0 × 0; a grid without a layout box (under a `display: none` ancestor) reports once it has one. See *Fitting a box to the grid*. |
|
|
958
999
|
| `frame` | `CellRange` | v0.18 — draws a frame around a range of cells: a line of `--aqsp-frame-width` (2px by default) in `--aqsp-frame-color` (default `#1f2937`) just inside the outer edges of the range's cells, scrolling with them and scaled by the zoom like their lines. The part of the range inside the grid is framed; bounds that are not non-negative integers with each start at most its end throw a RangeError. Each pane frames the part it paints and leaves open a side the range continues past (`data-aqsp-frame-open`), so frozen panes join into one frame. The frame sits over the freeze dividers and the bands and under the active cell's frame; while it is set the bands, the dividers and the marquee's far headroom stop at the last painted cell, and the root carries `data-aqsp-framed`. See *Framing a range*. LIVE prop. |
|
|
@@ -1326,7 +1367,7 @@ importers with the exact same Excel-compatible semantics the grid uses. `enumera
|
|
|
1326
1367
|
`onOperationRejected` op), and `EditRejection` (the `onEditRejected` context — see "Editing, Undo, and rejection") are exported for
|
|
1327
1368
|
consumer-side annotations.
|
|
1328
1369
|
|
|
1329
|
-
v0.8 adds the rich-cell engines as public pure functions (all React-free; `src/index.ts` exports 44 values and
|
|
1370
|
+
v0.8 adds the rich-cell engines as public pure functions (all React-free; `src/index.ts` exports 44 values and 112 types in total — every named type an exported declaration reaches is exported too, so nothing has to be extracted with `Awaited<ReturnType<>>` / `Extract<>`; `src/index.spec.ts` pins it):
|
|
1330
1371
|
|
|
1331
1372
|
- **Clip payload** — `serializeClipPayload(payload)` / `parseClipPayload(json)` (the lossless wire format `{ v: 1, rows, cols, clipId, formats, validations, cells, colWidths?, rowHeights?, wholeRows, wholeCols, conditionalFormats }`; the parser is total and returns `null` on ANY malformed input, the serializer validates the same way and throws a `RangeError`),
|
|
1332
1373
|
`detectClipSource(flavours, channel)` (`"aqsp" | "sheets" | "excel" | "html" | "tsv" | "none"` — the ADR-14 detection over `{ types, getData }`), and the types `ClipPayload` / `ClipCell` / `ClipComment` / `ClipSource` / `ClipInfo` / `ClipFlavours` / `ClipChannel` (the `detectClipSource` parameter types).
|