UNPKG

amis

Version:

一种MIS页面生成工具

48 lines (47 loc) 1.63 kB
import React from 'react'; import { OptionsControlProps } from './Options'; import { Action, Schema, PlainObject, Api } from '../../types'; import { Option } from '../../components/Checkboxes'; export interface TreeProps extends OptionsControlProps { placeholder?: any; hideRoot?: boolean; rootLabel?: string; rootValue?: any; showIcon?: boolean; cascade?: boolean; withChildren?: boolean; onlyChildren?: boolean; addApi?: Api; addMode?: 'dialog' | 'normal'; addDialog?: Schema; editApi?: Api; editMode?: 'dialog' | 'normal'; editDialog?: Schema; deleteApi?: Api; deleteConfirmText?: string; } export interface TreeState { isAddModalOpened: boolean; isEditModalOpened: boolean; parent: Option | null; prev: Option | null; data: any; } export default class TreeControl extends React.Component<TreeProps, TreeState> { static defaultProps: Partial<TreeProps>; state: TreeState; reload(): void; handleAdd(values: PlainObject): void; handleAddModalConfirm(values: Array<any>, action: Action, ctx: any, components: Array<any>): void; handleEdit(values: PlainObject): void; handleEditModalConfirm(values: Array<any>, action: Action, ctx: any, components: Array<any>): void; saveRemote(item: any, type: 'add' | 'edit'): Promise<void>; handleRemove(item: any): Promise<void>; openAddDialog(parent: Option | null): void; closeAddDialog(): void; openEditDialog(prev: Option): void; closeEditDialog(): void; render(): JSX.Element; } export declare class TreeControlRenderer extends TreeControl { }