@searsuite/sear-plugin-dropdown
Read and change a cell
Cell readers obtain the value and available options from validation-owned rules; clear and pick commands write the chosen value.
- interfaceDropdownCellInput
-
Absolute target cell; all picker reads are editor-local.
property readonly column: numberZero-based column.
property readonly row: numberZero-based row.
- interfaceDropdownCellSnapshot
-
interface DropdownCellSnapshot extends DropdownCellInputImmutable current rule and cell projection.
property readonly inputMessage?: stringSelection prompt from the validation owner.
property readonly multiple: booleanWhether choices accumulate.
property readonly options: readonly DataValidationOption[]Ordered, distinct current choices.
property readonly ruleId: stringStable validation owner id.
property readonly selected: readonly string[]Current selected labels, including values absent from the rule.
property readonly showArrow: booleanWhether the cell shows its arrow.
- variableClearDropdownValueCommand
-
ClearDropdownValueCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>Clears the cell value while retaining validation rules.
- variableReadDropdownCellQuery
-
ReadDropdownCellQuery: SheetQueryDefinition<DropdownCellInput, DropdownCellSnapshot | null>Reads the current dropdown without exposing a feature matrix.
- functionassertDropdownCell
-
assertDropdownCell(input: DropdownCellInput, shape: readonly number[]): voidValidates a cell before any source traversal or mutation.
- functionplanDropdownValue
-
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | nullComputes a selection without mutating state; stale or removed choices fail explicitly.
- functionreadDropdownCell
-
readDropdownCell(input: DropdownCellInput, options: SheetDropdownOptions): DropdownCellSnapshot | nullResolves the last covering dropdown rule and bounded, distinct choices.
- functionformatDropdownSelection
-
formatDropdownSelection(values: readonly string[]): stringSerializes labels without losing embedded commas, quotes or surrounding spaces.
- functionparseDropdownSelection
-
parseDropdownSelection(text: string): string[]Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.
Open the picker
OpenDropdownPickerCommand asks the host to show a picker. The picker request carries the cell and option data it needs.
- classDropdownError
-
class DropdownError extends SearErrorStructured feature diagnostic.
constructor DropdownError(code: DropdownErrorCode, message: string, details?: SearErrorDetails): DropdownErrorCreates a public dropdown diagnostic.
Inherited members 10
Inherited from SearError.
- classSheetDropdownPlugin
-
class SheetDropdownPlugin extends Plugin<unknown, CellProperties, null>Stateless dropdown interaction; rules and values retain their existing document owners.
constructor SheetDropdownPlugin(options: SheetDropdownOptions): SheetDropdownPluginReceives owner-scoped projections and semantic transaction factories.
property readonly depth: -24Handles arrows before ordinary selection.
property readonly warnOnDuplicateDepth: falseSeveral stateless interaction extensions may share depth.
property readonly symbol: typeof symbolstaticEditor-local service token.
method apply(): nullMutations belong to validation and cell owners.
method destroy(): voidReleases transient host subscriptions.
method getPluginConfig(): nullNo independent render configuration.
method onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidActivates the trailing cell arrow through the public command bus.
method onMouseUp(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidKeeps an arrow release from returning focus to the cell text editor.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidAdds viewport-bounded arrows and option color layers without taking fill ownership.
method registerCommands(commands: SheetCommandBus): voidRegisters value changes and a transient picker request command.
method registerObservations(registry: ObservationRegistry): voidHost listener failures are isolated by the editor observation registry.
method registerQueries(queries: SheetQueryRegistry): voidPublishes a typed, current-cell query.
method registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }No duplicate document field is created.
method render(): nullCell visual readers supply all adornments.
Inherited members 26
Inherited from Plugin.
- documentState
- interestedIn
- pluginKey
- transactionHistory
- transactionOT
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseMove
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfacePickDropdownOptionInput
-
interface PickDropdownOptionInput extends DropdownCellInputTarget and choice to set, or toggle in multiple-selection mode.
property readonly label: stringOption label, matched exactly against current choices.
property readonly ruleId?: stringOptional rule identity guards stale picker actions after configuration changes.
- interfaceSheetDropdownOptions
-
Dependencies supplied by the composition root; persistent data stays with its original owners.
property readonly queries: SheetQueryRegistryEditor-local query bus for validation-owner projections.
property readonly validation: SheetCellInputValidationRegistryShared edit validation, including overlapping rules.
method beforeOpen(): booleanCommits active editing before pointer activation; false leaves the edit active.
method createValueTransaction(row: number, column: number, text: string | null): TransactionPlans a text or empty replacement as an ordinary cell-owner transaction.
method forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (value: unknown): void): voidVisits nonempty source values in provider order, including formula projections.
method readShape(): readonly [number, number]Reads dimensions for coordinate validation.
method readText(row: number, column: number): stringReads display text, including formula results and structured cells.
- typeDropdownErrorCode
-
type DropdownErrorCode = typeof DropdownErrorCode[keyof typeof DropdownErrorCode]DropdownErrorCode: { Conflict: "DROPDOWN_CONFLICT"; Invalid: "DROPDOWN_INVALID"; Limit: "DROPDOWN_LIMIT"; Stale: "DROPDOWN_STALE" }One public dropdown error code.
- variableDropdownLimits
-
DropdownLimits: { Options: 1000; SourceValues: 10000 }Shared option and source traversal budgets.
- variableDropdownPickerRequest
-
DropdownPickerRequest: EventObservationDefinition<DropdownCellInput>Transient host request; no document or remount session state is stored.
- variableOpenDropdownPickerCommand
-
OpenDropdownPickerCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>Requests the host picker for one current dropdown cell.
- variablePickDropdownOptionCommand
-
PickDropdownOptionCommand: SheetCommandDefinition<PickDropdownOptionInput, SheetCommandResult>Picks one valid option through a cell-owner transaction.
- variableDropdownMode
-
DropdownMode: { Multiple: "multiple"; Single: "single" }Selection modes for dropdown validation.
- interfaceDropdownOption
-
One displayable dropdown choice and its optional color.
property readonly color?: stringproperty readonly label: string
No matching API entries.