@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
47 lines (46 loc) • 1.9 kB
TypeScript
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import type { BasicOptionProps } from '@douyinfe/semi-foundation/lib/es/select/optionFoundation';
export interface OptionProps extends BasicOptionProps {
[x: string]: any;
value?: string | number;
label?: string | number | React.ReactNode;
children?: React.ReactNode;
disabled?: boolean;
showTick?: boolean;
className?: string;
style?: React.CSSProperties;
}
declare class Option extends PureComponent<OptionProps> {
static isSelectOption: boolean;
static propTypes: {
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
disabled: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<NonNullable<string | number>>;
selected: PropTypes.Requireable<boolean>;
label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
empty: PropTypes.Requireable<boolean>;
emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
focused: PropTypes.Requireable<boolean>;
showTick: PropTypes.Requireable<boolean>;
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
prefixCls: PropTypes.Requireable<string>;
renderOptionItem: PropTypes.Requireable<(...args: any[]) => any>;
inputValue: PropTypes.Requireable<string>;
};
static defaultProps: {
prefixCls: string;
};
onClick({ value, label, children, ...rest }: Partial<OptionProps>, event: React.MouseEvent): void;
renderOptionContent({ config, children, inputValue, prefixCls }: {
config: any;
children: any;
inputValue: any;
prefixCls: any;
}): any;
render(): any;
}
export default Option;