import React from "react"; import type { AutocompleteOption } from "../form-controls/AutocompleteInput"; import type { SearchSelectOption } from "../form-controls/SearchSelectInput"; import type { PaginationInterface } from "../../interfaces"; export interface StaticOption { text: string; value: string; } interface BaseFilterProps { paramName?: string; label?: string; staticOptions?: StaticOption[]; inputWidth?: string; value?: string; onChange?: (value: string | undefined) => void; /** * Si es true, el componente solo se renderiza si tiene un valor o existe el queryParam asociado con un valor. * Por defecto es false. */ hideEmpty?: boolean; /** * Si es true, el componente se muestra con opacidad y no permite interacciones. * Si el panel está abierto, se cerrará automáticamente. */ disabled?: boolean; compact?: boolean; /** * Color de fondo del filtro (badge e input interno). Útil cuando el filtro se * coloca sobre una superficie del mismo color que el fondo por defecto (por ej. * dentro de una Card blanca). Acepta cualquier valor CSS de color o una variable * del tema, p. ej. `"#f5f5f5"` o `"var(--color-bg-secondary)"`. * El panel flotante mantiene el fondo por defecto (es un popover). */ bgColor?: string; } export interface TextFilterProps extends BaseFilterProps { filterType?: "text"; } export interface NumberFilterProps extends BaseFilterProps { filterType: "number"; min?: number; max?: number; } export interface DateFilterProps extends BaseFilterProps { filterType: "date"; } export interface AutocompleteFilterProps extends BaseFilterProps { filterType: "autocomplete"; options: T[]; getOptionLabel?: (item: T) => string; getOptionValue?: (item: T) => K; renderOption?: (item: T) => React.ReactNode; noResultsText?: string; multiple?: boolean; } export interface SearchFilterProps extends BaseFilterProps { filterType: "search"; } export interface SearchSelectFilterProps extends BaseFilterProps { filterType: "searchSelect"; onSearchPromiseFn: (text: string) => Promise | PaginationInterface>; onSingleSearchPromiseFn: (value: K) => Promise; getOptionLabel?: (item: T) => string; getOptionValue?: (item: T) => K; renderOption?: (item: T) => React.ReactNode; dialogTitle?: string; noResultsText?: string; } export type FilterProps = TextFilterProps | NumberFilterProps | DateFilterProps | AutocompleteFilterProps | SearchFilterProps | SearchSelectFilterProps; export declare const Filter: React.FC; export {}; //# sourceMappingURL=Filter.d.ts.map