FilterSphereInput
Defined in: filter/src/hooks/use-filter-sphere.tsx:18
Extends
Section titled “Extends”BasicFilterSphereInput<Data>
Type Parameters
Section titled “Type Parameters”Data
Properties
Section titled “Properties”defaultRule?
Section titled “defaultRule?”
optionaldefaultRule:FilterGroup
Defined in: filter/src/hooks/use-filter-sphere.tsx:28
fieldDeepLimit?
Section titled “fieldDeepLimit?”
optionalfieldDeepLimit:number
Defined in: filter/src/types.ts:30
The maximum depth of searching for filter fields.
Default
Section titled “Default”1Inherited from
Section titled “Inherited from”BasicFilterSphereInput.fieldDeepLimit
filterFnList?
Section titled “filterFnList?”
optionalfilterFnList:FnSchema[]
Defined in: filter/src/types.ts:18
The list of filter functions schema.
If not provided, the presetFilter will be used.
Inherited from
Section titled “Inherited from”BasicFilterSphereInput.filterFnList
getLocaleText()?
Section titled “getLocaleText()?”
optionalgetLocaleText: (key) =>string
Defined in: filter/src/types.ts:53
Returns the translation for the key.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”BasicFilterSphereInput.getLocaleText
mapFieldName()?
Section titled “mapFieldName()?”
optionalmapFieldName: (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
Section titled “Parameters”Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”BasicFilterSphereInput.mapFieldName
mapFilterName()?
Section titled “mapFilterName()?”
optionalmapFilterName: (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
Section titled “Parameters”filterSchema
Section titled “filterSchema”Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”BasicFilterSphereInput.mapFilterName
onPredicateChange()?
Section titled “onPredicateChange()?”
optionalonPredicateChange: (predicate) =>void
Defined in: filter/src/hooks/use-filter-sphere.tsx:41
Same as onRuleChange, but receives the predicate function.
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(data) => boolean
Returns
Section titled “Returns”void
onRuleChange()?
Section titled “onRuleChange()?”
optionalonRuleChange: (data) =>void
Defined in: filter/src/hooks/use-filter-sphere.tsx:32
The callback when the filter rule changes.
Parameters
Section titled “Parameters”filterRule
Section titled “filterRule”predicate
Section titled “predicate”(data) => boolean
Returns
Section titled “Returns”void
ruleValue?
Section titled “ruleValue?”
optionalruleValue: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
Section titled “schema”schema:
$ZodType<Data>
Defined in: filter/src/types.ts:8
The schema of the data to be filtered.