← All packages

@searsuite/sear-plugin-checkbox

Checkbox values

CheckboxCell stores a boolean cell value and its commit strategy interprets checkbox input.

classCheckboxCell
class CheckboxCell extends Cell<CellProperties<boolean>>

Renders a centered symbol while leaving the rest of the cell available for selection.

constructorCheckboxCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): CheckboxCell
methodgetDisplayText(): string

Preserves boolean editor, auto-size and plain-text semantics.

methodrender(): FixBoxNode<CellProperties<boolean>>

Creates a glyph only for well-formed boolean values.

Inherited members 4

Inherited from Cell.

classCheckboxCellCommitStrategy
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinition

Retains checkbox identity for boolean edits, including cells governed by checkbox validation.

constructorCheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategy

Creates a target predicate owned by the current editor.

propertyreadonly key: "checkbox"

Stable editor-local strategy identity.

propertyreadonly priority: 1100

Runs before numeric/formula/string fallbacks, only for checkbox targets.

methodcommit(context: CellCommitContext): { type: "string"; value: string } | { type: string; value: boolean } | null

Produces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.

methodmatches(context: CellCommitContext): boolean

Reports whether this strategy owns the target's edit semantics.

classCheckboxCellTypeDefinition
class CheckboxCellTypeDefinition extends CellTypeDefinition

Atomic catalog contribution for rendering, editing, display and clipboard behavior.

constructorCheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinition

Binds rule-aware edit conversion to one editor.

propertyreadonly type: "checkbox"

Persisted feature identifier.

methodcreateClipboardCodec(): { cellType: string; decode: (data: unknown): { type: string; value: boolean } | null; encode: (cell: { value?: unknown }): { value: unknown }; toPlainText: (cell: { value?: unknown }): string }

Preserves checkbox identity on native copies; plain text remains TRUE/FALSE.

methodcreateCommitStrategies(): CheckboxCellCommitStrategy[]

Creates the checkbox edit strategy.

methodcreateDisplayTextProvider(): { cellType: string; getDisplayText: (cell: { value?: unknown }): string }

Provides stable boolean text for searches and measurements.

methodcreateRenderer(): CellRendererDefinition

Registers portable glyph rendering.

methodisStoredValue(cell: { value?: unknown }): boolean

Validates persisted booleans before creating a glyph.

Inherited members 1

Inherited from CellTypeDefinition.

classCheckboxError
class CheckboxError extends SearError

Checkbox-specific public error with structured context.

Inherited members 10

Inherited from SearError.

interfaceCheckboxCellValue
interface CheckboxCellValue extends CellMatrixElement

A checkbox's persisted boolean state.

propertytype: "checkbox"

Feature-owned cell identifier.

propertyvalue: boolean

Boolean used directly by formula semantics.

Inherited members 2

Inherited from CellMatrixElement.

interfaceCheckboxCellWrite

Planned update owned by the ordinary cell-data plugin.

propertyreadonly cell: CellMatrixElement | null

Replacement cell; null clears it.

propertyreadonly column: number

Absolute column.

propertyreadonly row: number

Absolute row.

typeCheckboxErrorCode
type CheckboxErrorCode = typeof CheckboxErrorCode[keyof typeof CheckboxErrorCode] CheckboxErrorCode: { Conflict: "CHECKBOX_CONTENT_CONFLICT"; Invalid: "CHECKBOX_INVALID"; Limit: "CHECKBOX_RANGE_LIMIT" }

One checkbox diagnostic identity.

typeCheckboxRemovalMode
type CheckboxRemovalMode = typeof CheckboxRemovalMode[keyof typeof CheckboxRemovalMode] CheckboxRemovalMode: { Clear: "clear"; Text: "text" }

One supported removal policy.

variableCheckboxCellType
CheckboxCellType: "checkbox"

Stable persisted identifier owned by the checkbox extension.

variableCheckboxMutationLimit
CheckboxMutationLimit: 10000

Maximum number of persisted cells one checkbox command can change.

functioncheckboxText
checkboxText(value: boolean): string

Formats the boolean display, editor and clipboard representation.

functionisCheckboxCell
isCheckboxCell(cell: CellMatrixElement | null | undefined): cell

Reports whether a persisted value is a well-formed checkbox.

functionparseCheckboxText
parseCheckboxText(text: string): boolean | null

Converts explicit boolean editor text without coercing numbers or other strings.

Edit checkboxes

classCheckboxGlyphNode
class CheckboxGlyphNode extends FixBoxNode<CellProperties<boolean>>

Portable checkbox symbol; its own bounds are the pointer hit region.

constructorCheckboxGlyphNode(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): CheckboxGlyphNode

Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.

props

Partial properties and position for initialization.

