@worktile/gantt 15.0.0 → 15.1.0-next.0
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/class/event.d.ts +13 -0
- package/class/item.d.ts +7 -1
- package/components/bar/bar-drag.d.ts +10 -0
- package/components/bar/bar.component.d.ts +2 -1
- package/components/bar/bar.component.scss +22 -0
- package/components/calendar/calendar.scss +91 -0
- package/components/calendar/grid/calendar-grid.component.d.ts +24 -0
- package/components/calendar/header/calendar-header.component.d.ts +21 -0
- package/components/icon/icons.d.ts +1 -0
- package/components/links/links.component.d.ts +5 -5
- package/components/main/gantt-main.component.d.ts +3 -3
- package/components/table/body/gantt-table-body.component.d.ts +58 -0
- package/components/table/gantt-table.component.scss +169 -85
- package/components/table/gantt-table.scss +271 -0
- package/components/table/header/gantt-table-header.component.d.ts +31 -0
- package/esm2020/class/event.mjs +5 -1
- package/esm2020/class/item.mjs +9 -4
- package/esm2020/components/bar/bar-drag.mjs +106 -42
- package/esm2020/components/bar/bar.component.mjs +8 -2
- package/esm2020/components/calendar/grid/calendar-grid.component.mjs +71 -0
- package/esm2020/components/calendar/header/calendar-header.component.mjs +67 -0
- package/esm2020/components/icon/icons.mjs +4 -2
- package/esm2020/components/links/links.component.mjs +72 -54
- package/esm2020/components/main/gantt-main.component.mjs +5 -5
- package/esm2020/components/table/body/gantt-table-body.component.mjs +286 -0
- package/esm2020/components/table/header/gantt-table-header.component.mjs +140 -0
- package/esm2020/gantt-dom.service.mjs +8 -12
- package/esm2020/gantt-item-upper.mjs +15 -6
- package/esm2020/gantt-print.service.mjs +2 -2
- package/esm2020/gantt-upper.mjs +18 -15
- package/esm2020/gantt.component.mjs +114 -24
- package/esm2020/gantt.module.mjs +25 -10
- package/esm2020/root.component.mjs +10 -8
- package/esm2020/table/gantt-table.component.mjs +12 -4
- package/esm2020/utils/helpers.mjs +11 -1
- package/fesm2015/worktile-gantt.mjs +900 -377
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +891 -379
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt-dom.service.d.ts +1 -0
- package/gantt-item-upper.d.ts +3 -2
- package/gantt-upper.d.ts +4 -1
- package/gantt.component.d.ts +20 -7
- package/gantt.component.scss +35 -0
- package/gantt.module.d.ts +18 -15
- package/package.json +1 -1
- package/root.component.d.ts +1 -1
- package/styles/index.scss +4 -2
- package/styles/variables.scss +9 -7
- package/table/gantt-table.component.d.ts +5 -2
- package/components/calendar/calendar.component.d.ts +0 -26
- package/components/table/gantt-table.component.d.ts +0 -42
- package/esm2020/components/calendar/calendar.component.mjs +0 -88
- package/esm2020/components/table/gantt-table.component.mjs +0 -166
package/class/event.d.ts
CHANGED
|
@@ -30,3 +30,16 @@ export declare class GanttSelectedEvent<T = unknown> {
|
|
|
30
30
|
event: Event;
|
|
31
31
|
selectedValue: GanttItem<T> | GanttItem<T>[];
|
|
32
32
|
}
|
|
33
|
+
export declare class GanttTableDragDroppedEvent<T = unknown> {
|
|
34
|
+
source: GanttItem<T>;
|
|
35
|
+
sourceParent: GanttItem<T>;
|
|
36
|
+
target: GanttItem<T>;
|
|
37
|
+
targetParent: GanttItem<T>;
|
|
38
|
+
dropPosition: GanttTableDropPosition;
|
|
39
|
+
}
|
|
40
|
+
export type GanttTableDropPosition = 'before' | 'inside' | 'after';
|
|
41
|
+
export declare class GanttTableDragEnterPredicateContext<T = unknown> {
|
|
42
|
+
source: GanttItem<T>;
|
|
43
|
+
target: GanttItem<T>;
|
|
44
|
+
dropPosition: GanttTableDropPosition;
|
|
45
|
+
}
|
package/class/item.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GanttDate } from '../utils/date';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { GanttLink } from './link';
|
|
4
|
+
import { GanttViewType } from './view-type';
|
|
4
5
|
export interface GanttItemRefs {
|
|
5
6
|
width: number;
|
|
6
7
|
x: number;
|
|
@@ -19,6 +20,7 @@ export interface GanttItem<T = unknown> {
|
|
|
19
20
|
group_id?: string;
|
|
20
21
|
links?: (GanttLink | string)[];
|
|
21
22
|
draggable?: boolean;
|
|
23
|
+
itemDraggable?: boolean;
|
|
22
24
|
linkable?: boolean;
|
|
23
25
|
expandable?: boolean;
|
|
24
26
|
expanded?: boolean;
|
|
@@ -38,6 +40,7 @@ export declare class GanttItemInternal {
|
|
|
38
40
|
color?: string;
|
|
39
41
|
barStyle?: Partial<CSSStyleDeclaration>;
|
|
40
42
|
draggable?: boolean;
|
|
43
|
+
itemDraggable?: boolean;
|
|
41
44
|
linkable?: boolean;
|
|
42
45
|
origin: GanttItem;
|
|
43
46
|
expandable?: boolean;
|
|
@@ -47,6 +50,8 @@ export declare class GanttItemInternal {
|
|
|
47
50
|
type?: GanttItemType;
|
|
48
51
|
progress?: number;
|
|
49
52
|
fillDays?: number;
|
|
53
|
+
viewType?: GanttViewType;
|
|
54
|
+
level?: number;
|
|
50
55
|
get refs(): {
|
|
51
56
|
width: number;
|
|
52
57
|
x: number;
|
|
@@ -57,12 +62,13 @@ export declare class GanttItemInternal {
|
|
|
57
62
|
x: number;
|
|
58
63
|
y: number;
|
|
59
64
|
}>;
|
|
60
|
-
constructor(item: GanttItem, options?: {
|
|
65
|
+
constructor(item: GanttItem, level?: number, options?: {
|
|
61
66
|
fillDays: number;
|
|
62
67
|
});
|
|
63
68
|
fillItemStartOrEnd(item: GanttItem): void;
|
|
64
69
|
updateRefs(refs: GanttItemRefs): void;
|
|
65
70
|
updateDate(start: GanttDate, end: GanttDate): void;
|
|
71
|
+
updateLevel(level: number): void;
|
|
66
72
|
addChildren(items: GanttItem[]): void;
|
|
67
73
|
setExpand(expanded: boolean): void;
|
|
68
74
|
addLink(link: GanttLink): void;
|
|
@@ -17,10 +17,17 @@ export declare class GanttBarDrag implements OnDestroy {
|
|
|
17
17
|
private get dragDisabled();
|
|
18
18
|
private get linkDragDisabled();
|
|
19
19
|
private linkDraggingLine;
|
|
20
|
+
private dropListRef;
|
|
20
21
|
private barDragRef;
|
|
21
22
|
private dragRefs;
|
|
22
23
|
private destroy$;
|
|
24
|
+
private containerScrollLeft;
|
|
25
|
+
private barDragMoveDistance;
|
|
26
|
+
private barHandleDragMoveDistance;
|
|
27
|
+
private dragScrolling;
|
|
23
28
|
constructor(dragDrop: DragDrop, dom: GanttDomService, dragContainer: GanttDragContainer, root: NgxGanttRootComponent);
|
|
29
|
+
private createDragRef;
|
|
30
|
+
private createDragScrollEvent;
|
|
24
31
|
private createMouseEvents;
|
|
25
32
|
private createBarDrag;
|
|
26
33
|
private createBarHandleDrags;
|
|
@@ -29,10 +36,13 @@ export declare class GanttBarDrag implements OnDestroy {
|
|
|
29
36
|
private closeDragBackdrop;
|
|
30
37
|
private setDraggingStyles;
|
|
31
38
|
private clearDraggingStyles;
|
|
39
|
+
private barDragMove;
|
|
40
|
+
private barHandleDragMove;
|
|
32
41
|
private calcLinkLinePositions;
|
|
33
42
|
private createLinkDraggingLine;
|
|
34
43
|
private destroyLinkDraggingLine;
|
|
35
44
|
createDrags(elementRef: ElementRef, item: GanttItemInternal, ganttUpper: GanttUpper): void;
|
|
45
|
+
updateItem(item: GanttItemInternal): void;
|
|
36
46
|
ngOnDestroy(): void;
|
|
37
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<GanttBarDrag, [null, null, null, { skipSelf: true; }]>;
|
|
38
48
|
static ɵprov: i0.ɵɵInjectableDeclaration<GanttBarDrag>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit, ElementRef, OnChanges, OnDestroy, EventEmitter, AfterViewInit, QueryList, NgZone } from '@angular/core';
|
|
1
|
+
import { OnInit, ElementRef, OnChanges, OnDestroy, EventEmitter, AfterViewInit, QueryList, NgZone, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { GanttBarDrag } from './bar-drag';
|
|
3
3
|
import { GanttDragContainer } from '../../gantt-drag-container';
|
|
4
4
|
import { GanttBarClickEvent } from '../../class';
|
|
@@ -16,6 +16,7 @@ export declare class NgxGanttBarComponent extends GanttItemUpper implements OnIn
|
|
|
16
16
|
handles: QueryList<ElementRef<HTMLElement>>;
|
|
17
17
|
constructor(dragContainer: GanttDragContainer, drag: GanttBarDrag, elementRef: ElementRef<HTMLDivElement>, ganttUpper: GanttUpper, ngZone: NgZone);
|
|
18
18
|
ngOnInit(): void;
|
|
19
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
19
20
|
ngAfterViewInit(): void;
|
|
20
21
|
onBarClick(event: Event): void;
|
|
21
22
|
private setContentBackground;
|
|
@@ -157,6 +157,12 @@ $gantt-bar-link-drop-border: 5px;
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
&-draggable-drag {
|
|
161
|
+
.gantt-bar-layer {
|
|
162
|
+
visibility: hidden;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
160
166
|
&-active {
|
|
161
167
|
@include active-bar();
|
|
162
168
|
}
|
|
@@ -198,4 +204,20 @@ $gantt-bar-link-drop-border: 5px;
|
|
|
198
204
|
}
|
|
199
205
|
}
|
|
200
206
|
}
|
|
207
|
+
|
|
208
|
+
// 强制去掉 cdk drag placeholder 默认样式
|
|
209
|
+
&.cdk-drag-placeholder,
|
|
210
|
+
.drag-handles .handle.cdk-drag-placeholder {
|
|
211
|
+
background: none !important;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.handle.cdk-drag-preview {
|
|
216
|
+
visibility: hidden;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.gantt-bar.cdk-drag-preview {
|
|
220
|
+
.gantt-bar-layer {
|
|
221
|
+
display: none;
|
|
222
|
+
}
|
|
201
223
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@use '../../styles/variables';
|
|
2
|
+
|
|
3
|
+
.gantt-calendar {
|
|
4
|
+
display: block;
|
|
5
|
+
height: 100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
svg {
|
|
9
|
+
position: relative;
|
|
10
|
+
z-index: 1;
|
|
11
|
+
background-color: variables.$gantt-bg-color;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
}
|
|
14
|
+
line {
|
|
15
|
+
shape-rendering: crispEdges;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.primary-line {
|
|
19
|
+
stroke: variables.$gantt-date-primary-border;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.gantt-calendar-today-overlay {
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
.today-rect {
|
|
26
|
+
width: 35px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
position: absolute;
|
|
29
|
+
background: variables.$gantt-date-today-color;
|
|
30
|
+
color: variables.$gantt-date-today-text-color;
|
|
31
|
+
text-align: center;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
}
|
|
34
|
+
.today-line {
|
|
35
|
+
position: absolute;
|
|
36
|
+
width: 3px;
|
|
37
|
+
background: variables.$gantt-date-today-color;
|
|
38
|
+
transform: scaleX(0.5);
|
|
39
|
+
transform-origin: 100% 0;
|
|
40
|
+
margin-left: -2px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.gantt-calendar-header {
|
|
46
|
+
position: relative;
|
|
47
|
+
z-index: 2;
|
|
48
|
+
height: variables.$gantt-header-height;
|
|
49
|
+
.gantt-calendar-today-overlay {
|
|
50
|
+
z-index: 2;
|
|
51
|
+
}
|
|
52
|
+
.header-line {
|
|
53
|
+
stroke: variables.$gantt-border-color;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.primary-text {
|
|
57
|
+
fill: variables.$gantt-date-primary-color;
|
|
58
|
+
font-size: variables.$gantt-date-primary-font-size;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.secondary-text {
|
|
62
|
+
fill: variables.$gantt-date-secondary-color;
|
|
63
|
+
font-size: variables.$gantt-date-secondary-font-size;
|
|
64
|
+
|
|
65
|
+
&-weekend {
|
|
66
|
+
fill: variables.$gantt-date-secondary-weekend-color;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.primary-text,
|
|
71
|
+
.secondary-text {
|
|
72
|
+
text-anchor: middle;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.gantt-calendar-grid {
|
|
77
|
+
position: absolute;
|
|
78
|
+
width: 100%;
|
|
79
|
+
.gantt-calendar-grid-main {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.secondary-line {
|
|
84
|
+
stroke-dasharray: 2px 5px;
|
|
85
|
+
stroke: #cacaca;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.secondary-backdrop {
|
|
89
|
+
fill: variables.$gantt-date-week-backdrop-bg;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, NgZone, ElementRef } from '@angular/core';
|
|
2
|
+
import { GanttDatePoint } from '../../../class/date-point';
|
|
3
|
+
import { GanttUpper } from '../../../gantt-upper';
|
|
4
|
+
import { GanttViewType } from './../../../class/view-type';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class GanttCalendarGridComponent implements OnInit, OnDestroy {
|
|
7
|
+
ganttUpper: GanttUpper;
|
|
8
|
+
private ngZone;
|
|
9
|
+
private elementRef;
|
|
10
|
+
get view(): import("@worktile/gantt").GanttView;
|
|
11
|
+
private unsubscribe$;
|
|
12
|
+
headerHeight: number;
|
|
13
|
+
mainHeight: number;
|
|
14
|
+
todayBorderRadius: number;
|
|
15
|
+
viewTypes: typeof GanttViewType;
|
|
16
|
+
className: string;
|
|
17
|
+
constructor(ganttUpper: GanttUpper, ngZone: NgZone, elementRef: ElementRef<HTMLElement>);
|
|
18
|
+
setTodayPoint(): void;
|
|
19
|
+
ngOnInit(): void;
|
|
20
|
+
trackBy(point: GanttDatePoint, index: number): string | number;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttCalendarGridComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttCalendarGridComponent, "gantt-calendar-grid", never, {}, {}, never, never, false, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnInit, NgZone, ElementRef } from '@angular/core';
|
|
2
|
+
import { GanttDatePoint } from '../../../class/date-point';
|
|
3
|
+
import { GanttUpper } from '../../../gantt-upper';
|
|
4
|
+
import { GanttViewType } from '../../../class';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class GanttCalendarHeaderComponent implements OnInit {
|
|
7
|
+
ganttUpper: GanttUpper;
|
|
8
|
+
private ngZone;
|
|
9
|
+
private elementRef;
|
|
10
|
+
get view(): import("@worktile/gantt").GanttView;
|
|
11
|
+
private unsubscribe$;
|
|
12
|
+
headerHeight: number;
|
|
13
|
+
viewTypes: typeof GanttViewType;
|
|
14
|
+
className: string;
|
|
15
|
+
constructor(ganttUpper: GanttUpper, ngZone: NgZone, elementRef: ElementRef<HTMLElement>);
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
setTodayPoint(): void;
|
|
18
|
+
trackBy(point: GanttDatePoint, index: number): string | number;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttCalendarHeaderComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttCalendarHeaderComponent, "gantt-calendar-header", never, {}, {}, never, never, false, never>;
|
|
21
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit, EventEmitter, ChangeDetectorRef, ElementRef, OnDestroy, OnChanges } from '@angular/core';
|
|
1
|
+
import { OnInit, EventEmitter, ChangeDetectorRef, ElementRef, OnDestroy, OnChanges, NgZone } from '@angular/core';
|
|
2
2
|
import { GanttGroupInternal } from '../../class/group';
|
|
3
3
|
import { GanttItemInternal } from './../../class/item';
|
|
4
4
|
import { GanttLineClickEvent } from '../../class/event';
|
|
@@ -11,8 +11,8 @@ export declare class GanttLinksComponent implements OnInit, OnChanges, OnDestroy
|
|
|
11
11
|
private cdr;
|
|
12
12
|
private elementRef;
|
|
13
13
|
private ganttDragContainer;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
private ngZone;
|
|
15
|
+
flatData: (GanttGroupInternal | GanttItemInternal)[];
|
|
16
16
|
lineClick: EventEmitter<GanttLineClickEvent<unknown>>;
|
|
17
17
|
links: LinkInternal[];
|
|
18
18
|
ganttLinkTypes: typeof GanttLinkType;
|
|
@@ -22,7 +22,7 @@ export declare class GanttLinksComponent implements OnInit, OnChanges, OnDestroy
|
|
|
22
22
|
private linkLine;
|
|
23
23
|
private unsubscribe$;
|
|
24
24
|
ganttLinksOverlay: boolean;
|
|
25
|
-
constructor(ganttUpper: GanttUpper, cdr: ChangeDetectorRef, elementRef: ElementRef, ganttDragContainer: GanttDragContainer);
|
|
25
|
+
constructor(ganttUpper: GanttUpper, cdr: ChangeDetectorRef, elementRef: ElementRef, ganttDragContainer: GanttDragContainer, ngZone: NgZone);
|
|
26
26
|
ngOnInit(): void;
|
|
27
27
|
ngOnChanges(): void;
|
|
28
28
|
private computeItemPosition;
|
|
@@ -33,5 +33,5 @@ export declare class GanttLinksComponent implements OnInit, OnChanges, OnDestroy
|
|
|
33
33
|
mouseLeavePath(link: LinkInternal): void;
|
|
34
34
|
ngOnDestroy(): void;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<GanttLinksComponent, never>;
|
|
36
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GanttLinksComponent, "gantt-links-overlay", never, { "
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttLinksComponent, "gantt-links-overlay", never, { "flatData": "flatData"; }, { "lineClick": "lineClick"; }, never, never, false, never>;
|
|
37
37
|
}
|
|
@@ -4,8 +4,8 @@ import { GanttUpper } from '../../gantt-upper';
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class GanttMainComponent {
|
|
6
6
|
ganttUpper: GanttUpper;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
renderData: (GanttGroupInternal | GanttItemInternal)[];
|
|
8
|
+
flatData: (GanttGroupInternal | GanttItemInternal)[];
|
|
9
9
|
groupHeaderTemplate: TemplateRef<any>;
|
|
10
10
|
itemTemplate: TemplateRef<any>;
|
|
11
11
|
barTemplate: TemplateRef<any>;
|
|
@@ -16,5 +16,5 @@ export declare class GanttMainComponent {
|
|
|
16
16
|
constructor(ganttUpper: GanttUpper);
|
|
17
17
|
trackBy(index: number, item: GanttGroupInternal | GanttItemInternal): string | number;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<GanttMainComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GanttMainComponent, "gantt-main", never, { "
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttMainComponent, "gantt-main", never, { "renderData": "renderData"; "flatData": "flatData"; "groupHeaderTemplate": "groupHeaderTemplate"; "itemTemplate": "itemTemplate"; "barTemplate": "barTemplate"; "rangeTemplate": "rangeTemplate"; }, { "barClick": "barClick"; "lineClick": "lineClick"; }, never, never, false, never>;
|
|
20
20
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TemplateRef, QueryList, OnInit, EventEmitter, OnDestroy, ChangeDetectorRef, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { GanttItemInternal, GanttGroupInternal, GanttSelectedEvent, GanttTableDragEnterPredicateContext, GanttTableDragDroppedEvent } from '../../../class';
|
|
3
|
+
import { NgxGanttTableColumnComponent } from '../../../table/gantt-column.component';
|
|
4
|
+
import { GanttAbstractComponent } from '../../../gantt-abstract';
|
|
5
|
+
import { GanttUpper } from '../../../gantt-upper';
|
|
6
|
+
import { CdkDrag, CdkDragDrop, CdkDragEnd, CdkDragMove, CdkDragStart } from '@angular/cdk/drag-drop';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class GanttTableBodyComponent implements OnInit, OnDestroy, AfterViewInit {
|
|
9
|
+
gantt: GanttAbstractComponent;
|
|
10
|
+
ganttUpper: GanttUpper;
|
|
11
|
+
private cdr;
|
|
12
|
+
private document;
|
|
13
|
+
private _renderData;
|
|
14
|
+
set renderData(data: (GanttGroupInternal | GanttItemInternal)[]);
|
|
15
|
+
get renderData(): (GanttGroupInternal | GanttItemInternal)[];
|
|
16
|
+
flatData: (GanttGroupInternal | GanttItemInternal)[];
|
|
17
|
+
columns: QueryList<NgxGanttTableColumnComponent>;
|
|
18
|
+
groupTemplate: TemplateRef<any>;
|
|
19
|
+
emptyTemplate: TemplateRef<any>;
|
|
20
|
+
rowBeforeTemplate: TemplateRef<any>;
|
|
21
|
+
rowAfterTemplate: TemplateRef<any>;
|
|
22
|
+
draggable: boolean;
|
|
23
|
+
dropEnterPredicate?: (context: GanttTableDragEnterPredicateContext) => boolean;
|
|
24
|
+
dragDropped: EventEmitter<GanttTableDragDroppedEvent<unknown>>;
|
|
25
|
+
itemClick: EventEmitter<GanttSelectedEvent<unknown>>;
|
|
26
|
+
ganttTableClass: boolean;
|
|
27
|
+
ganttTableEmptyClass: boolean;
|
|
28
|
+
ganttTableDragging: boolean;
|
|
29
|
+
cdkDrags: QueryList<CdkDrag<GanttItemInternal>>;
|
|
30
|
+
hasGroup: boolean;
|
|
31
|
+
hasExpandIcon: boolean;
|
|
32
|
+
private itemDragRefMap;
|
|
33
|
+
private itemDragMoved;
|
|
34
|
+
private itemDropTarget;
|
|
35
|
+
private destroy$;
|
|
36
|
+
constructor(gantt: GanttAbstractComponent, ganttUpper: GanttUpper, cdr: ChangeDetectorRef, document: Document);
|
|
37
|
+
ngOnInit(): void;
|
|
38
|
+
ngAfterViewInit(): void;
|
|
39
|
+
expandGroup(group: GanttGroupInternal): void;
|
|
40
|
+
expandChildren(event: MouseEvent, item: GanttItemInternal): void;
|
|
41
|
+
onItemDragStarted(event: CdkDragStart<GanttItemInternal>): void;
|
|
42
|
+
emitItemDragMoved(event: CdkDragMove): void;
|
|
43
|
+
onItemDragMoved(event: CdkDragMove<GanttItemInternal>): void;
|
|
44
|
+
onItemDragEnded(event: CdkDragEnd<GanttItemInternal>): void;
|
|
45
|
+
onListDropped(event: CdkDragDrop<GanttItemInternal[], GanttItemInternal[], GanttItemInternal>): void;
|
|
46
|
+
trackBy(index: number, item: GanttGroupInternal | GanttItemInternal): string | number;
|
|
47
|
+
ngOnDestroy(): void;
|
|
48
|
+
private removeItem;
|
|
49
|
+
private insertItem;
|
|
50
|
+
private insertChildrenItem;
|
|
51
|
+
private getParentByItem;
|
|
52
|
+
private getChildrenElementsByDragRef;
|
|
53
|
+
private getTargetPosition;
|
|
54
|
+
private showDropPositionPlaceholder;
|
|
55
|
+
private cleanupDragArtifacts;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttTableBodyComponent, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GanttTableBodyComponent, "gantt-table-body", never, { "renderData": "renderData"; "flatData": "flatData"; "columns": "columns"; "groupTemplate": "groupTemplate"; "emptyTemplate": "emptyTemplate"; "rowBeforeTemplate": "rowBeforeTemplate"; "rowAfterTemplate": "rowAfterTemplate"; "draggable": "draggable"; "dropEnterPredicate": "dropEnterPredicate"; }, { "dragDropped": "dragDropped"; "itemClick": "itemClick"; }, never, never, false, never>;
|
|
58
|
+
}
|
|
@@ -1,7 +1,148 @@
|
|
|
1
1
|
@use '../../styles/variables';
|
|
2
2
|
|
|
3
|
+
@mixin gantt-table-item-base() {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
border-bottom: 1px solid variables.$gantt-border-color;
|
|
8
|
+
|
|
9
|
+
.gantt-table-column {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
border-right: 1px solid variables.$gantt-border-color;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
&:last-child {
|
|
16
|
+
border-right: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@mixin gantt-table-item {
|
|
22
|
+
@include gantt-table-item-base();
|
|
23
|
+
position: relative;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
&-first-level-group {
|
|
27
|
+
background: variables.$gantt-group-background-color;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-with-group {
|
|
31
|
+
.gantt-table-column {
|
|
32
|
+
&:first-child {
|
|
33
|
+
padding: 0 15px 0 32px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.gantt-table-column {
|
|
39
|
+
display: flex;
|
|
40
|
+
padding: variables.$gantt-table-td-padding;
|
|
41
|
+
|
|
42
|
+
&:last-child {
|
|
43
|
+
border-right: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.gantt-table-column-content {
|
|
48
|
+
flex: 1;
|
|
49
|
+
position: relative;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.gantt-expand-icon {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
width: 20px;
|
|
58
|
+
color: #aaa;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.gantt-drag-handle {
|
|
62
|
+
width: 1rem;
|
|
63
|
+
padding: 0 5px 0 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin-left: -10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:hover {
|
|
70
|
+
background-color: variables.$gantt-container-background-color;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-active {
|
|
74
|
+
background-color: rgba($color: variables.$gantt-table-header-drag-line-color, $alpha: 0.1);
|
|
75
|
+
&:hover {
|
|
76
|
+
background-color: rgba($color: variables.$gantt-table-header-drag-line-color, $alpha: 0.1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@mixin gantt-items-drag-drop() {
|
|
82
|
+
.cdk-drag-preview.gantt-table-item {
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
box-shadow: 0px 0px 8px 2px rgba(0, 0, 0, 0.08);
|
|
85
|
+
opacity: 0.9;
|
|
86
|
+
@include gantt-table-item();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.gantt-table.gantt-table-draggable {
|
|
90
|
+
.cdk-drag-placeholder {
|
|
91
|
+
display: none !important;
|
|
92
|
+
& + .cdk-drop-list {
|
|
93
|
+
display: none !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cdk-drag-disabled.gantt-table-item {
|
|
98
|
+
.gantt-drag-handle {
|
|
99
|
+
svg {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.drop-position-inside {
|
|
106
|
+
// border: 2px dashed variables.$gantt-primary-color !important;
|
|
107
|
+
.gantt-table-column {
|
|
108
|
+
height: 100%;
|
|
109
|
+
border-top: 2px dashed variables.$gantt-primary-color !important;
|
|
110
|
+
border-bottom: 2px dashed variables.$gantt-primary-color !important;
|
|
111
|
+
&:first-child {
|
|
112
|
+
border-left: 2px dashed variables.$gantt-primary-color !important;
|
|
113
|
+
}
|
|
114
|
+
&:last-child {
|
|
115
|
+
border-right: 2px dashed variables.$gantt-primary-color !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.drop-position-before {
|
|
121
|
+
background: #f5f5f5;
|
|
122
|
+
border-top: 2px solid variables.$gantt-primary-color !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.drop-position-after {
|
|
126
|
+
background: #f5f5f5;
|
|
127
|
+
border-bottom: 2px solid variables.$gantt-primary-color !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.gantt-table-dragging {
|
|
131
|
+
.gantt-table-item {
|
|
132
|
+
&:hover {
|
|
133
|
+
background: unset !important;
|
|
134
|
+
.gantt-drag-handle {
|
|
135
|
+
visibility: hidden !important;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
3
143
|
.gantt-table {
|
|
4
144
|
display: block;
|
|
145
|
+
|
|
5
146
|
&-empty {
|
|
6
147
|
height: 100%;
|
|
7
148
|
position: relative;
|
|
@@ -24,48 +165,6 @@
|
|
|
24
165
|
}
|
|
25
166
|
}
|
|
26
167
|
|
|
27
|
-
&-drag-trigger {
|
|
28
|
-
width: variables.$gantt-table-header-drag-line-width;
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
cursor: ew-resize;
|
|
34
|
-
z-index: 1;
|
|
35
|
-
|
|
36
|
-
&:hover {
|
|
37
|
-
background: variables.$gantt-table-header-drag-line-color;
|
|
38
|
-
z-index: 2;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&-drag-auxiliary-line {
|
|
43
|
-
width: variables.$gantt-table-header-drag-line-width;
|
|
44
|
-
background: variables.$gantt-table-header-drag-line-color;
|
|
45
|
-
position: absolute;
|
|
46
|
-
top: 0;
|
|
47
|
-
bottom: 0;
|
|
48
|
-
z-index: 100;
|
|
49
|
-
display: none;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.gantt-table-row {
|
|
53
|
-
display: flex;
|
|
54
|
-
box-sizing: border-box;
|
|
55
|
-
border-bottom: 1px solid variables.$gantt-border-color;
|
|
56
|
-
|
|
57
|
-
.gantt-table-column {
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
border-right: 1px solid variables.$gantt-border-color;
|
|
60
|
-
box-sizing: border-box;
|
|
61
|
-
position: relative;
|
|
62
|
-
|
|
63
|
-
&:last-child {
|
|
64
|
-
border-right: none;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
168
|
.gantt-table-header {
|
|
70
169
|
text-align: center;
|
|
71
170
|
position: sticky;
|
|
@@ -75,6 +174,8 @@
|
|
|
75
174
|
height: variables.$gantt-header-height;
|
|
76
175
|
line-height: variables.$gantt-header-height;
|
|
77
176
|
|
|
177
|
+
@include gantt-table-item-base();
|
|
178
|
+
|
|
78
179
|
.gantt-table-column {
|
|
79
180
|
font-weight: 400;
|
|
80
181
|
}
|
|
@@ -102,52 +203,35 @@
|
|
|
102
203
|
}
|
|
103
204
|
|
|
104
205
|
.gantt-table-item {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&-with-group {
|
|
111
|
-
.gantt-table-column {
|
|
112
|
-
&:first-child {
|
|
113
|
-
padding: 0 15px 0 32px;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.gantt-table-column {
|
|
119
|
-
display: flex;
|
|
120
|
-
padding: variables.$gantt-table-td-padding;
|
|
121
|
-
|
|
122
|
-
&:last-child {
|
|
123
|
-
border-right: none;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.gantt-table-column-content {
|
|
128
|
-
flex: 1;
|
|
129
|
-
position: relative;
|
|
130
|
-
overflow: hidden;
|
|
131
|
-
text-overflow: ellipsis;
|
|
132
|
-
white-space: nowrap;
|
|
133
|
-
}
|
|
206
|
+
@include gantt-table-item();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
134
209
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
210
|
+
.table-resize-trigger,
|
|
211
|
+
.column-resize-handle {
|
|
212
|
+
width: variables.$gantt-table-header-drag-line-width;
|
|
213
|
+
position: absolute;
|
|
214
|
+
top: 0;
|
|
215
|
+
right: 0;
|
|
216
|
+
bottom: 0;
|
|
217
|
+
cursor: ew-resize;
|
|
218
|
+
z-index: 1;
|
|
138
219
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
background-color: rgba($color: variables.$gantt-table-header-drag-line-color, $alpha: 0.1);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
220
|
+
&:hover {
|
|
221
|
+
background: variables.$gantt-table-header-drag-line-color;
|
|
222
|
+
z-index: 2;
|
|
145
223
|
}
|
|
224
|
+
}
|
|
146
225
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
226
|
+
.table-resize-line {
|
|
227
|
+
width: variables.$gantt-table-header-drag-line-width;
|
|
228
|
+
background: variables.$gantt-table-header-drag-line-color;
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 0;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
z-index: 100;
|
|
233
|
+
display: none;
|
|
152
234
|
}
|
|
153
235
|
}
|
|
236
|
+
|
|
237
|
+
@include gantt-items-drag-drop();
|