Built-in filter functions, ported from column-filtering/filterFns.ts.
A FilterFn is a comparison between a cell value and a filter value plus
three helpers that TanStack attaches to every filter fn:
resolveFilterValue normalises the filter value once per filter before
any row is tested (the table does this, not filter).resolveDataValue normalises the cell value before comparison
(filter does this).autoRemove says when a filter value is blank enough that the filter
should be dropped from state.meta, when the filter fn has one, produces the value the filtered row
model records for the row under
Table.rowColumnFiltersMeta. It is
TanStack's addMeta callback turned into a return value.Loose equality ("1" == 1).
Case-insensitive substring match.
Case-sensitive substring match.
Case-insensitive string equality.
Case-sensitive string equality.
Case-insensitive prefix match.
Numeric when both sides parse as numbers, string comparison otherwise.
See greaterThan.
Inclusive range; the filter value is List [ min, max ].
Inclusive numeric range; only Number cells can match.
Inclusive date range on Date cells (or timestamps, or YYYY-MM-DD
strings).
List or String cell includes at least one filter value.
List cell includes every filter value.
List cell includes at least one filter value.
Build a filter fn from a comparison. Resolvers default to identity
and autoRemove defaults to removing Null and the empty string.
Replace the filter-value normaliser.
Replace the cell-value normaliser.
Replace the auto-remove predicate.
Give a filter fn the meta the filtered row model records for every row it
tests, TanStack's addMeta callback.
The function is handed the already resolved cell value and the already
resolved filter value, the same two values filter compares, and
Nothing records nothing for that row. This is how the fuzzy-filter example
stores its match rank and then sorts by it.
Test a raw cell value against an already resolved filter value. The
cell value is passed through resolveDataValue first; the filter value is
not (resolve it once with resolveFilterValue).
Normalise a filter value.
Normalise a cell value.
Should this filter value cause the filter to be dropped?
The filter fn's meta producer, when withMeta gave it one.
Nothing is the common case and lets the filtered row model skip the work
entirely.
toDateTimestamp from filterFns.ts: a Date gives its milliseconds,
a Number passes through, and everything else that is not a parseable date
string gives NaN, which never falls inside a range.
Elm has no new Date(string), so the string form is limited to ISO 8601
YYYY-MM-DD, optionally followed by THH:MM, THH:MM:SS and a Z.
A filter comparison with its resolvers.