UNPKG

@cmk/fe_utils

Version:
42 lines (40 loc) 1.68 kB
import { SimpleTreeViewProps } from '@mui/x-tree-view/SimpleTreeView'; import { StyledTreeItemProps } from './CTreeItem'; declare module 'react' { interface CSSProperties { '--tree-view-color'?: string; '--tree-view-bg-color'?: string; } } export type AdditionalActionType = { action: (nodeId: string | number, e: any, sourceAnchorEl: HTMLElement) => void; icon: string; tooltip: string; label: string; disabled?: boolean; disableStopPropagation?: boolean; useDragListeners?: boolean; }; export type AdditionalActionGenType = AdditionalActionType[] | ((item: any) => AdditionalActionType[]); export type CTreeViewProps = Omit<SimpleTreeViewProps<false>, 'selectedItems'> & { items: StyledTreeItemProps[]; actions?: AdditionalActionGenType; additionalActions?: AdditionalActionGenType; onToggleExpand?: (id: string) => void; onExpandChildrenRecursively?: (id: string) => void; onCollapseChildrenRecursively?: (id: string) => void; onNodeDoubleClick?: (id: string, e: any) => void; onToggleSelect?: (id: string, e?: any) => void; onDragDrop?: (event: any, draggedItem: any, droppedItem: any, droppedOnBorder?: 'top' | 'bottom') => void; onDragging?: (event: any, active: boolean, draggedItem: any) => void; expandedItems?: string[]; selectedItems?: string[]; maxWidth?: number; disableItemsFocusable?: boolean; width?: number; onChangeDraggingActive?: (active: boolean) => void; onMouseUp?: any; disableExpandMargin?: boolean; transformer?: any[]; }; export declare const CTreeView: (props: CTreeViewProps) => import("react/jsx-runtime").JSX.Element;