antd
Version:
An enterprise-class UI design language and React components implementation
41 lines (40 loc) • 1.83 kB
TypeScript
import * as React from 'react';
import RcSelect, { Option, SelectProps as RcSelectProps } from 'rc-select';
import { OptionProps } from 'rc-select/lib/Option';
import { ConfigConsumerProps } from '../config-provider';
import { SizeType } from '../config-provider/SizeContext';
declare type RawValue = string | number;
export { OptionProps };
export declare type OptionType = typeof Option;
export interface LabeledValue {
key?: string;
value: RawValue;
label: React.ReactNode;
}
export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[];
export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
suffixIcon?: React.ReactNode;
size?: SizeType;
mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
bordered?: boolean;
}
export interface SelectProps<VT> extends Omit<InternalSelectProps<VT>, 'inputIcon' | 'mode' | 'getInputElement' | 'backfill'> {
mode?: 'multiple' | 'tags';
}
declare class Select<ValueType extends SelectValue = SelectValue> extends React.Component<SelectProps<ValueType>> {
static Option: import("rc-select/lib/Option").OptionFC;
static OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
static SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
static defaultProps: {
transitionName: string;
choiceTransitionName: string;
bordered: boolean;
};
selectRef: React.RefObject<RcSelect<ValueType>>;
focus: () => void;
blur: () => void;
getMode: () => "multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE" | "combobox" | undefined;
renderSelect: ({ getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction, virtual, dropdownMatchSelectWidth, }: ConfigConsumerProps) => JSX.Element;
render(): JSX.Element;
}
export default Select;