Skip to content

Filter

FilterCaptions (Extended from @revolist/revogrid)

Section titled “FilterCaptions (Extended from @revolist/revogrid)”
interface FilterCaptions {
/**
* The title of the selection filter
*/
selectionTitle: string;
/**
* Placeholder for the selection filter search input.
*/
selectionSearchPlaceholder: string;
/**
* The title of the slider filter
*/
sliderTitle: string;
/**
* The title of the date filter
*/
dateTitle: string;
/**
* The popup header title before the column name.
*/
popupHeaderTitle: string;
/**
* The popup header separator between title and column name.
*/
popupHeaderSeparator: string;
/**
* Formats the popup header column name from the full column data.
*/
popupHeaderColumnName: (column: ShowData) => string;
/**
* Accessible label for the popup header filter icon when the column has active filters.
*/
popupHeaderActive: string;
/**
* The popup header close icon accessible label and title.
*/
popupHeaderClose: string;
/**
* The button label for opening the Pro expression filter editor.
*/
expressionButton: string;
/**
* The title shown above the expression editor.
*/
expressionTitle: string;
/**
* Placeholder text for the expression editor.
*/
expressionPlaceholder: string;
/**
* Accessible label for applying expression text immediately.
*/
expressionApply: string;
/**
* Label shown before expression validation errors.
* @deprecated Expression validation details are now shown in the expression tooltip.
*/
expressionInvalid: string
}

ColumnFilterConfig (Extended from @revolist/revogrid)

Section titled “ColumnFilterConfig (Extended from @revolist/revogrid)”
interface ColumnFilterConfig {
/**
* The configuration for the selection filter
*/
selection?: SelectionConfig;
/**
* The configuration for the slider filter.
*
* @example
* ```ts
* grid.filter = {
* slider: {
* showRangeDisplay: true,
* showRangeInputs: true,
* formatInputValue: value => value.toFixed(2),
* parseInputValue: value => Number(value.replace(',', '.')),
* },
* };
* ```
*/
slider?: Pick<
RangeSliderProps,
'showTooltips' | 'showRangeDisplay' | 'showRangeInputs' | 'formatValue' | 'formatInputValue' | 'parseInputValue'
>;
/**
* The configuration for the Pro advanced filter popup header.
*/
popupHeader?: FilterPopupHeaderConfig;
/**
* Opt-in current-column expression editor for advanced filters.
* When enabled, the popup appends an expandable expression panel below the regular filter controls.
* Valid expressions compile into the existing `multiFilterItems` filter model.
*
* @example
* ```ts
* grid.filter = {
* expressions: {
* enabled: true,
* applyDebounceMs: 300,
* errorTooltipLabel: 'Expression validation details',
* formatDiagnostic: diagnostic => translateExpressionDiagnostic(diagnostic),
* },
* };
* ```
*/
expressions?: boolean | ExpressionFilterConfig
}
export function defineAdvancedFilterConfig(
config: AdvancedFilterConfig,
): ColumnFilterConfig;

AdvancedFilterConfig (Extended from index.ts)

Section titled “AdvancedFilterConfig (Extended from index.ts)”
export type AdvancedFilterConfig = Omit<ColumnFilterConfig, 'localization'> & {
localization?: AdvancedFilterLocalization;
};

AdvancedFilterLocalization (Extended from index.ts)

Section titled “AdvancedFilterLocalization (Extended from index.ts)”
export type AdvancedFilterLocalization = Partial<Omit<CoreFilterLocalization, 'filterNames'>> & {
filterNames?: Partial<CoreFilterLocalization['filterNames']>;
};

Plugins The AdvanceFilterPlugin extends the filtering capabilities of a RevoGrid component by introducing advanced, customizable filter options, such as selection and range-based filters. This plugin enhances the grid’s filter functionality, allowing users to interact with and manipulate data effectively.

Key Features:

  • Custom Filters: Introduces custom filter types including selection and slider for more flexible data filtering. These filters allow users to select specific values or define a range for filtering data.
  • Event Integration: Listens for BEFORE_HEADER_RENDER_EVENT to determine the applicability of filters for a given column, ensuring that only relevant filters are displayed.
  • Dynamic Content Rendering: Uses a HyperFunc to dynamically render filter UI components in the grid’s header, including a RangeSlider component and selection list rendering.
  • Enhanced Filter Management: Provides methods to manage excluded values from filters and to generate selection lists based on current data, facilitating complex filter interactions.

Usage:

  • Integrate AdvanceFilterPlugin into a RevoGrid instance to enable advanced filtering features. Add the plugin to the grid’s plugins array during initialization.
import { AdvanceFilterPlugin } from '@revolist/revogrid-pro'
const grid = document.createElement('revo-grid');
grid.plugins = [AdvanceFilterPlugin];

