@ishibashi0112/spreadsheet-grid 1.11.0 → 1.12.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.
Files changed (35) hide show
  1. package/API_REFERENCE.md +74 -9
  2. package/README.md +2 -2
  3. package/dist/GridShell.d.ts +1 -1
  4. package/dist/common.d.ts +1 -1
  5. package/dist/features/findReplace.d.ts +2 -0
  6. package/dist/features/richCopy.d.ts +2 -0
  7. package/dist/features/types.d.ts +8 -0
  8. package/dist/index.cjs +12 -11
  9. package/dist/index.js +2861 -2628
  10. package/dist/lite/{createSpreadsheetGrid-DRJX-y38.js → createSpreadsheetGrid-C2k5e4f7.js} +2045 -1935
  11. package/dist/lite/createSpreadsheetGrid-D3TsGHNb.cjs +12 -0
  12. package/dist/lite/createSpreadsheetGrid.cjs +1 -1
  13. package/dist/lite/createSpreadsheetGrid.js +1 -1
  14. package/dist/lite/features/find.cjs +1 -1
  15. package/dist/lite/features/find.js +1 -1
  16. package/dist/lite/features/findReplace.cjs +1 -0
  17. package/dist/lite/features/findReplace.js +2 -0
  18. package/dist/lite/features/richCopy.cjs +1 -0
  19. package/dist/lite/features/richCopy.js +9 -0
  20. package/dist/lite/find-B3brbyYF.js +112 -0
  21. package/dist/lite/find-CyoYo6uk.cjs +1 -0
  22. package/dist/lite/findReplace-Bl26__8E.js +128 -0
  23. package/dist/lite/findReplace-DqAy-_o3.cjs +1 -0
  24. package/dist/lite.cjs +1 -1
  25. package/dist/lite.d.ts +2 -0
  26. package/dist/lite.js +31 -29
  27. package/dist/style.css +1 -1
  28. package/dist/style.layer.css +1 -1
  29. package/dist/view/GridFindBar.d.ts +7 -1
  30. package/dist/view/GridFindReplace.d.ts +25 -0
  31. package/package.json +2 -2
  32. package/skills/spreadsheet-grid/SKILL.md +4 -2
  33. package/dist/lite/createSpreadsheetGrid-D7fxsRZG.cjs +0 -11
  34. package/dist/lite/find-CBDk2qXA.cjs +0 -1
  35. package/dist/lite/find-DtRIqxec.js +0 -105
package/API_REFERENCE.md CHANGED
@@ -26,6 +26,8 @@
26
26
  | `onPasteSkipped` | `(params: GridPasteSkippedParams<T>) => void` | — | 貼り付けで書かなかったセルの通知(1.1.0 から)。1 回の貼り付けで 1 回、書かなかったセルがあるときだけ呼ぶ(書いたセルは書く)。`params.cells` の各セルは `row` / `rowKey` / `rowIndex`(ビュー行)/ `columnKey` / `colIndex` / `text`(貼り付けた文字)/ `reason`(`'readOnly'` = 編集できないセル(列の `editable` / `canEditCell`)、`'invalid'` = `validationMode: 'reject'` の列で検査に通らない値)/ `value`(`'invalid'` のときパーサが読んだ値)/ `message`(`'invalid'` のときの検査のメッセージ)。`validationMode: 'mark'`(既定)の列は書いて印を付けるので入らない。表の外(`createRow` / `createOverflowColumn` が無くて足せない行 / 列)・ラベル行・グループ行と、編集できないセルへ貼った空の文字(1.3.0 から)は数えない。詳細は「貼り付けで読めない値」節。 |
27
27
  | `pasteFillsSelection` | `boolean` | `true` | セルの範囲を選んで貼り付けたとき、コピーした文字が範囲を割り切れれば(1 セルのコピー、範囲の行数と列数がコピーの倍数)範囲いっぱいに繰り返して書く(Excel / Google スプレッドシートと同じ。1.2.0 から)。数えるのはデータ行(ラベル行・グループ行は飛ばす)と合成列でない列。列 / 行の選択と、割り切れないとき・アクティブセルが範囲の外のときは 1 回だけ貼る。書き込みの規則(編集できないセル・`'reject'` の列は飛ばす)と元に戻す 1 回は貼り付けと同じ。serverSide で範囲にまだ読み込んでいない行があるときは 1 回だけ貼る(読み込んだ行にだけ書くと、全選択して貼っても大半の行が書かれないため)。`false` で 1.1 までと同じく範囲の左上から 1 回だけ貼る。 |
28
28
  | `excelShortcuts` | `boolean \| GridExcelShortcutsOptions` | `undefined`(切り取りだけ) | Excel と同じキーの操作(1.10.0 から)。何も渡さないときは `Ctrl` / `⌘+X` の切り取りだけが効く(今までは何も起きなかったキー)。`true` で 7 つ(切り取り・`Ctrl+D` 下へコピー・`Ctrl+R` 右へコピー・エディタの `Ctrl+Enter` 一括入力・`Ctrl+;` 今日の日付・`Shift+Space` 行を選ぶ・`Ctrl+Space` 列を選ぶ)すべて、`false` で切り取りも止める。オブジェクトは書かなかったキーが効き、`false` を書いたキーだけ外す(`{ fillDown: false }`)。中身は「Excel のキー(`excelShortcuts`)」節。 |
29
+ | `copyFormat` | `'text' \| 'rich'` | `'text'` | コピー(`Ctrl/Cmd+C`)と切り取り(`Ctrl/Cmd+X`)でクリップボードへ書く形(1.12.0 から)。`'text'` は今までどおりの TSV だけ。`'rich'` は TSV と一緒に罫線・寄せ・色の付いた表(text/html)も書き、Excel・Google スプレッドシート・Word・メールに貼ると表の形になる(このグリッドへの貼り付けは TSV を読む)。20,000 セルを超える範囲は TSV だけ。中身は「書式つきのコピー(`copyFormat` / `copyHeaders`)」節。 |
30
+ | `copyHeaders` | `boolean` | `false` | コピーの先頭に列の名前の行(列のグループ(`columnGroups`)の段も)を入れる(1.12.0 から。`copyFormat` が `'text'` でも効く)。切り取りと 1 セルだけのコピーには入れない。このグリッドでコピーした見出しつきの文字をそのままこのグリッドへ貼ったときは見出しの行を飛ばす。 |
29
31
  | `rowHeight` | `number` | density 依存(standard: `36`) | uniform 行の行高(px)。未指定時は density プリセット(compact: `28` / comfortable: `44`)から解決。明示指定が常に優先。 |
30
32
  | `autoHeight` | `boolean` | `false` | auto-height 行(可変行高)を有効化する**大本のスイッチ**。これに加えて**少なくとも1列に `column.autoHeight: true`** が必要(その列が折り返して行高を駆動)。両方 true かつ**行数 ≤ 50,000**のとき有効(超過時は uniform `rowHeight` へフォールバック)。詳細は「auto-height 行」節。 |
31
33
  | `verticalAlign` | `'top' \| 'center'` | — | auto-height で伸びた行(基準の `rowHeight` より高い行)での、セルの中身の縦の揃え。書かなければ `autoHeight` の列は上(折り返した文章の 1 行目)、ほかの列は真ん中。`'top'` で全部の列を上に、`'center'` で全部の列を真ん中にそろえる(列ごとの指定は `GridColumn.verticalAlign` が優先)。1 行の行と、auto-height を使わないグリッドではどれも真ん中。詳細は「auto-height 行」節。 |
@@ -42,7 +44,7 @@
42
44
  | `showSaveStatus` | `boolean` | `true` | serverSide の書き戻し(`dataSource.updateRows`)で、確定したセルに保存状態の印を出す。保存中は斜線 + 小さなスピナー(`[data-ssg-save="pending"]`)、成功は ✓ バッジを 1.3 秒(`"ok"`)、失敗は揺れ + 赤いフラッシュ + ✕ バッジ(`"failed"`)とセル下のチップ(文言は `localeText` の `saveFailedCell`。既定「保存に失敗しました。値を戻しました」。4 秒 / スクロールで消える)。既存の保存失敗バー(`onServerSideWriteError`)とは独立に出る。描画中のセルだけが対象(保存中の印は、スクロールで外れて戻ったセルにも付き直す)。clientSide では何も出ない。 |
