range components
This commit is contained in:
@@ -13,8 +13,6 @@ import FilterListIcon from "@mui/icons-material/FilterList";
|
||||
import { ResourceField, ResourceMode } from "../types/config";
|
||||
import { FilterBarComponents, FieldComponents } from "../types/overrides";
|
||||
import { getFieldOptions, resolveTemplate } from "../utils/options";
|
||||
import DateRangeField from './fields/DateRangeField';
|
||||
import NumberRangeField from './fields/NumberRangeField';
|
||||
|
||||
export function FilterAutocomplete({
|
||||
options,
|
||||
@@ -167,7 +165,6 @@ function renderFilterInput(
|
||||
if (filterType === "number-range") {
|
||||
const RangeComponent = fieldComponents?.numberRange;
|
||||
if (!RangeComponent) throw new Error(`Number range component not found for field ${fieldName}`);
|
||||
|
||||
const rangeVal = (value as { min?: string; max?: string }) || {};
|
||||
return <RangeComponent name={fieldName} field={field} value={rangeVal} onChange={(val: any) => onChange("value", val)} />;
|
||||
}
|
||||
@@ -175,7 +172,6 @@ function renderFilterInput(
|
||||
if (filterType === "date-range") {
|
||||
const RangeComponent = fieldComponents?.dateRange;
|
||||
if (!RangeComponent) throw new Error(`Number range component not found for field ${fieldName}`);
|
||||
|
||||
const rangeVal = (value as { start?: string; end?: string }) || {};
|
||||
return <RangeComponent name={fieldName} field={field} value={rangeVal} onChange={(val: any) => onChange("value", val)} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user