import { Accessibility, TreeItemBehaviorProps } from '@fluentui/accessibility'; import { ComponentWithAs } from '@fluentui/react-bindings'; import * as React from 'react'; import { UIComponentProps, ChildrenComponentProps } from '../../utils'; import { ComponentEventHandler, ShorthandRenderFunction, ShorthandValue, ShorthandCollection, FluentComponentStaticProps } from '../../types'; import { TreeTitleProps } from './TreeTitle'; import { BoxProps } from '../Box/Box'; export interface TreeItemProps extends UIComponentProps, ChildrenComponentProps { /** Accessibility behavior if overridden by the user. */ accessibility?: Accessibility; /** Ref for the item DOM element. */ contentRef?: React.Ref; /** Id needed to identify this item inside the Tree. */ id: string; /** The index of the item among its siblings. Count starts at 1. */ index?: number; /** Array of props for sub tree. */ items?: ShorthandCollection; /** Level of the tree/subtree that contains this item. */ level?: number; /** Called when the item's first child is about to be focused. */ onFocusFirstChild?: ComponentEventHandler; /** Called when the item's parent is about to be focused. */ onFocusParent?: ComponentEventHandler; /** Called when a tree title is clicked. */ onTitleClick?: ComponentEventHandler; /** Called when the item's siblings are about to be expanded. */ onSiblingsExpand?: ComponentEventHandler; /** Whether or not the item is in the expanded state. Only makes sense if item has children items. If set to true, item is initialy expanded. */ expanded?: boolean; /** The id of the parent tree item, if any. */ parent?: string; /** * A custom render iterator for rendering each tree title. * The default component, props, and children are available for each tree title. * * @param Component - The computed component for this slot. * @param props - The computed props for this slot. * @param children - The computed children for this slot. */ renderItemTitle?: ShorthandRenderFunction; /** Size of the tree/subtree that contains this item. */ treeSize?: number; /** Properties for TreeTitle. */ title?: ShorthandValue; /** Whether or not the item can be selectable. */ selectable?: boolean; /** A state of selection indicator. */ selected?: boolean; /** A selection indicator icon can be customized. */ selectionIndicator?: ShorthandValue; /** Whether or not tree item is part of the selectable parent. */ selectableParent?: boolean; indeterminate?: boolean; } export declare type TreeItemStylesProps = Required>; export declare const treeItemClassName = "ui-tree__item"; /** * A TreeItem renders an item of a Tree. * * @accessibility * Implements [ARIA TreeView](https://www.w3.org/TR/wai-aria-practices-1.1/#TreeView) design pattern. */ export declare const TreeItem: ComponentWithAs<'div', TreeItemProps> & FluentComponentStaticProps;