This plugin is essential for applications that require sophisticated filtering mechanisms, enabling users to perform more nuanced data queries and enhancing the overall data exploration experience.

  • Optional FilterPlugin: Replaces an existing core FilterPlugin while preserving its filter configuration.
class AdvanceFilterPlugin {
initConfig(config: ColumnFilterConfig);
beforeshow(data: ShowData): void;
async headerclick(...args: Parameters<FilterPlugin['headerclick']>);
async onFilterChange(filterItems: Parameters<FilterPlugin['onFilterChange']>[0]);
async doFiltering(...args: Parameters<FilterPlugin['doFiltering']>);
isSelectionCascadeEnabled();
getContextAwareSelectionList(
columnProp: ColumnProp,
exlude = new Set<string>(),
sourceRowTypes?: DimensionRows[],
);
getExcludedValues(columnProp: ColumnProp);
getSelectionList(
columnProp: ColumnProp,
exlude = new Set<string>(),
sourceRowTypes?: DimensionRows[],
):;
destroy();
}

export function getStartOfToday(): Date;

export function getStartOfYesterday(): Date;

export function getStartOfThisMonth(): Date;

export function getStartOfLastMonth(): Date;

export function getStartOfThisQuarter(): Date;

export function getStartOfThisYear(): Date;

export function getExtraByOperator(operator: DateFilterOperator): ExtraField | undefined;

FILTER_DATE: string;

filterOperators: DateFilterOperator[];

export type DateFilterOperatorWithDatePickerExtra =
| 'equals'
| 'before'
| 'after'
| 'onOrBefore'
| 'onOrAfter'
| 'notEqual';

export type DateFilterOperatorWithDateRangeExtra = 'between';

export type DateFilterOperator =
| 'notEqual'
| 'isEmpty'
| 'isNotEmpty'
| 'today'
| 'yesterday'
| 'last7Days'
| 'thisMonth'
| 'lastMonth'
| 'thisQuarter'
| 'nextQuarter'
| 'previousQuarter'
| 'thisYear'
| 'nextYear'
| 'previousYear'
| DateFilterOperatorWithDatePickerExtra
| DateFilterOperatorWithDateRangeExtra;

interface DateRangeValue {
operator: DateFilterOperator;
fromDate?: string;
toDate?: string
}

DATE_FILTERS: Record<DateFilterOperator, CustomFilter<any, LogicFunctionExtraParam>>;

export type SliderRange = { fromValue: number; toValue: number };

Props for the RangeSlider component.

The slider keeps its own visual controls synchronized with optional editable inputs. Use formatInputValue and parseInputValue together when the input text must follow a custom number format, such as comma decimals.

Example:

* ```ts
* slider: {
* showRangeInputs: true,
* formatValue: value => value.toFixed(2),
* formatInputValue: value => value.toFixed(2).replace('.', ','),
* parseInputValue: value => Number(value.replace(',', '.')),
* }
* ```
interface RangeSliderProps {
/** Minimum value for the range */
min: number;
/** Maximum value for the range */
max: number;
/** Current value for the start of the range */
fromValue: number;
/** Current value for the end of the range */
toValue: number;
/** Whether to show tooltips on hover */
showTooltips?: boolean;
/** Whether to show the current range values above the slider */
showRangeDisplay?: boolean;
/** Whether to show numeric inputs for editing the selected range */
showRangeInputs?: boolean;
/**
* Optional function to format values inside the editable inputs.
* Defaults to `String(value)`, which keeps dot decimals independent of the
* browser's localized number input rendering.
*/
formatInputValue?: (value: number) => string;
/**
* Optional function to parse editable input text back to a number.
* Return `NaN` to ignore incomplete or invalid text while the user is typing.
* The default parser accepts both dot and comma decimal separators.
*/
parseInputValue?: (value: string) => number;
/** Callback fired when the range values change */
onRangeChange: (range: SliderRange) => void;
/**
* Optional function to format read-only labels and tooltips.
* Editable inputs use `formatInputValue` so display labels and input text can
* intentionally use different formats.
*/
formatValue?: (value: number) => string
}

export type SelectionItem = { value: string; label: string; [key: string]: any };

export type GetItemsFn = (prop: ColumnProp) => Promise<SelectionItem[]> | SelectionItem[];

export type SelectionItemTemplateProps = {
/** Current column prop for the selection filter popup. */
columnProp: ColumnProp;
/** Original item returned by the default option loader or custom `selection.getItems`. */
item: SelectionItem;
/** Normalized option value used by selection filtering. */
value: string;
/** Display label for the option. */
label: string;
/** Whether this option is currently included in the filter result. */
checked: boolean;
};

