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