import React from 'react'; import type { SelectProps } from 'rc-select'; import { TreeNode } from 'rc-tree-select'; import { BaseProps } from '../../wui-core/src/iCore'; import { ResizeStartCallback, ResizeCallback } from 're-resizable'; export type Placement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'; export type RawValueType = string | number; export interface BaseTreeDataOption { disabled?: boolean; checkable?: boolean; disableCheckbox?: boolean; children?: BaseTreeDataOption[]; [name: string]: any; } export interface TreeDataOption extends BaseTreeDataOption { value?: RawValueType; title?: React.ReactNode; label?: React.ReactNode; key?: React.Key; children?: TreeDataOption[]; } export interface LabeledValueType { key?: React.Key; value?: RawValueType; label?: React.ReactNode; halfChecked?: boolean; } export interface TreeDataSimpleMode { id?: React.Key; pId?: React.Key; rootPId?: React.Key; } export interface ChangeEventExtra { preValue: LabeledValueType[]; triggerValue: RawValueType; selected?: boolean; checked?: boolean; triggerNode: React.ReactElement; allCheckedNodes: any[]; } export interface FieldNames { value?: string; label?: string; children?: string; } export interface TreeSelectRef { focus: () => void; blur: () => void; scrollTo: () => void; } export declare const SHOW_ALL = "SHOW_ALL"; export declare const SHOW_PARENT = "SHOW_PARENT"; export declare const SHOW_CHILD = "SHOW_CHILD"; export type CheckedStrategy = typeof SHOW_ALL | typeof SHOW_PARENT | typeof SHOW_CHILD; export type MaxTagCount = number | 'responsive'; export interface TreeSelectProps extends BaseProps { getPopupContainer?: (triggerNode?: React.ReactNode) => HTMLElement; multiple?: boolean; treeCheckable?: boolean | React.ReactNode; showSearch?: boolean; treeData?: TreeDataOption[]; dropdownClassName?: string; size?: string; notFoundContent?: string; dropdownStyle?: React.CSSProperties; suffixIcon?: React.ReactNode; loadData?: (treeNode: React.ReactNode) => Promise; bordered?: boolean; allowClear?: boolean; autoClearSearchValue?: boolean; defaultValue?: ValueType; disabled?: boolean; dropdownMatchSelectWidth?: boolean | number; dropdownRender?: (node: React.ReactElement) => React.ReactElement; filterTreeNode?: boolean | ((inputValue: string, treeNode: React.ReactNode) => boolean); labelInValue?: boolean; listHeight?: number; maxTagCount?: MaxTagCount; maxTagPlaceholder?: React.ReactNode | ((omittedValues: string[]) => React.ReactNode); placeholder?: string; searchValue?: string; showArrow?: boolean; showCheckedStrategy?: CheckedStrategy; switcherIcon?: React.ReactElement; treeCheckStrictly?: boolean; treeDataSimpleMode?: boolean | TreeDataSimpleMode; treeDefaultExpandAll?: boolean; treeDefaultExpandedKeys?: string[]; treeExpandedKeys?: string[]; treeIcon?: boolean; treeNodeFilterProp?: string; treeNodeLabelProp?: string; value?: ValueType; virtual?: boolean; onChange?: (value: ValueType, label: React.ReactNode[], extra: ChangeEventExtra) => void; onDropdownVisibleChange?: (open: boolean) => void; onSearch?: (value: string) => void; onSelect?: SelectProps['onSelect']; onDeselect?: SelectProps['onDeselect']; onTreeExpand?: (expandedKeys: string[]) => void; fieldNames?: FieldNames; open?: boolean; defaultOpen?: boolean; inputIcon?: React.ReactNode; removeIcon?: React.ReactNode; clearIcon?: React.ReactNode; onBlur?: React.FocusEventHandler; onFocus?: React.FocusEventHandler; onKeyUp?: React.KeyboardEventHandler; onKeyDown?: React.KeyboardEventHandler; onMouseDown?: React.MouseEventHandler; onPopupScroll?: React.UIEventHandler; onInputKeyDown?: React.KeyboardEventHandler; onMouseEnter?: React.MouseEventHandler; onMouseLeave?: React.MouseEventHandler; onClick?: React.MouseEventHandler; resizable?: boolean; onResizeStart?: ResizeStartCallback; onResize?: ResizeCallback; onResizeStop?: ResizeCallback; placement?: Placement; } export interface TreeSelectState { listHeight: number; minWidth: number; maxHeight: number; maxWidth: number; resizeClass?: string; enable?: { top?: boolean; right?: boolean; bottom?: boolean; left?: boolean; topRight?: boolean; bottomRight?: boolean; bottomLeft?: boolean; topLeft?: boolean; }; } export type TreeNodeType = typeof TreeNode;