@worktile/gantt 11.0.3 → 12.0.2
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/bundles/worktile-gantt.umd.js +1261 -1096
- package/bundles/worktile-gantt.umd.js.map +1 -1
- package/components/bar/bar-drag.d.ts +3 -0
- package/components/bar/bar.component.d.ts +3 -0
- package/components/calendar/calendar.component.d.ts +4 -1
- package/components/drag-backdrop/drag-backdrop.component.d.ts +3 -0
- package/components/icon/icon.component.d.ts +3 -0
- package/components/links/links.component.d.ts +3 -0
- package/components/main/gantt-main.component.d.ts +3 -0
- package/components/range/range.component.d.ts +3 -0
- package/components/table/gantt-table.component.d.ts +8 -3
- package/esm2015/components/bar/bar-drag.js +10 -12
- package/esm2015/components/bar/bar.component.js +29 -22
- package/esm2015/components/calendar/calendar.component.js +21 -17
- package/esm2015/components/drag-backdrop/drag-backdrop.component.js +14 -11
- package/esm2015/components/icon/icon.component.js +17 -15
- package/esm2015/components/links/links.component.js +28 -22
- package/esm2015/components/main/gantt-main.component.js +40 -22
- package/esm2015/components/range/range.component.js +21 -16
- package/esm2015/components/table/gantt-table.component.js +41 -23
- package/esm2015/gantt-abstract.js +3 -0
- package/esm2015/gantt-dom.service.js +7 -5
- package/esm2015/gantt-drag-container.js +7 -5
- package/esm2015/gantt-item-upper.js +17 -14
- package/esm2015/gantt-print.service.js +7 -5
- package/esm2015/gantt-upper.js +65 -51
- package/esm2015/gantt.component.js +60 -34
- package/esm2015/gantt.module.js +56 -25
- package/esm2015/gantt.pipe.js +26 -16
- package/esm2015/public-api.js +3 -1
- package/esm2015/root.component.js +37 -25
- package/esm2015/table/gantt-column.component.js +26 -17
- package/esm2015/table/gantt-table.component.js +13 -11
- package/esm2015/utils/helpers.js +11 -1
- package/esm2015/views/view.js +1 -1
- package/esm2015/views/year.js +3 -3
- package/esm2015/worktile-gantt.js +1 -12
- package/fesm2015/worktile-gantt.js +1342 -1205
- package/fesm2015/worktile-gantt.js.map +1 -1
- package/gantt-abstract.d.ts +12 -0
- package/gantt-dom.service.d.ts +3 -0
- package/gantt-drag-container.d.ts +3 -0
- package/gantt-item-upper.d.ts +3 -0
- package/gantt-print.service.d.ts +3 -0
- package/gantt-upper.d.ts +3 -1
- package/gantt.component.d.ts +3 -2
- package/gantt.module.d.ts +19 -0
- package/gantt.pipe.d.ts +7 -0
- package/{style.scss → main.bundle.scss} +63 -63
- package/package.json +4 -5
- package/public-api.d.ts +2 -0
- package/root.component.d.ts +3 -0
- package/table/gantt-column.component.d.ts +3 -0
- package/table/gantt-table.component.d.ts +3 -0
- package/utils/helpers.d.ts +2 -1
- package/worktile-gantt.d.ts +1 -11
- package/bundles/worktile-gantt.umd.min.js +0 -16
- package/bundles/worktile-gantt.umd.min.js.map +0 -1
- package/worktile-gantt.metadata.json +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { GanttGroupInternal, GanttItemInternal } from './class';
|
|
3
|
+
import { GanttStyles } from './gantt.styles';
|
|
4
|
+
import { NgxGanttTableComponent } from './table/gantt-table.component';
|
|
5
|
+
export interface GanttAbstractComponent {
|
|
6
|
+
table: NgxGanttTableComponent;
|
|
7
|
+
styles: GanttStyles;
|
|
8
|
+
maxLevel: number;
|
|
9
|
+
expandGroup(group: GanttGroupInternal): void;
|
|
10
|
+
expandChildren(item: GanttItemInternal): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const GANTT_ABSTRACT_TOKEN: InjectionToken<GanttAbstractComponent>;
|
package/gantt-dom.service.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
2
3
|
export declare enum ScrollDirection {
|
|
3
4
|
NONE = 0,
|
|
4
5
|
LEFT = 1,
|
|
@@ -26,4 +27,6 @@ export declare class GanttDomService implements OnDestroy {
|
|
|
26
27
|
getResize(): import("rxjs").Observable<Event>;
|
|
27
28
|
scrollMainContainer(left: number): void;
|
|
28
29
|
ngOnDestroy(): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttDomService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GanttDomService>;
|
|
29
32
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { GanttDragEvent, GanttLinkDragEvent } from './class/event';
|
|
3
3
|
import { GanttItemInternal } from './class/item';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare type LinkDragFrom = 'source' | 'target';
|
|
5
6
|
export declare class GanttDragContainer {
|
|
6
7
|
dragStarted: EventEmitter<GanttDragEvent<unknown>>;
|
|
@@ -17,4 +18,6 @@ export declare class GanttDragContainer {
|
|
|
17
18
|
emitLinkDragEntered(item: GanttItemInternal): void;
|
|
18
19
|
emitLinkDragLeaved(): void;
|
|
19
20
|
emitLinkDragEnded(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttDragContainer, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GanttDragContainer>;
|
|
20
23
|
}
|
package/gantt-item-upper.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ElementRef, TemplateRef } from '@angular/core';
|
|
|
2
2
|
import { GanttItemInternal } from './class';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { GanttUpper } from './gantt-upper';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
5
6
|
export declare abstract class GanttItemUpper {
|
|
6
7
|
protected elementRef: ElementRef<HTMLElement>;
|
|
7
8
|
protected ganttUpper: GanttUpper;
|
|
@@ -14,4 +15,6 @@ export declare abstract class GanttItemUpper {
|
|
|
14
15
|
onChanges(): void;
|
|
15
16
|
private setPositions;
|
|
16
17
|
onDestroy(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttItemUpper, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GanttItemUpper, never, never, { "template": "template"; "item": "item"; }, {}, never>;
|
|
17
20
|
}
|
package/gantt-print.service.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class GanttPrintService {
|
|
3
4
|
private root;
|
|
4
5
|
private mainContainer;
|
|
@@ -7,4 +8,6 @@ export declare class GanttPrintService {
|
|
|
7
8
|
private recursElementChildren;
|
|
8
9
|
register(root: ElementRef<HTMLElement>): void;
|
|
9
10
|
print(name?: string, ignoreElementClass?: string): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttPrintService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GanttPrintService>;
|
|
10
13
|
}
|
package/gantt-upper.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { GanttItem, GanttGroup, GanttViewType, GanttLoadOnScrollEvent, GanttDrag
|
|
|
4
4
|
import { GanttView, GanttViewOptions } from './views/view';
|
|
5
5
|
import { GanttStyles } from './gantt.styles';
|
|
6
6
|
import { GanttDragContainer } from './gantt-drag-container';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
7
8
|
export declare abstract class GanttUpper {
|
|
8
9
|
protected elementRef: ElementRef<HTMLElement>;
|
|
9
10
|
protected cdr: ChangeDetectorRef;
|
|
@@ -39,7 +40,6 @@ export declare abstract class GanttUpper {
|
|
|
39
40
|
dragContainer: GanttDragContainer;
|
|
40
41
|
unsubscribe$: Subject<unknown>;
|
|
41
42
|
private groupsMap;
|
|
42
|
-
private expandedItemIds;
|
|
43
43
|
ganttClass: boolean;
|
|
44
44
|
constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone);
|
|
45
45
|
private createView;
|
|
@@ -58,5 +58,7 @@ export declare abstract class GanttUpper {
|
|
|
58
58
|
expandGroup(group: GanttGroupInternal): void;
|
|
59
59
|
expandAll(): void;
|
|
60
60
|
collapseAll(): void;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GanttUpper, never>;
|
|
62
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GanttUpper, never, never, { "originItems": "items"; "originGroups": "groups"; "viewType": "viewType"; "start": "start"; "end": "end"; "showTodayLine": "showTodayLine"; "draggable": "draggable"; "styles": "styles"; "viewOptions": "viewOptions"; "disabledLoadOnScroll": "disabledLoadOnScroll"; }, { "loadOnScroll": "loadOnScroll"; "dragStarted": "dragStarted"; "dragEnded": "dragEnded"; "barClick": "barClick"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate"]>;
|
|
61
63
|
}
|
|
62
64
|
export declare const GANTT_UPPER_TOKEN: InjectionToken<GanttUpper>;
|
package/gantt.component.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { GanttUpper } from './gantt-upper';
|
|
|
4
4
|
import { GanttLinkDragEvent, GanttLineClickEvent, GanttItemInternal, GanttItem } from './class';
|
|
5
5
|
import { NgxGanttTableColumnComponent } from './table/gantt-column.component';
|
|
6
6
|
import { NgxGanttTableComponent } from './table/gantt-table.component';
|
|
7
|
-
|
|
8
|
-
export declare const minColumnWidth = 80;
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
9
8
|
export declare class NgxGanttComponent extends GanttUpper implements OnInit, AfterViewInit, OnChanges, OnDestroy {
|
|
10
9
|
maxLevel: number;
|
|
11
10
|
async: boolean;
|
|
@@ -25,4 +24,6 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, Aft
|
|
|
25
24
|
ngOnChanges(changes: SimpleChanges): void;
|
|
26
25
|
expandChildren(item: GanttItemInternal): void;
|
|
27
26
|
ngOnDestroy(): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttComponent, "ngx-gantt", never, { "maxLevel": "maxLevel"; "async": "async"; "childrenResolve": "childrenResolve"; "linkable": "linkable"; }, { "linkDragStarted": "linkDragStarted"; "linkDragEnded": "linkDragEnded"; "lineClick": "lineClick"; }, ["table", "tableEmptyTemplate", "columns"], never>;
|
|
28
29
|
}
|
package/gantt.module.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./gantt.component";
|
|
3
|
+
import * as i2 from "./table/gantt-table.component";
|
|
4
|
+
import * as i3 from "./table/gantt-column.component";
|
|
5
|
+
import * as i4 from "./components/table/gantt-table.component";
|
|
6
|
+
import * as i5 from "./components/main/gantt-main.component";
|
|
7
|
+
import * as i6 from "./components/calendar/calendar.component";
|
|
8
|
+
import * as i7 from "./components/links/links.component";
|
|
9
|
+
import * as i8 from "./components/bar/bar.component";
|
|
10
|
+
import * as i9 from "./components/icon/icon.component";
|
|
11
|
+
import * as i10 from "./components/drag-backdrop/drag-backdrop.component";
|
|
12
|
+
import * as i11 from "./components/range/range.component";
|
|
13
|
+
import * as i12 from "./root.component";
|
|
14
|
+
import * as i13 from "./gantt.pipe";
|
|
15
|
+
import * as i14 from "@angular/common";
|
|
16
|
+
import * as i15 from "@angular/cdk/drag-drop";
|
|
1
17
|
export declare class NgxGanttModule {
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttModule, never>;
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxGanttModule, [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i4.GanttTableComponent, typeof i5.GanttMainComponent, typeof i6.GanttCalendarComponent, typeof i7.GanttLinksComponent, typeof i8.NgxGanttBarComponent, typeof i9.GanttIconComponent, typeof i10.GanttDragBackdropComponent, typeof i11.NgxGanttRangeComponent, typeof i12.NgxGanttRootComponent, typeof i13.IsGanttRangeItemPipe, typeof i13.IsGanttBarItemPipe, typeof i13.IsGanttCustomItemPipe], [typeof i14.CommonModule, typeof i15.DragDropModule], [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i12.NgxGanttRootComponent, typeof i8.NgxGanttBarComponent, typeof i11.NgxGanttRangeComponent]>;
|
|
20
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxGanttModule>;
|
|
2
21
|
}
|
package/gantt.pipe.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import { GanttItemType } from './class';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class IsGanttRangeItemPipe implements PipeTransform {
|
|
4
5
|
transform(value: GanttItemType): boolean;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttRangeItemPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttRangeItemPipe, "isGanttRangeItem">;
|
|
5
8
|
}
|
|
6
9
|
export declare class IsGanttBarItemPipe implements PipeTransform {
|
|
7
10
|
transform(value: GanttItemType): boolean;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttBarItemPipe, never>;
|
|
12
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttBarItemPipe, "isGanttBarItem">;
|
|
8
13
|
}
|
|
9
14
|
export declare class IsGanttCustomItemPipe implements PipeTransform {
|
|
10
15
|
transform(value: GanttItemType): boolean;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttCustomItemPipe, never>;
|
|
17
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttCustomItemPipe, "isGanttCustomItem">;
|
|
11
18
|
}
|
|
@@ -46,81 +46,81 @@ $gantt-table-header-drag-line-width: 3px !default;
|
|
|
46
46
|
$gantt-table-header-drag-line-color: #348fe4 !default;
|
|
47
47
|
|
|
48
48
|
.gantt {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
position: relative;
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
display: flex;
|
|
55
|
-
color: $gantt-color;
|
|
56
|
-
opacity: 0;
|
|
57
|
-
|
|
58
|
-
svg {
|
|
59
|
-
overflow: visible;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.gantt-side {
|
|
63
|
-
border-right: 1px solid $gantt-border-color;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
background-color: $gantt-bg-color;
|
|
64
52
|
position: relative;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
display: flex;
|
|
55
|
+
color: $gantt-color;
|
|
56
|
+
opacity: 0;
|
|
68
57
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
height: $gantt-header-height;
|
|
58
|
+
svg {
|
|
59
|
+
overflow: visible !important;
|
|
72
60
|
}
|
|
73
61
|
|
|
74
|
-
.gantt-side
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
display: none;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
62
|
+
.gantt-side {
|
|
63
|
+
border-right: 1px solid $gantt-border-color;
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 3;
|
|
66
|
+
// overflow-x: scroll;
|
|
67
|
+
box-shadow: $gantt-side-shadow;
|
|
84
68
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
background-color: $gantt-container-background-color;
|
|
91
|
-
}
|
|
69
|
+
.gantt-side-header {
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
height: $gantt-header-height;
|
|
72
|
+
}
|
|
92
73
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
position: absolute;
|
|
98
|
-
top: $gantt-header-height;
|
|
99
|
-
bottom: 0;
|
|
100
|
-
left: 0;
|
|
101
|
-
right: 0;
|
|
102
|
-
overflow: auto;
|
|
103
|
-
background-color: $gantt-container-background-color;
|
|
74
|
+
.gantt-side-container {
|
|
75
|
+
height: 100%;
|
|
76
|
+
background-color: $gantt-bg-color;
|
|
77
|
+
overflow-y: auto;
|
|
104
78
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
79
|
+
&::-webkit-scrollbar {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
109
83
|
}
|
|
110
84
|
|
|
111
|
-
.gantt-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
85
|
+
.gantt-container {
|
|
86
|
+
flex: 1;
|
|
87
|
+
position: relative;
|
|
88
|
+
display: flex;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
background-color: $gantt-container-background-color;
|
|
116
91
|
}
|
|
117
92
|
|
|
118
|
-
.gantt-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
93
|
+
.gantt-main-container {
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: calc(100% - #{$gantt-header-height});
|
|
96
|
+
flex: 1;
|
|
97
|
+
position: absolute;
|
|
98
|
+
top: $gantt-header-height;
|
|
99
|
+
bottom: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
right: 0;
|
|
102
|
+
overflow: auto;
|
|
103
|
+
background-color: $gantt-container-background-color;
|
|
104
|
+
|
|
105
|
+
.gantt-main-groups,
|
|
106
|
+
.gantt-main-items {
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
min-height: 100%;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.gantt-group {
|
|
112
|
+
height: $gantt-group-height;
|
|
113
|
+
background: $gantt-group-background-color;
|
|
114
|
+
border-bottom: 1px solid $gantt-border-color;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.gantt-item {
|
|
119
|
+
border-bottom: 1px solid $gantt-border-color;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
position: relative;
|
|
122
|
+
}
|
|
122
123
|
}
|
|
123
|
-
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.gantt-table {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worktile/gantt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.2",
|
|
4
4
|
"schematics": "./schematics/collection.json",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": "^
|
|
7
|
-
"@angular/core": "^
|
|
6
|
+
"@angular/common": "^12.0.0",
|
|
7
|
+
"@angular/core": "^12.0.0"
|
|
8
8
|
},
|
|
9
9
|
"main": "bundles/worktile-gantt.umd.js",
|
|
10
10
|
"module": "fesm2015/worktile-gantt.js",
|
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
"esm2015": "esm2015/worktile-gantt.js",
|
|
13
13
|
"fesm2015": "fesm2015/worktile-gantt.js",
|
|
14
14
|
"typings": "worktile-gantt.d.ts",
|
|
15
|
-
"metadata": "worktile-gantt.metadata.json",
|
|
16
15
|
"sideEffects": false,
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"tslib": "^2.
|
|
17
|
+
"tslib": "^2.2.0"
|
|
19
18
|
}
|
|
20
19
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export * from './root.component';
|
|
|
4
4
|
export * from './gantt.component';
|
|
5
5
|
export * from './table/gantt-table.component';
|
|
6
6
|
export * from './table/gantt-column.component';
|
|
7
|
+
export * from './components/bar/bar.component';
|
|
8
|
+
export * from './components/range/range.component';
|
|
7
9
|
export * from './utils/date';
|
|
8
10
|
export * from './class';
|
|
9
11
|
export * from './views/view';
|
package/root.component.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { GanttDomService } from './gantt-dom.service';
|
|
|
3
3
|
import { GanttDragContainer } from './gantt-drag-container';
|
|
4
4
|
import { GanttUpper } from './gantt-upper';
|
|
5
5
|
import { GanttPrintService } from './gantt-print.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class NgxGanttRootComponent implements OnInit {
|
|
7
8
|
private elementRef;
|
|
8
9
|
private ngZone;
|
|
@@ -22,4 +23,6 @@ export declare class NgxGanttRootComponent implements OnInit {
|
|
|
22
23
|
private setupResize;
|
|
23
24
|
private setupScrollClass;
|
|
24
25
|
private scrollToToday;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttRootComponent, [null, null, null, null, null, { optional: true; }]>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttRootComponent, "ngx-gantt-root", never, { "sideWidth": "sideWidth"; }, {}, ["sideTemplate", "mainTemplate"], never>;
|
|
25
28
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { GanttUpper } from '../gantt-upper';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class NgxGanttTableColumnComponent implements OnInit {
|
|
4
5
|
ganttUpper: GanttUpper;
|
|
5
6
|
columnWidth: string;
|
|
@@ -9,4 +10,6 @@ export declare class NgxGanttTableColumnComponent implements OnInit {
|
|
|
9
10
|
headerTemplateRef: TemplateRef<any>;
|
|
10
11
|
constructor(ganttUpper: GanttUpper);
|
|
11
12
|
ngOnInit(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableColumnComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableColumnComponent, "ngx-gantt-column", never, { "width": "width"; "name": "name"; }, {}, ["templateRef", "headerTemplateRef"], never>;
|
|
12
15
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { GanttTableEvent } from '../class';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class NgxGanttTableComponent implements OnInit {
|
|
4
5
|
columnChanges: EventEmitter<GanttTableEvent>;
|
|
5
6
|
constructor();
|
|
6
7
|
ngOnInit(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, {}, { "columnChanges": "columnChanges"; }, never, never>;
|
|
7
10
|
}
|
package/utils/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GanttItemInternal } from '../class/item';
|
|
1
|
+
import { GanttItem, GanttItemInternal } from '../class/item';
|
|
2
2
|
export interface Dictionary<T = unknown> {
|
|
3
3
|
[key: string]: T;
|
|
4
4
|
}
|
|
@@ -9,3 +9,4 @@ export declare function hexToRgb(color: string, opacity?: number): string;
|
|
|
9
9
|
export declare function uniqBy<T = unknown>(array: T[], key: keyof T): any[];
|
|
10
10
|
export declare function flatten<T = unknown>(array: T[]): any;
|
|
11
11
|
export declare function recursiveItems(items: GanttItemInternal[]): any[];
|
|
12
|
+
export declare function getFlatItems(items: GanttItem[]): any[];
|
package/worktile-gantt.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
|
+
/// <amd-module name="@worktile/gantt" />
|
|
4
5
|
export * from './public-api';
|
|
5
|
-
export { GanttBarDrag as ɵd } from './components/bar/bar-drag';
|
|
6
|
-
export { NgxGanttBarComponent as ɵc } from './components/bar/bar.component';
|
|
7
|
-
export { GanttCalendarComponent as ɵg } from './components/calendar/calendar.component';
|
|
8
|
-
export { GanttDragBackdropComponent as ɵj } from './components/drag-backdrop/drag-backdrop.component';
|
|
9
|
-
export { GanttIconComponent as ɵi } from './components/icon/icon.component';
|
|
10
|
-
export { GanttLinksComponent as ɵh } from './components/links/links.component';
|
|
11
|
-
export { GanttMainComponent as ɵf } from './components/main/gantt-main.component';
|
|
12
|
-
export { NgxGanttRangeComponent as ɵk } from './components/range/range.component';
|
|
13
|
-
export { GanttTableComponent as ɵe } from './components/table/gantt-table.component';
|
|
14
|
-
export { GanttDomService as ɵa } from './gantt-dom.service';
|
|
15
|
-
export { GanttDragContainer as ɵb } from './gantt-drag-container';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs/operators"),require("rxjs"),require("date-fns"),require("@angular/cdk/coercion"),require("@angular/cdk/drag-drop"),require("html2canvas")):"function"==typeof define&&define.amd?define("@worktile/gantt",["exports","@angular/core","@angular/common","rxjs/operators","rxjs","date-fns","@angular/cdk/coercion","@angular/cdk/drag-drop","html2canvas"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).worktile=t.worktile||{},t.worktile.gantt={}),t.ng.core,t.ng.common,t.rxjs.operators,t.rxjs,t.dateFns,t.ng.cdk.coercion,t.ng.cdk.dragDrop,t.html2canvas)}(this,(function(t,e,n,i,r,a,o,s,l){"use strict";function p(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var d=p(l),u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;function g(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}Object.create;var m,y,v=function(t,e,n,i,r){this.start=t,this.text=e,this.x=n,this.y=i,this.additions=r},b=function(){},w=function(){},k=function(){},C=function(){},x=function(){},D=function(){},O=function(){function t(t){if(t)if(t instanceof Date)this.value=t;else{if("string"!=typeof t&&"number"!=typeof t)throw new Error("The input date type is not supported expect Date | string\n | number | { date: number; with_time: 0 | 1}, actual "+JSON.stringify(t));t.toString().length<13?this.value=a.fromUnixTime(+t):this.value=new Date(t)}else this.value=new Date}return t.prototype.getYear=function(){return this.value.getFullYear()},t.prototype.getMonth=function(){return this.value.getMonth()},t.prototype.getDay=function(){return this.value.getDay()},t.prototype.getTime=function(){return this.value.getTime()},t.prototype.getDate=function(){return this.value.getDate()},t.prototype.getHours=function(){return this.value.getHours()},t.prototype.getMinutes=function(){return this.value.getMinutes()},t.prototype.getSeconds=function(){return this.value.getSeconds()},t.prototype.getMilliseconds=function(){return this.value.getMilliseconds()},t.prototype.getWeek=function(t){return void 0===t&&(t={weekStartsOn:1}),a.getWeek(this.value,t)},t.prototype.getDaysInMonth=function(){return a.getDaysInMonth(this.value)},t.prototype.getDaysInQuarter=function(){return a.differenceInCalendarDays(this.endOfQuarter().addSeconds(1).value,this.startOfQuarter().value)},t.prototype.getDaysInYear=function(){return a.differenceInCalendarDays(this.endOfYear().addSeconds(1).value,this.startOfYear().value)},t.prototype.setDate=function(e){return new t(a.setDate(this.value,e))},t.prototype.clone=function(){return new t(new Date(this.value))},t.prototype.add=function(e,n){switch(n){case"second":return new t(this.value).addSeconds(e);case"minute":return new t(this.value).addMinutes(e);case"hour":return new t(this.value).addHours(e);case"day":return new t(this.value).addDays(e);case"week":return new t(this.value).addWeeks(e);case"month":return new t(this.value).addMonths(e);case"quarter":return new t(this.value).addQuarters(e);case"year":return new t(this.value).addYears(e);default:return new t(this.value).addSeconds(e)}},t.prototype.addSeconds=function(e){return new t(a.addSeconds(this.value,e))},t.prototype.addMinutes=function(e){return new t(a.addMinutes(this.value,e))},t.prototype.addHours=function(e){return new t(a.addHours(this.value,e))},t.prototype.addDays=function(e){return new t(a.addDays(this.value,e))},t.prototype.addWeeks=function(e){return new t(a.addWeeks(this.value,e))},t.prototype.addMonths=function(e){return new t(a.addMonths(this.value,e))},t.prototype.addQuarters=function(e){return new t(a.addQuarters(this.value,e))},t.prototype.addYears=function(e){return new t(a.addYears(this.value,e))},t.prototype.startOfDay=function(){return new t(a.startOfDay(this.value))},t.prototype.startOfWeek=function(e){return new t(a.startOfWeek(this.value,e))},t.prototype.startOfMonth=function(){return new t(a.startOfMonth(this.value))},t.prototype.startOfQuarter=function(){return new t(a.startOfQuarter(this.value))},t.prototype.startOfYear=function(){return new t(a.startOfYear(this.value))},t.prototype.endOfDay=function(){return new t(a.endOfDay(this.value))},t.prototype.endOfWeek=function(e){return new t(a.endOfWeek(this.value,e))},t.prototype.endOfMonth=function(){return new t(a.endOfMonth(this.value))},t.prototype.endOfQuarter=function(){return new t(a.endOfQuarter(this.value))},t.prototype.endOfYear=function(){return new t(a.endOfYear(this.value))},t.prototype.getUnixTime=function(){return a.getUnixTime(this.value)},t.prototype.format=function(t,e){return a.format(this.value,t,e)},t.prototype.isWeekend=function(){return a.isWeekend(this.value)},t.prototype.isToday=function(){return a.isToday(this.value)},t}();(m=t.GanttViewType||(t.GanttViewType={})).day="day",m.quarter="quarter",m.month="month",m.year="year",m.week="week",(y=t.GanttItemType||(t.GanttItemType={})).bar="bar",y.range="range",y.custom="custom";var E=function(){function e(n,i){var a=this;this.refs$=new r.BehaviorSubject(null),this.origin=n,this.id=this.origin.id,this.links=this.origin.links||[],this.color=this.origin.color,this.barStyle=this.origin.barStyle,this.linkable=void 0===this.origin.linkable||this.origin.linkable,this.draggable=void 0===this.origin.draggable||this.origin.draggable,this.expandable=this.origin.expandable||(this.origin.children||[]).length>0,this.expanded=void 0!==this.origin.expanded&&this.origin.expanded,this.start=n.start?new O(n.start):null,this.end=n.end?new O(n.end):null,this.viewType=i&&i.viewType?i.viewType:t.GanttViewType.month,this.children=(n.children||[]).map((function(t){return new e(t,{viewType:a.viewType})})),this.type=this.origin.type||t.GanttItemType.bar,this.progress=this.origin.progress,this.fillItemStartOrEnd(n)}return Object.defineProperty(e.prototype,"refs",{get:function(){return this.refs$.getValue()},enumerable:!1,configurable:!0}),e.prototype.fillItemStartOrEnd=function(e){var n;switch(this.viewType){case t.GanttViewType.day:case t.GanttViewType.week:n=0;break;default:n=30}e.start&&!e.end&&(this.end=new O(e.start).addDays(n).endOfDay()),!e.start&&e.end&&(this.start=new O(e.end).addDays(-n).startOfDay())},e.prototype.updateRefs=function(t){this.refs$.next(t)},e.prototype.updateDate=function(t,e){this.start=t.startOfDay(),this.end=e.endOfDay(),this.origin.start=this.start.getUnixTime(),this.origin.end=this.end.getUnixTime()},e.prototype.addChildren=function(t){var n=this;this.origin.children=t,this.children=(t||[]).map((function(t){return new e(t,{viewType:n.viewType})}))},e.prototype.setExpand=function(t){this.expanded=t,this.origin.expanded=t},e.prototype.addLink=function(t){this.links=f(this.links,[t]),this.origin.links=this.links},e}(),I=function(){function t(t){this.refs={},this.id=t.id,this.origin=t,this.title=t.title,this.expanded=void 0===t.expanded||t.expanded,this.items=[],this.mergedItems=[[]],this.class=t.class||""}return t.prototype.setExpand=function(t){this.expanded=t,this.origin.expanded=t},t}(),T=18,S={min:(new O).addYears(-1).startOfYear(),max:(new O).addYears(1).endOfYear()},P=function(){function t(t,e,n){this.showTimeline=!0,this.options=Object.assign({},S,n);var i=t.isCustom?this.startOf(t.date):this.startOf(t.date.value<this.options.start.value?t.date:this.options.start),a=e.isCustom?this.endOf(e.date):this.endOf(e.date.value>this.options.end.value?e.date:this.options.end);this.start$=new r.BehaviorSubject(i),this.end$=new r.BehaviorSubject(a),this.initialize()}return Object.defineProperty(t.prototype,"start",{get:function(){return this.start$.getValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.end$.getValue()},enumerable:!1,configurable:!0}),t.prototype.getDateIntervalWidth=function(t,e){for(var n=0,i=a.differenceInDays(e.value,t.value),r=0;r<Math.abs(i);r++)n+=this.getDayOccupancyWidth(t.addDays(r));return n=i>=0?n:-n,Number(n.toFixed(3))},t.prototype.initialize=function(){this.primaryDatePoints=this.getPrimaryDatePoints(),this.secondaryDatePoints=this.getSecondaryDatePoints(),this.width=this.getWidth(),this.cellWidth=this.getCellWidth(),this.primaryWidth=this.getPrimaryWidth()},t.prototype.addStartDate=function(){var t=this.startOf(this.start.add(-1*this.options.addAmount,this.options.addUnit));if(t.value>=this.options.min.value){var e=this.start;return this.start$.next(t),this.initialize(),{start:this.start,end:e}}return null},t.prototype.addEndDate=function(){var t=this.endOf(this.end.add(this.options.addAmount,this.options.addUnit));if(t.value<=this.options.max.value){var e=this.end;return this.end$.next(t),this.initialize(),{start:e,end:this.end}}return null},t.prototype.updateDate=function(t,e){t=this.startOf(t),e=this.endOf(e),t.value<this.start.value&&this.start$.next(t),e.value>this.end.value&&this.end$.next(e),this.initialize()},t.prototype.getWidth=function(){return this.getCellWidth()*this.secondaryDatePoints.length},t.prototype.getCellWidth=function(){return this.options.cellWidth},t.prototype.getTodayXPoint=function(){var t=(new O).startOfDay();return t.value>this.start.value&&t.value<this.end.value?this.getXPointByDate(t)+this.getDayOccupancyWidth(t)/2:null},t.prototype.getXPointByDate=function(t){return this.getDateIntervalWidth(this.start,t)},t.prototype.getDateByXPoint=function(t){var e=Math.floor(t/this.getCellWidth()),n=this.secondaryDatePoints[e],i=this.getDayOccupancyWidth(null==n?void 0:n.start);if(i===this.getCellWidth())return null==n?void 0:n.start;var r=Math.floor(t%this.getCellWidth()/i)+1;return this.getCellWidth()/i==7?null==n?void 0:n.start.addDays(r):null==n?void 0:n.start.setDate(r)},t.prototype.getDateRangeWidth=function(t,e){return this.getDateIntervalWidth(t,e.addSeconds(1))},t}(),W={start:(new O).startOfQuarter().addQuarters(-1),end:(new O).endOfQuarter().addQuarters(2),cellWidth:280,addAmount:1,addUnit:"quarter"},L=function(t){function e(e,n,i){return t.call(this,e,n,Object.assign({},W,i))||this}return c(e,t),e.prototype.startOf=function(t){return t.startOfQuarter()},e.prototype.endOf=function(t){return t.endOfQuarter()},e.prototype.getPrimaryWidth=function(){return 3*this.getCellWidth()},e.prototype.getDayOccupancyWidth=function(t){return this.cellWidth/t.getDaysInMonth()},e.prototype.getPrimaryDatePoints=function(){for(var t=a.differenceInCalendarQuarters(this.end.addSeconds(1).value,this.start.value),e=[],n=0;n<t;n++){var i=this.start.addQuarters(n),r=new v(i,i.format("yyyy年QQQ"),3*this.getCellWidth()/2+n*(3*this.getCellWidth()),T);e.push(r)}return e},e.prototype.getSecondaryDatePoints=function(){for(var t=a.eachMonthOfInterval({start:this.start.value,end:this.end.value}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=new v(i,i.getMonth()+1+"月",n*this.getCellWidth()+this.getCellWidth()/2,36);e.push(r)}return e},e}(P),R={start:(new O).addYears(-1).startOfYear(),end:(new O).addYears(1).endOfYear(),min:(new O).addYears(-2).startOfYear(),max:(new O).addYears(2).endOfYear(),cellWidth:500,addAmount:1,addUnit:"year"},B=function(t){function e(e,n,i){return t.call(this,e,n,Object.assign({},R,i))||this}return c(e,t),e.prototype.startOf=function(t){return t.startOfYear()},e.prototype.endOf=function(t){return t.endOfYear()},e.prototype.getPrimaryWidth=function(){return 4*this.getCellWidth()},e.prototype.getDayOccupancyWidth=function(t){return this.cellWidth/t.getDaysInQuarter()},e.prototype.getPrimaryDatePoints=function(){for(var t=a.eachYearOfInterval({start:this.start.value,end:this.end.value}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=new v(i,i.format("yyyy")+"年",4*this.getCellWidth()/2+n*(4*this.getCellWidth()),T);e.push(r)}return e},e.prototype.getSecondaryDatePoints=function(){for(var t=a.differenceInCalendarQuarters(this.end.value,this.start.value),e=[],n=0;n<=t;n++){var i=this.start.addQuarters(n),r=new v(i,i.format("QQQ"),n*this.getCellWidth()+this.getCellWidth()/2,36);e.push(r)}return e},e}(P),M={cellWidth:35,start:(new O).startOfYear().startOfWeek({weekStartsOn:1}),end:(new O).endOfYear().endOfWeek({weekStartsOn:1}),addAmount:1,addUnit:"month"},U=function(t){function e(e,n,i){var r=t.call(this,e,n,Object.assign({},M,i))||this;return r.showWeekBackdrop=!0,r.showTimeline=!1,r}return c(e,t),e.prototype.startOf=function(t){return t.startOfWeek({weekStartsOn:1})},e.prototype.endOf=function(t){return t.endOfWeek({weekStartsOn:1})},e.prototype.getPrimaryWidth=function(){return 7*this.getCellWidth()},e.prototype.getDayOccupancyWidth=function(){return this.cellWidth},e.prototype.getPrimaryDatePoints=function(){for(var t=a.eachWeekOfInterval({start:this.start.value,end:this.end.addSeconds(1).value},{weekStartsOn:1}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=i.getDaysInMonth()-i.getDate()>=3?0:1,o=new v(i,i.addWeeks(r).format("yyyy年MM月"),7*this.getCellWidth()/2+n*(7*this.getCellWidth()),T);e.push(o)}return e},e.prototype.getSecondaryDatePoints=function(){for(var t=a.eachDayOfInterval({start:this.start.value,end:this.end.value}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=new v(i,i.getDate().toString(),n*this.getCellWidth()+this.getCellWidth()/2,36,{isWeekend:i.isWeekend(),isToday:i.isToday()});e.push(r)}return e},e}(P),j={cellWidth:280,start:(new O).startOfYear().startOfWeek({weekStartsOn:1}),end:(new O).endOfYear().endOfWeek({weekStartsOn:1}),addAmount:1,addUnit:"month"},H=function(t){function e(e,n,i){return t.call(this,e,n,Object.assign({},j,i))||this}return c(e,t),e.prototype.startOf=function(t){return t.startOfWeek({weekStartsOn:1})},e.prototype.endOf=function(t){return t.endOfWeek({weekStartsOn:1})},e.prototype.getPrimaryWidth=function(){return this.getCellWidth()},e.prototype.getDayOccupancyWidth=function(){return this.cellWidth/7},e.prototype.getPrimaryDatePoints=function(){for(var t=a.eachWeekOfInterval({start:this.start.value,end:this.end.addSeconds(1).value},{weekStartsOn:1}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=i.getDaysInMonth()-i.getDate()>=3?0:1,o=new v(i,i.addWeeks(r).format("yyyy年"),this.getCellWidth()/2+n*this.getCellWidth(),T);e.push(o)}return e},e.prototype.getSecondaryDatePoints=function(){for(var t=a.eachWeekOfInterval({start:this.start.value,end:this.end.value}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=new v(i,"第"+i.format("w")+"周",n*this.getCellWidth()+this.getCellWidth()/2,36);e.push(r)}return e},e}(P),G={cellWidth:480,start:(new O).addYears(-1).startOfYear(),end:(new O).addYears(1).endOfYear(),addAmount:1,addUnit:"year"},$=function(t){function e(e,n,i){return t.call(this,e,n,Object.assign({},G,i))||this}return c(e,t),e.prototype.startOf=function(t){return t.startOfYear()},e.prototype.endOf=function(t){return t.endOfYear()},e.prototype.getPrimaryWidth=function(){return this.getCellWidth()},e.prototype.getDayOccupancyWidth=function(t){return this.cellWidth/t.getDaysInYear()},e.prototype.getPrimaryDatePoints=function(){for(var t=a.eachYearOfInterval({start:this.start.value,end:this.end.value}),e=[],n=0;n<t.length;n++){var i=new O(t[n]),r=new v(i,"",this.getCellWidth()/2+n*this.getCellWidth(),T);e.push(r)}return e},e.prototype.getSecondaryDatePoints=function(){for(var t=a.differenceInCalendarYears(this.end.value,this.start.value),e=[],n=0;n<=t;n++){var i=this.start.addYears(n),r=new v(i,i.format("yyyy")+"年",n*this.getCellWidth()+this.getCellWidth()/2,27);e.push(r)}return e},e}(P);var Y={lineHeight:44,barHeight:22};function V(t){return"number"==typeof t}function A(t,e){return void 0===e&&(e=1),/^#/g.test(t)?"rgba("+parseInt(t.slice(1,3),16)+","+parseInt(t.slice(3,5),16)+","+parseInt(t.slice(5,7),16)+","+e+")":t}function N(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?N(e):e)}),[])}function F(t){var e=[];return(t||[]).forEach((function(t){e.push(t),t.expanded&&t.children&&e.push.apply(e,f(F(t.children)))})),e}var Q=function(){function n(n,i,a){this.elementRef=n,this.cdr=i,this.ngZone=a,this.originItems=[],this.originGroups=[],this.viewType=t.GanttViewType.month,this.showTodayLine=!0,this.loadOnScroll=new e.EventEmitter,this.dragStarted=new e.EventEmitter,this.dragEnded=new e.EventEmitter,this.barClick=new e.EventEmitter,this.linkDragEnded=new e.EventEmitter,this.items=[],this.groups=[],this.viewChange=new e.EventEmitter,this.expandChange=new e.EventEmitter,this.firstChange=!0,this.unsubscribe$=new r.Subject,this.expandedItemIds=[],this.ganttClass=!0}return Object.defineProperty(n.prototype,"element",{get:function(){return this.elementRef.nativeElement},enumerable:!1,configurable:!0}),n.prototype.createView=function(){var e=this.getViewDate();this.view=function(e,n,i,r){switch(e){case t.GanttViewType.month:return new L(n,i,r);case t.GanttViewType.week:return new H(n,i,r);case t.GanttViewType.quarter:return new B(n,i,r);case t.GanttViewType.day:return new U(n,i,r);case t.GanttViewType.year:return new $(n,i,r);default:throw new Error("gantt view type invalid")}}(this.viewType,e.start,e.end,this.viewOptions)},n.prototype.setupGroups=function(){var t=this,e=this.groups.filter((function(t){return!1===t.expanded})).map((function(t){return t.id}));this.groupsMap={},this.groups=[],this.originGroups.forEach((function(n){var i=new I(n);i.expanded=!e.includes(i.id),t.groupsMap[i.id]=i,t.groups.push(i)}))},n.prototype.setupItems=function(){var t,e,n,i,r=this;this.originItems=(t=this.originItems,e="id",n={},i=[],(t||[]).forEach((function(t){var r=t[e];n[r]||(n[r]=t,i.push(t))})),i),this.originItems.forEach((function(t){var e,n,i=r.items.find((function(e){return e.id===t.id}));r.firstChange||(i&&!(null===(e=i.children)||void 0===e?void 0:e.length)&&(null===(n=t.children)||void 0===n?void 0:n.length)?t.expanded=t.expanded||r.expandedItemIds.includes(t.id):t.expanded=r.expandedItemIds.includes(t.id))})),this.items=[],this.groups.length>0?this.originItems.forEach((function(t){var e=r.groupsMap[t.group_id];if(e){var n=new E(t,{viewType:r.viewType});e.items.push(n)}})):this.originItems.forEach((function(t){var e=new E(t,{viewType:r.viewType});r.items.push(e)}))},n.prototype.setupExpandedState=function(){var t=this,e=[];e=this.items.length>0?F(this.items):N(this.groups.map((function(t){return F(t.items)}))),this.expandedItemIds=[],e.forEach((function(e){e.origin.expanded&&t.expandedItemIds.push(e.id)}))},n.prototype.getViewDate=function(){var t=this,e=this.start,n=this.end;return this.start&&this.end||this.originItems.forEach((function(i){i.start&&!t.start&&(e=e?Math.min(e,i.start):i.start),i.end&&!t.end&&(n=n?Math.max(n,i.end):i.end)})),{start:{date:new O(e),isCustom:!!this.start},end:{date:new O(n),isCustom:!!this.end}}},n.prototype.computeRefs=function(){var t=this;this.groups.forEach((function(e){var n=F(e.items);t.computeItemsRefs.apply(t,f(n))}));var e=F(this.items);this.computeItemsRefs.apply(this,f(e))},n.prototype.expandGroups=function(t){this.groups.forEach((function(e){e.setExpand(t)})),this.expandChange.next(),this.cdr.detectChanges()},n.prototype.onInit=function(){var t=this;this.styles=Object.assign({},Y,this.styles),this.createView(),this.setupGroups(),this.setupItems(),this.computeRefs(),this.firstChange=!1,this.ngZone.onStable.pipe(i.take(1)).subscribe((function(){t.element.style.opacity="1",t.dragContainer.dragStarted.subscribe((function(e){t.dragStarted.emit(e)})),t.dragContainer.dragEnded.subscribe((function(e){t.dragEnded.emit(e),t.computeRefs(),t.detectChanges()}))})),this.view.start$.pipe(i.skip(1),i.takeUntil(this.unsubscribe$)).subscribe((function(){t.computeRefs()}))},n.prototype.onChanges=function(t){this.firstChange||(t.viewType&&t.viewType.currentValue&&(this.createView(),this.setupGroups(),this.setupItems(),this.computeRefs(),this.viewChange.emit(this.view)),(t.originItems||t.originGroups)&&(this.setupExpandedState(),this.setupGroups(),this.setupItems(),this.computeRefs()))},n.prototype.onDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},n.prototype.computeItemsRefs=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){e.updateRefs({width:e.start&&e.end?t.view.getDateRangeWidth(e.start.startOfDay(),e.end.endOfDay()):0,x:e.start?t.view.getXPointByDate(e.start):0,y:(t.styles.lineHeight-t.styles.barHeight)/2-1})}))},n.prototype.trackBy=function(t,e){return t.id||e},n.prototype.detectChanges=function(){this.cdr.detectChanges()},n.prototype.expandGroup=function(t){t.setExpand(!t.expanded),this.expandChange.emit(),this.cdr.detectChanges()},n.prototype.expandAll=function(){this.expandGroups(!0)},n.prototype.collapseAll=function(){this.expandGroups(!1)},n}();Q.decorators=[{type:e.Directive}],Q.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:e.NgZone}]},Q.propDecorators={originItems:[{type:e.Input,args:["items"]}],originGroups:[{type:e.Input,args:["groups"]}],viewType:[{type:e.Input}],start:[{type:e.Input}],end:[{type:e.Input}],showTodayLine:[{type:e.Input}],draggable:[{type:e.Input}],styles:[{type:e.Input}],viewOptions:[{type:e.Input}],disabledLoadOnScroll:[{type:e.Input}],loadOnScroll:[{type:e.Output}],dragStarted:[{type:e.Output}],dragEnded:[{type:e.Output}],barClick:[{type:e.Output}],barTemplate:[{type:e.ContentChild,args:["bar",{static:!0}]}],rangeTemplate:[{type:e.ContentChild,args:["range",{static:!0}]}],itemTemplate:[{type:e.ContentChild,args:["item",{static:!0}]}],groupTemplate:[{type:e.ContentChild,args:["group",{static:!0}]}],groupHeaderTemplate:[{type:e.ContentChild,args:["groupHeader",{static:!0}]}],ganttClass:[{type:e.HostBinding,args:["class.gantt"]}]};var q=new e.InjectionToken("GANTT_UPPER_TOKEN"),z=function(){function t(t){this.ganttUpper=t}return Object.defineProperty(t.prototype,"width",{set:function(t){this.columnWidth=o.coerceCssPixelValue(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t}();z.decorators=[{type:e.Component,args:[{selector:"ngx-gantt-column",template:""}]}],z.ctorParameters=function(){return[{type:Q,decorators:[{type:e.Inject,args:[q]}]}]},z.propDecorators={width:[{type:e.Input}],name:[{type:e.Input}],templateRef:[{type:e.ContentChild,args:["cell",{static:!0}]}],headerTemplateRef:[{type:e.ContentChild,args:["header",{static:!0}]}]};var X=function(){function t(){this.columnChanges=new e.EventEmitter}return t.prototype.ngOnInit=function(){},t}();X.decorators=[{type:e.Component,args:[{selector:"ngx-gantt-table",template:""}]}],X.ctorParameters=function(){return[]},X.propDecorators={columnChanges:[{type:e.Output}]};var Z=function(t){function n(n,i,a){var o=t.call(this,n,i,a)||this;return o.maxLevel=2,o.linkDragStarted=new e.EventEmitter,o.linkDragEnded=new e.EventEmitter,o.lineClick=new e.EventEmitter,o.ngUnsubscribe$=new r.Subject,o.sideTableWidth=400,o}return c(n,t),n.prototype.ngOnInit=function(){var e=this;t.prototype.onInit.call(this),this.ngZone.onStable.pipe(i.take(1)).subscribe((function(){e.dragContainer.linkDragStarted.pipe(i.takeUntil(e.ngUnsubscribe$)).subscribe((function(t){e.linkDragStarted.emit(t)})),e.dragContainer.linkDragEnded.pipe(i.takeUntil(e.ngUnsubscribe$)).subscribe((function(t){e.linkDragEnded.emit(t)}))}))},n.prototype.ngAfterViewInit=function(){var t=this;this.columns.changes.pipe(i.startWith(!0),i.takeUntil(this.ngUnsubscribe$)).subscribe((function(){t.columns.forEach((function(t){t.columnWidth||(t.columnWidth=o.coerceCssPixelValue(100))})),t.cdr.detectChanges()}))},n.prototype.ngOnChanges=function(e){t.prototype.onChanges.call(this,e)},n.prototype.expandChildren=function(t){var e=this;t.expanded?(t.setExpand(!1),this.expandChange.emit()):(t.setExpand(!0),this.async&&this.childrenResolve&&0===t.children.length?(t.loading=!0,this.childrenResolve(t.origin).pipe(i.take(1),i.finalize((function(){t.loading=!1,e.expandChange.emit(),e.cdr.detectChanges()}))).subscribe((function(n){t.addChildren(n),e.computeItemsRefs.apply(e,f(t.children))}))):(this.computeItemsRefs.apply(this,f(t.children)),this.expandChange.emit()))},n.prototype.ngOnDestroy=function(){t.prototype.onDestroy.call(this)},n}(Q);Z.decorators=[{type:e.Component,args:[{selector:"ngx-gantt",template:'<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table [groups]="groups" [items]="items" [columns]="columns" [groupTemplate]="groupTemplate" [emptyTemplate]="tableEmptyTemplate"></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]="groups"\n [items]="items"\n [groupHeaderTemplate]="groupHeaderTemplate"\n [itemTemplate]="itemTemplate"\n [barTemplate]="barTemplate"\n [rangeTemplate]="rangeTemplate"\n (barClick)="barClick.emit($event)"\n (lineClick)="lineClick.emit($event)"\n >\n </gantt-main>\n </ng-template>\n</ngx-gantt-root>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[{provide:q,useExisting:Z}]}]}],Z.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:e.NgZone}]},Z.propDecorators={maxLevel:[{type:e.Input}],async:[{type:e.Input}],childrenResolve:[{type:e.Input}],linkable:[{type:e.Input}],linkDragStarted:[{type:e.Output}],linkDragEnded:[{type:e.Output}],lineClick:[{type:e.Output}],table:[{type:e.ContentChild,args:[X]}],columns:[{type:e.ContentChildren,args:[z,{descendants:!0}]}],tableEmptyTemplate:[{type:e.ContentChild,args:["tableEmpty",{static:!0}]}]};var _=function(){function e(e,n,i){this.ganttUpper=e,this.ngZone=n,this.elementRef=i,this.unsubscribe$=new r.Subject,this.headerHeight=44,this.mainHeight=5e3,this.todayHeight=24,this.todayWidth=35,this.todayBorderRadius=4,this.viewTypes=t.GanttViewType,this.className=!0}return Object.defineProperty(e.prototype,"view",{get:function(){return this.ganttUpper.view},enumerable:!1,configurable:!0}),e.prototype.setTodayPoint=function(){var t=this.view.getTodayXPoint(),e=(new O).getDate(),n=this.elementRef.nativeElement.getElementsByClassName("gantt-calendar-today-overlay")[0],i=this.elementRef.nativeElement.getElementsByClassName("today-rect")[0],r=this.elementRef.nativeElement.getElementsByClassName("today-line")[0];V(t)?(i&&(i.style.left=t-17.5+"px",i.style.top="20px",i.innerHTML=e.toString()),r&&(r.style.left=t+"px",r.style.top="44px",r.style.bottom="-5000px")):n.style.display="none"},e.prototype.ngOnInit=function(){var t=this;this.ngZone.onStable.pipe(i.take(1)).subscribe((function(){r.merge(t.ganttUpper.viewChange,t.ganttUpper.view.start$).pipe(i.takeUntil(t.unsubscribe$)).subscribe((function(){t.setTodayPoint()}))}))},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnChanges=function(t){},e.prototype.trackBy=function(t,e){return t.text||e},e.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},e}();_.decorators=[{type:e.Component,args:[{selector:"gantt-calendar-overlay",template:'<div class="gantt-calendar-today-overlay" [style.width.px]="view.width">\n <span class="today-rect" [hidden]="ganttUpper.viewType !== viewTypes.day"> </span>\n <span class="today-line" *ngIf="ganttUpper.showTodayLine"> </span>\n</div>\n\n<svg class="gantt-calendar-overlay-main" [attr.width]="view.width" [attr.height]="headerHeight">\n <g>\n <text class="primary-text" *ngFor="let point of view.primaryDatePoints; trackBy: trackBy" [attr.x]="point.x" [attr.y]="point.y">\n {{ point.text }}\n </text>\n <ng-container *ngFor="let point of view.secondaryDatePoints; trackBy: trackBy">\n <text class="secondary-text" [class.secondary-text-weekend]="point.additions?.isWeekend" [attr.x]="point.x" [attr.y]="point.y">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor="let point of view.primaryDatePoints; let i = index; trackBy: trackBy"\n [attr.x1]="(i + 1) * view.primaryWidth"\n [attr.x2]="(i + 1) * view.primaryWidth"\n [attr.y1]="0"\n [attr.y2]="mainHeight"\n class="primary-line"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]="0" [attr.x2]="view.width" [attr.y1]="headerHeight" [attr.y2]="headerHeight" class="header-line"></line>\n </g>\n </g>\n <g>\n <g *ngIf="view.showTimeline">\n <line\n *ngFor="let point of view.secondaryDatePoints; let i = index; trackBy: trackBy"\n [attr.x1]="(i + 1) * view.cellWidth"\n [attr.x2]="(i + 1) * view.cellWidth"\n [attr.y1]="headerHeight"\n [attr.y2]="mainHeight"\n class="secondary-line"\n ></line>\n <line\n *ngFor="let point of view.primaryDatePoints; let i = index; trackBy: trackBy"\n [attr.x1]="(i + 1) * view.primaryWidth"\n [attr.x2]="(i + 1) * view.primaryWidth"\n [attr.y1]="0"\n [attr.y2]="mainHeight"\n class="primary-line"\n ></line>\n </g>\n </g>\n</svg>\n'}]}],_.ctorParameters=function(){return[{type:Q,decorators:[{type:e.Inject,args:[q]}]},{type:e.NgZone},{type:e.ElementRef}]},_.propDecorators={className:[{type:e.HostBinding,args:["class.gantt-calendar-overlay"]}]};var K=function(){function t(t,e){this.gantt=t,this.elementRef=e,this.ganttTableClass=!0,this.ganttTableEmptyClass=!1}return Object.defineProperty(t.prototype,"columns",{set:function(t){t.forEach((function(t){t.columnWidth||(t.columnWidth=o.coerceCssPixelValue(100))})),this.columnList=t},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){var e,n;(null===(e=t.groups.currentValue)||void 0===e?void 0:e.length)||(null===(n=t.items.currentValue)||void 0===n?void 0:n.length)?this.ganttTableEmptyClass=!1:this.ganttTableEmptyClass=!0},t.prototype.dragFixed=function(t){t.movedWidth<t.minWidth&&(t.target.style.transform="translate3d("+(t.minWidth-t.originWidth)+"px, 0, 0)")},t.prototype.expandGroup=function(t){this.gantt.expandGroup(t)},t.prototype.expandChildren=function(t){this.gantt.expandChildren(t)},t.prototype.dragStarted=function(t){var e=t.source.element.nativeElement;this.dragStartLeft=e.getBoundingClientRect().left},t.prototype.dragMoved=function(t,e){var n,i,r,a=t.source.element.nativeElement,o=a.getBoundingClientRect().left;e?(i=(n=parseInt(e.columnWidth,10))+(o-this.dragStartLeft),r=80):(i=(n=this.elementRef.nativeElement.getBoundingClientRect().width)+(o-this.dragStartLeft),r=80*this.columnList.length),this.dragFixed({target:a,originWidth:n,movedWidth:i,minWidth:r}),this.showAuxiliaryLine(t)},t.prototype.columnDragEnded=function(t,e){var n=t.source.element.nativeElement.getBoundingClientRect().left,i=parseInt(e.columnWidth,10)+(n-this.dragStartLeft),r=Math.max(i||0,80);e.columnWidth=o.coerceCssPixelValue(r),this.gantt.table&&this.gantt.table.columnChanges.emit({columns:this.columnList}),this.hideAuxiliaryLine(),t.source.reset()},t.prototype.tableDragEnded=function(t){var e=t.source.element.nativeElement.getBoundingClientRect().left,n=this.elementRef.nativeElement.getBoundingClientRect().width,i=e-this.dragStartLeft;this.columnList.forEach((function(t){var e=parseInt(t.columnWidth,10),r=parseInt(String(i*(e/n)),10),a=Math.max(e+r||0,80);t.columnWidth=o.coerceCssPixelValue(a)})),this.gantt.table&&this.gantt.table.columnChanges.emit({columns:this.columnList}),this.hideAuxiliaryLine(),t.source.reset()},t.prototype.showAuxiliaryLine=function(t){var e=this.elementRef.nativeElement.getBoundingClientRect(),n=t.source.element.nativeElement.getBoundingClientRect(),i=n.left-e.left;n.top,e.top;this.draglineElementRef.nativeElement.style.left=i+"px",this.draglineElementRef.nativeElement.style.display="block"},t.prototype.hideAuxiliaryLine=function(){this.draglineElementRef.nativeElement.style.display="none"},t}();K.decorators=[{type:e.Component,args:[{selector:"gantt-table",template:'<div class="gantt-table-header gantt-table-row">\n <div class="gantt-table-column" *ngFor="let column of columnList; let i = index" [style.width]="column.columnWidth">\n <ng-container *ngIf="column.headerTemplateRef; else default" [ngTemplateOutlet]="column.headerTemplateRef"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class="gantt-table-drag-trigger"\n cdkDrag\n cdkDragLockAxis="x"\n cdkDragBoundary=".gantt"\n (cdkDragMoved)="dragMoved($event, column)"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="columnDragEnded($event, column)"\n ></div>\n </div>\n</div>\n<div class="gantt-table-body">\n <ng-container *ngIf="!groups.length && !items.length">\n <ng-container *ngIf="!emptyTemplate">\n <gantt-icon class="empty-icon" iconName="empty"></gantt-icon>\n <div class="empty-text">没有数据</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]="emptyTemplate"></ng-template>\n </ng-container>\n\n <ng-container *ngIf="groups && groups.length > 0; else itemsTemplate">\n <ng-container *ngFor="let group of groups">\n <div class="gantt-table-group" [ngClass]="group.class">\n <div class="gantt-table-group-title" [class.expanded]="group.expanded" (click)="expandGroup(group)">\n <gantt-icon class="expand-icon" [iconName]="group.expanded ? \'angle-down\' : \'angle-right\'"></gantt-icon>\n <ng-container *ngIf="groupTemplate; else default">\n <ng-template\n [ngTemplateOutlet]="groupTemplate"\n [ngTemplateOutletContext]="{ $implicit: group.origin, group: group.origin }"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class="group-title">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf="group.expanded">\n <ng-template\n [ngTemplateOutlet]="ganttItems"\n [ngTemplateOutletContext]="{ group: group, items: group.items, level: 0 }"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class="gantt-table-drag-trigger"\n cdkDrag\n cdkDragLockAxis="x"\n cdkDragBoundary=".gantt"\n (cdkDragMoved)="dragMoved($event)"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="tableDragEnded($event)"\n></div>\n\n<div #dragLine class="gantt-table-drag-auxiliary-line"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]="ganttItems" [ngTemplateOutletContext]="{ items: items, level: 0 }"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group="group" let-items="items" let-level="level">\n <ng-container *ngFor="let item of items">\n <div\n class="gantt-table-item gantt-table-row"\n [class.gantt-table-item-first-level-group]="level === 0 && (item.type | isGanttRangeItem)"\n [class.gantt-table-item-with-group]="group"\n [style.height.px]="gantt.styles.lineHeight"\n [style.lineHeight.px]="gantt.styles.lineHeight"\n >\n <div class="gantt-table-column" *ngFor="let column of columnList; let first = first" [style.width]="column.columnWidth">\n <div *ngIf="first" class="gantt-expand-icon" [style.marginLeft.px]="level * 20">\n <ng-container *ngIf="level < gantt.maxLevel - 1 && item.expandable">\n <gantt-icon\n *ngIf="!item.loading"\n class="expand-icon"\n [iconName]="item.expanded ? \'angle-down\' : \'angle-right\'"\n (click)="expandChildren(item)"\n ></gantt-icon>\n <gantt-icon *ngIf="item.loading" [iconName]="\'loading\'"></gantt-icon>\n </ng-container>\n </div>\n <div class="gantt-table-column-content">\n <ng-template\n [ngTemplateOutlet]="column.templateRef"\n [ngTemplateOutletContext]="{ $implicit: item.origin, item: item.origin }"\n ></ng-template>\n </div>\n </div>\n </div>\n <ng-template\n *ngIf="item.children && item.expanded"\n [ngTemplateOutlet]="ganttItems"\n [ngTemplateOutletContext]="{ items: item.children, level: level + 1, group: group }"\n ></ng-template>\n </ng-container>\n</ng-template>\n'}]}],K.ctorParameters=function(){return[{type:Z},{type:e.ElementRef}]},K.propDecorators={groups:[{type:e.Input}],items:[{type:e.Input}],columns:[{type:e.Input}],groupTemplate:[{type:e.Input}],emptyTemplate:[{type:e.Input}],draglineElementRef:[{type:e.ViewChild,args:["dragLine",{static:!0}]}],ganttTableClass:[{type:e.HostBinding,args:["class.gantt-table"]}],ganttTableEmptyClass:[{type:e.HostBinding,args:["class.gantt-table-empty"]}]};var J;!function(t){t[t.NONE=0]="NONE",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT"}(J||(J={}));var tt=function(){function t(){this.unsubscribe$=new r.Subject}return t.prototype.monitorScrollChange=function(){var t=this;r.merge(r.fromEvent(this.mainContainer,"scroll"),r.fromEvent(this.sideContainer,"scroll")).pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(e){t.syncScroll(e)})),r.fromEvent(this.mainContainer,"scroll").pipe(i.startWith(),i.takeUntil(this.unsubscribe$)).subscribe((function(t){}))},t.prototype.syncScroll=function(t){var e=t.currentTarget;this.calendarOverlay.scrollLeft=this.mainContainer.scrollLeft,this.sideContainer.scrollTop=e.scrollTop,this.mainContainer.scrollTop=e.scrollTop},t.prototype.disableBrowserWheelEvent=function(){var t=this.mainContainer;r.fromEvent(t,"wheel").pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(e){var n=e.deltaX;n&&(t.scrollLeft+t.offsetWidth===t.scrollWidth&&n>0||0===t.scrollLeft&&n<0)&&e.preventDefault()}))},t.prototype.initialize=function(t){this.root=t.nativeElement,this.side=this.root.getElementsByClassName("gantt-side")[0],this.container=this.root.getElementsByClassName("gantt-container")[0],this.sideContainer=this.root.getElementsByClassName("gantt-side-container")[0],this.mainContainer=this.root.getElementsByClassName("gantt-main-container")[0],this.calendarOverlay=this.root.getElementsByClassName("gantt-calendar-overlay")[0],this.monitorScrollChange(),this.disableBrowserWheelEvent()},t.prototype.getViewerScroll=function(){var t=this;return r.fromEvent(this.mainContainer,"scroll").pipe(i.map((function(){return t.mainContainer.scrollLeft})),i.pairwise(),i.map((function(e){var n=h(e,2),i=n[0],r=n[1],a={target:t.mainContainer,direction:J.NONE};return r-i<0&&t.mainContainer.scrollLeft<50&&t.mainContainer.scrollLeft>0&&(a.direction=J.LEFT),r-i>0&&t.mainContainer.scrollWidth-t.mainContainer.clientWidth-t.mainContainer.scrollLeft<50&&(a.direction=J.RIGHT),a})))},t.prototype.getResize=function(){return r.fromEvent(window,"resize").pipe(i.auditTime(150))},t.prototype.scrollMainContainer=function(t){if(V(t)){var e=t-this.mainContainer.clientWidth/2;this.mainContainer.scrollLeft=e>50?e:0,this.calendarOverlay.scrollLeft=this.mainContainer.scrollLeft}},t.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},t}();tt.decorators=[{type:e.Injectable}],tt.ctorParameters=function(){return[]};var et=function(){function t(){this.dragStarted=new e.EventEmitter,this.dragEnded=new e.EventEmitter,this.linkDragStarted=new e.EventEmitter,this.linkDragEntered=new e.EventEmitter,this.linkDragEnded=new e.EventEmitter}return t.prototype.emitLinkDragStarted=function(t,e){this.linkDraggingId=e.id,this.linkDragFrom=t,this.linkDragSource="source"===this.linkDragFrom?e:null,this.linkDragTarget="target"===this.linkDragFrom?e:null,this.linkDragStarted.emit({source:this.linkDragSource&&this.linkDragSource.origin,target:this.linkDragTarget&&this.linkDragTarget.origin})},t.prototype.emitLinkDragEntered=function(t){"source"===this.linkDragFrom?this.linkDragTarget=t:this.linkDragSource=t,this.linkDragEntered.emit({source:this.linkDragSource.origin,target:this.linkDragTarget.origin})},t.prototype.emitLinkDragLeaved=function(){"source"===this.linkDragFrom?this.linkDragTarget=null:this.linkDragSource=null},t.prototype.emitLinkDragEnded=function(){this.linkDraggingId=null,this.linkDragSource&&this.linkDragTarget&&(this.linkDragSource.addLink(this.linkDragTarget.id),this.linkDragEnded.emit({source:this.linkDragSource.origin,target:this.linkDragTarget.origin})),this.linkDragSource=null,this.linkDragTarget=null},t}();et.decorators=[{type:e.Injectable}],et.ctorParameters=function(){return[]};var nt="gantt-bar-active",it="gantt-bar-link-drop";function rt(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg",t);return n.classList.add(e),n}var at=function(){function t(t,e,n){this.dragDrop=t,this.dom=e,this.dragContainer=n,this.dragRefs=[],this.destroy$=new r.Subject}return Object.defineProperty(t.prototype,"dragDisabled",{get:function(){return!this.item.draggable||!this.ganttUpper.draggable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkDragDisabled",{get:function(){return!this.item.linkable||!this.ganttUpper.linkable},enumerable:!1,configurable:!0}),t.prototype.createMouseEvents=function(){var t=this;r.fromEvent(this.barElement,"mouseenter").pipe(i.takeUntil(this.destroy$)).subscribe((function(){t.dragContainer.linkDraggingId&&t.dragContainer.linkDraggingId!==t.item.id?t.item.linkable&&(t.barElement.classList.add(it),t.dragContainer.emitLinkDragEntered(t.item)):t.barElement.classList.add(nt)})),r.fromEvent(this.barElement,"mouseleave").pipe(i.takeUntil(this.destroy$)).subscribe((function(){t.dragContainer.linkDraggingId?t.dragContainer.emitLinkDragLeaved():t.barElement.classList.remove(nt),t.barElement.classList.remove(it)}))},t.prototype.createBarDrag=function(){var t=this,e=this.dragDrop.createDrag(this.barElement);return e.lockAxis="x",e.started.subscribe((function(){t.setDraggingStyles(),t.dragContainer.dragStarted.emit({item:t.item.origin})})),e.moved.subscribe((function(e){var n=t.item.refs.x+e.distance.x,i=a.differenceInCalendarDays(t.item.end.value,t.item.start.value),r=t.ganttUpper.view.getDateByXPoint(n).addDays(i);t.openDragBackdrop(t.barElement,t.ganttUpper.view.getDateByXPoint(n),r)})),e.ended.subscribe((function(e){var n=a.differenceInCalendarDays(t.item.end.value,t.item.start.value),i=t.ganttUpper.view.getDateByXPoint(t.item.refs.x+e.distance.x),r=i.addDays(n);t.item.updateDate(i,r),t.clearDraggingStyles(),t.closeDragBackdrop(),e.source.reset(),t.dragContainer.dragEnded.emit({item:t.item.origin})})),this.barDragRef=e,e},t.prototype.createBarHandleDrags=function(){var t=this,e=[];return this.barElement.querySelectorAll(".drag-handles .handle").forEach((function(n,i){var r=0===i,a=t.dragDrop.createDrag(n);a.lockAxis="x",a.withBoundaryElement(t.dom.root),a.started.subscribe((function(){t.setDraggingStyles(),t.dragContainer.dragStarted.emit({item:t.item.origin})})),a.moved.subscribe((function(e){if(r){var n=t.item.refs.x+e.distance.x;(i=t.item.refs.width+-1*e.distance.x)>10&&(t.barElement.style.width=i+"px",t.barElement.style.left=n+"px",t.openDragBackdrop(t.barElement,t.ganttUpper.view.getDateByXPoint(n),t.ganttUpper.view.getDateByXPoint(n+i)))}else{var i;(i=t.item.refs.width+e.distance.x)>10&&(t.barElement.style.width=i+"px",t.openDragBackdrop(t.barElement,t.ganttUpper.view.getDateByXPoint(t.item.refs.x),t.ganttUpper.view.getDateByXPoint(t.item.refs.x+i)))}e.source.reset()})),a.ended.subscribe((function(e){r?t.item.refs.width+-1*e.distance.x>10?t.item.updateDate(t.ganttUpper.view.getDateByXPoint(t.item.refs.x+e.distance.x),t.item.end):t.item.updateDate(t.item.end.startOfDay(),t.item.end):t.item.refs.width+e.distance.x>10?t.item.updateDate(t.item.start,t.ganttUpper.view.getDateByXPoint(t.item.refs.x+t.item.refs.width+e.distance.x)):t.item.updateDate(t.item.start,t.item.start.endOfDay());t.clearDraggingStyles(),t.closeDragBackdrop(),t.dragContainer.dragEnded.emit({item:t.item.origin})})),e.push(a)})),e},t.prototype.createLinkHandleDrags=function(){var t=this,e=[];return this.barElement.querySelectorAll(".link-handles .handle").forEach((function(n,i){var r=0===i,a=t.dragDrop.createDrag(n);a.withBoundaryElement(t.dom.root),a.beforeStarted.subscribe((function(){n.style.pointerEvents="none",t.barDragRef&&(t.barDragRef.disabled=!0),t.createLinkDraggingLine(),t.dragContainer.emitLinkDragStarted(r?"target":"source",t.item)})),a.moved.subscribe((function(){var e=t.calcLinkLinePositions(n,r);t.linkDraggingLine.setAttribute("x1",e.x1.toString()),t.linkDraggingLine.setAttribute("y1",e.y1.toString()),t.linkDraggingLine.setAttribute("x2",e.x2.toString()),t.linkDraggingLine.setAttribute("y2",e.y2.toString())})),a.ended.subscribe((function(e){e.source.reset(),n.style.pointerEvents="",t.barDragRef&&(t.barDragRef.disabled=!1),t.barElement.classList.remove(nt),t.destroyLinkDraggingLine(),t.dragContainer.emitLinkDragEnded()})),e.push(a)})),e},t.prototype.openDragBackdrop=function(t,e,n){var i=this.dom.root.querySelector(".gantt-drag-mask"),r=this.dom.root.querySelector(".gantt-drag-backdrop"),a=this.dom.root.getBoundingClientRect(),o=t.getBoundingClientRect(),s=o.left-a.left-this.dom.side.clientWidth,l=o.right-o.left;i.style.left=s+"px",i.style.width=l+"px",i.querySelector(".start").innerHTML=e.format("MM-dd"),i.querySelector(".end").innerHTML=n.format("MM-dd"),i.style.display="block",r.style.display="block"},t.prototype.closeDragBackdrop=function(){var t=this.dom.root.querySelector(".gantt-drag-mask"),e=this.dom.root.querySelector(".gantt-drag-backdrop");t.style.display="none",e.style.display="none"},t.prototype.setDraggingStyles=function(){this.barElement.style.pointerEvents="none",this.barElement.classList.add("gantt-bar-draggable-drag")},t.prototype.clearDraggingStyles=function(){this.barElement.style.pointerEvents="",this.barElement.classList.remove("gantt-bar-draggable-drag")},t.prototype.calcLinkLinePositions=function(t,e){var n=this.dom.root.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.parentElement.parentElement.getBoundingClientRect();return{x1:r.left+(e?0:r.width)-n.left,y1:r.top+r.height/2-n.top,x2:i.left-n.left+i.width/2,y2:i.top-n.top+i.height/2}},t.prototype.createLinkDraggingLine=function(){if(!this.linkDraggingLine){var t=rt("svg","gantt-link-drag-container"),e=rt("line","link-dragging-line");t.appendChild(e),this.dom.root.appendChild(t),this.linkDraggingLine=e}},t.prototype.destroyLinkDraggingLine=function(){this.linkDraggingLine&&(this.linkDraggingLine.parentElement.remove(),this.linkDraggingLine=null)},t.prototype.createDrags=function(t,e,n){var i,r;if(this.item=e,this.barElement=t.nativeElement,this.ganttUpper=n,!(!e.draggable||this.dragDisabled&&this.linkDragDisabled)){if(this.createMouseEvents(),!this.dragDisabled){var a=this.createBarDrag(),o=this.createBarHandleDrags();(i=this.dragRefs).push.apply(i,f([a],o))}if(!this.linkDragDisabled){var s=this.createLinkHandleDrags();(r=this.dragRefs).push.apply(r,f(s))}}},t.prototype.ngOnDestroy=function(){this.closeDragBackdrop(),this.dragRefs.forEach((function(t){return t.dispose()})),this.destroy$.next(),this.destroy$.complete()},t}();at.decorators=[{type:e.Injectable}],at.ctorParameters=function(){return[{type:s.DragDrop},{type:tt},{type:et}]};var ot=function(){function e(t,e){this.elementRef=t,this.ganttUpper=e,this.firstChange=!0,this.unsubscribe$=new r.Subject}return e.prototype.onInit=function(){var t=this;this.firstChange=!1,this.item.refs$.pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(){t.setPositions()}))},e.prototype.onChanges=function(){this.firstChange||this.setPositions()},e.prototype.setPositions=function(){var e=this.elementRef.nativeElement;e.style.left=this.item.refs.x+"px",e.style.top=this.item.refs.y+"px",e.style.width=this.item.refs.width+"px",this.item.type===t.GanttItemType.bar?e.style.height=this.ganttUpper.styles.barHeight+"px":this.item.type===t.GanttItemType.range&&(e.style.height="17px")},e.prototype.onDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},e}();function st(t,e,n){return"linear-gradient("+t+","+e+" 0%,"+n+" 40%)"}ot.decorators=[{type:e.Directive}],ot.ctorParameters=function(){return[{type:e.ElementRef},{type:Q,decorators:[{type:e.Inject,args:[q]}]}]},ot.propDecorators={template:[{type:e.Input}],item:[{type:e.Input}]};var lt=function(t){function n(n,i,r,a){var o=t.call(this,r,a)||this;return o.dragContainer=n,o.drag=i,o.ganttUpper=a,o.barClick=new e.EventEmitter,o.ganttItemClass=!0,o.color="red",o}return c(n,t),n.prototype.ngOnInit=function(){var e=this;t.prototype.onInit.call(this),this.dragContainer.dragEnded.pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(){e.setContentBackground()}))},n.prototype.ngAfterViewInit=function(){this.drag.createDrags(this.elementRef,this.item,this.ganttUpper),this.setContentBackground()},n.prototype.ngOnChanges=function(){t.prototype.onChanges.call(this)},n.prototype.onBarClick=function(t){this.barClick.emit({event:t,item:this.item.origin})},n.prototype.setContentBackground=function(){var t=this.contentElementRef.nativeElement,e=this.item.color||"#348fe4",n=this.item.barStyle||{};if(this.item.origin.start&&this.item.origin.end&&(n.background=e,n.borderRadius=""),this.item.origin.start&&!this.item.origin.end&&(n.background=st("to left",A(e,.55),A(e,1)),n.borderRadius="4px 12.5px 12.5px 4px"),!this.item.origin.start&&this.item.origin.end&&(n.background=st("to right",A(e,.55),A(e,1)),n.borderRadius="12.5px 4px 4px 12.5px"),this.item.progress>=0){var i=t.querySelector(".gantt-bar-content-progress");n.background=A(e,.3),n.borderRadius="",i.style.background=e}for(var r in n)n.hasOwnProperty(r)&&(t.style[r]=n[r])},n.prototype.stopPropagation=function(t){t.stopPropagation()},n.prototype.ngOnDestroy=function(){t.prototype.onDestroy.call(this)},n}(ot);lt.decorators=[{type:e.Component,args:[{selector:"ngx-gantt-bar,gantt-bar",template:'<div class="gantt-bar-layer">\n <div *ngIf="item.draggable && ganttUpper.draggable" class="drag-handles">\n <ng-container>\n <span class="handle" (mousedown)="stopPropagation($event)"></span>\n <span class="handle" (mousedown)="stopPropagation($event)"></span>\n </ng-container>\n </div>\n <div *ngIf="item.linkable && ganttUpper.linkable" class="link-handles">\n <span class="handle"><span class="point"></span></span>\n <span class="handle"> <span class="point"></span></span>\n </div>\n</div>\n<div class="gantt-bar-border"></div>\n<div #content class="gantt-bar-content" (click)="onBarClick($event)">\n <div class="gantt-bar-content-progress" *ngIf="item.progress >= 0" [style.width.%]="item.progress * 100"></div>\n <ng-template [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item.origin, refs: item.refs }"></ng-template>\n</div>\n',providers:[at]}]}],lt.ctorParameters=function(){return[{type:et},{type:at},{type:e.ElementRef},{type:Q,decorators:[{type:e.Inject,args:[q]}]}]},lt.propDecorators={barClick:[{type:e.Output}],contentElementRef:[{type:e.ViewChild,args:["content"]}],ganttItemClass:[{type:e.HostBinding,args:["class.gantt-bar"]}]};var pt=function(){function t(t){this.ganttUpper=t,this.barClick=new e.EventEmitter,this.lineClick=new e.EventEmitter,this.ganttMainClass=!0}return t.prototype.ngOnInit=function(){},t.prototype.trackBy=function(t,e){return t.id||e},t}();pt.decorators=[{type:e.Component,args:[{selector:"gantt-main",template:'<gantt-links-overlay [groups]="groups" [items]="items" (lineClick)="lineClick.emit($event)"></gantt-links-overlay>\n\x3c!-- groups --\x3e\n<div class="gantt-main-groups" *ngIf="groups && groups.length > 0; else itemsTemplate" [style.width.px]="ganttUpper.view.width">\n <ng-container *ngFor="let group of groups; trackBy: trackBy">\n <div class="gantt-group" [ngClass]="group.class">\n <ng-template [ngTemplateOutlet]="groupHeaderTemplate" [ngTemplateOutletContext]="{ group: group }"></ng-template>\n </div>\n <div *ngIf="group.expanded" class="gantt-items">\n <ng-template [ngTemplateOutlet]="ganttItems" [ngTemplateOutletContext]="{ items: group.items }"></ng-template>\n </div>\n </ng-container>\n</div>\n\x3c!-- items --\x3e\n<ng-template #itemsTemplate>\n <div class="gantt-main-items" [style.width.px]="ganttUpper.view.width">\n <ng-template [ngTemplateOutlet]="ganttItems" [ngTemplateOutletContext]="{ items: items }"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items="items">\n <ng-container *ngFor="let item of items; trackBy: trackBy">\n <div class="gantt-item" [style.height.px]="ganttUpper.styles.lineHeight">\n <ng-container *ngIf="item.type | isGanttCustomItem">\n <ng-template [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ item: item.origin, refs: item.refs }"></ng-template>\n </ng-container>\n <gantt-range *ngIf="item.type | isGanttRangeItem" [template]="rangeTemplate" [item]="item"></gantt-range>\n <gantt-bar *ngIf="item.type | isGanttBarItem" [item]="item" [template]="barTemplate" (barClick)="barClick.emit($event)"></gantt-bar>\n </div>\n <ng-template\n *ngIf="item.children && item.expanded"\n [ngTemplateOutlet]="ganttItems"\n [ngTemplateOutletContext]="{ items: item.children }"\n ></ng-template>\n </ng-container>\n</ng-template>\n'}]}],pt.ctorParameters=function(){return[{type:Q,decorators:[{type:e.Inject,args:[q]}]}]},pt.propDecorators={groups:[{type:e.Input}],items:[{type:e.Input}],groupHeaderTemplate:[{type:e.Input}],itemTemplate:[{type:e.Input}],barTemplate:[{type:e.Input}],rangeTemplate:[{type:e.Input}],barClick:[{type:e.Output}],lineClick:[{type:e.Output}],ganttMainClass:[{type:e.HostBinding,args:["class.gantt-main-container"]}]};var dt={"angle-right":'<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="amnavigation/angle-right" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z" transform="rotate(-90 7.978 8.252)"></path></g></svg>',"angle-down":'<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aknavigation/angle-down" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z" ></path></g></svg>',"plus-square":'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="kxaction/plus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm5.45 6.2V4.75h1.2V7.4h2.65v1.2H8.65v2.65h-1.2V8.6H4.8V7.4h2.65z"></path></g></svg>',"minus-square":'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="jnaction/minus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z"></path></g></svg>',loading:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve">\n<path fill="#aaa" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)">\n <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform>\n</path>\n</svg>',empty:'<svg\nwidth="148px"\nheight="134px"\nviewBox="0 0 148 134"\nversion="1.1"\nxmlns="http://www.w3.org/2000/svg"\nxmlns:xlink="http://www.w3.org/1999/xlink"\n>\n<defs>\n <filter x="0.0%" y="0.0%" width="100.0%" height="100.0%" filterUnits="objectBoundingBox" id="filter-1">\n <feGaussianBlur stdDeviation="0" in="SourceGraphic"></feGaussianBlur>\n </filter>\n</defs>\n<g id="148x134" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="编组-6" transform="translate(1.000000, 1.000000)">\n <ellipse\n id="椭圆形"\n fill="#EDEEF2"\n opacity="0.3"\n filter="url(#filter-1)"\n cx="73.0800017"\n cy="115.920003"\n rx="73.0800017"\n ry="16.8000004"\n ></ellipse>\n <g id="编组-5" transform="translate(15.120000, 0.000000)">\n <polygon\n id="矩形"\n fill="#E2E4E9"\n points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"\n ></polygon>\n <path\n d="M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z"\n id="矩形"\n fill="#F9FAFB"\n ></path>\n <path\n d="M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z"\n id="矩形"\n fill="#E8EAEE"\n ></path>\n <text\n id="</null>"\n font-family="PingFangSC-Medium, PingFang SC"\n font-size="15.1200003"\n font-weight="400"\n fill="#BCBECD"\n >\n <tspan x="33.6000008" y="32.8000004"></null></tspan>\n </text>\n <rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>\n <rect\n id="矩形备份"\n fill="#E8EAEE"\n x="27.5600006"\n y="63.8400014"\n width="61.4800014"\n height="5.04000011"\n rx="2.52000006"\n ></rect>\n <path\n d="M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z"\n id="矩形"\n fill="#EDEFF2"\n ></path>\n </g>\n </g>\n</g>\n</svg>'},ut=function(){function t(t){this.elementRef=t,this.isIcon=!0}return Object.defineProperty(t.prototype,"iconName",{set:function(t){this.setSvg(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.setSvg=function(t){var e=dt[t];this.elementRef.nativeElement.innerHTML=e||""},t}();ut.decorators=[{type:e.Component,args:[{selector:"gantt-icon",template:""}]}],ut.ctorParameters=function(){return[{type:e.ElementRef}]},ut.propDecorators={isIcon:[{type:e.HostBinding,args:["class.gantt-icon"]}],iconName:[{type:e.Input}]};var ct,gt=function(){function t(){this.backdropClass=!0}return t.prototype.ngOnInit=function(){},t}();gt.decorators=[{type:e.Component,args:[{selector:"gantt-drag-backdrop",template:'<div class="gantt-drag-mask">\n <div class="date-range">\n <span class="start"></span>\n <span class="end"></span>\n </div>\n</div>\n'}]}],gt.ctorParameters=function(){return[]},gt.propDecorators={backdropClass:[{type:e.HostBinding,args:["class.gantt-drag-backdrop"]}]},function(t){t.default="#cacaca",t.blocked="#FF7575",t.active="#348FE4"}(ct||(ct={}));var ht=function(){function t(t,n,i,a){this.ganttUpper=t,this.cdr=n,this.elementRef=i,this.ganttDragContainer=a,this.groups=[],this.items=[],this.lineClick=new e.EventEmitter,this.links=[],this.linkItems=[],this.bezierWeight=-.5,this.firstChange=!0,this.unsubscribe$=new r.Subject,this.ganttLinksOverlay=!0}return t.prototype.ngOnInit=function(){var t=this;this.buildLinks(),this.firstChange=!1,this.ganttDragContainer.dragStarted.pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(){t.elementRef.nativeElement.style.visibility="hidden"})),r.merge(this.ganttUpper.viewChange,this.ganttUpper.expandChange,this.ganttUpper.view.start$,this.ganttUpper.dragEnded,this.ganttUpper.linkDragEnded).pipe(i.takeUntil(this.unsubscribe$),i.skip(1)).subscribe((function(){t.elementRef.nativeElement.style.visibility="visible",t.buildLinks(),t.cdr.detectChanges()}))},t.prototype.ngOnChanges=function(){this.firstChange||this.buildLinks()},t.prototype.computeItemPosition=function(){var t=this,e=this.ganttUpper.styles.lineHeight,n=this.ganttUpper.styles.barHeight;if(this.linkItems=[],this.groups.length>0){var i=0,r=0;this.groups.forEach((function(a){if(r++,a.expanded){var o=F(a.items);o.forEach((function(a,o){var s=(r+i+o)*e+a.refs.y+n/2;t.linkItems.push(Object.assign(Object.assign({},a),{before:{x:a.refs.x,y:s},after:{x:a.refs.x+a.refs.width,y:s}}))})),i+=o.length}}))}else{F(this.items).forEach((function(i,r){var a=r*e+i.refs.y+n/2;t.linkItems.push(Object.assign(Object.assign({},i),{before:{x:i.refs.x,y:a},after:{x:i.refs.x+i.refs.width,y:a}}))}))}},t.prototype.generatePath=function(t,e){if(t.before&&t.after&&e.before&&e.after){var n=t.after.x,i=t.after.y,r=e.before.x,a=e.before.y,o=Math.abs(r-n)*this.bezierWeight,s=n-o,l=r+o,p=(n+r)/2,d=(i+a)/2,u=this.ganttUpper.styles.lineHeight/2,c=this.ganttUpper.styles.lineHeight/2;return n>=r?a>i?Math.abs(a-i)<=this.ganttUpper.styles.lineHeight?"M "+n+" "+i+"\n C "+(n+u)+" "+i+" "+(n+u)+" "+(i+u)+" "+n+" "+(i+c)+"\n L "+n+" "+(i+c)+" "+p+" "+d+"\n\n M "+r+" "+a+"\n C "+(r-u)+" "+a+" "+(r-u)+" "+(a-u)+" "+r+" "+(a-c)+"\n L "+r+" "+(a-c)+" "+p+" "+d:"M "+n+" "+i+"\n C "+(n+(u=this.ganttUpper.styles.lineHeight))+" "+i+" "+(n+u)+" "+(i+u)+" "+p+" "+d+"\n\n\n M "+r+" "+a+"\n C "+(r-u)+" "+a+" "+(r-u)+" "+(a-u)+" "+p+" "+d:Math.abs(a-i)<=this.ganttUpper.styles.lineHeight?"M "+n+" "+i+"\n C "+(n+u)+" "+i+" "+(n+u)+" "+(i-u)+" "+n+" "+(i-c)+"\n L "+n+" "+(i-c)+" "+p+" "+d+"\n\n M "+r+" "+a+"\n C "+(r-u)+" "+a+" "+(r-u)+" "+(a+u)+" "+r+" "+(a+c)+"\n L "+r+" "+(a+c)+" "+p+" "+d+"\n ":"M "+n+" "+i+"\n C "+(n+(u=this.ganttUpper.styles.lineHeight))+" "+i+" "+(n+u)+" "+(i-u)+" "+p+" "+d+"\n\n M "+r+" "+a+"\n C "+(r-u)+" "+a+" "+(r-u)+" "+(a+u)+" "+p+" "+d:"M "+n+" "+i+" C "+s+" "+i+" "+l+" "+a+" "+r+" "+a}},t.prototype.buildLinks=function(){var t=this;this.computeItemPosition(),this.links=[],this.linkItems.forEach((function(e){(e.origin.start||e.origin.end)&&e.links.forEach((function(n){var i=t.linkItems.find((function(t){return t.id===n}));i&&(i.origin.start||i.origin.end)&&t.links.push({path:t.generatePath(e,i),source:e.origin,target:i.origin,color:e.end.getTime()>i.start.getTime()?ct.blocked:ct.default})}))}))},t.prototype.trackBy=function(t){return t},t.prototype.onLineClick=function(t,e){this.lineClick.emit({event:t,source:e.source,target:e.target})},t.prototype.mouseEnterPath=function(t){t.color===ct.default&&(t.color=ct.active)},t.prototype.mouseLeavePath=function(t){t.color===ct.active&&(t.color=ct.default)},t.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},t}();ht.decorators=[{type:e.Component,args:[{selector:"gantt-links-overlay",template:'<svg [attr.width]="ganttUpper.view.width" class="gantt-links-overlay-main">\n <ng-container *ngFor="let link of links; let i = index; trackBy: trackBy">\n <path [attr.d]="link.path" fill="transparent" stroke-width="2" [attr.stroke]="link.color" pointer-events="none"></path>\n <g>\n <path\n class="link-line"\n (click)="onLineClick($event, link)"\n (mouseenter)="mouseEnterPath(link)"\n (mouseleave)="mouseLeavePath(link)"\n [attr.d]="link.path"\n stroke="transparent"\n stroke-width="9"\n fill="none"\n cursor="pointer"\n ></path>\n </g>\n </ng-container>\n <line class="link-dragging-line"></line>\n</svg>\n'}]}],ht.ctorParameters=function(){return[{type:Q,decorators:[{type:e.Inject,args:[q]}]},{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:et}]},ht.propDecorators={groups:[{type:e.Input}],items:[{type:e.Input}],lineClick:[{type:e.Output}],ganttLinksOverlay:[{type:e.HostBinding,args:["class.gantt-links-overlay"]}]};var ft=function(){function t(){}return t.prototype.setInlineStyles=function(t){var e,n,i=Array.from(t.getElementsByTagName("svg"));try{for(var r=g(i),a=r.next();!a.done;a=r.next()){var o=a.value;this.recursElementChildren(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.recursElementChildren=function(t){var e,n,i,r;if(t.style){var a=getComputedStyle(t);try{for(var o=g(["fill","color","font-size","stroke","font","text-anchor","stroke-dasharray","shape-rendering","stroke-width"]),s=o.next();!s.done;s=o.next()){var l=s.value;t.style[l]=a[l]}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var p=g(Array.from(t.childNodes)),d=p.next();!d.done;d=p.next()){var u=d.value;this.recursElementChildren(u)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}},t.prototype.register=function(t){this.root=t.nativeElement,this.mainContainer=this.root.getElementsByClassName("gantt-main-container")[0]},t.prototype.print=function(t,e){var n=this;void 0===t&&(t="download");var i=this.root,r=this.mainContainer,a=i.offsetWidth,o=i.offsetHeight-r.offsetHeight+r.scrollHeight;d.default(i,{logging:!1,allowTaint:!0,useCORS:!0,width:a,height:o,ignoreElements:function(t){return!(!e||!t.classList.contains(e))||(!!t.classList.contains("gantt-calendar-today-overlay")||void 0)},onclone:function(t){var e=i.className,r=t.querySelector("."+e.replace(/\s+/g,".")),s=t.querySelector(".gantt-container"),l=t.querySelector(".gantt-calendar-overlay-main"),p=t.querySelector(".gantt-links-overlay-main");r.style.width=a+"px",r.style.height=o+"px",r.style.overflow="unset",s.style.backgroundColor="#fff",l.setAttribute("height",""+o),l.setAttribute("style","background: transparent"),p&&(p.setAttribute("height",""+o),p.setAttribute("style","height: "+o+"px")),n.setInlineStyles(r)}}).then((function(e){var n=document.createElement("a"),i=e.toDataURL("image/png");n.download=t+".png",n.href=i,n.click()}))},t}();ft.decorators=[{type:e.Injectable}],ft.ctorParameters=function(){return[]};var mt=function(){function t(t,e,n,i,a,o){this.elementRef=t,this.ngZone=e,this.dom=n,this.dragContainer=i,this.ganttUpper=a,this.printService=o,this.ganttClass=!0,this.unsubscribe$=new r.Subject,this.ganttUpper.dragContainer=i}return Object.defineProperty(t.prototype,"view",{get:function(){return this.ganttUpper.view},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.ngZone.onStable.pipe(i.take(1)).subscribe((function(){t.dom.initialize(t.elementRef),t.printService&&t.printService.register(t.elementRef),t.setupScrollClass(),t.setupResize(),t.setupViewScroll(),t.elementRef.nativeElement.style.opacity="1",t.ganttUpper.viewChange.pipe(i.startWith(null)).subscribe((function(){t.scrollToToday()}))}))},t.prototype.setupViewScroll=function(){var t=this;this.ganttUpper.disabledLoadOnScroll||this.dom.getViewerScroll().pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(e){if(e.direction===J.LEFT){var n=t.view.addStartDate();n&&(e.target.scrollLeft+=t.view.getDateRangeWidth(n.start,n.end),t.ngZone.run((function(){t.ganttUpper.loadOnScroll.emit({start:n.start.getUnixTime(),end:n.end.getUnixTime()})})))}if(e.direction===J.RIGHT){var i=t.view.addEndDate();i&&t.ngZone.run((function(){t.ganttUpper.loadOnScroll.emit({start:i.start.getUnixTime(),end:i.end.getUnixTime()})}))}}))},t.prototype.setupResize=function(){var t=this;this.dom.getResize().pipe(i.takeUntil(this.unsubscribe$)).subscribe((function(){t.setupScrollClass()}))},t.prototype.setupScrollClass=function(){var t=this.dom.mainContainer,e=t.offsetHeight,n=t.scrollHeight;this.elementRef.nativeElement.className=n>e?"gantt gantt-scroll":"gantt"},t.prototype.scrollToToday=function(){var t=this.view.getTodayXPoint();this.dom.scrollMainContainer(t)},t}();mt.decorators=[{type:e.Component,args:[{selector:"ngx-gantt-root",template:'<div class="gantt-side" [style.width.px]="sideWidth">\n <div class="gantt-side-container">\n <ng-template [ngTemplateOutlet]="sideTemplate"></ng-template>\n </div>\n</div>\n<div class="gantt-container">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class="gantt-main">\n <ng-template [ngTemplateOutlet]="mainTemplate"></ng-template>\n </div>\n</div>\n',providers:[tt,et]}]}],mt.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:tt},{type:et},{type:Q,decorators:[{type:e.Inject,args:[q]}]},{type:ft,decorators:[{type:e.Optional}]}]},mt.propDecorators={sideWidth:[{type:e.Input}],ganttClass:[{type:e.HostBinding,args:["class.gantt"]}],sideTemplate:[{type:e.ContentChild,args:["sideTemplate",{static:!0}]}],mainTemplate:[{type:e.ContentChild,args:["mainTemplate",{static:!0}]}]};var yt=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.ganttRangeClass=!0,i}return c(e,t),e.prototype.ngOnInit=function(){t.prototype.onInit.call(this)},e.prototype.ngOnChanges=function(){t.prototype.onChanges.call(this)},e.prototype.ngOnDestroy=function(){t.prototype.onDestroy.call(this)},e}(ot);yt.decorators=[{type:e.Component,args:[{selector:"ngx-gantt-range,gantt-range",template:'<ng-container *ngIf="item.start && item.end">\n <div class="gantt-range-main">\n <div class="gantt-range-main-progress" *ngIf="item.progress >= 0" [style.width.%]="item.progress * 100"></div>\n </div>\n <div class="gantt-range-triangle left"></div>\n <div class="gantt-range-triangle right"></div>\n <ng-template [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item.origin, refs: item.refs }"></ng-template>\n</ng-container>\n'}]}],yt.ctorParameters=function(){return[{type:e.ElementRef},{type:Q,decorators:[{type:e.Inject,args:[q]}]}]},yt.propDecorators={ganttRangeClass:[{type:e.HostBinding,args:["class.gantt-range"]}]};var vt=function(){function e(){}return e.prototype.transform=function(e){return e===t.GanttItemType.range},e}();vt.decorators=[{type:e.Pipe,args:[{name:"isGanttRangeItem"}]}];var bt=function(){function e(){}return e.prototype.transform=function(e){return e===t.GanttItemType.bar},e}();bt.decorators=[{type:e.Pipe,args:[{name:"isGanttBarItem"}]}];var wt=function(){function e(){}return e.prototype.transform=function(e){return e===t.GanttItemType.custom},e}();wt.decorators=[{type:e.Pipe,args:[{name:"isGanttCustomItem"}]}];var kt=function(){};kt.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,s.DragDropModule],exports:[Z,X,z,mt,lt],declarations:[Z,X,z,K,pt,_,ht,lt,ut,gt,yt,mt,vt,bt,wt],providers:[]}]}],Object.defineProperty(t,"addDays",{enumerable:!0,get:function(){return a.addDays}}),Object.defineProperty(t,"addHours",{enumerable:!0,get:function(){return a.addHours}}),Object.defineProperty(t,"addMinutes",{enumerable:!0,get:function(){return a.addMinutes}}),Object.defineProperty(t,"addMonths",{enumerable:!0,get:function(){return a.addMonths}}),Object.defineProperty(t,"addQuarters",{enumerable:!0,get:function(){return a.addQuarters}}),Object.defineProperty(t,"addSeconds",{enumerable:!0,get:function(){return a.addSeconds}}),Object.defineProperty(t,"addWeeks",{enumerable:!0,get:function(){return a.addWeeks}}),Object.defineProperty(t,"addYears",{enumerable:!0,get:function(){return a.addYears}}),Object.defineProperty(t,"differenceInCalendarDays",{enumerable:!0,get:function(){return a.differenceInCalendarDays}}),Object.defineProperty(t,"differenceInCalendarQuarters",{enumerable:!0,get:function(){return a.differenceInCalendarQuarters}}),Object.defineProperty(t,"differenceInDays",{enumerable:!0,get:function(){return a.differenceInDays}}),Object.defineProperty(t,"eachDayOfInterval",{enumerable:!0,get:function(){return a.eachDayOfInterval}}),Object.defineProperty(t,"eachMonthOfInterval",{enumerable:!0,get:function(){return a.eachMonthOfInterval}}),Object.defineProperty(t,"eachWeekOfInterval",{enumerable:!0,get:function(){return a.eachWeekOfInterval}}),Object.defineProperty(t,"endOfDay",{enumerable:!0,get:function(){return a.endOfDay}}),Object.defineProperty(t,"endOfMonth",{enumerable:!0,get:function(){return a.endOfMonth}}),Object.defineProperty(t,"endOfQuarter",{enumerable:!0,get:function(){return a.endOfQuarter}}),Object.defineProperty(t,"endOfWeek",{enumerable:!0,get:function(){return a.endOfWeek}}),Object.defineProperty(t,"endOfYear",{enumerable:!0,get:function(){return a.endOfYear}}),Object.defineProperty(t,"format",{enumerable:!0,get:function(){return a.format}}),Object.defineProperty(t,"fromUnixTime",{enumerable:!0,get:function(){return a.fromUnixTime}}),Object.defineProperty(t,"getDaysInMonth",{enumerable:!0,get:function(){return a.getDaysInMonth}}),Object.defineProperty(t,"getUnixTime",{enumerable:!0,get:function(){return a.getUnixTime}}),Object.defineProperty(t,"getWeek",{enumerable:!0,get:function(){return a.getWeek}}),Object.defineProperty(t,"isToday",{enumerable:!0,get:function(){return a.isToday}}),Object.defineProperty(t,"isWeekend",{enumerable:!0,get:function(){return a.isWeekend}}),Object.defineProperty(t,"setDate",{enumerable:!0,get:function(){return a.setDate}}),Object.defineProperty(t,"startOfDay",{enumerable:!0,get:function(){return a.startOfDay}}),Object.defineProperty(t,"startOfMonth",{enumerable:!0,get:function(){return a.startOfMonth}}),Object.defineProperty(t,"startOfQuarter",{enumerable:!0,get:function(){return a.startOfQuarter}}),Object.defineProperty(t,"startOfWeek",{enumerable:!0,get:function(){return a.startOfWeek}}),Object.defineProperty(t,"startOfYear",{enumerable:!0,get:function(){return a.startOfYear}}),t.GANTT_UPPER_TOKEN=q,t.GanttBarClickEvent=D,t.GanttDate=O,t.GanttDatePoint=v,t.GanttDragEvent=b,t.GanttGroupInternal=I,t.GanttItemInternal=E,t.GanttItemUpper=ot,t.GanttLineClickEvent=x,t.GanttLinkDragEvent=k,t.GanttLoadOnScrollEvent=C,t.GanttPrintService=ft,t.GanttTableEvent=w,t.GanttUpper=Q,t.GanttView=P,t.IsGanttBarItemPipe=bt,t.IsGanttCustomItemPipe=wt,t.IsGanttRangeItemPipe=vt,t.NgxGanttComponent=Z,t.NgxGanttModule=kt,t.NgxGanttRootComponent=mt,t.NgxGanttTableColumnComponent=z,t.NgxGanttTableComponent=X,t.defaultColumnWidth=100,t.minColumnWidth=80,t.primaryDatePointTop=T,t.secondaryDatePointTop=36,t.ɵa=tt,t.ɵb=et,t.ɵc=lt,t.ɵd=at,t.ɵe=K,t.ɵf=pt,t.ɵg=_,t.ɵh=ht,t.ɵi=ut,t.ɵj=gt,t.ɵk=yt,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
-
//# sourceMappingURL=worktile-gantt.umd.min.js.map
|