@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.
constructor CheckboxCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): CheckboxCellmethod getDisplayText(): stringPreserves boolean editor, auto-size and plain-text semantics.
method render(): FixBoxNode<CellProperties<boolean>>Creates a glyph only for well-formed boolean values.
- classCheckboxCellCommitStrategy
-
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinitionRetains checkbox identity for boolean edits, including cells governed by checkbox validation.
constructor CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategyCreates a target predicate owned by the current editor.
property readonly key: "checkbox"Stable editor-local strategy identity.
property readonly priority: 1100Runs before numeric/formula/string fallbacks, only for checkbox targets.
method commit(context: CellCommitContext): { type: "string"; value: string } | { type: string; value: boolean } | nullProduces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.
method matches(context: CellCommitContext): booleanReports whether this strategy owns the target's edit semantics.
- classCheckboxCellTypeDefinition
-
class CheckboxCellTypeDefinition extends CellTypeDefinitionAtomic catalog contribution for rendering, editing, display and clipboard behavior.
constructor CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinitionBinds rule-aware edit conversion to one editor.
property readonly type: "checkbox"Persisted feature identifier.
method createClipboardCodec(): { 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.
method createCommitStrategies(): CheckboxCellCommitStrategy[]Creates the checkbox edit strategy.
method createDisplayTextProvider(): { cellType: string; getDisplayText: (cell: { value?: unknown }): string }Provides stable boolean text for searches and measurements.
method createRenderer(): CellRendererDefinitionRegisters portable glyph rendering.
method isStoredValue(cell: { value?: unknown }): booleanValidates persisted booleans before creating a glyph.
- classCheckboxError
-
class CheckboxError extends SearErrorCheckbox-specific public error with structured context.
constructor CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxErrorCreates a feature diagnostic.
Inherited members 10
Inherited from SearError.
- interfaceCheckboxCellValue
-
interface CheckboxCellValue extends CellMatrixElementA checkbox's persisted boolean state.
property type: "checkbox"Feature-owned cell identifier.
property value: booleanBoolean used directly by formula semantics.
- interfaceCheckboxCellWrite
-
Planned update owned by the ordinary cell-data plugin.
property readonly cell: CellMatrixElement | nullReplacement cell; null clears it.
property readonly column: numberAbsolute column.
property readonly row: numberAbsolute 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: 10000Maximum number of persisted cells one checkbox command can change.
- functioncheckboxText
-
checkboxText(value: boolean): stringFormats the boolean display, editor and clipboard representation.
- functionisCheckboxCell
-
isCheckboxCell(cell: CellMatrixElement | null | undefined): cellReports whether a persisted value is a well-formed checkbox.
- functionparseCheckboxText
-
parseCheckboxText(text: string): boolean | nullConverts 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.
constructor CheckboxGlyphNode(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): CheckboxGlyphNodeConstructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
method drawScene(context: RenderContext, _clip?: ClipRegion): voidPaints the symbol using paths supported by every render adapter.
Inherited members 42
Inherited from FixBoxNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classSheetCheckboxPlugin
-
class SheetCheckboxPlugin extends Plugin<unknown, CellProperties, null>Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.
constructor SheetCheckboxPlugin(options: SheetCheckboxOptions): SheetCheckboxPluginInstalls all type capabilities atomically into the owning editor's registries.
property readonly depth: -25Intercepts glyph hits before selection and text editing.
property readonly warnOnDuplicateDepth: falseStateless input features need no duplicate-depth warning.
property readonly symbol: typeof symbolstaticEditor-local DI token.
method apply(): nullThe feature never owns or directly applies cell state.
method destroy(): voidRestores all replaced capabilities and releases handlers idempotently.
method getPluginConfig(): nullNo render configuration is contributed.
method onDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidConsumes glyph double-clicks so they do not enter text editing.
method onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidChanges a glyph through typed selection and toggle commands, never through direct matrix mutation.
method registerCommands(commands: SheetCommandBus): voidRegisters owner-targeted commands; each change is one staged cell transaction.
method registerQueries(queries: SheetQueryRegistry): voidPublishes sparse range-state reads.
method registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }No independent document state is registered.
method render(): nullGlyphs are rendered by the catalog's ordinary cell renderer.
Inherited members 26
Inherited from Plugin.
- documentState
- interestedIn
- pluginKey
- transactionHistory
- transactionOT
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onInitialDataCell
- onInitialDataComplete
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceCheckboxRangeStatus
-
Read-only aggregate of existing checkbox states.
property readonly checked: numberChecked checkbox count.
property readonly count: numberWell-formed checkbox count.
property readonly mixed: booleanWhether both states occur in the range.
property readonly unchecked: numberUnchecked checkbox count.
- interfaceInsertCheckboxesInput
-
interface InsertCheckboxesInput extends SheetRangeInputConverts empty or explicit boolean cells; replacement of other content requires opt-in.
property readonly checked?: booleanOptional forced initial state; otherwise existing boolean states are retained.
property readonly replaceExisting?: booleanExplicitly replace other persisted content.
- interfaceSheetCheckboxOptions
-
Editor-local dependencies; checkbox state stays in the cell-data owner.
property readonly catalog: CellTypeCatalogCell-type extension catalog.
property readonly cursor?: CursorRegistryOptional editor-local cursor registry.
property readonly formulas?: CellFormulaValueConverterRegistryFormula converter registry, when formula support is installed.
property readonly inputValidation?: SheetCellInputValidationRegistryShared cell-edit validation registry.
method beforeToggle(): booleanAllows the composition root to commit or reject an active edit before pointer toggling.
method createTransaction(writes: readonly CheckboxCellWrite[]): TransactionCreates a semantic cell-owner transaction without mutating live data.
method forEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): voidVisits persisted sparse entries inside the inclusive selection.
method hasCheckboxRule(row: number, column: number): booleanReports a checkbox validation rule, including cells currently showing warning text.
method isMergedCoveredCell(row: number, column: number): booleanTrue when a merged range hides this coordinate behind its anchor.
method readCell(row: number, column: number): CellMatrixElement | nullReads current persisted cell values.
method readShape(): readonly [number, number]Reads current Sheet dimensions.
method validateValue(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]): SheetRangeInputValidates and orders a public range without limiting sparse read traversal by viewport.
No matching API entries.