@ishibashi0112/spreadsheet-grid-solid 1.13.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 (35) hide show
  1. package/API_REFERENCE.md +228 -16
  2. package/README.md +10 -8
  3. package/dist/{ColumnFilterPopover-t32VGfTq.js → ColumnFilterPopover-DYnfyUTm.js} +40 -41
  4. package/dist/ai.d.ts +2 -0
  5. package/dist/ai.js +48 -47
  6. package/dist/devWarnings.d.ts +1 -0
  7. package/dist/features/pagination.d.ts +2 -0
  8. package/dist/features/types.d.ts +7 -0
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.js +3611 -3312
  11. package/dist/inputValue-Dvxw-RUC.js +69 -0
  12. package/dist/primitives/rowDrag.d.ts +1 -0
  13. package/dist/primitives/serverSide.d.ts +2 -1
  14. package/dist/source/ai.jsx +3 -0
  15. package/dist/source/chunks/{ColumnFilterPopover-JL3HPGXY.jsx → ColumnFilterPopover-7COSTSPD.jsx} +2 -4
  16. package/dist/source/chunks/{chunk-AI3CSPI3.jsx → chunk-D4IAL3ZE.jsx} +43 -1
  17. package/dist/source/chunks/{toolPanelViews-N6TGBFFW.jsx → toolPanelViews-WBFE4QVY.jsx} +2 -4
  18. package/dist/source/index.jsx +926 -477
  19. package/dist/style.css +1 -1
  20. package/dist/style.layer.css +1 -1
  21. package/dist/{toolPanelViews-CPYtBTQP.js → toolPanelViews-BgEAIDpk.js} +35 -36
  22. package/dist/view/DefaultGridBottomBar.d.ts +3 -0
  23. package/dist/view/DefaultGridTopBar.d.ts +1 -0
  24. package/dist/view/GridBodyGroupRow.d.ts +1 -0
  25. package/dist/view/GridBodyLabelRow.d.ts +1 -0
  26. package/dist/view/GridBodyLayer.d.ts +1 -0
  27. package/dist/view/GridBodySkeletonRow.d.ts +2 -0
  28. package/dist/view/GridPager.d.ts +9 -0
  29. package/dist/view/GridScrollHint.d.ts +2 -0
  30. package/dist/view/GridStickyLabelLayer.d.ts +1 -0
  31. package/package.json +3 -3
  32. package/skills/spreadsheet-grid-solid/SKILL.md +5 -1
  33. package/dist/inputValue-C6BHBMBx.js +0 -24
  34. package/dist/portalTokens-LgUwLYnR.js +0 -47
  35. package/dist/source/chunks/chunk-WLXZT66B.jsx +0 -44
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)** (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)
5
+ **[Docs & live demo](https://datasheet-grid.vercel.app/en)** (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. See [installation](https://datasheet-grid.vercel.app/en/docs/solid/installation) · [notes for Solid](https://datasheet-grid.vercel.app/en/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 ([CSS](https://datasheet-grid.vercel.app/docs/css), [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/en/docs/css), [design systems](https://datasheet-grid.vercel.app/en/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 247KB gzip of initial JS; the column filter popover, the tool panel and the calendar, about 18KB, load later). `createSpreadsheetGrid` builds a grid with only the features you pass, and the rest is left out of your bundle (about 120KB with no features, about 150KB 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 257KB gzip of initial JS; the column filter popover, the tool panel and the calendar, about 18KB, load later). `createSpreadsheetGrid` builds a grid with only the features you pass, and the rest is left out of your bundle (about 128KB with no features, about 157KB 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'
@@ -67,7 +67,8 @@ The feature names and what they enable are listed in the bundled `API_REFERENCE.
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
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)).
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/en/docs/guides/ai-filter)).
71
+ - **Tools for AI agents (`/ai`, 1.14.0+).** `createGridAgentTools` and `registerGridAgentTools` come from the same entry and work as in the React version; pass the grid as `grid: () => grid` ([AI agent guide](https://datasheet-grid.vercel.app/en/docs/guides/ai-agent)).
71
72
  - **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
73
  - 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
74
 
@@ -100,11 +101,11 @@ This library is new, so AI coding assistants rarely know its API and tend to gue
100
101
  - **State is controlled.** Edits come back through `onRowsChange` as a new array; pass that array back to `rows` as-is (re-creating it, e.g. with `map`, clears the undo history).
101
102
  - **Row keys.** Return a stable key from `rowKeyGetter` (the default is the row index).
102
103
  - **Height.** Use the `height` prop. A value containing `%` 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`.
103
- - **Positions are view positions.** `viewRowIndex` / `colIndex` are positions after sorting and filtering. Look them up with `getViewRowIndex(rowKey)` / `getColIndex(columnKey)`.
104
+ - **Positions are view positions.** `viewRowIndex` / `colIndex` are positions after sorting and filtering. Look them up with `getViewRowIndex(rowKey)` / `getColIndex(columnKey)`. With pagination (`pagination`) row positions are still continuous across all pages (not positions within the current page).
104
105
 
105
106
  ## Versioning
106
107
 
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`.
108
+ 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/en/docs/versioning)). 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`.
108
109
 
109
110
  ## License
110
111
 
@@ -128,13 +129,14 @@ Solid 2.0 向けの仮想化スプレッドシート / データグリッドで
128
129
 
129
130
  ### 機能を選んで組み込む
130
131
 
131
- `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 247KB gzip。列フィルターのポップオーバーとツールパネル・カレンダーの約 18KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 120KB、プリセット `standardFeatures` で約 150KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
132
+ `SpreadsheetGrid` は全機能入りです(初期読み込みの JS が約 257KB gzip。列フィルターのポップオーバーとツールパネル・カレンダーの約 18KB は後から読みます)。`createSpreadsheetGrid` では渡した機能だけを入れたグリッドを作れ、渡さなかった機能はバンドルに入りません(機能なしで約 128KB、プリセット `standardFeatures` で約 157KB)。React 版と違い、機能の部品も同じ入口から import します(`/lite` はありません)。機能の名前と中身は同梱の `API_REFERENCE.md` の「機能を選んで組み込む」のとおりです(部品の名前も React 版と同じ)。グリッドはコンポーネントの中ではなく、モジュールの先頭で 1 回だけ作ってください。
132
133
 
133
134
  ### React 版との違い
134
135
 
135
136
  - **`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
137
  - **描く関数は必要なときだけ呼びます。** `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
138
  - **ことばで絞り込み(`/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))。