43
45
  | `rowDragMotion` | `'ghost' \| 'live'` | `'ghost'` | 行ドラッグ並べ替え(`enableRowDrag`)の表示方式。`'ghost'` は従来(ゴースト + ガイド線、ドロップ後に新しい位置へスライド)。`'live'` は掴んだ行がポインタに追従し、通る先の行がその場で上下へ退避する(ドロップ先が「隙間」として見える。枠外で離しても直前の位置へ確定、`Esc` で元へ戻る。ウィンドウからフォーカスが外れたときも元へ戻る)。`motion` が `'off'` のときは `'ghost'` と同じ。 |
44
46
  | `columnDragMotion` | `'ghost' \| 'live'` | `'ghost'` | 列ヘッダーのドラッグ並べ替え(`onColumnsChange` 指定時)の表示方式。`'ghost'` は従来(ゴースト + 縦線、ドロップ後に新しい位置へスライド)。`'live'` は同じペイン内では掴んだ列(ヘッダー + 描画中のセル)がポインタに追従し、通る先の列がその場で左右へ退避する(ドロップ先が「隙間」として見える。枠外で離しても直前の位置へ確定、`Esc` で元へ戻る。ウィンドウからフォーカスが外れたときも元へ戻る)。固定列のペインをまたいで移す(固定の変更)ときは、掴んだ列の複製(浮かぶ列)がポインタに付いてきて元のペインは列が抜けた分だけ詰まり、移動先は縦線で示す(浮かぶ列の見出しに、固定ペインへはピン / 中央へは移動の矢印のアイコン。浮かぶ列は表の枠の内側に収まり、離すと新しい位置へ滑り込む)。`motion` が `'off'` のときは `'ghost'` と同じ。 |
45
- | `find` | `boolean \| FindOptions` | `false` | **セル内検索**。`true` でグリッド右上の検索バー(`.ssg-find-bar`)と `Ctrl/Cmd+F`(グリッドにフォーカスがあるときだけ横取り)が有効になる。表示文字列(`valueFormatter` 適用後)への部分一致で、ヒットをすべて `<mark class="ssg-find-mark">` で強調し、`Enter` / `↓` で次、`Shift+Enter` / `↑` で前へ(アクティブセルとスクロールが追従)、`Esc` で閉じる。行は消さない(絞り込みのフィルターとは別)。`FindOptions` = `{ shortcut?: boolean(既定 true。false でブラウザ標準の検索に譲る), caseSensitive?: boolean(既定 false) }`。走査は時間分割(1 チャンク 10ms)で入力を止めない。SSRM はロード済み範囲だけが対象。ヒットは 10,000 件で打ち切り(件数に `+`)。詳細は「セル内検索」節。 |
47
+ | `find` | `boolean \| FindOptions` | `false` | **セル内検索**。`true` でグリッド右上の検索バー(`.ssg-find-bar`)と `Ctrl/Cmd+F`(グリッドにフォーカスがあるときだけ横取り)が有効になる。表示文字列(`valueFormatter` 適用後)への部分一致で、ヒットをすべて `<mark class="ssg-find-mark">` で強調し、`Enter` / `↓` で次、`Shift+Enter` / `↑` で前へ(アクティブセルとスクロールが追従)、`Esc` で閉じる。行は消さない(絞り込みのフィルターとは別)。`FindOptions` = `{ shortcut?: boolean(既定 true。false でブラウザ標準の検索に譲る), caseSensitive?: boolean(既定 false), replace?: boolean(既定 false。true で置換の段と `Ctrl+H`。1.12.0 から。「検索と置換」節) }`。走査は時間分割(1 チャンク 10ms)で入力を止めない。SSRM はロード済み範囲だけが対象。ヒットは 10,000 件で打ち切り(件数に `+`)。詳細は「セル内検索」節。 |
46
48
  | `onFindChange` | `(params: FindChangeParams) => void` | — | セル内検索の状態(`{ query, matchCount, currentIndex, open, truncated }`)が変わったときの通知。`currentIndex` は 0 始まり(ヒットなしは `null`)。ヒットは 10,000 件で打ち切り、打ち切ったときは `truncated` が `true`(`matchCount` は 10000。組み込みのバーは「10000+」と出す。1.2.0 から)。ツールバーに「3 / 12」を出す等に使う。 |
47
49
  | `rowHeaderWidth` | `number` | `56` | 行番号列の幅(px)。行番号列は左固定列が無くても左に固定され、横にスクロールしても流れない(Excel の行見出しと同じ。0.63.0 から)。 |
48
50
  | `height` | `number \| string` | `—` | グリッドの明示高さ。**値の種類で何の高さかが変わる**。① `%` を含む文字列(`'100%'` / `'50%'` / `'calc(100% - 40px)'`): トップバー・フィルターチップバー・ボトムバーを含む**グリッド全体**の高さ。`'100%'` でグリッドが親要素に収まり、バーを除いた残りがスクロール領域になる(ルートに `ssg-root--fill-height` が付く)。親要素が確定高さを持つ前提で、親が高さ `auto` だと全行分まで伸びて仮想化が効かない。② `number`(px)/ `%` を含まない文字列(`'400px'` / `'50vh'` / `'calc(100vh - 120px)'`): **スクロール領域だけ**の高さ(グリッド全体はバーの分だけ高くなる)。③ 未指定: スクロール領域は内容の高さで `maxHeight` によりクリップ。ルートへの `style={{ height }}` だけではスクロール領域は決まらないため、高さはこの prop で指定する。 |
@@ -469,6 +471,26 @@ import { localeTextEn } from '@ishibashi0112/spreadsheet-grid/locales/en';
469
471
  | `findNextHint` | `次へ(Enter)` | `Next (Enter)` | 検索の ↓ のツールチップ。 |
470
472
  | `findClose` | `検索を閉じる` | `Close find` | 検索の × の読み上げの名前。 |
471
473
  | `findCloseHint` | `閉じる(Esc)` | `Close (Esc)` | 検索の × のツールチップ。 |
474
+ | `findReplaceShow` | `置換の欄を開く` | `Show replace` | 置換の段を開く ▸ の読み上げの名前。 |
475
+ | `findReplaceHide` | `置換の欄を閉じる` | `Hide replace` | 置換の段を閉じる ▸ の読み上げの名前。 |
476
+ | `findReplaceToggleHint` | `置換(Ctrl+H)` | `Replace (Ctrl+H)` | 置換の段を開く ▸ のツールチップ。 |
477
+ | `findReplacePlaceholder` | `置換後` | `Replace` | 置換後の入力欄の placeholder。 |
478
+ | `findReplaceInput` | `置換後の文字` | `Replacement text` | 置換後の入力欄の読み上げの名前。 |
479
+ | `findReplace` | `置換` | `Replace` | 置換のボタン。 |
480
+ | `findReplaceHint` | `今の当たりを置換して次へ(Enter)` | `Replace this match and go to the next (Enter)` | 置換のボタンのツールチップ。 |
481
+ | `findReplaceAll` | `すべて置換` | `Replace all` | すべて置換のボタン。 |
482
+ | `findInSelection` | `選んだ範囲だけ` | `In selection` | 「選んだ範囲だけ」のチェックボックス。 |
483
+ | `findReplacing` | `置換中…` | `Replacing…` | すべて置換の途中。 |
484
+ | `findReplaced` | `{replaced} 件を置換しました` | `Replaced {replaced}` | 置換の結果(飛ばしたセルが無いとき。`{replaced}` = 置換した数)。 |
485
+ | `findReplacedSkipped` | `{replaced} 件を置換、{skipped} 件は置換できないため飛ばしました` | `Replaced {replaced}, skipped {skipped} that cannot be replaced` | 置換の結果(飛ばしたセルがあるとき)。 |
486
+ | `findReplaceNothing` | `置換するものがありません` | `Nothing to replace` | すべて置換で当たりが無かったとき。 |
487
+ | `findReplaceCellSkipped` | `このセルは変更できないため飛ばしました` | `Skipped: this cell cannot be changed` | 今の当たりのセルを飛ばしたとき(変更できないセル)。 |
488
+ | `findReplaceCellUnsupported` | `この列は置換できないため飛ばしました` | `Skipped: this column cannot be replaced` | 今の当たりのセルを飛ばしたとき(置換できない種類の列。数値・日付・表示を書き換えた列など)。 |
489
+ | `findReplaceCellNotOption` | `候補に無い名前になるため飛ばしました` | `Skipped: the result is not one of the options` | 今の当たりのセルを飛ばしたとき(選択の列で、候補に無い名前になる)。 |
490
+ | `findReplaceCellInvalid` | `入力の検査で断られたため飛ばしました({message})` | `Skipped: {message}` | 今の当たりのセルを飛ばしたとき(入力の検査で断られた。`{message}` = 検査のメッセージ)。 |
491
+ | `findReplaceCellUnchanged` | `置き換えても値が変わらないため飛ばしました` | `Skipped: the value would not change` | 今の当たりのセルを飛ばしたとき(置き換えても値が変わらない)。 |
492
+ | `findInSelectionNeedsRange` | `先に表で 2 つ以上のセルを選んでください` | `Select two or more cells first` | 「選んだ範囲だけ」を入れるのに範囲が無いとき。 |
493
+ | `findReplaceInterrupted` | `表が変わり続けたため置換をやめました(何も置換していません)` | `Stopped: the table kept changing (nothing was replaced)` | すべて置換の間に表が変わり続けて、置換をやめたとき。 |
472
494
  | `fillOptions` | `オートフィル オプション` | `Auto Fill Options` | フィルのボタンのツールチップとメニューの名前。 |
