UNPKG

ultra-design

Version:
48 lines (47 loc) 1.51 kB
import React from 'react'; import { OptionProps as OptionPropsWithNoChild } from './option'; interface OptionProps extends React.PropsWithChildren<OptionPropsWithNoChild> { } export interface SelectProps { /** * @description.zh-CN 值 * @description.en-US value */ value?: string; /** * @description.zh-CN 默认值值 * @description.en-US default value */ defaultValue?: string; /** * @description.zh-CN 占位符 * @description.en-US placeholder */ placeholder?: string; clearable?: boolean; /** * @description.zh-CN 支持输入过滤,如果传入函数则可以自定义过滤方法 * @description.en-US supported Input filtering, and custom filtering methods can be used if pass in a function type */ filterable?: boolean | ((keyword: string, option: OptionProps) => boolean); /** * @description.zh-CN 是否禁用 * @description.en-US whether disable */ disabled?: boolean; /** * @description.zh-CN 选择时触发的回调 * @description.en-US triggered when selecting an option */ onChange?: (value: any) => void; className?: string; style?: React.CSSProperties; } declare const defaultProps: { name: string; }; export declare type MergedSelectProps = typeof defaultProps & SelectProps; declare const Select: React.ForwardRefExoticComponent<SelectProps & { children?: React.ReactNode; } & React.RefAttributes<unknown>>; export default Select;