Filter utils
evaluateFilter, evaluateFilterExpression, advancedFilterFn: generated from the source of active-grid.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Functions, hooks and constants#
(cellValue: unknown, filter: FilterValue, presentation?: GridPresentation, dateSemantic?: GridDateSemantic) => booleanEvaluate a filter expression tree against a row.
Recursively evaluates FilterGroup nodes using AND/OR combinators and FilterCondition leaf nodes using the existing evaluate.
An incomplete condition, and a group holding only incomplete conditions, is left out of its group rather than counted as a match or a miss: AND and OR judge the remaining children, and a group with none left matches every row. The no-value operators (is, is) are complete as they stand.
<TData>(row: TData, expression: FilterExpressionNode, getFieldValue: (row: TData, field: string) => unknown, presentation?: GridPresentation, dateSemanticOf?: (field: string) => GridDateSemantic | undefined) => booleanA predicate a column's filter may be set to directly.
THREE parameters, and the arity is the contract. The engine calls a filter with a fourth argument of its own — a callback that records filter metadata on the row — so any trailing parameter declared here is filled by that callback rather than by a caller. Do not add a presentation parameter here: it would receive that callback.
The presentation-bound form is create.
(row: { getValue: (id: string) => unknown; }, columnId: string, filterValue: unknown) => booleanFields of row
The object it takes.
- Type
(id: string) => unknown