UNPKG

react-querybuilder

Version:

React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts

25 lines (24 loc) 840 B
import * as React from "react"; import type { FullOption, ValueSelectorProps } from "../types/index.mjs"; /** * Default `<select>` component used by {@link QueryBuilder}. * * @group Components */ export declare const ValueSelector: <Opt extends FullOption = FullOption>(props: ValueSelectorProps<Opt>) => React.JSX.Element; export type UseValueSelectorParams = Pick<ValueSelectorProps, "handleOnChange" | "listsAsArrays" | "multiple" | "value">; /** * Transforms a value into an array when appropriate and provides a memoized change handler. * * @group Hooks */ export declare const useValueSelector: (props: UseValueSelectorParams) => { /** * Memoized change handler for value selectors */ onChange: (v: string | string[]) => void; /** * The value as provided or, if appropriate, as an array */ val: string | any[] | undefined; };