@ishibashi0112/spreadsheet-grid 1.14.0 → 1.15.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 (49) hide show
  1. package/API_REFERENCE.md +101 -13
  2. package/README.md +12 -12
  3. package/dist/GridShell.d.ts +1 -1
  4. package/dist/common.d.ts +1 -1
  5. package/dist/features/pagination.d.ts +2 -0
  6. package/dist/features/types.d.ts +8 -0
  7. package/dist/hooks/useGridBarContext.d.ts +5 -3
  8. package/dist/hooks/useGridLocaleText.d.ts +1 -1
  9. package/dist/index.cjs +14 -13
  10. package/dist/index.js +4607 -4331
  11. package/dist/lite/createSpreadsheetGrid-DRSQBYBT.cjs +14 -0
  12. package/dist/lite/createSpreadsheetGrid-atbwakIX.js +5597 -0
  13. package/dist/lite/createSpreadsheetGrid.cjs +1 -1
  14. package/dist/lite/createSpreadsheetGrid.js +1 -1
  15. package/dist/lite/features/grouping.cjs +1 -1
  16. package/dist/lite/features/grouping.js +1 -1
  17. package/dist/lite/features/pagination.cjs +1 -0
  18. package/dist/lite/features/pagination.js +2 -0
  19. package/dist/lite/features/rowDrag.cjs +1 -1
  20. package/dist/lite/features/rowDrag.js +1 -1
  21. package/dist/lite/features/scrollHint.cjs +1 -1
  22. package/dist/lite/features/scrollHint.js +1 -1
  23. package/dist/lite/grouping-BKT6i8at.cjs +1 -0
  24. package/dist/lite/{grouping-u4J8Rl0V.js → grouping-CZ86adA8.js} +30 -30
  25. package/dist/lite/pagination-C6zVQode.cjs +1 -0
  26. package/dist/lite/pagination-DJB7JLDr.js +114 -0
  27. package/dist/lite/rowDrag-DMI_HkRV.cjs +1 -0
  28. package/dist/lite/{rowDrag-e6TC1gsM.js → rowDrag-DZ5LiIQN.js} +20 -19
  29. package/dist/lite/scrollHint-Bn6YBjDF.js +210 -0
  30. package/dist/lite/scrollHint-CvLQcvC4.cjs +1 -0
  31. package/dist/lite.cjs +1 -1
  32. package/dist/lite.d.ts +1 -0
  33. package/dist/lite.js +17 -16
  34. package/dist/style.css +1 -1
  35. package/dist/style.layer.css +1 -1
  36. package/dist/view/DefaultGridBottomBar.d.ts +3 -1
  37. package/dist/view/DefaultGridTopBar.d.ts +2 -1
  38. package/dist/view/GridBodyGroupRow.d.ts +2 -1
  39. package/dist/view/GridBodyLayer.d.ts +2 -1
  40. package/dist/view/GridPager.d.ts +13 -0
  41. package/dist/view/GridScrollHint.d.ts +3 -1
  42. package/package.json +2 -2
  43. package/skills/spreadsheet-grid/SKILL.md +5 -3
  44. package/dist/lite/createSpreadsheetGrid-Bn5cneMS.js +0 -5440
  45. package/dist/lite/createSpreadsheetGrid-Di5iNqyu.cjs +0 -13
  46. package/dist/lite/grouping-DKYPOjCk.cjs +0 -1
  47. package/dist/lite/rowDrag-Cn5fud6W.cjs +0 -1
  48. package/dist/lite/scrollHint-Bt8fuU7l.cjs +0 -1
  49. package/dist/lite/scrollHint-Dr4TOFNn.js +0 -196
package/API_REFERENCE.md CHANGED
@@ -91,6 +91,7 @@
91
91
  | `enableColumnHeaderHover` | `boolean` | `true` | 列ヘッダーのホバー時にヘッダーセルを薄くハイライト。 |
92
92
  | `noMatchingRowsText` | `string` | `localeText` の `noMatchingRows`(`'一致する行がありません'`) | フィルター結果 0 行時のオーバーレイ文言。serverSide(`dataSource`)では列 / グローバルフィルターが掛かった状態で 0 件のときにこちら、掛かっていなければ `noRowsText` を出す。 |
93
93
  | `noRowsText` | `string` | `localeText` の `noRows`(`'表示する行がありません'`) | rows が 0 件のときの文言。 |
94
+ | `loading` | `boolean` | `false` | **読み込み中の表示**(1.15.0 から)。利用側が行を読み込んでいる間 `true` にする。行が無ければ本体に骨組みの行を出し(空の表の文は出さない)、行があれば見えている所を薄くして列見出しの下に動く線を出す(`serverSideRefetch="keep"` と同じ見た目)。行がある間は編集・貼り付け・`Delete`・フィルハンドル・置換をしない。表に `aria-busy`、既定の下部バーの件数の所は「読み込み中」。詳細は「読み込み中の表示(`loading`)」節。 |
94
95
  | `ariaLabel` | `string` | — | 表(`role="grid"` の要素。ツリーデータでは `role="treegrid"`)のアクセシブル名。スクリーンリーダーが表を読み上げるときの名前で、1 画面に複数のグリッドを置くときは付けておくと区別できる(「アクセシビリティ」節)。 |
95
96
  | `showTopBar` | `boolean` | `true` | 上部バー(ツールバー)の表示有無。`false` で `renderTopBar` / `enableGlobalFilter` に関わらず一切描画しない(表示のマスタースイッチ。矛盾指定時は `renderTopBar` より優先)。 |
96
97
  | `showTopBarSummary` | `boolean` | `true` | 既定トップバーの summary chips(件数/フィルター/ソート)の表示有無。`renderTopBar` 未指定時のみ有効。これと `showTopBarFilter` がともに非表示なら既定トップバーは描画されない(空バーを出さない)。 |
@@ -109,9 +110,9 @@
109
110
  | `style` | `CSSProperties` | — | ルート要素(`.ssg-root`)のインライン style。`classNames.root` の style とマージされ、こちらが後勝ち。 |
110
111
  | `classNames` | `GridClassNames` | — | パーツ別の追加スロット。各値は `GridSlotProps`(`string \| { className?, style? }`)で、StyleX の `stylex.props(...)` の戻り値をそのまま渡せる。全 25 スロット配線済み(一覧と規則は「パーツ別スロット」節)。レンダー毎に新しいオブジェクトを渡してもよい(内容の署名で memo)。基底 class は未レイヤー・特異度 (0,1,0)のため同特異度のクラスは読み込み順で決まる(確実な上書きは連結セレクタか `style.layer.css`)。Tailwind CSS v4 のユーティリティはレイヤー(`@layer utilities`)の中にあるので、読み込み順に関係なく `style.css`(未レイヤー)に負けて効かない。`style.layer.css` + レイヤー順の宣言(`@layer theme, base, ssg-base, components, utilities;`)にするか、`!` を付ける。 |
111
112
  | `getRowClassName` | `(row: T, rowIndex: number, ctx: RowStyleContext<T>) => GridSlotProps \| undefined` | — | 行ごとの追加 class(または `{ className, style }`)。行コンテナ + 行ヘッダー「#」セル + 各データセルに付与され、Tailwind / StyleX での行ハイライトに使える。`style` はインラインで付与され、座標 / 寸法はグリッドが後勝ち(返した style は内容比較で memo される)。第 3 引数 `ctx` は `{ row, rowIndex, sourceRowIndex, rowKey, isSelected, pinned? }`(「補助型」節参照)。固定行(`pinnedTopRows` / `pinnedBottomRows`)にも呼ばれ、そのときは `ctx.pinned` が `'top'` / `'bottom'`(`rowIndex` / `sourceRowIndex` は固定行の中の位置)。既存の 2 引数関数もそのまま動く(後方互換)。グループ行は対象外。class と style は行と各セルの両方に付くので、`opacity` / `filter` のように重なる指定は style で返さず、class を返して `.ssg-body-row.<class>` で行だけに当てる(style の `opacity: 0.5` は 0.25 になる)。 |
112
- | `onStateChange` | `(state: GridState) => void` | — | 永続スライス(手動リサイズ幅 / フィルター / ソート)が**実際に変化したとき**に最新 `GridState` を渡して呼ばれる。保存タイミングの signal(例: localStorage 自動保存)。発火規約は「状態の保存 / 復元」節を参照。 |
113
+ | `onStateChange` | `(state: GridState) => void` | — | 永続スライス(手動リサイズ幅 / フィルター / ソート。ページ送りのページと 1 ページの行の数も = 1.15.0 から)が**実際に変化したとき**に最新 `GridState` を渡して呼ばれる。保存タイミングの signal(例: localStorage 自動保存)。発火規約は「状態の保存 / 復元」節を参照。 |
113
114
  | `includeGroupingInState` | `boolean` | `false` | 行のグループ化(各列の `rowGroup`)と折りたたんだグループ(`collapsedGroups`)を状態に入れる(1.2.0 から)。`getState()` / `onStateChange` の値に入り(グループの開閉でも `onStateChange` が呼ばれる)、`applyState` / `initialState` / `restoreColumnsFromState` で戻る。既定は 1.1 までと同じく入れない。詳細は「状態の保存 / 復元」節。 |
114
- | `initialState` | `Omit<GridStatePatch, 'columns'>` | — | 状態(列幅 / フィルター / ソート)の初期値。**最初の 1 回(マウント時)だけ**使い、後から変えても今の状態は変わらない(変えるときは `applyState`)。最初の描画・サーバーの描画(SSR)・serverSide の最初の `getRows` から効き(clientSide で 5 万行を超える表のグローバルフィルター `filters.globalText` だけは、時間を分けて評価するので最初の描画の少し後に効く)、`getState()` もその値を返す。マウント時は `onStateChange` / `onFiltersChange` / `onSortChange` を呼ばない。`getState()` の値をそのまま渡せる(列メタの `columns` は使わない。列の並び / 表示 / 固定は `columns` prop で決める。保存した値から戻すときは `restoreColumnsFromState(columns, saved)` で作った配列を渡す。並び / 表示 / 固定が `columns` prop と見た目で違うときだけ開発時に警告)。今の `columns` に無い列の幅 / フィルター / ソートは捨てる(開発時に警告)。URL のクエリや保存した状態から戻すときに使う。 |
115
+ | `initialState` | `Omit<GridStatePatch, 'columns'>` | — | 状態(列幅 / フィルター / ソート。ページ送りの `page` / `pageSize` も = 1.15.0 から)の初期値。**最初の 1 回(マウント時)だけ**使い、後から変えても今の状態は変わらない(変えるときは `applyState`)。最初の描画・サーバーの描画(SSR)・serverSide の最初の `getRows` から効き(clientSide で 5 万行を超える表のグローバルフィルター `filters.globalText` だけは、時間を分けて評価するので最初の描画の少し後に効く)、`getState()` もその値を返す。マウント時は `onStateChange` / `onFiltersChange` / `onSortChange` を呼ばない。`getState()` の値をそのまま渡せる(列メタの `columns` は使わない。列の並び / 表示 / 固定は `columns` prop で決める。保存した値から戻すときは `restoreColumnsFromState(columns, saved)` で作った配列を渡す。並び / 表示 / 固定が `columns` prop と見た目で違うときだけ開発時に警告)。今の `columns` に無い列の幅 / フィルター / ソートは捨てる(開発時に警告)。URL のクエリや保存した状態から戻すときに使う。 |
115
116
  | `onFiltersChange` | `(filters: GridFilterState) => void` | — | フィルター状態(`globalText` + `columnFilters`)が**実際に変化したとき**だけ、そのスライスの複製を渡して呼ばれる。`onStateChange` は列幅 / 列メタでも呼ばれるため、記述子から WHERE を組み立てるなどフィルターだけを追いたい用途向け。規約は `onStateChange` と同じ(初回非発火 / 同値非発火 / `applyState` でも発火)。 |
