import type { Placement } from '@popperjs/core'; import type { AutoCompleteCloseReason, AutoCompleteProps } from '@sinoui/core/AutoComplete'; import type { TextInputProps } from '@sinoui/core/TextInput'; import React from 'react'; import type SelectItem from './SelectItem'; /** * */ export interface Props extends Omit { /** * 子元素 */ children?: React.ReactNode; /** * 选项清单 */ items?: SelectItem[]; /** * 多选 */ multiple?: boolean; /** * 值变更时的回调函数 */ onChange?: (value?: string | string[]) => void; /** * 值的渲染方式 */ renderValue?: (value: string | string[] | undefined, items: SelectItem[]) => React.ReactNode; /** * 值 */ value?: string | string[]; /** * 自定义class名称 */ className?: string; /** * 是否将弹出内容以传送门的方式渲染。默认为`false`。 */ portal?: boolean; /** * 自定义自动完成组件的属性 */ autoCompleteProps?: Partial; /** * 宽度自适应 */ autoWidth?: boolean; /** * 控制选项打开状态 */ open?: boolean; /** * 打开选项的回调函数 */ onOpen?: (state: boolean) => void; /** * 关闭选项的回调函数 */ onClose?: (reason: AutoCompleteCloseReason) => void; /** * 输入框引用 */ textInputRef?: React.Ref; /** * 弹出层元素引用 */ popperRef?: React.Ref; /** * 是否允许弹层获取焦点。默认为`false`。 */ popperFocusable?: boolean; /** * 指定弹出层位置 */ placement?: Placement; /** * 是否允许在选项上显示title提示 */ allowShowTitle?: boolean; /** * 显示加载中指示图标。 */ loading?: boolean; /** * 自定义分组数据的渲染 */ renderGroup?: (option: any) => React.ReactNode; } /** * 转化select的value为AutoComplete的值 * * @param items 选项列表 * @param multiple 是否为多选 * @param value 给到 select 的值 */ export declare function transferSelectValueToAutoCompleteValue(items: SelectItem[], multiple?: boolean, value?: string | string[]): SelectItem | SelectItem[] | undefined; /** * 选择框组件 * * @param props */ declare function Select(props: Props): JSX.Element; export default Select;