473
495
  | `fillOptionsCurrent` | `オートフィル オプション({kind})` | `Auto Fill Options ({kind})` | フィルのボタンの読み上げの名前(`{kind}` = `fillSeries` / `fillCopy`)。 |
474
496
  | `fillSeries` | `連続データ` | `Fill Series` | フィルのメニュー。 |
@@ -962,6 +984,24 @@ const gridRef = useRef<SpreadsheetGridHandle<Row>>(null);
962
984
  - **スタイル**: ヒットは `.ssg-find-mark`、カレントは `.ssg-find-mark--current`(トークン `--ssg-find-mark-bg` / `--ssg-find-mark-current-bg`)。バーは `classNames.findBar`。
963
985
  - **ショートカット**: `Ctrl/Cmd+F` の横取りはグリッド本体にフォーカスがあるときだけ(フィルター入力 / エディタ内では効かない)。`shortcut: false` でブラウザ標準の検索に譲り、`handle.openFind()` だけで開く運用もできる。スマートフォンなど `Ctrl/Cmd+F` を押せない環境では検索バーを開く手段が無いので、ツールバーなどに `handle.openFind()` を呼ぶボタンを置く。
964
986
 
987
+ ### 検索と置換(`find.replace`)
988
+
989
+ `find={{ replace: true }}` で、検索バーに置換の段が付く(1.12.0 から。**既定は無効**)。検索バーの左端の ▸ で開閉し、`Ctrl+H`(グリッドにフォーカスがあるとき。検索の入力欄の中でも)で置換の段を開いた形で開く。`Ctrl/Cmd+F` は閉じていた検索バーを置換の段を閉じた形で開く。
990
+
991
+ ```tsx
992
+ <SpreadsheetGrid find={{ replace: true }} rows={rows} onRowsChange={setRows} ... />
993
+ // 置換の段を開いて「大阪」を探す
994
+ gridRef.current?.openFind({ query: '大阪', replace: true });
995
+ ```
996
+
997
+ - **置換**: 今の当たりのセルを置換後の文字で置き換え、そのセルより後ろの当たりへ移る(置換後の欄の `Enter` も同じ)。1 つのセルの当たりはすべて置き換える。**すべて置換**は今の当たりをすべて置き換える(検索の 10,000 件の上限に関係なく、すべての行を時間で分けて調べる。その間はボタンを止めて「置換中…」)。どちらも書き込みは 1 回の `onRowsChange` で、元に戻す(`Ctrl/Cmd+Z`)も 1 回(`trackChanges` の印も付く)。すべて置換は調べ終えてから書くので、途中で検索バーを閉じた・「選んだ範囲だけ」が外れた・表が変わり続けた(外から rows を差し替えるたびに調べ直し、3 回で終わらなければ知らせの行に出す)ときは何も書かずにやめる(`replaceAll` は `{ replaced: 0, skipped: 0 }` で解決)。外から短い間隔で行を更新し続ける表は、すべて置換の間は更新を止める。大文字と小文字は検索の `caseSensitive` のまま。正規表現は使わない。
998
+ - **置き換えるセル**: 文字の列(値が文字で、画面の文字が値と同じ列)と選択(`select`)の列。選択の列は画面の名前(`label`)を置き換え、結果が候補の名前か値になるときだけその値を書く(`allowFreeText` の列は置き換えた文字を書く)。書く値は貼り付けと同じ規則(列の `parseClipboardValue`・`validationMode: 'reject'` の検査)。
999
+ - **飛ばすセル**: 変更できないセル(`readOnly` の列 / `editable: false` / `canEditCell` が false)・数値・日付・時刻・日時・チェックボックス・自作のエディタ・複数選択の列・`valueFormatter` で表示を変えた文字の列(選択の列は除く)・計算の列(`getValue` だけ)・`validationMode: 'reject'` で断られる値・候補に無い名前になる選択の列・置き換えても値が変わらないセル(選択の列で同じ候補になるなど)。飛ばした当たりにも同じ印が付いたまま残り(すべて置換の後に残った当たり = 飛ばしたセル)、知らせの行に「4 件を置換、1 件は置換できないため飛ばしました」のように数が出る。1 件ずつの置換で飛ばしたときは理由ごとの文(変更できないセル・置換できない列・候補に無い名前・入力の検査のメッセージ・値が変わらない)。ラベル行・グループ行・合計行・固定行・入力行とツリーデータの集計のセルは検索と同じく対象外。
1000
+ - **選んだ範囲だけ**: チェックを入れた時点の選択(2 つ以上のセル。行の選択は全部の列、列の選択は全部の行)の中だけを探して置き換える(件数・印・↑↓ も範囲の中だけ = Excel と同じ)。範囲を選んでから探す文字を打った後(最初の当たりへ移って選択が 1 セルになった後)にチェックを入れても、打つ前に選んでいた範囲を使う。範囲は入れたときの行で覚える(置き換えた行が絞り込みから外れても、範囲の外の行は入らない。範囲の行がすべて外れたら範囲は残ったまま当たりは 0 件)。範囲は薄い色(`.ssg-find-scope-overlay`)で見える。並べ替え・絞り込み・グループの開閉・列の入れ替えで見え方が変わると外れる(すべて置換の途中で外れたらそこでやめる)。絞り込みで隠れた行と折りたたんだグループの中の行は置き換えない(検索と同じ。ツリーデータは閉じた親の中の行も置き換える)。
1001
+ - **使えない表**: 読み取り専用の表(`readOnly`・`onRowsChange` が無い)では置換の段を出さない(検索だけ)。`serverSide`(`dataSource`)の表では使えない(開発時に警告して検索だけ)。
1002
+ - **命令的 API**: `openFind({ query, replace: true })` / `replaceNext(text)`(今の当たりを置換して次へ。`{ replaced, skipped }` を返す)/ `replaceAll(text)`(`Promise<{ replaced, skipped }>`)。置換が使えない表では `openFind` は検索だけを開き、`replaceNext` / `replaceAll` は何もしない(0 件)。`openFind({ query })` の直後は検索が終わるまで当たりが無いので、`replaceNext` は検索が終わってから(`onFindChange` で件数が出てから)呼ぶ(`replaceAll` は直後でもよい)。タッチの端末など `Ctrl+H` を押せない環境では、ツールバーなどに `openFind({ replace: true })` を呼ぶボタンを置く。
1003
+ - **`/lite`**: `findReplaceFeature`(`findFeature` も要る)。
1004
+
965
1005
  ### 入力行(`newRow`)
