/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { TreeViewCheckChangeEvent, TreeViewExpandChangeEvent, TreeViewItemClickEvent, TreeViewItemDragEndEvent, TreeViewItemDragOverEvent, TreeViewItemDragStartEvent } from './events'; /** * Represents the props of the [Kendo UI for Vue TreeView component]({% slug overview_treeview %}). */ export interface TreeViewProps { /** * Sets the data of the TreeView ([more information and examples]({% slug databinding_treeview %})). */ dataItems?: any[] | null; /** * Controls the animation. By default, the expand and collapse animations are enabled. */ animate?: boolean; /** * Sets a tabIndex of the TreeView DOM element. */ tabIndex?: number; /** * The TreeView has a built-in implementation of focusing and keyboard navigation. By default, the component uses hierarchical indices to uniquely match the focused item. You can use the `focusIdField` prop for specifying the name of the field which will uniquely describe an item as an alternative to its hierarchical index. */ focusIdField?: string; /** * When `focusIdField` is set, the TreeView executes a depth-first search on the data to find the currently focused item. The `getFocusHierarchicalIndex` prop specifies the function that will be used as an alternative to the default search algorithm. */ getFocusHierarchicalIndex?: (itemId: any) => string | undefined; /** * Controls the rendering of the expand (collapse) icons. By default, the icons are not rendered ([see example]({% slug expansion_ways_treeview %})). */ expandIcons?: boolean; /** * Fires when the expanding or collapsing of an item is requested ([see example]({% slug expansion_ways_treeview %})). */ onExpandChange?: (event: TreeViewExpandChangeEvent) => void; /** * Fires when an item is clicked or when `Enter` is pressed on a focused item ([see example]({% slug selection_ways_treeview %})). */ onItemClick?: (event: TreeViewItemClickEvent) => void; /** * Specifies the name of the field which will provide a Boolean representation for the expanded state of the item. Defaults to `expanded`. */ expandField?: string; /** * Specifies the name of the field which will provide a Boolean representation for the selected state of the item. Defaults to `selected`. */ selectField?: string; /** * Specifies the name of the field which indicates to the TreeView that an item has children even if the children are not initially passed. Used for implementing the load-on-demand feature ([see example]({% slug databinding_treeview %}#toc-loading-data-on-demand)). Defaults to `hasChildren`. */ hasChildrenField?: string; /** * Specifies the name of the field which will provide an array representation of the item children. */ childrenField?: string; /** * Specifies the name of the field which will provide a text representation for the item. Defaults to `text`. */ textField?: string; /** * Specifies the name of the field which will provide a Boolean representation for the disabled state of the item. Defaults to `disabled`. */ disableField?: string; /** * Defines the component that will be used for rendering each of the TreeView items ([see example]({% slug rendering_treeview %})). */ item?: any; /** * Indicates that the user can select more than one TreeView items. If the TreeView is in a multiple selection mode, set the `aria-multiselectable` prop to `true` ([more on accessibility by the TreeView]({% slug accessibility_treeview %})). */ ariaMultiSelectable?: boolean | 'false' | 'true' | string; /** * Defines a string value that labels the TreeView ([more on accessibility by the TreeView]({% slug accessibility_treeview %})). */ ariaLabel?: string; /** * Identifies the element or elements which will label the TreeView ([more on accessibility by the TreeView]({% slug accessibility_treeview %})). */ ariaLabelledby?: string; /** * Controls the rendering of checkboxes. By default, the checkboxes are not rendered ([see example]({% slug checkboxes_treeview %})). */ checkboxes?: boolean; /** * Specifies the name of the field which will provide a Boolean representation for the checked state of the item. Defaults to `checked`. */ checkField?: string; /** * Specifies the name of the field which will provide a Boolean representation for the check indeterminate state of the item. Defaults to `checkIndeterminate`. */ checkIndeterminateField?: string; /** * Fires when a checkbox is clicked or when `Space` is pressed on a focused item ([see example]({% slug checkboxes_treeview %})). */ onCheckChange?: (event: TreeViewCheckChangeEvent) => void; /** * Controls the unique id of the TreeView component. */ id?: string; /** * Controls the dispatching of the `drag` events. By default, the `drag` events are not dispatched ([see example]({% slug dragdrop_treeview %})). */ draggable?: boolean; /** * Fires when the dragging of an item has started. */ onItemDragStart?: (event: TreeViewItemDragStartEvent) => void; /** * Fires when a dragged item changes its position ([see example]({% slug dragdrop_treeview %})). */ onItemDragOver?: (event: TreeViewItemDragOverEvent) => void; /** * Fires when a dragged item is dropped ([see example]({% slug dragdrop_treeview %})). */ onItemDragEnd?: (event: TreeViewItemDragEndEvent) => void; /** * Configures the `size` of the TreeView. * * The available options are: * - small * - medium * - large * - undefined—Does not set a size `className`. * * @default `undefined` */ size?: 'small' | 'medium' | 'large'; }