use/useFilterForm
Overview
Manages reactive filter form values, translating field-type-specific initial values and range fields into URL-ready query parameters.
Properties
FilterFieldMappings
Per-filter-type value configuration: the empty/initial value a filter field starts from, and whether it is a range (suffix pair) or an array filter. Exported so the central URL→filter restoration in buildFilterFromQuery coerces query values the same way the live form does.
Type: object
Source: client/lib/use/useFilterForm.js:19
Methods
- buildFilterFromQuery - Build an active-filter object from a URL query, or
nullwhen the field has no value in the query. - filtersToParams - Reduce an active-filter list to the flat query-param object the URL and list request carry.
- getFilterParams - Resolve the URL query-param key(s) a filter writes to.
- getFilterQueryValue - Read a filter's active value out of a URL query object, in the shape the filter form submits: a
{ [suffix]: value }object for suffix/range filters, or the bare param value otherwise. - useFilterField - A Vue composable that creates reactive state for a single filter field based on its type definition.
Types
UseFilterFieldProps
UseFilterFieldRawState
Source
client/lib/use/useFilterForm.js:1