966
1006
 
967
1007
  表の最後に空の入力行を出し、そこに打つと行が増えます(1.10.0 から。Excel のテーブル・Airtable の最後の行と同じ)。
@@ -1019,6 +1059,23 @@ Excel と同じキーで、切り取り・下 / 右へのコピー・一括入
1019
1059
  - `Ctrl` / `⌘+D` はブラウザのブックマーク、`Ctrl` / `⌘+R` は再読み込みのキーです。グリッドにフォーカスがあり、そのキーが効く表のときだけグリッドが受けます(ブラウザへ残したいキーは `false` を書く)。`Ctrl+Space` は Windows の IME の切り替え・Mac の入力ソースの切り替えに使われていることがあり、そのときはページに届きません。
1020
1060
  - `/lite`(`createSpreadsheetGrid`)では、切り取りは本体にあり、ほかの 6 つは `excelShortcutsFeature` を入れたときだけ効きます(入れずに書くと開発時に 1 回警告)。
1021
1061
 
1062
+ ### 書式つきのコピー(`copyFormat` / `copyHeaders`)
1063
+
1064
+ `copyFormat="rich"` で、コピーと切り取りが TSV(text/plain)と一緒に書式つきの表(text/html)もクリップボードへ書きます(1.12.0 から。**既定は `'text'` = 今までどおり**)。Excel・Google スプレッドシート・Word・Gmail・Outlook に貼ると、罫線・寄せ・色の付いた表になります。`copyHeaders` で列の名前の行も入れます。
1065
+
1066
+ ```tsx
1067
+ <SpreadsheetGrid copyFormat="rich" copyHeaders rows={rows} columns={columns} ... />
1068
+ ```
1069
+
1070
+ - **行と列**: 文字のコピーと同じ(選択の範囲。合成列は入れず、`isRowExportable` が `false` の行は除く。ツリーデータの子を持つ行は集計値)。
1071
+ - **セルの文字**: 書式つきの表は画面と同じ文字(`valueFormatter` があればその文字、無ければエディタの種類で決まる文字。複数選択は名前を区切りでつないだ文字)。TSV は今までどおり値(`formatClipboardValue` / `clipboard: 'label'` の列はその文字)。`renderCell` の列は文字だけ、データバーも文字だけ(帯は書かない)。ツリーデータの子を持つ行の集計のセルは画面と同じ集計の文字。状態チップ(`conditionalFormat.chips`)はチップの名前と色(画面でチップを描くセルだけ = `renderCell` の列・チェックボックス・複数選択のセルには付けない)、カラースケール(`colorScale`)はセルの背景の色。文字の先頭の空白と続いた空白は、貼り付け先によっては 1 つにまとまる(HTML の決まり。TSV はそのまま)。
1072
+ - **見た目**: すべてのセルに罫線、見出しは太字で地の色、寄せは列の `align`(見出しは `headerAlign`)。色はコピーした時点で計算した色(`#rrggbb`)を背景と文字の両方に書き、表の地と文字の色は書かない(貼り付け先の既定の色のまま)。表がダークのときもライトのときの色で書く(貼り付け先の多くは白い地)。テーマ(`--ssg-*` のトークン)で変えた色は、ライトの表ならその色。
1073
+ - **文字の列**: 数値・日付・時刻・日時・チェックボックス以外の列の文字と見出しの名前は、Excel が「00123」「1-2」を数や日付に読み替えないよう「文字列」の書式(`mso-number-format`)で書く。表を作る途中で例外になったとき(`valueFormatter` やチップの関数が投げたなど)は TSV だけ書く(開発時はコンソールにエラー)。
1074
+ - **見出し(`copyHeaders`)**: 列の名前(空の `title` は `key`)の行を先頭に入れる。列のグループ(`columnGroups`)があれば、コピーする列に掛かるグループの段も上に入れる(TSV はグループの名前を最初の列に書き残りは空 = CSV のエクスポートと同じ形、書式つきの表はセルをつなげる)。`copyFormat="text"` でも効く。切り取りと 1 セルだけのコピー(1 つの値をチャットや入力欄へ写す操作)には入れない。このグリッドでコピーした見出しつきの文字をそのままこのグリッドへ貼ったときは、見出しの行を飛ばす(点線が消えた後・並べ替えた後も。ほかのアプリでコピーし直した文字・ほかのグリッドへ貼ったときは見出しも値として入る)。
1075
+ - **大きさ**: 20,000 セルを超える範囲は TSV だけ書く(大きな HTML はクリップボードと貼り付け先を重くするため)。
1076
+ - **ブラウザ**: `navigator.clipboard.write`(`ClipboardItem`)で書き、無いブラウザ(Firefox 126 まで)や断られたときは `copy` イベントで書く。どちらもだめなら TSV だけ(今までどおり)。
1077
+ - **`/lite`**: `richCopyFeature`。入れずに `copyFormat="rich"` を書くと TSV だけ(開発時に 1 回警告)。`copyHeaders` の TSV は本体にある。
1078
+
1022
1079
  ### キーボード操作
1023
1080
 
1024
1081
  グリッド本体フォーカス中(編集中でない)の操作一覧。フィルター入力等のフォーム要素にフォーカス中は無効。
@@ -1036,10 +1093,11 @@ Excel と同じキーで、切り取り・下 / 右へのコピー・一括入
1036
1093
  | `Enter` / `Space`(グループ行 / 展開トグル列のセル) | そのグループ / 展開行の開閉(編集は始めない)。 |
1037
1094
  | `Alt+Shift+↓` / `Alt+Shift+↑`(Mac は `Option`。ツリーデータの木の列のセル) | その行を開く / 閉じる(`treeData`。1.9.0 から。`Enter` は編集なので使わない)。 |
1038
1095
  | `Escape` | 選択解除(範囲を選んでいるとき。グリッドを入れたダイアログはこの `Escape` では閉じない。1 セルを選んでいるだけのときは見た目は変わらず、`Escape` はダイアログへ届く)。 |
1039
- | `Ctrl/Cmd+C` / ペースト(`Ctrl/Cmd+V`) | 選択範囲の TSV コピー(範囲の選択が無いとき(`Escape` で外した後など)はアクティブセルの 1 セル。1.3.0 から。`isRowExportable` 指定時は `false` の行を除く)/ 貼り付け(readOnly では no-op)。貼り付けは選択範囲の左上から(列の選択は列の先頭のデータ行、行の選択は行の先頭から。選択の外にアクティブセルがあるときはアクティブセルから)。1 セルのコピー(と、範囲がコピーの大きさの倍数)はセルの範囲いっぱいに繰り返す(Excel と同じ。1.2.0 から。`pasteFillsSelection={false}` で 1 回だけ)。ラベル行・グループ行は飛ばして次のデータ行へ貼る。TSV は Excel / Google スプレッドシート互換(改行・タブ・`"` を含むセルは `"…"` で囲み `"` は `""`。貼り付けはこの引用符を解釈し、途中の空行も行として保持する。最後の行のセルがすべて空なら、コピーの文字の末尾に改行を 1 つ足す = Excel のコピーと同じ形で、貼り付けで最後の空の行が消えない。1.0.2 から)。合成列(行ドラッグのハンドル列・展開トグル列・自動グループ列)はコピーの列に数えず(TSV に空の列を作らない)、貼り付けでも飛ばす(合成列のセルから貼るとその右のデータ列から書く)。 |
1096
+ | `Ctrl/Cmd+C` / ペースト(`Ctrl/Cmd+V`) | 選択範囲の TSV コピー(範囲の選択が無いとき(`Escape` で外した後など)はアクティブセルの 1 セル。1.3.0 から。`isRowExportable` 指定時は `false` の行を除く)/ 貼り付け(readOnly では no-op)。貼り付けは選択範囲の左上から(列の選択は列の先頭のデータ行、行の選択は行の先頭から。選択の外にアクティブセルがあるときはアクティブセルから)。1 セルのコピー(と、範囲がコピーの大きさの倍数)はセルの範囲いっぱいに繰り返す(Excel と同じ。1.2.0 から。`pasteFillsSelection={false}` で 1 回だけ)。ラベル行・グループ行は飛ばして次のデータ行へ貼る。TSV は Excel / Google スプレッドシート互換(改行・タブ・`"` を含むセルは `"…"` で囲み `"` は `""`。貼り付けはこの引用符を解釈し、途中の空行も行として保持する。最後の行のセルがすべて空なら、コピーの文字の末尾に改行を 1 つ足す = Excel のコピーと同じ形で、貼り付けで最後の空の行が消えない。1.0.2 から)。合成列(行ドラッグのハンドル列・展開トグル列・自動グループ列)はコピーの列に数えず(TSV に空の列を作らない)、貼り付けでも飛ばす(合成列のセルから貼るとその右のデータ列から書く)。`copyFormat="rich"` で書式つきの表(text/html)も一緒に書き、`copyHeaders` で列の名前の行を先頭に入れる(1.12.0 から。「書式つきのコピー」節)。 |
1040
1097
  | `Ctrl/Cmd+X` | 切り取り(1.10.0 から。既定で効く)。選んだ範囲をコピーして点線で囲み、このグリッドへ同じ文字を貼ると元のセルを空にする(「Excel のキー(`excelShortcuts`)」節)。`excelShortcuts={false}` か `{ cut: false }` で何もしない(1.9 までと同じ)。 |
