@aiquants/spreadsheet 0.15.0 → 0.16.0
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 +75 -0
- package/README.md +206 -21
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +107 -5
- package/dist/index.d.ts +107 -5
- package/dist/index.js +4314 -4166
- package/dist/styles/spreadsheet.css +1 -1
- package/dist/styles/spreadsheet.standalone.css +1 -1
- package/dist/tsv.cjs +8 -1
- package/dist/tsv.d.cts +63 -4
- package/dist/tsv.d.ts +63 -4
- package/dist/tsv.js +78 -3
- package/dist/view-BkwCUzTl.cjs +1 -0
- package/dist/view-DycJZi_t.js +41 -0
- package/dist/view.cjs +1 -1
- package/dist/view.d.cts +31 -7
- package/dist/view.d.ts +31 -7
- package/dist/view.js +12 -12
- package/package.json +1 -1
- package/src/Spreadsheet.tsx +110 -14
- package/src/clipboard/tsv.ts +167 -72
- package/src/clipboard/useClipboard.ts +3 -2
- package/src/commands/useCommands.ts +43 -1
- package/src/grid/GridBody.tsx +51 -6
- package/src/header/resizeGates.ts +34 -0
- package/src/header/useHeaderResize.ts +83 -16
- package/src/index.ts +1 -1
- package/src/keyboard/shortcuts.ts +67 -0
- package/src/model/dataAdapter.ts +74 -0
- package/src/overlay/SelectionOverlay.tsx +22 -2
- package/src/styles/spreadsheet.css +193 -123
- package/src/tsv.ts +15 -10
- package/src/view.ts +67 -14
- package/dist/tsv-B6TDExlk.js +0 -91
- package/dist/tsv-BHXbWK5W.cjs +0 -8
package/dist/index.d.cts
CHANGED
|
@@ -670,6 +670,20 @@ export declare type HtmlTableResult = {
|
|
|
670
670
|
readonly outcome: "none";
|
|
671
671
|
};
|
|
672
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Yields the rows of a TSV text one at a time, in exactly parseTsv's grammar (the same quoting rule, line terminators
|
|
675
|
+
* and final-terminator handling; empty text is one row with one empty cell), WITHOUT padding them to a common width. A
|
|
676
|
+
* consumer that stops early materialises nothing past the last row it took, so a large text can be previewed under a
|
|
677
|
+
* cell budget.
|
|
678
|
+
* TSV の文字列の行を 1 つずつ出す処理。parseTsv とちょうど同じ文法 (同じ引用の規則・改行・末尾の改行の扱い。空の文字は空のセル
|
|
679
|
+
* 1 つの 1 行) で、幅を揃える右の埋めはしない。途中で止めた受け手は、最後に取った行より先を何も実体化しないので、大きな文字を
|
|
680
|
+
* セルの予算の下で見られる。
|
|
681
|
+
*
|
|
682
|
+
* @param text - The TSV text. TSV の文字列。
|
|
683
|
+
* @returns The rows, unpadded. 埋めない行。
|
|
684
|
+
*/
|
|
685
|
+
export declare function iterateTsvRows(text: string): Generator<string[]>;
|
|
686
|
+
|
|
673
687
|
/**
|
|
674
688
|
* Renders the hyperlink editor for one cell.
|
|
675
689
|
* 1 セルのハイパーリンクエディタを描画する。
|
|
@@ -733,6 +747,23 @@ export declare type ListValidationRule = {
|
|
|
733
747
|
/** Builds a normalized range from two corners. / 2 隅から正規化レンジを構築。 */
|
|
734
748
|
export declare const makeRange: (a: CellCoord, b: CellCoord) => CellRange;
|
|
735
749
|
|
|
750
|
+
/**
|
|
751
|
+
* The dimensions `parseTsv(text)` would materialise — rows and the rectangularised (maximum)
|
|
752
|
+
* column count — from the SAME grammar walk, without building any row array: the ADR-12
|
|
753
|
+
* pre-materialisation estimate of the `tsv` paste source (a raw line-terminator count would
|
|
754
|
+
* over-count rows for quoted embedded newlines and falsely reject a legitimate paste).
|
|
755
|
+
* `parseTsv(text)` が実体化する寸法 — 行数と矩形化後 (最大) の列数 — を**同じ**文法走査から、
|
|
756
|
+
* 行配列を一切作らずに返す: `tsv` 貼り付けソースの ADR-12 実体化前見積もり (素の改行計数は
|
|
757
|
+
* quoted 内の埋め込み改行を行と数え、正当な貼り付けを誤って上限拒否する)。
|
|
758
|
+
*
|
|
759
|
+
* @param text - The TSV text. TSV の文字列。
|
|
760
|
+
* @returns The row count and the maximum column count. 行数と最大の列数。
|
|
761
|
+
*/
|
|
762
|
+
export declare const measureTsv: (text: string) => {
|
|
763
|
+
rows: number;
|
|
764
|
+
cols: number;
|
|
765
|
+
};
|
|
766
|
+
|
|
736
767
|
/**
|
|
737
768
|
* Applies a patch to a base format: `null` clears a key, `undefined` (or an omitted key) keeps
|
|
738
769
|
* the base value, anything else replaces it (borders as a whole set). Returns the CANONICAL
|
|
@@ -902,8 +933,13 @@ export declare type ParsedChord = {
|
|
|
902
933
|
export declare const parseHtmlTable: (html: string, kind: HtmlTableKind, options: NumberFormatDecodeOptions, maxCells: number) => HtmlTableResult;
|
|
903
934
|
|
|
904
935
|
/**
|
|
905
|
-
* Parses
|
|
906
|
-
*
|
|
936
|
+
* Parses TSV into a rectangular matrix (ragged rows are right-padded with ""; one trailing line
|
|
937
|
+
* terminator is dropped; empty text is one empty cell): the rows of iterateTsvRows, padded.
|
|
938
|
+
* TSV を矩形行列へ解析する処理 (不揃いの行は "" で右を埋め、末尾の改行 1 つを除き、空の文字は空のセル 1 つ)。iterateTsvRows の
|
|
939
|
+
* 行を埋めたもの。
|
|
940
|
+
*
|
|
941
|
+
* @param text - The TSV text. TSV の文字列。
|
|
942
|
+
* @returns The rectangular matrix, at least 1 × 1. 少なくとも 1 × 1 の矩形行列。
|
|
907
943
|
*/
|
|
908
944
|
export declare const parseTsv: (text: string) => string[][];
|
|
909
945
|
|
|
@@ -1133,6 +1169,23 @@ export declare type SelectionState = {
|
|
|
1133
1169
|
active: CellCoord;
|
|
1134
1170
|
};
|
|
1135
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* Serializes a matrix the way Excel writes its clipboard text, with a trailing CRLF: only a field
|
|
1174
|
+
* holding a tab, CR or LF is quoted (inner quotes doubled), so a field that merely starts with `"`
|
|
1175
|
+
* reaches a plain-text target as typed. Its round trip is not exact for such fields (a raw
|
|
1176
|
+
* `"\t"\tBlue` reads back as two cells); the grid's copy writes text/plain with it (and so should a
|
|
1177
|
+
* host's own copy control, to match), and the grid's own paste reads the JSON payload first. Files and
|
|
1178
|
+
* stored bodies use `serializeTsv`.
|
|
1179
|
+
* Excel がクリップボードの文字を書く形で行列を終端 CRLF つきに直列化する処理。囲むのはタブ・CR・LF を含む値だけ (中の
|
|
1180
|
+
* `"` は二重化) なので、`"` で始まるだけの値は平文の貼り先へそのまま届く。そうした値の往復は厳密でない (素の
|
|
1181
|
+
* `"\t"\tBlue` は 2 つのセルに読み戻る)。グリッドのコピーが text/plain をこれで書き (ホスト自身のコピーの部品も揃えて
|
|
1182
|
+
* これで書く)、グリッド自身の貼り付けは JSON の payload を先に読む。ファイルと保存する本文は `serializeTsv` を使う。
|
|
1183
|
+
*
|
|
1184
|
+
* @param matrix - The rows of cell strings. セルの文字列の行。
|
|
1185
|
+
* @returns The TSV text in Excel's form. Excel の形の TSV の文字列。
|
|
1186
|
+
*/
|
|
1187
|
+
export declare const serializeClipboardTsv: (matrix: readonly (readonly string[])[]) => string;
|
|
1188
|
+
|
|
1136
1189
|
/**
|
|
1137
1190
|
* Serialises a payload with the FIXED leading key order `{"v":1,"rows":R,"cols":C,"clipId":"…",…}`
|
|
1138
1191
|
* and a deterministic key order everywhere below (fileoverview). A structurally malformed
|
|
@@ -1156,8 +1209,14 @@ export declare const serializeClipPayload: (payload: ClipPayload) => string;
|
|
|
1156
1209
|
export declare const serializeHtmlTable: (payload: ClipPayload, clipJson: string) => string;
|
|
1157
1210
|
|
|
1158
1211
|
/**
|
|
1159
|
-
* Serializes a matrix to
|
|
1160
|
-
*
|
|
1212
|
+
* Serializes a matrix to TSV with a trailing CRLF; `parseTsv` reads the result back to the same
|
|
1213
|
+
* matrix for every rectangular matrix of strings of at least 1 × 1 (the strict writer the package
|
|
1214
|
+
* publishes; a host stores tables with it).
|
|
1215
|
+
* 行列を終端 CRLF つきの TSV へ直列化する処理。文字列の少なくとも 1 × 1 のどの矩形行列でも `parseTsv` が同じ行列へ
|
|
1216
|
+
* 読み戻す (パッケージが公開する厳密な書き手。ホストは表をこれで保存する)。
|
|
1217
|
+
*
|
|
1218
|
+
* @param matrix - The rows of cell strings. セルの文字列の行。
|
|
1219
|
+
* @returns The TSV text. TSV の文字列。
|
|
1161
1220
|
*/
|
|
1162
1221
|
export declare const serializeTsv: (matrix: readonly (readonly string[])[]) => string;
|
|
1163
1222
|
|
|
@@ -1247,7 +1306,7 @@ export declare const SPREADSHEET_RESERVED_SHORTCUTS: readonly string[];
|
|
|
1247
1306
|
* グリッドの再バインド可能コマンド全件 (camelCase — 計画 §1.5 の正確な一覧)。前半は Google Sheets
|
|
1248
1307
|
* 同等の既定束縛、拡張ブロックは既定未束縛 (`[]`) で consumer が `shortcuts` で束縛するための存在。
|
|
1249
1308
|
*/
|
|
1250
|
-
export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
|
|
1309
|
+
export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "increaseColumnWidth" | "decreaseColumnWidth" | "increaseRowHeight" | "decreaseRowHeight" | "autoFitColumnWidth" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
|
|
1251
1310
|
|
|
1252
1311
|
/**
|
|
1253
1312
|
* The single data boundary between the grid and the consumer. Reads via getCellText (renderCell
|
|
@@ -1692,6 +1751,15 @@ export declare type SpreadsheetProps = {
|
|
|
1692
1751
|
* 位置に依らず常時可視で、可視化の縦成分は no-op。飛行中の変更は全ドラッグを取り消す。
|
|
1693
1752
|
*/
|
|
1694
1753
|
frozenRows?: number;
|
|
1754
|
+
/**
|
|
1755
|
+
* The leading rows whose cells are column headers (default 0): their cells take `role="columnheader"` and the
|
|
1756
|
+
* stylesheet's header-row paint (`--aqsp-header-row-*`), so assistive technology reads them as the headers of the
|
|
1757
|
+
* columns below. An integer in [0, frozenRows]: header rows are always frozen rows; anything else is a RangeError
|
|
1758
|
+
* during render.
|
|
1759
|
+
* 先頭の見出しの行数 (既定 0)。そのセルは `role="columnheader"` とスタイルシートの見出し行の塗り (`--aqsp-header-row-*`)
|
|
1760
|
+
* を受け、支援技術は下の列の見出しとして読む。[0, frozenRows] の整数 (見出しの行は常に凍結行)。それ以外は描画中の RangeError。
|
|
1761
|
+
*/
|
|
1762
|
+
headerRows?: number;
|
|
1695
1763
|
/**
|
|
1696
1764
|
* Freezes the LAST N columns at the right edge (v0.9 — the VirtualGrid frozenTrailingCols
|
|
1697
1765
|
* pass-through; LIVE prop, default 0). Validation SSOT is the engine's fail-fast contract
|
|
@@ -1901,6 +1969,26 @@ export declare type SpreadsheetProps = {
|
|
|
1901
1969
|
* region は溢れない。
|
|
1902
1970
|
*/
|
|
1903
1971
|
formatReadOnlyAnnouncement?: (rejection: ReadOnlyRejection) => string;
|
|
1972
|
+
/**
|
|
1973
|
+
* Makes the whole grid read-only (default false): `aria-readonly="true"` on the `role="grid"` element and on the
|
|
1974
|
+
* hidden input, and every cell is read-only whatever the adapter's `isCellReadOnly` says, so every write is refused
|
|
1975
|
+
* through `onReadOnlyRejected` / `formatReadOnlyAnnouncement` and the cell announcement's `readOnly` is true. View
|
|
1976
|
+
* changes stay available: selection, copy, scrolling, zoom, resizing, hiding and highlighting.
|
|
1977
|
+
* グリッド全体を読み取り専用にする (既定 false)。`role="grid"` の要素と隠しの入力に `aria-readonly="true"` を付け、アダプタの
|
|
1978
|
+
* `isCellReadOnly` に関わらず全てのセルを読み取り専用にする (書き込みは全て `onReadOnlyRejected` / `formatReadOnlyAnnouncement`
|
|
1979
|
+
* で拒まれ、セルの読み上げの `readOnly` は true)。見た目の変更 (選択・コピー・スクロール・拡大率・寸法・非表示・強調) は使える。
|
|
1980
|
+
*/
|
|
1981
|
+
readOnly?: boolean;
|
|
1982
|
+
/**
|
|
1983
|
+
* The id of the element that names the grid (a caption or heading of the host): the `role="grid"` element and the
|
|
1984
|
+
* focusable root (the Escape landing point) both take `aria-labelledby` with it instead of the built-in
|
|
1985
|
+
* `labels.rootAriaLabel`. A non-empty id without whitespace; anything else is a RangeError during render. Omitted:
|
|
1986
|
+
* the root and the grid both carry `labels.rootAriaLabel` as `aria-label`.
|
|
1987
|
+
* グリッドに名前を与える要素の id (ホストの表題や見出し)。`role="grid"` の要素とフォーカスを受けるルート (Escape の着地点) は
|
|
1988
|
+
* 組み込みの `labels.rootAriaLabel` の代わりにこれを `aria-labelledby` に持つ。空白を含まない空でない id で、それ以外は描画中の
|
|
1989
|
+
* RangeError。省略するとルートとグリッドの両方が `labels.rootAriaLabel` を `aria-label` に持つ。
|
|
1990
|
+
*/
|
|
1991
|
+
labelledBy?: string;
|
|
1904
1992
|
/**
|
|
1905
1993
|
* Paste outcome summary (v0.10 plan §3.1): the menu channel mirrors `paste(options)`'s
|
|
1906
1994
|
* resolve value 1:1 (read refusals and the write-time re-gate included); the event channel
|
|
@@ -1982,6 +2070,20 @@ export declare type SpreadsheetProps = {
|
|
|
1982
2070
|
command: SpreadsheetCommand;
|
|
1983
2071
|
state: boolean | null;
|
|
1984
2072
|
}) => string;
|
|
2073
|
+
/**
|
|
2074
|
+
* Live-region text after a keyboard resize (increaseColumnWidth / decreaseColumnWidth / increaseRowHeight /
|
|
2075
|
+
* decreaseRowHeight / autoFitColumnWidth): the active track's axis, index and new size in CSS px. Omit for silence
|
|
2076
|
+
* (no built-in strings); it shares the announcement debounce.
|
|
2077
|
+
* キーボードの寸法の変更 (increaseColumnWidth / decreaseColumnWidth / increaseRowHeight / decreaseRowHeight /
|
|
2078
|
+
* autoFitColumnWidth) の後の読み上げ文言。アクティブなトラックの軸・番号・新しい寸法 (CSS px) を受ける。省略で無音
|
|
2079
|
+
* (組み込み文言なし)。読み上げのデバウンスを共有する。
|
|
2080
|
+
*/
|
|
2081
|
+
formatResizeAnnouncement?: (ctx: {
|
|
2082
|
+
command: SpreadsheetCommand;
|
|
2083
|
+
axis: "row" | "column";
|
|
2084
|
+
index: number;
|
|
2085
|
+
size: number;
|
|
2086
|
+
}) => string;
|
|
1985
2087
|
/**
|
|
1986
2088
|
* UI chrome language ("en" | "ja"; default "en"): selects the label catalog, the built-in
|
|
1987
2089
|
* data-validation messages, and is forwarded to the grid scrollbars (arrow labels,
|
package/dist/index.d.ts
CHANGED
|
@@ -670,6 +670,20 @@ export declare type HtmlTableResult = {
|
|
|
670
670
|
readonly outcome: "none";
|
|
671
671
|
};
|
|
672
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Yields the rows of a TSV text one at a time, in exactly parseTsv's grammar (the same quoting rule, line terminators
|
|
675
|
+
* and final-terminator handling; empty text is one row with one empty cell), WITHOUT padding them to a common width. A
|
|
676
|
+
* consumer that stops early materialises nothing past the last row it took, so a large text can be previewed under a
|
|
677
|
+
* cell budget.
|
|
678
|
+
* TSV の文字列の行を 1 つずつ出す処理。parseTsv とちょうど同じ文法 (同じ引用の規則・改行・末尾の改行の扱い。空の文字は空のセル
|
|
679
|
+
* 1 つの 1 行) で、幅を揃える右の埋めはしない。途中で止めた受け手は、最後に取った行より先を何も実体化しないので、大きな文字を
|
|
680
|
+
* セルの予算の下で見られる。
|
|
681
|
+
*
|
|
682
|
+
* @param text - The TSV text. TSV の文字列。
|
|
683
|
+
* @returns The rows, unpadded. 埋めない行。
|
|
684
|
+
*/
|
|
685
|
+
export declare function iterateTsvRows(text: string): Generator<string[]>;
|
|
686
|
+
|
|
673
687
|
/**
|
|
674
688
|
* Renders the hyperlink editor for one cell.
|
|
675
689
|
* 1 セルのハイパーリンクエディタを描画する。
|
|
@@ -733,6 +747,23 @@ export declare type ListValidationRule = {
|
|
|
733
747
|
/** Builds a normalized range from two corners. / 2 隅から正規化レンジを構築。 */
|
|
734
748
|
export declare const makeRange: (a: CellCoord, b: CellCoord) => CellRange;
|
|
735
749
|
|
|
750
|
+
/**
|
|
751
|
+
* The dimensions `parseTsv(text)` would materialise — rows and the rectangularised (maximum)
|
|
752
|
+
* column count — from the SAME grammar walk, without building any row array: the ADR-12
|
|
753
|
+
* pre-materialisation estimate of the `tsv` paste source (a raw line-terminator count would
|
|
754
|
+
* over-count rows for quoted embedded newlines and falsely reject a legitimate paste).
|
|
755
|
+
* `parseTsv(text)` が実体化する寸法 — 行数と矩形化後 (最大) の列数 — を**同じ**文法走査から、
|
|
756
|
+
* 行配列を一切作らずに返す: `tsv` 貼り付けソースの ADR-12 実体化前見積もり (素の改行計数は
|
|
757
|
+
* quoted 内の埋め込み改行を行と数え、正当な貼り付けを誤って上限拒否する)。
|
|
758
|
+
*
|
|
759
|
+
* @param text - The TSV text. TSV の文字列。
|
|
760
|
+
* @returns The row count and the maximum column count. 行数と最大の列数。
|
|
761
|
+
*/
|
|
762
|
+
export declare const measureTsv: (text: string) => {
|
|
763
|
+
rows: number;
|
|
764
|
+
cols: number;
|
|
765
|
+
};
|
|
766
|
+
|
|
736
767
|
/**
|
|
737
768
|
* Applies a patch to a base format: `null` clears a key, `undefined` (or an omitted key) keeps
|
|
738
769
|
* the base value, anything else replaces it (borders as a whole set). Returns the CANONICAL
|
|
@@ -902,8 +933,13 @@ export declare type ParsedChord = {
|
|
|
902
933
|
export declare const parseHtmlTable: (html: string, kind: HtmlTableKind, options: NumberFormatDecodeOptions, maxCells: number) => HtmlTableResult;
|
|
903
934
|
|
|
904
935
|
/**
|
|
905
|
-
* Parses
|
|
906
|
-
*
|
|
936
|
+
* Parses TSV into a rectangular matrix (ragged rows are right-padded with ""; one trailing line
|
|
937
|
+
* terminator is dropped; empty text is one empty cell): the rows of iterateTsvRows, padded.
|
|
938
|
+
* TSV を矩形行列へ解析する処理 (不揃いの行は "" で右を埋め、末尾の改行 1 つを除き、空の文字は空のセル 1 つ)。iterateTsvRows の
|
|
939
|
+
* 行を埋めたもの。
|
|
940
|
+
*
|
|
941
|
+
* @param text - The TSV text. TSV の文字列。
|
|
942
|
+
* @returns The rectangular matrix, at least 1 × 1. 少なくとも 1 × 1 の矩形行列。
|
|
907
943
|
*/
|
|
908
944
|
export declare const parseTsv: (text: string) => string[][];
|
|
909
945
|
|
|
@@ -1133,6 +1169,23 @@ export declare type SelectionState = {
|
|
|
1133
1169
|
active: CellCoord;
|
|
1134
1170
|
};
|
|
1135
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* Serializes a matrix the way Excel writes its clipboard text, with a trailing CRLF: only a field
|
|
1174
|
+
* holding a tab, CR or LF is quoted (inner quotes doubled), so a field that merely starts with `"`
|
|
1175
|
+
* reaches a plain-text target as typed. Its round trip is not exact for such fields (a raw
|
|
1176
|
+
* `"\t"\tBlue` reads back as two cells); the grid's copy writes text/plain with it (and so should a
|
|
1177
|
+
* host's own copy control, to match), and the grid's own paste reads the JSON payload first. Files and
|
|
1178
|
+
* stored bodies use `serializeTsv`.
|
|
1179
|
+
* Excel がクリップボードの文字を書く形で行列を終端 CRLF つきに直列化する処理。囲むのはタブ・CR・LF を含む値だけ (中の
|
|
1180
|
+
* `"` は二重化) なので、`"` で始まるだけの値は平文の貼り先へそのまま届く。そうした値の往復は厳密でない (素の
|
|
1181
|
+
* `"\t"\tBlue` は 2 つのセルに読み戻る)。グリッドのコピーが text/plain をこれで書き (ホスト自身のコピーの部品も揃えて
|
|
1182
|
+
* これで書く)、グリッド自身の貼り付けは JSON の payload を先に読む。ファイルと保存する本文は `serializeTsv` を使う。
|
|
1183
|
+
*
|
|
1184
|
+
* @param matrix - The rows of cell strings. セルの文字列の行。
|
|
1185
|
+
* @returns The TSV text in Excel's form. Excel の形の TSV の文字列。
|
|
1186
|
+
*/
|
|
1187
|
+
export declare const serializeClipboardTsv: (matrix: readonly (readonly string[])[]) => string;
|
|
1188
|
+
|
|
1136
1189
|
/**
|
|
1137
1190
|
* Serialises a payload with the FIXED leading key order `{"v":1,"rows":R,"cols":C,"clipId":"…",…}`
|
|
1138
1191
|
* and a deterministic key order everywhere below (fileoverview). A structurally malformed
|
|
@@ -1156,8 +1209,14 @@ export declare const serializeClipPayload: (payload: ClipPayload) => string;
|
|
|
1156
1209
|
export declare const serializeHtmlTable: (payload: ClipPayload, clipJson: string) => string;
|
|
1157
1210
|
|
|
1158
1211
|
/**
|
|
1159
|
-
* Serializes a matrix to
|
|
1160
|
-
*
|
|
1212
|
+
* Serializes a matrix to TSV with a trailing CRLF; `parseTsv` reads the result back to the same
|
|
1213
|
+
* matrix for every rectangular matrix of strings of at least 1 × 1 (the strict writer the package
|
|
1214
|
+
* publishes; a host stores tables with it).
|
|
1215
|
+
* 行列を終端 CRLF つきの TSV へ直列化する処理。文字列の少なくとも 1 × 1 のどの矩形行列でも `parseTsv` が同じ行列へ
|
|
1216
|
+
* 読み戻す (パッケージが公開する厳密な書き手。ホストは表をこれで保存する)。
|
|
1217
|
+
*
|
|
1218
|
+
* @param matrix - The rows of cell strings. セルの文字列の行。
|
|
1219
|
+
* @returns The TSV text. TSV の文字列。
|
|
1161
1220
|
*/
|
|
1162
1221
|
export declare const serializeTsv: (matrix: readonly (readonly string[])[]) => string;
|
|
1163
1222
|
|
|
@@ -1247,7 +1306,7 @@ export declare const SPREADSHEET_RESERVED_SHORTCUTS: readonly string[];
|
|
|
1247
1306
|
* グリッドの再バインド可能コマンド全件 (camelCase — 計画 §1.5 の正確な一覧)。前半は Google Sheets
|
|
1248
1307
|
* 同等の既定束縛、拡張ブロックは既定未束縛 (`[]`) で consumer が `shortcuts` で束縛するための存在。
|
|
1249
1308
|
*/
|
|
1250
|
-
export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
|
|
1309
|
+
export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "increaseColumnWidth" | "decreaseColumnWidth" | "increaseRowHeight" | "decreaseRowHeight" | "autoFitColumnWidth" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
|
|
1251
1310
|
|
|
1252
1311
|
/**
|
|
1253
1312
|
* The single data boundary between the grid and the consumer. Reads via getCellText (renderCell
|
|
@@ -1692,6 +1751,15 @@ export declare type SpreadsheetProps = {
|
|
|
1692
1751
|
* 位置に依らず常時可視で、可視化の縦成分は no-op。飛行中の変更は全ドラッグを取り消す。
|
|
1693
1752
|
*/
|
|
1694
1753
|
frozenRows?: number;
|
|
1754
|
+
/**
|
|
1755
|
+
* The leading rows whose cells are column headers (default 0): their cells take `role="columnheader"` and the
|
|
1756
|
+
* stylesheet's header-row paint (`--aqsp-header-row-*`), so assistive technology reads them as the headers of the
|
|
1757
|
+
* columns below. An integer in [0, frozenRows]: header rows are always frozen rows; anything else is a RangeError
|
|
1758
|
+
* during render.
|
|
1759
|
+
* 先頭の見出しの行数 (既定 0)。そのセルは `role="columnheader"` とスタイルシートの見出し行の塗り (`--aqsp-header-row-*`)
|
|
1760
|
+
* を受け、支援技術は下の列の見出しとして読む。[0, frozenRows] の整数 (見出しの行は常に凍結行)。それ以外は描画中の RangeError。
|
|
1761
|
+
*/
|
|
1762
|
+
headerRows?: number;
|
|
1695
1763
|
/**
|
|
1696
1764
|
* Freezes the LAST N columns at the right edge (v0.9 — the VirtualGrid frozenTrailingCols
|
|
1697
1765
|
* pass-through; LIVE prop, default 0). Validation SSOT is the engine's fail-fast contract
|
|
@@ -1901,6 +1969,26 @@ export declare type SpreadsheetProps = {
|
|
|
1901
1969
|
* region は溢れない。
|
|
1902
1970
|
*/
|
|
1903
1971
|
formatReadOnlyAnnouncement?: (rejection: ReadOnlyRejection) => string;
|
|
1972
|
+
/**
|
|
1973
|
+
* Makes the whole grid read-only (default false): `aria-readonly="true"` on the `role="grid"` element and on the
|
|
1974
|
+
* hidden input, and every cell is read-only whatever the adapter's `isCellReadOnly` says, so every write is refused
|
|
1975
|
+
* through `onReadOnlyRejected` / `formatReadOnlyAnnouncement` and the cell announcement's `readOnly` is true. View
|
|
1976
|
+
* changes stay available: selection, copy, scrolling, zoom, resizing, hiding and highlighting.
|
|
1977
|
+
* グリッド全体を読み取り専用にする (既定 false)。`role="grid"` の要素と隠しの入力に `aria-readonly="true"` を付け、アダプタの
|
|
1978
|
+
* `isCellReadOnly` に関わらず全てのセルを読み取り専用にする (書き込みは全て `onReadOnlyRejected` / `formatReadOnlyAnnouncement`
|
|
1979
|
+
* で拒まれ、セルの読み上げの `readOnly` は true)。見た目の変更 (選択・コピー・スクロール・拡大率・寸法・非表示・強調) は使える。
|
|
1980
|
+
*/
|
|
1981
|
+
readOnly?: boolean;
|
|
1982
|
+
/**
|
|
1983
|
+
* The id of the element that names the grid (a caption or heading of the host): the `role="grid"` element and the
|
|
1984
|
+
* focusable root (the Escape landing point) both take `aria-labelledby` with it instead of the built-in
|
|
1985
|
+
* `labels.rootAriaLabel`. A non-empty id without whitespace; anything else is a RangeError during render. Omitted:
|
|
1986
|
+
* the root and the grid both carry `labels.rootAriaLabel` as `aria-label`.
|
|
1987
|
+
* グリッドに名前を与える要素の id (ホストの表題や見出し)。`role="grid"` の要素とフォーカスを受けるルート (Escape の着地点) は
|
|
1988
|
+
* 組み込みの `labels.rootAriaLabel` の代わりにこれを `aria-labelledby` に持つ。空白を含まない空でない id で、それ以外は描画中の
|
|
1989
|
+
* RangeError。省略するとルートとグリッドの両方が `labels.rootAriaLabel` を `aria-label` に持つ。
|
|
1990
|
+
*/
|
|
1991
|
+
labelledBy?: string;
|
|
1904
1992
|
/**
|
|
1905
1993
|
* Paste outcome summary (v0.10 plan §3.1): the menu channel mirrors `paste(options)`'s
|
|
1906
1994
|
* resolve value 1:1 (read refusals and the write-time re-gate included); the event channel
|
|
@@ -1982,6 +2070,20 @@ export declare type SpreadsheetProps = {
|
|
|
1982
2070
|
command: SpreadsheetCommand;
|
|
1983
2071
|
state: boolean | null;
|
|
1984
2072
|
}) => string;
|
|
2073
|
+
/**
|
|
2074
|
+
* Live-region text after a keyboard resize (increaseColumnWidth / decreaseColumnWidth / increaseRowHeight /
|
|
2075
|
+
* decreaseRowHeight / autoFitColumnWidth): the active track's axis, index and new size in CSS px. Omit for silence
|
|
2076
|
+
* (no built-in strings); it shares the announcement debounce.
|
|
2077
|
+
* キーボードの寸法の変更 (increaseColumnWidth / decreaseColumnWidth / increaseRowHeight / decreaseRowHeight /
|
|
2078
|
+
* autoFitColumnWidth) の後の読み上げ文言。アクティブなトラックの軸・番号・新しい寸法 (CSS px) を受ける。省略で無音
|
|
2079
|
+
* (組み込み文言なし)。読み上げのデバウンスを共有する。
|
|
2080
|
+
*/
|
|
2081
|
+
formatResizeAnnouncement?: (ctx: {
|
|
2082
|
+
command: SpreadsheetCommand;
|
|
2083
|
+
axis: "row" | "column";
|
|
2084
|
+
index: number;
|
|
2085
|
+
size: number;
|
|
2086
|
+
}) => string;
|
|
1985
2087
|
/**
|
|
1986
2088
|
* UI chrome language ("en" | "ja"; default "en"): selects the label catalog, the built-in
|
|
1987
2089
|
* data-validation messages, and is forwarded to the grid scrollbars (arrow labels,
|