UNPKG

@chief-editor/ui

Version:

UI Component for chief editor

28 lines (27 loc) 1.14 kB
import { ISelectDisplayInfoItem, ISelectQuery } from '@rc-hooks/select'; import { UnionOmit } from '@co-hooks/util'; import { HTMLAttributes } from 'react'; import { ISelectBase } from './components/SelectBase'; export interface ISelect<T> { value?: T; disabled?: boolean; readonly?: boolean; filterOption?: ISelectQuery<T>; onChange?: (value: T | undefined) => void; onValueChange?: (value: T | undefined) => void; onDisplayInfoChange?: (info: Array<ISelectDisplayInfoItem<T>>) => void; autoClearSearchValue?: boolean; clearable?: boolean; onSearchChange?: (query: string) => void; } export interface ISelectExtraProps { checkType?: CheckType; clearable?: boolean; } export declare type CheckType = 'checkbox' | 'check'; export declare type SelectProps<T> = UnionOmit<ISelect<T> & ISelectExtraProps & Omit<ISelectBase<T>, 'renderTrigger'>, HTMLAttributes<HTMLDivElement>>; export declare function Select<T>(props: SelectProps<T>): JSX.Element; export declare namespace Select { var Option: typeof import("./Option").Option; var OptionGroup: typeof import("./OptionGroup").OptionGroup; }