1041
1098
  | `Ctrl+D` / `Ctrl+R` / `Ctrl+;` / `Shift+Space` / `Ctrl+Space` | 下へコピー / 右へコピー / 今日の日付 / 行を選ぶ / 列を選ぶ(`excelShortcuts` に書いた表だけ。1.10.0 から。「Excel のキー(`excelShortcuts`)」節)。書いていない表では今までどおり(グリッドは受けない)。 |
1042
1099
  | `Ctrl/Cmd+F` | セル内検索バーを開く(`find` が有効なとき。無効ならブラウザ標準の検索)。 |
1100
+ | `Ctrl+H` | 置換の段を開いた検索バーを開く(`find={{ replace: true }}` で置換が使えるとき。1.12.0 から。`Cmd+H` は macOS のアプリを隠すキーなので使わない)。 |
1043
1101
  | `Ctrl/Cmd+A` | 全体選択(2 回目で解除)。 |
1044
1102
  | `Delete` / `Backspace` | 選択セル(なければアクティブセル)の値クリア。編集不可セルは対象外。クリア値は「空文字のペースト」と同じ規則(`parseClipboardValue('')` 経由、未定義なら `''`)。変更が無ければ no-op(undo 履歴にも積まれない)。 |
1045
1103
  | `Ctrl/Cmd+Z` / `Ctrl/Cmd+Shift+Z` / `Ctrl/Cmd+Y` | undo / redo(詳細は命令的 API の「undo / redo」節)。 |
@@ -1091,6 +1149,7 @@ WAI-ARIA の grid パターンに沿って、表・行・セルに役割と状
1091
1149
  | 合計行(`totalRow`) | `role="row"`(表の最後の行。`aria-rowindex` = 表示行数 + 2 + 固定行の数)。見出し(「合計」)の欄は `role="rowheader"`、セルは `role="gridcell"`。見出しを先頭のデータ列に出すときはそのセルが行見出しで、行番号の欄は見た目だけ(`aria-hidden`。1.2.0 から。文字の無い行見出しを作らない)。 |
1092
1150
  | 固定行(`pinnedTopRows` / `pinnedBottomRows`) | `role="row"`。上の固定行は見出し行の次(`aria-rowindex` は 2 から)、下の固定行はデータ行の後(合計行の前。`pinnedBottomRowsPlacement: 'belowTotal'` なら合計行の後)。行見出しは `role="rowheader"` で、ピンの印(`role="img"`)に `aria-label`(「上に固定 1」「下に固定 2」。`localeText` の `pinnedTopRow` / `pinnedBottomRow`)。行見出しの名前はこの印から決まる(1.2.0 から。1.1.0 は行見出しに `aria-label` で、文字の無い行見出しとして axe の `empty-table-header` になっていた)。セルは `role="gridcell"` + `aria-readonly`。 |
1093
1151
  | フィルハンドル(`fillHandle`) | ハンドルは `aria-hidden`(ポインタ操作。キーボードではコピー / 貼り付け)。埋めたあとのボタンは `aria-haspopup="menu"` / `aria-expanded` / `aria-label`(「オートフィル オプション(連続データ)」等)、メニューは `role="menu"`、項目は `role="menuitemradio"` + `aria-checked`。 |
1152
+ | 検索バー(`find`) | `role="search"`、`aria-label` は `localeText.findLabel`(既定 `セル内検索`)。入力欄にも `aria-label`。件数と置換の知らせは `aria-live="polite"`(同じ文の知らせが続いても届くよう、知らせのたびに文の要素を作り直す)。置換の段(`find={{ replace: true }}`)の ▸ は `aria-expanded`、置換 / すべて置換のボタンは使えないとき `aria-disabled="true"`(押したボタンのフォーカスは残る)。開くと検索の欄へフォーカスが移り(開いたまま `Ctrl/Cmd+F` / `Ctrl+H` / `openFind()` でも)、`Esc`(バーのどこからでも)で閉じてグリッドへ戻る。`Tab` の順は 検索の欄 → ↑ ↓ × → 置換後の欄 → 置換 → すべて置換 → 「選んだ範囲だけ」。1.12.0 から(バーは 1.0 から)。 |
1094
1153
 
1095
1154
  - 仮想化で描画していない行・列は DOM に無いため、表全体の中の位置は `aria-rowindex` / `aria-colindex` / `aria-rowcount` / `aria-colcount` で伝える。
1096
1155
  - 制約: 固定列(`pinned`)があると、1 つの行が左 / 中央 / 右のペインごとの `role="row"` に分かれる(どれも同じ `aria-rowindex`。読み上げの順は DOM 順でペインごと)。展開行(`detailRow`)の帯は `aria-rowindex` を持たない(データ行の番号をずらさないため)。表の直後の空の要素(`Tab` で展開行のカードから表の外へ出るための目印)は、カードがあって `Tab` の順番に入っている間だけ `aria-hidden` を外す(1.3.0 から。フォーカスが来たらすぐ表の外の次の要素へ移す)。縦固定で複製したラベル行(`labelRow.sticky`)は `aria-hidden` で、中のボタン等は `tabindex="-1"`(Tab で止まらない。マウスでは押せる。本物のラベル行はそのまま)。
@@ -2214,7 +2273,7 @@ const gridRef = useRef<SpreadsheetGridHandle<Row>>(null);
2214
2273
 
2215
2274
  `viewRowIndex` / `colIndex` は**ビュー座標**(フィルター/ソート適用後の表示 index。`colIndex` は固定列を含む視覚順 = 左→中央→右)。`viewRowIndex` はラベル行・グループ行も 1 行に数え、`colIndex` は行ドラッグのハンドル列・展開トグル列・自動グループ列(ライブラリが足す列)も数える。行キー / 列キーからは `getViewRowIndex(rowKey)` / `getColIndex(columnKey)` で引ける。アクティブセルは表示位置に付く(上の行を消すと、同じ位置に来た別の行を指す。Excel と同じ)。範囲外 index は内部でクランプ/無視する。表示行数が減った(rows 差し替え / フィルター / グループの折りたたみ等)ときも、はみ出したアクティブセル / 選択範囲は範囲内へ詰められる(アクティブセルは最終行へ寄せ、範囲ははみ出した部分を切り詰める。0 行になったらセル / 行の選択とアクティブセルは解除)。列が減ったとき(`columns` から外す / 非表示にする)も同じく最終列へ寄せて切り詰める(0 列になったらアクティブセルとセル / 列の選択は解除)。グリッドの中で列を変えたとき(見出しのドラッグ・列メニューの「列の固定」と「列を隠す」・ツールパネルの「列」タブ・列のリセット)は、アクティブセルはその列に付いていき(その列を隠したときは同じ位置のまま)、選択はアクティブセルの 1 セルになる(1.3.0 から。それまでは外れていた。列メニューのグループ化を変えたときは外れる)。貼り付けの後の選択も書き込んだ範囲まで。行が 0 件のときの `selectCell` / `selectRange` / `setActiveCell` は何もしない。このため `getActiveCell()` / `getSelection()` が存在しない行や列を返すことはない。
