Skip to content

FilterSphereInput

Defined in: filter/src/hooks/use-filter-sphere.tsx:18

Extends

Type Parameters

Data

Properties

defaultRule?

optional defaultRule: FilterGroup

Defined in: filter/src/hooks/use-filter-sphere.tsx:28


fieldDeepLimit?

optional fieldDeepLimit: number

Defined in: filter/src/types.ts:30

The maximum depth of searching for filter fields.

Default

1

Inherited from

BasicFilterSphereInput.fieldDeepLimit


filterFnList?

optional filterFnList: FnSchema[]

Defined in: filter/src/types.ts:18

The list of filter functions schema.

If not provided, the presetFilter will be used.

Inherited from

BasicFilterSphereInput.filterFnList


getLocaleText()?

optional getLocaleText: (key) => string

Defined in: filter/src/types.ts:53

Returns the translation for the key.

Parameters

key

string

Returns

string

Inherited from

BasicFilterSphereInput.getLocaleText


mapFieldName()?

optional mapFieldName: (field) => string

Defined in: filter/src/types.ts:38

Map the filter field to the field name.

For example, if the field path is user.name, you can map it to Name.

If not provided, the default map will use the fieldSchema.description or the field path as the name.

Parameters

field

FilterField

Returns

string

Inherited from

BasicFilterSphereInput.mapFieldName


mapFilterName()?

optional mapFilterName: (filterSchema, field) => string

Defined in: filter/src/types.ts:46

Map the filter fn schema to the filter label.

For example, if the filter name is eq, you can map it to Equal.

If not provided, the default map will use the filter name as the label.

Parameters

filterSchema

StandardFnSchema

field

FilterField

Returns

string

Inherited from

BasicFilterSphereInput.mapFilterName


onPredicateChange()?

optional onPredicateChange: (predicate) => void

Defined in: filter/src/hooks/use-filter-sphere.tsx:41

Same as onRuleChange, but receives the predicate function.

Parameters

predicate

(data) => boolean

Returns

void


onRuleChange()?

optional onRuleChange: (data) => void

Defined in: filter/src/hooks/use-filter-sphere.tsx:32

The callback when the filter rule changes.

Parameters

data
filterRule

FilterGroup

predicate

(data) => boolean

Returns

void


ruleValue?

optional ruleValue: FilterGroup

Defined in: filter/src/hooks/use-filter-sphere.tsx:27

The filter rule.

If provided, the filter rule will be controlled. Don’t forget to update the rule when it changes.

This prop will overwrite the defaultRule prop.


schema

schema: ZodType<Data>

Defined in: filter/src/types.ts:8

The schema of the data to be filtered.

Inherited from

BasicFilterSphereInput.schema