UNPKG

@progress/kendo-react-gantt

Version:

React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package

186 lines (185 loc) 7.39 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { TaskModelFields } from '../interfaces/TaskModelFields.js'; import { DependencyModelFields } from '../interfaces/DependencyModelFields.js'; import { Day } from '@progress/kendo-date-math'; import { DateRange } from '../interfaces/DateRange.js'; import { Slot } from '../interfaces/Slot.js'; import { IntlService } from '@progress/kendo-react-intl'; import { filterBy as filterByCommon, orderBy as orderByCommon } from '@progress/kendo-react-data-tools'; import { GanttTaskModelFields } from '../interfaces/GanttTaskModelFields.js'; import { GanttDependencyModelFields } from '../interfaces/GanttDependencyModelFields.js'; import { Rectangle } from '../interfaces/Rectangle.js'; import { GanttViewTimelineHeaderCellProps } from '../interfaces/GanttViewTimelineHeaderCellProps.js'; import * as React from 'react'; /** * Orders the specified tree according to the provided sort descriptors. * * @param {T[]} data - The data that will be sorted. * @param {SortDescriptor[]} descriptors - The descriptors by which the data will be sorted. * @param {string} subItemsField - The field which points to the subitems collection of each data item. * @returns {T[]} - The sorted data. */ export declare const orderBy: typeof orderByCommon; /** * Filters the provided data tree according to the specified `Array<FilterDescriptor|CompositeFilterDescriptor>`. * * @param {T[]} data - The data that will be filtered. * @param {FilterDescriptor[]|CompositeFilterDescriptor[]} descriptors - The filter criteria that will be applied. * @param {string} subItemsField - The field which points to the subitems collection of each data item. * @returns {T[]} - The filtered data. */ export declare const filterBy: typeof filterByCommon; /** * Creates a new array with the results of calling the provided callback function * on every element in the provided data tree. * * @param {any[]} tree - The data tree. * @param {string} subItemsField - The field which points to the subitems collection of each data item. * @param {(value: any) => any} callback - The callback function. * @returns {any[]} - The new data tree. */ export declare const mapTree: (tree: any[], subItemsField: string, callback: (value: any) => any) => any[]; /** * Similar to the `Object.assign` function. Additionally, creates a new array for the subitems. * * @param {object} item - The source data item. * @param {string} subItemsField - The field which points to the subitems collection of each data item. * @param {object} propsToExtend - The props with which the source data item will be extended. * @returns {object} - The target data item. */ export declare const extendDataItem: (item: any, subItemsField: string, propsToExtend?: any) => any; /** * Creates a tree from the passed dataset. * * @param {object[]} dataset - The source dataset of data items. * @param {(item: object) => any} getId - A function which will return the id of the data item. * @param {(item: object) => any} getParentId - A function which will return the data item id of its parent data item. * @param {string} subItemsField - The field which points to the subitems collection of each data item. * @returns {object[]} - A collection of the generated data items that are structured in a tree. */ export declare const createDataTree: (dataset: any[], getId: (item: any) => any, getParentId: (item: any) => any, subItemsField: string) => any[]; /** @hidden */ export declare const getTaskModelFields: (taskModelFields: GanttTaskModelFields | undefined) => { fields: TaskModelFields; }; /** @hidden */ export declare const getDependencyModelFields: (dependencyModelFields: GanttDependencyModelFields | undefined) => { fields: DependencyModelFields; }; /** @hidden */ export declare const getStartDate: (date: any) => Date; /** @hidden */ export declare const getEndDate: (date: any, numberOfDays?: any) => Date; /** @hidden */ export declare const isInRange: (slotStart: Date, slotEnd: Date, taskStart: Date, taskEnd: Date) => boolean; /** @hidden */ export declare function toUTCDateTime(localDate: Date): Date; /** @hidden */ export declare const ARROW_SIZE = 4; /** @hidden */ export declare const MIN_LINE_WIDTH = 10; /** @hidden */ export declare const dependencyCoordinates: (from: Rectangle, to: Rectangle, rowHeight: number, type: number) => { left: number; top: number; }[]; /** @hidden */ export declare const addArrow: (top: any, left: any, points: any, isArrowWest: any) => void; /** @hidden */ export declare const addArrowWest: (top: any, left: any, points: any) => void; /** @hidden */ export declare const addArrowEast: (top: any, left: any, points: any) => void; /** * @hidden */ export declare const getWorkDays: (options: { workWeekStart?: Day; workWeekEnd?: Day; }) => number[]; /** * @hidden */ export declare const isWorkDay: (date: any, workDays: any) => boolean; /** * @hidden */ export declare const toRanges: (dateRange: DateRange, { step, timezone }: { step: any; timezone: any; }) => DateRange[]; /** * @hidden */ export declare const toWeekRanges: (dateRange: DateRange, { timezone }: any, intl: any) => DateRange[]; /** * @hidden */ export declare const toMonthRanges: (dateRange: DateRange, { timezone }: any) => DateRange[]; /** * @hidden */ export declare const toYearRanges: (dateRange: DateRange, { timezone }: any) => DateRange[]; /** * @hidden */ export declare const getHourSlots: (range: DateRange, options: { workDayEnd: string; workDayStart: string; slotDuration: number; timezone?: string; }, intl: any) => Slot[]; /** * @hidden */ export declare const getDaySlots: (range: DateRange, options: { workDays: number[]; timezone?: string; }, intl: IntlService) => Slot[]; /** * @hidden */ export declare const getWeekSlots: (range: DateRange, options: { timezone?: string; }, intl: IntlService) => Slot[]; /** * @hidden */ export declare const getMonthSlots: (range: DateRange, options: { timezone?: string; }, intl: IntlService) => Slot[]; /** * @hidden */ export declare const getYearSlots: (range: DateRange, options: { timezone?: string; }, intl: IntlService) => Slot[]; /** * @hidden */ export declare const getTimelineHeader: (slotLevels: Slot[][], ref: React.MutableRefObject<HTMLTableElement | null>, timelineHeaderCell?: React.ComponentType<GanttViewTimelineHeaderCellProps>) => React.JSX.Element; /** * @hidden */ export declare const getTimelineContent: (slotLevels: Slot[][], ref: React.MutableRefObject<HTMLTableElement | null>) => React.JSX.Element; /** * @hidden */ export declare const getTimelineWidth: (slotLevels: Slot[][], slotWidth: number) => number; /** * @hidden */ export declare const isExpanded: (dataItem: any, expandedField: string) => boolean; /** * @hidden */ export declare const hasChildren: (dataItem: any, childrenField: string) => boolean; /** * @hidden */ export declare const expandedChildren: (expandedField: string, childrenField: string) => (dataItem: any) => any[];