range components

This commit is contained in:
2026-06-07 15:45:26 +05:30
parent cd7f26594b
commit dd538f79d4
3 changed files with 5 additions and 5 deletions

View File

@@ -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)} />;
}