UNPKG

2.8 kBTypeScriptView Raw
1import * as React from 'react';
2import type { BaseSelectRef, SelectProps as RcSelectProps } from 'rc-select';
3import { OptGroup, Option } from 'rc-select';
4import type { OptionProps } from 'rc-select/lib/Option';
5import type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
6import type { SelectCommonPlacement } from '../_util/motion';
7import type { InputStatus } from '../_util/statusUtils';
8import type { SizeType } from '../config-provider/SizeContext';
9import type { Variant } from '../config-provider';
10type RawValue = string | number;
11export type { BaseOptionType, DefaultOptionType, OptionProps, BaseSelectRef as RefSelectProps };
12export interface LabeledValue {
13 key?: string;
14 value: RawValue;
15 label: React.ReactNode;
16}
17export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
18export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
19 rootClassName?: string;
20 suffixIcon?: React.ReactNode;
21 size?: SizeType;
22 disabled?: boolean;
23 mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE' | 'combobox';
24 /** @deprecated Use `variant` instead. */
25 bordered?: boolean;
26 /**
27 * @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a
28 * default behavior, you can hide it by setting `suffixIcon` to null.
29 */
30 showArrow?: boolean;
31 /**
32 * @since 5.13.0
33 * @default "outlined"
34 */
35 variant?: Variant;
36}
37export interface SelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<InternalSelectProps<ValueType, OptionType>, 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement'> {
38 placement?: SelectCommonPlacement;
39 mode?: 'multiple' | 'tags';
40 status?: InputStatus;
41 popupClassName?: string;
42 /** @deprecated Please use `popupClassName` instead */
43 dropdownClassName?: string;
44 /** @deprecated Please use `popupMatchSelectWidth` instead */
45 dropdownMatchSelectWidth?: boolean | number;
46 popupMatchSelectWidth?: boolean | number;
47}
48declare const Select: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: React.PropsWithChildren<SelectProps<ValueType, OptionType>> & React.RefAttributes<BaseSelectRef>) => React.ReactElement) & {
49 displayName?: string;
50 SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
51 Option: typeof Option;
52 OptGroup: typeof OptGroup;
53 _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
54};
55declare const PurePanel: (props: import("../_util/type").AnyObject) => React.JSX.Element;
56export default Select;