2216
2275
 
2217
- **外したグリッドのハンドル**(1.3.0 から): グリッドを外した(アンマウントした)後も、変数に残したハンドルは呼べる。状態を変えるメソッド(`applyRows` / `undo` / `selectCell` / `applyState` / `scrollToRow` など)は何もせず(`startEditing` は `false` を返す)、開発ビルドでだけ console に 1 回警告する。読むメソッド(名前が `get` / `is` / `can` / `export` / `download` で始まるもの)は外したときの値を返す(外す直前に `getState()` を保存する書き方のため)。ただしスクロールの位置は表の要素から読むので、`getScrollPosition()` は `null`、`isAtBottom()` は `false` を返す(位置を残したいときは外す前に読むか、`onScroll` で覚えておく)。同じグリッドがまた描かれたら元どおりに動く。
2276
+ **外したグリッドのハンドル**(1.3.0 から): グリッドを外した(アンマウントした)後も、変数に残したハンドルは呼べる。状態を変えるメソッド(`applyRows` / `undo` / `selectCell` / `applyState` / `scrollToRow` など)は何もせず(値を返すものは何もしなかったときの値: `startEditing` / `focusNewRow` / `commitNewRow` は `false`、`replaceNext` は `{ replaced: 0, skipped: 0 }`、`replaceAll` はそれで解決する Promise)、開発ビルドでだけ console に 1 回警告する。読むメソッド(名前が `get` / `is` / `can` / `export` / `download` で始まるもの)は外したときの値を返す(外す直前に `getState()` を保存する書き方のため)。ただしスクロールの位置は表の要素から読むので、`getScrollPosition()` は `null`、`isAtBottom()` は `false` を返す(位置を残したいときは外す前に読むか、`onScroll` で覚えておく)。同じグリッドがまた描かれたら元どおりに動く。
2218
2277
 
2219
2278
  ### スクロール
2220
2279
 
