UNPKG

1.61 kBTypeScriptView Raw
1import * as React from 'react';
2import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD, TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select';
3import { ConfigConsumerProps } from '../config-provider';
4import { SizeType } from '../config-provider/SizeContext';
5declare type RawValue = string | number;
6export interface LabeledValue {
7 key?: string;
8 value: RawValue;
9 label: React.ReactNode;
10}
11export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[];
12export interface TreeSelectProps<T> extends Omit<RcTreeSelectProps<T>, 'showTreeIcon' | 'treeMotion' | 'inputIcon' | 'mode' | 'getInputElement' | 'backfill'> {
13 suffixIcon?: React.ReactNode;
14 size?: SizeType;
15 bordered?: boolean;
16}
17declare class TreeSelect<T> extends React.Component<TreeSelectProps<T>, {}> {
18 static TreeNode: React.FC<import("rc-tree-select/lib/TreeNode").TreeNodeProps>;
19 static SHOW_ALL: typeof SHOW_ALL;
20 static SHOW_PARENT: typeof SHOW_PARENT;
21 static SHOW_CHILD: typeof SHOW_CHILD;
22 static defaultProps: {
23 transitionName: string;
24 choiceTransitionName: string;
25 bordered: boolean;
26 };
27 selectRef: React.RefObject<RcTreeSelect<import("rc-tree-select/lib/interface").DefaultValueType>>;
28 constructor(props: TreeSelectProps<T>);
29 focus(): void;
30 blur(): void;
31 renderTreeSelect: ({ getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction, virtual, dropdownMatchSelectWidth, }: ConfigConsumerProps) => JSX.Element;
32 render(): JSX.Element;
33}
34export { TreeNode };
35export default TreeSelect;