@sheetwrite/coreinterface
Retained lifecycle returned by a custom editor's mount method.
- Package
@sheetwrite/core- Source
packages/core/src/types/grid.ts#L90
Members 5
update
update(context: CellEditorContextinterface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput: string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(value: string, navigation?: CellEditorNavigation): void;
cancel(): void;
}interface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput: string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(value: string, navigation?: CellEditorNavigation): void;
cancel(): void;
}interface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput:
string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(
value: string,
navigation?: CellEditorNavigation,
): void;
cancel(): void;
}Immutable state and guarded completion callbacks for one mounted editor.API reference →): void;reposition
reposition(rect: CellEditorRectinterface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}interface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}interface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}Viewport-relative geometry of the cell currently owned by an editor.API reference →): void;commit
commit(navigation: CellEditorNavigationtype CellEditorNavigation = "down" | "right" | "left" | "none";type CellEditorNavigation = "down" | "right" | "left" | "none";type CellEditorNavigation =
| "down"
| "right"
| "left"
| "none";Selection movement applied after a successful editor commit.API reference →): string | undefined | Promise<string | undefined>;cancel
cancel(): void;destroy
destroy(): void;Declaration
View full TypeScript declaration
export interface CellEditorInstance { update(context: CellEditorContextinterface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput: string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(value: string, navigation?: CellEditorNavigation): void;
cancel(): void;
}interface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput: string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(value: string, navigation?: CellEditorNavigation): void;
cancel(): void;
}interface CellEditorContext {
readonly grid: Grid;
readonly address: Readonly<CellAddress>;
readonly viewAddress: Readonly<CellAddress>;
readonly column: Readonly<Column>;
readonly value: CellScalar;
readonly text: string;
readonly initialInput:
string | undefined;
readonly selectAll: boolean;
readonly label: string;
readonly signal: AbortSignal;
commit(
value: string,
navigation?: CellEditorNavigation,
): void;
cancel(): void;
}Immutable state and guarded completion callbacks for one mounted editor.API reference →): void; reposition(rect: CellEditorRectinterface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}interface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}interface CellEditorRect {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}Viewport-relative geometry of the cell currently owned by an editor.API reference →): void; commit( navigation: CellEditorNavigationtype CellEditorNavigation = "down" | "right" | "left" | "none";type CellEditorNavigation = "down" | "right" | "left" | "none";type CellEditorNavigation =
| "down"
| "right"
| "left"
| "none";Selection movement applied after a successful editor commit.API reference →, ): string | undefined | Promise<string | undefined>; cancel(): void; destroy(): void;}