116
117
  | `onSortChange` | `(sort: GridSortState) => void` | — | ソート状態が**実際に変化したとき**だけ、その複製を渡して呼ばれる(ORDER BY の組み立てなど)。規約は `onFiltersChange` と同じ。 |
117
118
  | `onScroll` | `(params: GridScrollEventParams) => void` | — | スクロール位置の変化通知(rAF で 1 フレーム 1 回に間引き・縦横どちらの変化でも発火)。`params` は `{ top, left, source, atBottom }`(px。`atBottom` は縦のスクロールが末尾にあるか = ハンドルの `isAtBottom()` と同じ判定。1.2.0 から)。`source: 'api'` は `setScrollPosition` / `scrollTo*` 系由来(と、スクロールの位置を縮めて写す大きな表で、行の増減のときに見ている行を保つための合わせ直し)、`'user'` はそれ以外(ホイール / ドラッグ / キーボードのほか、絞り込みや行の高さの測り直しで表が縮み、ブラウザが位置を詰めた分も `'user'` で届く)。2 グリッドの双方向スクロール同期は `source === 'user'` のときだけ相手へ反映することでループを止められる。インライン関数可(latest-ref 経由)。 |
@@ -131,6 +132,8 @@
131
132
  | `onColumnGroupOpenChange` | `(params: ColumnGroupOpenChangeParams) => void` | — | 列のグループ(`collapsible`)を開閉したときの通知(1.6.0 から)。開閉のボタン・`setColumnGroupOpen`・`applyState` のどれでも、開閉が変わったグループごとに 1 回呼ぶ(最初の描画では呼ばない)。`params = { groupKey, open, closedGroups }`(`closedGroups` は閉じている開閉できるグループのキーの一覧)。 |
132
133
  | `treeData` | `GridTreeDataOptions<T>` | —(無効) | **ツリーデータ(親子のある行)**。平らな `rows` を、`getParentKey(row)` が返す親の行のキーで木にし、`column` の列のセルを深さぶん字下げして開閉の印を出す(1.9.0 から)。`rowKeyGetter` が要り、clientSide だけ。`{ getParentKey, column, defaultOpenDepth? }`(`defaultOpenDepth` は最初に開く深さ。既定 `'all'`)。並べ替えはきょうだいの中で、絞り込みは当たった行とその下の行・そこまでの親を出す。`aggFunc` を書いた列は、子を持つ行のセルに下にある末端の行の集計を出す(読み取り専用)。`rowGroup` / `labelRow` / `enableRowDrag` とは一緒に使えない(ツリーデータが勝ち、開発時に警告)。詳細は「ツリーデータ」節。 |
133
134
  | `onTreeRowOpenChange` | `(params: TreeRowOpenChangeParams) => void` | — | ツリーデータ(`treeData`)の行を開閉したときの通知(1.9.0 から)。`params = { rowKey, open }`。開閉の印・キー(`Alt+Shift+↓` / `Alt+Shift+↑`)・`setTreeRowOpen`・`revealRow`・検索の移動で開いた行ごとに 1 回呼ぶ。`expandAllTreeRows` / `collapseAllTreeRows` / `applyState` では呼ばない(今の開閉は `getState().closedTreeRows`)。 |
135
+ | `pagination` | `boolean \| GridPaginationOptions` | —(無効) | **ページ送り**(1.15.0 から)。見た目の行を `pageSize` ごとに区切って 1 ページずつ見せ、既定の下部バーの右にページ送り(行の範囲・ページの番号・「表示件数」)を出す。`true` は既定(1 ページ 50 行・表示件数 `[20, 50, 100]`)。`GridPaginationOptions` = `{ pageSize?, pageSizeOptions?, autoPageSize? }`。ハンドルの行の番号は全ページの通し番号。詳細は「ページ送り(`pagination`)」節。 |
136
+ | `onPageChange` | `(info: GridPageInfo) => void` | — | ページか 1 ページの行の数が変わったときに呼ばれる(1.15.0 から)。`GridPageInfo` = `{ page, pageCount, pageSize, rowCount, firstRow }`(`page` は 0 始まり)。最初の描画では呼ばない。ページ送りのボタン・「表示件数」・ハンドル・絞り込みや並べ替えで 1 ページ目へ戻ったとき・行が減ってページを寄せたときに呼ぶ。 |
134
137
  | `fillHandle` | `boolean \| FillHandleOptions<T>` | —(無効) | **フィルハンドル**。選択範囲(無ければアクティブセル)の右下に小さな四角を出し、引いた先のセルを**連続データ**(1, 2, 3 … / 日付 / 曜日・月の名前 / `P-001` のような末尾の数)か**セルのコピー**で埋める(Excel のオートフィル)。ドラッグ中は埋める範囲を点線で、いちばん遠いセルへ入る値をポインタの近くに出し、`Ctrl`(Mac は `⌘`)で埋め方を入れ替え、`Escape` でやめる。離したあとは右下のボタンで「連続データ / セルのコピー」を選び直せる(元に戻す 1 回で埋める前へ)。ハンドルのダブルクリックで隣の列に値が続くところまで下へ埋める。書き込みは貼り付けと同じ規則(編集できないセル・`validate` の reject は飛ばす / undo の対象)。`readOnly` や書き込み先が無い(`onRowsChange` も `dataSource.updateRows` も無い)ときは出さない。`true` で既定、オブジェクトで `{ getFillValue? }`。詳細は「フィルハンドル」節。 |
