/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { SortDescriptor, FilterDescriptor, CompositeFilterDescriptor } from '@progress/kendo-data-query'; import { TreeList } from '../TreeList.js'; import { TreeListColumnProps } from './TreeListColumnProps.js'; import { BaseEvent } from '@progress/kendo-react-common'; import { TableDragSelectionReleaseEvent, TableKeyDownEvent, TableSelectionChangeEvent } from '@progress/kendo-react-data-tools'; /** * Represents the base event object of the TreeList. */ export interface TreeListEvent extends BaseEvent { } /** * Represents the object of the `onDataStateChange` TreeList event. */ export interface TreeListDataStateChangeEvent extends TreeListEvent { /** * The state of the TreeList based on the user action. */ dataState: { /** * The descriptors that are used for sorting. */ sort?: Array; /** * The descriptors that are used for filtering. */ filter?: Array; /** * The field of the column which triggers the event. */ field?: string; }; } /** * Represents the object of the `onSortChange` TreeList event. */ export interface TreeListSortChangeEvent extends TreeListEvent { /** * The new `SortDescriptor` according to the user action. */ sort: SortDescriptor[]; /** * The field of the column which triggers the event. */ field: string; } /** * Represents the object of the `onFilterChange` TreeList event. */ export interface TreeListFilterChangeEvent extends TreeListEvent { /** * The new `FilterDescriptor` based on the user action. */ filter: FilterDescriptor[]; /** * The field of the column which triggers the event. */ field: string; } /** * Represents the object of the `onColumnMenuFilterChange` TreeList event. */ export interface TreeListColumnMenuFilterChangeEvent extends TreeListEvent { /** * The new `CompositeFilterDescriptor` based on the user action. */ filter: CompositeFilterDescriptor[]; /** * The field of the column which triggers the event. */ field: string; } /** * Represents the object of the `onExpandChange` TreeList event. */ export interface TreeListExpandChangeEvent extends TreeListEvent { /** * The data item which is expanded or collapsed. */ dataItem: any; /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; /** * The available values are: * - `true`—If the data item is expanded. * - `false`—If the data item is collapsed. */ value: boolean; } /** * Represents the object of the `onSelectionChange` TreeList event. */ export interface TreeListSelectionChangeEvent extends TreeListEvent, TableSelectionChangeEvent { /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; } /** * Represents the object of the `onKeyDownEvent` TreeList event. */ export interface TreeListKeyDownEvent extends TreeListEvent, TableKeyDownEvent { } /** @hidden */ export interface TreeListDragSelectionReleaseEvent extends TableDragSelectionReleaseEvent { } /** * Represents the object of the `onHeaderSelectionChange` TreeList event. */ export interface TreeListHeaderSelectionChangeEvent extends TreeListEvent { /** * The field of the column in which the cell is located. */ field?: string; /** * The current data as flatted array. */ dataItems: any[]; } /** * Represents the object of the `onRowClick` TreeList event. */ export interface TreeListRowClickEvent extends TreeListEvent { /** * The data item which corresponds to the clicked row. */ dataItem: any; /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; } /** * Represents the object of the `onRowDoubleClick` TreeList event. */ export interface TreeListRowDoubleClickEvent extends TreeListEvent { /** * The data item which corresponds to the clicked row. */ dataItem: any; /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; } /** * Represents the object of the `onRowContextMenu` TreeList event. */ export interface TreeListRowContextMenuEvent extends TreeListEvent { /** * The data item which corresponds to the clicked row. */ dataItem: any; /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; } /** * Represents the object of the `onItemChange` TreeList event. */ export interface TreeListItemChangeEvent extends TreeListEvent { /** * The data item which corresponds to the current row. */ dataItem: any; /** * An array of indexes of each parent and current item in the data tree. */ level: number[]; /** * The field to which the row is bound. */ field?: string; /** * The value of the item. */ value: any; } interface ColumnDragEvent { /** * An event target. */ target: TreeList; /** * A native DOM event. */ nativeEvent: any; /** * The current columns collection. */ columns: TreeListColumnProps[]; } /** * Represents the object of the `onColumnResize` TreeList event. */ export interface TreeListColumnResizeEvent extends ColumnDragEvent { /** * The index of the column. */ index: number; /** * The new width of the column. */ newWidth: number; /** * The actual width of the column prior to resizing. */ oldWidth: number; /** * Indicates that resizing is complete and the user has dropped the resize handler. */ end: boolean; /** * The total width of the columns after the resizing. */ totalWidth: number; } /** * Represents the object of the `onColumnReorder` TreeList event. */ export interface TreeListColumnReorderEvent extends ColumnDragEvent { } /** * Represents the object of the `onPageChange` TreeList event. */ export interface TreeListPageChangeEvent extends TreeListEvent { /** * The number of records that will be skipped. */ skip: number; /** * The number of records that will be taken. */ take: number; } /** * Represents the object of the TreeList row Drag and Drop event. */ export interface TreeListRowDragEvent { /** * A native DOM event. */ nativeEvent: any; /** * An event target. */ target: TreeList; /** * The level of the dragged row. * The level represents an array of indexes of each parent and current item in the data tree. */ dragged: number[]; /** * The level of the draggedOver row. * The level represents an array of indexes of each parent and current item in the data tree. */ draggedOver: number[] | null; /** * The data item which corresponds to the dragged row. */ draggedItem: any; } export {};