1 | import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
|
2 | import type { ScrollConfig, ScrollTo } from 'rc-virtual-list/lib/List';
|
3 | import * as React from 'react';
|
4 | import type { DisplayInfoType, DisplayValueType, Mode, Placement, RenderDOMFunc, RenderNode, RawValueType } from './interface';
|
5 | export type { DisplayInfoType, DisplayValueType, Mode, Placement, RenderDOMFunc, RenderNode, RawValueType };
|
6 | export interface RefOptionListProps {
|
7 | onKeyDown: React.KeyboardEventHandler;
|
8 | onKeyUp: React.KeyboardEventHandler;
|
9 | scrollTo?: (args: number | ScrollConfig) => void;
|
10 | }
|
11 | export type CustomTagProps = {
|
12 | label: React.ReactNode;
|
13 | value: any;
|
14 | disabled: boolean;
|
15 | onClose: (event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
16 | closable: boolean;
|
17 | };
|
18 | export interface BaseSelectRef {
|
19 | focus: () => void;
|
20 | blur: () => void;
|
21 | scrollTo: ScrollTo;
|
22 | }
|
23 | export interface BaseSelectPrivateProps {
|
24 | id: string;
|
25 | prefixCls: string;
|
26 | omitDomProps?: string[];
|
27 | displayValues: DisplayValueType[];
|
28 | onDisplayValuesChange: (values: DisplayValueType[], info: {
|
29 | type: DisplayInfoType;
|
30 | values: DisplayValueType[];
|
31 | }) => void;
|
32 |
|
33 | activeValue?: string;
|
34 |
|
35 | activeDescendantId?: string;
|
36 | onActiveValueChange?: (value: string | null) => void;
|
37 | searchValue: string;
|
38 | autoClearSearchValue?: boolean;
|
39 |
|
40 | onSearch: (searchValue: string, info: {
|
41 | source: 'typing' | 'effect' | 'submit' | 'blur';
|
42 | }) => void;
|
43 |
|
44 | onSearchSplit?: (words: string[]) => void;
|
45 | OptionList: React.ForwardRefExoticComponent<React.PropsWithoutRef<any> & React.RefAttributes<RefOptionListProps>>;
|
46 |
|
47 | emptyOptions: boolean;
|
48 | }
|
49 | export type BaseSelectPropsWithoutPrivate = Omit<BaseSelectProps, keyof BaseSelectPrivateProps>;
|
50 | export interface BaseSelectProps extends BaseSelectPrivateProps, React.AriaAttributes {
|
51 | className?: string;
|
52 | style?: React.CSSProperties;
|
53 | title?: string;
|
54 | showSearch?: boolean;
|
55 | tagRender?: (props: CustomTagProps) => React.ReactElement;
|
56 | direction?: 'ltr' | 'rtl';
|
57 | maxLength?: number;
|
58 | tabIndex?: number;
|
59 | autoFocus?: boolean;
|
60 | notFoundContent?: React.ReactNode;
|
61 | placeholder?: React.ReactNode;
|
62 | onClear?: () => void;
|
63 | choiceTransitionName?: string;
|
64 | mode?: Mode;
|
65 | disabled?: boolean;
|
66 | loading?: boolean;
|
67 | open?: boolean;
|
68 | defaultOpen?: boolean;
|
69 | onDropdownVisibleChange?: (open: boolean) => void;
|
70 |
|
71 | getInputElement?: () => JSX.Element;
|
72 |
|
73 | getRawInputElement?: () => JSX.Element;
|
74 | maxTagTextLength?: number;
|
75 | maxTagCount?: number | 'responsive';
|
76 | maxTagPlaceholder?: React.ReactNode | ((omittedValues: DisplayValueType[]) => React.ReactNode);
|
77 | tokenSeparators?: string[];
|
78 | allowClear?: boolean | {
|
79 | clearIcon?: RenderNode;
|
80 | };
|
81 | suffixIcon?: RenderNode;
|
82 | /**
|
83 | * Clear all icon
|
84 | * @deprecated Please use `allowClear` instead
|
85 | **/
|
86 | clearIcon?: RenderNode;
|
87 | /** Selector remove icon */
|
88 | removeIcon?: RenderNode;
|
89 | animation?: string;
|
90 | transitionName?: string;
|
91 | dropdownStyle?: React.CSSProperties;
|
92 | dropdownClassName?: string;
|
93 | dropdownMatchSelectWidth?: boolean | number;
|
94 | dropdownRender?: (menu: React.ReactElement) => React.ReactElement;
|
95 | dropdownAlign?: AlignType;
|
96 | placement?: Placement;
|
97 | builtinPlacements?: BuildInPlacements;
|
98 | getPopupContainer?: RenderDOMFunc;
|
99 | showAction?: ('focus' | 'click')[];
|
100 | onBlur?: React.FocusEventHandler<HTMLElement>;
|
101 | onFocus?: React.FocusEventHandler<HTMLElement>;
|
102 | onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
|
103 | onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
104 | onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
|
105 | onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
|
106 | onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
107 | onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
108 | onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
109 | onClick?: React.MouseEventHandler<HTMLDivElement>;
|
110 | }
|
111 | export declare function isMultiple(mode: Mode): boolean;
|
112 | declare const BaseSelect: React.ForwardRefExoticComponent<BaseSelectProps & React.RefAttributes<BaseSelectRef>>;
|
113 | export default BaseSelect;
|