← All packages

API reference

@searsuite/sear-plugin-dropdown

Optional dropdown cell interactions over validation-owned rules.

21 exportsderived from source

classDropdownErrorsource ↗
class DropdownError extends SearError

Structured feature diagnostic.

constructorconstructor
DropdownError(code: DropdownErrorCode, message: string, details?: SearErrorDetails): DropdownError

Creates a public dropdown diagnostic.

code: DropdownErrorCode
message: string
details: SearErrorDetails
Inherited members 10

Inherited from SearError.

classSheetDropdownPluginsource ↗
class SheetDropdownPlugin extends Plugin<unknown, CellProperties, null>

Stateless dropdown interaction; rules and values retain their existing document owners.

constructorconstructor
SheetDropdownPlugin(options: SheetDropdownOptions): SheetDropdownPlugin

Receives owner-scoped projections and semantic transaction factories.

options: SheetDropdownOptions
propertydepth
readonly depth: -24

Handles arrows before ordinary selection.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Several stateless interaction extensions may share depth.

propertysymbolstatic
readonly symbol: typeof symbol

Editor-local service token.

methodapply
apply(): null

Mutations belong to validation and cell owners.

methoddestroy
destroy(): void

Releases transient host subscriptions.

methodgetPluginConfig
getPluginConfig(): null

No independent render configuration.

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

Activates the trailing cell arrow through the public command bus.

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

Keeps an arrow release from returning focus to the cell text editor.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Adds viewport-bounded arrows and option color layers without taking fill ownership.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers value changes and a transient picker request command.

commands: SheetCommandBus
methodregisterObservations
registerObservations(registry: ObservationRegistry): void

Host listener failures are isolated by the editor observation registry.

registry: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Publishes a typed, current-cell query.

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

No duplicate document field is created.

methodrender
render(): null

Cell visual readers supply all adornments.

Inherited members 26

Inherited from Plugin.

interfaceDropdownCellInputsource ↗
interface DropdownCellInput

Absolute target cell; all picker reads are editor-local.

propertycolumn
readonly column: number

Zero-based column.

propertyrow
readonly row: number

Zero-based row.

interfaceDropdownCellSnapshotsource ↗
interface DropdownCellSnapshot extends DropdownCellInput

Immutable current rule and cell projection.

propertyinputMessage
readonly inputMessage?: string

Selection prompt from the validation owner.

propertymultiple
readonly multiple: boolean

Whether choices accumulate.

propertyoptions
readonly options: readonly DataValidationOption[]

Ordered, distinct current choices.

propertyruleId
readonly ruleId: string

Stable validation owner id.

propertyselected
readonly selected: readonly string[]

Current selected labels, including values absent from the rule.

propertyshowArrow
readonly showArrow: boolean

Whether the cell shows its arrow.

Inherited members 2

Inherited from DropdownCellInput.

interfacePickDropdownOptionInputsource ↗
interface PickDropdownOptionInput extends DropdownCellInput

Target and choice to set, or toggle in multiple-selection mode.

propertylabel
readonly label: string

Option label, matched exactly against current choices.

propertyruleId
readonly ruleId?: string

Optional rule identity guards stale picker actions after configuration changes.

Inherited members 2

Inherited from DropdownCellInput.

interfaceSheetDropdownOptionssource ↗
interface SheetDropdownOptions

Dependencies supplied by the composition root; persistent data stays with its original owners.

propertyqueries
readonly queries: SheetQueryRegistry

Editor-local query bus for validation-owner projections.

propertyvalidation
readonly validation: SheetCellInputValidationRegistry

Shared edit validation, including overlapping rules.

methodbeforeOpen
beforeOpen(): boolean

Commits active editing before pointer activation; false leaves the edit active.

methodcreateValueTransaction
createValueTransaction(row: number, column: number, text: string | null): Transaction

Plans a text or empty replacement as an ordinary cell-owner transaction.

row: number
column: number
text: string | null
methodforEachSourceValue
forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (value: unknown): void): void

Visits nonempty source values in provider order, including formula projections.

start: readonly [number, number]
end: readonly [number, number]
visit: (value: unknown): void
methodreadShape
readShape(): readonly [number, number]

Reads dimensions for coordinate validation.

methodreadText
readText(row: number, column: number): string

Reads display text, including formula results and structured cells.

row: number
column: number
typeDropdownErrorCodesource ↗
type DropdownErrorCode = typeof DropdownErrorCode[keyof typeof DropdownErrorCode]

One public dropdown error code.

variableClearDropdownValueCommandsource ↗
ClearDropdownValueCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>

Clears the cell value while retaining validation rules.

variableDropdownErrorCodesource ↗
DropdownErrorCode: { Conflict: "DROPDOWN_CONFLICT"; Invalid: "DROPDOWN_INVALID"; Limit: "DROPDOWN_LIMIT"; Stale: "DROPDOWN_STALE" }

Stable dropdown diagnostic codes.

variableDropdownLimitssource ↗
DropdownLimits: { Options: 1000; SourceValues: 10000 }

Shared option and source traversal budgets.

variableDropdownPickerRequestsource ↗
DropdownPickerRequest: EventObservationDefinition<DropdownCellInput>

Transient host request; no document or remount session state is stored.

variableOpenDropdownPickerCommandsource ↗
OpenDropdownPickerCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>

Requests the host picker for one current dropdown cell.

variablePickDropdownOptionCommandsource ↗
PickDropdownOptionCommand: SheetCommandDefinition<PickDropdownOptionInput, SheetCommandResult>

Picks one valid option through a cell-owner transaction.

variableReadDropdownCellQuerysource ↗
ReadDropdownCellQuery: SheetQueryDefinition<DropdownCellInput, DropdownCellSnapshot | null>

Reads the current dropdown without exposing a feature matrix.

functionassertDropdownCellsource ↗
assertDropdownCell(input: DropdownCellInput, shape: readonly number[]): void

Validates a cell before any source traversal or mutation.

input: DropdownCellInput
shape: readonly number[]
functionplanDropdownValuesource ↗
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | null

Computes a selection without mutating state; stale or removed choices fail explicitly.

state: DropdownCellSnapshot | null
input: PickDropdownOptionInput
functionreadDropdownCellsource ↗
readDropdownCell(input: DropdownCellInput, options: SheetDropdownOptions): DropdownCellSnapshot | null

Resolves the last covering dropdown rule and bounded, distinct choices.

input: DropdownCellInput
options: SheetDropdownOptions
variableDropdownModesource ↗
DropdownMode: { Multiple: "multiple"; Single: "single" }

Selection modes for dropdown validation.

interfaceDropdownOptionsource ↗
interface DropdownOption

One displayable dropdown choice and its optional color.

propertycolor
readonly color?: string
propertylabel
readonly label: string
functionformatDropdownSelectionsource ↗
formatDropdownSelection(values: readonly string[]): string

Serializes labels without losing embedded commas, quotes or surrounding spaces.

values: readonly string[]
functionparseDropdownSelectionsource ↗
parseDropdownSelection(text: string): string[]

Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.

text: string