/** * @author linhd * @date 2021/8/5 15:07 * @description 下拉框 */ import React, { FunctionComponent, ReactNode } from 'react'; import { EmptyProps } from '../Empty'; import { LabelTooltipProps } from '../Label'; import { TooltipProps } from '../Tooltip'; import { HelperTextDetailProps } from '../HelperText'; import './index.scss'; export interface SelectProps extends HelperTextDetailProps { /** 样式class */ className?: string; /** style */ style?: React.CSSProperties; /** 是否显示下拉 */ showSelect?: boolean; /** 是否显示清空按钮 */ allowClear?: boolean; /** 空状态属性 */ emptyProps?: EmptyProps; /** 大小 */ size?: 'small' | 'medium' | 'large'; /** 标题模式 outside外,inside内 */ labelMode?: 'outside' | 'inside'; /** 标题 */ label?: ReactNode; /** 标题提示 */ labelSign?: ReactNode; /** 帮组提示信息 */ labelTooltip?: LabelTooltipProps; /** 提示语 */ placeholder?: ReactNode; /** 搜索提示语 */ searchPlaceholder?: string; /** 是否禁用 */ disabled?: boolean | any[]; /** * 禁用提示 */ disabledTooltip?: TooltipProps; /** 是否多选 */ multiple?: boolean; /** 是否必填 */ required?: boolean; /** 下拉选项 {label: ReactNode, value: any, children: any[]}*/ list: any[]; /** * 自定义渲染 * item: 当前想数据 * type: true 下拉选项 false 已选项 more: 更多选项 * */ renderContent?: (item: any, type: boolean | 'more') => ReactNode; /** 下拉选中是否有图标, 默认有 */ selectCheckIcon?: boolean; /** 显示名字段 */ showName?: string; /** 取值字段 */ showValue?: string; /** 下级字段 */ childrenName?: string; /** 默认值 不受控 */ defaultValue?: any; /** 选中值 多选时为数组 单选单值 受控 */ value?: any; /** 超出换行 */ overLine?: boolean; /** 是否有搜索 */ search?: boolean; /** 搜索框的props, input的所有属性 */ searchInputProps?: { [name: string]: any; }; /** 可输入回车 */ input?: boolean; /** 搜索模块 */ searchModel?: 'outside' | 'inside'; /** 下拉框className */ selectPopoverClassName?: string; /** 更多className */ morePopoverClassName?: string; /** 返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:[]) 来返回它 */ fetchSuggestions?: (val: string, cb: (data: any[]) => void) => void; /** 改变值 */ onChange?: (val: any, e: any) => void; /** 全局回车事件 */ onEnter?: (val: any) => void; /** 搜索框输入框回车事件 */ onEnterInput?: (val: string) => void; /** 点击清空内容回调 */ onClear?: () => void; /** 浮层渲染容器,默认body */ getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; /** 失去焦点改变值 */ blurChangeValueBol?: boolean; [name: string]: any; } declare const Select: FunctionComponent; export default Select;