@searsuite/sear-plugin-filter
Filter rules and values
A filter definition names the range and its column rules. Value queries provide the choices shown in a filter menu.
- interfaceReadSheetFilterValuesInput
-
Parameters for a bounded distinct-value query.
property readonly column: numberproperty readonly includeBlank?: booleanIncludes blank cells even when a host's visible blank label matches the search text.
property readonly limit?: numberproperty readonly search?: string - interfaceSheetFilterColumnRule
-
A rule attached to one column within a filter range.
property readonly column: numberZero-based sheet column index.
property readonly predicate: SheetFilterPredicatePredicate applied to values in the column.
- interfaceSheetFilterDefinition
-
Document or private-session filter configuration for one sheet range.
property readonly firstRowIsHeader: booleanWhether the first row is always visible as a header.
property readonly privateView: booleanWhether this definition belongs to the current editor session.
property readonly range: { end: readonly [number, number]; start: readonly [number, number] }Inclusive sheet coordinates covered by the filter.
property readonly rules: readonly SheetFilterColumnRule[]Active column predicates.
- interfaceSheetFilterValueCount
-
One distinct displayed value and its occurrence count.
property readonly count: numberproperty readonly value: string - interfaceSheetFilterValuePage
-
Bounded distinct-value query result for a filter column.
property readonly items: readonly SheetFilterValueCount[]Matching values returned within the requested limit.
property readonly truncated: booleanWhether additional matching values were omitted.
- typeSheetFilterCategory
-
type SheetFilterCategory = typeof SheetFilterCategory[keyof typeof SheetFilterCategory]SheetFilterCategory: { Date: "date"; Number: "number"; Text: "text" }A condition filter's value category.
- typeSheetFilterColorProperty
-
type SheetFilterColorProperty = typeof SheetFilterColorProperty[keyof typeof SheetFilterColorProperty]SheetFilterColorProperty: { Fill: "fill"; Text: "textColor" }A cell visual property used by a color filter.
- typeSheetFilterKind
-
type SheetFilterKind = typeof SheetFilterKind[keyof typeof SheetFilterKind]SheetFilterKind: { Color: "color"; Condition: "condition"; Values: "values" }Supported filter rule kinds.
- typeSheetFilterOperator
-
type SheetFilterOperator = typeof SheetFilterOperator[keyof typeof SheetFilterOperator]SheetFilterOperator: { Between: "between"; Contains: "contains"; EndsWith: "endsWith"; Equal: "equal"; Greater: "greater"; GreaterEqual: "greaterEqual"; Less: "less"; LessEqual: "lessEqual"; … }A comparison operator supported by the filter plugin.
- typeSheetFilterPredicate
-
type SheetFilterPredicate = { excluded?: boolean; kind: typeof SheetFilterKind.Values; values: readonly string[] } | { category: SheetFilterCategory; kind: typeof SheetFilterKind.Condition; operator: SheetFilterOperator; secondValue?: string; value: string } | { color: string | null; kind: typeof SheetFilterKind.Color; property: SheetFilterColorProperty }Serializable rule used to decide whether a row remains visible.
- variableReadSheetFilterQuery
-
ReadSheetFilterQuery: SheetQueryDefinition<void, SheetFilterDefinition | null>Reads the active filter definition.
- variableReadSheetFilterValuesQuery
-
ReadSheetFilterValuesQuery: SheetQueryDefinition<ReadSheetFilterValuesInput, SheetFilterValuePage>Reads a bounded page of distinct displayed values in one column.
- functionsheetFilterValueKey
-
sheetFilterValueKey(value: unknown): stringUses display values for distinct-value selection, including an explicit blank key.
Apply and update filters
CreateSheetFilterCommand installs a filter, SetSheetColumnFilterCommand changes one column, and ReapplySheetFilterCommand refreshes row visibility.
- classSheetFilterMatrix
-
class SheetFilterMatrix extends CSRMatrix<SheetFilterDefinition | null>One sparse anchor holds the current range and its column rules.
constructor SheetFilterMatrix(data?: { data: SheetFilterDefinition | null[]; indices: number[]; indptr: number[] }): SheetFilterMatrixmethod addItem(row: number, column: number, value: SheetFilterDefinition | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
valueThe value to add.
method clone(): thisCreates an independent copy of this value and its mutable data.
method getItem(row: number, column: number): SheetFilterDefinition | nullRetrieves an item from the matrix at the specified row and column.
ReturnsThe item at the specified position or null if not present.
rowThe row index.
Inherited members 32
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetFilterPlugin
-
class SheetFilterPlugin extends Plugin<unknown, CellProperties, SheetFilterPluginState>, SheetRowVisibilityOwns persisted filter rules and a derived, editor-local row visibility view.
constructor SheetFilterPlugin(state: SheetFilterPluginState, dependencies: SheetFilterDependencies): SheetFilterPluginproperty readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>Document-state export modules owned by this plugin state.
property interestedIn: MatrixOTActionName[]Declares which Sheet OT action names this plugin is interested in. The engine will only call
applywhen a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.['uc', 'rr', 'rc']— only called for UpdateCell, ResizeRow, ResizeCol['*']— called for any transaction (wildcard)[]— only called for this plugin's own transactions
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Shared transaction algebra used by history and collaboration.
property readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
property readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>staticproperty readonly pluginKey: PluginKeystaticproperty readonly symbol: typeof symbolstaticmemberactive active: unknownmemberversion version: unknownmethod apply(state: SheetFilterPluginState, transaction: Transaction): SheetFilterPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
method dispose(): voidmethod getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
method isRowFiltered(row: number): booleanmethod onTransactionCommitted(transaction: Transaction): voidRuns only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.
transactionA committed transaction from the completed pipeline.
method registerCommands(commands: SheetCommandBus): voidmethod registerQueries(queries: SheetQueryRegistry): voidmethod registerSessionState(registry: SessionStateRegistry): voidmethod registerState(): { dataEngine: { dataView: { fieldKey: string; select: (): SheetRowVisibility; viewKey: string }[] }; key: PluginKey; state: SheetFilterPluginState }Registers one or more plugin-owned state records with the host manager.
method render(): []Produces scene nodes owned by this plugin for the current core state.
Inherited members 24
Inherited from Plugin.
- depth
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceCreateSheetFilterInput
-
Sheet range and header policy for a new filter or private view.
property readonly firstRowIsHeader?: booleanTreat the first row as a header when true.
property readonly range: { end: readonly [number, number]; start: readonly [number, number] }Inclusive range to filter.
- interfaceSetSheetColumnFilterInput
-
Sets or clears a predicate for one column.
- interfaceSheetFilterDependencies
-
interface SheetFilterDependencies extends Omit<SheetFilterCommandSource, "target" | "readMatrix" | "readActiveDefinition" | "readPrivateDefinition" | "setPrivateDefinition" | "normalizeSearch">Host-neutral dependencies supplied by a Sheet composition root.
property readonly dataTarget?: PluginKeyproperty readonly displayedValueChanges?: Pick<SheetDisplayedValueChanges, "subscribe">property readonly invalidateVisibilityAggregates?: (): voidproperty readonly parseDate?: (value: unknown): number | nullproperty readonly platform: Pick<Platform, "toLowerCase">property readonly readColor: (row: number, column: number, property: "fill" | "textColor"): string | nullproperty readonly requestRenderAll?: (): voidInherited members 4
- renderKeys
- forEachStoredInRange
- readShape
- readValue
- interfaceSheetFilterPluginState
-
Persisted state owned by the filter plugin.
- variableClearSheetFilterCommand
-
ClearSheetFilterCommand: SheetCommandDefinition<void, SheetCommandResult>Clears the active filter or private view.
- variableCreateSheetFilterCommand
-
CreateSheetFilterCommand: SheetCommandDefinition<CreateSheetFilterInput, SheetCommandResult>Creates a document-owned filter range.
- variableCreateSheetFilterViewCommand
-
CreateSheetFilterViewCommand: SheetCommandDefinition<CreateSheetFilterInput, SheetCommandResult>Creates a session-owned filter view.
- variableReapplySheetFilterCommand
-
ReapplySheetFilterCommand: SheetCommandDefinition<void, SheetCommandResult>Recomputes visibility for the active filter.
- variableSetSheetColumnFilterCommand
-
SetSheetColumnFilterCommand: SheetCommandDefinition<SetSheetColumnFilterInput, SheetCommandResult>Replaces or clears one column predicate.
- variableSheetFilterViewSessionStateDefinition
-
SheetFilterViewSessionStateDefinition: SessionStateDefinition<SheetFilterDefinition | null>Session-state contribution for a private filter view.
- variableSheetRowVisibilityFieldKey
-
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"Neutral field contract re-exported by the plugin that owns the contribution.
- functionparseSheetFilterNumber
-
parseSheetFilterNumber(value: unknown): number | nullParses a finite decimal value for numeric filter conditions.
No matching API entries.