@@ -2519,7 +2578,9 @@ const buffer = await writeXlsx({
2519
2578
 
2520
2579
  | メソッド | 説明 |
2521
2580
  | --- | --- |
2522
- | `openFind(query?)` | 検索バーを開く(`find` が無効なら何もしない)。`query` を渡すとその文字列で検索し、先頭のヒットへ移動する。省略時は前回のクエリのまま開く。 |
2581
+ | `openFind(query?)` | 検索バーを開く(`find` が無効なら何もしない)。`query` を渡すとその文字列で検索し、先頭のヒットへ移動する。省略時は空の欄で開く(閉じると探す文字は消える。開いているときは今の文字のまま)。`{ query?, replace? }`(`GridFindOpenOptions`)も渡せて、`replace: true` で置換の段も開く(置換が使える表だけ。1.12.0 から)。開いているときに呼ぶと検索の欄へフォーカスを移す(1.12.0 から)。 |
2582
+ | `replaceNext(text)` | 今のヒットのセルを `text` で置換して、そのセルより後ろのヒットへ移る(`find={{ replace: true }}` で置換が使えるときだけ。1.12.0 から)。戻り値は置換した数と飛ばした数(`GridFindReplaceResult` = `{ replaced, skipped }`。変更できないセルは飛ばす)。`openFind({ query })` の直後は検索が終わるまで当たりが無く 0 件(`onFindChange` で件数が出てから呼ぶ)。 |
2583
+ | `replaceAll(text)` | 今の検索の文字をすべて `text` で置換する(1 回の変更 = 元に戻すも 1 回。1.12.0 から)。すべての行を時間で分けて調べ、終わったら置換した数と飛ばした数で解決する `Promise<GridFindReplaceResult>` を返す。途中で検索バーを閉じた・表が変わり続けたなどでやめたときは何も書かずに `{ replaced: 0, skipped: 0 }`。 |
2523
2584
  | `closeFind()` | 検索バーを閉じる(クエリとヒットの強調が消える。開いていなければ何もしない)。 |
2524
2585
  | `findNext()` | 次のヒットへ(循環)。カレントのヒットへアクティブセルとスクロールが追従する。 |
2525
2586
  | `findPrev()` | 前のヒットへ(循環)。 |
@@ -2773,7 +2834,9 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2773
2834
  | `columnGroups` | `columnGroupsFeature` | 列のグループ(多段の列見出し。`columnGroups` / `onColumnGroupOpenChange`。ハンドルの `setColumnGroupOpen()` は本体にある。グループの見出しの掴み手は `columnReorder`、列メニューの開閉の項目は `columnMenu` も要る) | +4.7KB |
2774
2835
  | `export` | `exportFeature` | CSV / TSV / `getExportData`(ハンドルの `exportCsv` / `downloadCsv` / `getExportData`) | +3.5KB |
2775
2836
  | `contextMenu` | `contextMenuFeature` | セル / 行の右クリックメニュー(`enableContextMenu` / `getContextMenuItems`) | +3.1KB |
2776
- | `find` | `findFeature` | セル内検索(`find` / `onFindChange`) | +3.0KB |
2837
+ | `find` | `findFeature` | セル内検索(`find` / `onFindChange`) | +3.8KB |
2838
+ | `findReplace` | `findReplaceFeature` | 検索と置換(`find={{ replace: true }}`・`Ctrl+H`・ハンドルの `replaceNext` / `replaceAll`。`find` も要る) | +4.3KB |
2839
+ | `richCopy` | `richCopyFeature` | 書式つきのコピー(`copyFormat="rich"` の text/html の表。`copyHeaders` の TSV は本体にある) | +2.9KB |
2777
2840
  | `grouping` | `groupingFeature` | 行グルーピングと集計(`columns[].rowGroup` / `aggFunc`) | +2.8KB |
2778
2841
  | `columnAutosize` | `columnAutosizeFeature` | 列幅の自動調整(境界のダブルクリック・列メニューの項目・`autoSizeColumns`) | +2.5KB |
2779
2842
  | `scrollHint` | `scrollHintFeature` | スクロール位置インジケーター(`scrollHint`) | +2.4KB |
@@ -2798,10 +2861,10 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2798
2861
 
2799
2862
  | 構成 | 初期 JS(gzip) |
2800
2863
  | --- | --- |
2801
- | 全部入り(`SpreadsheetGrid`) | 約 207KB |
2802
- | `/lite` 機能なし | 約 107KB |
2803
- | `/lite` + `standardFeatures` | 約 133KB |
2804
- | `/lite` + `standardFeatures` + `serverSideFeature` | 約 138KB |
2864
+ | 全部入り(`SpreadsheetGrid`) | 約 216KB |
2865
+ | `/lite` 機能なし | 約 110KB |
2866
+ | `/lite` + `standardFeatures` | 約 135KB |
2867
+ | `/lite` + `standardFeatures` + `serverSideFeature` | 約 140KB |
2805
2868
 
2806
2869
  - 各機能の目安は「機能なし」に 1 つだけ足したときの増え方で、組み合わせると共通部分のぶん合計より少し小さくなる。バンドラーによって数 KB 前後する(0.61.0 の全部入りの実測で、Vite 8(Rolldown)は esbuild より約 1.5KB 小さく、Vite 7(Rollup)はほぼ同じ。Next.js 16 では webpack が Turbopack より約 4KB 大きい)。
2807
2870
  - 使わない機能がバンドルから落ちることは、Vite 8・webpack 5・Next.js 16(既定の Turbopack)・esbuild で確かめている(バンドラーが `package.json` の `sideEffects` と `/* @__PURE__ */` を解釈する必要がある)。
@@ -3236,6 +3299,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3236
3299
  | `.ssg-scroll-hint` | スクロール位置インジケーター(`scrollHint`)。 |
3237
3300
  | `.ssg-find-bar` | セル内検索(`find`)の検索バー。 |
3238
3301
  | `.ssg-find-mark` / `.ssg-find-mark--current` | セル内検索のヒット / 今のヒット(`<mark>`)。 |
3302
+ | `.ssg-find-scope-overlay` | 検索と置換の「選んだ範囲だけ」の範囲の薄い色(`find={{ replace: true }}`。1.12.0 から)。 |
3239
3303
  | `.ssg-icon-btn` | ヘッダーのアイコンボタン。 |
3240
3304
  | `.ssg-col-hover-overlay` | `hoverHighlight="cross"` の列の帯。 |
3241
3305
  | `.ssg-col-drop-indicator` | 列ドラッグの挿入位置の縦線。 |
@@ -3349,6 +3413,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3349
3413
  - `GridColumnPinned = 'left' | 'right'`
3350
3414
  - `GridSelectFilterOption = { label: string; value: string }`
3351
3415
  - `GridSelectEditorOption = GridSelectFilterOption & { description?: string; searchText?: string; data?: unknown }`(select エディタの候補。`description` は一覧で右に薄く出す補足(検索できる選択エディタの一覧だけ。`search` の無い select の一覧には出さない)、`searchText` は探すときだけ使う文字、`data` は `fillRow` で使う好きな値。どれも 1.7.0 から)
3416
+ - `GridFindOpenOptions = { query?: string; replace?: boolean }`(ハンドルの `openFind` のオプション)/ `GridFindReplaceResult = { replaced: number; skipped: number }`(`replaceNext` / `replaceAll` の結果。どちらも当たりの数)。どちらも 1.12.0 から(「検索と置換(`find.replace`)」節)
3352
3417
  - `GridNewRowOptions<T> = { placeholder?: string | ((column: GridColumn<T>) => string | null | undefined) }`(入力行 `newRow` のオプション。1.10.0 から。「入力行(`newRow`)」節)
3353
3418
  - `GridTrackChangesOptions = { rows?: boolean }`(`trackChanges` のオブジェクトの形。`rows: true` で行の追加と削除も追う。1.10.0 から)、`GridAddedRow<T> = { rowKey, row }` / `GridRemovedRow<T> = { rowKey, row }`(`getChanges()` の `added` / `removed` の 1 行。「行の追加と削除の追跡」節)
3354
3419
  - `GridSelectLoadOptionsParams<T> = { query, row, rowKey, column, signal }`(select エディタの `loadOptions` の引数)/ `GridSelectFillRowContext<T> = { row, rowKey }`(`fillRow` の第 2 引数)。どちらも 1.7.0 から。バレルから公開(「検索できる選択エディタ」節)
package/README.md CHANGED
@@ -52,7 +52,7 @@ More runnable examples (server-side row model, Astryx) are in [`examples/`](http
52
52
 
53
53
  ## Smaller bundles: `/lite` (0.54.0+)
54
54
 
55
- `SpreadsheetGrid` includes every feature (about 207KB gzip of initial JS). The `/lite` entry builds a grid with only the features you pass; the rest is left out of your bundle (about 107KB with no features, about 133KB with the `standardFeatures` preset).
55
+ `SpreadsheetGrid` includes every feature (about 216KB gzip of initial JS). The `/lite` entry builds a grid with only the features you pass; the rest is left out of your bundle (about 110KB with no features, about 135KB with the `standardFeatures` preset).
56
56
 
57
57
  ```tsx
58
58
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid/lite'
@@ -133,7 +133,7 @@ Astryx / Mantine / HeroUI v3 / shadcn/ui の中で使うときは、`style.css`
133
133
 
134
134
  ### バンドルを小さくする: `/lite`(0.54.0 から)
135
135
 
136
- `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 207KB gzip)。`/lite` の入口では、渡した機能だけを入れたグリッドを作れます。渡さなかった機能はバンドルに入りません(機能なしで約 107KB、プリセット `standardFeatures` で約 133KB)。
136
+ `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 216KB gzip)。`/lite` の入口では、渡した機能だけを入れたグリッドを作れます。渡さなかった機能はバンドルに入りません(機能なしで約 110KB、プリセット `standardFeatures` で約 135KB)。
137
137
 
138
138
  ```tsx
139
139
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid/lite'
@@ -1,3 +1,3 @@
1
1
  import type { SpreadsheetGridProps } from './model/gridTypes.js';
2
2
  import type { GridShellFeatures } from './features/types.js';
3
- export declare function useGridShell<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, serverSideRefetch, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, onPasteSkipped, pasteFillsSelection, excelShortcuts, newRow, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, verticalAlign, headerHeight: headerHeightProp, density, theme, motion, popupContainer, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, trackChanges, onChangesChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, globalFilterMatch, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, localeText, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, pinnedTopRows, pinnedBottomRows, pinnedBottomRowsPlacement, columnGroups: columnGroupsProp, columnGroupHeaderHeight: columnGroupHeaderHeightProp, onColumnGroupOpenChange, treeData, onTreeRowOpenChange, fillHandle, enableRowDrag, isRowDraggable, onRowMove, canDropRow, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, initialState, includeGroupingInState, activeCellFollows, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>, features: GridShellFeatures): import("react").JSX.Element;
3
+ export declare function useGridShell<T extends object>({ rows: rowsProp, dataSource, serverSideRefreshToken, serverSideRefetch, onServerSideLoadError, onServerSideWriteError, columns: columnsProp, onRowsChange, onColumnsChange, rowKeyGetter, isRowExportable, createRow, createOverflowColumn, onPasteSkipped, pasteFillsSelection, copyFormat, copyHeaders, excelShortcuts, newRow, rowHeight: rowHeightProp, autoHeight, estimateRowHeight, verticalAlign, headerHeight: headerHeightProp, density, theme, motion, popupContainer, animateRows, showCopyRange, hoverHighlight, highlightChanges, showSaveStatus, rowDragMotion, columnDragMotion, find, onFindChange, rowHeaderWidth, height, maxHeight, readOnly, dimReadOnlyCells, canEditCell: canEditCellProp, enableUndoRedo, enableClearOnDelete, editorEnterMove, imeDirectInput, undoHistoryLimit, onUndoRedoStateChange, trackChanges, onChangesChange, enableRangeSelection, enableRowSelection, rowSelectionMode, enableSelectAllRows: enableSelectAllRowsProp, rowSelection: rowSelectionProp, selectedRowKeys: selectedRowKeysProp, onRowSelectionChange, enableGlobalFilter, globalFilterMatch, enableColumnFilter, renderFilterDateInput, getFilterOptions, enableSorting, manualFiltering, manualSorting, enableColumnResize, autoSizeColumns, showCellOverflowTooltip, showValidationMarks, enableRowHover, enableColumnHeaderHover, hoveredRowIndex: hoveredRowIndexProp, onHoveredRowChange, onCellClick, onCellDoubleClick, onActiveCellChange, enableColumnMenu, noMatchingRowsText, noRowsText, ariaLabel, showTopBar, showBottomBar, showTopBarSummary, showTopBarFilter, globalFilterPlaceholder, globalFilterIcon, localeText, showTopBarCounts, showBottomBarCounts, showSelectionAggregates, showFilterChipBar, renderTopBar, renderBottomBar, className, style, classNames, getRowClassName, detailRow, onExpandedDetailRowKeysChange, labelRow, totalRow, pinnedTopRows, pinnedBottomRows, pinnedBottomRowsPlacement, columnGroups: columnGroupsProp, columnGroupHeaderHeight: columnGroupHeaderHeightProp, onColumnGroupOpenChange, treeData, onTreeRowOpenChange, fillHandle, enableRowDrag, isRowDraggable, onRowMove, canDropRow, enableContextMenu, getContextMenuItems, onContextMenuOpen, scrollHint, ref, onStateChange, initialState, includeGroupingInState, activeCellFollows, onFiltersChange, onSortChange, onScroll, }: SpreadsheetGridProps<T>, features: GridShellFeatures): import("react").JSX.Element;
package/dist/common.d.ts CHANGED
@@ -2,6 +2,6 @@ export { numberFormatter } from '@ishibashi0112/spreadsheet-grid-core/internal/l
2
2
  export { numberParser } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueParsers';
3
3
  export { restoreColumnsFromState } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridState';
4
4
  export { preloadGridPopups } from './view/lazyPopups.js';
5
- export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridSelectLoadOptionsParams, GridSelectFillRowContext, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridChanges, GridChangedRow, GridChangesSummary, GridChangesSavedTarget, GridAddedRow, GridRemovedRow, GridTrackChangesOptions, GridTreeDataOptions, GridTreeRow, CellTreeContext, CellTreeState, TreeRowOpenChangeParams, GridRevealRowOptions, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, GridColumnGroup, GridColumnGroupCollapsible, ColumnGroupHeaderRenderContext, ColumnGroupOpenChangeParams, GridExportColumnGroup, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, RowDropParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GridLocaleText, GridLocaleTextTemplate, GridVerticalAlign, GridTextEditorEnterKey, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridStatePatch, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, GridPopupContainer, GridGlobalFilterMatch, GridPasteSkippedCell, GridPasteSkippedParams, GridExcelShortcutsOptions, GridNewRowOptions, GridApplyRowsOptions, GridPinnedRowPosition, FindOptions, FindChangeParams, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
5
+ export type { SpreadsheetGridProps, GridColumn, GridColumnPinned, GridColumnEditor, EditorCommitDirection, EditorEnterMove, CellEditorContext, GridSelectEditorOption, GridSelectLoadOptionsParams, GridSelectFillRowContext, GridValidationMode, CellValidationContext, CellValidationResult, GridInvalidCell, EditorCommitResult, GridChanges, GridChangedRow, GridChangesSummary, GridChangesSavedTarget, GridAddedRow, GridRemovedRow, GridTrackChangesOptions, GridTreeDataOptions, GridTreeRow, CellTreeContext, CellTreeState, TreeRowOpenChangeParams, GridRevealRowOptions, GridRowKey, GridAggFuncName, GridAggFuncParams, GridAggFunc, GridGroupRow, GridSelectFilterOption, GetFilterOptionsParams, GetFilterOptionsResult, ColumnFilterTypeOption, ColumnFilterUiType, CellRenderContext, HeaderRenderContext, GridColumnGroup, GridColumnGroupCollapsible, ColumnGroupHeaderRenderContext, ColumnGroupOpenChangeParams, GridExportColumnGroup, CellStyleContext, CanEditCellContext, GridConditionalFormat, RowStyleContext, DetailRowOptions, GridClassNames, GridSlotProps, GridFrameworkTypes, ReactGridTypes, DetailRowRenderContext, CellDetailContext, LabelRowOptions, LabelRowRenderContext, GridLabelRow, LabelRowSortMode, TotalRowOptions, TotalRowCellContext, TotalRowCellKind, FillHandleOptions, GridFillValueParams, GridFillDirection, GridFillKind, RowDragContext, RowMoveParams, RowDropParams, GridCellRef, GridCellEventParams, GridCellDoubleClickParams, CellValueFormatter, CellValueFormatterParams, SpreadsheetGridSlotContext, SpreadsheetGridDerivedSummary, SpreadsheetGridSelectionStats, GridLocaleText, GridLocaleTextTemplate, GridVerticalAlign, GridTextEditorEnterKey, GlobalFilterStatus, GridSelectionAggregates, CellCoord, CellRange, GridSelection, GridSortState, GridSortEntry, GridSortDirection, ColumnFilterValue, GridFilterState, SetColumnFilterValue, NumberColumnFilterValue, NumberSetColumnFilterValue, ParsedNumberFilter, TextSetColumnFilterValue, ParsedTextFilter, DateSetColumnFilterValue, ParsedDateFilter, DateFilterPreset, DateFilterPresetOption, CustomDateFilterPreset, DateFilterPresetRange, FilterDateInputContext, TextColumnFilterValue, DateColumnFilterValue, SelectColumnFilterValue, CustomColumnFilterValue, ServerSideDataSource, ServerSideQuery, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideLoadErrorParams, ServerSideCellChange, ServerSideRowUpdate, ServerSideUpdateRowsParams, ServerSideUpdateRowsResult, ServerSideWriteErrorParams, RowModel, SpreadsheetGridHandle, RowSelectionModel, RowSelectionMode, ScrollAlign, GridScrollPosition, GridScrollEventParams, CsvExportScope, CsvExportOptions, GridExportOptions, GridExportCell, GridExportData, GridState, GridStatePatch, GridColumnState, GridDensity, GridTheme, UndoRedoState, GridMotion, GridPopupContainer, GridGlobalFilterMatch, GridPasteSkippedCell, GridPasteSkippedParams, GridExcelShortcutsOptions, GridNewRowOptions, GridApplyRowsOptions, GridPinnedRowPosition, FindOptions, FindChangeParams, GridFindOpenOptions, GridFindReplaceResult, GridDataBarFormat, GridColorScaleFormat, GridChipTone, GridChipSpec, GridChipMap, AutoSizeColumnsMode, GridContextMenuTarget, GridContextMenuParams, GridContextMenuItem, GridContextMenuActionItem, GridContextMenuLabelItem, GridContextMenuSeparatorItem, GridContextMenuCustomItem, ScrollHintOptions, ScrollHintTrigger, ScrollHintRenderArgs, } from './model/gridTypes.js';
6
6
  export type { NumberFormatterOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueFormatters';
7
7
  export type { NumberParserOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/valueParsers';
@@ -0,0 +1,2 @@
1
+ import type { GridFeature } from './types.js';
2
+ export declare const findReplaceFeature: GridFeature<"findReplace">;
@@ -0,0 +1,2 @@
1
+ import type { GridFeature } from './types.js';
2
+ export declare const richCopyFeature: GridFeature<"richCopy">;
@@ -1,3 +1,4 @@
1
+ import type { RichCopyParts } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/clipboardHtml';
1
2
  import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode, RefObject } from 'react';
2
3
  import type { GridCoreFeatures } from '@ishibashi0112/spreadsheet-grid-core/internal/engine/features';
3
4
  import type { splitTextByFindRanges } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/find';
@@ -18,6 +19,7 @@ import type { ColumnPane, GridPaneLayout } from '@ishibashi0112/spreadsheet-grid
18
19
  import type { DetailRowExtra, RowMetrics } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry';
19
20
  import type { CellCoord, ColumnFilterValue, GridColumn, GridContextMenuItem, GridContextMenuParams, GridContextMenuTarget, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridLocaleText, GridUiState, GlobalFilterStatus, GridGlobalFilterMatch, GridRowKey, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
20
21
  import type { GridFindBar } from '../view/GridFindBar.js';
22
+ import type { GridFindReplaceSection, GridFindReplaceToggle, GridFindScopeOverlay } from '../view/GridFindReplace.js';
21
23
  import type { GridScrollHint } from '../view/GridScrollHint.js';
22
24
  import type { GridTotalRow } from '../view/GridTotalRow.js';
23
25
  import type { GridPinnedRows } from '../view/GridPinnedRows.js';
@@ -229,6 +231,12 @@ export type ReactGridFeatures = {
229
231
  FindBar: typeof GridFindBar;
230
232
  splitTextByFindRanges: typeof splitTextByFindRanges;
231
233
  } | undefined;
234
+ findReplace?: NonNullable<GridCoreFeatures['findReplace']> & FeatureLocaleDefaults & {
235
+ FindReplaceToggle: typeof GridFindReplaceToggle;
236
+ FindReplaceSection: typeof GridFindReplaceSection;
237
+ FindScopeOverlay: typeof GridFindScopeOverlay;
238
+ } | undefined;
239
+ richCopy?: RichCopyParts | undefined;
232
240
  fillHandle?: (FeatureLocaleDefaults & {
233
241
  useFillHandle: <T>(args: FillHandleFeatureArgs<T>) => FillHandleFeatureResult;
234
242
  }) | undefined;