import React, { ReactNode, CSSProperties, ReactElement } from 'react'; import { type SizeType } from '../config-provider'; import { type InputTagProps } from '../input-tag/interface'; import type { InputComponentProps } from '../input/interface'; export interface SelectViewCommonProps extends Pick, 'animation' | 'renderTag' | 'dragToSort'> { id?: string; style?: CSSProperties; className?: string | string[]; children?: ReactNode; inputValue?: string; /** * 选择框默认文字。 */ placeholder?: string; /** * 是否需要边框 * @defaultValue true */ bordered?: boolean; /** * 使单选模式可搜索,传入 `{ retainInputValue: true }` 在搜索框聚焦时保留现有内容 * 传入 `{ retainInputValueWhileSelect: true }` 在多选选择时保留输入框内容。 */ showSearch?: boolean | { retainInputValue?: boolean; retainInputValueWhileSelect?: boolean; }; /** * 静态展示 */ quickStatic?: boolean; /** * 快速编辑(默认无边框) */ quickEdit?: boolean; /** * 分别不同尺寸的选择器。对应 `24px`, `28px`, `32px` */ size?: SizeType; /** * 是否为禁用状态。 */ disabled?: boolean; /** * 状态 */ status?: 'error' | 'warning'; /** * 是否为加载状态。 */ loading?: boolean; /** * 允许清除值。 */ allowClear?: boolean; /** * 最多显示多少个 `tag`,仅在多选或标签模式有效。 */ maxTagCount?: number | { count: number; render?: (invisibleTagCount: number) => ReactNode; }; /** * 前缀。 */ prefix?: ReactNode; /** * 自定义选择框后缀图标。 */ suffixIcon?: ReactNode; /** * 自定义箭头图标,设置为 `null` 不显示箭头图标。 */ arrowIcon?: ReactNode | null; /** * 多选时配置选中项的删除图标。当传入`null`,不显示删除图标。 */ removeIcon?: ReactNode | null; /** * `allowClear` 时配置清除按钮的图标。 */ clearIcon?: ReactNode; /** * 设置宽度自适应。minWidth 默认为 0,maxWidth 默认为 100% */ autoWidth?: boolean | { minWidth?: CSSProperties['minWidth']; maxWidth?: CSSProperties['maxWidth']; }; minWidth?: CSSProperties['minWidth']; maxWidth?: CSSProperties['minWidth']; /** * 选择框前添加元素 */ addBefore?: ReactNode; /** * 鼠标点击下拉框时的回调 */ onClick?: (e: any) => void; /** * 键盘输入时的回调 */ onKeyDown?: (e: any) => void; } export interface SelectViewProps extends SelectViewCommonProps { value?: any; popupVisible?: boolean; allowCreate?: boolean; isEmptyValue: boolean; isMultiple?: boolean; prefixCls: string; rtl?: boolean; ariaControls?: string; renderText: (value: any) => { text: any; disabled: any; }; renderView?: (eleView: ReactElement) => ReactElement; onSort?: (value: any) => void; onRemoveCheckedItem?: (item: any, index: number, e: any) => void; onChangeInputValue?: InputComponentProps['onChange']; onPaste?: (e: any) => void; onClear?: (e: any) => void; onFocus?: (e: any) => void; onBlur?: (e: any) => void; } export declare type SelectViewHandle = { dom: HTMLDivElement; focus: () => void; blur: () => void; getWidth: () => number; }; declare const SelectViewComponent: React.ForwardRefExoticComponent>; export default SelectViewComponent;