@ishibashi0112/spreadsheet-grid-solid 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API_REFERENCE.md CHANGED
@@ -18,6 +18,8 @@
18
18
 
19
19
  ## SpreadsheetGrid props (`SpreadsheetGridProps<T>`)
20
20
 
21
+ `T` は行の型(オブジェクト)。グリッドを包む汎用の部品は `function MyGrid<T extends object>(props: SpreadsheetGridProps<T>)` のように `<T extends object>` で書く(グリッドの部品の型引数は `T extends object` で、`SpreadsheetGridProps<T>` には制約が無いため、`<T>` のままでは TS2322 になる。2.0 で `SpreadsheetGridProps<T>` にも同じ制約を付ける候補)。
22
+
21
23
  | Name | Type | Default | Description |
22
24
  | --- | --- | --- | --- |
23
25
  | `rows` | `readonly T[]` | — | clientSide モードの行データ。readonly 配列も受け付ける(グリッドは入力配列を破壊的に変更しない。編集結果は `onRowsChange` が新配列で返す)。`dataSource` を指定した場合は無視され serverSide モードになる(両者は排他)。 |
@@ -25,6 +27,7 @@
25
27
  | `onRowsChange` | `(nextRows: T[]) => void` | — | 行が変化したとき呼ばれる(rows を controlled にする)。 |
26
28
  | `dataSource` | `ServerSideDataSource<T>` | — | serverSide(SSRM)モードのデータ供給口。指定すると可視窓近傍のブロックだけを `getRows` で都度取得し、`rows` 系の clientSide パイプラインをバイパスする。`updateRows`(任意)を持たせるとセル編集の書き戻し(楽観更新つき)が有効になる(「セル編集の書き戻し」節)。 |
27
29
  | `serverSideRefreshToken` | `number` | — | serverSide のソフトリフレッシュ用トークン。値を増やすと、クエリ(フィルター/ソート/グローバル)を変えずにキャッシュを破棄して現在の可視レンジをサーバから取り直す。スクロール位置は保持し、件数は到着ブロックの `totalRowCount` で追従する(clientSide では無視)。命令的に呼びたい場合は同挙動のハンドル `refreshServerSide()` を使う。 |
30
+ | `serverSideRefetch` | `'skeleton' \| 'keep'` | `'skeleton'` | serverSide で条件(ソート / 列フィルター / グローバルフィルター)が変わったときと、取り直し(`refreshServerSide()` / `serverSideRefreshToken`)のときの見せ方(1.5.0 から)。`'skeleton'` は読み込み中の行(1.4 までと同じ)。`'keep'` は新しい行が届くまで前の行を薄くして見せ続け(ルートに `.ssg-root--refetching`)、列見出しの下に動く線(`.ssg-refetch-bar`)を出し、表(`role="grid"`)に `aria-busy="true"` を付ける。見えている範囲の新しい行がそろったら(そのブロックの取得に失敗したら)一度に差し替える(一部だけ新しい行が混ざらない)。前の行を見せている間は編集・貼り付け・削除・フィルハンドルをしない(行の位置が新しい結果と合わないため)。初めての取得と、前の行が無いときは読み込み中の行。保存中の書き込みがあるときは、決着してから取り直す(1.4 までと同じ)。色はトークン `--ssg-refetch-row-opacity` / `--ssg-refetch-bar` / `--ssg-refetch-bar-track`。`motion` が `'off'` なら線は動かない。clientSide では無視。詳細は「取り直しの間の見せ方」節。 |
28
31
  | `onServerSideLoadError` | `(error, params) => void` | — | serverSide の `getRows` が reject したときの通知(abort は正常キャンセルのため通知しない)。`params` は失敗した要求の view 空間レンジ `{ startIndex, endIndex }`。グリッド内蔵のエラーバー(再試行 UI)とは独立に呼ばれる(利用側トースト / ログ用)。インライン関数可(latest-ref 経由で読む)。 |
29
32
  | `onServerSideWriteError` | `(error, params) => void` | — | serverSide の `dataSource.updateRows` が reject したときの通知。グリッド側は楽観更新をロールバック済みで、`params.updates` に失敗して元に戻した行更新(`rowKey` / `changes` / `previousRow`)が入る(利用側トースト / リトライ導線用。`changes` は元に戻したセルだけで、後から同じセルを変えた編集で上書き済みの変更は入らない。`row` は今の表示の行に元に戻した変更を当てた行で、同じ行の新しい編集の値を含む)。グリッド内蔵の保存失敗バーとは独立に呼ばれる。インライン関数可(latest-ref 経由で読む)。詳細は「セル編集の書き戻し」節。 |
