AppFilterPanel
The single, schema-driven filtering component. A standalone collapsible card that owns all filtering logic — every field type, all value shapes, removable chips, and the exported filterRows() predicate engine. It reuses AppForm’s FormFieldRow schema and extends it with filter-only types. Bind v-model, pass a schema, and react to @apply; nothing fetches per keystroke. AppTable embeds it via its filterFields prop.
Install: pnpm add-component AppFilterPanel
Every field type
A single schema exercising all field types — text, select, multiselect, boolean tri-state, numberRange, and dateRange — laid out on an auto-computed responsive grid. Pick values to watch the active-count badge and removable chips update. Nothing is “applied” until you press Apply.
Filter a table (decoupled)
The panel drives an AppTable. On Apply/Clear the parent runs filterRows() over its data and feeds the result to the table — the table holds no filtering logic. The same toolbar also exports the filtered rows to Excel. Try filtering, then Export.
API
modelValue(FilterState): Live filter state (v-model). Updated as fields change; commit points are the apply/clear events.fields(FilterFieldRow[]): Row/field schema — a superset of AppForm’s FormFieldRow[]. Types: text, email, number, select, phone, date, datetime (scalar) plus multiselect, boolean, dateRange, numberRange.defaultValues(FilterState): Baseline that Clear resets to and the active-count badge / chips diff against.title(string): Title shown in the block header, next to the funnel icon.subtitle(string): Sub-line under the title when no filters are active (replaced by an “N filters active” summary otherwise).loading(boolean): Disables controls and shows a spinner on the Apply button.defaultOpen(boolean): Start with the panel expanded.chips(boolean): Show removable active-filter chips inside the block, with per-type value formatting.showLabel / hideLabel(string): Labels on the header toggle button for the collapsed / expanded states.applyLabel(string): Apply button label.clearLabel(string): Per-field / chip clear label.clearAllLabel(string): Header / footer clear-all label.anyLabel(string): Prefix for empty select/multiselect/dateRange placeholders (e.g. “Any Department”).rowClass(string): Override the auto-computed responsive grid class for every row.@apply((state: FilterState) => void): Emitted when the user presses Apply (also on Clear and chip removal) — fetch/filter now.@clear((state: FilterState) => void): Emitted when fields are reset to defaultValues.filterRows()((rows, fields, state) => rows): Pure predicate engine exported from the component. Use it to filter an array client-side; handles scalars, multiselect arrays, tri-state booleans, {from,to} and {min,max} ranges (dot-notation keys supported).