export type SelectionItemTemplate = (
h: HyperFunc<VNode>,
props: SelectionItemTemplateProps,
) => any;

export type SelectionGridSettings = Partial<{
additionalData: HTMLRevoGridElement['additionalData'];
autoSizeColumn: HTMLRevoGridElement['autoSizeColumn'];
canFocus: HTMLRevoGridElement['canFocus'];
colSize: HTMLRevoGridElement['colSize'];
columnTypes: HTMLRevoGridElement['columnTypes'];
editors: HTMLRevoGridElement['editors'];
frameSize: HTMLRevoGridElement['frameSize'];
hideAttribution: HTMLRevoGridElement['hideAttribution'];
noHorizontalScrollTransfer: HTMLRevoGridElement['noHorizontalScrollTransfer'];
range: HTMLRevoGridElement['range'];
readonly: HTMLRevoGridElement['readonly'];
resize: HTMLRevoGridElement['resize'];
rowDefinitions: HTMLRevoGridElement['rowDefinitions'];
rowHeaders: HTMLRevoGridElement['rowHeaders'];
rowSize: HTMLRevoGridElement['rowSize'];
theme: HTMLRevoGridElement['theme'];
useClipboard: HTMLRevoGridElement['useClipboard'];
}>;

export type SelectionCascadeConfig = {
/**
* Enables context-aware selection options.
* When true, selection values are calculated from rows matching active filters
* in other columns, excluding the current column filter itself.
*/
enabled?: boolean;
/**
* Shows active filter dependency order badges next to header filter icons.
* Disabled by default. Set to true to show dependency badges.
*/
showDependencyNumbers?: boolean;
};

export type SelectionConfig = {
sortDirection?: 'asc' | 'desc' | 'none';
/**
* Row stores used by the default selection option loader.
* Defaults to all row stores for backward compatibility. Set to `['rgRow']`
* to build options from the main data source only and ignore pinned rows.
*/
sourceRowTypes?: DimensionRows[];
/**
* Controls whether typing in the selection popup search input also applies a
* hidden `quickSearch` filter to the grid rows.
* Defaults to true for backward compatibility. Set to false to only narrow
* the popup option list while keeping the grid rows unchanged until checkbox
* selection values are changed.
*/
quickSearchFiltering?: boolean;
/**
* Optional grouping for selection filter option rows.
* - Pass a config to apply it globally to all selection-filter columns.
* - Pass a record keyed by column prop to override per column.
*/
grouping?: GroupingOptions | Record<string, GroupingOptions>;
/**
* Provide a custom loader for selection list items.
* - Pass a function to apply it globally to all columns.
* - Pass a record keyed by column prop to override per column;
* columns without an entry fall back to the default store-based lookup.
*/
getItems?: GetItemsFn | Record<string, GetItemsFn>;
/**
* Custom renderer for selection option content.
* The plugin still renders and controls the checkbox; this template replaces
* the label content next to it, so icons and custom item metadata can be shown
* without changing selection semantics.
* - Pass a function to apply it globally to all columns.
* - Pass a record keyed by column prop to override per column.
*/
itemTemplate?: SelectionItemTemplate | Record<string, SelectionItemTemplate>;
/**
* Custom plugins for the nested selection option grid.
* - Pass an array to apply it globally to all selection-filter columns.
* - Pass a record keyed by column prop to override per column.
*/
plugins?: GridPlugin[] | Record<string, GridPlugin[]>;
/**
* Optional settings for the nested selection option grid.
* `source`, `columns`, and `grouping` stay controlled by the filter list.
* - Pass an object to apply it globally to all selection-filter columns.
* - Pass a record keyed by column prop to override per column.
*/
gridSettings?: SelectionGridSettings | Record<string, SelectionGridSettings>;
/**
* Optional context-aware option loading for selection filters.
*/
cascadeOptions?: SelectionCascadeConfig;
};

export type FilterPopupHeaderConfig = {
/**
* Hide the advanced filter popup header.
*/
hidden?: boolean;
};

Selection filter type

FIlTER_SELECTION: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte";

Quick search filter type

FIlTER_QUICK_SEARCH: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte";

Slider filter type

FIlTER_SLIDER: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte";

Hidden Pro expression filter type.

FIlTER_EXPRESSION: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte";

between: LogicFunction<any, SliderRange | undefined>;

export function mergeFilterConfigs(
base?: ColumnFilterConfig,
override?: ColumnFilterConfig,
): ColumnFilterConfig | undefined;

export function createAdvancedFilterConfig(
config?: ColumnFilterConfig,
): ColumnFilterConfig;

export function createDefaultFilterTypes(): Record<string, string[]>;

