@ishibashi0112/spreadsheet-grid-solid 0.1.2 → 1.4.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
@@ -4,10 +4,11 @@
4
4
  >
5
5
  > この API リファレンスは React 版(`@ishibashi0112/spreadsheet-grid`)と同じ文書です。props・列の定義・ハンドルのメソッド・通知・CSS のクラスとトークンは Solid 版も同じなので、次のように読み替えてください。
6
6
  >
7
- > - import は `@ishibashi0112/spreadsheet-grid-solid` から。`/lite` の `createSpreadsheetGrid` と機能の部品も本体の入口にあります(`/lite` はありません)。`/locales/en` と `/testing` は同じ名前です。ことばで絞り込み(`/ai`)はありません。
7
+ > - import は `@ishibashi0112/spreadsheet-grid-solid` から。`/lite` の `createSpreadsheetGrid` と機能の部品も本体の入口にあります(`/lite` はありません)。`/ai` / `/locales/en` / `/testing` は同じ名前です。`/ai` の `useGridAsk` は `createGridAsk`(型の `UseGridAskOptions` / `UseGridAskResult` は `CreateGridAskOptions` / `CreateGridAskResult`)で、`grid` はハンドルを返す関数(`grid={() => grid}`)か signal です。
8
8
  > - 例の `useState` は `createSignal`(`rows={rows}` は `rows={rows()}`)、`useMemo` は `createMemo`、`useRef` + `ref={gridRef}` は `let grid!: SpreadsheetGridHandle<Row>` + `ref={grid}`(`gridRef.current` は `grid`)、`flushSync` / テストの `act()` は `solid-js` の `flush()` です。
9
9
  > - 型の `ReactNode` は `JSX.Element`、`useEffect` は `createEffect` / `onSettled`、`Suspense` は `<Loading>`、`createPortal` は `<Portal>`(`@solidjs/web`)です。
10
- > - 「X.Y.Z から」の版は React 版とコア(`@ishibashi0112/spreadsheet-grid-core`)の版です。Solid 版では、そのコアの版に依存する版から使えます(Solid 版の変更履歴を見てください)。
10
+ > - 「X.Y.Z から」の版は React 版とコア(`@ishibashi0112/spreadsheet-grid-core`)の版です。Solid 版は 1.4.0 から同じ版なので、1.4.0 以降の「X.Y.Z から」は Solid 版でも同じ版から使えます(1.3.0 以前の版の機能は Solid 版 1.4.0 にすべて入っています)。
11
+ > - 「機能を選んで組み込む」の大きさ(KB)は React 版の値です。Solid 版は全部入りで約 168KB、機能なしで約 95KB、`standardFeatures` で約 123KB です(solid-js は含めない。README.md の「Picking features」、日本語は「機能を選んで組み込む」)。
11
12
  > - Solid 版だけのこと(描く関数を呼び直す時機・書き込みの反映・テスト・SSR)は同梱の README.md の「Differences from the React version」「Solid-specific notes」(日本語は「React 版との違い」「Solid で気をつけること」)にあります。
12
13
 
13
14
  # SpreadsheetGrid 公開 API リファレンス
@@ -1201,7 +1202,7 @@ const columns: GridColumn<Expense>[] = [
1201
1202
  | `'select'` | 候補ドロップダウン(表の外のポータル。`popupContainer`)。↑↓=ハイライト移動 / Enter=確定(下へ)/ Tab=確定(左右へ)/ クリック=確定 / 印字キー=label 前方一致のタイプアヘッド(約 700ms でリセット)/ IME で確定した文字(日本語の名前など)= その文字で始まる候補、無ければ含む候補へ(1.0.2) | `options: readonly GridSelectEditorOption[] \| (row) => readonly GridSelectEditorOption[]`(静的 or 行依存。関数はレンダー中に呼ばれるため純粋であること。readonly / `as const` の配列も可。1.3.0 から)/ `clipboard: 'value' \| 'label'`(既定 `'value'`。`'label'` でコピー・CSV は label、貼り付けた label は value へ。1.1.0) | パススルー(`option.value` は string。型変換したい場合は `parseClipboardValue` を併用)。`clipboard: 'label'` なら、貼り付けた文字が候補の label(前後の空白は外して比べる)ならその value、value ならそのまま、どちらでもなければ生文字列のまま(label を先に見る。エディタで選んだ候補は読み替えずにその value を書く) |
1202
1203
  | `'date'` | ネイティブ `<input type="date">`。ドラフトは `'YYYY-MM-DD' \| ''`。入力欄は中身(年 / 月 / 日)より狭くせず、細い列ではセルからはみ出して開く。セルを選んで文字から打ち始めたときは、その文字を消さないよう文字の入力欄で開き、確定するときに日付として読む(`2026/3/15`・`2026-03-15` など。読み方は既定パーサに、全角の数字・記号と「2026年3月15日」の書き方を足したもの。貼り付けではこれらを読まない)。読めなければ「日付で入力してください」を出して編集を続ける(フォーカスが外れたら取り消し。1.0.2) | `strict`(`true` で日付として読めない値に印。1.2.0。「バリデーション」節) | `''`→`null` / 解釈可能→`'YYYY-MM-DD'` へ正規化(数字の日付は年 / 月 / 日と、年が後ろの月 / 日 / 年 = 「4/11/2026」は 4 月 11 日。日 / 月 / 年としては読まない)/ 解釈不可→生文字列のまま(数字だけの文字列 = Excel の日付のシリアル値「45678」や「5」と、年が 4 桁にならない文字列、年の無い文字列(「11/2」「Nov 1」)、ありえない日付(「2026/2/30」)も解釈不可。翌月へ繰り越さない) |
1203
1204
  | `'checkbox'` | **直接トグル**(編集セッションなし)。チェックボックスそのものを押すか、アクティブセルで Space を押すと即トグル(セルのチェックボックスの外を押したときはアクティブセルになるだけ。ダブルクリックでも切り替わらない)。Enter / F2 / ダブルクリックではエディタが開かない | `checkedValue`(既定 `true`)/ `uncheckedValue`(既定 `false`)。checked 判定は `Object.is(value, checkedValue)` のみ | `''`→unchecked / checked・unchecked の文字列表現→対応値 / `'true'`・`'1'`→checked / その他→unchecked |
1204
- | `'custom'` | `render(ctx)` の返り値を編集オーバーレイ内に描画。**フォーカス管理・キーバインドは利用側の責務**(開いたままグリッドの中の別のセルを押したときに値を残す / エディタを閉じるには、入力欄の `onBlur` で `ctx.commit` か `ctx.cancel` を呼ぶ。呼ばないとエディタが開いたまま残り、グリッドのキー操作が効かない) | `render: (ctx: CellEditorContext<T>) => ReactNode`, `imeDirectInput?: boolean`(グリッドの `imeDirectInput` が有効なとき、IME で確定した文字を `ctx.initialText` に入れて開く。既定 `false`。1.2.0 から) | パススルー |
1205
+ | `'custom'` | `render(ctx)` の返り値を編集オーバーレイ内に描画。**フォーカス管理・キーバインドは利用側の責務**(開いたままグリッドの中の別のセル・行番号・列見出し・見出しの角・行の掴み手・展開トグル・表の余白を押すと、グリッドが編集を終えてエディタを閉じる。編集していたセルの中でエディタが覆っていない所を押したときは閉じない。打った値を残すには入力欄の `onBlur` で `ctx.commit(value)` を呼ぶ。サーバーの検査を待ってから呼んでも、閉じた後に編集していたセルへ書く(その前に同じセルをまた開いて編集しているときとグリッドを外した後は書かない。検査で reject する値は書かず `{ status: 'rejected' }` を返す)。呼ばなければ打ちかけは書かない。1.4.0 まではエディタが開いたまま残り、別のセルをダブルクリックするまでグリッドのキー操作が効かなかった) | `render: (ctx: CellEditorContext<T>) => ReactNode`, `imeDirectInput?: boolean`(グリッドの `imeDirectInput` が有効なとき、IME で確定した文字を `ctx.initialText` に入れて開く。既定 `false`。1.2.0 から) | パススルー |
1205
1206
 
1206
1207
  注意点:
1207
1208
 
@@ -2305,14 +2306,14 @@ export const OrdersTable = () => <Grid columns={columns} dataSource={dataSource}
2305
2306
  | `motionExtras` | `motionExtrasFeature` | 変更のハイライト、コピー範囲の点線、十字ホバー(`highlightChanges` / `showCopyRange` / `hoverHighlight`) | +1.2KB |
2306
2307
  | `autoHeight` | `autoHeightFeature` | 行の高さの実測(`autoHeight` / `columns[].autoHeight`) | +1.2KB |
2307
2308
 
2308
- サイズ(初期読み込みの JS の gzip。esbuild で minify・React は外部化・`@tanstack/virtual-core` 込み。2026-11-08 の dist で計測):
2309
+ サイズ(初期読み込みの JS の gzip。esbuild で minify・React は外部化・`@tanstack/virtual-core` 込み。2026-11-23 の dist で計測):
2309
2310
 
2310
2311
  | 構成 | 初期 JS(gzip) |
2311
2312
  | --- | --- |
2312
- | 全部入り(`SpreadsheetGrid`) | 約 140KB |
2313
- | `/lite` 機能なし | 約 80KB |
2314
- | `/lite` + `standardFeatures` | 約 102KB |
2315
- | `/lite` + `standardFeatures` + `serverSideFeature` | 約 107KB |
2313
+ | 全部入り(`SpreadsheetGrid`) | 約 153KB |
2314
+ | `/lite` 機能なし | 約 90KB |
2315
+ | `/lite` + `standardFeatures` | 約 114KB |
2316
+ | `/lite` + `standardFeatures` + `serverSideFeature` | 約 118KB |
2316
2317
 
2317
2318
  - 各機能の目安は「機能なし」に 1 つだけ足したときの増え方で、組み合わせると共通部分のぶん合計より少し小さくなる。バンドラーによって数 KB 前後する(0.61.0 の全部入りの実測で、Vite 8(Rolldown)は esbuild より約 1.5KB 小さく、Vite 7(Rollup)はほぼ同じ。Next.js 16 では webpack が Turbopack より約 4KB 大きい)。
2318
2319
  - 使わない機能がバンドルから落ちることは、Vite 8・webpack 5・Next.js 16(既定の Turbopack)・esbuild で確かめている(バンドラーが `package.json` の `sideEffects` と `/* @__PURE__ */` を解釈する必要がある)。
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)** (written for the React version; the props are the same. 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)** (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)
6
6
 
