import type { CustomFilterProps, CustomFloatingFilterProps } from 'ag-grid-react';
import type { IFilter } from 'ag-grid-community';
/**
* Custom AG Grid filter component for numeric columns. AG Grid Community's
* built-in `agNumberColumnFilter` paints a stock browser-skinned
* ` ` that does not match the kit's form language —
* this wraps the DS `` + `` so totals, prices,
* quantities, etc. line up visually with neighbouring DS-styled cells.
*
* Wire on a colDef:
* ```tsx
* {
* field: 'total',
* filter: NumberFilter,
* floatingFilterComponent: NumberFloatingFilter,
* filterParams: { defaultOperator: 'greaterThan', min: 0 },
* }
* ```
*
* The full-popover variant exposes the operator dropdown (equals,
* greaterThan, inRange, blank, …). The floating-filter row follows the
* applied operator, or `defaultOperator` when no filter is applied: one
* input for most operators, a from/to pair for `inRange`. Either bound may
* be empty (from-only means "≥ from", to-only "≤ to"). Both variants speak
* the same `NumberFilterModel` so server-side adapters can read either.
*
* Model shape `{ type, filter?, filterTo? }` matches AG Grid's own
* `agNumberColumnFilter` vocabulary so adapters can interchange.
*/
export type NumberFilterOperator = 'equals' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'inRange' | 'blank' | 'notBlank';
export interface NumberFilterModel {
type: NumberFilterOperator;
/** Lower bound or comparison value. Optional, as in AG Grid's own model,
* so an `inRange` model can carry only `filterTo` ("≤ to"). */
filter?: number;
filterTo?: number;
}
export interface NumberFilterParams {
defaultOperator?: NumberFilterOperator;
min?: number;
max?: number;
step?: number;
placeholder?: string;
}
/**
* The predicate behind both the popover and the floating row. Exported for
* unit tests only; not re-exported from the data-table barrel.
*/
export declare function numberFilterPasses(op: NumberFilterOperator, cell: number | null, primary: number | null, secondary: number | null): boolean;
export declare function NumberFilter(props: CustomFilterProps & NumberFilterParams): import("react/jsx-runtime").JSX.Element;
/**
* Floating-filter companion for `NumberFilter`.
*
* Follows the APPLIED operator, falling back to `defaultOperator` (or
* `'equals'`) when no filter is applied. Emptying the row keeps the operator
* it was editing, so retyping does not switch to the default; only an
* external clear (chip remove, header Clear, `setFilterModel`) returns to it,
* as with AG Grid's own floating filter. `inRange` renders a compact from/to
* pair; either bound may stay empty, and clearing both commits `null`.
* Every other value operator renders one input. `blank` / `notBlank` take no
* value, so the input is disabled and names the operator. The operator
* dropdown lives only in the full popover, as with `agNumberColumnFilter`.
*
* One 200 ms debounce covers both bounds, so each keystroke does not re-run
* the grid filter, and an invalid number never reaches the model as `NaN`.
* Every input, here and in the popover, is `mode="decimal"`: the integer
* default showed 0.01 as "0" once blurred, while the filter compared 0.01.
*/
export declare function NumberFloatingFilter(props: CustomFloatingFilterProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=number-filter.d.ts.map