30
33
  | `onColumnsChange` | `(nextColumns: GridColumn<T>[]) => void` | — | 列が変化したとき呼ばれる。列メニューの固定切替はこれが指定されている場合のみ反映。列の並べ替え(ヘッダーのドラッグ / 列パネル)と `applyState` で渡る `nextColumns` は、配列順が固定列ごと(左固定 → 中央 → 右固定)に並べ直される(画面上の列順は変わらない。例: 右固定列の後ろに宣言した列があると、右固定列が配列の末尾へ移る)。列メニューの固定切替は配列順を変えず `pinned` だけを更新する。指定が無いと、列メニューの固定 / リセットと、ツールパネルの「列」タブの表示 / 非表示・並べ替え・リセットは押せない(今の状態は見える)。押せない理由のツールチップは利用者向けの文(「この表では列の固定を変えられません」など。1.0.2 から。1.0.1 までは「onColumnsChange 未指定のため…」)。 |
@@ -1649,7 +1652,7 @@ const lastYear: Sale = { id: 'last-year', region: '前年', q1: 980, q2: 1110, q
1649
1652
  - **`renderCell` からの操作(`ctx.detail`)**: `detailRow` 有効時、`CellRenderContext` に `detail: { expanded, expandable, toggle(), setExpanded(bool) }` が入ります(無効時は `undefined`)。`showToggleColumn: false` と組み合わせて、商品名セルの横などにトグルを自前配置できます。
1650
1653
  - **選択 / アクティブセル**: 帯はセルではないため選択・アクティブセルの対象外です。帯を跨ぐ範囲選択のハイライトは帯を避けて分割描画されます。
1651
1654
  - **serverSide(`dataSource`)**: 使えますが、(1) クエリ(フィルター / ソート / グローバル)が変わると展開状態は**すべて閉じ**ます(結果セットが総入れ替えされ、未ロード行のキーを走査できないため)。(2) 未ロード行の帯は表示されません。
1652
- - **上限**: 帯は auto-height 行と同じ可変行高ジオメトリで描画するため、`rows × rowHeight + 展開中の帯の合計` が 15,000,000px(36px 行で約 41 万行)を超える構成では帯を描画しません(開発時警告。展開状態は保持され、行数を絞ると表示されます)。行だけで 15,000,000px を超える間は、展開のトグル(▸)も出さず、`Enter` / `Space` でも開閉しません(`ctx.detail.expandable` も `false`。1.0.1 から)。
1655
+ - **上限**: 帯は auto-height 行と同じ可変行高ジオメトリで描画するため、`rows × rowHeight + 展開中の帯の合計` が 15,000,000px(36px 行で約 41 万行。Firefox は 8,000,000px = 約 22 万行)を超える構成では帯を描画しません(開発時警告。展開状態は保持され、行数を絞ると表示されます)。行だけでこの上限を超える間は、展開のトグル(▸)も出さず、`Enter` / `Space` でも開閉しません(`ctx.detail.expandable` も `false`。1.0.1 から)。
1653
1656
  - **行グルーピング併用**: 展開できるのは leaf 行のみ(グループ行は対象外)。
1654
1657
 
1655
1658
  ### ラベル行(見出し / 区切り行)(`labelRow`)
@@ -1710,7 +1713,7 @@ type Row = { id: string; kind?: 'label'; code: string; name: string; qty: number
1710
1713
  - **展開行併用**: 可。ラベル行は展開できません(データ行のみ)。
1711
1714
  - **serverSide(`dataSource`)**: サーバーが `getRows` の結果にラベル行を含めて返し(`totalRowCount` にも数える)、`isLabelRow` で識別します。セクションの並べ替え / `sectionRowCount` / 縦固定(`sticky`)/ ラベル行の `height` はサーバー行モデルでは適用されず、件数表示はサーバー総数のままです。
1712
1715
  - **エクスポート**: 既定では出力に含みません(scope `'raw'` でもデータ行として出ません)。`exportCsv` / `getExportData` の `includeLabelRows: true` で 1 行として出力し、`getExportData` は `rowKinds` で行種を返します(「Excel / スプレッドシート エクスポート」節のレシピ参照)。コピー(`Ctrl/Cmd+C`)には含まれません。
1713
- - **上限**: `height` を指定した場合は可変行高ジオメトリで描画するため、論理全高が 15,000,000px を超える構成では上書きを諦めて `rowHeight` に戻ります。
1716
+ - **上限**: `height` を指定した場合は可変行高ジオメトリで描画するため、論理全高が 15,000,000px(Firefox は 8,000,000px)を超える構成では上書きを諦めて `rowHeight` に戻ります。
1714
1717
 
1715
1718
  ラベル行の記述子は `GridLabelRow<T>`(`{ kind: 'label', row, sourceIndex, label, sectionRowCount }`)としてバレルから公開されます(`LabelRowOptions<T>` / `LabelRowRenderContext<T>` / `LabelRowSortMode` も同様)。
1716
1719
 
@@ -2206,9 +2209,23 @@ set / select / 複合(numberSet / textSet / dateSet)の候補集合はクライ
2206
2209
 
2207
2210
  - **`queryKey` 変化との違い**: フィルター/ソート/グローバルフィルターの変更は結果セットの総入れ替えなので**先頭へスクロールリセット**してキャッシュを全破棄し block 0 から取り直す。一方ソフトリフレッシュは**スクロール位置を保持**したままキャッシュを破棄し、**現在の可視レンジ**を即時(debounce なし)取り直す。
2208
2211
  - **件数**: リフレッシュ時に件数はリセットせず、到着ブロックの `totalRowCount` で更新する。外部更新で件数が増減していれば縦スクロール空間が追従する。可視レンジ未確立や件数 0(空結果)からのリフレッシュでは block 0 をブートストラップとして取り直す(空になったテーブルがサーバ側でデータを得た後も復帰できる)。
2209
- - **挙動メモ**: 取り直し中は対象行が一瞬スケルトン表示になる(purge → 再取得)。`refreshToken` は単調増加で運用する(値が変わったときだけ取り直す)。初回 mount では発火しない。
2212
+ - **挙動メモ**: 取り直し中は対象行が一瞬スケルトン表示になる(purge → 再取得)。前の行を見せたまま取り直すには `serverSideRefetch="keep"`(下の「取り直しの間の見せ方」節)。`refreshToken` は単調増加で運用する(値が変わったときだけ取り直す)。初回 mount では発火しない。
2210
2213
  - **用途**: 外部での編集/追加削除(mutation)後の反映トリガーとして使う想定。グリッド上の**セル編集**は `dataSource.updateRows`(下の「セル編集の書き戻し」節)で直接書き戻せるため本機能は不要。**行の追加削除**は書き戻し API を持たないため、「サーバへ反映 → `refreshServerSide()`」の運用に寄せる(AG Grid も実質この形)。
2211
2214
 
2215
+ ### 取り直しの間の見せ方(`serverSideRefetch`)
2216
+
2217
+ 条件(ソート / 列フィルター / グローバルフィルター)を変えたときと、取り直し(`refreshServerSide()` / `serverSideRefreshToken`)のとき、既定(`'skeleton'`)では行が読み込み中の行(スケルトン)になる。`serverSideRefetch="keep"` にすると、新しい行が届くまで前の行を薄くして見せ続ける(1.5.0 から)。
2218
+
2219
+ ```tsx
2220
+ <SpreadsheetGrid dataSource={dataSource} columns={columns} rowKeyGetter={(row) => row.id} serverSideRefetch="keep" />
2221
+ ```
2222
+
2223
+ - **見せ方**: 前の行は `--ssg-refetch-row-opacity`(既定 `0.45`)の濃さに見え(本体の見えている所に、セルの背景色の面を重ねて薄くする。行の要素の `opacity` は変えないので、固定列の下に中央の列が透けない)、列見出しの下に左から右へ流れる線(`.ssg-refetch-bar`。色は `--ssg-refetch-bar`、下地は `--ssg-refetch-bar-track`)が出る。ルートには `.ssg-root--refetching`、表(`role="grid"`)には `aria-busy="true"` が付く。`motion` が `'off'` なら線は動かない(全幅の止まった線)。
2224
+ - **差し替えるとき**: 見えている範囲(描いている行)のブロックがすべて新しい条件で届いたら、一度に差し替える(件数も新しい `totalRowCount` に)。届いたブロックから順に混ぜることはしない(上が新しい並び、下が古い並び、のような表を見せないため)。見えている範囲のブロックの取得に失敗したときは、前の行をやめて失敗の表示(読み込み中の行 + エラーバー)にする。範囲の外のブロックは待たない。
2225
+ - **スクロール**: 条件が変わったときは 1.4 までと同じく先頭へ戻る(前の行の先頭を薄く見せる)。取り直しはスクロール位置を保つ。前の行を見せている間にスクロールした先が前の行の読み込み済みのブロックの外なら、そこは読み込み中の行になる。
2226
+ - **編集**: 前の行を見せている間は、編集の開始・貼り付け・削除・フィルハンドルをしない(前の行の位置が新しい結果と合わないため。編集中に取り直しが始まったときは、その編集を確定しても書かない)。セルの読み取り専用の印・`aria-readonly`・`renderCell` の `readOnly` は変えない。前の行を見せ始める前の保存中の書き込みは、決着してから取り直す(1.4 までと同じ)。その値は保存できるまで前の行に出し続ける。
2227
+ - **前の行が無いとき**: 初めての取得と、まだ 1 つもブロックが届いていないときは、`'keep'` でも読み込み中の行になる。前の行を見せている間にまた条件を変えたときは、最初の前の行を見せたまま、新しい条件で取り直す(途中まで届いた行は捨てる)。
2228
+
2212
2229
  ### getRows 失敗時のエラー表示とリトライ
2213
2230
 
2214
2231
  `getRows` が reject する(abort 以外。Promise を返す前に同期で throw したときも同じ)と、失敗ブロックの行はスケルトンのまま残り、グリッド下部中央に**エラーバー**(「行の取得に失敗しました(N ブロック)」+ 再試行 / 閉じる)が表示される。
@@ -2287,8 +2304,8 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2287
2304
  | `filtering` | `filteringFeature` | グローバル / 列フィルター、フィルターのポップオーバー(遅延読み込み)、チップバー、非同期の候補(`enableGlobalFilter` / `enableColumnFilter` / `columns[].filterType` / `getFilterOptions` / `showFilterChipBar` / `onFiltersChange` / `manualFiltering` ほか) | +13.8KB(+ 遅延 8.2KB) |
2288
2305
  | `fillHandle` | `fillHandleFeature` | フィルハンドル(`fillHandle`) | +9.3KB |
2289
2306
  | `columnReorder` | `columnReorderFeature` | 列ヘッダーのドラッグ並べ替え(`onColumnsChange` 指定時 / `columnDragMotion`) | +6.0KB |
2290
- | `rowDrag` | `rowDragFeature` | 行のドラッグ並べ替え(`enableRowDrag` / `isRowDraggable` / `onRowMove` / `canDropRow` / `rowDragMotion`。ハンドルの `moveRow()` は本体にあるので無くても使える) | +4.8KB |
2291
- | `serverSide` | `serverSideFeature` | サーバーサイド行モデル(SSRM)の読み取りと書き戻し、保存状態の表示(`dataSource` / `serverSideRefreshToken` / `showSaveStatus` ほか) | +4.7KB |
2307
+ | `rowDrag` | `rowDragFeature` | 行のドラッグ並べ替え(`enableRowDrag` / `isRowDraggable` / `onRowMove` / `canDropRow` / `rowDragMotion`。ハンドルの `moveRow()` は本体にあるので無くても使える) | +5.3KB |
2308
+ | `serverSide` | `serverSideFeature` | サーバーサイド行モデル(SSRM)の読み取りと書き戻し、保存状態の表示(`dataSource` / `serverSideRefreshToken` / `showSaveStatus` ほか) | +5.1KB |
2292
2309
  | `columnMenu` | `columnMenuFeature` | 列メニュー(ソート・固定。幅の自動調整は `columnAutosize`、フィルターの入口は `filtering`、パネルの入口は `toolPanel` があるとき。`enableColumnMenu`) | +3.5KB |
2293
2310
  | `find` | `findFeature` | セル内検索(`find` / `onFindChange`) | +2.9KB |
2294
2311
  | `grouping` | `groupingFeature` | 行グルーピングと集計(`columns[].rowGroup` / `aggFunc`) | +2.7KB |
@@ -2300,20 +2317,20 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2300
2317
  | `toolPanel` | `toolPanelFeature` | ツールパネル(フィルター管理 / 列の表示 / 並び替え。部品は遅延読み込み) | +2.0KB(+ 遅延 7.1KB) |
2301
2318
  | `labelRow` | `labelRowFeature` | ラベル行(`labelRow`) | +1.8KB |
2302
2319
  | `totalRow` | `totalRowFeature` | 合計行(`totalRow`) | +1.7KB |
2320
+ | `motionExtras` | `motionExtrasFeature` | 変更のハイライト、コピー範囲の点線、十字ホバー(`highlightChanges` / `showCopyRange` / `hoverHighlight`) | +1.5KB |
2303
2321
  | `conditionalFormat` | `conditionalFormatFeature` | 条件付き書式とチップ(`columns[].conditionalFormat`) | +1.3KB |
2304
2322
  | `pinnedRows` | `pinnedRowsFeature` | 固定行(`pinnedTopRows` / `pinnedBottomRows`) | +1.3KB |
2305
2323
  | `imeDirectInput` | `imeDirectInputFeature` | IME オンのままの直接入力(`imeDirectInput`) | +1.2KB |
2306
- | `motionExtras` | `motionExtrasFeature` | 変更のハイライト、コピー範囲の点線、十字ホバー(`highlightChanges` / `showCopyRange` / `hoverHighlight`) | +1.2KB |
2307
2324
  | `autoHeight` | `autoHeightFeature` | 行の高さの実測(`autoHeight` / `columns[].autoHeight`) | +1.2KB |
2308
2325
 
2309
2326
  サイズ(初期読み込みの JS の gzip。esbuild で minify・React は外部化・`@tanstack/virtual-core` 込み。2026-11-23 の dist で計測):
2310
2327
 
2311
2328
  | 構成 | 初期 JS(gzip) |
2312
2329
  | --- | --- |
2313
- | 全部入り(`SpreadsheetGrid`) | 約 153KB |
2314
- | `/lite` 機能なし | 約 90KB |
2330
+ | 全部入り(`SpreadsheetGrid`) | 約 155KB |
2331
+ | `/lite` 機能なし | 約 91KB |
2315
2332
  | `/lite` + `standardFeatures` | 約 114KB |
2316
- | `/lite` + `standardFeatures` + `serverSideFeature` | 約 118KB |
2333
+ | `/lite` + `standardFeatures` + `serverSideFeature` | 約 119KB |
2317
2334
 
2318
2335
  - 各機能の目安は「機能なし」に 1 つだけ足したときの増え方で、組み合わせると共通部分のぶん合計より少し小さくなる。バンドラーによって数 KB 前後する(0.61.0 の全部入りの実測で、Vite 8(Rolldown)は esbuild より約 1.5KB 小さく、Vite 7(Rollup)はほぼ同じ。Next.js 16 では webpack が Turbopack より約 4KB 大きい)。
2319
2336
  - 使わない機能がバンドルから落ちることは、Vite 8・webpack 5・Next.js 16(既定の Turbopack)・esbuild で確かめている(バンドラーが `package.json` の `sideEffects` と `/* @__PURE__ */` を解釈する必要がある)。
@@ -2733,6 +2750,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
2733
2750
  | --- | --- |
2734
2751
  | `.ssg-root` | グリッドのルート要素(`className` prop の付与先)。 |
2735
2752
  | `.ssg-root--fill-height` | `height` に `%` を含む値を渡したときのルート(flex column)。 |
2753
+ | `.ssg-root--refetching` | `serverSideRefetch="keep"` で、取り直しの間に前の行を見せているときのルート(このとき本体の見えている所を `--ssg-refetch-row-opacity` の濃さに薄く見せる)。 |
2736
2754
  | `.ssg-root--filling` | フィルハンドル(`fillHandle`)のドラッグ中のルート(カーソルを十字に固定)。 |
2737
2755
  | `.ssg-theme-dark` | `theme="dark"`(または `'auto'` のダーク解決)時に root と各ポータル(popover / menu / panel / ツールチップ)へ。 |
2738
2756
  | `.ssg-theme-class` | `theme="class"` のとき root と各ポータル(popover / menu / panel / ツールチップ / ドラッグのゴースト)と `GridAskBar` へ。祖先に `.dark` か `[data-theme="dark"]` があるとダークのプリセットになる(`:where` で定義)。 |
@@ -2743,6 +2761,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
2743
2761
  | `.ssg-filter-chip-bar` | フィルターチップバー。 |
2744
2762
  | `.ssg-empty-state` | 0 行時の空状態。 |
2745
2763
  | `.ssg-ssrm-error-bar` | SSRM の読み込みエラーバー。 |
2764
+ | `.ssg-refetch-bar` | `serverSideRefetch="keep"` で前の行を見せている間、列見出しの下に出る動く線(色は `--ssg-refetch-bar` / `--ssg-refetch-bar-track`)。 |
2746
2765
  | `.ssg-scroll-hint` | スクロール位置インジケーター(`scrollHint`)。 |
2747
2766
  | `.ssg-find-bar` | セル内検索(`find`)の検索バー。 |
2748
2767
  | `.ssg-find-mark` / `.ssg-find-mark--current` | セル内検索のヒット / 今のヒット(`<mark>`)。 |
@@ -2830,7 +2849,7 @@ function Grid(props: SpreadsheetGridProps<Row>) {
2830
2849
  | 保存の印(SSRM の書き戻し) | `--ssg-save-pending` / `--ssg-save-ok` / `--ssg-save-ok-contrast` / `--ssg-save-failed` |
2831
2850
  | 検索とフィルハンドル | `--ssg-find-mark-bg` / `--ssg-find-mark-current-bg`、`--ssg-fill-line` / `--ssg-fill-handle-ring` |
2832
2851
  | 条件付き書式 | `--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`(チップ) |
2833
- | 読み込み中とスクロール位置 | `--ssg-skeleton-bar` / `--ssg-skeleton-bar-hi`(SSRM のスケルトン)、`--ssg-scrollhint-track-bg` / `--ssg-scrollhint-thumb` / `--ssg-scrollhint-thumb-active`(`scrollHint`) |
2852
+ | 読み込み中とスクロール位置 | `--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`) |
2834
2853
  | モーション | `--ssg-motion-fast` / `--ssg-motion-base` / `--ssg-motion-slow` / `--ssg-motion-ease` |
2835
2854
 
2836
2855
  ## 補助型(props で参照される shape)
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A virtualized spreadsheet / data grid for Solid 2.0 (~1M rows, pinned columns, Excel-like editing / selection / clipboard, filters & sorting, client-side and server-side row models). It is the Solid version of [`@ishibashi0112/spreadsheet-grid`](https://www.npmjs.com/package/@ishibashi0112/spreadsheet-grid) (React): the same props, column options, imperative handle, CSS and look, built on the same framework-independent core. 日本語は下にあります。
4
4
 
5
- **[Docs & live demo](https://datasheet-grid.vercel.app)** (the guides show a Solid tab wherever the code differs, and the API reference is written for the React version with the same props. Solid notes, in Japanese: [Solid で使う](https://datasheet-grid.vercel.app/docs/solid)) · [Try on StackBlitz](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/solid?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [Changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)
5
+ **[Docs & live demo](https://datasheet-grid.vercel.app)** (pick Solid at the top of the sidebar and the getting-started pages, the code in the guides and the notes on the API reference switch to Solid. In Japanese: [installation](https://datasheet-grid.vercel.app/docs/solid/installation) · [Solid で気をつけること](https://datasheet-grid.vercel.app/docs/solid/notes)) · [Try on StackBlitz](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/solid?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [Changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)
6
6
 
7
7
  ## Install
8
8
 
@@ -18,7 +18,7 @@ import '@ishibashi0112/spreadsheet-grid-solid/style.css'
18
18
 
19
19
  The package follows the Solid convention for libraries: the `solid` export condition points at JSX source (`dist/source/`), which your bundler compiles with your own Solid settings (DOM or SSR, dev or prod). With Vite, use `@solidjs/vite-plugin` 3 (Vite 8 or later). SSR needs this form. Tools without the `solid` condition get the DOM build (`dist/index.js`, ESM only). In Node (for example tests with Vitest and jsdom), resolve with the `solid` or `browser` condition, which `@solidjs/vite-plugin` sets: with Node's default conditions `@solidjs/web` resolves to its server build and the DOM build fails with "Client-only API called on the server side".
20
20
 
21
- `style.layer.css` and the design-system themes (`themes/astryx.css` / `themes/mantine.css` / `themes/heroui.css` / `themes/shadcn.css`) are the same files as in the React version ([installation](https://datasheet-grid.vercel.app/docs/installation), [design systems](https://datasheet-grid.vercel.app/docs/guides/design-systems)).
21
+ `style.layer.css` and the design-system themes (`themes/astryx.css` / `themes/mantine.css` / `themes/heroui.css` / `themes/shadcn.css`) are the same files as in the React version ([CSS](https://datasheet-grid.vercel.app/docs/css), [design systems](https://datasheet-grid.vercel.app/docs/guides/design-systems)).
22
22
 
23
23
  ## Quick start
24
24
 
@@ -52,7 +52,7 @@ A runnable example (an editable inventory table with 10,000 rows) is in [`exampl
52
52
 
53
53
  ## Picking features
54
54
 
55
- `SpreadsheetGrid` includes every feature (about 168KB gzip of initial JS; the column filter popover and the tool panel, about 16KB, load later). `createSpreadsheetGrid` builds a grid with only the features you pass, and the rest is left out of your bundle (about 95KB with no features, about 123KB with the `standardFeatures` preset). Unlike the React version, the parts come from the main entry (there is no `/lite`).
55
+ `SpreadsheetGrid` includes every feature (about 170KB gzip of initial JS; the column filter popover and the tool panel, about 16KB, load later). `createSpreadsheetGrid` builds a grid with only the features you pass, and the rest is left out of your bundle (about 97KB with no features, about 124KB with the `standardFeatures` preset). Unlike the React version, the parts come from the main entry (there is no `/lite`).
56
56
 
57
57
  ```tsx
58
58
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid-solid'
@@ -68,7 +68,7 @@ The feature names and what they enable are listed in the bundled `API_REFERENCE.
68
68
  - **`ref` works like Solid's DOM refs.** `let grid!: SpreadsheetGridHandle<Row>` with `ref={grid}`, or `ref={(handle) => (grid = handle)}`, gives you the handle with the same methods (there are no React ref objects). The handle is set before your component's first `createEffect` and `onSettled` run, so you can call it there (for example to restore a saved state or scroll to the bottom). Inside `<Loading>`, the grid is not drawn until the first rows arrive, and methods that change its state do nothing before that (the grid warns once in development): pass the first state as `initialState`, or call the handle from an effect that reads the rows (`createEffect(() => rows().length, …)`). After the grid is removed (hidden with `<Show>` and so on), a handle left in your variable does nothing for methods that change the state (the grid warns once in development), and methods that read return the values from when it was removed (save `grid.getState()` in `onCleanup`; `getScrollPosition()` returns `null` and `isAtBottom()` `false`).
69
69
  - **Render functions run only when needed.** `renderCell` and `renderHeader` run again when their column changes, and the bar renderers when the function changes; not on every update as in React. Everything in the context (`row`, `value`, `rowIndex`, `isActive`, the bar context and each field of its `derivedSummary`, and so on) is read when you access it: read it inside JSX and only that expression follows, so an input inside a cell can call `ctx.setValue` on every keystroke and keep its focus (1.4.0+; earlier versions re-created the cell content whenever its row changed). Reading a value in the function body (destructuring the arguments included) re-creates the content when that value changes. Reading it at the top of your own component's body (`renderCell={(ctx) => <MyCell ctx={ctx} />}` with `const v = props.ctx.value` in `MyCell`) does not follow later changes (Solid reports `STRICT_READ_UNTRACKED` in development), so read it inside JSX there. Signals from outside the grid read in the `renderCell` body re-create the content of every visible cell when they change, so read them inside JSX (or through a memo per row key).
70
70
  - **Natural-language filter (`/ai`).** `GridAskBar` and `createGridAsk` (the React version's `useGridAsk`; Solid names it `create…`) come from `@ishibashi0112/spreadsheet-grid-solid/ai` (about 15KB gzip, separate from the grid's bundle). Pass the grid as a function that returns the handle, `grid={() => grid}` (with `let grid!` and `ref={grid}`), or as a signal (`ref={setGrid}` with `grid={grid}`); there are no ref objects. Everything else (your `ask` function, the answer format, `gridAskLocaleTextEn` from `/locales/en`) is the same as the React version ([AI filter guide](https://datasheet-grid.vercel.app/docs/guides/ai-filter)).
71
- - **Speed.** Scrolling and editing feel the same as the React version in usual tables. Jumping far in very large or very wide tables takes more JavaScript time than the React version: in our measurement on 1.4.0, `Ctrl+End` in 1,000,000 rows took about 1.2 times as long, and large vertical jumps in a table of about 200 columns about 2 times the script time, with a few MB more memory (each visible cell is a small set of Solid computations; 1.4.0 roughly halved the earlier gap).
71
+ - **Speed.** Scrolling and editing feel about the same as the React version. In our measurement on 2026-11-28 (production build, Chromium), `Ctrl+End` in 1,000,000 rows takes about the same time as the React version, large vertical jumps in a table of about 200 columns take less JavaScript time (about 0.6 times), short scrolls about 1.2 times and large horizontal jumps about 1.5 times, and a table of about 200 columns uses about 3.5 MB more memory (each visible cell is a small set of Solid computations; when only the drawn range changes, row and cell elements are reused and only their contents are rewritten).
72
72
  - Everything else (props, column options, handle methods, callbacks, CSS classes and tokens) is the same as in the React version. The package ships `API_REFERENCE.md` (0.1.2+; the same document as the React version's, with a note at the top on reading it for Solid; also [on GitHub](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/react/API_REFERENCE.md)).
73
73
 
74
74
  ## Solid-specific notes
@@ -116,7 +116,7 @@ MIT
116
116
 
117
117
  Solid 2.0 向けの仮想化スプレッドシート / データグリッドです(約 100 万行・列固定・Excel ライクな編集 / 選択 / クリップボード・フィルター / ソート・クライアントサイド / サーバーサイド行モデル)。React 版の [`@ishibashi0112/spreadsheet-grid`](https://www.npmjs.com/package/@ishibashi0112/spreadsheet-grid) と同じ props・列の定義・命令的なハンドル・CSS・見た目で、同じフレームワークに依らないコアの上に作っています。
118
118
 
119
- **[ドキュメントとライブデモ](https://datasheet-grid.vercel.app)**(ガイドはコードが違う所に Solid のタブがあります。API リファレンスは React 版向けですが、props は同じです。Solid 版だけのことは [Solid で使う](https://datasheet-grid.vercel.app/docs/solid))· [StackBlitz で試す](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/solid?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [変更履歴](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)
119
+ **[ドキュメントとライブデモ](https://datasheet-grid.vercel.app)**(サイドバーの一番上で Solid を選ぶと、はじめるのページ・ガイドのコード・API リファレンスの読み替えが Solid になります。Solid 版だけのことは [Solid で気をつけること](https://datasheet-grid.vercel.app/docs/solid/notes))· [StackBlitz で試す](https://stackblitz.com/fork/github/ishibashi0112/datasheet-grid/tree/main/examples/solid?file=src/App.tsx&terminal=dev) · [GitHub](https://github.com/ishibashi0112/datasheet-grid) · [変更履歴](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)
120
120
 
121
121
  `npm install @ishibashi0112/spreadsheet-grid-solid` で入れます(peer は `solid-js` / `@solidjs/web` の `^2.0.0`)。CSS は `import '@ishibashi0112/spreadsheet-grid-solid/style.css'` を 1 回読み込みます。`style.layer.css` とデザインシステムのテーマ(`themes/*.css`)は React 版と同じファイルです。
122
122
 
@@ -128,14 +128,14 @@ Solid 2.0 向けの仮想化スプレッドシート / データグリッドで
128
128
 
129
129
  ### 機能を選んで組み込む
130
130
 
131
- `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 168KB gzip。列フィルターのポップオーバーとツールパネルの約 16KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 95KB、プリセット `standardFeatures` で約 123KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
131
+ `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 170KB gzip。列フィルターのポップオーバーとツールパネルの約 16KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 97KB、プリセット `standardFeatures` で約 124KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
132
132
 
133
133
  ### React 版との違い
134
134
 
135
135
  - **`ref` は Solid の DOM の ref と同じです。** `let grid!: SpreadsheetGridHandle<Row>` と `ref={grid}`、または `ref={(handle) => (grid = handle)}` で、同じメソッドを持つハンドルを受け取れます(React の ref オブジェクトはありません)。ハンドルは利用側の部品の最初の `createEffect` と `onSettled` より前に入るので、そこで呼べます(保存した状態を戻す、末尾へスクロールする など)。`<Loading>` の中では最初の行が届くまでグリッドを描かず、それまでに呼んだ状態を変えるメソッドは何もしません(開発時に 1 回知らせます)。最初の状態は `initialState` で渡すか、行を読む effect(`createEffect(() => rows().length, …)`)から呼んでください。グリッドを外した後(`<Show>` で隠したときなど)も変数に残ったハンドルは、状態を変えるメソッドは何もせず(開発時に 1 回知らせます)、読むメソッドは外したときの値を返します(`onCleanup` で `grid.getState()` を保存できます。`getScrollPosition()` は `null`、`isAtBottom()` は `false`)。
136
136
  - **描く関数は必要なときだけ呼びます。** `renderCell` と `renderHeader` は列が変わったとき、バーの関数は関数が変わったときに呼び直します(React 版のように更新のたびには呼びません)。文脈の値(`row` / `value` / `rowIndex` / `isActive`、バーの文脈と、その `derivedSummary` の各項目など)は読んだときに引くので、JSX の中で読めばその式だけが追従します。セルの中の入力欄で打つたびに `ctx.setValue` しても、入力欄はそのままでフォーカスも外れません(1.4.0 から。それまでは行が変わるたびにセルの中身を作り直していました)。関数の本体で読むと(引数の分割代入も)、その値が変わったときに中身を作り直します(バーの入力欄なら、フォーカスと打ちかけの文字が消えます)。自分の部品の本体の一番上で読むと(`renderCell={(ctx) => <MyCell ctx={ctx} />}` で `MyCell` の中の `const v = props.ctx.value`)、その後の変化に追従しません(開発時に Solid が `STRICT_READ_UNTRACKED` を出します)。そこでも JSX の中で読んでください。グリッドの外の signal を `renderCell` の本体で読むと、変わるたびに見えているすべてのセルの中身を作り直します。JSX の中で読むか、行のキーごとの memo を通してください。
137
137
  - **ことばで絞り込み(`/ai`)。** `GridAskBar` と `createGridAsk`(React 版の `useGridAsk`。Solid の慣例で `create…` の名前)は `@ishibashi0112/spreadsheet-grid-solid/ai` から import します(約 15KB gzip。グリッドのバンドルとは別)。グリッドはハンドルを返す関数 `grid={() => grid}`(`let grid!` と `ref={grid}`)か signal(`ref={setGrid}` と `grid={grid}`)で渡します(ref オブジェクトはありません)。そのほか(利用側の `ask`・答えの形・`/locales/en` の `gridAskLocaleTextEn`)は React 版と同じです([ことばで絞り込み](https://datasheet-grid.vercel.app/docs/guides/ai-filter))。
138
- - **速さ。** ふつうの表のスクロールと編集は React 版と変わりません。とても行の多い表や列の多い表で遠くへ飛ぶときは、JS の時間が React 版より長くなります。1.4.0 で測ると、100 万行の `Ctrl+End` は約 1.2 倍、約 200 列の表で縦に大きく飛ぶときの JS は約 2 倍で、メモリは数 MB 多くなりました(見えているセルごとに Solid の計算をいくつか持つため。1.4.0 で差をおよそ半分に縮めました)。
138
+ - **速さ。** スクロールと編集は React 版とほぼ同じです。2026-11-28 に本番ビルドの Chromium で測ると、100 万行の `Ctrl+End` は React 版と同じくらい、約 200 列の表で縦に大きく飛ぶときの JS の時間は React 版より短く(約 0.6 倍)、少しずつのスクロールは約 1.2 倍、横に大きく飛ぶときは約 1.5 倍で、約 200 列の表ではメモリが約 3.5MB 多くなります(見えているセルごとに Solid の計算をいくつか持つため。描く範囲だけが変わったときは、行の要素とセルの部品を使い回して中身だけを書き換えます)。
139
139
  - そのほか(props・列の定義・ハンドルのメソッド・通知・CSS のクラスとトークン)は React 版と同じです。パッケージに `API_REFERENCE.md` を同梱しています(0.1.2 から。React 版と同じ文書で、先頭に Solid 版での読み替えがあります。[GitHub](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/react/API_REFERENCE.md) でも読めます)。
140
140
 
141
141
  ### Solid で気をつけること
@@ -18,6 +18,7 @@ export type ShellDevWarningArgs = {
18
18
  detailRowEnabled: () => boolean;
19
19
  detailExtraCount: () => number;
20
20
  detailActive: () => boolean;
21
+ maxBodyPx: () => number;
21
22
  globalFilterText: () => string;
22
23
  columnFilterCount: () => number;
23
24
  };