135
138
  | `enableRowDrag` | `boolean` | `false` | **行ドラッグ並び替え**。先頭にドラッグハンドル列(幅 28px・タイトル無しの合成列。左固定列があれば左固定側)を挿入し、ハンドル(⋮⋮)を掴んで行を上下へ動かせる。確定時は `onRowsChange` へ移動後の**新配列**を渡し(履歴ラッパ経由 = undo/redo 対象)、続けて `onRowMove` を呼ぶ。clientSide(`rows` + `onRowsChange`)専用で、`dataSource`(serverSide)/ 行グルーピング中 / `onRowsChange` 未指定ではハンドル列を出さない。ソート / フィルター適用中はハンドルを淡色 + 理由ツールチップにして操作を無効化する(列は残る)。詳細は「行ドラッグ並び替え」節と[ガイド](https://datasheet-grid.vercel.app/docs/guides/row-drag)。 |
136
139
  | `isRowDraggable` | `(row: T, ctx: RowDragContext) => boolean` | 全行可 | 行ごとのドラッグ可否。`false` の行にはハンドルを描画しない。`ctx = { rowKey, sourceRowIndex }`。 |
@@ -156,12 +159,14 @@
156
159
  | ボトムの行 / 列の件数だけ消す | `showBottomBarCounts={false}` |
157
160
  | 選択範囲の集計(平均 / データの個数 / 合計)を消す | `showSelectionAggregates={false}` |
158
161
  | 適用中の列フィルターをチップで常時表示 | `showFilterChipBar`(既定 OFF) |
162
+ | ページ送りを自前の下部バーに描く | `renderBottomBar` の `ctx.pagination`(「ページ送り(`pagination`)」節) |
159
163
  | フィルター機能ごと無効 + summary は残す | `enableGlobalFilter={false}` |
160
164
  | 完全に自前のバー | `renderTopBar={(ctx) => …}` |
161
165
 
162
166
  `showTopBarSummary` と `showTopBarFilter`(実効は `showTopBarFilter && enableGlobalFilter`)がともに `false` の場合、既定トップバーは描画されない(空バーを出さない)。
163
167
 
164
168
  ボトムバーは行 / 列の件数を `showBottomBarCounts`、選択範囲の集計を `showSelectionAggregates` で出し分けできる(右側のセル / 範囲 / 選択の大きさ / 列数は対象外)。それ以外の内訳を変えたい場合は `renderBottomBar` を使う。
169
+ ページ送り(`pagination`)があるときは、既定ボトムバーの右にページ送りを出す(1.15.0 から)。`showBottomBar={false}` の表は表の下の帯に出し、`renderBottomBar` の表は出さずに `ctx.pagination` を渡す(自前で描く)。
165
170
 
166
171
  ### 文言(`localeText`)と英語
167
172
 
@@ -199,6 +204,7 @@ import { localeTextEn } from '@ishibashi0112/spreadsheet-grid/locales/en';
199
204
  | キー | 既定(日本語) | 英語(`localeTextEn`) | 説明 |
200
205
  | --- | --- | --- | --- |
201
206
  | `rowCount` | `行 {shown} / {total}` | `Rows {shown} of {total}` | 行の件数。`{shown}` = 表示中の行数、`{total}` = 全部の行数(ラベル行は数えない)。 |
207
+ | `loadingRows` | `読み込み中` | `Loading…` | 読み込み中(`loading`)の既定の下部バーの件数の所の文字(1.15.0 から)。 |
202
208
  | `columnCount` | `列 {shown} / {total}` | `Columns {shown} of {total}` | 列の件数。`{shown}` = 表示中の列数、`{total}` = 全部の列数。 |
203
209
  | `filterSummary` | `絞り込み: {value}` | `Filter: {value}` | 絞り込みの要約。`{value}` は `none` / `filterGlobal` / `filterColumns`(両方なら ` + ` でつなぐ)。 |
204
210
  | `filterGlobal` | `「{text}」` | `"{text}"` | 検索欄の文字(`{text}`。長いと 16 文字で切る)。 |
@@ -224,6 +230,14 @@ import { localeTextEn } from '@ishibashi0112/spreadsheet-grid/locales/en';
224
230
  | `globalFilterLabel` | `表全体を検索` | `Search the whole table` | 上部バーの検索欄の読み上げの名前(placeholder を空にしたとき)。 |
225
231
  | `clearGlobalFilter` | `フィルターをクリア` | `Clear filter` | 上部バーの検索欄の × の読み上げの名前。 |
226
232
  | `toggleFilterPanel` | `フィルター管理パネルを開閉` | `Show or hide the filter panel` | 上部バーの絞り込みの要約(押せるとき)のツールチップと、読み上げの名前の後半(前半は見えている要約。1.0.2 から。1.0.1 まではこの文だけが名前)。 |
233
+ | `paginationLabel` | `ページ` | `Pagination` | ページ送り(`pagination`)の読み上げの名前(`<nav aria-label>`。1.15.0 から)。 |
234
+ | `pageRange` | `{from}–{to} / {total} 行` | `{from}–{to} of {total}` | ページ送りの今のページの行の範囲(ページを替えたときの読み上げにも使う)。`{from}` / `{to}` は 1 から数えた行、`{total}` は全ページの行の数。 |
235
+ | `pageRangeEmpty` | `0 行` | `0 rows` | 同上で行が 0 のとき。 |
236
+ | `previousPage` | `前のページ` | `Previous page` | ページ送りの ‹ のボタンの名前とツールチップ。 |
237
+ | `nextPage` | `次のページ` | `Next page` | ページ送りの › のボタンの名前とツールチップ。 |
238
+ | `goToPage` | `ページ {page}` | `Page {page}` | ページの番号のボタンの名前(`{page}` は 1 始まり)。 |
239
+ | `pageOfPages` | `{page} / {pageCount}` | `{page} of {pageCount}` | 狭い表で縮めたページ送りの「3 / 25」。 |
240
+ | `pageSizeLabel` | `表示件数` | `Rows per page` | ページ送りの「表示件数」の選ぶ欄の名前。 |
227
241
 
228
242
  **共通**
229
243
 
@@ -794,6 +808,56 @@ gridRef.current?.goToNextChange();
794
808
  - **見た目**: 枠 `.ssg-range-decoration`(`[data-ssg-range-decoration]` に `id`。塗りは `.ssg-range-decoration--fill`、点線は `.ssg-range-decoration--dashed`)、名札 `.ssg-range-decoration-label`。
795
809
  - **`/lite`**: 機能の部品は `rangeDecorationsFeature`。無い構成では `rangeDecorations` は効かず、開発時に 1 回警告する。
796
810
 
811
+ ### 読み込み中の表示(`loading`)
812
+
813
+ 利用側が行を読み込んでいる間 `loading` を `true` にすると、グリッドが読み込み中の見た目を出す(1.15.0 から)。行を取ってくるのは今までどおりグリッドの外(取れたら `rows` を差し替える)。
814
+
815
+ ```tsx
816
+ const [rows, setRows] = useState<Row[]>([]);
817
+ const [loading, setLoading] = useState(true);
818
+ useEffect(() => {
819
+ fetchRows().then((data) => {
820
+ setRows(data);
821
+ setLoading(false);
822
+ });
823
+ }, []);
824
+
825
+ <SpreadsheetGrid rows={rows} onRowsChange={setRows} columns={columns} loading={loading} />;
826
+ ```
827
+
828
+ - **行が無いとき**(最初の読み込み): 本体の高さぶんの骨組みの行(serverSide の読み込み中の行と同じ見た目)を出し、空の表の文(`noRows`)は出さない。骨組みの行は行として数えず(`aria-hidden`)、押しても何も起きない。既定の上部バーと下部バーの件数の所・ページ送りの行の範囲は「読み込み中」(文言 `loadingRows`)。
829
+ - **行があるとき**(読み込み直し): 今の行を残したまま本体の見えている所を薄くし、列見出しの下に動く線を出す(`serverSideRefetch="keep"` の取り直しと同じ見た目。トークン `--ssg-refetch-row-opacity` / `--ssg-refetch-bar` / `--ssg-refetch-bar-track`、`motion` が `'off'` なら線は動かない)。その間は編集・貼り付け・`Delete`・フィルハンドル・置換をしない(読み取り専用の印は変えない。読み込みが始まったときに開いていたエディタは閉じず、確定すると書く。新しい編集は始めない)。選択・コピー・スクロール・並べ替え・絞り込みはできる。
830
+ - **読み上げ**: 表に `aria-busy="true"`。ルートに `.ssg-root--loading`(どちらのときも)。
831
+ - serverSide(`dataSource`)は読み込み中の行をグリッドが出すので要らない。
832
+ - 本体の機能(`/lite` でも使える)。
833
+
834
+ ### ページ送り(`pagination`)
835
+
836
+ 見た目の行を `pageSize` ごとに区切り、1 ページずつ見せる(1.15.0 から)。既定の下部バーの右に、行の範囲「1–50 / 1234 行」・‹ 1 2 3 … 25 ›・「表示件数」の選ぶ欄が出る。
837
+
838
+ ```tsx
839
+ <SpreadsheetGrid
840
+ rows={rows}
841
+ onRowsChange={setRows}
842
+ columns={columns}
843
+ pagination={{ pageSize: 50, pageSizeOptions: [20, 50, 100] }}
844
+ onPageChange={(info) => console.log(`${info.page + 1} / ${info.pageCount}`)}
845
+ />
846
+ ```
847
+
848
+ - **オプション**(`GridPaginationOptions`。`true` は既定のまま): `pageSize`(1 ページの行の数。既定 `50`。後から変えると「表示件数」もこの値へ戻し、今のページの先頭の行が入るページを見せる)、`pageSizeOptions`(「表示件数」で選べる数。既定 `[20, 50, 100]`。`false` で「表示件数」を出さない。今の 1 ページの行の数が選択肢に無ければ足して小さい順に並べる)、`autoPageSize`(本体の見える高さに収まる行の数を 1 ページにし、表の高さが変わると数え直して、高さが変わり始めたときの先頭の行(アクティブセルがあればその行)が入るページを見せる。本体の高さは描いた後に測るので、サーバーで描く HTML と最初の描画は `pageSize` で区切る。「表示件数」は出さない。`autoHeight` の表では使えず `pageSize` で区切る = 開発時に警告)。
849
+ - **区切り方**: 絞り込み・並べ替え・行グループやツリーの開閉の後の見た目の行を区切る。グループ行・ラベル行・差分の表示の削除の行も 1 行と数える(展開行の帯は数えない)。1 ページの中は今までどおり仮想スクロール。合計行・固定行はどのページにも出し、合計行の集計は全ページの行。入力行(`newRow`)は最後のページにだけ出す(行にしてページがあふれたら、新しい最後のページの入力行へ移る)。
850
+ - **ページが変わるとき**: 絞り込み・並べ替えを変えると 1 ページ目へ戻る(アクティブセルはページの中の同じ位置に残る。グリッドの外の条件で `rows` を絞り込むときはページを替えないので `setPage(0)` を呼ぶ)。行が減って今のページが無くなったら最後のページへ寄せる。ページを替えると、編集中の値は確定し、本体のスクロールは先頭へ戻り、アクティブセルがあれば新しいページの先頭の行の同じ列に置く(選択はその 1 セル)。`onPageChange` と `onStateChange` を呼ぶ(最初の描画では呼ばない。`onPageChange` はページか 1 ページの行の数が変わったときだけで、行の数が変わっただけでは呼ばない)。
851
+ - **キーと選択**: キー操作・範囲の選択・`Ctrl/Cmd+A`・コピー・貼り付け・`Delete`・フィルハンドル・行のドラッグは今のページの中だけ(`Ctrl/Cmd+End` はそのページの末尾)。貼り付けはページの終わりで止まり、はみ出した行は貼らない(表の外と同じ扱いで `onPasteSkipped` には入らない。最後のページでは `createRow` で行を足す)。切り取り(`Ctrl/Cmd+X`)もページの中だけで、ほかのページへ移って貼るとふつうの貼り付けになる。ページを替えるキーは無い。
852
+ - **ページをまたぐもの**: セル内検索(`find`)と置換はすべてのページを探し、当たったセルのページへ替える。元に戻すは直したセルのページへ戻り、やり直すは元に戻したときの位置へ戻る(ページ送りの無い表と同じ)。見出しのチェックボックスの行選択はすべてのページの行。`goToNextChange()` / `goToPrevChange()` もすべてのページを回る。
853
+ - **行の番号**: ハンドル(`scrollToRow` / `selectCell` / `getRowKey` など)・通知・`renderCell` などの `ctx.rowIndex`・`canEditCell`・行番号・`aria-rowindex` は全ページの通し番号(1 ページ 50 行なら 2 ページ目の先頭は `50`)。ほかのページの行を指すとそのページへ替えてから動く(「命令的 API」の「ページ送り」)。
854
+ - **エクスポート**: scope `'view'` は全ページ、`'page'` は今のページの行だけ。
855
+ - **状態**: `getState()` に `page` / `pageSize` が入り、`applyState` / `initialState` で戻せる。行が 0 の間(読み込み前)に渡したページは寄せずに残し(その間の `getState()` の `page` も渡したページ)、行が届いてそのページへ移っても `onPageChange` / `onStateChange` は呼ばない。
856
+ - **下部バー**: 件数のチップ(`rowCount`)は全ページのデータの行の数のまま(ページ送りの行の範囲はグループ行・ラベル行も数えるので、違う数になることがある)。`showBottomBar={false}` の表は表の下の帯にページ送りを出し、`renderBottomBar` の表は出さずに `ctx.pagination`(`GridPaginationContext` = `GridPageInfo` と `pageSizeOptions` / `setPage` / `setPageSize`)を渡す。ページ送りの幅はページを替えても変わらない。下部バーに収まらないときはバーの次の段へ折り返し、バーの幅が 760px 以下ではページの番号のボタンを「3 / 25」に替え、500px 以下では行の範囲を、300px 以下では「表示件数」を隠す。
857
+ - **serverSide(`dataSource`)**: サーバーの件数を区切り、今のページのブロックだけを頼む。
858
+ - **読み上げ**: `<nav>`(名前は `paginationLabel`)、今のページの番号のボタンに `aria-current="page"`、ページを替えると行の範囲を `aria-live` で読み上げる(`renderBottomBar` で描くページ送りは読み上げないので、自分で `aria-live` を置く)。‹ / › で端のページへ移ってボタンが押せなくなったら、今のページの番号のボタンへフォーカスを移す。
859
+ - **見た目**: `.ssg-pager`(既定の下部バーの右は `.ssg-pager--bar`、表の下の帯 `.ssg-pager-band` の中は `.ssg-pager--band`)、ボタン `.ssg-pager-button`。
860
+ - **`/lite`**: 機能の部品は `paginationFeature`(`standardFeatures` には入れない)。無い構成では `pagination` は効かず、開発時に 1 回警告する。
797
861
  ### セル操作の通知(`onCellClick` / `onCellDoubleClick` / `onActiveCellChange`)
798
862
 
799
863
  データセルのクリック / ダブルクリック / アクティブセルの変化を受け取る通知口。3 つとも省略可で、指定しなければ従来どおり(グリッドの既定の動作は変わらない)。
@@ -1174,6 +1238,7 @@ Excel と同じキーで、切り取り・下 / 右へのコピー・一括入
1174
1238
  | `Ctrl/Cmd+Z` / `Ctrl/Cmd+Shift+Z` / `Ctrl/Cmd+Y` | undo / redo(詳細は命令的 API の「undo / redo」節)。 |
1175
1239
 
1176
1240
  端の行 / 列はラベル行を飛ばし、先頭の列は操作用の合成列(行ドラッグのハンドル列・展開トグル列)を飛ばした最初の列(`←` ではこれらの列へも移れる。自動グループ列には止まる)。`Shift` で範囲を広げるときは今の範囲の終わりから動かす(ドラッグや `Shift`+クリックで選んだ範囲もそのまま広がる。キー操作だけで広げた範囲はこれまでどおり)。アクティブセルが無いとき(`Tab` でグリッドに入った直後など)の最初の矢印 / `Tab` / `Enter` / `PageUp` / `PageDown` は、先頭のセル(ラベル行を飛ばした最初の行 × 上の先頭の列)に止まる(編集は始めない。`Shift+Tab` はグリッドの外へ。`Ctrl/Cmd+End` などは無くても端へ)。キーボードでアクティブセルを動かしたときは、グリッドの中に加えて、グリッドを囲むスクロールする親やページも最小限スクロールしてアクティブセルを見せる(グリッドの下側がウィンドウの外にあるときなど。1.0.2 から。マウスで押したときと、フォーカスがグリッドの外にあるときの命令的な API では動かさない)。
1241
+ ページ送り(`pagination`)の表では、キー操作と範囲の選択は今のページの中だけ(`Ctrl/Cmd+End` はそのページの末尾のセル、`Ctrl/Cmd+A` はそのページの行。1.15.0 から)。ページを替えるキーは無い(ページ送りのボタンかハンドルの `setPage`)。
1177
1242
 
1178
1243
  マウス: セルを押すとアクティブセル、そのままドラッグで範囲選択。`Shift` を押しながらセルを押すと、今の範囲の起点(範囲が無ければアクティブセル)から押したセルまでを選ぶ(アクティブセルは起点のまま。`Shift`+矢印と同じ起点。`enableRangeSelection={false}` では押したセルだけ)。行番号も同じで、`Shift` を押しながら行番号を押すと、今の行の範囲の起点(無ければアクティブセルの行)から押した行までを選ぶ(`enableRowSelection` の表ではチェックボックスの行選択の範囲)。列見出しを押すとその列を選ぶが、`Shift` を押しながら列見出しを押すと、範囲を広げるのではなくその列を並べ替えに足す(押すたびに昇順 → 降順 → 外す。ほかの列の並べ替えは残る。`enableSorting={false}` のときは押した列を選ぶ)。
1179
1244
 
@@ -1221,6 +1286,8 @@ WAI-ARIA の grid パターンに沿って、表・行・セルに役割と状
1221
1286
  | 固定行(`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`。 |
1222
1287
  | フィルハンドル(`fillHandle`) | ハンドルは `aria-hidden`(ポインタ操作。キーボードではコピー / 貼り付け)。埋めたあとのボタンは `aria-haspopup="menu"` / `aria-expanded` / `aria-label`(「オートフィル オプション(連続データ)」等)、メニューは `role="menu"`、項目は `role="menuitemradio"` + `aria-checked`。 |
1223
1288
  | 検索バー(`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 から)。 |
1289
+ | ページ送り(`pagination`) | `<nav>`(`aria-label` は `localeText.paginationLabel`、既定 `ページ`)。番号のボタンの名前は「ページ 3」(`goToPage`)で、今のページに `aria-current="page"`。‹ › のボタンは端のページで `disabled`。ページを替えると行の範囲(「51–100 / 1234 行」)を `aria-live` で読み上げる(最初の描画では読まない)。表の `aria-rowcount` と行の `aria-rowindex` は全ページの通し番号(1.15.0 から)。 |
1290
+ | 読み込み中(`loading`) | 表に `aria-busy="true"`。行が無い間の骨組みの行は `aria-hidden`(行として数えない)。既定の下部バーの件数の所は「読み込み中」(1.15.0 から)。 |
1224
1291
 
1225
1292
  - 仮想化で描画していない行・列は DOM に無いため、表全体の中の位置は `aria-rowindex` / `aria-colindex` / `aria-rowcount` / `aria-colcount` で伝える。
1226
1293
  - 制約: 固定列(`pinned`)があると、1 つの行が左 / 中央 / 右のペインごとの `role="row"` に分かれる(どれも同じ `aria-rowindex`。読み上げの順は DOM 順でペインごと)。展開行(`detailRow`)の帯は `aria-rowindex` を持たない(データ行の番号をずらさないため)。表の直後の空の要素(`Tab` で展開行のカードから表の外へ出るための目印)は、カードがあって `Tab` の順番に入っている間だけ `aria-hidden` を外す(1.3.0 から。フォーカスが来たらすぐ表の外の次の要素へ移す)。縦固定で複製したラベル行(`labelRow.sticky`)は `aria-hidden` で、中のボタン等は `tabindex="-1"`(Tab で止まらない。マウスでは押せる。本物のラベル行はそのまま)。
@@ -2508,6 +2575,17 @@ const addRow = () => {
2508
2575
  | `goToPrevChange()` | 同上で前の変更へ動く(端まで行ったら最後へ。1.13.0 から)。 |
2509
2576
  | `revertChanges(rowKeys?)` | 未保存のセルを保存済みの値へ戻す(1.8.0 から)。`trackChanges={{ rows: true }}` のときは足した行を消し、消した行を元の場所へ戻す(1.10.0 から)。省略ですべての行、配列でその行。1 回の変更として履歴に積み(`Ctrl/Cmd+Z` で戻せる)、`onRowsChange` を 1 回呼ぶ。戻すセルが無ければ何もしない。 |
2510
2577
 
2578
+ ### ページ送り
2579
+
2580
+ `pagination` が効いているときだけ動く(1.15.0 から。効いていなければ何もせず、`getPageInfo()` は `null`)。「ページ送り(`pagination`)」節も参照。
2581
+
2582
+ | メソッド | 説明 |
2583
+ | --- | --- |
2584
+ | `setPage(page)` | ページを替える(0 始まり。範囲の外は端へ寄せる)。編集中ならその値を確定してから替え、アクティブセルがあれば新しいページの先頭の行の同じ列に置く。 |
2585
+ | `setPageSize(pageSize)` | 1 ページの行の数を替える(正の整数。小数は切り捨て)。今のページの先頭の行が入るページを見せる。`pageSizeOptions` に無い数も使え、そのときは「表示件数」の選択肢に足して見せる。`autoPageSize` の表では何もしない(数は表の高さで決まる)。 |
2586
+ | `getPageInfo()` | 今のページ `GridPageInfo` = `{ page, pageCount, pageSize, rowCount, firstRow }`(`page` は 0 始まり、`rowCount` は区切る前の行の数 = 入力行は数えない、`firstRow` はこのページの先頭の行の通し番号)。 |
2587
+
2588
+ ほかのメソッドの行の番号(`viewRowIndex`)は、ページ送りがあっても全ページの通し番号(`firstRow` から `firstRow + pageSize - 1` が今のページ)。ほかのページの行を指す `scrollToRow` / `selectCell` / `setActiveCell` / `startEditing` / `revealRow` などはそのページへ替えてから動き、`selectRange` の範囲は起点の行のページの中だけ(はみ出した分は端へ寄せる)。`getSelection()` などが返す番号も通し番号。
2511
2589
  ### serverSide(SSRM)
2512
2590
 
2513
2591
  | メソッド | 説明 |
@@ -2528,10 +2606,11 @@ const addRow = () => {
2528
2606
 
2529
2607
  | scope | 意味 | スクロール位置 |
2530
2608
  | --- | --- | --- |
2531
- | `'view'`(**既定**) | ビュー行全体(フィルター/ソート/列可視・固定順を反映。行グルーピング中は折りたたみに関係なく全 leaf 行) | 非依存 |
2609
+ | `'view'`(**既定**) | ビュー行全体(フィルター/ソート/列可視・固定順を反映。行グルーピング中は折りたたみに関係なく全 leaf 行。ページ送り(`pagination`)の表でも全ページ) | 非依存 |
2532
2610
  | `'raw'` | 全ソース行(`rows` 配列順)。**フィルターもソートも無視**(列は可視列・固定順に従う) | 非依存 |
2533
2611
  | `'rendered'` | 仮想化ウィンドウ(いま**描画中**の行のみ・オーバースキャン込み) | **依存** |
2534
2612
  | `'selection'` | 現在の選択範囲(セル/行/列)。選択なしは空 | — |
2613
+ | `'page'` | ページ送り(`pagination`)の今のページの行だけ(1.15.0 から。ページ送りが無い表では `'view'` と同じ。入力行は出さない) | 非依存 |
2535
2614
 
2536
2615
  表にない値(型を通さずに渡した、1.0.0 で消した `'all'` / `'visible'` など)は `'view'` として扱い、開発ビルドでだけ console に警告する。
2537
2616
 
@@ -2681,11 +2760,12 @@ const buffer = await writeXlsx({
2681
2760
 
2682
2761
  マウントの時点で戻す状態が分かっているときは、`applyState` の代わりに prop の `initialState` に渡す(最初の描画・サーバーの描画・serverSide の最初の `getRows` から効く。`columns` は使わない)。列の並び / 表示 / 固定(`columns`)も戻すときは、`restoreColumnsFromState(columns, saved)` で保存した列メタを列定義へ当てた配列を作り、`columns` prop に渡す(下の例。`applyState` と同じ規則で、保存に無い列は末尾、今の列に無い保存の列は捨てる。幅は `initialState` の `columnWidths` で戻すので列定義へは焼き込まない。保存した `columns` が無い / 読めないときは渡した配列をそのまま返す。readonly の配列も渡せる)。今の列に無い列の幅 / フィルター / ソートは捨てるが、マウント時は `onStateChange` を呼ばないので保存した値には残り、開くたびに開発時の警告が出る。消すときは、マウントの後に `getState()` の値で保存し直す。
2683
2762
 
2684
- `GridState`: `{ version, columnWidths, filters, sort, columns?, collapsedGroups?, closedColumnGroups?, closedTreeRows? }`(`closedTreeRows` はツリーデータ(`treeData`)のとき閉じている親の行のキー。1.9.0 から)。`applyState` の引数の `GridStatePatch` は、その各フィールドを省略できる形(`filters` は `{ globalText?, columnFilters? }`)で、`getState()` の値はそのまま渡せる(全部のフィールドがあるので全部置き換わる)。`version` はマイグレーション用(現行 `2`)。`columns` は **列メタ(可視 / 順序 / ピン)のスナップショット**(`GridColumnState[]` = `{ key, visible?, pinned?, rowGroup? }`。`rowGroup` は `includeGroupingInState` のときだけ。配列順 = 列順)で、`getState()` は常に出力し、`applyState()` は **`onColumnsChange` が指定されているときだけ** `columns` prop へ反映する(並び / 表示 / 固定 / グループ化が今と同じなら `onColumnsChange` は呼ばない(1.3.0 から)。列順 / ピン / 可視も復元される点に注意。v1 形式 = `columns` 無しの保存値は列メタを触らない後方互換)。復元した `columns` 配列は固定列ごと(左固定 → 中央 → 右固定)の順に並べ直される(画面上の列順は同じ。列のドラッグ並べ替えと同じ規則で、2 回目以降の `applyState` では順序は変わらない)。`flex` / 列定義そのものは含めない。`activeCell` / `selection` などの一時 UI も含めない。`columnWidths` は**手動リサイズ / autoSize / `applyState` で幅が決まった列だけ**を持つ(それ以外の列は `width` / `flex` で描画され、エントリを持たない)。`columns` を同じ内容の別参照で渡し直しても消えず、列が削除されたとき・その列の `flex` / `pinned` 指定が変わったとき・`width` がエントリと異なる値に指定し直されたとき・列のリセット時にだけ捨てられる。そのため `applyState(getState())` は冪等で、保存値に既定幅が焼き込まれることもない(後からコードで `width` を変えれば、手動リサイズしていない列には反映される)。`custom` フィルターの `value`(`unknown`)は深いコピーをしないため、シリアライズ可能性は consumer 責務。`applyState` は壊れた / 部分的な入力にも耐える(非数値の幅・`kind` 無し / 未知 `kind` / 配列であるべき `values` が欠けた列フィルター・不正な `direction` は捨てる。`columns` に同じ `key` が重なっていたら最初の 1 つだけ使う)。
2763
+ `GridState`: `{ version, columnWidths, filters, sort, columns?, collapsedGroups?, closedColumnGroups?, closedTreeRows?, page?, pageSize? }`(`closedTreeRows` はツリーデータ(`treeData`)のとき閉じている親の行のキー。1.9.0 から)。`applyState` の引数の `GridStatePatch` は、その各フィールドを省略できる形(`filters` は `{ globalText?, columnFilters? }`)で、`getState()` の値はそのまま渡せる(全部のフィールドがあるので全部置き換わる)。`version` はマイグレーション用(現行 `2`)。`columns` は **列メタ(可視 / 順序 / ピン)のスナップショット**(`GridColumnState[]` = `{ key, visible?, pinned?, rowGroup? }`。`rowGroup` は `includeGroupingInState` のときだけ。配列順 = 列順)で、`getState()` は常に出力し、`applyState()` は **`onColumnsChange` が指定されているときだけ** `columns` prop へ反映する(並び / 表示 / 固定 / グループ化が今と同じなら `onColumnsChange` は呼ばない(1.3.0 から)。列順 / ピン / 可視も復元される点に注意。v1 形式 = `columns` 無しの保存値は列メタを触らない後方互換)。復元した `columns` 配列は固定列ごと(左固定 → 中央 → 右固定)の順に並べ直される(画面上の列順は同じ。列のドラッグ並べ替えと同じ規則で、2 回目以降の `applyState` では順序は変わらない)。`flex` / 列定義そのものは含めない。`activeCell` / `selection` などの一時 UI も含めない。`columnWidths` は**手動リサイズ / autoSize / `applyState` で幅が決まった列だけ**を持つ(それ以外の列は `width` / `flex` で描画され、エントリを持たない)。`columns` を同じ内容の別参照で渡し直しても消えず、列が削除されたとき・その列の `flex` / `pinned` 指定が変わったとき・`width` がエントリと異なる値に指定し直されたとき・列のリセット時にだけ捨てられる。そのため `applyState(getState())` は冪等で、保存値に既定幅が焼き込まれることもない(後からコードで `width` を変えれば、手動リサイズしていない列には反映される)。`custom` フィルターの `value`(`unknown`)は深いコピーをしないため、シリアライズ可能性は consumer 責務。`applyState` は壊れた / 部分的な入力にも耐える(非数値の幅・`kind` 無し / 未知 `kind` / 配列であるべき `values` が欠けた列フィルター・不正な `direction` は捨てる。`columns` に同じ `key` が重なっていたら最初の 1 つだけ使う)。
2685
2764
 
2686
2765
  行のグループ化(列の `rowGroup`)とグループの開閉は、既定では `GridState` に入らない。prop の `includeGroupingInState` を付けると入る(1.2.0 から): `columns` の各列のうち `rowGroup` を書いた列に `rowGroup`(`true` / `false`)が、`collapsedGroups` に折りたたんだグループのキー(`GridGroupRow.groupKey`)の配列が入り、グループの開閉でも `onStateChange` が呼ばれる。戻すときは、`restoreColumnsFromState(columns, saved)` が保存にある列の `rowGroup` を列定義へ当て(グループ化の階層は列の順なので並びも戻る。グループ元の列どうしの順は、固定のペインごとの並べ直しでも変えない)、`initialState` / `applyState` が `collapsedGroups` を戻す(`collapsedGroups` は渡したときだけ変える。今の行に無いキーは画面には効かないが `collapsedGroups` には残る = 絞り込みを外すと閉じたまま戻る。グループが入れ替わり続ける表では、保存する前に `getGroupRows()` にあるキーだけへ絞る)。`applyState` で `columns` を戻すときも `rowGroup` が戻る(`onColumnsChange` があるとき)。グループのキーは列のキーと値から作る文字列で、行を取り直しても変わらない(中の形は決まっていないので、自分で組み立てずに `getGroupRows()` / 保存した値から使う)。
2687
2766
 
2688
2767
  列のグループ(`columnGroups`)に開閉できるグループ(`collapsible`)があるときは、`closedColumnGroups` に閉じているグループのキーの配列が入り、開閉でも `onStateChange` が呼ばれる(1.6.0 から。開閉できるグループが無いときは入らない)。`initialState` / `applyState` で戻せる(渡したときだけ変える。今の定義に無いキーは無視)。
2768
+ ページ送り(`pagination`)が効いているときは、`page`(今のページ。0 始まり)と `pageSize`(1 ページの行の数)が入り、ページを替えても `onStateChange` が呼ばれる(1.15.0 から)。`initialState` / `applyState` で戻せる(絞り込み・並べ替えと一緒に渡しても、渡したページが残る。範囲の外のページは端へ寄せる。`pageSize` だけを渡すと、今のページの先頭の行が入るページを見せる。`autoPageSize` の表では `pageSize` を使わない)。
2689
2769
 
2690
2770
  ```tsx
2691
2771
  <SpreadsheetGrid
@@ -2935,17 +3015,18 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2935
3015
  | `newRow` | `newRowFeature` | 入力行(`newRow`、ハンドルの `focusNewRow` / `commitNewRow`) | +1.9KB |
2936
3016
  | `excelShortcuts` | `excelShortcutsFeature` | Excel のキー(`excelShortcuts` の `Ctrl+D` / `Ctrl+R` / エディタの `Ctrl+Enter` / `Ctrl+;` / `Shift+Space` / `Ctrl+Space`。`Ctrl+X` の切り取りは本体にある) | +2.1KB |
2937
3017
  | `treeData` | `treeDataFeature` | ツリーデータ(`treeData` / `onTreeRowOpenChange`、ハンドルの `setTreeRowOpen` / `expandAllTreeRows` / `collapseAllTreeRows`。`revealRow` は本体にあり、ツリーデータでない表でもスクロールする) | +6.7KB |
3018
+ | `pagination` | `paginationFeature` | ページ送り(`pagination` / `onPageChange`、ハンドルの `setPage` / `setPageSize` / `getPageInfo`。`loading` は本体にある) | +3.4KB |
2938
3019
  | `conditionalFormat` | `conditionalFormatFeature` | 条件付き書式とチップ(`columns[].conditionalFormat`) | +1.4KB |
2939
3020
  | `autoHeight` | `autoHeightFeature` | 行の高さの実測(`autoHeight` / `columns[].autoHeight`) | +1.2KB |
2940
3021
 
2941
- サイズ(初期読み込みの JS の gzip。esbuild で minify・React は外部化・`@tanstack/virtual-core` 込み。2026-12-02 の dist で計測):
3022
+ サイズ(初期読み込みの JS の gzip。esbuild で minify・React は外部化・`@tanstack/virtual-core` 込み。2026-12-06 の dist で計測):
2942
3023
 
2943
3024
  | 構成 | 初期 JS(gzip) |
2944
3025
  | --- | --- |
2945
- | 全部入り(`SpreadsheetGrid`) | 約 226KB |
2946
- | `/lite` 機能なし | 約 113KB |
2947
- | `/lite` + `standardFeatures` | 約 138KB |
2948
- | `/lite` + `standardFeatures` + `serverSideFeature` | 約 143KB |
3026
+ | 全部入り(`SpreadsheetGrid`) | 約 236KB |
3027
+ | `/lite` 機能なし | 約 119KB |
3028
+ | `/lite` + `standardFeatures` | 約 145KB |
3029
+ | `/lite` + `standardFeatures` + `serverSideFeature` | 約 150KB |
2949
3030
 
2950
3031
  - 各機能の目安は「機能なし」に 1 つだけ足したときの増え方で、組み合わせると共通部分のぶん合計より少し小さくなる。バンドラーによって数 KB 前後する(0.61.0 の全部入りの実測で、Vite 8(Rolldown)は esbuild より約 1.5KB 小さく、Vite 7(Rollup)はほぼ同じ。Next.js 16 では webpack が Turbopack より約 4KB 大きい)。
2951
3032
  - 使わない機能がバンドルから落ちることは、Vite 8・webpack 5・Next.js 16(既定の Turbopack)・esbuild で確かめている(バンドラーが `package.json` の `sideEffects` と `/* @__PURE__ */` を解釈する必要がある)。
@@ -3484,6 +3565,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3484
3565
  | `.ssg-root` | グリッドのルート要素(`className` prop の付与先)。 |
3485
3566
  | `.ssg-root--fill-height` | `height` に `%` を含む値を渡したときのルート(flex column)。 |
3486
3567
  | `.ssg-root--refetching` | `serverSideRefetch="keep"` で、取り直しの間に前の行を見せているときのルート(このとき本体の見えている所を `--ssg-refetch-row-opacity` の濃さに薄く見せる)。 |
3568
+ | `.ssg-root--loading` | 読み込み中(`loading`)のルート(行が無い間の骨組みのときも、行があって薄く見せるときも。1.15.0 から)。 |
3487
3569
  | `.ssg-root--filling` | フィルハンドル(`fillHandle`)のドラッグ中のルート(カーソルを十字に固定)。 |
3488
3570
  | `.ssg-theme-dark` | `theme="dark"`(または `'auto'` のダーク解決)時に root と各ポータル(popover / menu / panel / ツールチップ)へ。 |
3489
3571
  | `.ssg-theme-class` | `theme="class"` のとき root と各ポータル(popover / menu / panel / ツールチップ / ドラッグのゴースト)と `GridAskBar` へ。祖先に `.dark` か `[data-theme="dark"]` があるとダークのプリセットになる(`:where` で定義)。 |
@@ -3494,7 +3576,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3494
3576
  | `.ssg-filter-chip-bar` | フィルターチップバー。 |
3495
3577
  | `.ssg-empty-state` | 0 行時の空状態。 |
3496
3578
  | `.ssg-ssrm-error-bar` | SSRM の読み込みエラーバー。 |
3497
- | `.ssg-refetch-bar` | `serverSideRefetch="keep"` で前の行を見せている間、列見出しの下に出る動く線(色は `--ssg-refetch-bar` / `--ssg-refetch-bar-track`)。 |
3579
+ | `.ssg-refetch-bar` | `serverSideRefetch="keep"` で前の行を見せている間と、読み込み中(`loading`)で行があるとき、列見出しの下に出る動く線(色は `--ssg-refetch-bar` / `--ssg-refetch-bar-track`)。 |
3498
3580
  | `.ssg-scroll-hint` | スクロール位置インジケーター(`scrollHint`)。 |
3499
3581
  | `.ssg-find-bar` | セル内検索(`find`)の検索バー。 |
3500
3582
  | `.ssg-find-mark` / `.ssg-find-mark--current` | セル内検索のヒット / 今のヒット(`<mark>`)。 |
@@ -3524,6 +3606,9 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3524
3606
  | `.ssg-diff-original` | 差分の表示の `showOriginal` で変更のセルに並べる baseline の値(取り消し線。1.13.0 から)。 |
3525
3607
  | `.ssg-bar-chip--diff` | 既定の下部バーの差分の件数「追加 1 行・削除 2 行・変更 3 セル(2 行)」(1.13.0 から)。 |
3526
3608
  | `.ssg-bar-diff-nav-btn` | 同上の横の、変更を回る ▲ ▼ のボタン(1.13.0 から)。 |
3609
+ | `.ssg-pager` | ページ送り(`pagination`)の部品(`<nav>`)。既定の下部バーの右は `.ssg-pager--bar`、下部バーを出さない表の下の帯(`.ssg-pager-band`)の中は `.ssg-pager--band`(1.15.0 から)。 |
3610
+ | `.ssg-pager-button` | ページ送りのボタン(‹ は `.ssg-pager-button--prev`、› は `.ssg-pager-button--next`、番号は `.ssg-pager-button--page` で今のページは `[aria-current="page"]`)。 |
3611
+ | `.ssg-pager-range` / `.ssg-pager-size` | ページ送りの行の範囲の文字 / 「表示件数」の選ぶ欄(`<label>`。中の `<select>` は `.ssg-pager-size-select`)。 |
3527
3612
  | `.ssg-range-decoration` | 範囲の飾り(`rangeDecorations`)の枠(ペインごと。塗りは `.ssg-range-decoration--fill`、点線は `.ssg-range-decoration--dashed`。1.13.0 から)。 |
3528
3613
  | `.ssg-range-decoration-label` | 範囲の飾りの名札(1.13.0 から)。 |
3529
3614
  | `.ssg-body-cell--cf-bar` | 条件付き書式のデータバーがあるセル(帯は子要素 `.ssg-cf-bar`。負の値は `.ssg-cf-bar--negative`)。 |
@@ -3614,7 +3699,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3614
3699
  | 検索とフィルハンドル | `--ssg-find-mark-bg` / `--ssg-find-mark-current-bg`、`--ssg-fill-line` / `--ssg-fill-handle-ring` |
3615
3700
  | 差分の表示と範囲の飾り | `--ssg-diff-added` / `--ssg-diff-removed` / `--ssg-diff-changed`(差分の表示の追加の行 / 削除の行 / 変更のセルの色。塗りはこの色を薄く混ぜる)、`--ssg-range-decoration` / `--ssg-range-decoration-contrast`(範囲の飾りの既定の色 / 名札の文字。1.13.0 から) |
3616
3701
  | 条件付き書式 | `--ssg-cf-bar` / `--ssg-cf-bar-negative`(データバー)、`--ssg-cf-seq-min` / `--ssg-cf-seq-max` / `--ssg-cf-div-negative` / `--ssg-cf-div-mid` / `--ssg-cf-div-positive`(カラースケール)、`--ssg-cf-neutral` / `--ssg-cf-neutral-bg` / `--ssg-cf-info` / `--ssg-cf-info-bg` / `--ssg-cf-good` / `--ssg-cf-good-bg` / `--ssg-cf-warning` / `--ssg-cf-warning-bg` / `--ssg-cf-critical` / `--ssg-cf-critical-bg`(チップ) |
3617
- | 読み込み中とスクロール位置 | `--ssg-skeleton-bar` / `--ssg-skeleton-bar-hi`(SSRM のスケルトン)、`--ssg-refetch-row-opacity` / `--ssg-refetch-bar` / `--ssg-refetch-bar-track`(`serverSideRefetch="keep"` の前の行の濃さ / 動く線 / 線の下地)、`--ssg-scrollhint-track-bg` / `--ssg-scrollhint-thumb` / `--ssg-scrollhint-thumb-active`(`scrollHint`) |
3702
+ | 読み込み中とスクロール位置 | `--ssg-skeleton-bar` / `--ssg-skeleton-bar-hi`(SSRM のスケルトン)、`--ssg-refetch-row-opacity` / `--ssg-refetch-bar` / `--ssg-refetch-bar-track`(`serverSideRefetch="keep"` と読み込み中(`loading`)の前の行の濃さ / 動く線 / 線の下地)、`--ssg-scrollhint-track-bg` / `--ssg-scrollhint-thumb` / `--ssg-scrollhint-thumb-active`(`scrollHint`) |
3618
3703
  | モーション | `--ssg-motion-fast` / `--ssg-motion-base` / `--ssg-motion-slow` / `--ssg-motion-ease` |
3619
3704
 
3620
3705
  ## 補助型(props で参照される shape)
@@ -3648,9 +3733,12 @@ function Grid(props: SpreadsheetGridProps<Row>) {
3648
3733
  - `GridScrollPosition = { top: number; left: number }`(`getScrollPosition` の返り値 / `setScrollPosition` の基準)
3649
3734
  - `GridScrollEventParams = { top: number; left: number; source: 'user' | 'api'; atBottom?: boolean }`(`onScroll` の引数。`source` の意味は props 表の `onScroll` 行を参照。`atBottom` は末尾にいるか = グリッドはいつも入れる。1.2.0 から)
3650
3735
  - `HeaderRenderContext<T> = { colIndex, width, column, filterValue?, isFiltered? }`
3651
- - `SpreadsheetGridSlotContext<T> = { rows, filteredRows, columns, visibleColumns, globalFilterText, columnFilterValues, sortState, setGlobalFilterText, activeCell, selection, derivedSummary, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges }`
3736
+ - `SpreadsheetGridSlotContext<T> = { rows, filteredRows, columns, visibleColumns, globalFilterText, columnFilterValues, sortState, setGlobalFilterText, activeCell, selection, derivedSummary, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, pagination, loading }`
3652
3737
  - `derivedSummary` は `SpreadsheetGridDerivedSummary`(行/列/フィルター/ソートの summary 文字列・選択統計などを内包)。helper を import せずトップ/ボトムバーで使える。
3653
3738
  - 開発ビルドでの注意: `ctx` や `rows` / `filteredRows` を子コンポーネントの props にそのまま渡す(`<MyBar ctx={ctx} />` / `<MyBar {...ctx} />` / `<MyBar rows={ctx.filteredRows} />`)と、React 19.2 以降の開発ビルドは Performance Track 向けに props の差分を取るため大きな配列を走査し、100 万行規模ではソート 1 回に数十秒かかることがある。子へは使う値だけを渡す(件数なら `ctx.filteredRows.length` や `derivedSummary`)。本番ビルドには影響しない。内蔵のトップ / ボトムバーも必要な値だけを受け取る。
3654
3739
  - `globalFilterStatus: GlobalFilterStatus`(`'idle' | 'filtering' | 'ready'`)/ `globalFilterProgress: number`(0..1)。グローバルテキストフィルタは行数が大きい(しきい値 50,000 行・条件は `rows.length > 50000`)とき、入力を主スレッドを塞がず時間分割で適用する。適用中は `status='filtering'`・`progress` が進捗(0..1)になる。空/無効は `'idle'`、確定は `'ready'`(progress=1)。50,000 行以下は同期適用のため即 `'ready'`(`'filtering'` を経由しない)。**ローディング表示はグリッドが本体に重ねる組み込み overlay(autosize の計測中 overlay と同じ作法)で行うため、トップバーやカスタム UI 側で扱う必要は通常ない。** この 2 値は、入力の無効化や独自インジケータなどカスタム UI を出したい場合の参照用に公開している。serverSide では基本 `'idle'` / `'ready'`(取得中表示は行スケルトンが担当)。
3655
3740
  - `selectionAggregates?: GridSelectionAggregates | null`(グリッドは常に入れる)。2 セル以上を選んでいるときの選択範囲の集計 `{ status: 'computing' | 'ready'; progress; cellCount; count; numericCount; sum; average; min; max; partial }`(`count` = 空でないセル数、`numericCount` = 数値として数えたセル数、数値が無ければ `sum` / `average` / `min` / `max` は `undefined`、`partial` = SSRM で未読み込みの行を飛ばした)。1 セル以下の選択 / `showSelectionAggregates={false}` / 出す先が無い(ボトムバー非表示で、`renderTopBar` も無い)ときは `null`。走査セル数が 50,000 を超える選択は時間分割で計算し、その間は `status: 'computing'`(値は未確定、`progress` は 0..1 を 5% 刻み)。同じ選択のまま値だけ変わったときは、計算し直すあいだも前の結果(`status: 'ready'`)のままで、終われば差し替わる。既定ボトムバーは平均 / データの個数 / 合計を出す(最小 / 最大はこの値でだけ参照できる)。
3656
- - `unsavedChanges?: GridChangesSummary | null`(グリッドは常に入れる。1.8.0 から)。変更の追跡(`trackChanges`)の未保存の行とセルの数 `{ rowCount, cellCount }`(`trackChanges={{ rows: true }}` のときは `addedCount` / `removedCount` も。1.10.0 から)。`trackChanges` が効いていなければ `null`。
3741
+ - `unsavedChanges?: GridChangesSummary | null`(グリッドは常に入れる。1.8.0 から)。変更の追跡(`trackChanges`)の未保存の行とセルの数 `{ rowCount, cellCount }`(`trackChanges={{ rows: true }}` のときは `addedCount` / `removedCount` も。1.10.0 から)。`trackChanges` が効いていなければ `null`。
3742
+ - `pagination?: GridPaginationContext | null`(グリッドは常に入れる。1.15.0 から)。ページ送り(`pagination`)の今のページと操作(`GridPageInfo` と `pageSizeOptions` / `setPage` / `setPageSize`)。ページ送りが効いていなければ `null`。`renderBottomBar` で差し替えた表はグリッドがページ送りを描かないので、これで描く(「ページ送り(`pagination`)」節)。
3743
+ - `loading?: boolean`(グリッドは常に入れる。1.15.0 から)。`loading` prop の値。
3744
+ - `GridPaginationOptions = { pageSize?: number; pageSizeOptions?: readonly number[] | false; autoPageSize?: boolean }`(`pagination` のオブジェクトの形)/ `GridPageInfo = { page, pageCount, pageSize, rowCount, firstRow }`(`onPageChange` の引数・`getPageInfo()` の値)/ `GridPaginationContext = GridPageInfo & { pageSizeOptions, setPage, setPageSize }`(`renderBottomBar` の `ctx.pagination`)。どれも 1.15.0 から、バレルから公開。
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A virtualized spreadsheet / data grid for React 18.3 / 19 (~1M rows, pinned columns, Excel-like editing / selection / clipboard, filters & sorting, client-side and server-side row models). 日本語は下にあります。
4
4
 
5
- **[Docs & live demo](https://datasheet-grid.vercel.app)** · [Playground](https://datasheet-grid.vercel.app/playground) · [Try on StackBlitz](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/basic?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [Changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md) · [Solid version](https://datasheet-grid.vercel.app/docs/solid/installation)
5
+ **[Docs & live demo](https://datasheet-grid.vercel.app/en)** · [Playground](https://datasheet-grid.vercel.app/en/playground) · [Try on StackBlitz](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/basic?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [Changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md) · [Solid version](https://datasheet-grid.vercel.app/en/docs/solid/installation)
6
6
 
7
7
  ## Install
8
8
 
@@ -16,9 +16,9 @@ Peer dependencies: `react` / `react-dom` `^18.3.0 || ^19.0.0`. Supported browser
16
16
  import '@ishibashi0112/spreadsheet-grid/style.css'
17
17
  ```
18
18
 
19
- `style.css` also works as is with Tailwind CSS v4. The cascade-layer variant `style.layer.css` (everything inside `@layer ssg-base`) is only for when you want the grid inside your layer order, and then you must declare that order in your CSS before Tailwind — `@layer theme, base, ssg-base, components, utilities;` — otherwise `ssg-base` becomes the weakest layer and Tailwind's preflight breaks the borders, buttons and popovers ([details](https://datasheet-grid.vercel.app/docs/css)). The declaration must load before `style.layer.css`: import `style.layer.css` from that CSS file (`@import`), or, from JS, after it. The same goes for StyleX with `useLayers`.
19
+ `style.css` also works as is with Tailwind CSS v4. The cascade-layer variant `style.layer.css` (everything inside `@layer ssg-base`) is only for when you want the grid inside your layer order, and then you must declare that order in your CSS before Tailwind — `@layer theme, base, ssg-base, components, utilities;` — otherwise `ssg-base` becomes the weakest layer and Tailwind's preflight breaks the borders, buttons and popovers ([details](https://datasheet-grid.vercel.app/en/docs/css)). The declaration must load before `style.layer.css`: import `style.layer.css` from that CSS file (`@import`), or, from JS, after it. The same goes for StyleX with `useLayers`.
20
20
 
21
- Using Astryx, Mantine, HeroUI v3 or shadcn/ui? Also import its theme after `style.css` (`themes/astryx.css` / `themes/mantine.css` / `themes/heroui.css` / `themes/shadcn.css`) so the grid follows your design system's colors and light / dark ([guide](https://datasheet-grid.vercel.app/docs/guides/design-systems)).
21
+ Using Astryx, Mantine, HeroUI v3 or shadcn/ui? Also import its theme after `style.css` (`themes/astryx.css` / `themes/mantine.css` / `themes/heroui.css` / `themes/shadcn.css`) so the grid follows your design system's colors and light / dark ([guide](https://datasheet-grid.vercel.app/en/docs/guides/design-systems)).
22
22
 
23
23
  ## Quick start
24
24
 
@@ -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 226KB 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 113KB with no features, about 138KB with the `standardFeatures` preset).
55
+ `SpreadsheetGrid` includes every feature (about 236KB 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 119KB with no features, about 145KB with the `standardFeatures` preset).
56
56
 
57
57
  ```tsx
58
58
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid/lite'
@@ -66,7 +66,7 @@ Props, the `ref` handle and types are the same as `SpreadsheetGrid`. Props of fe
66
66
 
67
67
  ## Natural-language filtering: `/ai` (0.57.0+)
68
68
 
69
- `GridAskBar` from the `/ai` entry turns a sentence ("Tokyo items with 10 or fewer in stock, most expensive first") into the grid's filters, sort, global search and column visibility. The grid never calls an AI: your `ask` function forwards the request to your own server, which calls any model with structured output. Row data is never sent, and every answer is validated, shown as chips and undoable. It is a separate entry (about 14.0KB gzip). Server code for Claude, OpenAI, Gemini and the Vercel AI SDK (AI Gateway) is in the [guide](https://datasheet-grid.vercel.app/docs/guides/ai-filter); the API is in `API_REFERENCE.md` (「ことばで絞り込み」).
69
+ `GridAskBar` from the `/ai` entry turns a sentence ("Tokyo items with 10 or fewer in stock, most expensive first") into the grid's filters, sort, global search and column visibility. The grid never calls an AI: your `ask` function forwards the request to your own server, which calls any model with structured output. Row data is never sent, and every answer is validated, shown as chips and undoable. It is a separate entry (about 14.0KB gzip). Server code for Claude, OpenAI, Gemini and the Vercel AI SDK (AI Gateway) is in the [guide](https://datasheet-grid.vercel.app/en/docs/guides/ai-filter); the API is in `API_REFERENCE.md` (「ことばで絞り込み」).
70
70
 
71
71
  ```tsx
72
72
  import { GridAskBar } from '@ishibashi0112/spreadsheet-grid/ai'
@@ -74,7 +74,7 @@ import { GridAskBar } from '@ishibashi0112/spreadsheet-grid/ai'
74
74
  <GridAskBar grid={gridRef} columns={columns} ask={ask} />
75
75
  ```
76
76
 
77
- The same entry has `useGridAgentTools` (1.14.0+; `createGridAgentTools` outside components): tools an AI agent can call to read and change the view, jump to a row and, when you allow it, read rows and write cells (one undo step). Pass `definitions` to your own chat and run calls with `execute(name, input)`, or register them with a browser agent (WebMCP) with `registerGridAgentTools`. See the [guide](https://datasheet-grid.vercel.app/docs/guides/ai-agent) and `API_REFERENCE.md` (「AI エージェントの道具」).
77
+ The same entry has `useGridAgentTools` (1.14.0+; `createGridAgentTools` outside components): tools an AI agent can call to read and change the view, jump to a row and, when you allow it, read rows and write cells (one undo step). Pass `definitions` to your own chat and run calls with `execute(name, input)`, or register them with a browser agent (WebMCP) with `registerGridAgentTools`. See the [guide](https://datasheet-grid.vercel.app/en/docs/guides/ai-agent) and `API_REFERENCE.md` (「AI エージェントの道具」).
78
78
 
79
79
  ## Documentation in this package
80
80
 
@@ -84,7 +84,7 @@ Everything below ships inside the npm package, so it is available offline (for e
84
84
  | --- | --- |
85
85
  | Full API reference — props, column options, imperative handle (`ref`), recipes (Japanese) | `API_REFERENCE.md` in this package |
86
86
  | Per-field docs (shown on hover) | JSDoc in the type definitions. Field docs live in the core package's file `dist/model/gridTypes.core.d.ts` and match the tables in `API_REFERENCE.md` |
87
- | Guides with live demos (Japanese), playground, theme builder | [datasheet-grid.vercel.app](https://datasheet-grid.vercel.app) |
87
+ | Docs in English and Japanese (the guides are being translated into English), guides with live demos, playground, theme builder | [datasheet-grid.vercel.app/en](https://datasheet-grid.vercel.app/en) |
88
88
  | Design notes, changelog | [GitHub README](https://github.com/ishibashi0112/datasheet-grid#readme) / [CHANGELOG.md](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md) |
89
89
 
90
90
  ## Using with AI coding assistants
@@ -93,7 +93,7 @@ This library is new, so AI coding assistants rarely know its API and tend to gue
93
93
 
94
94
  - **Skill.** The package ships an [Agent Skill](https://agentskills.io) at `skills/spreadsheet-grid/SKILL.md` (0.57.0+): a short guide with the rules below and where to look in `API_REFERENCE.md`. Tools that read `SKILL.md` (Claude Code, Cursor, Codex, GitHub Copilot and others) use it once it is in their skills folder. Install it from GitHub with `npx skills add https://github.com/ishibashi0112/datasheet-grid/tree/main/packages/react/skills/spreadsheet-grid`, or copy the folder from `node_modules` (for Claude Code, into `.claude/skills/`).
95
95
  - **One line for `AGENTS.md` / `CLAUDE.md`:** "Before writing grid code, read `node_modules/@ishibashi0112/spreadsheet-grid/API_REFERENCE.md` and use only the props and methods it lists."
96
- - **Docs for LLMs:** [llms.txt](https://datasheet-grid.vercel.app/llms.txt) lists every docs page (add `.md` to a page URL to get its Markdown), and [llms-full.txt](https://datasheet-grid.vercel.app/llms-full.txt) has all pages in one (large) file. Each docs page also has "Copy Markdown" and "Open" (in ChatGPT / Claude / Cursor).
96
+ - **Docs for LLMs:** [llms.txt](https://datasheet-grid.vercel.app/en/llms.txt) lists every docs page (add `.md` to a page URL to get its Markdown), and [llms-full.txt](https://datasheet-grid.vercel.app/en/llms-full.txt) has all pages in one (large) file. Each docs page also has "Copy Markdown" and "Open" (in ChatGPT / Claude / Cursor).
97
97
 
98
98
  ## Rules that are easy to get wrong
99
99
 
@@ -103,13 +103,13 @@ This library is new, so AI coding assistants rarely know its API and tend to gue
103
103
  - **`rows` or `dataSource`.** `rows` is the client-side row model; `dataSource` switches to the server-side row model. They are mutually exclusive.
104
104
  - **Height.** Use the `height` prop, not `style.height` on the root. A value containing `%` (`'100%'`) sizes the **whole grid including its bars** and needs a parent with a definite height; a number sizes the **scroll area only**. Without `height`, the scroll area is capped at `480px` (`maxHeight`).
105
105
  - **Imperative API.** Pass `ref` to get a `SpreadsheetGridHandle<T>` (no `forwardRef` needed on your side; works the same on React 18.3 and 19). If you wrap the grid in your own component and pass `ref` to the wrapper, make the wrapper a `forwardRef` on React 18: the types accept `ref` either way, but React 18 does not pass it as a prop, so the handle stays `null`.
106
- - **Positions are view positions.** `viewRowIndex` / `colIndex` (in `selectCell` and the like) are positions after sorting and filtering, and `colIndex` also counts the columns the grid adds (row drag handle, detail toggle, auto group column). Look them up with `getViewRowIndex(rowKey)` / `getColIndex(columnKey)` instead of `rows.findIndex`.
106
+ - **Positions are view positions.** `viewRowIndex` / `colIndex` (in `selectCell` and the like) are positions after sorting and filtering, and `colIndex` also counts the columns the grid adds (row drag handle, detail toggle, auto group column). Look them up with `getViewRowIndex(rowKey)` / `getColIndex(columnKey)` instead of `rows.findIndex`. With pagination (`pagination`) row positions are still continuous across all pages (not positions within the current page).
107
107
  - **Next.js App Router.** Render the grid from a Client Component (a file with `'use client'`); the package does not add the directive.
108
108
  - **UI language.** The grid's own texts are Japanese by default. For English pass `localeText={localeTextEn}` from `@ishibashi0112/spreadsheet-grid/locales/en` (and `gridAskLocaleTextEn` to `GridAskBar`).
109
109
 
110
110
  ## Versioning
111
111
 
112
- Releases follow semver, and this package, the core and the Solid version (`@ishibashi0112/spreadsheet-grid-solid`, from 1.4.0) always share one version. Since 1.0, breaking changes ship only in major releases and are listed in the [changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md) (before 1.0 they shipped in minor releases, under 「挙動の変化」 / 「core の破壊的変更」). The public surface is the entry points above (`.` / `/lite` / `/ai` / `/locales/en` / `/testing`), the CSS files, `API_REFERENCE.md`, and the CSS tokens, classes and attributes listed there. TypeScript 5.8 or later is supported (`moduleResolution` `bundler` or `nodenext`). Anything to be removed is deprecated in a minor release first, with a one-time console warning in development builds. The core's building blocks (`@ishibashi0112/spreadsheet-grid-core/internal/…`; the old subpaths without `internal/` were removed in 0.61.0) are internal and may change in any release (this package depends on the core of exactly the same version). Details: [Versioning](https://datasheet-grid.vercel.app/docs/versioning) (Japanese).
112
+ Releases follow semver, and this package, the core and the Solid version (`@ishibashi0112/spreadsheet-grid-solid`, from 1.4.0) always share one version. Since 1.0, breaking changes ship only in major releases and are listed in the [changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md) (before 1.0 they shipped in minor releases, under 「挙動の変化」 / 「core の破壊的変更」). The public surface is the entry points above (`.` / `/lite` / `/ai` / `/locales/en` / `/testing`), the CSS files, `API_REFERENCE.md`, and the CSS tokens, classes and attributes listed there. TypeScript 5.8 or later is supported (`moduleResolution` `bundler` or `nodenext`). Anything to be removed is deprecated in a minor release first, with a one-time console warning in development builds. The core's building blocks (`@ishibashi0112/spreadsheet-grid-core/internal/…`; the old subpaths without `internal/` were removed in 0.61.0) are internal and may change in any release (this package depends on the core of exactly the same version). Details: [Versioning](https://datasheet-grid.vercel.app/en/docs/versioning).
113
113
 
114
114
  ## License
115
115
 
@@ -135,7 +135,7 @@ Astryx / Mantine / HeroUI v3 / shadcn/ui の中で使うときは、`style.css`
135
135
 
136
136
  ### バンドルを小さくする: `/lite`(0.54.0 から)
137
137
 
138
- `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 226KB gzip)。`/lite` の入口では、渡した機能だけを入れたグリッドを作れます。渡さなかった機能はバンドルに入りません(機能なしで約 113KB、プリセット `standardFeatures` で約 138KB)。
138
+ `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 236KB gzip)。`/lite` の入口では、渡した機能だけを入れたグリッドを作れます。渡さなかった機能はバンドルに入りません(機能なしで約 119KB、プリセット `standardFeatures` で約 145KB)。
139
139
 
140
140
  ```tsx
141
141
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid/lite'
@@ -184,7 +184,7 @@ npm パッケージに同梱されているため、オフライン(`node_module
184
184
  - **`rows` か `dataSource`。** `rows` はクライアントサイド行モデル、`dataSource` を渡すとサーバーサイド行モデルです。両者は排他です。
185
185
  - **高さ。** ルートの `style.height` ではなく `height` prop で指定します。`%` を含む値(`'100%'`)は**バーを含むグリッド全体**の高さで、親要素に確定高さが必要です。数値は**スクロール領域だけ**の高さです。`height` 未指定時のスクロール領域は `480px`(`maxHeight`)が上限です。
186
186
  - **命令的 API。** `ref` を渡すと `SpreadsheetGridHandle<T>` を受け取れます(利用側で `forwardRef` は不要。React 18.3 / 19 のどちらでも同じ)。グリッドを自分のコンポーネントで包んでその部品へ `ref` を渡すときは、React 18 では包む部品を `forwardRef` にします(型はどちらでも通りますが、React 18 は `ref` を props として渡さないので、ハンドルが `null` のままになります)。
187
- - **位置は表示の位置。** `selectCell` などの `viewRowIndex` / `colIndex` は並べ替え・絞り込みの後の表示の位置で、`colIndex` は行ドラッグのハンドル列・展開トグル列・自動グループ列(ライブラリが足す列)も数えます。`rows.findIndex` ではなく `getViewRowIndex(rowKey)` / `getColIndex(columnKey)` で引いてください。
187
+ - **位置は表示の位置。** `selectCell` などの `viewRowIndex` / `colIndex` は並べ替え・絞り込みの後の表示の位置で、`colIndex` は行ドラッグのハンドル列・展開トグル列・自動グループ列(ライブラリが足す列)も数えます。`rows.findIndex` ではなく `getViewRowIndex(rowKey)` / `getColIndex(columnKey)` で引いてください。ページ送り(`pagination`)の表でも行の位置は全ページの通し番号です(今のページの中の番号ではありません)。
188
188
  - **Next.js App Router。** クライアントコンポーネント(`'use client'` のファイル)から描画してください。パッケージ側はディレクティブを付けていません。
189
189
  - **UI の言語。** グリッドが出す文言の既定は日本語です。英語は `@ishibashi0112/spreadsheet-grid/locales/en` の `localeTextEn` を `localeText` に渡します(`GridAskBar` には `gridAskLocaleTextEn`)。
190
190
 
@@ -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, 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, rangeDecorations, 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, loading, pagination, onPageChange, 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, rangeDecorations, 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, GridRangeDecoration, 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, GridCellValueEdit, GridCellValueSkip, GridCellValueSkipReason, GridCellValueMarked, GridSetCellValuesOptions, GridSetCellValuesResult, GridRowCounts, 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';
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, GridRangeDecoration, 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, GridCellValueEdit, GridCellValueSkip, GridCellValueSkipReason, GridCellValueMarked, GridSetCellValuesOptions, GridSetCellValuesResult, GridRowCounts, GridPaginationOptions, GridPageInfo, GridPaginationContext, 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 paginationFeature: GridFeature<"pagination">;
@@ -16,11 +16,13 @@ import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-cor
16
16
  import type { createRangeDecorationResolver } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/rangeDecorations';
17
17
  import type { describeChangeNavTarget, describeDiffCell, formatDiffOriginalText, formatDiffSummaryParts, nextChangeNavAnnouncement } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/diffView';
18
18
  import type { resolveNewRowPlaceholder } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/newRow';
19
+ import type { resolveAutoPageSize, resolvePaginationOptions } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/pagination';
19
20
  import type { GridUiAction } from '@ishibashi0112/spreadsheet-grid-core/internal/model/gridActions';
20
21
  import type { ColumnPane, GridPaneLayout } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/geometry';
21
22
  import type { DetailRowExtra, RowMetrics } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/verticalGeometry';
22
23
  import type { CellCoord, ColumnFilterValue, GridColumn, GridContextMenuItem, GridContextMenuParams, GridContextMenuTarget, GridResolvedSlots, GridSelection, GridSelectionAggregates, GridLocaleText, GridUiState, GlobalFilterStatus, GridGlobalFilterMatch, GridRowKey, RowModel, SpreadsheetGridProps } from '../model/gridTypes.js';
23
24
  import type { GridFindBar } from '../view/GridFindBar.js';
25
+ import type { GridPager } from '../view/GridPager.js';
24
26
  import type { GridFindReplaceSection, GridFindReplaceToggle, GridFindScopeOverlay } from '../view/GridFindReplace.js';
25
27
  import type { GridScrollHint } from '../view/GridScrollHint.js';
26
28
  import type { GridTotalRow } from '../view/GridTotalRow.js';
@@ -181,6 +183,7 @@ export type RowDragFeatureArgs<T> = Omit<UseRowDragControllerArgs, 'getRowDragLa
181
183
  hasRowKeys: boolean;
182
184
  localeTexts: ResolvedGridLocaleText;
183
185
  blockedByRemovedRows?: boolean | undefined;
186
+ rowOffset?: number | undefined;
184
187
  };
185
188
  export type RowDragFeatureResult<T> = {
186
189
  renderHandleCell: (row: T, rowIndex: number) => ReactNode;
@@ -326,6 +329,11 @@ export type ReactGridFeatures = {
326
329
  newRow?: NonNullable<GridCoreFeatures['newRow']> & FeatureLocaleDefaults & {
327
330
  resolveNewRowPlaceholder: typeof resolveNewRowPlaceholder;
328
331
  } | undefined;
332
+ pagination?: NonNullable<GridCoreFeatures['pagination']> & FeatureLocaleDefaults & {
333
+ resolvePaginationOptions: typeof resolvePaginationOptions;
334
+ resolveAutoPageSize: typeof resolveAutoPageSize;
335
+ Pager: typeof GridPager;
336
+ } | undefined;
329
337
  treeData?: NonNullable<GridCoreFeatures['treeData']> & FeatureLocaleDefaults & {
330
338
  TreeCellPrefix: typeof GridTreeCellPrefix;
331
339
  TreeAggregateValue: typeof GridTreeAggregateValue;
@@ -1,6 +1,6 @@
1
- import type { GlobalFilterStatus, GridChangesSummary, GridColumn, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
1
+ import type { GlobalFilterStatus, GridChangesSummary, GridColumn, GridPaginationContext, GridSelectionAggregates, GridUiState, SpreadsheetGridSlotContext } from '../model/gridTypes.js';
2
2
  import type { ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
3
- type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates' | 'unsavedChanges'>;
3
+ type GridSlotContextBase<T> = Omit<SpreadsheetGridSlotContext<T>, 'setGlobalFilterText' | 'derivedSummary' | 'filteredRows' | 'globalFilterStatus' | 'globalFilterProgress' | 'selectionAggregates' | 'unsavedChanges' | 'pagination' | 'loading'>;
4
4
  type UseGridBarContextArgs<T> = {
5
5
  rows: T[];
6
6
  localeTexts: ResolvedGridLocaleText;
@@ -17,10 +17,12 @@ type UseGridBarContextArgs<T> = {
17
17
  globalFilterProgress: number;
18
18
  selectionAggregates?: GridSelectionAggregates | null;
19
19
  unsavedChanges?: GridChangesSummary | null;
20
+ pagination?: GridPaginationContext | null;
21
+ loading?: boolean;
20
22
  filtersApplied?: boolean;
21
23
  columnTitles?: ReadonlyMap<string, string> | null;
22
24
  };
23
- export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
25
+ export declare const useGridBarContext: <T>({ rows, localeTexts, viewRowCount, totalRowCount, getFilteredRows, columns, visibleColumns, orderedColumns, labelViewIndexes, uiState, setGlobalFilterText, globalFilterStatus, globalFilterProgress, selectionAggregates, unsavedChanges, pagination, loading, filtersApplied, columnTitles, }: UseGridBarContextArgs<T>) => {
24
26
  slotContextBase: GridSlotContextBase<T>;
25
27
  derivedSummary: import("@ishibashi0112/spreadsheet-grid-core").SpreadsheetGridDerivedSummary;
26
28
  slotContext: SpreadsheetGridSlotContext<T>;
@@ -1,5 +1,5 @@
1
1
  import { type FeatureLocaleText, type ResolvedGridLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText';
2
- export declare const GridLocaleTextContext: import("react").Context<Readonly<Pick<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText, "none" | "blank" | "selection" | "globalFilterPlaceholder" | "rowCount" | "columnCount" | "filterSummary" | "filterGlobal" | "filterColumns" | "sortSummary" | "sortEntry" | "sortAscending" | "sortDescending" | "activeCell" | "selectionSize" | "selectedColumns" | "detailColumnName" | "rowDragColumnName" | "listSeparator" | "multiSelectSeparator" | "globalFilterLabel" | "clearGlobalFilter" | "toggleFilterPanel" | "clear" | "close" | "retry" | "noOptions" | "noRows" | "noMatchingRows" | "selectAllRows" | "selectRow" | "sortedAscending" | "sortedDescending" | "sortPriority" | "columnFiltered" | "dragColumn" | "columnMenu" | "columnMenuFor" | "showDetails" | "hideDetails" | "editCell" | "cellInput" | "sizingColumns" | "applyingFilter" | "resetColumnsHint" | "toolPanelFilters" | "toolPanelSort" | "toolPanelColumns" | "filterNone" | "filterCustom" | "filterExcluded" | "filterExcludedValues" | "filterSelected" | "filterMatches" | "filterBoth" | "conditionGreaterThanOrEqual" | "conditionGreaterThan" | "conditionLessThanOrEqual" | "conditionLessThan" | "conditionEquals" | "conditionNotEquals" | "conditionRange" | "conditionOnOrAfter" | "conditionOnOrBefore" | "conditionContains" | "conditionStartsWith" | "conditionEndsWith" | "conditionBlank" | "conditionNotBlank" | "datePresetToday" | "datePresetThisMonth" | "datePresetLast30Days" | "invalidValue" | "enterNumber" | "enterInteger" | "enterMin" | "enterMax" | "enterRange" | "enterDate" | "enterTime" | "enterDateTime" | "saveFailedCell" | "totalRowLabel" | "totalAverage" | "totalMin" | "totalMax" | "totalCount" | "exportSubtotal"> & Partial<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText>>>;
2
+ export declare const GridLocaleTextContext: import("react").Context<Readonly<Pick<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText, "none" | "blank" | "selection" | "globalFilterPlaceholder" | "rowCount" | "columnCount" | "filterSummary" | "filterGlobal" | "filterColumns" | "sortSummary" | "sortEntry" | "sortAscending" | "sortDescending" | "activeCell" | "selectionSize" | "selectedColumns" | "detailColumnName" | "rowDragColumnName" | "listSeparator" | "multiSelectSeparator" | "globalFilterLabel" | "clearGlobalFilter" | "toggleFilterPanel" | "clear" | "close" | "retry" | "noOptions" | "noRows" | "noMatchingRows" | "selectAllRows" | "selectRow" | "sortedAscending" | "sortedDescending" | "sortPriority" | "columnFiltered" | "dragColumn" | "columnMenu" | "columnMenuFor" | "showDetails" | "hideDetails" | "editCell" | "cellInput" | "sizingColumns" | "applyingFilter" | "resetColumnsHint" | "toolPanelFilters" | "toolPanelSort" | "toolPanelColumns" | "filterNone" | "filterCustom" | "filterExcluded" | "filterExcludedValues" | "filterSelected" | "filterMatches" | "filterBoth" | "conditionGreaterThanOrEqual" | "conditionGreaterThan" | "conditionLessThanOrEqual" | "conditionLessThan" | "conditionEquals" | "conditionNotEquals" | "conditionRange" | "conditionOnOrAfter" | "conditionOnOrBefore" | "conditionContains" | "conditionStartsWith" | "conditionEndsWith" | "conditionBlank" | "conditionNotBlank" | "datePresetToday" | "datePresetThisMonth" | "datePresetLast30Days" | "invalidValue" | "enterNumber" | "enterInteger" | "enterMin" | "enterMax" | "enterRange" | "enterDate" | "enterTime" | "enterDateTime" | "saveFailedCell" | "totalRowLabel" | "totalAverage" | "totalMin" | "totalMax" | "totalCount" | "exportSubtotal" | "loadingRows"> & Partial<import("@ishibashi0112/spreadsheet-grid-core").GridLocaleText>>>;
3
3
  export declare const useGridLocaleText: () => ResolvedGridLocaleText;
4
4
  export declare const useFeatureLocaleText: <D>() => FeatureLocaleText<D>;
5
5
  export declare const mergeFeatureLocaleDefaults: (features: object) => ResolvedGridLocaleText;