|
1 |
| -// Type definitions for dhtmlxGantt 8.0.1 |
| 1 | +// Type definitions for dhtmlxGantt 8.0.2 |
2 | 2 | // Project: https://dhtmlx.com/docs/products/dhtmlxGantt
|
3 | 3 |
|
4 | 4 | type GanttCallback = (...args: any[]) => any;
|
5 | 5 |
|
6 | 6 |
|
7 |
| -export type GanttEventName = "onAfterAutoSchedule" | "onAfterBatchUpdate" | "onAfterBranchLoading" | "onAfterLightbox" | "onAfterLinkAdd" | "onAfterLinkDelete" | "onAfterLinkUpdate" | "onAfterQuickInfo" | "onAfterRedo" | "onAfterRowResize" | "onAfterSort" | "onAfterTaskAdd" | "onAfterTaskAutoSchedule" | "onAfterTaskDelete" | "onAfterTaskDrag" | "onAfterTaskMove" | "onAfterTaskUpdate" | "onAfterUndo" | "onAjaxError" | "onAutoScheduleCircularLink" | "onBeforeAutoSchedule" | "onBeforeBatchUpdate" | "onBeforeBranchLoading" | "onBeforeCollapse" | "onBeforeDataRender" | "onBeforeExpand" | "onBeforeGanttReady" | "onBeforeGanttRender" | "onBeforeLightbox" | "onBeforeLinkAdd" | "onBeforeLinkDelete" | "onBeforeLinkDisplay" | "onBeforeLinkUpdate" | "onBeforeMultiSelect" | "onBeforeParse" | "onBeforeRedo" | "onBeforeRedoStack" | "onBeforeRowDragEnd" | "onBeforeRowDragMove" | "onBeforeRowResize" | "onBeforeRowResizeEnd" | "onBeforeTaskAdd" | "onBeforeTaskAutoSchedule" | "onBeforeTaskChanged" | "onBeforeTaskDelete" | "onBeforeTaskDisplay" | "onBeforeTaskDrag" | "onBeforeTaskMove" | "onBeforeTaskMultiSelect" | "onBeforeTaskSelected" | "onBeforeTaskUpdate" | "onBeforeUndo" | "onBeforeUndoStack" | "onCircularLinkError" | "onClear" | "onCollapse" | "onColumnResize" | "onColumnResizeEnd" | "onColumnResizeStart" | "onContextMenu" | "onDataProcessorReady" | "onDataRender" | "onDestroy" | "onEmptyClick" | "onError" | "onExpand" | "onGanttLayoutReady" | "onGanttReady" | "onGanttRender" | "onGanttScroll" | "onGridHeaderClick" | "onGridResize" | "onGridResizeEnd" | "onGridResizeStart" | "onLightbox" | "onLightboxButton" | "onLightboxCancel" | "onLightboxChange" | "onLightboxDelete" | "onLightboxSave" | "onLinkClick" | "onLinkCreated" | "onLinkDblClick" | "onLinkIdChange" | "onLinkValidation" | "onLoadEnd" | "onLoadStart" | "onMouseMove" | "onMultiSelect" | "onOptionsLoad" | "onParse" | "onQuickInfo" | "onRowDragEnd" | "onRowDragStart" | "onRowResize" | "onScaleAdjusted" | "onScaleClick" | "onTaskClick" | "onTaskClosed" | "onTaskCreated" | "onTaskDblClick" | "onTaskDrag" | "onTaskIdChange" | "onTaskLoading" | "onTaskMultiSelect" | "onTaskOpened" | "onTaskRowClick" | "onTaskSelected" | "onTaskUnselected" | "onTemplatesReady"; |
| 7 | +export type GanttEventName = "onAfterAutoSchedule" | "onAfterBatchUpdate" | "onAfterBranchLoading" | "onAfterLightbox" | "onAfterLinkAdd" | "onAfterLinkDelete" | "onAfterLinkUpdate" | "onAfterQuickInfo" | "onAfterRedo" | "onAfterRowResize" | "onAfterSort" | "onAfterTaskAdd" | "onAfterTaskAutoSchedule" | "onAfterTaskDelete" | "onAfterTaskDrag" | "onAfterTaskMove" | "onAfterTaskUpdate" | "onAfterUndo" | "onAjaxError" | "onAutoScheduleCircularLink" | "onBeforeAutoSchedule" | "onBeforeBatchUpdate" | "onBeforeBranchLoading" | "onBeforeCollapse" | "onBeforeDataRender" | "onBeforeExpand" | "onBeforeGanttReady" | "onBeforeGanttRender" | "onBeforeLightbox" | "onBeforeLinkAdd" | "onBeforeLinkDelete" | "onBeforeLinkDisplay" | "onBeforeLinkUpdate" | "onBeforeMultiSelect" | "onBeforeParse" | "onBeforeRedo" | "onBeforeRedoStack" | "onBeforeRollupTaskDisplay" | "onBeforeRowDragEnd" | "onBeforeRowDragMove" | "onBeforeRowResize" | "onBeforeRowResizeEnd" | "onBeforeSplitTaskDisplay" | "onBeforeTaskAdd" | "onBeforeTaskAutoSchedule" | "onBeforeTaskChanged" | "onBeforeTaskDelete" | "onBeforeTaskDisplay" | "onBeforeTaskDrag" | "onBeforeTaskMove" | "onBeforeTaskMultiSelect" | "onBeforeTaskSelected" | "onBeforeTaskUpdate" | "onBeforeUndo" | "onBeforeUndoStack" | "onCircularLinkError" | "onClear" | "onCollapse" | "onColumnResize" | "onColumnResizeEnd" | "onColumnResizeStart" | "onContextMenu" | "onDataProcessorReady" | "onDataRender" | "onDestroy" | "onEmptyClick" | "onError" | "onExpand" | "onGanttLayoutReady" | "onGanttReady" | "onGanttRender" | "onGanttScroll" | "onGridHeaderClick" | "onGridResize" | "onGridResizeEnd" | "onGridResizeStart" | "onLightbox" | "onLightboxButton" | "onLightboxCancel" | "onLightboxChange" | "onLightboxDelete" | "onLightboxSave" | "onLinkClick" | "onLinkCreated" | "onLinkDblClick" | "onLinkIdChange" | "onLinkValidation" | "onLoadEnd" | "onLoadStart" | "onMouseMove" | "onMultiSelect" | "onOptionsLoad" | "onParse" | "onQuickInfo" | "onRowDragEnd" | "onRowDragStart" | "onRowResize" | "onScaleAdjusted" | "onScaleClick" | "onTaskClick" | "onTaskClosed" | "onTaskCreated" | "onTaskDblClick" | "onTaskDrag" | "onTaskIdChange" | "onTaskLoading" | "onTaskMultiSelect" | "onTaskOpened" | "onTaskRowClick" | "onTaskSelected" | "onTaskUnselected" | "onTemplatesReady"; |
8 | 8 |
|
9 | 9 |
|
10 | 10 | export interface GanttTemplates {
|
@@ -286,6 +286,13 @@ export interface GanttTemplates {
|
286 | 286 | */
|
287 | 287 | timeline_cell_class(item: any, date: Date): string;
|
288 | 288 |
|
| 289 | + /** |
| 290 | + * specifies custom HTML content in the timeline cells |
| 291 | + * @param task the task's object |
| 292 | + * @param date the date of a cell |
| 293 | + */ |
| 294 | + timeline_cell_content(task: Task, date: Date): string; |
| 295 | + |
289 | 296 | /**
|
290 | 297 | * specifies the format of start and end dates displayed in the tooltip
|
291 | 298 | * @param date the date which needs formatting
|
@@ -372,11 +379,21 @@ export interface GanttConfigOptions {
|
372 | 379 | */
|
373 | 380 | auto_scheduling_move_projects: boolean;
|
374 | 381 |
|
| 382 | + /** |
| 383 | + * defines whether tasks should inherit the constraint type from their parent project |
| 384 | + */ |
| 385 | + auto_scheduling_project_constraint: boolean; |
| 386 | + |
375 | 387 | /**
|
376 | 388 | * enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date
|
377 | 389 | */
|
378 | 390 | auto_scheduling_strict: boolean;
|
379 | 391 |
|
| 392 | + /** |
| 393 | + * sets the way the scheduling algorithms process completed tasks |
| 394 | + */ |
| 395 | + auto_scheduling_use_progress: boolean; |
| 396 | + |
380 | 397 | /**
|
381 | 398 | * automatically converts tasks with subtasks to projects and projects without subtasks back to tasks
|
382 | 399 | */
|
@@ -765,7 +782,7 @@ export interface GanttConfigOptions {
|
765 | 782 | /**
|
766 | 783 | * adds an empty row into the end of the list of tasks to simplify tasks editing via keyboard
|
767 | 784 | */
|
768 |
| - placeholder_task: boolean; |
| 785 | + placeholder_task: any; |
769 | 786 |
|
770 | 787 | /**
|
771 | 788 | * preserves the current position of the vertical and horizontal scrolls while re-drawing the gantt chart
|
@@ -857,6 +874,11 @@ export interface GanttConfigOptions {
|
857 | 874 | */
|
858 | 875 | resource_store: string;
|
859 | 876 |
|
| 877 | + /** |
| 878 | + * defines an extra configuration for the resource store |
| 879 | + */ |
| 880 | + resources: any; |
| 881 | + |
860 | 882 | /**
|
861 | 883 | * sets the id of the virtual root element
|
862 | 884 | */
|
@@ -927,6 +949,11 @@ export interface GanttConfigOptions {
|
927 | 949 | */
|
928 | 950 | show_chart: boolean;
|
929 | 951 |
|
| 952 | + /** |
| 953 | + * defines whether to display the placeholder element inside the grid when it is empty |
| 954 | + */ |
| 955 | + show_empty_state: boolean; |
| 956 | + |
930 | 957 | /**
|
931 | 958 | * enables showing error alerts in case of unexpected behavior
|
932 | 959 | */
|
@@ -1057,6 +1084,11 @@ export interface GanttConfigOptions {
|
1057 | 1084 | */
|
1058 | 1085 | time_step: number;
|
1059 | 1086 |
|
| 1087 | + /** |
| 1088 | + * shows the background grid in the empty timeline |
| 1089 | + */ |
| 1090 | + timeline_placeholder: boolean; |
| 1091 | + |
1060 | 1092 | /**
|
1061 | 1093 | * sets the length of time, in milliseconds, before the tooltip hides
|
1062 | 1094 | */
|
@@ -1888,6 +1920,12 @@ export interface GanttStatic {
|
1888 | 1920 | */
|
1889 | 1921 | getLastSelectedTask(): string | number;
|
1890 | 1922 |
|
| 1923 | + /** |
| 1924 | + * returns the object of the layout view by its name |
| 1925 | + * @param name the name of the layout view |
| 1926 | + */ |
| 1927 | + getLayoutView(name: string): any; |
| 1928 | + |
1891 | 1929 | /**
|
1892 | 1930 | * gets the lightbox's HTML object element
|
1893 | 1931 | */
|
@@ -1975,8 +2013,9 @@ export interface GanttStatic {
|
1975 | 2013 | /**
|
1976 | 2014 | * returns all tasks assigned to the resource
|
1977 | 2015 | * @param resourceId the id of the resource
|
| 2016 | + * @param taskId the id of the task |
1978 | 2017 | */
|
1979 |
| - getResourceAssignments(resourceId: string | number): any[]; |
| 2018 | + getResourceAssignments(resourceId: string | number, taskId?: string | number): any[]; |
1980 | 2019 |
|
1981 | 2020 | /**
|
1982 | 2021 | * returns a calendar which the resource is assigned to
|
@@ -2063,8 +2102,9 @@ export interface GanttStatic {
|
2063 | 2102 | * finds a task by the specified criteria
|
2064 | 2103 | * @param propertyName the name of the property to match, or a filter function
|
2065 | 2104 | * @param propertyValue the property value
|
| 2105 | + * @param types an object with types of the tasks which should be returned |
2066 | 2106 | */
|
2067 |
| - getTaskBy(propertyName: string | GanttCallback, propertyValue?: string | number | any[]): Array<Task>; |
| 2107 | + getTaskBy(propertyName: string | GanttCallback, propertyValue?: string | number | any[], types?: any): Array<Task>; |
2068 | 2108 |
|
2069 | 2109 | /**
|
2070 | 2110 | * returns a task by its global task index
|
@@ -2353,7 +2393,7 @@ export interface GanttStatic {
|
2353 | 2393 | * @param tindex the index of the position that the task will be moved to <br> (the index within a branch)
|
2354 | 2394 | * @param parent the parent id. If specified, the <b>tindex</b> will refer to the index in the <br> <b>'parent'</b> branch
|
2355 | 2395 | */
|
2356 |
| - moveTask(sid: string | number, tindex: number, parent?: string | number): boolean | undefined; |
| 2396 | + moveTask(sid: string | number, tindex: number, parent?: string | number): boolean | void; |
2357 | 2397 |
|
2358 | 2398 | /**
|
2359 | 2399 | * opens the branch with the specified id
|
@@ -2470,6 +2510,14 @@ export interface GanttStatic {
|
2470 | 2510 | */
|
2471 | 2511 | roundTaskDates(task: Task): void;
|
2472 | 2512 |
|
| 2513 | + /** |
| 2514 | + * scrolls the layout view to the specified position |
| 2515 | + * @param name the name of the layout view |
| 2516 | + * @param x optional, value of horizontal scroll or 'null' (if the scroll position shouldn't be changed) |
| 2517 | + * @param y optional, value of vertical scroll or 'null' (if the scroll position shouldn't be changed) |
| 2518 | + */ |
| 2519 | + scrollLayoutCell(name: string, x: number | null, y: number | null): void; |
| 2520 | + |
2473 | 2521 | /**
|
2474 | 2522 | * scrolls the Gantt container to the specified position
|
2475 | 2523 | * @param x optional, value of horizontal scroll or 'null' (if the scroll position shouldn't be changed)
|
@@ -2759,7 +2807,6 @@ export interface Task {
|
2759 | 2807 |
|
2760 | 2808 | /**
|
2761 | 2809 | * the task type. The available values are stored in the api/gantt_types_config.md object:
|
2762 |
| - |
2763 | 2810 | "task" - a regular task (default value).
|
2764 | 2811 | "project" - a task that starts, when its earliest child task starts, and ends, when its latest child ends.
|
2765 | 2812 | The start_date, end_date, duration properties are ignored for such tasks.
|
@@ -2849,6 +2896,11 @@ export interface Task {
|
2849 | 2896 | */
|
2850 | 2897 | $raw?: object,
|
2851 | 2898 |
|
| 2899 | + /** |
| 2900 | + * The id of a row the rollup item / split task is rendered at. This is the temporary property which appears in the object of the rollup/split task only when it's been rendering on the page. |
| 2901 | + */ |
| 2902 | + $rendered_at?: string | number, |
| 2903 | + |
2852 | 2904 | /**
|
2853 | 2905 | * The id of the parent under which the task is rendered (not id of the real parent of the task). The property is used in internal calculations and on tasks' grouping.
|
2854 | 2906 | */
|
@@ -2922,7 +2974,6 @@ export interface Link {
|
2922 | 2974 |
|
2923 | 2975 | /**
|
2924 | 2976 | * the dependency type. The available values are stored in the api/gantt_links_config.md object. By default, they are:
|
2925 |
| - |
2926 | 2977 | "0" - 'finish_to_start'.
|
2927 | 2978 | "1" - 'start_to_start'.
|
2928 | 2979 | "2" - 'finish_to_finish'.
|
@@ -3056,7 +3107,14 @@ export interface GridColumn {
|
3056 | 3107 | * @param the Task object
|
3057 | 3108 | * @param the HTML element of the Grid cell
|
3058 | 3109 | */
|
3059 |
| - onrender?(task: Task, node: HTMLElement): any |
| 3110 | + onrender?(task: Task, node: HTMLElement): any, |
| 3111 | + |
| 3112 | + /** |
| 3113 | + * sort configuration after clicking on the column header. When it is set to *false*, sorting is disabled. Otherwise you can set a different task property in the *string* to sort the column or use a custom sorting function |
| 3114 | + * @param the first task that will be sorted |
| 3115 | + * @param the second task that will be sorted |
| 3116 | + */ |
| 3117 | + sort?: boolean | string | ((task1: Task, task2: Task,) => any) |
3060 | 3118 | }
|
3061 | 3119 |
|
3062 | 3120 | export interface DateHelpers {
|
@@ -4628,8 +4686,65 @@ export interface Formatters {
|
4628 | 4686 | ): LinkFormatter
|
4629 | 4687 | }
|
4630 | 4688 |
|
| 4689 | +export interface EmptyState { |
| 4690 | + |
| 4691 | + /** |
| 4692 | + * an array with the IDs of the attached handlers. Modified by the *attachAddTaskEvent* and *detachAddTaskEvents* methods. |
| 4693 | + */ |
| 4694 | + clickEvents?: Array<string>, |
| 4695 | + |
| 4696 | + /** |
| 4697 | + * returns *true* if there is no data loaded into the Gantt chart, otherwise |
| 4698 | + * @param the container element |
| 4699 | + */ |
| 4700 | + isGanttEmpty(container: HTMLElement): boolean, |
| 4701 | + |
| 4702 | + /** |
| 4703 | + * returns *true* if the api/gantt_show_empty_state_config.md property is enabled, otherwise |
| 4704 | + * @param the container element |
| 4705 | + */ |
| 4706 | + isEnabled(container: HTMLElement): boolean, |
| 4707 | + |
| 4708 | + /** |
| 4709 | + * puts an HTML content into the empty state element. The method can be redefined. |
| 4710 | + * @param the container element |
| 4711 | + */ |
| 4712 | + renderContent(container: HTMLElement): void, |
| 4713 | + |
| 4714 | + /** |
| 4715 | + * returns the DOM element where the empty state will be attached to. By default, returns the grid element (the "empty state" will be displayed in the grid). If there is no grid, returns the timeline element (the "empty state" will be displayed in the timeline). The method can be redefined. |
| 4716 | + */ |
| 4717 | + getContainer(): HTMLElement | null, |
| 4718 | + |
| 4719 | + /** |
| 4720 | + * returns the DOM node of the empty state element. |
| 4721 | + */ |
| 4722 | + getNode(): HTMLElement | null, |
| 4723 | + |
| 4724 | + /** |
| 4725 | + * displays the "empty state". Returns *false* if there is no container for the Empty State Element. The extension calls the method by itself |
| 4726 | + */ |
| 4727 | + show(): null | void, |
| 4728 | + |
| 4729 | + /** |
| 4730 | + * hides the "empty state". Returns *false* if there is no Empty State Element node, so there is nothing to hide. The extension calls the method by itself |
| 4731 | + */ |
| 4732 | + hide(): boolean | void, |
| 4733 | + |
| 4734 | + /** |
| 4735 | + * adds the handler that will fire after clicking on the Empty State Element. By default, used to add a new task. |
| 4736 | + */ |
| 4737 | + attachAddTaskEvent(): void, |
| 4738 | + |
| 4739 | + /** |
| 4740 | + * removes the handlers that were used to add a task after clicking on the Empty State Element. |
| 4741 | + */ |
| 4742 | + detachAddTaskEvents(): void |
| 4743 | +} |
| 4744 | + |
4631 | 4745 | export interface Ext {
|
4632 | 4746 | inlineEditors: InlineEditorMethods,
|
| 4747 | + emptyStateElement: EmptyState, |
4633 | 4748 | fullscreen: Fullscreen,
|
4634 | 4749 | formatters: Formatters,
|
4635 | 4750 | keyboardNavigation: KeyNav,
|
|
0 commit comments