7
7
  ## Install
8
8
 
@@ -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 166KB 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 94KB with no features, about 121KB 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 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`).
56
56
 
57
57
  ```tsx
58
58
  import { createSpreadsheetGrid, standardFeatures, serverSideFeature } from '@ishibashi0112/spreadsheet-grid-solid'
@@ -66,25 +66,26 @@ The feature names and what they enable are listed in the bundled `API_REFERENCE.
66
66
  ## Differences from the React version
67
67
 
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
- - **Render functions run only when needed.** `renderCell` runs again when its row, value or column changes, `renderHeader` when its column changes, and the bar renderers when the function changes; not on every update as in React. Positions and states in the context (`rowIndex`, `isActive`, the bar context and so on) are reactive: read them inside JSX and they stay current. Reading them in the function body makes the content re-created whenever they change (`derivedSummary` is one value, so reading any of its fields re-creates the bar whenever any summary text changes, such as the active cell's address). Because `renderCell` runs again when its row changes, an input inside a cell that calls `ctx.setValue` on every keystroke loses focus after the first character: keep the text in a signal inside the component and call `setValue` when it is committed (blur / Enter), or use a custom editor. The same goes for signals from outside the grid read in the `renderCell` body: each change re-creates the content of every visible cell, so read them inside JSX (or through a memo per row key).
70
- - **Not available:** the natural-language filter (`/ai`, `GridAskBar`).
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
+ - **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
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)).
72
73
 
73
74
  ## Solid-specific notes
74
75
 
75
- - **Keep `rows` in a signal.** `onRowsChange` returns a new array on every edit (the same contract as the React version). The rows are replaced as a whole, so, following Solid's own split (a signal for values replaced as a whole, a store for nested data updated piece by piece), keep them in a signal and put the array back with `setRows(next)`. In this version, with `createStore` the rows that come back are a store proxy instead of the array the grid returned, so the undo / redo history is cleared, and Solid prints many development diagnostics (the grid warns once in development when `rows` is a store).
76
+ - **`rows` in a signal or a store.** `onRowsChange` returns a new array on every edit (the same contract as the React version). With a signal, put it back as is with `setRows(next)`. With `createStore`, pass `rows={state.rows}` and put it back with `setState((s) => { s.rows = next })` or `setState((s) => { reconcile(next, 'id')(s.rows) })`: undo / redo works as with a signal (1.4.0+). Changes you make inside the store (`s.rows[0].name = …`, `push`, `splice`) show in the grid and, like the React version's rows replaced by the parent, clear the undo history. A store tracks each row to notice those changes, so with many rows every edit takes longer (about 0.1s per edit with 100,000 rows); keep tables of more than about 50,000 rows in a signal (the grid suggests it once in development).
76
77
  - **Writes apply in a microtask.** After `setRows(...)`, the grid sees the new rows on the next flush. To use a row you just added right away (`getViewRowIndex(key)` then `startEditing(...)`), call `flush()` from `solid-js` first (the React docs use `flushSync` for the same thing). In tests, call `flush()` after changing a signal or firing an event, before looking at the DOM.
77
78
  - **Saving with `action`.** You can start an `action` from a grid callback: `onRowsChange={(next) => save(next)}` with `createOptimistic` inside the action, or `setRows(next)` followed by `save(next)`. The grid keeps its own updates out of your action, so the editor closes and the next edit goes to the right row while the save is in flight (like `startTransition` in the React version). Take the save target (a project id and so on) from the rows you receive, not from props that may already point elsewhere. A `refresh()` that fetches the saved rows again replaces `rows` from outside, which clears the undo history (as in the React version).
78
79
  - **Async rows.** Rows from an async `createMemo` / `createSignal(async)` work inside `<Loading>`: the fallback shows until the first rows arrive. While they are fetched again, the grid keeps the previous rows and stays usable; show the wait with `isPending(() => rows())`. With `<Loading on={...}>` the fallback replaces the grid during the refetch (the grid keeps its state and comes back when the rows arrive); an edit in progress is committed when the grid is replaced, so `onRowsChange` gets the previous rows. A failed refetch reaches your `<Errored>`. Rows read through `createDeferred` show the old values while a save's `refresh()` fetches them again (that is how `createDeferred` works); an async `createMemo` keeps the saved values.
79
80
  - **Callbacks after drawing.** The callbacks the React version calls from an effect after rendering (`onActiveCellChange`, `onStateChange`, `onFiltersChange`, `onSortChange`, `onExpandedDetailRowKeysChange`, and `onRowSelectionChange` when removing selected rows drops them from the selection) run right after the flush that drew the change, in a microtask, and not after the grid is removed. In tests, `await Promise.resolve()` after `flush()` before checking them.
80
81
  - **Tests (Vitest + jsdom).** Add `@solidjs/vite-plugin` to the Vitest config. Without the plugin, put `browser` in `resolve.conditions`, `ssr.resolve.conditions` and `ssr.resolve.externalConditions` (all three). Use the Solid 2 version of `@solidjs/testing-library` (1.0 release candidates) and `installJsdomLayoutStubs` from `@ishibashi0112/spreadsheet-grid-solid/testing` (jsdom has no layout).
81
- - **SSR.** SolidStart supports only Solid 1 at the time of writing. With Solid 2, use Vite's SSR with `@solidjs/vite-plugin` (`ssr: true`), `renderToString` or `renderToStream` with `generateHydrationScript` on the server, and `hydrate` on the client (`@solidjs/router` 2 also needs `createRequestEvent` from `@solidjs/web` and `provideRequestEvent` from `@solidjs/web/storage`). The server renders only the grid's frame (headers, the filter and sort labels of the bars); rows, pinned cells, counts and totals are drawn after hydration, so a different time zone or date in the browser (date conditions, `Date` values) cannot leave the server's rows on the page (Solid's hydration does not fix server text that differs on the client; the React version re-renders the mismatch on the client). Run the production server with `NODE_ENV=production` (or set `define: { 'process.env.NODE_ENV': JSON.stringify('production') }` in the SSR build): otherwise the server renders the development build's extra parts and hydration does not pick up the grid.
82
+ - **SSR.** SolidStart supports only Solid 1 at the time of writing. With Solid 2, use Vite's SSR with `@solidjs/vite-plugin` (`ssr: true`), `renderToString` or `renderToStream` with `generateHydrationScript` on the server, and `hydrate` on the client (`@solidjs/router` 2 also needs `createRequestEvent` from `@solidjs/web` and `provideRequestEvent` from `@solidjs/web/storage`). The server renders what the React version renders: the frame, the row numbers and pinned cells of the first rows, counts and totals (columns that are not pinned need the grid's width and are drawn in the browser, as in the React version). The server's rows are a display-only copy: after hydration the grid swaps it for the rows computed in the browser within the same task, so a different time zone or date in the browser (date conditions, `Date` values) cannot leave the server's rows on the page. Solid's hydration does not fix server text that differs on the client, so the server HTML holds a hidden frame without rows that hydration picks up, followed by the copy, which is removed after hydration (the React version re-renders the mismatch on the client). Only the copy has the `.ssg-root` class, so the server HTML has one `.ssg-root`, as in the React version (the frame gets the class after hydration; 1.4.0 put it on both). Run the production server with `NODE_ENV=production` (or set `define: { 'process.env.NODE_ENV': JSON.stringify('production') }` in the SSR build): otherwise the server renders the development build's extra parts and hydration does not pick up the grid.
82
83
  - **Saving the state in the URL.** Pass the saved state as `initialState` on the first render, save it from `onStateChange`, and apply later changes (back / forward) with `grid.applyState(...)`. Reading signals inside the grid's callbacks is fine; they run outside tracking, like event handlers.
83
- - **Detail rows.** `detailRow.render` runs once when a row opens; it is not called again when the row changes, and `ctx.row` is the current row. Read `ctx.row` inside JSX to follow edits and undo. A field initialized with `createSignal(() => ctx.row.x)` is reset whenever the row changes, so keep unsaved input in a plain signal: `createSignal(untrack(() => ctx.row.x))`. The same goes for custom editors: `ctx.value` and `ctx.row` are reactive, so read them inside JSX, or take the starting value with `untrack(() => ctx.value)` (or `ctx.initialText`); reading them in the component body makes Solid report `STRICT_READ_UNTRACKED` in development.
84
+ - **Detail rows.** `detailRow.render` runs when a row opens, and `ctx.row` returns the current row when read. Read `ctx.row` inside JSX (passing it to a component, as in `order={ctx.row}`, counts too) and only that expression follows edits and undo. Reading it in the body of `render` (including destructuring `({ row }) => …`) calls `render` again whenever the row changes and rebuilds the card (focus and unsaved text in its inputs, and the state of a nested grid, are lost). A field initialized with `createSignal(() => ctx.row.x)` is reset whenever the row changes, so keep unsaved input in a plain signal: `createSignal(untrack(() => ctx.row.x))`. The same goes for custom editors: `ctx.value` and `ctx.row` are reactive, so read them inside JSX, or take the starting value with `untrack(() => ctx.value)` (or `ctx.initialText`); reading them in the component body makes Solid report `STRICT_READ_UNTRACKED` in development.
84
85
  - **Values from outside the rows.** `getValue` and `valueFormatter` should depend only on the row and the value. If they read a signal from outside, the cells follow it but totals (`aggFunc`) do not; re-create the columns when that signal changes (for example `const columns = createMemo(() => makeColumns(totals()))`).
85
86
  - **Sharing props between grids.** Spread a stable object, or write the props out. Spreading an object that is re-created on every change (`{...gridProps()}`) works, but in development Solid reports `HUGE_FAN_OUT`.
86
87
  - **Shadow DOM (Web Components).** Put `style.css` inside the shadow root (a `<style>` or `adoptedStyleSheets`), wrap the grid in an element instead of rendering it directly into the shadow root (popups are drawn inside that element), use an open shadow root, and call the `dispose` that `render()` returns from `disconnectedCallback`. Details: the section 「Shadow DOM の中のグリッド」 of the API reference.
87
- - **Development diagnostics.** In `vite dev`, Solid may print `EFFECT_RELAY_TEAR` / `EFFECT_WRITES_OWN_SOURCE` naming effects such as `autoHeightMeasurer`, `activeRowFollow`, `edit`, `serverSideRowModel`, `fillHandle` or `clampSelectionToRowCount` (the names are examples). They come from the grid re-aligning its state after a change (the React version re-renders the same way), are harmless, and do not appear in production builds.
88
+ - **Development diagnostics.** In `vite dev`, Solid may print `EFFECT_WRITES_OWN_SOURCE` for three effects: `autoHeightMeasurer` (with `autoHeight` columns, after measuring rows), `activeRowFollow` (with `activeCellFollows: 'row'` when the order changes) and `edit` (when the order changes while editing). They come from the grid re-aligning its state after a change (the React version re-renders the same way), are harmless, and do not appear in production builds. Since 1.4.0 the grid's other re-alignments (selection clamping, column widths, scrolling, the server-side row model, notifications such as `onActiveCellChange`) no longer print `EFFECT_RELAY_TEAR`: their writes depend on state outside Solid's graph (the grid's store, the DOM), which Solid's tooling counts as the cost of measuring rather than derived state.
88
89
 
89
90
  ## Using with AI coding assistants
90
91
 
@@ -103,7 +104,7 @@ This library is new, so AI coding assistants rarely know its API and tend to gue
103
104
 
104
105
  ## Versioning
105
106
 
106
- This package has its own version (0.x), separate from the React version and the core, and depends on the core of exactly one version. Before 1.0, minor releases may include breaking changes; they are listed in the [changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md). TypeScript 5.8 or later is supported (`moduleResolution` `bundler` or `nodenext`, `jsx: "preserve"`, `jsxImportSource: "@solidjs/web"`). A library built on this package that exports inferred types should list this package and the core (the version this package depends on) in `peerDependencies`.
107
+ From 1.4.0, this package shares one version with the React version and the core (0.1.2 was followed by 1.4.0), and depends on the core of exactly the same version. Releases follow semver: since 1.4.0, breaking changes ship only in major releases, as in the React version (before, the 0.1.x releases could include them in minor releases). Changes shared with the React version are in the [changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md), and Solid-only changes in the [Solid changelog](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md) ([Versioning](https://datasheet-grid.vercel.app/docs/versioning), Japanese). TypeScript 5.8 or later is supported (`moduleResolution` `bundler` or `nodenext`, `jsx: "preserve"`, `jsxImportSource: "@solidjs/web"`). A library built on this package that exports inferred types should list this package and the core (the version this package depends on) in `peerDependencies`.
107
108
 
108
109
  ## License
109
110
 
@@ -115,7 +116,7 @@ MIT
115
116
 
116
117
  Solid 2.0 向けの仮想化スプレッドシート / データグリッドです(約 100 万行・列固定・Excel ライクな編集 / 選択 / クリップボード・フィルター / ソート・クライアントサイド / サーバーサイド行モデル)。React 版の [`@ishibashi0112/spreadsheet-grid`](https://www.npmjs.com/package/@ishibashi0112/spreadsheet-grid) と同じ props・列の定義・命令的なハンドル・CSS・見た目で、同じフレームワークに依らないコアの上に作っています。
117
118
 
118
- **[ドキュメントとライブデモ](https://datasheet-grid.vercel.app)**(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 リファレンスは 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
120
 
120
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 版と同じファイルです。
121
122
 
@@ -127,30 +128,31 @@ Solid 2.0 向けの仮想化スプレッドシート / データグリッドで
127
128
 
128
129
  ### 機能を選んで組み込む
129
130
 
130
- `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 166KB gzip。列フィルターのポップオーバーとツールパネルの約 16KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 94KB、プリセット `standardFeatures` で約 121KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
131
+ `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 168KB gzip。列フィルターのポップオーバーとツールパネルの約 16KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 95KB、プリセット `standardFeatures` で約 123KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
131
132
 
132
133
  ### React 版との違い
133
134
 
134
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`)。
135
- - **描く関数は必要なときだけ呼びます。** `renderCell` は行・値・列が変わったとき、`renderHeader` は列が変わったとき、バーの関数は関数が変わったときに呼び直します(React 版のように更新のたびには呼びません)。文脈の位置と状態(`rowIndex` / `isActive` / バーの文脈など)は読んだときに引くので、JSX の中で読めばその場で追従します。関数の本体で読むと(引数の分割代入も)、それが変わるたびに中身を作り直します(バーの入力欄なら、フォーカスと打ちかけの文字が消えます。変わる値は JSX の中で読んでください。`derivedSummary` は 1 つの値なので、その中のどれを読んでも、アクティブセルの番地など要約の文字のどれかが変わるたびに作り直します)。`renderCell` は行が変わると呼び直すので、セルの中の入力欄で打つたびに `ctx.setValue` すると、1 文字目で中身が作り直されてフォーカスが外れます。打つ間は部品の中の signal に持ち、確定したとき(blur / Enter)に `setValue` するか、custom のエディタを使ってください。グリッドの外の signal を `renderCell` の本体で読んだときも同じで、変わるたびに見えているすべてのセルの中身を作り直します。JSX の中で読むか、行のキーごとの memo を通してください。
136
- - **ありません:** ことばで絞り込み(`/ai` の `GridAskBar`)。
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
+ - **ことばで絞り込み(`/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 で差をおよそ半分に縮めました)。
137
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) でも読めます)。
138
140
 
139
141
  ### Solid で気をつけること
140
142
 
141
- - **`rows` は signal で持つ。** `onRowsChange` は編集のたびに新しい配列を返します(React 版と同じ約束)。行は配列ごと差し替わるので、Solid の使い分け(丸ごと差し替える値は signal、中を少しずつ書き換える入れ子のデータは store)どおり signal で持ち、`setRows(next)` で戻してください。今の版では `createStore` に入れると、戻ってくる rows がグリッドの返した配列ではなく store のプロキシになるので、元に戻す / やり直しの履歴が消え、開発時に Solid の知らせが多く出ます(`rows` が store のときは開発時に 1 回警告します)。
143
+ - **`rows` は signal でも store でも持てます。** `onRowsChange` は編集のたびに新しい配列を返します(React 版と同じ約束)。signal なら `setRows(next)` でそのまま戻します。`createStore` なら `rows={state.rows}` で渡し、`setState((s) => { s.rows = next })` か `setState((s) => { reconcile(next, 'id')(s.rows) })` で戻すと、signal のときと同じく元に戻す / やり直しが効きます(1.4.0 から)。store の中を直接変えたとき(`s.rows[0].name = …` / `push` / `splice`)もグリッドに映り、React 版で親が rows を差し替えたときと同じく元に戻すの履歴は消えます。store は中の変化に気づくため行ごとに追うので、行が多いと編集のたびに時間がかかります(10 万行で 1 回 0.1 秒ほど)。5 万行ほどより多い表は signal で持ってください(開発時に 1 回勧めます)。
142
144
  - **書き込みはマイクロタスクで反映されます。** `setRows(...)` の後、グリッドが新しい行を見るのは次の反映のときです。足したばかりの行をすぐ使う(`getViewRowIndex(key)` → `startEditing(...)`)ときは、先に `solid-js` の `flush()` を呼んでください(React 版のドキュメントの `flushSync` と同じ)。テストでも、signal を変えた・イベントを送った後に DOM を見る前に `flush()` を呼びます。
143
145
  - **`action` で保存する。** グリッドの通知の中で `action` を始めてかまいません(`onRowsChange={(next) => save(next)}` で action の中で `createOptimistic` に書く、または `setRows(next)` の後に `save(next)`)。グリッドは自分の書き込みを利用者の action に入れないので、保存の間もエディタは閉じ、続けた編集はその行に入ります(React 版の `startTransition` と同じ)。保存先(プロジェクトの ID など)は、先に別の値へ変わっていることがある props ではなく、受け取った行から取ってください。保存した行を `refresh()` で取り直すと、`rows` が外から差し替わるので、元に戻すの履歴は消えます(React 版と同じ)。
144
146
  - **非同期の行。** 非同期の `createMemo` / `createSignal(async)` の行は `<Loading>` の中で使えます(最初の行が届くまでは fallback)。取り直しの間は前の行のまま操作できるので、待っていることは `isPending(() => rows())` で出してください。`<Loading on={...}>` では取り直しの間 fallback がグリッドに替わります(グリッドの状態は残り、行が届くと戻ります)。替わるときに編集中の値は確定し、`onRowsChange` には前の行が渡ります。取り直しの失敗は利用側の `<Errored>` が受けます。`createDeferred` で読んだ行は、保存の `refresh()` の取り直しの間は元の値を出します(`createDeferred` の意味どおり)。非同期の `createMemo` なら保存した値のままです。
145
147
  - **描いた後の通知。** React 版が描いた後の effect で呼ぶ通知(`onActiveCellChange` / `onStateChange` / `onFiltersChange` / `onSortChange` / `onExpandedDetailRowKeysChange`、選んだ行を消して選択から外したときの `onRowSelectionChange`)は、その変化を反映し終えた直後(次のマイクロタスク)に呼び、グリッドを外した後には呼びません。テストでは `flush()` の後に `await Promise.resolve()` で 1 回待ってから確かめてください。
146
148
  - **テスト(Vitest + jsdom)。** Vitest の設定に `@solidjs/vite-plugin` を入れてください。プラグイン無しなら `browser` を `resolve.conditions` / `ssr.resolve.conditions` / `ssr.resolve.externalConditions` の 3 か所すべてに書きます。`@solidjs/testing-library` は Solid 2 向けの版(1.0 の候補版)を使い、jsdom にはレイアウトが無いので `@ishibashi0112/spreadsheet-grid-solid/testing` の `installJsdomLayoutStubs` を呼びます。
147
- - **SSR。** 今の SolidStart は Solid 1 だけに対応しています。Solid 2 では Vite の SSR と `@solidjs/vite-plugin`(`ssr: true`)で、サーバーは `renderToString` か `renderToStream` と `generateHydrationScript`、クライアントは `hydrate` を使います(`@solidjs/router` 2 は `@solidjs/web` の `createRequestEvent` と `@solidjs/web/storage` の `provideRequestEvent` も要ります)。サーバーで描くのはグリッドの骨組み(見出し・上下のバーの絞り込み / 並び替えの表示)だけで、行・固定列のセル・件数・合計はハイドレーションの後に描きます。サーバーとブラウザでタイムゾーンや今日が違っても(日付の条件・Date の値)、サーバーの行がページに残りません(Solid のハイドレーションはクライアントで違う値になった文字を直さないため。React 版は食い違いをクライアントで描き直します)。本番のサーバーは `NODE_ENV=production` で起動してください(または SSR のビルドに `define: { 'process.env.NODE_ENV': JSON.stringify('production') }`)。無いとサーバーが開発用の部品も描き、ハイドレーションがグリッドを引き継げません。
149
+ - **SSR。** 今の SolidStart は Solid 1 だけに対応しています。Solid 2 では Vite の SSR と `@solidjs/vite-plugin`(`ssr: true`)で、サーバーは `renderToString` か `renderToStream` と `generateHydrationScript`、クライアントは `hydrate` を使います(`@solidjs/router` 2 は `@solidjs/web` の `createRequestEvent` と `@solidjs/web/storage` の `provideRequestEvent` も要ります)。サーバーは React 版と同じものを描きます(骨組み・最初の行の行番号と固定した列のセル・件数・合計。固定していない列はグリッドの幅が要るので、React 版と同じくブラウザで描きます)。サーバーの行は表示だけの写しで、ハイドレーションの後、同じタスクの中でブラウザで計算した行へ入れ替えます。サーバーとブラウザでタイムゾーンや今日が違っても(日付の条件・Date の値)、サーバーの行がページに残りません。Solid のハイドレーションはクライアントで違う値になった文字を直さないので、サーバーの HTML には、ハイドレーションで使う行を空にして隠した骨組みと、その後ろの写しが並びます(写しはハイドレーションの後に外れます。React 版は食い違いをクライアントで描き直します)。`.ssg-root` が付くのは写しだけで、サーバーの HTML の `.ssg-root` は React 版と同じく 1 つです(骨組みにはハイドレーションの後に付きます。1.4.0 は両方に付いていました)。本番のサーバーは `NODE_ENV=production` で起動してください(または SSR のビルドに `define: { 'process.env.NODE_ENV': JSON.stringify('production') }`)。無いとサーバーが開発用の部品も描き、ハイドレーションがグリッドを引き継げません。
148
150
  - **状態を URL に残す。** 保存した状態は最初の描画で `initialState` に渡し、`onStateChange` で保存し、後からの変化(戻る / 進む)は `grid.applyState(...)` で入れます。グリッドの通知の中で signal を読んでかまいません(イベントのハンドラと同じく追跡の外で呼びます)。
149
- - **展開行。** `detailRow.render` は行を開いたときに 1 回呼び、行が変わっても呼び直しません(`ctx.row` が今の行)。編集や元に戻すに追従するには JSX の中で `ctx.row` を読んでください。`createSignal(() => ctx.row.x)` で持った入力欄の値は行が変わるたびに戻るので、保存前の入力はふつうの signal で持ちます(`createSignal(untrack(() => ctx.row.x))`)。custom エディタも同じで、`ctx.value` / `ctx.row` は読んだときに引くので JSX の中で読むか、始めの値は `untrack(() => ctx.value)`(または `ctx.initialText`)で取ってください(部品の本体で読むと開発時に Solid が `STRICT_READ_UNTRACKED` を出します)。
151
+ - **展開行。** `detailRow.render` は行を開いたときに呼び、`ctx.row` は読んだときに今の行を引きます。JSX の中で `ctx.row` を読めば(`order={ctx.row}` のように部品へ渡すのも同じ)、編集や元に戻すにその式だけが追従します。`render` の本体で読むと(引数の分割代入 `({ row }) => …` も)、その行が変わるたびに `render` を呼び直してカードを作り直します(カードの中の入力欄のフォーカスや打ちかけの文字、入れ子のグリッドの状態が消えます)。`createSignal(() => ctx.row.x)` で持った入力欄の値は行が変わるたびに戻るので、保存前の入力はふつうの signal で持ちます(`createSignal(untrack(() => ctx.row.x))`)。custom エディタも同じで、`ctx.value` / `ctx.row` は読んだときに引くので JSX の中で読むか、始めの値は `untrack(() => ctx.value)`(または `ctx.initialText`)で取ってください(部品の本体で読むと開発時に Solid が `STRICT_READ_UNTRACKED` を出します)。
150
152
  - **行の外の値。** `getValue` / `valueFormatter` は行と値だけから決めてください。外の signal を読むと、セルはそれに追従しますが合計(`aggFunc`)は追従しません。その signal が変わったら列を作り直してください(`const columns = createMemo(() => makeColumns(totals()))` など)。
151
153
  - **複数のグリッドで props を共有する。** 変わらないオブジェクトを spread するか、props を書き並べてください。変化のたびに作り直すオブジェクトを spread しても(`{...gridProps()}`)動きますが、開発時に Solid が `HUGE_FAN_OUT` を出します。
152
154
  - **Shadow DOM(Web Components)。** `style.css` は Shadow root の中に入れ(`<style>` か `adoptedStyleSheets`)、グリッドは Shadow root の直下に描かずに要素で包み(ポップアップはその要素の中に出ます)、open の Shadow root を使い、`disconnectedCallback` で `render()` が返す `dispose` を呼んでください。詳しくは API リファレンスの「Shadow DOM の中のグリッド」。
153
- - **開発時の Solid の知らせ。** `vite dev` では、Solid が `autoHeightMeasurer` / `activeRowFollow` / `edit` / `serverSideRowModel` / `fillHandle` / `clampSelectionToRowCount` などの effect の名前(名前は例です)で `EFFECT_RELAY_TEAR` / `EFFECT_WRITES_OWN_SOURCE` を出すことがあります。変化の後にグリッドが状態を合わせ直す処理(React 版も同じ描き直しをしている)で、害は無く、本番のビルドでは出ません。
155
+ - **開発時の Solid の知らせ。** `vite dev` では、Solid が 3 つの effect の名前で `EFFECT_WRITES_OWN_SOURCE` を出すことがあります: `autoHeightMeasurer`(`autoHeight` の列で行を測った後)/ `activeRowFollow`(`activeCellFollows: 'row'` で並びが変わったとき)/ `edit`(編集中に並びが変わったとき)。変化の後にグリッドが状態を合わせ直す処理(React 版も同じ描き直しをしている)で、害は無く、本番のビルドでは出ません。1.4.0 から、ほかの合わせ直し(選択を範囲の中へ詰める・列幅・スクロール・サーバーサイドの行モデル・`onActiveCellChange` などの通知)は `EFFECT_RELAY_TEAR` を出しません(書く値がグリッドの store や DOM など Solid のグラフの外の状態で決まるので、Solid の計測は派生した状態ではなく「測ることの手間」として扱います)。
154
156
 
155
157
  ### AI コーディングツールで使う
156
158
 
@@ -169,7 +171,7 @@ Solid 2.0 向けの仮想化スプレッドシート / データグリッドで
169
171
 
170
172
  ### バージョンの方針
171
173
 
172
- このパッケージは React 版・コアとは別の版(0.x)で、コアには同じ 1 つの版で依存します。1.0 より前は minor でも壊す変更が入ることがあり、[変更履歴](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)に書きます。TypeScript は 5.8 以上(`moduleResolution` は `bundler` / `nodenext`、`jsx: "preserve"`・`jsxImportSource: "@solidjs/web"`)です。このパッケージの上に作ったライブラリが推論した型を export するときは、このパッケージと core(このパッケージが依存する版)を `peerDependencies` に入れてください。
174
+ 1.4.0 から、このパッケージは React 版・コアと同じ版で出し(0.1.2 の次が 1.4.0)、コアには同じ版で依存します。版は semver に沿って上げ、1.4.0 からは React 版と同じく壊す変更は major でだけ出します(その前の 0.1.x では minor でも出していました)。React 版と共通の変更は [CHANGELOG](https://github.com/ishibashi0112/datasheet-grid/blob/main/CHANGELOG.md)、Solid 版だけの変更は [Solid 版の変更履歴](https://github.com/ishibashi0112/datasheet-grid/blob/main/packages/solid/CHANGELOG.md)にあります([バージョンと互換性](https://datasheet-grid.vercel.app/docs/versioning))。TypeScript は 5.8 以上(`moduleResolution` は `bundler` / `nodenext`、`jsx: "preserve"`・`jsxImportSource: "@solidjs/web"`)です。このパッケージの上に作ったライブラリが推論した型を export するときは、このパッケージと core(このパッケージが依存する版)を `peerDependencies` に入れてください。
173
175
 
174
176
  ## License
175
177
 
@@ -1,5 +1,5 @@
1
1
  import { f as e, i as t, o as n, r, t as i } from "./portalTokens-Gz03P3fZ.js";
2
- import { n as a, r as o, t as s } from "./columnVirtualizer-Bv79_vW1.js";
2
+ import { n as a, r as o, t as s } from "./columnVirtualizer-DdL7-ijS.js";
3
3
  import { n as c, r as l, t as u } from "./inputValue-C6BHBMBx.js";
4
4
  import { For as d, Match as f, Show as p, Switch as m, createEffect as h, createMemo as g, createSignal as _, onCleanup as v, untrack as y } from "solid-js";
5
5
  import { Portal as b, addEvent as x, className as S, createComponent as C, delegateEvents as w, effect as T, heldRead as E, insert as D, memo as O, readShallow as k, ref as A, setAttribute as j, setStyleProperty as M, spread as N, style as ee, template as P } from "@solidjs/web";
@@ -11,15 +11,15 @@ import { parseFilterDateText as z } from "@ishibashi0112/spreadsheet-grid-core/i
11
11
  import { getEventTarget as B } from "@ishibashi0112/spreadsheet-grid-core/internal/utils/shadowDom";
12
12
  import { createDateRolloverStore as V } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/dateRolloverStore";
13
13
  import { normalizeDateFilterPresets as H } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterPresets";
14
- import { keepFocusAfterPress as U } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport";
15
- import { resolveFocusWrapTarget as W } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
16
- import { filterSetOptionsBySearch as G, resolveSetFilterEnterAction as K } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch";
14
+ import { DEFAULT_FILTER_LOCALE_TEXT as U } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters";
15
+ import { keepFocusAfterPress as W } from "@ishibashi0112/spreadsheet-grid-core/internal/controllers/popoverSupport";
16
+ import { resolveFocusWrapTarget as G } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/focusCycle";
17
+ import { filterSetOptionsBySearch as K, resolveSetFilterEnterAction as te } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSearch";
17
18
  import { isSetValueSelected as q } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/setFilterSelection";
18
- import { DEFAULT_NUMBER_FILTER_DRAFT as te, NUMBER_FILTER_OPERATOR_OPTIONS as J, buildParsedNumberFilterFromDraft as Y, filterOptionsByNumberCondition as X, numberFilterOperandCount as ne } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition";
19
- import { DEFAULT_TEXT_FILTER_DRAFT as re, TEXT_FILTER_OPERATOR_OPTIONS as ie, buildParsedTextFilterFromDraft as ae, filterOptionsByTextCondition as oe, textFilterOperandCount as se } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition";
20
- import { DATE_FILTER_OPERATOR_OPTIONS as ce, DEFAULT_DATE_FILTER_DRAFT as le, buildParsedDateFilterFromDraft as ue, dateFilterOperandCount as de, filterOptionsByDateCondition as fe, normalizeFilterDateInputValue as pe, resolveComboReferenceDate as me } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition";
21
- import { buildDateTreeRows as he } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree";
22
- import { DEFAULT_FILTER_LOCALE_TEXT as ge } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeTextFilters";
19
+ import { DEFAULT_NUMBER_FILTER_DRAFT as J, NUMBER_FILTER_OPERATOR_OPTIONS as Y, buildParsedNumberFilterFromDraft as X, filterOptionsByNumberCondition as ne, numberFilterOperandCount as re } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/numberFilterCondition";
20
+ import { DEFAULT_TEXT_FILTER_DRAFT as ie, TEXT_FILTER_OPERATOR_OPTIONS as ae, buildParsedTextFilterFromDraft as oe, filterOptionsByTextCondition as se, textFilterOperandCount as ce } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/textFilterCondition";
21
+ import { DATE_FILTER_OPERATOR_OPTIONS as le, DEFAULT_DATE_FILTER_DRAFT as ue, buildParsedDateFilterFromDraft as de, dateFilterOperandCount as fe, filterOptionsByDateCondition as pe, normalizeFilterDateInputValue as me, resolveComboReferenceDate as he } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterCondition";
22
+ import { buildDateTreeRows as ge } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/dateFilterTree";
23
23
  import { buildCalendarDayCells as _e, buildYearGrid as ve, formatFilterDateDisplay as ye, yearGridStart as be } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/datePickerCalendar";
24
24
  //#region src/view/FilterDateField.tsx
25
25
  var xe = /* @__PURE__ */ P("<div class=ssg-dp-root><div class=ssg-dp-field><input type=text inputmode=numeric placeholder=yyyy/mm/dd class=ssg-dp-input><button><svg width=12 height=12 viewBox=\"0 0 16 16\"aria-hidden=true><rect x=1.5 y=2.5 width=13 height=12 rx=1.5 fill=none stroke=currentColor></rect><line x1=1.5 y1=6 x2=14.5 y2=6 stroke=currentColor></line><line x1=5 y1=1 x2=5 y2=4 stroke=currentColor></line><line x1=11 y1=1 x2=11 y2=4 stroke=currentColor>"), Se = /* @__PURE__ */ P("<div class=ssg-dp-panel><div class=ssg-dp-nav><button>‹</button><button></button><button>›</button></div><!><!><div class=ssg-dp-foot><button></button><button>"), Ce = /* @__PURE__ */ P("<div class=ssg-dp-dow>"), we = /* @__PURE__ */ P("<div class=ssg-dp-days>"), Te = /* @__PURE__ */ P("<span>"), Z = /* @__PURE__ */ P("<button>"), Ee = /* @__PURE__ */ P("<div class=ssg-dp-grid>");
@@ -104,9 +104,9 @@ function De(t) {
104
104
  m((t) => t + e * 12);
105
105
  }, K = () => {
106
106
  f((e) => e === "days" ? "months" : "years");
107
- }, q = () => {
108
- f((e) => e === "years" ? "months" : "days");
109
107
  }, te = () => {
108
+ f((e) => e === "years" ? "months" : "days");
109
+ }, q = () => {
110
110
  let e = u();
111
111
  return e === "days" ? F(n().calendarTitle, {
112
112
  year: p(),
@@ -147,7 +147,7 @@ function De(t) {
147
147
  get "aria-label"() {
148
148
  return n().calendarChangeView;
149
149
  }
150
- }, () => W(K)], !0), D(a, te), N(o, [{
150
+ }, () => W(K)], !0), D(a, q), N(o, [{
151
151
  type: "button",
152
152
  class: "ssg-dp-nav-btn",
153
153
  get "aria-label"() {
@@ -244,7 +244,7 @@ function De(t) {
244
244
  return N(e, [{
245
245
  type: "button",
246
246
  class: "ssg-dp-foot-btn"
247
- }, () => W(q)], !0), D(e, () => n().calendarBack), e;
247
+ }, () => W(te)], !0), D(e, () => n().calendarBack), e;
248
248
  })() : void 0;
249
249
  })(), h), N(h, [{
250
250
  type: "button",
@@ -278,7 +278,7 @@ var Oe = /* @__PURE__ */ P("<span class=ssg-filter-truncated>"), ke = /* @__PURE
278
278
  let r = y(e);
279
279
  r && (r.current = n);
280
280
  };
281
- }, st = 24, ct = 40, lt = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches ? ct : st, ut = (e, t, n) => e === "" && t === ge.blank ? n : t, dt = (e, t) => t === ge.blank ? e : e.map((e) => e.value === "" && e.label === ge.blank ? {
281
+ }, st = 24, ct = 40, lt = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches ? ct : st, ut = (e, t, n) => e === "" && t === U.blank ? n : t, dt = (e, t) => t === U.blank ? e : e.map((e) => e.value === "" && e.label === U.blank ? {
282
282
  ...e,
283
283
  label: t
284
284
  } : e), ft = (e) => {
@@ -309,7 +309,7 @@ function ht() {
309
309
  }
310
310
  var gt = (e, t, n) => t === 0 ? n ? e.filterNoOptionsSource : e.noOptions : e.filterNoMatches;
311
311
  function _t(t) {
312
- let r = e(), [i, a] = _(""), o = g(() => dt(t.options, r().blank)), l = g(() => G(o(), i())), f = g(() => i().trim().length > 0), p, m = lt(), h = s(() => ({
312
+ let r = e(), [i, a] = _(""), o = g(() => dt(t.options, r().blank)), l = g(() => K(o(), i())), f = g(() => i().trim().length > 0), p, m = lt(), h = s(() => ({
313
313
  count: l().length,
314
314
  getScrollElement: () => p ?? null,
315
315
  estimateSize: () => m,
@@ -340,7 +340,7 @@ function _t(t) {
340
340
  if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), t.onRequestClose()), e.key === "Enter") {
341
341
  if (I(e)) return;
342
342
  e.preventDefault();
343
- let n = K(y(o), e.currentTarget.value);
343
+ let n = te(y(o), e.currentTarget.value);
344
344
  if (n.kind === "none") return;
345
345
  n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
346
346
  }
@@ -407,14 +407,14 @@ function _t(t) {
407
407
  ];
408
408
  }
409
409
  function vt(t) {
410
- let n = e(), r = g(() => ne(t.draft.operator)), i = l(() => t.draft.operator);
410
+ let n = e(), r = g(() => re(t.draft.operator)), i = l(() => t.draft.operator);
411
411
  return [(() => {
412
412
  var e = Ie();
413
413
  return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
414
414
  ...t.draft,
415
415
  operator: e.currentTarget.value
416
416
  })), A(() => i, e), D(e, C(d, {
417
- each: J,
417
+ each: Y,
418
418
  children: (e) => (() => {
419
419
  var t = Le();
420
420
  return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
@@ -495,14 +495,14 @@ function yt(e) {
495
495
  }), r;
496
496
  }
497
497
  function bt(t) {
498
- let n = e(), r = g(() => se(t.draft.operator)), i = l(() => t.draft.operator);
498
+ let n = e(), r = g(() => ce(t.draft.operator)), i = l(() => t.draft.operator);
499
499
  return [(() => {
500
500
  var e = Ie();
501
501
  return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
502
502
  ...t.draft,
503
503
  operator: e.currentTarget.value
504
504
  })), A(() => i, e), D(e, C(d, {
505
- each: ie,
505
+ each: ae,
506
506
  children: (e) => (() => {
507
507
  var t = Le();
508
508
  return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
@@ -543,10 +543,10 @@ function bt(t) {
543
543
  })())];
544
544
  }
545
545
  function xt(t) {
546
- let n = e(), r = g(() => t.draft.preset === null ? de(t.draft.operator) : 0), i = l(() => t.draft.operator), a = (e, n) => {
546
+ let n = e(), r = g(() => t.draft.preset === null ? fe(t.draft.operator) : 0), i = l(() => t.draft.operator), a = (e, n) => {
547
547
  t.onDraftChange({
548
548
  ...t.draft,
549
- [e]: pe(n),
549
+ [e]: me(n),
550
550
  preset: null
551
551
  });
552
552
  }, o = (e) => {
@@ -577,7 +577,7 @@ function xt(t) {
577
577
  operator: e.currentTarget.value,
578
578
  preset: null
579
579
  })), A(() => i, e), D(e, C(d, {
580
- each: ce,
580
+ each: le,
581
581
  children: (e) => (() => {
582
582
  var t = Le();
583
583
  return D(t, () => n()[e.labelKey]), T(() => e.value, (e) => {
@@ -675,7 +675,7 @@ function xt(t) {
675
675
  return N(n, [
676
676
  { type: "button" },
677
677
  () => $((t) => {
678
- c(e().id), U(t);
678
+ c(e().id), W(t);
679
679
  }),
680
680
  { get class() {
681
681
  return ["ssg-filter-preset-chip", { "ssg-filter-preset-chip--active": t.draft.preset === e().id }];
@@ -687,7 +687,7 @@ function xt(t) {
687
687
  ];
688
688
  }
689
689
  function St(t) {
690
- let r = e(), [i, a] = _(""), [o, l] = _(/* @__PURE__ */ new Set()), f = g(() => i().trim().length > 0), p = g(() => dt(t.options, r().blank)), m = g(() => G(p(), i())), h = g(() => he(t.options, o(), r())), v, b = g(() => f() ? m().length : h().length), S = lt(), w = s(() => ({
690
+ let r = e(), [i, a] = _(""), [o, l] = _(/* @__PURE__ */ new Set()), f = g(() => i().trim().length > 0), p = g(() => dt(t.options, r().blank)), m = g(() => K(p(), i())), h = g(() => ge(t.options, o(), r())), v, b = g(() => f() ? m().length : h().length), S = lt(), w = s(() => ({
691
691
  count: b(),
692
692
  getScrollElement: () => v ?? null,
693
693
  estimateSize: () => S,
@@ -727,7 +727,7 @@ function St(t) {
727
727
  let n = 0;
728
728
  for (let r of e) q(t, r) && (n += 1);
729
729
  return n;
730
- }, te = (e) => {
730
+ }, G = (e) => {
731
731
  if (e.type === "leaf") {
732
732
  t.onValueToggle(e.key);
733
733
  return;
@@ -752,7 +752,7 @@ function St(t) {
752
752
  })() : Ke()),
753
753
  (() => {
754
754
  var t = We();
755
- return x(t, "change", u(a, () => te(y(e.row)))), A(() => o, t), T(() => ({
755
+ return x(t, "change", u(a, () => G(y(e.row)))), A(() => o, t), T(() => ({
756
756
  e: i(),
757
757
  t: s(),
758
758
  a: E()
@@ -773,7 +773,7 @@ function St(t) {
773
773
  if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), t.onRequestClose()), e.key === "Enter") {
774
774
  if (I(e)) return;
775
775
  e.preventDefault();
776
- let n = K(y(p), e.currentTarget.value);
776
+ let n = te(y(p), e.currentTarget.value);
777
777
  if (n.kind === "none") return;
778
778
  n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
779
779
  }
@@ -823,7 +823,7 @@ function St(t) {
823
823
  children: (e) => (() => {
824
824
  var t = Je();
825
825
  return t._$$click = (t) => {
826
- t.target.closest("button, input") || te(y(e).row);
826
+ t.target.closest("button, input") || G(y(e).row);
827
827
  }, D(t, C(X, { row: () => e().row })), T(() => ({
828
828
  e: `translateY(${e().start}px)`,
829
829
  t: n(e().size),
@@ -985,20 +985,20 @@ function Et(t) {
985
985
  function Dt(s) {
986
986
  let c = e(), l = r().container(), u = { current: null }, d = /* @__PURE__ */ new Date(), p = V();
987
987
  a(p, () => ({ active: s.filterType === "dateSet" && (s.dateConditionDraft?.preset ?? null) !== null }), "render", "filterDateRollover");
988
- let h = o(p, "filterDateRolloverStore"), y = () => me(d, h()), [x, w] = _(), E;
988
+ let h = o(p, "filterDateRolloverStore"), y = () => he(d, h()), [x, w] = _(), E;
989
989
  v(() => {
990
990
  E?.removeEventListener("keydown", Ce, !0), s.panelRef.current === E && (s.panelRef.current = null);
991
991
  });
992
992
  let M = g(() => s.layout);
993
993
  i(x, () => s.themeClassName, M);
994
- let P = g(() => s.filterType), R = g(() => P() === "set"), z = g(() => P() === "numberSet"), B = g(() => P() === "textSet"), U = g(() => P() === "dateSet"), G = g(() => z() || B() || U()), K = g(() => R() || G()), q = g(() => K() || P() === "select"), J = g(() => {
995
- if (!q()) return "ready";
994
+ let P = g(() => s.filterType), R = g(() => P() === "set"), z = g(() => P() === "numberSet"), B = g(() => P() === "textSet"), U = g(() => P() === "dateSet"), W = g(() => z() || B() || U()), K = g(() => R() || W()), te = g(() => K() || P() === "select"), q = g(() => {
995
+ if (!te()) return "ready";
996
996
  let e = s.optionsStatus;
997
997
  return e === "collecting" ? "collecting" : e === "loading" || e === "error" ? "pending" : "ready";
998
- }), ne = g(() => s.optionsStatus === "loading" ? "loading" : "error"), ie = g(() => s.numberConditionDraft ?? te), se = g(() => s.textConditionDraft ?? re), ce = g(() => s.dateConditionDraft ?? le), de = g(() => s.datePresets ?? H(void 0, c())), pe = g(() => z() ? Y(ie()) : null), he = g(() => B() ? ae(se()) : null), ge = g(() => U() ? ue(ce()) : null), _e = g(() => pe() !== null || he() !== null || ge() !== null), ve = g(() => z() ? X(s.selectOptions, pe()) : B() ? oe(s.selectOptions, he()) : U() ? fe(s.selectOptions, ge(), y(), de()) : s.selectOptions), ye = g(() => {
999
- let e = J();
998
+ }), Y = g(() => s.optionsStatus === "loading" ? "loading" : "error"), re = g(() => s.numberConditionDraft ?? J), ae = g(() => s.textConditionDraft ?? ie), ce = g(() => s.dateConditionDraft ?? ue), le = g(() => s.datePresets ?? H(void 0, c())), fe = g(() => z() ? X(re()) : null), me = g(() => B() ? oe(ae()) : null), ge = g(() => U() ? de(ce()) : null), _e = g(() => fe() !== null || me() !== null || ge() !== null), ve = g(() => z() ? ne(s.selectOptions, fe()) : B() ? se(s.selectOptions, me()) : U() ? pe(s.selectOptions, ge(), y(), le()) : s.selectOptions), ye = g(() => {
999
+ let e = q();
1000
1000
  if (e === "collecting") return c().filterOptionsLoadingShort;
1001
- if (e === "pending") return ne() === "loading" ? c().filterOptionsLoadingShort : c().filterOptionsFailedShort;
1001
+ if (e === "pending") return Y() === "loading" ? c().filterOptionsLoadingShort : c().filterOptionsFailedShort;
1002
1002
  }), be = () => F(c().filterCollecting, { percent: Math.round(s.optionsProgress * 100) }), xe = (e) => {
1003
1003
  if (e.stopPropagation(), !I(e)) {
1004
1004
  if (e.key === "Enter") {
@@ -1011,7 +1011,7 @@ function Dt(s) {
1011
1011
  e.stopPropagation(), e.key === "Escape" && !L(e) && !I(e) && (e.preventDefault(), s.onRequestClose());
1012
1012
  }, Ce = (e) => {
1013
1013
  if (t(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || I(e)) return;
1014
- let n = e.currentTarget, r = W(n, e.target instanceof Element ? e.target : null, e.shiftKey);
1014
+ let n = e.currentTarget, r = G(n, e.target instanceof Element ? e.target : null, e.shiftKey);
1015
1015
  r !== null && (e.preventDefault(), r.focus());
1016
1016
  }, we = () => C(m, { get children() {
1017
1017
  return [
@@ -1022,7 +1022,7 @@ function Dt(s) {
1022
1022
  get children() {
1023
1023
  return C(vt, {
1024
1024
  get draft() {
1025
- return ie();
1025
+ return re();
1026
1026
  },
1027
1027
  get valueInputRef() {
1028
1028
  return s.textInputRef;
@@ -1041,7 +1041,7 @@ function Dt(s) {
1041
1041
  get children() {
1042
1042
  return C(bt, {
1043
1043
  get draft() {
1044
- return se();
1044
+ return ae();
1045
1045
  },
1046
1046
  get valueInputRef() {
1047
1047
  return s.textInputRef;
@@ -1070,7 +1070,7 @@ function Dt(s) {
1070
1070
  },
1071
1071
  onKeyDown: xe,
1072
1072
  get presets() {
1073
- return de();
1073
+ return le();
1074
1074
  },
1075
1075
  get renderDateInput() {
1076
1076
  return s.renderDateInput;
@@ -1086,7 +1086,7 @@ function Dt(s) {
1086
1086
  return [
1087
1087
  C(f, {
1088
1088
  get when() {
1089
- return G();
1089
+ return W();
1090
1090
  },
1091
1091
  get children() {
1092
1092
  return C(Et, {
@@ -1119,7 +1119,7 @@ function Dt(s) {
1119
1119
  return [
1120
1120
  C(f, {
1121
1121
  get when() {
1122
- return J() === "collecting";
1122
+ return q() === "collecting";
1123
1123
  },
1124
1124
  get children() {
1125
1125
  var e = Xe();
@@ -1128,12 +1128,12 @@ function Dt(s) {
1128
1128
  }),
1129
1129
  C(f, {
1130
1130
  get when() {
1131
- return J() === "pending";
1131
+ return q() === "pending";
1132
1132
  },
1133
1133
  get children() {
1134
1134
  return C(Ct, {
1135
1135
  get status() {
1136
- return ne();
1136
+ return Y();
1137
1137
  },
1138
1138
  get errorMessage() {
1139
1139
  return s.optionsErrorMessage;
@@ -1219,7 +1219,7 @@ function Dt(s) {
1219
1219
  }),
1220
1220
  C(f, {
1221
1221
  get when() {
1222
- return J() === "collecting";
1222
+ return q() === "collecting";
1223
1223
  },
1224
1224
  get children() {
1225
1225
  var e = Xe();
@@ -1228,12 +1228,12 @@ function Dt(s) {
1228
1228
  }),
1229
1229
  C(f, {
1230
1230
  get when() {
1231
- return J() === "pending";
1231
+ return q() === "pending";
1232
1232
  },
1233
1233
  get children() {
1234
1234
  return C(Ct, {
1235
1235
  get status() {
1236
- return ne();
1236
+ return Y();
1237
1237
  },
1238
1238
  get errorMessage() {
1239
1239
  return s.optionsErrorMessage;
@@ -1287,7 +1287,7 @@ function Dt(s) {
1287
1287
  get children() {
1288
1288
  return C(vt, {
1289
1289
  get draft() {
1290
- return ie();
1290
+ return re();
1291
1291
  },
1292
1292
  get valueInputRef() {
1293
1293
  return s.textInputRef;
@@ -0,0 +1,20 @@
1
+ import type { JSX } from '@solidjs/web';
2
+ import type { GridTheme } from '../model/gridTypes.js';
3
+ import { type CreateGridAskOptions } from './createGridAsk.js';
4
+ export type GridAskBarProps<T> = CreateGridAskOptions<T> & {
5
+ /** 入力欄の下に出す例の文(押すとその文で聞く)。 */
6
+ examples?: readonly string[] | undefined;
7
+ /** 入力欄のプレースホルダー(既定は文言の `placeholder`)。 */
8
+ placeholder?: string | undefined;
9
+ /** 入力欄のラベル(読み上げ用。既定は文言の `label`)。 */
10
+ label?: string | undefined;
11
+ /** バーの root に足すクラス(グリッドの `className` と同じく、React 版と同じ名前)。 */
12
+ className?: string | undefined;
13
+ /** 配色(グリッドの `theme` と同じ値を渡す)。 */
14
+ theme?: GridTheme | undefined;
15
+ };
16
+ /**
17
+ * ことばで絞り込み・並べ替えをする入力欄です(グリッドの上に置く)。AI は利用側の `ask` で呼びます。
18
+ * `grid` にはグリッドのハンドルを返す関数(`() => grid`)か、ハンドルそのものを渡します。
19
+ */
20
+ export declare function GridAskBar<T>(props: GridAskBarProps<T>): JSX.Element;