@ishibashi0112/spreadsheet-grid 1.4.0 → 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 +1 -1
- package/dist/CellEditorLayer.d.ts +3 -1
- package/dist/editors/CustomCellEditor.d.ts +3 -1
- package/dist/hooks/useGridEditController.d.ts +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.js +1500 -1481
- package/dist/lite/createSpreadsheetGrid-D4KNp4aG.cjs +6 -0
- package/dist/lite/createSpreadsheetGrid-DYVCimWp.js +4372 -0
- package/dist/lite/createSpreadsheetGrid.cjs +1 -1
- package/dist/lite/createSpreadsheetGrid.js +1 -1
- package/dist/lite.cjs +1 -1
- package/dist/lite.js +1 -1
- package/dist/view/DetailToggleButton.d.ts +2 -1
- package/package.json +2 -2
- package/dist/lite/createSpreadsheetGrid-CJinhQgY.js +0 -4353
- package/dist/lite/createSpreadsheetGrid-CQDpzjaZ.cjs +0 -6
package/API_REFERENCE.md
CHANGED
|
@@ -1189,7 +1189,7 @@ const columns: GridColumn<Expense>[] = [
|
|
|
1189
1189
|
| `'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 を書く) |
|
|
1190
1190
|
| `'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」)も解釈不可。翌月へ繰り越さない) |
|
|
1191
1191
|
| `'checkbox'` | **直接トグル**(編集セッションなし)。チェックボックスそのものを押すか、アクティブセルで Space を押すと即トグル(セルのチェックボックスの外を押したときはアクティブセルになるだけ。ダブルクリックでも切り替わらない)。Enter / F2 / ダブルクリックではエディタが開かない | `checkedValue`(既定 `true`)/ `uncheckedValue`(既定 `false`)。checked 判定は `Object.is(value, checkedValue)` のみ | `''`→unchecked / checked・unchecked の文字列表現→対応値 / `'true'`・`'1'`→checked / その他→unchecked |
|
|
1192
|
-
| `'custom'` | `render(ctx)` の返り値を編集オーバーレイ内に描画。**フォーカス管理・キーバインドは利用側の責務**(
|
|
1192
|
+
| `'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 から) | パススルー |
|
|
1193
1193
|
|
|
1194
1194
|
注意点:
|
|
1195
1195
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorCommitDirection, EditorCommitResult, EditorEnterMove, GridColumn, GridColumnEditor, GridRowKey } from './model/gridTypes.js';
|
|
2
2
|
import type { GridResolvedSlots } from './model/gridTypes.js';
|
|
3
|
+
import type { LateEditCommitReceiver } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/editController';
|
|
3
4
|
export type { EditorCommitDirection };
|
|
4
5
|
type CellEditorRect = {
|
|
5
6
|
left: number;
|
|
@@ -29,10 +30,11 @@ type CellEditorLayerProps<T> = {
|
|
|
29
30
|
onCommit: (value: unknown, direction?: EditorCommitDirection) => EditorCommitResult | void;
|
|
30
31
|
onCancel: () => void;
|
|
31
32
|
onRegisterFlush?: ((flush: (() => void) | null) => void) | undefined;
|
|
33
|
+
onRegisterLateCommit?: ((receiver: LateEditCommitReceiver) => () => void) | undefined;
|
|
32
34
|
align?: 'left' | 'center' | 'right';
|
|
33
35
|
enterMove?: EditorEnterMove;
|
|
34
36
|
domId?: string;
|
|
35
37
|
alignTop?: boolean;
|
|
36
38
|
};
|
|
37
|
-
export declare function CellEditorLayer<T>({ rect, headerHeight, leadingWidth, baseOffset, initialValue, editor, editorSession, themeClassName, slots, onCommit, onCancel, onRegisterFlush, align, enterMove, domId, alignTop, }: CellEditorLayerProps<T>): import("react").JSX.Element | null;
|
|
39
|
+
export declare function CellEditorLayer<T>({ rect, headerHeight, leadingWidth, baseOffset, initialValue, editor, editorSession, themeClassName, slots, onCommit, onCancel, onRegisterFlush, onRegisterLateCommit, align, enterMove, domId, alignTop, }: CellEditorLayerProps<T>): import("react").JSX.Element | null;
|
|
38
40
|
export default CellEditorLayer;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { CellEditorContext } from '../model/gridTypes.js';
|
|
3
|
+
import type { LateEditCommitReceiver } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/editController';
|
|
3
4
|
type CustomCellEditorProps<T> = {
|
|
4
5
|
render: (ctx: CellEditorContext<T>) => ReactNode;
|
|
5
6
|
context: CellEditorContext<T> | null;
|
|
6
7
|
onRegisterFlush?: ((flush: (() => void) | null) => void) | undefined;
|
|
8
|
+
onRegisterLateCommit?: ((receiver: LateEditCommitReceiver) => () => void) | undefined;
|
|
7
9
|
};
|
|
8
|
-
export declare function CustomCellEditor<T>({ render, context, onRegisterFlush, }: CustomCellEditorProps<T>): import("react").JSX.Element | null;
|
|
10
|
+
export declare function CustomCellEditor<T>({ render, context, onRegisterFlush, onRegisterLateCommit, }: CustomCellEditorProps<T>): import("react").JSX.Element | null;
|
|
9
11
|
export default CustomCellEditor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EditControllerArgs } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/editController';
|
|
2
|
-
export declare const useGridEditController: <T extends object>(args: EditControllerArgs<T>) => {
|
|
1
|
+
import { type EditController, type EditControllerArgs } from '@ishibashi0112/spreadsheet-grid-core/internal/controllers/editController';
|
|
2
|
+
export declare const useGridEditController: <T extends object>(args: EditControllerArgs<T>, created?: EditController<T>) => {
|
|
3
3
|
activateSingleCell: (cell: import("@ishibashi0112/spreadsheet-grid-core").CellCoord) => void;
|
|
4
4
|
startEditWithValue: (cell: import("@ishibashi0112/spreadsheet-grid-core").CellCoord, initialValue: string) => void;
|
|
5
5
|
commitEdit: (committedValue: unknown, direction?: import("@ishibashi0112/spreadsheet-grid-core").EditorCommitDirection) => import("@ishibashi0112/spreadsheet-grid-core").EditorCommitResult;
|