export function resetFilterConfigState(state:;

expressionFilterFunction: LogicFunction<any, LogicFunctionExtraParam>;

ADVANCED_FILTERS: {
[FIlTER_SELECTION]: { columnFilterType: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; name: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; func: LogicFunction<any, LogicFunctionExtraParam>; };
[FIlTER_SLIDER]: { columnFilterType: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; name: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; func: LogicFunction<any, LogicFunctionExtraParam>; };
[FIlTER_QUICK_SEARCH]: { columnFilterType: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; name: "empty" | "none" | "notEmpty" | "eq" | "notEq" | "begins" | "contains" | "notContains" | "eqN" | "neqN" | "gt" | "gte" | "lt" | "lte"; func: LogicFunction<any, LogicFunctionExtraParam>; };
};

ADVANCED_FILTER_NAMES: {
[FIlTER_EXPRESSION]: string;
};

notContains: LogicFunction<any, Set<any> | undefined>;

popUpContent: (data: ShowData, { multiFilterItems, onFilterItemsChange, subscribeFilterItemsChange, dataStores, getItems, itemTemplate, grouping, plugins, gridSettings, config, change, onClose, }: { multiFilterItems: MultiFilterItem; onFilterItemsChange: ProFilterItemsChangeListener; subscribeFilterItemsChange: ProFilterItemsChangeSubscription; dataStores: RowDataSources; getItems: () => SelectionItem[] | Promise<SelectionItem[]>; itemTemplate?: SelectionItemTemplate | undefined; grouping?: GroupingOptions | undefined; plugins?: typeof BasePlugin[] | undefined; gridSettings?: Partial<{ additionalData: AdditionalData; autoSizeColumn: boolean | AutoSizeColumnConfig; canFocus: boolean; colSize: number; columnTypes: { [name: string]: ColumnType<DataType<any, ColumnProp>>; }; editors: Editors; frameSize: number; hideAttribution: boolean; noHorizontalScrollTransfer: boolean; range: boolean; readonly: boolean; resize: boolean; rowDefinitions: RowDefinition[]; rowHeaders: boolean | RowHeaders; rowSize: number; theme: string; useClipboard: boolean | ClipboardConfig; }> | undefined; config?: ColumnFilterConfig | undefined; change(filterItems: MultiFilterItem): Promise<void>; onClose?(): void; }) => VNode;

popUpBottomContent: (data: ShowData, options: { multiFilterItems: MultiFilterItem; onFilterItemsChange: ProFilterItemsChangeListener; subscribeFilterItemsChange: ProFilterItemsChangeSubscription; getItems: () => SelectionItem[] | Promise<SelectionItem[]>; config?: ColumnFilterConfig | undefined; change(filterItems: MultiFilterItem): Promise<void>; }) => never[] | VNode;

export type ProFilterItemsChangeDetail = {
prop: ColumnProp;
multiFilterItems: MultiFilterItem;
};

export type ProFilterItemsChangeListener = (detail: ProFilterItemsChangeDetail) => void;

export type ProFilterItemsChangeSubscription = (
listener: ProFilterItemsChangeListener,
) => () => void;

export function hasMeaningfulFilterValue(value: unknown);

export function hasActiveFiltersForColumn(
columnProp: ColumnProp | undefined,
multiFilterItems: MultiFilterItem,
);

export function renderFilterPopupHeader(
data: ShowData,;

export type FilterPopupHeaderOptions = {
multiFilterItems: MultiFilterItem;
captions?: Partial<FilterCaptions>;
onClose?(): void;
};

Renders the dual native range inputs used as slider handles. Shared runtime helpers keep handle position, highlighted track, labels, tooltips, and optional editable inputs synchronized.

export function renderSliderControl(runtime: RangeSliderRuntime);

Renders optional editable range inputs for the selected slider range. Inputs intentionally use type="text" with inputMode="decimal" so custom formatters control comma/dot decimals instead of browser-localized number UI.

export function renderRangeInputs(runtime: RangeSliderRuntime);

export function scaleSliderValue(value: number, scaleFactor = SLIDER_SCALE_FACTOR);

export function unscaleSliderValue(value: number, scaleFactor = SLIDER_SCALE_FACTOR);

export function normalizeSliderState(;

export function clampScaledValue(value: number, minInt: number, maxInt: number);

export function normalizeFromSlider(fromValueInt: number, toValueInt: number);

export function normalizeToSlider(fromValueInt: number, toValueInt: number);

export function normalizeFromInputValue(
value: number,
currentToValueInt: number,
state: Pick<ScaledSliderState, 'minInt' | 'maxInt'>,
scaleFactor = SLIDER_SCALE_FACTOR,
);

export function normalizeToInputValue(
value: number,
currentFromValueInt: number,
state: Pick<ScaledSliderState, 'minInt' | 'maxInt'>,
scaleFactor = SLIDER_SCALE_FACTOR,
);

export function toSliderRange(
fromValueInt: number,
toValueInt: number,
scaleFactor = SLIDER_SCALE_FACTOR,
): SliderRange;

export function toSliderDisplayValue(valueInt: number, scaleFactor = SLIDER_SCALE_FACTOR);

export function formatSliderInputValue(value: number);

Default editable input parser. Accepts both 640.42 and 640,42; returns NaN for empty text so partial edits do not reset the current slider selection while the user is typing.

export function parseSliderInputValue(value: string);

Range inputs can contain decimals while native range inputs work most predictably with integers. Slider logic stores values as scaled integers and converts back to numbers only when displaying values or emitting filter state.

SLIDER_SCALE_FACTOR: 100;

export type ScaledSliderState = {
minInt: number;
maxInt: number;
fromValueInt: number;
toValueInt: number;
};

export type SliderStateInput = {
min: number;
max: number;
fromValue: number;
toValue: number;
scaleFactor?: number;
};

export function getCurrentRange(runtime: RangeSliderRuntime);

export function syncRangeText(runtime: RangeSliderRuntime);

export function updateTooltip(
slider: HTMLInputElement,
tooltip: HTMLDivElement,
state: ScaledSliderState,
formatValue: NonNullable<RangeSliderProps['formatValue']>,
);

export function hideTooltip(tooltip: HTMLDivElement);

export function fillSlider(
from: HTMLInputElement,
to: HTMLInputElement,
controlSlider: HTMLInputElement,
);

export function syncVisuals(runtime: RangeSliderRuntime);

export function setToggleAccessible(runtime: RangeSliderRuntime);

export function emitRangeChange(runtime: RangeSliderRuntime);

export function preventInvalidNumberKey(event: KeyboardEvent);

export type RangeSliderRefs = {
fromSlider?: HTMLInputElement;
toSlider?: HTMLInputElement;
fromInput?: HTMLInputElement;
toInput?: HTMLInputElement;
fromLabel?: HTMLSpanElement;
toLabel?: HTMLSpanElement;
fromTooltip?: HTMLDivElement;
toTooltip?: HTMLDivElement;
};

export type RangeSliderRuntime = {
refs: RangeSliderRefs;
state: ScaledSliderState;
formatValue: NonNullable<RangeSliderProps['formatValue']>;
formatInputValue: NonNullable<RangeSliderProps['formatInputValue']>;
parseInputValue: NonNullable<RangeSliderProps['parseInputValue']>;
showTooltips: boolean;
onRangeChange: RangeSliderProps['onRangeChange'];
scheduleSyncVisuals: () => void;
syncVisuals: () => void;
};

RangeSlider renders a dual-handle range control for the Pro slider filter. The slider track and numeric inputs are separate controls that share one normalized scaled-value state.

RangeSlider: FunctionalComponent<RangeSliderProps>;

export function isFilterOptionSourceRow(row?: DataType);

export function getFilterOptionSourceRows(
stores: RowDataSources,
sourceRowTypes?: DimensionRows[],
): DataType[];

export function compileExpressionFilter(
text: string,
context: ExpressionColumnContext,
): ExpressionCompileResult;

Normalizes the public expression config into one internal shape with defaults.

Returns undefined when expressions are disabled so callers can keep opt-in rendering, filter registration, and stale-state cleanup behind one predicate.

export function normalizeExpressionConfig(
config?: ColumnFilterConfig['expressions'],
): NormalizedExpressionConfig | undefined;

export function evaluateExpression(ast: ExpressionAst, value: unknown): boolean;

expressionFilter: LogicFunction<unknown, ExpressionFilterValue>;

export function highlightExpression(text: string, diagnostics: ExpressionDiagnostic[] = []);

export function isCoreFilterType(value: string): value is FilterType;

export function isExpressionOperator(value: string): value is ExpressionOperator;

EXPRESSION_FILTER_OPERATORS: { readonly empty: "empty"; readonly notEmpty: "notEmpty"; readonly eq: "eq"; readonly notEq: "notEq"; readonly begins: "begins"; readonly contains: "contains"; readonly notContains: "notContains"; readonly eqN: "eqN"; readonly neqN: "neqN"; readonly gt: "gt"; readonly gte: "gte"; readonly lt: "lt"; readonly lte: "lte"; };

EXPRESSION_DATE_OPERATORS: { readonly equals: "equals"; readonly before: "before"; readonly after: "after"; readonly onOrBefore: "onOrBefore"; readonly onOrAfter: "onOrAfter"; readonly between: "between"; readonly notEqual: "notEqual"; readonly isEmpty: "isEmpty"; readonly isNotEmpty: "isNotEmpty"; readonly today: "today"; readonly yesterday: "yesterday"; readonly last7Days: "last7Days"; readonly thisMonth: "thisMonth"; readonly lastMonth: "lastMonth"; readonly thisQuarter: "thisQuarter"; readonly nextQuarter: "nextQuarter"; readonly previousQuarter: "previousQuarter"; readonly thisYear: "thisYear"; readonly nextYear: "nextYear"; readonly previousYear: "previousYear"; };

EXPRESSION_SELECTION_OPERATORS: { readonly is: "is"; readonly in: "in"; readonly notIn: "notIn"; };

EXPRESSION_SYMBOL_OPERATORS: { readonly '=': "eq"; readonly '!=': "notEq"; readonly '>': "gt"; readonly '>=': "gte"; readonly '<': "lt"; readonly '<=': "lte"; };

export type ExpressionFilterOperator =
| typeof EXPRESSION_FILTER_OPERATORS[keyof typeof EXPRESSION_FILTER_OPERATORS]
| typeof EXPRESSION_DATE_OPERATORS[keyof typeof EXPRESSION_DATE_OPERATORS]
| typeof EXPRESSION_SELECTION_OPERATORS[keyof typeof EXPRESSION_SELECTION_OPERATORS];

export type ExpressionSymbolOperator = keyof typeof EXPRESSION_SYMBOL_OPERATORS;

export type ExpressionOperator = ExpressionFilterOperator | ExpressionSymbolOperator;

DATE_PERIOD_PHRASES: { readonly today: "today"; readonly yesterday: "yesterday"; readonly 'last 7 days': "last7Days"; readonly 'this month': "thisMonth"; readonly 'last month': "lastMonth"; readonly 'this quarter': "thisQuarter"; readonly 'next quarter': "nextQuarter"; readonly 'previous quarter': "previousQuarter"; readonly 'this year': "thisYear"; readonly 'next year': "nextYear"; readonly 'previous year': "previousYear"; };

VALUELESS_OPERATORS: Set<ExpressionOperator>;

LIST_OPERATORS: Set<ExpressionOperator>;

NUMERIC_OPERATORS: Set<ExpressionOperator>;

DATE_OPERATORS: Set<ExpressionOperator>;

SELECTION_OPERATORS: Set<ExpressionOperator>;

VALID_OPERATORS: Set<ExpressionOperator>;

OPERATOR_START_WORDS: Set<string>;

export function defineExpressionPanel(el: HTMLElement, props: ExpressionPanelProps);

export type ExpressionPanelProps = {
data: ShowData;
multiFilterItems: MultiFilterItem;
onFilterItemsChange: ProFilterItemsChangeListener;
subscribeFilterItemsChange: ProFilterItemsChangeSubscription;
config?: ColumnFilterConfig;
getItems: () => Promise<SelectionItem[]> | SelectionItem[];
change(filterItems: MultiFilterItem): Promise<void>;
};

export function parseExpression(text: string): ExpressionParseResult;

export function serializeExpressionFilters(filters: FilterData[] = []);

Creates the next filter item map after replacing one column’s expression-owned filters.

The advanced filter panel receives mutable filter state from the core filter panel, but expression apply logic should produce a fresh map before notifying sibling Pro controls. This keeps the helper reusable in tests and avoids hidden prop mutation from the expression UI.

export function replaceColumnFilters(
multiFilterItems: MultiFilterItem,
prop: ColumnProp,
filters: FilterData[],
): MultiFilterItem;

export function syncFilterItemsTarget(
target: MultiFilterItem,
source: MultiFilterItem,
): void;

export function tokenizeExpression(text: string):;

Boolean operator supported by the advanced filter expression AST.

/**
* Boolean operator supported by the advanced filter expression AST.
*/
export type ExpressionBooleanOperator = 'and' | 'or';

Parsed expression tree used by the hidden expression filter evaluator.

/**
* Parsed expression tree used by the hidden expression filter evaluator.
*/
export type ExpressionAst =
| ExpressionConditionNode
| {
kind: 'binary';
op: ExpressionBooleanOperator;
left: ExpressionAst;
right: ExpressionAst;
};

Single current-column condition parsed from an expression.

/**
* Single current-column condition parsed from an expression.
*/
export type ExpressionConditionNode = {
/** Condition node discriminator. */
kind: 'condition';
/** Optional field reference. Expressions may only reference the current column. */
field?: string;
/** Filter, date, selection, or symbolic operator. */
operator: ExpressionOperator;
/** Literal values consumed by the operator. */
values: ExpressionLiteral[];
};

Literal value parsed from expression text.

/**
* Literal value parsed from expression text.
*/
export type ExpressionLiteral = string | number;

Validation or parsing diagnostic associated with an expression text range.

/**
* Validation or parsing diagnostic associated with an expression text range.
*/
export type ExpressionDiagnostic = {
/** Human-readable diagnostic message. */
message: string;
/** Inclusive start offset in the expression text. */
start: number;
/** Exclusive end offset in the expression text. */
end: number;
};

Token categories produced by the expression tokenizer.

/**
* Token categories produced by the expression tokenizer.
*/
export type ExpressionTokenType =
| 'word'
| 'string'
| 'number'
| 'operator'
| 'paren'
| 'comma'
| 'invalid';

Token emitted by the expression tokenizer for parsing and highlighting.

/**
* Token emitted by the expression tokenizer for parsing and highlighting.
*/
export type ExpressionToken = {
/** Token category. */
type: ExpressionTokenType;
/** Raw token value without quote delimiters for string tokens. */
value: string;
/** Inclusive start offset in the expression text. */
start: number;
/** Exclusive end offset in the expression text. */
end: number;
};

Result of parsing expression text.

/**
* Result of parsing expression text.
*/
export type ExpressionParseResult = {
/** Parsed AST when expression syntax is valid enough to build one. */
ast?: ExpressionAst;
/** Tokens produced from the source expression text. */
tokens: ExpressionToken[];
/** Parser and tokenizer diagnostics. */
diagnostics: ExpressionDiagnostic[];
};

Hidden filter value stored in multiFilterItems for expression predicates.

/**
* Hidden filter value stored in `multiFilterItems` for expression predicates.
*/
export type ExpressionFilterValue = {
/** Original expression text used for serialization back into the editor. */
text: string;
/** Parsed expression tree used at filter evaluation time. */
ast: ExpressionAst;
};

Configuration for the Pro advanced filter expression editor.

Expression filtering is opt-in through grid.filter.expressions. When enabled, the advanced filter popup renders a current-column expression editor and compiles valid expressions into the existing RevoGrid filter model.

/**
* Configuration for the Pro advanced filter expression editor.
*
* Expression filtering is opt-in through `grid.filter.expressions`. When enabled,
* the advanced filter popup renders a current-column expression editor and compiles
* valid expressions into the existing RevoGrid filter model.
*/
export type ExpressionFilterConfig = {
/**
* Enables or disables the expression editor.
* Set to `false` to disable expressions when passing an object config.
*/
enabled?: boolean;
/**
* Delay in milliseconds before applying expression edits after typing.
* Use `0` for immediate validation/application in tests or highly reactive UIs.
*/
applyDebounceMs?: number;
/**
* Label for the button that opens the expression editor.
*/
buttonLabel?: string;
/**
* Placeholder shown in the expression textarea when it is empty.
*/
placeholder?: string;
/**
* Accessible label/title for the validation tooltip trigger shown on invalid expressions.
*/
errorTooltipLabel?: string;
/**
* Formats an expression diagnostic for the validation tooltip.
*
* Use this to localize diagnostic text or map low-level parser/compiler messages
* to product-specific wording. Multiple diagnostics are formatted individually
* and joined with new lines.
*/
formatDiagnostic?: (diagnostic: ExpressionDiagnostic, diagnostics: ExpressionDiagnostic[]) => string;
};

Expression configuration after defaults are applied.

/**
* Expression configuration after defaults are applied.
*/
export type NormalizedExpressionConfig = Required<ExpressionFilterConfig>;

Column-specific context needed to validate and compile expression text.

/**
* Column-specific context needed to validate and compile expression text.
*/
export type ExpressionColumnContext = {
/** Current column property. */
prop: ColumnProp;
/** Current column display name. */
name?: string;
/** Filter panel column metadata. */
data: ShowData;
/** Selection options available for current-column selection expressions. */
selectionItems?: ExpressionSelectionOption[];
};

Result of compiling expression text into RevoGrid filter items.

/**
* Result of compiling expression text into RevoGrid filter items.
*/
export type ExpressionCompileResult = {
/** Filter items that should replace current-column expression-owned filters. */
filters: FilterData[];
/** Validation diagnostics that should prevent applying filters when present. */
diagnostics: ExpressionDiagnostic[];
};

Selection option available to expression selection operators.

/**
* Selection option available to expression selection operators.
*/
export type ExpressionSelectionOption = {
/** Normalized selection value used by the selection filter model. */
value: string;
/** User-facing selection label. */
label: string;
};

Value normalization helpers shared by expression evaluation and future expression integrations. They intentionally mirror the lightweight coercion used by the existing Pro filter predicates instead of introducing a separate expression runtime.

Checks whether a value should be treated as empty by expression predicates.

export function isEmptyValue(value: unknown);

Normalizes a value for case-insensitive text and selection comparisons.

export function normalizeExpressionText(value: unknown);

Coerces a value for numeric expression comparisons.

export function toExpressionNumber(value: unknown);

Coerces a value to a timestamp for date expression comparisons.

export function toExpressionDateTime(value: unknown);

Compares values by their calendar date string, matching existing Pro date-filter semantics.

export function isSameCalendarDate(value: unknown, compare: unknown);

Detects values that should prefer date comparison over numeric comparison.

export function isDateLikeValue(value: unknown);

export function normalizeSelectionFilterConfig(
config?: ColumnFilterConfig,
): ColumnFilterConfig | undefined;

export function resolveSelectionFilterConfig(
selection: SelectionConfig | undefined,
prop: ColumnProp,
): ResolvedSelectionFilterConfig;

export function normalizeSelectionItems(items: SelectionItem[]): SelectionItem[];

export type ResolvedSelectionFilterConfig = {
getItems?: GetItemsFn;
itemTemplate?: SelectionItemTemplate;
grouping?: GroupingOptions;
plugins?: GridPlugin[];
gridSettings?: SelectionGridSettings;
sourceRowTypes?: DimensionRows[];
};

export function isSelectionFilterActive(data: ShowData);

export function renderSelectionContent(
data: ShowData,;

export type SelectionContentOptions = {
multiFilterItems: MultiFilterItem;
onFilterItemsChange: ProFilterItemsChangeListener;
subscribeFilterItemsChange: ProFilterItemsChangeSubscription;
getItems: () => Promise<SelectionItem[]> | SelectionItem[];
itemTemplate?: SelectionItemTemplate;
grouping?: GroupingOptions;
plugins?: GridPlugin[];
gridSettings?: SelectionGridSettings;
config?: ColumnFilterConfig;
change(filterItems: MultiFilterItem): Promise<void>;
};

export function createFilterDependencyBadgeController(
plugin: FilterDependencyBadgePlugin,
getFilterConfig: () => ColumnFilterConfig | undefined,
): FilterDependencyBadgeController;

export function getContextAwareSelectionList(
plugin: FilterPluginLike,
columnProp: ColumnProp,
exclude = new Set<string>(),
sourceRowTypes?: DimensionRows[],
): SelectionItem[];

export function parseValue(
originalValue: string | undefined,
originalLabel?: string,
):;

export function parseSelectionValues(
originalValue: unknown,
originalLabel?: string,
):;

export function getSelectionValueKeys(value: unknown): string[];

SelectionGrid: ({ columnProp, rows, itemTemplate, grouping, plugins, gridSettings, onCheckedChange, }: SelectionGridProps) => preact.JSX.Element;

List: ({ columnProp, subscribeFilterItemsChange, getItems, exclude: initialExclude, search, searchPlaceholder, filter, quickFilter, sortDirection, itemTemplate, grouping, plugins, gridSettings, }: ListProps) => preact.JSX.Element;

defineList: (el: HTMLElement, props: ListProps) => void;

Search: ({ search, selectAll, searchValue, placeholder, allSelected, }: SearchProps) => preact.JSX.Element;

export type SelectionListOption = {
text: string;
checked: boolean;
item: SelectionItem;
};

export type SelectionListRow = {
value: string;
label: string;
checked: boolean;
item: SelectionItem;
[key: string]: any;
};

interface ListProps {
columnProp: ColumnProp;
subscribeFilterItemsChange?: ProFilterItemsChangeSubscription;
getItems: () => Promise<SelectionItem[]> | SelectionItem[];
exclude?: Set<string>;
search?: string;
searchPlaceholder?: string;
filter: (excluded: Set<string>) => void;
quickFilter: (txt: string) => void;
sortDirection?: 'asc' | 'desc' | 'none';
itemTemplate?: SelectionItemTemplate;
grouping?: GroupingOptions;
plugins?: GridPlugin[];
gridSettings?: SelectionGridSettings
}

EMPTY_EXCLUDE: Set<string>;

FILTER_LIST_ROW_HEIGHT: 28;

FILTER_LIST_MAX_VISIBLE_ROWS: 8;

FILTER_LIST_MAX_HEIGHT: number;

export function normalizeSelectionValue(value?: string);

export function createSelectionMap(items: SelectionItem[], exclude: Set<string>);

export function filterSelectionMapBySearch(
data: Map<string, SelectionListOption>,
searchText: string,
);

export function sortSelectionRows(
filteredData: Map<string, SelectionListOption>,
sortDirection?: 'asc' | 'desc' | 'none',
): SelectionListRow[];

export function countGroupedSelectionRows(rows: SelectionListRow[], groupingProps: ColumnProp[] = []);