@progress/kendo-react-gantt
Version:
React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package
305 lines (304 loc) • 8.16 kB
TypeScript
/**
* @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 { GanttColumnProps } from './GanttColumnProps.js';
import { BaseEvent } from '@progress/kendo-react-common';
import { GanttHandle } from '../Gantt.js';
import { AddDirection } from './AddDirection.js';
import { TableKeyDownEvent, TableSelectionChangeEvent } from '@progress/kendo-react-data-tools';
/**
* Represents the base event object of the Gantt.
*/
export interface GanttEvent extends BaseEvent<GanttHandle> {
}
/**
* Represents the object of the `onDataStateChange` Gantt event.
*/
export interface GanttDataStateChangeEvent extends GanttEvent {
/**
* The state of the Gantt based on the user action.
*/
dataState: {
/**
* The descriptors that are used for sorting.
*/
sort?: Array<SortDescriptor>;
/**
* The descriptors that are used for filtering.
*/
filter?: Array<FilterDescriptor>;
/**
* The field of the column which triggers the event.
*/
field?: string;
};
}
/**
* Represents the object of the `onSortChange` Gantt event.
*/
export interface GanttSortChangeEvent extends GanttEvent {
/**
* 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` Gantt event.
*/
export interface GanttFilterChangeEvent extends GanttEvent {
/**
* 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` Gantt event.
*/
export interface GanttColumnMenuFilterChangeEvent extends GanttEvent {
/**
* 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` Gantt event.
*/
export interface GanttExpandChangeEvent extends GanttEvent {
/**
* 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 `onAddClick` Gantt event.
*/
export interface GanttAddClickEvent extends GanttEvent {
/**
* The direction of the add action.
*/
direction: AddDirection;
/**
* The data item which is currently selected.
*/
selectedDataItem?: any;
/**
* Current view first slot range start date.
*/
slotStart: Date;
/**
* Current view first slot range end date.
*/
slotEnd: Date;
}
/**
* Represents the object of the `onKeyDownEvent` Gantt event.
*/
export interface GanttKeyDownEvent extends GanttEvent, TableKeyDownEvent<GanttHandle> {
}
/**
* Represents the object of the `onHeaderSelectionChange` Gantt event.
*/
export interface GanttHeaderSelectionChangeEvent extends GanttEvent {
/**
* The field of the column in which the cell is located.
*/
field?: string;
}
/**
* Represents the object of the `onSelectionChange` Gantt event.
*/
export interface GanttSelectionChangeEvent extends GanttEvent, TableSelectionChangeEvent<GanttHandle> {
/**
* An array of indexes of each parent and current item in the data tree.
*/
level: number[];
}
/**
* Called every time the user changes the active `view`.
*/
export interface GanttViewChangeEvent extends GanttEvent {
/**
* The value of the selected view.
*/
value: string;
}
interface ColumnDragEvent {
/**
* An event target.
*/
target: GanttHandle;
/**
* A native DOM event.
*/
nativeEvent: any;
/**
* The current columns collection.
*/
columns: GanttColumnProps[];
}
/**
* Represents the object of the `onColumnResize` Gantt event.
*/
export interface GanttColumnResizeEvent 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` Gantt event.
*/
export interface GanttColumnReorderEvent extends ColumnDragEvent {
}
/**
* Represents the object of the `onRowClick` Gantt event.
*/
export interface GanttRowClickEvent extends GanttEvent {
/**
* 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` Gantt event.
*/
export interface GanttRowDoubleClickEvent extends GanttEvent {
/**
* 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` Gantt event.
*/
export interface GanttRowContextMenuEvent extends GanttEvent {
/**
* 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 `onTaskClick` Gantt event.
*/
export interface GanttTaskClickEvent extends GanttEvent {
/**
* The data item which corresponds to the clicked task.
*/
dataItem: any;
/**
* An array of indexes of each parent and current item in the data tree.
*/
level: number[];
}
/**
* Represents the object of the `onTaskDoubleClick` Gantt event.
*/
export interface GanttTaskDoubleClickEvent extends GanttEvent {
/**
* The data item which corresponds to the double clicked task.
*/
dataItem: any;
/**
* An array of indexes of each parent and current item in the data tree.
*/
level: number[];
}
/**
* Represents the object of the `onTaskContextMenu` Gantt event.
*/
export interface GanttTaskContextMenuEvent extends GanttEvent {
/**
* The data item which corresponds to the clicked task.
*/
dataItem: any;
/**
* An array of indexes of each parent and current item in the data tree.
*/
level: number[];
}
/**
* Represents the object of the `onTaskRemoveClick` Gantt event.
*/
export interface GanttTaskRemoveClickEvent extends GanttEvent {
/**
* The data item which corresponds to the clicked task.
*/
dataItem: any;
/**
* An array of indexes of each parent and current item in the data tree.
*/
level: number[];
}
/**
* Represents the object of the `onDependencyCreateEvent` Gantt event.
*/
export interface GanttDependencyCreateEvent extends GanttEvent {
/**
* The id of the source task.
*/
fromId: any;
/**
* The id of the destination task.
*/
toId: any;
/**
* The type of the dependency.
*/
type: number;
}
export {};