/**
* @file Tree
* @description 树形组件
* @author fex
*/
///
import React from 'react';
import { Option, Options } from './Select';
import { ThemeProps } from '../theme';
import { LocaleProps } from '../locale';
interface TreeSelectorProps extends ThemeProps, LocaleProps {
highlightTxt?: string;
showIcon?: boolean;
initiallyOpen?: boolean;
unfoldedLevel?: number;
showRadio?: boolean;
multiple?: boolean;
disabled?: boolean;
withChildren?: boolean;
onlyChildren?: boolean;
labelField: string;
valueField: string;
iconField: string;
unfoldedField: string;
foldedField: string;
disabledField: string;
showOutline?: boolean;
className?: string;
itemClassName?: string;
joinValues?: boolean;
extractValue?: boolean;
delimiter?: string;
options: Options;
value: any;
onChange: Function;
placeholder?: string;
hideRoot?: boolean;
rootLabel?: string;
rootValue?: any;
cascade?: boolean;
selfDisabledAffectChildren?: boolean;
minLength?: number;
maxLength?: number;
bultinCUD?: boolean;
rootCreatable?: boolean;
rootCreateTip?: string;
creatable?: boolean;
createTip?: string;
onAdd?: (idx?: number | Array, value?: any, skipForm?: boolean) => void;
editable?: boolean;
editTip?: string;
onEdit?: (value: Option, origin?: Option, skipForm?: boolean) => void;
removable?: boolean;
removeTip?: string;
onDelete?: (value: Option) => void;
onDeferLoad?: (option: Option) => void;
}
interface TreeSelectorState {
value: Array;
inputValue: string;
addingParent: Option | null;
isAdding: boolean;
isEditing: boolean;
editingItem: Option | null;
}
export declare class TreeSelector extends React.Component {
static defaultProps: {
showIcon: boolean;
showOutline: boolean;
initiallyOpen: boolean;
unfoldedLevel: number;
showRadio: boolean;
multiple: boolean;
disabled: boolean;
withChildren: boolean;
onlyChildren: boolean;
labelField: string;
valueField: string;
iconField: string;
unfoldedField: string;
foldedField: string;
disabledField: string;
joinValues: boolean;
extractValue: boolean;
delimiter: string;
hideRoot: boolean;
rootLabel: string;
rootValue: number;
cascade: boolean;
selfDisabledAffectChildren: boolean;
rootCreateTip: string;
createTip: string;
editTip: string;
removeTip: string;
};
unfolded: WeakMap