methoddrawScene(context: RenderContext, _clip?: ClipRegion): void

Paints the symbol using paths supported by every render adapter.

Inherited members 42

Inherited from FixBoxNode.

classSheetCheckboxPlugin
class SheetCheckboxPlugin extends Plugin<unknown, CellProperties, null>

Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.

constructorSheetCheckboxPlugin(options: SheetCheckboxOptions): SheetCheckboxPlugin

Installs all type capabilities atomically into the owning editor's registries.

propertyreadonly depth: -25

Intercepts glyph hits before selection and text editing.

propertyreadonly warnOnDuplicateDepth: false

Stateless input features need no duplicate-depth warning.

propertyreadonly symbol: typeof symbolstatic

Editor-local DI token.

methodapply(): null

The feature never owns or directly applies cell state.

methoddestroy(): void

Restores all replaced capabilities and releases handlers idempotently.

methodgetPluginConfig(): null

No render configuration is contributed.

methodonDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Consumes glyph double-clicks so they do not enter text editing.

methodonMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Changes a glyph through typed selection and toggle commands, never through direct matrix mutation.

methodregisterCommands(commands: SheetCommandBus): void

Registers owner-targeted commands; each change is one staged cell transaction.

methodregisterQueries(queries: SheetQueryRegistry): void

Publishes sparse range-state reads.

methodregisterState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

No independent document state is registered.

methodrender(): null

Glyphs are rendered by the catalog's ordinary cell renderer.

Inherited members 26

Inherited from Plugin.

interfaceCheckboxRangeStatus

Read-only aggregate of existing checkbox states.

propertyreadonly checked: number

Checked checkbox count.

propertyreadonly count: number

Well-formed checkbox count.

propertyreadonly mixed: boolean

Whether both states occur in the range.

propertyreadonly unchecked: number

Unchecked checkbox count.

interfaceInsertCheckboxesInput
interface InsertCheckboxesInput extends SheetRangeInput

Converts empty or explicit boolean cells; replacement of other content requires opt-in.

propertyreadonly checked?: boolean

Optional forced initial state; otherwise existing boolean states are retained.

propertyreadonly replaceExisting?: boolean

Explicitly replace other persisted content.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetCheckboxOptions

Editor-local dependencies; checkbox state stays in the cell-data owner.

propertyreadonly catalog: CellTypeCatalog

Cell-type extension catalog.

propertyreadonly cursor?: CursorRegistry

Optional editor-local cursor registry.

propertyreadonly formulas?: CellFormulaValueConverterRegistry

Formula converter registry, when formula support is installed.

propertyreadonly inputValidation?: SheetCellInputValidationRegistry

Shared cell-edit validation registry.

methodbeforeToggle(): boolean

Allows the composition root to commit or reject an active edit before pointer toggling.

methodcreateTransaction(writes: readonly CheckboxCellWrite[]): Transaction

Creates a semantic cell-owner transaction without mutating live data.

methodforEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): void

Visits persisted sparse entries inside the inclusive selection.

methodhasCheckboxRule(row: number, column: number): boolean

Reports a checkbox validation rule, including cells currently showing warning text.

methodisMergedCoveredCell(row: number, column: number): boolean

True when a merged range hides this coordinate behind its anchor.

methodreadCell(row: number, column: number): CellMatrixElement | null

Reads current persisted cell values.

methodreadShape(): readonly [number, number]

Reads current Sheet dimensions.

methodvalidateValue(row: number, column: number, text: string): { message?: string; reject: boolean }

Rejects incompatible existing validation on direct checkbox commands.

variableCheckboxGlyphRole
CheckboxGlyphRole: { Checked: "checked"; Unchecked: "unchecked" }

Stable semantic state roles used by checkbox render targets and diagnostics.

variableInsertCheckboxesCommand
InsertCheckboxesCommand: SheetCommandDefinition<InsertCheckboxesInput, SheetCommandResult>

Inserts checkbox cells in one cell-owner transaction.

variableReadCheckboxRangeQuery
ReadCheckboxRangeQuery: SheetQueryDefinition<SheetRangeInput, CheckboxRangeStatus>

Reads sparse checkbox state without traversing every empty coordinate.

variableRemoveCheckboxesCommand
RemoveCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { mode?: CheckboxRemovalMode }, SheetCommandResult>

Converts only existing checkbox cells to text or clears them.

variableSetCheckboxesCommand
SetCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { checked: boolean }, SheetCommandResult>

Sets only existing checkbox cells in the range.

variableToggleCheckboxesCommand
ToggleCheckboxesCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>

Checks a mixed/unchecked range, or unchecks an entirely checked range.

functionnormalizeCheckboxRange
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInput

Validates and orders a public range without limiting sparse read traversal by viewport.