BFilter
Just describe filter fields. Use subclasses of FilterField.
Example
BFilter props
filterFields
list of query params for filtration
-
redefineValuesDep
BFilter subscribe to this prop changes for redefine local state variable
boolean
false
realTime
call onChange by change any field value or by click to save button
boolean
false
onChange
Callback that change query params and get data
(filter: Record<string, any> | null) => void
-
IFilterField
IGeneralFilterField<V>
IGeneralFilterField<V>
fieldType
type of input
-
id
id attribute
string
''
name
Field name
string
''
keyName
query params prop name
string
-
placeholder
input placeholder
string
''
label
input label
React.ReactNode
keyName
style
css for input
React.CSSProperties
undefined
value
filter field value that is necessary to (re)define filter object
V
-
onChange
Callback when input value is changed
(value: V | null) => void
-
FilterFieldType
FilterFieldType
IFilterSelect<T, V>
IFilterSelect<T, V>
IFilterSelect extends IGeneralFilterField
...IGeneralFilterField
...
...
...
multiple
...
boolean
false
value
query params prop value
V
-
disabled
...
boolean
false
reduceListItem
generate list item template
(elem: T) => React.ReactNode
-
reduceElemName
generate list item name
(elem: T) => string
undefined
reduceValue
get item value
(elem: T) => V
-
getMethod
callback that will be used for getting data list
Function
-
extraParams
properties of query params that don't participate in filtration
Object
null
searchQueryParam
query param that is used for searching
string
''
createMethod
callback that will be used for list item creation
Function
-
onChange
Callback when selected item is changed
(value: V | null) => void
-
IFilterFieldComponent
IFilterFieldComponent
component
render function (like React.FC)
(field: IGeneralFilterField<any> & { key: string }) => React.ReactNode
-
fieldType
type of input
FilterFieldType.COMPONENT
id
id attribute
string
''
name
Field name
string
''
keyName
query params prop name
string
-
placeholder
input placeholder
string
''
label
input label
React.ReactNode
keyName
style
css for input
React.CSSProperties
undefined
value
filter field value that is necessary to (re)define filter object
V
onChange
Callback when value is changed
(value: any) => void
IFilterDatePicker
IFilterDatePicker
IFilterDatePicker extends IGeneralFilterField
...IGeneralFilterField
...
...
...
format
...
string
YYYY-MM-DD
value
query params prop value
string | Date
-
onChange
Callback when date is changed
(value: string | Date | null) => void
-
IFilterCheckbox
IFilterCheckbox
IFilterCheckbox extends IGeneralFilterField
...IGeneralFilterField
...
...
...
color
...
string
'primary'
value
query params prop value
boolean
-
onChange
Callback when checkbox is toggled
(value: boolean | null) => void
-
IFilterRadio
IFilterRadio
IFilterRadio extends IGeneralFilterField
...IGeneralFilterField
...
...
...
text
...
string
'primary'
value
query params prop value
string
-
onChange
Callback when user selects radio button
(value: string | null) => void
-
IFilterInput
IFilterInput
IFilterInput extends IGeneralFilterField
...IGeneralFilterField
...
...
...
type
input type
string
'text'
value
query params prop value
string
-
onChange
Callback when user types in input
(value: string | null) => void
-
Last updated