/* eslint-disable @typescript-eslint/no-explicit-any */ import FactoryRenderer from "../../../../Renderer"; import { FilterExpression, FilterValue } from "../../data/quickFilter"; import { ValueLoadType } from "../../type"; interface FilterProps { filterRow: FilterExpression; dataKeyRelatedValues?: Record; onQuickFilterApply: ( id: string, value: { label: string; value: any }, ) => void; } const Filter = (props: FilterProps) => { const dataProvider = props.filterRow.propertyToFilter?.dataProvider; // SELF-loaded values are self-contained on the dataProvider, so read them // directly instead of the key-based map (which requires a `key` to resolve). const listData = dataProvider?.valueLoadType === ValueLoadType.SELF ? ((dataProvider.value as FilterValue[]) ?? []) : (props.dataKeyRelatedValues?.[dataProvider?.key ?? ""] ?? []); return (
{props.filterRow.propertyToFilter.label} props.onQuickFilterApply(props.filterRow.id, e) } uiElementType="WIDGET" widgetType="DROPDOWN" />
); }; export default Filter;