react-querybuilder
Version:
React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts
22 lines (21 loc) • 791 B
TypeScript
import * as React from "react";
import type { FullOption, ValueSelectorProps } from "../types";
/**
* Default `<select>` component used by {@link QueryBuilder}.
*/
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.
*/
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
};