139
+ - **AI エージェントの道具(`/ai`、1.14.0 から)。** `createGridAgentTools` と `registerGridAgentTools` も同じ入口から import し、React 版と同じに使えます。グリッドは `grid: () => grid` で渡します([AI エージェントに表を操作させる](https://datasheet-grid.vercel.app/docs/guides/ai-agent))。
138
140
  - **速さ。** スクロールと編集は React 版とほぼ同じです。2026-11-28 に本番ビルドの Chromium で測ると、100 万行の `Ctrl+End` は React 版と同じくらい、約 200 列の表で縦に大きく飛ぶときの JS の時間は React 版より短く(約 0.6 倍)、少しずつのスクロールは約 1.2 倍、横に大きく飛ぶときは約 1.5 倍で、約 200 列の表ではメモリが約 3.5MB 多くなります(見えているセルごとに Solid の計算をいくつか持つため。描く範囲だけが変わったときは、行の要素とセルの部品を使い回して中身だけを書き換えます)。
139
141
  - そのほか(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
142
 
@@ -167,7 +169,7 @@ Solid 2.0 向けの仮想化スプレッドシート / データグリッドで
167
169
  - **状態は controlled。** 編集結果は `onRowsChange` が新しい配列で返します。受け取った配列をそのまま `rows` へ戻してください(`map` 等で作り直すと undo 履歴が消えます)。
168
170
  - **行キー。** `rowKeyGetter` で安定したキーを返してください(既定は行 index)。
169
171
  - **高さ。** `height` prop で指定します。`%` を含む値はバーを含むグリッド全体の高さで、親要素に確定高さが必要です。数値はスクロール領域だけの高さです。`height` 未指定時のスクロール領域は `480px` が上限です。
170
- - **位置は表示の位置。** `viewRowIndex` / `colIndex` は並べ替え・絞り込みの後の表示の位置です。`getViewRowIndex(rowKey)` / `getColIndex(columnKey)` で引いてください。
172
+ - **位置は表示の位置。** `viewRowIndex` / `colIndex` は並べ替え・絞り込みの後の表示の位置です。`getViewRowIndex(rowKey)` / `getColIndex(columnKey)` で引いてください。ページ送り(`pagination`)の表でも行の位置は全ページの通し番号です(今のページの中の番号ではありません)。
171
173
 
172
174
  ### バージョンの方針
173
175
 
@@ -1,7 +1,6 @@
1
1
  import { a as e } from "./localeText-CCqvpkYM.js";
2
2
  import { n as t, r as n, t as r } from "./columnVirtualizer-DdL7-ijS.js";
3
- import { i, o as a, r as o, t as s } from "./portalTokens-LgUwLYnR.js";
4
- import { n as c, r as l, t as u } from "./inputValue-C6BHBMBx.js";
3
+ import { i, l as a, n as o, o as s, r as c, s as l, t as u } from "./inputValue-Dvxw-RUC.js";
5
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";
6
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";
7
6
  import { formatLocaleText as F } from "@ishibashi0112/spreadsheet-grid-core/internal/logic/localeText";
@@ -25,11 +24,11 @@ import { buildCalendarDayCells as _e, buildYearGrid as ve, formatFilterDateDispl
25
24
  //#region src/view/FilterDateField.tsx
26
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>");
27
26
  function De(t) {
28
- let n = e(), [r, i] = _(null), [a, o] = _(!1), [s, c] = _(!1), [u, f] = _("days"), [p, m] = _((/* @__PURE__ */ new Date()).getFullYear()), [b, x] = _((/* @__PURE__ */ new Date()).getMonth()), S, w = !1;
27
+ let n = e(), [r, i] = _(null), [a, o] = _(!1), [s, l] = _(!1), [u, f] = _("days"), [p, m] = _((/* @__PURE__ */ new Date()).getFullYear()), [b, x] = _((/* @__PURE__ */ new Date()).getMonth()), S, w = !1;
29
28
  v(() => {
30
29
  w = !0, t.inputRef && t.inputRef.current === E && (t.inputRef.current = null);
31
30
  });
32
- let E, k = g(() => r() ?? ye(t.value)), M = () => R(/* @__PURE__ */ new Date()) ?? "", ee = l(k), P = () => {
31
+ let E, k = g(() => r() ?? ye(t.value)), M = () => R(/* @__PURE__ */ new Date()) ?? "", ee = c(k), P = () => {
33
32
  let e = y(r);
34
33
  if (e === null) return;
35
34
  let n = e.trim();
@@ -45,9 +44,9 @@ function De(t) {
45
44
  t.onCommit(a), i(null), o(!1);
46
45
  }, L = () => {
47
46
  let [e, n] = (t.value === "" ? M() : t.value).split("-");
48
- m(Number(e)), x(Number(n) - 1), f("days"), c(!0);
47
+ m(Number(e)), x(Number(n) - 1), f("days"), l(!0);
49
48
  }, V = () => {
50
- c(!1);
49
+ l(!1);
51
50
  }, H = (e) => {
52
51
  t.onCommit(e), i(null), o(!1), V();
53
52
  };
@@ -55,7 +54,7 @@ function De(t) {
55
54
  if (!e) return;
56
55
  let t = (e) => {
57
56
  let t = B(e, S ?? null);
58
- t && S?.contains(t) || c(!1);
57
+ t && S?.contains(t) || l(!1);
59
58
  };
60
59
  return document.addEventListener("pointerdown", t, !0), () => {
61
60
  document.removeEventListener("pointerdown", t, !0);
@@ -310,7 +309,7 @@ function ht() {
310
309
  }
311
310
  var gt = (e, t, n) => t === 0 ? n ? e.filterNoOptionsSource : e.noOptions : e.filterNoMatches;
312
311
  function _t(t) {
313
- let n = e(), [i, o] = _(""), s = g(() => dt(t.options, n().blank)), l = g(() => K(s(), i())), f = g(() => i().trim().length > 0), p, m = lt(), h = r(() => ({
312
+ let n = e(), [i, s] = _(""), c = g(() => dt(t.options, n().blank)), l = g(() => K(c(), i())), f = g(() => i().trim().length > 0), p, m = lt(), h = r(() => ({
314
313
  count: l().length,
315
314
  getScrollElement: () => p ?? null,
316
315
  estimateSize: () => m,
@@ -333,7 +332,7 @@ function _t(t) {
333
332
  return r;
334
333
  }), w = g(() => l().length > 0 && S() === l().length), k = g(() => S() > 0 && !w()), N = g(() => new Set(t.options.map((e) => e.value))), ee = g(() => mt(t.setSelection, N(), t.options.length)), P = () => {
335
334
  t.onSelectAllChange(y(f) || t.selectAllUsesExplicitScope ? y(l).map((e) => e.value) : "all", !y(w));
336
- }, L = c(k), R = ot(() => t.searchInputRef);
335
+ }, L = o(k), R = ot(() => t.searchInputRef);
337
336
  return [
338
337
  (() => {
339
338
  var e = ke();
@@ -341,11 +340,11 @@ function _t(t) {
341
340
  if (e.stopPropagation(), e.key === "Escape" && (e.preventDefault(), t.onRequestClose()), e.key === "Enter") {
342
341
  if (I(e)) return;
343
342
  e.preventDefault();
344
- let n = te(y(s), e.currentTarget.value);
343
+ let n = te(y(c), e.currentTarget.value);
345
344
  if (n.kind === "none") return;
346
345
  n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
347
346
  }
348
- }, e._$$input = (e) => o(e.currentTarget.value), A(() => R, e), T(() => ({
347
+ }, e._$$input = (e) => s(e.currentTarget.value), A(() => R, e), T(() => ({
349
348
  e: n().filterSearchPlaceholder,
350
349
  t: n().filterSearchPlaceholder
351
350
  }), ({ e: t, t: n }, r) => {
@@ -408,7 +407,7 @@ function _t(t) {
408
407
  ];
409
408
  }
410
409
  function vt(t) {
411
- let n = e(), r = g(() => re(t.draft.operator)), i = l(() => t.draft.operator);
410
+ let n = e(), r = g(() => re(t.draft.operator)), i = c(() => t.draft.operator);
412
411
  return [(() => {
413
412
  var e = Ie();
414
413
  return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
@@ -483,7 +482,7 @@ function vt(t) {
483
482
  })())];
484
483
  }
485
484
  function yt(e) {
486
- let t = l(() => e.value()), n = ot(() => e.inputRef);
485
+ let t = c(() => e.value()), n = ot(() => e.inputRef);
487
486
  var r = Ve();
488
487
  return x(r, "keydown", e.onKeyDown, !0), r.addEventListener("compositionend", (t) => e.onCommit(t.currentTarget.value)), r._$$input = (t) => e.onChange(t.currentTarget.value, t), A(() => (e) => {
489
488
  n(e), t(e);
@@ -496,7 +495,7 @@ function yt(e) {
496
495
  }), r;
497
496
  }
498
497
  function bt(t) {
499
- let n = e(), r = g(() => ce(t.draft.operator)), i = l(() => t.draft.operator);
498
+ let n = e(), r = g(() => ce(t.draft.operator)), i = c(() => t.draft.operator);
500
499
  return [(() => {
501
500
  var e = Ie();
502
501
  return x(e, "keydown", t.onKeyDown, !0), e.addEventListener("change", (e) => t.onDraftChange({
@@ -544,7 +543,7 @@ function bt(t) {
544
543
  })())];
545
544
  }
546
545
  function xt(t) {
547
- let n = e(), r = g(() => t.draft.preset === null ? fe(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 = c(() => t.draft.operator), a = (e, n) => {
548
547
  t.onDraftChange({
549
548
  ...t.draft,
550
549
  [e]: me(n),
@@ -564,7 +563,7 @@ function xt(t) {
564
563
  },
565
564
  slot: e
566
565
  }));
567
- }, s = g(() => r() === 2 ? "from" : "single"), c = (e) => {
566
+ }, s = g(() => r() === 2 ? "from" : "single"), l = (e) => {
568
567
  t.onDraftChange({
569
568
  ...t.draft,
570
569
  preset: t.draft.preset === e ? null : e
@@ -676,7 +675,7 @@ function xt(t) {
676
675
  return N(n, [
677
676
  { type: "button" },
678
677
  () => $((t) => {
679
- c(e().id), W(t);
678
+ l(e().id), W(t);
680
679
  }),
681
680
  { get class() {
682
681
  return ["ssg-filter-preset-chip", { "ssg-filter-preset-chip--active": t.draft.preset === e().id }];
@@ -688,7 +687,7 @@ function xt(t) {
688
687
  ];
689
688
  }
690
689
  function St(t) {
691
- let n = e(), [i, o] = _(""), [s, l] = _(/* @__PURE__ */ new Set()), f = g(() => i().trim().length > 0), p = g(() => dt(t.options, n().blank)), m = g(() => K(p(), i())), h = g(() => ge(t.options, s(), n())), v, b = g(() => f() ? m().length : h().length), S = lt(), w = r(() => ({
690
+ let n = e(), [i, s] = _(""), [c, l] = _(/* @__PURE__ */ new Set()), f = g(() => i().trim().length > 0), p = g(() => dt(t.options, n().blank)), m = g(() => K(p(), i())), h = g(() => ge(t.options, c(), n())), v, b = g(() => f() ? m().length : h().length), S = lt(), w = r(() => ({
692
691
  count: b(),
693
692
  getScrollElement: () => v ?? null,
694
693
  estimateSize: () => S,
@@ -735,8 +734,8 @@ function St(t) {
735
734
  }
736
735
  let n = y(() => t.setSelection), r = e.leafKeys.length > 0 && W(e.leafKeys, n) === e.leafKeys.length;
737
736
  t.onSelectAllChange(e.leafKeys, !r);
738
- }, J = c(B), Y = ot(() => t.searchInputRef), X = (e) => {
739
- let r = g(() => W(e.row().leafKeys, t.setSelection)), i = g(() => e.row().leafKeys.length > 0 && r() === e.row().leafKeys.length), a = g(() => r() > 0 && !i()), o = c(a), s = () => ut(e.row().key, e.row().label, n().blank);
737
+ }, J = o(B), Y = ot(() => t.searchInputRef), X = (e) => {
738
+ let r = g(() => W(e.row().leafKeys, t.setSelection)), i = g(() => e.row().leafKeys.length > 0 && r() === e.row().leafKeys.length), a = g(() => r() > 0 && !i()), s = o(a), c = () => ut(e.row().key, e.row().label, n().blank);
740
739
  return [
741
740
  O(() => O(() => e.row().type === "group")() ? (() => {
742
741
  var t = Q();
@@ -753,9 +752,9 @@ function St(t) {
753
752
  })() : Ke()),
754
753
  (() => {
755
754
  var t = We();
756
- return x(t, "change", u(a, () => G(y(e.row)))), A(() => o, t), T(() => ({
755
+ return x(t, "change", u(a, () => G(y(e.row)))), A(() => s, t), T(() => ({
757
756
  e: i(),
758
- t: s(),
757
+ t: c(),
759
758
  a: E()
760
759
  }), ({ e, t: n, a: r }, i) => {
761
760
  (e !== i?.e || !r) && (t.checked = e), n !== i?.t && j(t, "aria-label", n);
@@ -763,7 +762,7 @@ function St(t) {
763
762
  })(),
764
763
  (() => {
765
764
  var e = Ge();
766
- return D(e, s), e;
765
+ return D(e, c), e;
767
766
  })()
768
767
  ];
769
768
  };
@@ -778,7 +777,7 @@ function St(t) {
778
777
  if (n.kind === "none") return;
779
778
  n.kind === "replace" && t.onReplaceSelection(n.values), t.onRequestClose();
780
779
  }
781
- }, e._$$input = (e) => o(e.currentTarget.value), A(() => Y, e), T(() => ({
780
+ }, e._$$input = (e) => s(e.currentTarget.value), A(() => Y, e), T(() => ({
782
781
  e: n().filterSearchPlaceholder,
783
782
  t: n().filterSearchPlaceholder
784
783
  }), ({ e: t, t: n }, r) => {
@@ -890,7 +889,7 @@ function Ct(t) {
890
889
  })());
891
890
  }
892
891
  function wt(t) {
893
- let n = e(), r = l(() => t.draftValue), i = ot(() => t.selectRef);
892
+ let n = e(), r = c(() => t.draftValue), i = ot(() => t.selectRef);
894
893
  return [(() => {
895
894
  var e = Qe(), a = e.firstChild;
896
895
  return e._$$keydown = (e) => {
@@ -921,7 +920,7 @@ function wt(t) {
921
920
  })()];
922
921
  }
923
922
  function Tt(t) {
924
- let n = e(), r = l(() => t.draftValue), i = ot(() => t.textInputRef);
923
+ let n = e(), r = c(() => t.draftValue), i = ot(() => t.textInputRef);
925
924
  return [(() => {
926
925
  var e = Ve();
927
926
  return e._$$keydown = (e) => {
@@ -984,23 +983,23 @@ function Et(t) {
984
983
  ];
985
984
  }
986
985
  function Dt(r) {
987
- let c = e(), l = o().container(), u = { current: null }, d = /* @__PURE__ */ new Date(), p = V();
986
+ let o = e(), c = s().container(), u = { current: null }, d = /* @__PURE__ */ new Date(), p = V();
988
987
  t(p, () => ({ active: r.filterType === "dateSet" && (r.dateConditionDraft?.preset ?? null) !== null }), "render", "filterDateRollover");
989
988
  let h = n(p, "filterDateRolloverStore"), y = () => he(d, h()), [x, w] = _(), E;
990
989
  v(() => {
991
990
  E?.removeEventListener("keydown", Ce, !0), r.panelRef.current === E && (r.panelRef.current = null);
992
991
  });
993
992
  let M = g(() => r.layout);
994
- s(x, () => r.themeClassName, M);
993
+ i(x, () => r.themeClassName, M);
995
994
  let P = g(() => r.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(() => {
996
995
  if (!te()) return "ready";
997
996
  let e = r.optionsStatus;
998
997
  return e === "collecting" ? "collecting" : e === "loading" || e === "error" ? "pending" : "ready";
999
- }), Y = g(() => r.optionsStatus === "loading" ? "loading" : "error"), re = g(() => r.numberConditionDraft ?? J), ae = g(() => r.textConditionDraft ?? ie), ce = g(() => r.dateConditionDraft ?? ue), le = g(() => r.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(r.selectOptions, fe()) : B() ? se(r.selectOptions, me()) : U() ? pe(r.selectOptions, ge(), y(), le()) : r.selectOptions), ye = g(() => {
998
+ }), Y = g(() => r.optionsStatus === "loading" ? "loading" : "error"), re = g(() => r.numberConditionDraft ?? J), ae = g(() => r.textConditionDraft ?? ie), ce = g(() => r.dateConditionDraft ?? ue), le = g(() => r.datePresets ?? H(void 0, o())), 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(r.selectOptions, fe()) : B() ? se(r.selectOptions, me()) : U() ? pe(r.selectOptions, ge(), y(), le()) : r.selectOptions), ye = g(() => {
1000
999
  let e = q();
1001
- if (e === "collecting") return c().filterOptionsLoadingShort;
1002
- if (e === "pending") return Y() === "loading" ? c().filterOptionsLoadingShort : c().filterOptionsFailedShort;
1003
- }), be = () => F(c().filterCollecting, { percent: Math.round(r.optionsProgress * 100) }), xe = (e) => {
1000
+ if (e === "collecting") return o().filterOptionsLoadingShort;
1001
+ if (e === "pending") return Y() === "loading" ? o().filterOptionsLoadingShort : o().filterOptionsFailedShort;
1002
+ }), be = () => F(o().filterCollecting, { percent: Math.round(r.optionsProgress * 100) }), xe = (e) => {
1004
1003
  if (e.stopPropagation(), !I(e)) {
1005
1004
  if (e.key === "Enter") {
1006
1005
  e.preventDefault(), r.onApply();
@@ -1011,7 +1010,7 @@ function Dt(r) {
1011
1010
  }, Se = (e) => {
1012
1011
  e.stopPropagation(), e.key === "Escape" && !L(e) && !I(e) && (e.preventDefault(), r.onRequestClose());
1013
1012
  }, Ce = (e) => {
1014
- if (i(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || I(e)) return;
1013
+ if (l(e) !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || I(e)) return;
1015
1014
  let t = e.currentTarget, n = G(t, e.target instanceof Element ? e.target : null, e.shiftKey);
1016
1015
  n !== null && (e.preventDefault(), n.focus());
1017
1016
  }, we = () => C(m, { get children() {
@@ -1353,15 +1352,15 @@ function Dt(r) {
1353
1352
  }
1354
1353
  })
1355
1354
  ];
1356
- } }), Z = () => F(c().filterTitle, { column: r.title }), Ee = () => ({
1355
+ } }), Z = () => F(o().filterTitle, { column: r.title }), Ee = () => ({
1357
1356
  ...r.popoverSlot?.style,
1358
1357
  top: a(M().top),
1359
1358
  left: a(M().left),
1360
1359
  width: a(M().width),
1361
1360
  "max-height": a(M().maxHeight)
1362
1361
  });
1363
- return l ? C(b, {
1364
- mount: l,
1362
+ return c ? C(b, {
1363
+ mount: c,
1365
1364
  get children() {
1366
1365
  var e = at(), t = e.firstChild, n = t.nextSibling, i = n.nextSibling;
1367
1366
  return e._$$keydown = Se, e._$$pointerdown = (e) => e.stopPropagation(), A(() => (e) => {
@@ -1370,7 +1369,7 @@ function Dt(r) {
1370
1369
  var e = O(() => !K());
1371
1370
  return () => e() ? (() => {
1372
1371
  var e = et();
1373
- return D(e, () => F(c().filterCurrentValue, { value: r.currentValueText })), e;
1372
+ return D(e, () => F(o().filterCurrentValue, { value: r.currentValueText })), e;
1374
1373
  })() : void 0;
1375
1374
  })(), i), D(i, (() => {
1376
1375
  var e = O(() => !!K());
@@ -1380,28 +1379,28 @@ function Dt(r) {
1380
1379
  { type: "button" },
1381
1380
  () => $(() => r.onSetClear()),
1382
1381
  { class: "ssg-filter-btn-secondary" }
1383
- ], !0), D(e, () => c().clear), e;
1382
+ ], !0), D(e, () => o().clear), e;
1384
1383
  })(), (() => {
1385
1384
  var e = Q();
1386
1385
  return N(e, [
1387
1386
  { type: "button" },
1388
1387
  () => $(() => r.onRequestClose()),
1389
1388
  { class: "ssg-filter-btn-primary" }
1390
- ], !0), D(e, () => c().close), e;
1389
+ ], !0), D(e, () => o().close), e;
1391
1390
  })()] : [(() => {
1392
1391
  var e = Q();
1393
1392
  return N(e, [
1394
1393
  { type: "button" },
1395
1394
  () => $(() => r.onClear()),
1396
1395
  { class: "ssg-filter-btn-secondary" }
1397
- ], !0), D(e, () => c().clear), e;
1396
+ ], !0), D(e, () => o().clear), e;
1398
1397
  })(), (() => {
1399
1398
  var e = Q();
1400
1399
  return N(e, [
1401
1400
  { type: "button" },
1402
1401
  () => $(() => r.onApply()),
1403
1402
  { class: "ssg-filter-btn-primary" }
1404
- ], !0), D(e, () => c().apply), e;
1403
+ ], !0), D(e, () => o().apply), e;
1405
1404
  })()];
1406
1405
  })()), T(() => ({
1407
1406
  e: k([
package/dist/ai.d.ts CHANGED
@@ -4,4 +4,6 @@ export { createGridAsk } from './ai/createGridAsk.js';
4
4
  export type { CreateGridAskOptions, CreateGridAskResult, GridAsk, GridAskApplyEvent, GridAskSession, GridAskTarget, } from './ai/createGridAsk.js';
5
5
  export { createGridAskRequest, describeGridAskView, gridAskSystemPrompt, isGridAskColumnsChanged, isSameGridAskView, readGridAskAnswer, removeGridAskItem, } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAsk';
6
6
  export type { GridAskAnswer, GridAskFilter, GridAskItem, GridAskOp, GridAskOptions, GridAskRequest, GridAskResult, GridAskSort, } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAsk';
7
+ export { createGridAgentTools, registerGridAgentTools } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAgentTools';
8
+ export type { GridAgentConfirmRequest, GridAgentExecuteOptions, GridAgentTarget, GridAgentTool, GridAgentToolAnnotations, GridAgentToolCall, GridAgentToolDefinition, GridAgentToolOutput, GridAgentTools, GridAgentToolsOptions, } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAgentTools';
7
9
  export type { GridAskLocaleText } from '@ishibashi0112/spreadsheet-grid-core/internal/logic/gridAskLocaleText';