AdvancedFilterBuilder
proAdvancedFilterBuilder edits nested rule groups and emits both a filter tree and query string.
Where
Current Query
Use Apply Filter to commit the current rules.
Installation
Add this component with the NateUI CLI.
Examples
Custom Fields
Where
Current query
Start with the first rule.
Initial Value
Where
(status=active AND rating>=4 OR category=electronics)
Popover
Nested Groups
Where
Where
Last applied
(status=processing OR (customer~=acme AND item_count>2))
Query Helpers
Where
Callback Events
Where
Event log
- No callback has fired yet.
API
AdvancedFilterBuilder stores rule edits internally unless a new value tree is
passed from the parent. All callbacks receive the current tree and the matching
query string.
| Prop | Description | Type | Default |
|---|---|---|---|
fields | Field list used to render the field dropdown, operator list, and value input for each rule. | FieldConfig[] | DEFAULT_FIELDS |
value | Filter tree used to initialize or replace the builder state. | FilterTree | - |
onChange | Called after a rule or group edit. | (tree: FilterTree, queryString: string) => void | - |
onApply | Called when the Apply Filter button is pressed. | (tree: FilterTree, queryString: string) => void | - |
onReset | Called after Reset restores a single empty rule. | (tree: FilterTree, queryString: string) => void | - |
Utilities
| Export | Description | Type |
|---|---|---|
toQueryString | Serializes a FilterTree to the query string form used by callbacks. | (tree: FilterTree) => string |
parseQueryString | Parses a query string into a FilterTree. Field type coercion currently follows the built-in default fields. | (query: string) => FilterTree |