jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
33 lines (32 loc) • 1.17 kB
TypeScript
import type { Option } from 'jamis-core';
import type { BaseSelectionProps } from '../types';
import { BaseSelection } from './Selection';
export interface TreeSelectionProps extends BaseSelectionProps {
expand?: 'all' | 'first' | 'root' | 'none';
}
interface TreeSelectionState {
expanded: Array<string>;
}
/**
* 树形选择框组件
*/
export declare class TreeSelection extends BaseSelection<TreeSelectionProps, TreeSelectionState> {
valueArray: Array<Option>;
state: TreeSelectionState;
static defaultProps: {
expand: "first";
placeholder: string;
itemRender: (option: Option, states: import("../types").ItemRenderStates) => JSX.Element;
multiple: boolean;
clearable: boolean;
};
componentDidMount(): void;
componentDidUpdate(prevProps: TreeSelectionProps): void;
syncExpanded(): void;
toggleOption(option: Option): void;
toggleCollapsed(option: Option, index: string): void;
renderItem(option: Option, index: number, indexes?: Array<number>, depth?: number): JSX.Element;
render(): JSX.Element;
}
declare const _default: typeof TreeSelection;
export default _default;