ngx-core-components 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/charts/gantt-chart/gantt-chart.component.d.ts +79 -10
- package/charts/gantt-chart/models/gantt-baseline.model.d.ts +5 -0
- package/charts/gantt-chart/models/gantt-config.model.d.ts +74 -1
- package/charts/gantt-chart/models/gantt-dependency.model.d.ts +4 -1
- package/charts/gantt-chart/models/gantt-event.model.d.ts +71 -1
- package/charts/gantt-chart/models/gantt-group.model.d.ts +7 -0
- package/charts/gantt-chart/models/gantt-task.model.d.ts +40 -0
- package/charts/gantt-chart/models/index.d.ts +2 -0
- package/charts/gantt-chart/services/gantt-layout.service.d.ts +9 -2
- package/charts/gantt-chart/services/gantt-print.service.d.ts +24 -0
- package/charts/gantt-chart/utils/date-utils.d.ts +8 -0
- package/charts/gantt-chart/utils/svg-utils.d.ts +2 -2
- package/charts/public-api.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +1223 -883
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GanttTask, GanttDependency, GanttConfig, GanttColumnDef, ZoomLevel, GanttTaskChangeEvent, GanttTaskClickEvent, GanttDependencyClickEvent, GanttScrollEvent } from './models';
|
|
1
|
+
import { GanttTask, GanttSubtask, GanttDependency, GanttConfig, GanttColumnDef, ZoomLevel, GanttGroup, GanttBaselineItem, GanttTaskChangeEvent, GanttTaskClickEvent, GanttDependencyClickEvent, GanttScrollEvent, GanttDragEvent, GanttLinkDragEvent, GanttLineClickEvent, GanttBarClickEvent, GanttSelectedEvent, GanttTableDragStartedEvent, GanttTableDragEndedEvent, GanttTableDragDroppedEvent, GanttLoadOnScrollEvent, GanttVirtualScrolledIndexChangeEvent, GanttViewChangeEvent, GanttExpandChangeEvent } from './models';
|
|
2
2
|
import { FlatRow } from './services/gantt-layout.service';
|
|
3
3
|
import { GanttKeyboardService } from './services/gantt-keyboard.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -6,25 +6,47 @@ export declare class GanttChartComponent {
|
|
|
6
6
|
tasks: import("@angular/core").InputSignal<GanttTask[]>;
|
|
7
7
|
dependencies: import("@angular/core").InputSignal<GanttDependency[]>;
|
|
8
8
|
config: import("@angular/core").InputSignal<Partial<GanttConfig>>;
|
|
9
|
+
groups: import("@angular/core").InputSignal<GanttGroup<unknown>[]>;
|
|
10
|
+
baselineItems: import("@angular/core").InputSignal<GanttBaselineItem[]>;
|
|
9
11
|
taskChange: import("@angular/core").OutputEmitterRef<GanttTaskChangeEvent>;
|
|
10
12
|
taskClick: import("@angular/core").OutputEmitterRef<GanttTaskClickEvent>;
|
|
11
13
|
taskDblClick: import("@angular/core").OutputEmitterRef<GanttTaskClickEvent>;
|
|
12
14
|
dependencyClick: import("@angular/core").OutputEmitterRef<GanttDependencyClickEvent>;
|
|
13
15
|
scroll: import("@angular/core").OutputEmitterRef<GanttScrollEvent>;
|
|
14
16
|
zoomChange: import("@angular/core").OutputEmitterRef<ZoomLevel>;
|
|
17
|
+
dragStarted: import("@angular/core").OutputEmitterRef<GanttDragEvent>;
|
|
18
|
+
dragMoved: import("@angular/core").OutputEmitterRef<GanttDragEvent>;
|
|
19
|
+
dragEnded: import("@angular/core").OutputEmitterRef<GanttDragEvent>;
|
|
20
|
+
linkDragStarted: import("@angular/core").OutputEmitterRef<GanttLinkDragEvent>;
|
|
21
|
+
linkDragEnded: import("@angular/core").OutputEmitterRef<GanttLinkDragEvent>;
|
|
22
|
+
lineClick: import("@angular/core").OutputEmitterRef<GanttLineClickEvent>;
|
|
23
|
+
barClick: import("@angular/core").OutputEmitterRef<GanttBarClickEvent>;
|
|
24
|
+
selectedChange: import("@angular/core").OutputEmitterRef<GanttSelectedEvent>;
|
|
25
|
+
viewChange: import("@angular/core").OutputEmitterRef<GanttViewChangeEvent>;
|
|
26
|
+
expandChange: import("@angular/core").OutputEmitterRef<GanttExpandChangeEvent>;
|
|
27
|
+
loadOnScroll: import("@angular/core").OutputEmitterRef<GanttLoadOnScrollEvent>;
|
|
28
|
+
virtualScrolledIndexChange: import("@angular/core").OutputEmitterRef<GanttVirtualScrolledIndexChangeEvent>;
|
|
29
|
+
tableDragStarted: import("@angular/core").OutputEmitterRef<GanttTableDragStartedEvent>;
|
|
30
|
+
tableDragEnded: import("@angular/core").OutputEmitterRef<GanttTableDragEndedEvent>;
|
|
31
|
+
tableDragDropped: import("@angular/core").OutputEmitterRef<GanttTableDragDroppedEvent>;
|
|
15
32
|
private scaleService;
|
|
16
33
|
private layoutService;
|
|
17
34
|
keyboardService: GanttKeyboardService;
|
|
35
|
+
private printService;
|
|
36
|
+
private elementRef;
|
|
18
37
|
private timelineContent;
|
|
19
38
|
private treelistContent;
|
|
20
39
|
private internalCollapsed;
|
|
40
|
+
private internalGroupExpanded;
|
|
21
41
|
hoveredTaskId: import("@angular/core").WritableSignal<string | null>;
|
|
22
|
-
|
|
42
|
+
private selectedTaskIds;
|
|
23
43
|
scrollLeft: import("@angular/core").WritableSignal<number>;
|
|
24
|
-
private scrollTop_;
|
|
25
44
|
private sidebarWidthOverride;
|
|
26
45
|
private lastEmittedZoom;
|
|
46
|
+
showLoading: import("@angular/core").WritableSignal<boolean>;
|
|
47
|
+
private loadingTimer;
|
|
27
48
|
tooltipTask: import("@angular/core").WritableSignal<GanttTask | null>;
|
|
49
|
+
tooltipSubtask: import("@angular/core").WritableSignal<GanttSubtask | null>;
|
|
28
50
|
tooltipX: import("@angular/core").WritableSignal<number>;
|
|
29
51
|
tooltipY: import("@angular/core").WritableSignal<number>;
|
|
30
52
|
rowTooltipData: import("@angular/core").WritableSignal<{
|
|
@@ -32,11 +54,23 @@ export declare class GanttChartComponent {
|
|
|
32
54
|
} | null>;
|
|
33
55
|
rowTooltipX: import("@angular/core").WritableSignal<number>;
|
|
34
56
|
rowTooltipY: import("@angular/core").WritableSignal<number>;
|
|
57
|
+
linkDragLine: import("@angular/core").WritableSignal<{
|
|
58
|
+
x1: number;
|
|
59
|
+
y1: number;
|
|
60
|
+
x2: number;
|
|
61
|
+
y2: number;
|
|
62
|
+
} | null>;
|
|
63
|
+
private linkDragSource;
|
|
64
|
+
private tableDragSourceRow;
|
|
65
|
+
private virtualRange;
|
|
35
66
|
mergedConfig: import("@angular/core").Signal<GanttConfig>;
|
|
67
|
+
themeVars: import("@angular/core").Signal<string>;
|
|
36
68
|
sidebarColumns: import("@angular/core").Signal<GanttColumnDef[]>;
|
|
37
69
|
private effectiveTasks;
|
|
70
|
+
private effectiveGroups;
|
|
38
71
|
private flatRows;
|
|
39
72
|
visibleRows: import("@angular/core").Signal<FlatRow[]>;
|
|
73
|
+
renderedRows: import("@angular/core").Signal<FlatRow[]>;
|
|
40
74
|
private dateRange;
|
|
41
75
|
private columnDates;
|
|
42
76
|
totalWidth: import("@angular/core").Signal<number>;
|
|
@@ -64,49 +98,84 @@ export declare class GanttChartComponent {
|
|
|
64
98
|
barHeight: number;
|
|
65
99
|
rowIndex: number;
|
|
66
100
|
primaryTaskId: string;
|
|
101
|
+
isGroupHeader: boolean;
|
|
102
|
+
}[]>;
|
|
103
|
+
baselineBars: import("@angular/core").Signal<{
|
|
104
|
+
id: string;
|
|
105
|
+
start: Date;
|
|
106
|
+
end: Date;
|
|
107
|
+
left: number;
|
|
108
|
+
width: number;
|
|
109
|
+
top: number;
|
|
67
110
|
}[]>;
|
|
68
111
|
dependencyPaths: import("@angular/core").Signal<{
|
|
69
112
|
dependency: GanttDependency;
|
|
70
113
|
path: string;
|
|
71
114
|
key: string;
|
|
115
|
+
color: string;
|
|
72
116
|
}[]>;
|
|
73
117
|
constructor();
|
|
118
|
+
isTaskSelected(taskId: string): boolean;
|
|
119
|
+
private toggleSelection;
|
|
74
120
|
onTimelineScroll(): void;
|
|
75
121
|
onSplitBarDown(event: PointerEvent): void;
|
|
76
122
|
onBarPointerDown(event: PointerEvent, task: GanttTask, mode: 'move' | 'resize-left' | 'resize-right'): void;
|
|
123
|
+
onLinkDragStart(event: PointerEvent, task: GanttTask, side: 'start' | 'end'): void;
|
|
124
|
+
onTableDragStart(event: DragEvent, row: FlatRow): void;
|
|
125
|
+
onTableDragEnd(_event: DragEvent, row: FlatRow): void;
|
|
126
|
+
onTableDragOver(event: DragEvent, row: FlatRow): void;
|
|
127
|
+
onTableDrop(event: DragEvent, targetRow: FlatRow): void;
|
|
77
128
|
onRowClick(task: GanttTask, event: MouseEvent): void;
|
|
78
129
|
onTaskBarClick(task: GanttTask, event: MouseEvent): void;
|
|
79
130
|
onTaskBarDblClick(task: GanttTask, event: MouseEvent): void;
|
|
80
131
|
onDependencyClick(dep: GanttDependency, event: MouseEvent): void;
|
|
81
132
|
onToggleCollapse(taskId: string): void;
|
|
133
|
+
onToggleGroupCollapse(group: GanttGroup): void;
|
|
134
|
+
onToolbarViewChange(vt: ZoomLevel): void;
|
|
135
|
+
getViewLabel(vt: ZoomLevel): string;
|
|
82
136
|
onKeyDown(event: KeyboardEvent): void;
|
|
137
|
+
scrollToToday(): void;
|
|
83
138
|
scrollToDate(date: Date): void;
|
|
84
139
|
scrollToTask(taskId: string): void;
|
|
85
140
|
expandAll(): void;
|
|
86
141
|
collapseAll(): void;
|
|
142
|
+
exportAsImage(filename?: string): Promise<void>;
|
|
143
|
+
getImageDataUrl(): Promise<string | null>;
|
|
144
|
+
isSelected(taskId: string): boolean;
|
|
145
|
+
getSelectedIds(): string[];
|
|
146
|
+
rerenderView(): void;
|
|
87
147
|
formatDateShort(date: Date): string;
|
|
88
148
|
formatDateFull(date: Date): string;
|
|
89
|
-
isNameColumn(
|
|
90
|
-
isDateColumn(
|
|
91
|
-
isProgressColumn(
|
|
92
|
-
getSidebarCellValue(row: FlatRow,
|
|
149
|
+
isNameColumn(col: GanttColumnDef, index: number): boolean;
|
|
150
|
+
isDateColumn(col: GanttColumnDef): boolean;
|
|
151
|
+
isProgressColumn(col: GanttColumnDef): boolean;
|
|
152
|
+
getSidebarCellValue(row: FlatRow, col: GanttColumnDef): string;
|
|
93
153
|
showTooltip(task: GanttTask, event: MouseEvent): void;
|
|
154
|
+
showSubtaskTooltip(task: GanttTask, subtask: GanttSubtask, event: MouseEvent): void;
|
|
94
155
|
hideTooltip(): void;
|
|
95
|
-
getRowStart(row: FlatRow): Date;
|
|
96
|
-
getRowEnd(row: FlatRow): Date;
|
|
97
156
|
getRowAvgProgress(row: FlatRow): number;
|
|
98
157
|
getRowProgressTitle(row: FlatRow): string;
|
|
99
158
|
getMetaEntries(meta: Record<string, unknown> | undefined): {
|
|
100
159
|
key: string;
|
|
101
160
|
value: string;
|
|
102
161
|
}[];
|
|
162
|
+
getSubtaskBars(bar: {
|
|
163
|
+
task: GanttTask;
|
|
164
|
+
left: number;
|
|
165
|
+
width: number;
|
|
166
|
+
}): {
|
|
167
|
+
subtask: GanttSubtask;
|
|
168
|
+
left: number;
|
|
169
|
+
width: number;
|
|
170
|
+
}[];
|
|
103
171
|
showRowTooltip(row: FlatRow, event: MouseEvent): void;
|
|
104
172
|
updateRowTooltip(event: MouseEvent): void;
|
|
105
173
|
hideRowTooltip(): void;
|
|
174
|
+
toStyleStr(style: Partial<CSSStyleDeclaration>): string;
|
|
106
175
|
private positionRowTooltip;
|
|
107
176
|
private getPrimaryLabel;
|
|
108
177
|
private getSecondaryLabel;
|
|
109
178
|
private getMsPerUnit;
|
|
110
179
|
static ɵfac: i0.ɵɵFactoryDeclaration<GanttChartComponent, never>;
|
|
111
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GanttChartComponent, "ngx-gantt-chart", never, { "tasks": { "alias": "tasks"; "required": true; "isSignal": true; }; "dependencies": { "alias": "dependencies"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "taskChange": "taskChange"; "taskClick": "taskClick"; "taskDblClick": "taskDblClick"; "dependencyClick": "dependencyClick"; "scroll": "scroll"; "zoomChange": "zoomChange"; }, never, never, true, never>;
|
|
180
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttChartComponent, "ngx-gantt-chart", never, { "tasks": { "alias": "tasks"; "required": true; "isSignal": true; }; "dependencies": { "alias": "dependencies"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "groups": { "alias": "groups"; "required": false; "isSignal": true; }; "baselineItems": { "alias": "baselineItems"; "required": false; "isSignal": true; }; }, { "taskChange": "taskChange"; "taskClick": "taskClick"; "taskDblClick": "taskDblClick"; "dependencyClick": "dependencyClick"; "scroll": "scroll"; "zoomChange": "zoomChange"; "dragStarted": "dragStarted"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "linkDragStarted": "linkDragStarted"; "linkDragEnded": "linkDragEnded"; "lineClick": "lineClick"; "barClick": "barClick"; "selectedChange": "selectedChange"; "viewChange": "viewChange"; "expandChange": "expandChange"; "loadOnScroll": "loadOnScroll"; "virtualScrolledIndexChange": "virtualScrolledIndexChange"; "tableDragStarted": "tableDragStarted"; "tableDragEnded": "tableDragEnded"; "tableDragDropped": "tableDragDropped"; }, never, never, true, never>;
|
|
112
181
|
}
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
import { GanttTask } from './gantt-task.model';
|
|
2
2
|
export declare enum ZoomLevel {
|
|
3
|
+
Hour = "hour",
|
|
3
4
|
Day = "day",
|
|
4
5
|
Week = "week",
|
|
5
|
-
Month = "month"
|
|
6
|
+
Month = "month",
|
|
7
|
+
Quarter = "quarter",
|
|
8
|
+
Year = "year"
|
|
9
|
+
}
|
|
10
|
+
export declare enum GanttLinkLineType {
|
|
11
|
+
Curve = "curve",
|
|
12
|
+
Straight = "straight"
|
|
13
|
+
}
|
|
14
|
+
export interface GanttLinkOptions {
|
|
15
|
+
dependencyTypes?: ('FS' | 'SS' | 'FF' | 'SF')[];
|
|
16
|
+
showArrow?: boolean;
|
|
17
|
+
lineType?: GanttLinkLineType;
|
|
18
|
+
}
|
|
19
|
+
export interface GanttToolbarOptions {
|
|
20
|
+
viewTypes?: ZoomLevel[];
|
|
21
|
+
}
|
|
22
|
+
export interface GanttThemeColors {
|
|
23
|
+
primary?: string;
|
|
24
|
+
danger?: string;
|
|
25
|
+
highlight?: string;
|
|
26
|
+
background?: string;
|
|
27
|
+
text?: {
|
|
28
|
+
main?: string;
|
|
29
|
+
muted?: string;
|
|
30
|
+
light?: string;
|
|
31
|
+
inverse?: string;
|
|
32
|
+
};
|
|
33
|
+
gray?: {
|
|
34
|
+
100?: string;
|
|
35
|
+
200?: string;
|
|
36
|
+
300?: string;
|
|
37
|
+
400?: string;
|
|
38
|
+
500?: string;
|
|
39
|
+
600?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface GanttStyleOptions {
|
|
43
|
+
primaryColor?: string;
|
|
44
|
+
headerHeight?: number;
|
|
45
|
+
rowHeight?: number;
|
|
46
|
+
barHeight?: number;
|
|
47
|
+
defaultTheme?: string;
|
|
48
|
+
themes?: Record<string, GanttThemeColors>;
|
|
6
49
|
}
|
|
7
50
|
export interface GanttColumnDef {
|
|
8
51
|
field: string | ((task: GanttTask) => string);
|
|
@@ -21,5 +64,35 @@ export interface GanttConfig {
|
|
|
21
64
|
headerHeight: number;
|
|
22
65
|
snapTo: 'none' | 'day' | 'hour';
|
|
23
66
|
locale: string;
|
|
67
|
+
/** Enable drag to create dependency links between tasks */
|
|
68
|
+
linkable: boolean;
|
|
69
|
+
/** Link rendering options */
|
|
70
|
+
linkOptions: GanttLinkOptions;
|
|
71
|
+
/** Enable task selection (single or multi) */
|
|
72
|
+
selectable: boolean;
|
|
73
|
+
/** Allow selecting multiple tasks (requires selectable: true) */
|
|
74
|
+
multiple: boolean;
|
|
75
|
+
/** Show built-in toolbar with view type switcher */
|
|
76
|
+
showToolbar: boolean;
|
|
77
|
+
/** Toolbar configuration */
|
|
78
|
+
toolbarOptions: GanttToolbarOptions;
|
|
79
|
+
/** Style/theme options */
|
|
80
|
+
styleOptions: GanttStyleOptions;
|
|
81
|
+
/** Enable virtual scrolling for large datasets */
|
|
82
|
+
virtualScrollEnabled: boolean;
|
|
83
|
+
/** Show loading overlay */
|
|
84
|
+
loading: boolean;
|
|
85
|
+
/** Delay in ms before showing loading indicator */
|
|
86
|
+
loadingDelay: number;
|
|
87
|
+
/** Show baseline comparison bars */
|
|
88
|
+
showBaseline: boolean;
|
|
89
|
+
/** Enable table row drag and drop */
|
|
90
|
+
tableDraggable: boolean;
|
|
91
|
+
/** Emit load event when scrolling near edges */
|
|
92
|
+
loadOnScroll: boolean;
|
|
93
|
+
/** Maximum nesting level for tree hierarchy */
|
|
94
|
+
maxLevel: number;
|
|
95
|
+
/** Bar height in pixels */
|
|
96
|
+
barHeight: number;
|
|
24
97
|
}
|
|
25
98
|
export declare const DEFAULT_GANTT_CONFIG: GanttConfig;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GanttTask } from './gantt-task.model';
|
|
2
|
-
import { GanttDependency } from './gantt-dependency.model';
|
|
2
|
+
import { GanttDependency, DependencyType } from './gantt-dependency.model';
|
|
3
|
+
import { GanttGroup } from './gantt-group.model';
|
|
3
4
|
export interface GanttTaskChangeEvent {
|
|
4
5
|
task: GanttTask;
|
|
5
6
|
previousStart: Date;
|
|
@@ -19,3 +20,72 @@ export interface GanttScrollEvent {
|
|
|
19
20
|
visibleStartDate: Date;
|
|
20
21
|
visibleEndDate: Date;
|
|
21
22
|
}
|
|
23
|
+
/** Emitted when a bar drag starts, moves, or ends. */
|
|
24
|
+
export interface GanttDragEvent {
|
|
25
|
+
task: GanttTask;
|
|
26
|
+
}
|
|
27
|
+
/** Emitted during link-drag operations. */
|
|
28
|
+
export interface GanttLinkDragEvent {
|
|
29
|
+
source: GanttTask;
|
|
30
|
+
target?: GanttTask;
|
|
31
|
+
type?: DependencyType;
|
|
32
|
+
}
|
|
33
|
+
/** Emitted when a dependency line is clicked. */
|
|
34
|
+
export interface GanttLineClickEvent {
|
|
35
|
+
event: MouseEvent;
|
|
36
|
+
source: GanttTask;
|
|
37
|
+
target: GanttTask;
|
|
38
|
+
}
|
|
39
|
+
/** Emitted when a bar is clicked. */
|
|
40
|
+
export interface GanttBarClickEvent {
|
|
41
|
+
event: Event;
|
|
42
|
+
task: GanttTask;
|
|
43
|
+
}
|
|
44
|
+
/** Emitted when task selection changes. */
|
|
45
|
+
export interface GanttSelectedEvent {
|
|
46
|
+
event: Event;
|
|
47
|
+
current: GanttTask;
|
|
48
|
+
selectedValue: GanttTask | GanttTask[];
|
|
49
|
+
}
|
|
50
|
+
/** Emitted when table row drag starts. */
|
|
51
|
+
export interface GanttTableDragStartedEvent {
|
|
52
|
+
source: GanttTask;
|
|
53
|
+
sourceParent: GanttTask | null;
|
|
54
|
+
}
|
|
55
|
+
/** Emitted when table row drag ends. */
|
|
56
|
+
export interface GanttTableDragEndedEvent {
|
|
57
|
+
source: GanttTask;
|
|
58
|
+
sourceParent: GanttTask | null;
|
|
59
|
+
}
|
|
60
|
+
/** Emitted when a table row is dropped into a new position. */
|
|
61
|
+
export interface GanttTableDragDroppedEvent {
|
|
62
|
+
source: GanttTask;
|
|
63
|
+
sourceParent: GanttTask | null;
|
|
64
|
+
target: GanttTask;
|
|
65
|
+
targetParent: GanttTask | null;
|
|
66
|
+
dropPosition: 'before' | 'inside' | 'after';
|
|
67
|
+
}
|
|
68
|
+
/** Emitted when scroll reaches near edges (for infinite loading). */
|
|
69
|
+
export interface GanttLoadOnScrollEvent {
|
|
70
|
+
start: Date;
|
|
71
|
+
end: Date;
|
|
72
|
+
}
|
|
73
|
+
/** Emitted when virtual scroll index changes. */
|
|
74
|
+
export interface GanttVirtualScrolledIndexChangeEvent {
|
|
75
|
+
index: number;
|
|
76
|
+
renderedRange: {
|
|
77
|
+
start: number;
|
|
78
|
+
end: number;
|
|
79
|
+
};
|
|
80
|
+
count: number;
|
|
81
|
+
}
|
|
82
|
+
/** Emitted when the view type changes. */
|
|
83
|
+
export interface GanttViewChangeEvent {
|
|
84
|
+
viewType: string;
|
|
85
|
+
}
|
|
86
|
+
/** Emitted when a group or item expand state changes. */
|
|
87
|
+
export interface GanttExpandChangeEvent {
|
|
88
|
+
item?: GanttTask;
|
|
89
|
+
group?: GanttGroup;
|
|
90
|
+
expanded: boolean;
|
|
91
|
+
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
export declare enum GanttItemType {
|
|
2
|
+
Bar = "bar",
|
|
3
|
+
Range = "range",
|
|
4
|
+
Custom = "custom"
|
|
5
|
+
}
|
|
6
|
+
export interface GanttSubtask {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
start: Date;
|
|
10
|
+
end: Date;
|
|
11
|
+
color: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
progress?: number;
|
|
14
|
+
meta?: Record<string, unknown>;
|
|
15
|
+
cssClass?: string;
|
|
16
|
+
}
|
|
1
17
|
export interface GanttTask {
|
|
2
18
|
id: string;
|
|
3
19
|
name: string;
|
|
@@ -13,4 +29,28 @@ export interface GanttTask {
|
|
|
13
29
|
cssClass?: string;
|
|
14
30
|
/** Tasks sharing the same rowId (and the same parentId) are rendered in a single row. */
|
|
15
31
|
rowId?: string;
|
|
32
|
+
/** Subtasks rendered as colored segments inside this task's bar. */
|
|
33
|
+
subtasks?: GanttSubtask[];
|
|
34
|
+
/** Group ID for group mode — tasks with same group_id are grouped together. */
|
|
35
|
+
group_id?: string;
|
|
36
|
+
/** Whether this specific item can be dragged in the sidebar table. */
|
|
37
|
+
itemDraggable?: boolean;
|
|
38
|
+
/** Whether dependency links can be created from/to this task. Defaults to true when linkable is enabled. */
|
|
39
|
+
linkable?: boolean;
|
|
40
|
+
/** Whether the task can be expanded to show children (auto-detected from children/parentId). */
|
|
41
|
+
expandable?: boolean;
|
|
42
|
+
/** Item display type: bar (default), range, or custom. */
|
|
43
|
+
type?: GanttItemType;
|
|
44
|
+
/** Custom style overrides for the task bar element. */
|
|
45
|
+
barStyle?: Partial<CSSStyleDeclaration>;
|
|
46
|
+
/** Custom style overrides for the task's lane (row background). */
|
|
47
|
+
laneStyle?: Partial<CSSStyleDeclaration>;
|
|
48
|
+
/** Dependency links defined on this item (alternative to top-level dependencies input). */
|
|
49
|
+
links?: (string | {
|
|
50
|
+
type: 'FS' | 'SS' | 'FF' | 'SF';
|
|
51
|
+
link: string;
|
|
52
|
+
color?: string;
|
|
53
|
+
})[];
|
|
54
|
+
/** Children items for tree hierarchy (alternative to parentId). */
|
|
55
|
+
children?: GanttTask[];
|
|
16
56
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { GanttTask } from '../models';
|
|
1
|
+
import { GanttTask } from '../models/gantt-task.model';
|
|
2
|
+
import { GanttGroup } from '../models/gantt-group.model';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export interface FlatRow {
|
|
4
5
|
task: GanttTask;
|
|
@@ -8,9 +9,15 @@ export interface FlatRow {
|
|
|
8
9
|
rowIndex: number;
|
|
9
10
|
hasChildren: boolean;
|
|
10
11
|
isVisible: boolean;
|
|
12
|
+
/** Set when this row is a group header. */
|
|
13
|
+
group?: GanttGroup;
|
|
14
|
+
/** Whether this is a group header row. */
|
|
15
|
+
isGroupHeader: boolean;
|
|
11
16
|
}
|
|
12
17
|
export declare class GanttLayoutService {
|
|
13
|
-
flattenTasks(tasks: GanttTask[]): FlatRow[];
|
|
18
|
+
flattenTasks(tasks: GanttTask[], groups?: GanttGroup[]): FlatRow[];
|
|
19
|
+
private flattenTree;
|
|
20
|
+
private flattenWithGroups;
|
|
14
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<GanttLayoutService, never>;
|
|
15
22
|
static ɵprov: i0.ɵɵInjectableDeclaration<GanttLayoutService>;
|
|
16
23
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service for exporting the gantt chart as a PNG image.
|
|
5
|
+
* Requires html2canvas as an optional peer dependency for full export.
|
|
6
|
+
* Falls back to SVG serialization if html2canvas is not available.
|
|
7
|
+
*/
|
|
8
|
+
export declare class GanttPrintService {
|
|
9
|
+
private root;
|
|
10
|
+
register(rootRef: ElementRef<HTMLElement>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Export the gantt chart as a PNG data URL.
|
|
13
|
+
* Uses the Canvas API to capture the rendered content.
|
|
14
|
+
*/
|
|
15
|
+
exportAsImage(ignoreElementClass?: string): Promise<string | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Download the gantt chart as a PNG file.
|
|
18
|
+
*/
|
|
19
|
+
print(name?: string, ignoreElementClass?: string): Promise<void>;
|
|
20
|
+
private loadHtml2Canvas;
|
|
21
|
+
private fallbackCapture;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttPrintService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GanttPrintService>;
|
|
24
|
+
}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { ZoomLevel } from '../models';
|
|
2
2
|
export declare function addDays(date: Date, days: number): Date;
|
|
3
|
+
export declare function addHours(date: Date, hours: number): Date;
|
|
3
4
|
export declare function diffDays(a: Date, b: Date): number;
|
|
5
|
+
export declare function diffHours(a: Date, b: Date): number;
|
|
6
|
+
export declare function startOfHour(date: Date): Date;
|
|
4
7
|
export declare function startOfDay(date: Date): Date;
|
|
5
8
|
export declare function startOfWeek(date: Date, weekStartsOn?: number): Date;
|
|
6
9
|
export declare function startOfMonth(date: Date): Date;
|
|
10
|
+
export declare function startOfQuarter(date: Date): Date;
|
|
11
|
+
export declare function startOfYear(date: Date): Date;
|
|
7
12
|
export declare function addMonths(date: Date, months: number): Date;
|
|
13
|
+
export declare function addQuarters(date: Date, quarters: number): Date;
|
|
14
|
+
export declare function addYears(date: Date, years: number): Date;
|
|
8
15
|
export declare function addWeeks(date: Date, weeks: number): Date;
|
|
9
16
|
export declare function isWeekend(date: Date): boolean;
|
|
17
|
+
export declare function daysInMonth(date: Date): number;
|
|
10
18
|
export declare function getDateRange(tasks: {
|
|
11
19
|
start: Date;
|
|
12
20
|
end: Date;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DependencyType } from '../models';
|
|
1
|
+
import { DependencyType, GanttLinkLineType } from '../models';
|
|
2
2
|
export interface Rect {
|
|
3
3
|
x: number;
|
|
4
4
|
y: number;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
}
|
|
8
|
-
export declare function computeDependencyPath(from: Rect, to: Rect, type: DependencyType, offset?: number): string;
|
|
8
|
+
export declare function computeDependencyPath(from: Rect, to: Rect, type: DependencyType, offset?: number, lineType?: GanttLinkLineType): string;
|
package/charts/public-api.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { CHART_COLORS } from './shared/chart-utils';
|
|
|
7
7
|
export { GanttChartComponent } from './gantt-chart/gantt-chart.component';
|
|
8
8
|
export * from './gantt-chart/models';
|
|
9
9
|
export { GanttScaleService } from './gantt-chart/services/gantt-scale.service';
|
|
10
|
+
export { GanttPrintService } from './gantt-chart/services/gantt-print.service';
|
|
10
11
|
export type { FlatRow } from './gantt-chart/services/gantt-layout.service';
|
|
11
12
|
export * from './gantt-chart/utils/date-utils';
|