gantt-task-react/src/types/public-types.ts

93 lines
2.0 KiB
TypeScript
Raw Normal View History

2020-07-22 20:50:43 +03:00
export enum ViewMode {
2020-08-05 08:14:22 +03:00
QuarterDay = "Quarter Day",
HalfDay = "Half Day",
Day = "Day",
2020-07-22 20:50:43 +03:00
/** ISO-8601 week */
2020-08-05 08:14:22 +03:00
Week = "Week",
Month = "Month",
2020-07-22 20:50:43 +03:00
}
export interface Task {
id: string;
name: string;
start: Date;
end: Date;
/**
* From 0 to 100
*/
progress: number;
styles?: {
backgroundColor?: string;
backgroundSelectedColor?: string;
progressColor?: string;
progressSelectedColor?: string;
};
isDisabled?: boolean;
dependencies?: string[];
}
export interface EventOption {
/**
* Time step value for date changes.
*/
timeStep?: number;
2020-08-11 01:16:53 +03:00
onDoubleClick?: (task: Task) => void;
2020-07-22 20:50:43 +03:00
onDateChange?: (task: Task) => void | Promise<any>;
onProgressChange?: (task: Task) => void | Promise<any>;
onTaskDelete?: (task: Task) => void | Promise<any>;
}
export interface DisplayOption {
viewMode?: ViewMode;
/**
2020-07-24 10:14:18 +03:00
* Specifies the month name language. Able formats: ISO 639-2, Java Locale
2020-07-22 20:50:43 +03:00
*/
locale?: string;
}
export interface StylingOption {
headerHeight?: number;
columnWidth?: number;
listCellWidth?: string;
2020-07-22 20:50:43 +03:00
rowHeight?: number;
ganttHeight?: number;
2020-07-22 20:50:43 +03:00
barCornerRadius?: number;
handleWidth?: number;
fontFamily?: string;
fontSize?: string;
/**
* How many of row width can be taken by task.
* From 0 to 100
*/
barFill?: number;
2020-07-30 00:01:51 +03:00
barProgressColor?: string;
barProgressSelectedColor?: string;
barBackgroundColor?: string;
barBackgroundSelectedColor?: string;
2020-07-22 20:50:43 +03:00
arrowColor?: string;
arrowIndent?: number;
2020-07-30 00:01:51 +03:00
todayColor?: string;
TooltipContent?: React.FC<{
task: Task;
fontSize: string;
fontFamily: string;
}>;
TaskListHeader?: React.SFC<{
headerHeight: number;
rowWidth: string;
fontFamily: string;
fontSize: string;
}>;
TaskListTable?: React.SFC<{
rowHeight: number;
rowWidth: string;
fontFamily: string;
fontSize: string;
locale: string;
tasks: Task[];
}>;
2020-07-22 20:50:43 +03:00
}
export interface GanttProps extends EventOption, DisplayOption, StylingOption {
tasks: Task[];
}