@worktile/gantt 15.0.0-next.0 → 15.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/class/event.d.ts +13 -0
  2. package/class/item.d.ts +7 -1
  3. package/components/bar/bar-drag.d.ts +10 -0
  4. package/components/bar/bar.component.d.ts +2 -1
  5. package/components/bar/bar.component.scss +22 -0
  6. package/components/calendar/calendar.scss +91 -0
  7. package/components/calendar/grid/calendar-grid.component.d.ts +24 -0
  8. package/components/calendar/header/calendar-header.component.d.ts +21 -0
  9. package/components/icon/icons.d.ts +1 -0
  10. package/components/links/links.component.d.ts +5 -5
  11. package/components/main/gantt-main.component.d.ts +3 -3
  12. package/components/table/body/gantt-table-body.component.d.ts +58 -0
  13. package/components/table/gantt-table.component.scss +169 -85
  14. package/components/table/gantt-table.scss +271 -0
  15. package/components/table/header/gantt-table-header.component.d.ts +31 -0
  16. package/esm2020/class/event.mjs +5 -1
  17. package/esm2020/class/item.mjs +9 -4
  18. package/esm2020/components/bar/bar-drag.mjs +106 -42
  19. package/esm2020/components/bar/bar.component.mjs +8 -2
  20. package/esm2020/components/calendar/grid/calendar-grid.component.mjs +71 -0
  21. package/esm2020/components/calendar/header/calendar-header.component.mjs +67 -0
  22. package/esm2020/components/icon/icons.mjs +4 -2
  23. package/esm2020/components/links/links.component.mjs +72 -54
  24. package/esm2020/components/main/gantt-main.component.mjs +5 -5
  25. package/esm2020/components/table/body/gantt-table-body.component.mjs +286 -0
  26. package/esm2020/components/table/header/gantt-table-header.component.mjs +140 -0
  27. package/esm2020/gantt-dom.service.mjs +8 -12
  28. package/esm2020/gantt-item-upper.mjs +15 -6
  29. package/esm2020/gantt-print.service.mjs +2 -2
  30. package/esm2020/gantt-upper.mjs +18 -15
  31. package/esm2020/gantt.component.mjs +114 -24
  32. package/esm2020/gantt.module.mjs +25 -10
  33. package/esm2020/root.component.mjs +10 -8
  34. package/esm2020/table/gantt-column.component.mjs +4 -2
  35. package/esm2020/table/gantt-table.component.mjs +12 -4
  36. package/esm2020/utils/helpers.mjs +11 -1
  37. package/fesm2015/worktile-gantt.mjs +903 -373
  38. package/fesm2015/worktile-gantt.mjs.map +1 -1
  39. package/fesm2020/worktile-gantt.mjs +894 -375
  40. package/fesm2020/worktile-gantt.mjs.map +1 -1
  41. package/gantt-dom.service.d.ts +1 -0
  42. package/gantt-item-upper.d.ts +3 -2
  43. package/gantt-upper.d.ts +4 -1
  44. package/gantt.component.d.ts +20 -7
  45. package/gantt.component.scss +35 -0
  46. package/gantt.module.d.ts +18 -15
  47. package/package.json +1 -1
  48. package/root.component.d.ts +1 -1
  49. package/styles/index.scss +4 -2
  50. package/styles/variables.scss +9 -7
  51. package/table/gantt-column.component.d.ts +2 -1
  52. package/table/gantt-table.component.d.ts +5 -2
  53. package/components/calendar/calendar.component.d.ts +0 -26
  54. package/components/table/gantt-table.component.d.ts +0 -41
  55. package/esm2020/components/calendar/calendar.component.mjs +0 -88
  56. package/esm2020/components/table/gantt-table.component.mjs +0 -161
@@ -18,6 +18,7 @@ export declare class GanttDomService implements OnDestroy {
18
18
  container: Element;
19
19
  sideContainer: Element;
20
20
  mainContainer: Element;
21
+ calendarHeader: Element;
21
22
  mainItems: Element;
22
23
  calendarOverlay: Element;
23
24
  linksOverlay: Element;
@@ -1,4 +1,4 @@
1
- import { ElementRef, TemplateRef, OnInit, OnChanges, OnDestroy } from '@angular/core';
1
+ import { ElementRef, TemplateRef, OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
2
  import { GanttItemInternal } from './class';
3
3
  import { Subject } from 'rxjs';
4
4
  import { GanttUpper } from './gantt-upper';
@@ -12,7 +12,8 @@ export declare abstract class GanttItemUpper implements OnChanges, OnInit, OnDes
12
12
  unsubscribe$: Subject<void>;
13
13
  constructor(elementRef: ElementRef<HTMLElement>, ganttUpper: GanttUpper);
14
14
  ngOnInit(): void;
15
- ngOnChanges(): void;
15
+ ngOnChanges(changes: SimpleChanges): void;
16
+ private itemChange;
16
17
  private setPositions;
17
18
  ngOnDestroy(): void;
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<GanttItemUpper, never>;
package/gantt-upper.d.ts CHANGED
@@ -10,6 +10,7 @@ import { GanttLinkOptions } from './class/link';
10
10
  import { SelectionModel } from '@angular/cdk/collections';
11
11
  import { BooleanInput } from '@angular/cdk/coercion';
12
12
  import { GanttBaselineItem, GanttBaselineItemInternal } from './class/baseline';
13
+ import { NgxGanttTableComponent } from './table/gantt-table.component';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy {
15
16
  protected elementRef: ElementRef<HTMLElement>;
@@ -49,6 +50,7 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
49
50
  groupHeaderTemplate: TemplateRef<any>;
50
51
  toolbarTemplate: TemplateRef<any>;
51
52
  linkable: boolean;
53
+ computeAllRefs: boolean;
52
54
  linkDragEnded: EventEmitter<GanttLinkDragEvent<unknown>>;
53
55
  view: GanttView;
54
56
  items: GanttItemInternal[];
@@ -60,6 +62,7 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
60
62
  dragContainer: GanttDragContainer;
61
63
  unsubscribe$: Subject<void>;
62
64
  selectionModel: SelectionModel<string>;
65
+ table?: NgxGanttTableComponent;
63
66
  private groupsMap;
64
67
  private _selectable;
65
68
  private _multiple;
@@ -73,8 +76,8 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
73
76
  private setupExpandedState;
74
77
  private getViewDate;
75
78
  computeRefs(): void;
76
- private expandGroups;
77
79
  private initSelectionModel;
80
+ expandGroups(expanded: boolean): void;
78
81
  ngOnInit(): void;
79
82
  ngOnChanges(changes: SimpleChanges): void;
80
83
  ngOnDestroy(): void;
@@ -1,14 +1,17 @@
1
- import { OnInit, ElementRef, EventEmitter, ChangeDetectorRef, NgZone, QueryList, AfterViewInit, TemplateRef } from '@angular/core';
1
+ import { OnInit, ElementRef, EventEmitter, ChangeDetectorRef, NgZone, QueryList, AfterViewInit, TemplateRef, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { GanttUpper } from './gantt-upper';
4
- import { GanttLinkDragEvent, GanttLineClickEvent, GanttItemInternal, GanttItem, GanttSelectedEvent } from './class';
4
+ import { GanttLinkDragEvent, GanttLineClickEvent, GanttItemInternal, GanttItem, GanttSelectedEvent, GanttGroupInternal } from './class';
5
5
  import { NgxGanttTableColumnComponent } from './table/gantt-column.component';
6
6
  import { NgxGanttTableComponent } from './table/gantt-table.component';
7
7
  import { GanttGlobalConfig } from './gantt.config';
8
8
  import { NgxGanttRootComponent } from './root.component';
9
9
  import { GanttDate } from './utils/date';
10
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
11
+ import { GanttPrintService } from './gantt-print.service';
10
12
  import * as i0 from "@angular/core";
11
- export declare class NgxGanttComponent extends GanttUpper implements OnInit, AfterViewInit {
13
+ export declare class NgxGanttComponent extends GanttUpper implements OnInit, OnChanges, AfterViewInit {
14
+ private printService;
12
15
  maxLevel: number;
13
16
  async: boolean;
14
17
  childrenResolve: (GanttItem: any) => Observable<GanttItem[]>;
@@ -21,15 +24,25 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, Aft
21
24
  columns: QueryList<NgxGanttTableColumnComponent>;
22
25
  tableEmptyTemplate: TemplateRef<any>;
23
26
  ganttRoot: NgxGanttRootComponent;
24
- private ngUnsubscribe$;
25
- sideTableWidth: number;
26
- constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, config: GanttGlobalConfig);
27
+ virtualScroll: CdkVirtualScrollViewport;
28
+ flatData: (GanttGroupInternal | GanttItemInternal)[];
29
+ renderData: (GanttGroupInternal | GanttItemInternal)[];
30
+ private rangeStart;
31
+ private rangeEnd;
32
+ private flatDataMap;
33
+ constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, printService: GanttPrintService, config: GanttGlobalConfig);
27
34
  ngOnInit(): void;
35
+ ngOnChanges(changes: SimpleChanges): void;
28
36
  ngAfterViewInit(): void;
37
+ private buildVirtualFlatData;
38
+ private afterExpand;
39
+ private computeTempDataRefs;
29
40
  expandChildren(item: GanttItemInternal): void;
30
41
  selectItem(selectEvent: GanttSelectedEvent): void;
31
42
  scrollToToday(): void;
32
43
  scrollToDate(date: number | GanttDate): void;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, never>;
44
+ expandGroups(expanded: boolean): void;
45
+ expandGroup(group: GanttGroupInternal): void;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, [null, null, null, { optional: true; }, null]>;
34
47
  static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttComponent, "ngx-gantt", never, { "maxLevel": "maxLevel"; "async": "async"; "childrenResolve": "childrenResolve"; "linkable": "linkable"; }, { "linkDragStarted": "linkDragStarted"; "linkDragEnded": "linkDragEnded"; "lineClick": "lineClick"; "selectedChange": "selectedChange"; }, ["table", "tableEmptyTemplate", "columns"], never, false, never>;
35
48
  }
@@ -82,4 +82,39 @@
82
82
  }
83
83
  }
84
84
  }
85
+
86
+ .gantt-virtual-scroll-viewport {
87
+ position: absolute;
88
+ left: 0;
89
+ top: variables.$gantt-header-height;
90
+ right: 0;
91
+ bottom: 0;
92
+ z-index: 2;
93
+ // 兼容火狐浏览器
94
+ overflow: auto;
95
+ overflow: overlay;
96
+ .cdk-virtual-scroll-content-wrapper {
97
+ width: 100%;
98
+ min-width: unset;
99
+ display: flex;
100
+ min-height: 100%;
101
+ .gantt-container {
102
+ .gantt-main-container {
103
+ height: 100%;
104
+ top: 0;
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ .gantt-header {
112
+ display: flex;
113
+ overflow: hidden;
114
+ height: 100%;
115
+ .gantt-container-header {
116
+ flex: 1;
117
+ overflow: hidden;
118
+ background-color: #fafafa;
119
+ }
85
120
  }
package/gantt.module.d.ts CHANGED
@@ -2,22 +2,25 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./gantt.component";
3
3
  import * as i2 from "./table/gantt-table.component";
4
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 "./components/baseline/baseline.component";
15
- import * as i14 from "./components/toolbar/toolbar.component";
16
- import * as i15 from "./gantt.pipe";
17
- import * as i16 from "@angular/common";
18
- import * as i17 from "@angular/cdk/drag-drop";
5
+ import * as i4 from "./components/table/header/gantt-table-header.component";
6
+ import * as i5 from "./components/table/body/gantt-table-body.component";
7
+ import * as i6 from "./components/main/gantt-main.component";
8
+ import * as i7 from "./components/calendar/header/calendar-header.component";
9
+ import * as i8 from "./components/calendar/grid/calendar-grid.component";
10
+ import * as i9 from "./components/links/links.component";
11
+ import * as i10 from "./components/bar/bar.component";
12
+ import * as i11 from "./components/icon/icon.component";
13
+ import * as i12 from "./components/drag-backdrop/drag-backdrop.component";
14
+ import * as i13 from "./components/range/range.component";
15
+ import * as i14 from "./root.component";
16
+ import * as i15 from "./components/baseline/baseline.component";
17
+ import * as i16 from "./components/toolbar/toolbar.component";
18
+ import * as i17 from "./gantt.pipe";
19
+ import * as i18 from "@angular/common";
20
+ import * as i19 from "@angular/cdk/drag-drop";
21
+ import * as i20 from "@angular/cdk/scrolling";
19
22
  export declare class NgxGanttModule {
20
23
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttModule, never>;
21
- 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.NgxGanttBaselineComponent, typeof i14.NgxGanttToolbarComponent, typeof i15.IsGanttRangeItemPipe, typeof i15.IsGanttBarItemPipe, typeof i15.IsGanttCustomItemPipe], [typeof i16.CommonModule, typeof i17.DragDropModule], [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i12.NgxGanttRootComponent, typeof i8.NgxGanttBarComponent, typeof i11.NgxGanttRangeComponent, typeof i13.NgxGanttBaselineComponent, typeof i14.NgxGanttToolbarComponent]>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxGanttModule, [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i4.GanttTableHeaderComponent, typeof i5.GanttTableBodyComponent, typeof i6.GanttMainComponent, typeof i7.GanttCalendarHeaderComponent, typeof i8.GanttCalendarGridComponent, typeof i9.GanttLinksComponent, typeof i10.NgxGanttBarComponent, typeof i11.GanttIconComponent, typeof i12.GanttDragBackdropComponent, typeof i13.NgxGanttRangeComponent, typeof i14.NgxGanttRootComponent, typeof i15.NgxGanttBaselineComponent, typeof i16.NgxGanttToolbarComponent, typeof i17.IsGanttRangeItemPipe, typeof i17.IsGanttBarItemPipe, typeof i17.IsGanttCustomItemPipe], [typeof i18.CommonModule, typeof i19.DragDropModule, typeof i20.ScrollingModule], [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i14.NgxGanttRootComponent, typeof i10.NgxGanttBarComponent, typeof i13.NgxGanttRangeComponent, typeof i15.NgxGanttBaselineComponent, typeof i16.NgxGanttToolbarComponent]>;
22
25
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxGanttModule>;
23
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
3
- "version": "15.0.0-next.0",
3
+ "version": "15.1.0-next.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "exports": {
6
6
  ".": {
@@ -28,5 +28,5 @@ export declare class NgxGanttRootComponent implements OnInit, OnDestroy {
28
28
  scrollToToday(): void;
29
29
  scrollToDate(date: number | GanttDate): void;
30
30
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttRootComponent, [null, null, null, null, null, { optional: true; }]>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttRootComponent, "ngx-gantt-root", never, { "sideWidth": "sideWidth"; }, {}, ["sideTemplate", "mainTemplate"], never, false, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttRootComponent, "ngx-gantt-root", never, { "sideWidth": "sideWidth"; }, {}, ["sideTemplate", "mainTemplate"], ["*"], false, never>;
32
32
  }
package/styles/index.scss CHANGED
@@ -1,7 +1,9 @@
1
1
  @use './variables.scss';
2
2
  @use '../gantt.component.scss';
3
- @use '../components/table/gantt-table.component.scss';
4
- @use '../components/calendar/calendar.component.scss';
3
+ // @use '../components/table/gantt-table.component.scss';
4
+ // @use '../components/calendar/calendar.component.scss';
5
+ @use '../components/table/gantt-table.scss';
6
+ @use '../components/calendar/calendar.scss';
5
7
  @use '../components/drag-backdrop/drag-backdrop.component.scss';
6
8
  @use '../components/bar/bar.component.scss';
7
9
  @use '../components/range/range.component.scss';
@@ -1,5 +1,6 @@
1
1
  // basic
2
2
  $gantt-color: #333 !default;
3
+ $gantt-primary-color: #348fe4 !default;
3
4
  $gantt-header-height: 44px !default;
4
5
  $gantt-border-color: #eee !default;
5
6
  $gantt-bg-color: #fff !default;
@@ -32,21 +33,22 @@ $gantt-bar-bg: #fff !default;
32
33
  $gantt-bar-layer-bg: #fff !default;
33
34
  $gantt-bar-handle-color: #cacaca !default;
34
35
  $gantt-bar-handle-height: 12px !default;
35
- $gantt-bar-background-color: #348fe4 !default;
36
+ $gantt-bar-background-color: $gantt-primary-color !default;
36
37
 
37
38
  // drag
38
- $gantt-item-drag-mask-color: #348fe4 !default;
39
- $gantt-link-dragging-line-color: #348fe4 !default;
39
+ $gantt-item-drag-mask-color: $gantt-primary-color !default;
40
+ $gantt-link-dragging-line-color: $gantt-primary-color !default;
40
41
 
41
42
  // link
42
- $gantt-link-line-color: #348fe4 !default;
43
+ $gantt-link-line-color: $gantt-primary-color !default;
43
44
 
44
45
  // table
45
46
  $gantt-table-header-drag-line-width: 3px !default;
46
- $gantt-table-header-drag-line-color: #348fe4 !default;
47
+ $gantt-table-header-drag-line-color: $gantt-primary-color !default;
48
+ $gantt-table-items-drop-background-color: #f5f5f5 !default;
47
49
 
48
50
  // baseline
49
51
  $gantt-baseline-background-color: #cacaca !default;
50
52
 
51
- // toobar
52
- $gantt-toolbar-view-active-color: #348fe4 !default;
53
+ // toolbar
54
+ $gantt-toolbar-view-active-color: $gantt-primary-color !default;
@@ -6,9 +6,10 @@ export declare class NgxGanttTableColumnComponent {
6
6
  columnWidth: string;
7
7
  set width(width: number | string);
8
8
  name: string;
9
+ showExpandIcon: boolean;
9
10
  templateRef: TemplateRef<any>;
10
11
  headerTemplateRef: TemplateRef<any>;
11
12
  constructor(ganttUpper: GanttUpper);
12
13
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableColumnComponent, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableColumnComponent, "ngx-gantt-column", never, { "width": "width"; "name": "name"; }, {}, ["templateRef", "headerTemplateRef"], never, false, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableColumnComponent, "ngx-gantt-column", never, { "width": "width"; "name": "name"; "showExpandIcon": "showExpandIcon"; }, {}, ["templateRef", "headerTemplateRef"], never, false, never>;
14
15
  }
@@ -1,10 +1,13 @@
1
1
  import { EventEmitter, TemplateRef } from '@angular/core';
2
- import { GanttTableEvent } from '../class';
2
+ import { GanttTableDragEnterPredicateContext, GanttTableDragDroppedEvent, GanttTableEvent } from '../class';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class NgxGanttTableComponent {
5
+ draggable: boolean;
6
+ dropEnterPredicate?: (context: GanttTableDragEnterPredicateContext) => boolean;
7
+ dragDropped: EventEmitter<GanttTableDragDroppedEvent<unknown>>;
5
8
  columnChanges: EventEmitter<GanttTableEvent>;
6
9
  rowBeforeTemplate: TemplateRef<any>;
7
10
  rowAfterTemplate: TemplateRef<any>;
8
11
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, {}, { "columnChanges": "columnChanges"; }, ["rowBeforeTemplate", "rowAfterTemplate"], never, false, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, { "draggable": "draggable"; "dropEnterPredicate": "dropEnterPredicate"; }, { "dragDropped": "dragDropped"; "columnChanges": "columnChanges"; }, ["rowBeforeTemplate", "rowAfterTemplate"], never, false, never>;
10
13
  }
@@ -1,26 +0,0 @@
1
- import { OnInit, OnDestroy, NgZone, ElementRef } from '@angular/core';
2
- import { GanttDatePoint } from '../../class/date-point';
3
- import { GanttUpper } from '../../gantt-upper';
4
- import { GanttViewType } from './../../class/view-type';
5
- import * as i0 from "@angular/core";
6
- export declare class GanttCalendarComponent implements OnInit, OnDestroy {
7
- ganttUpper: GanttUpper;
8
- private ngZone;
9
- private elementRef;
10
- get view(): import("@worktile/gantt").GanttView;
11
- headerHeight: number;
12
- mainHeight: number;
13
- todayHeight: number;
14
- todayWidth: number;
15
- todayBorderRadius: number;
16
- viewTypes: typeof GanttViewType;
17
- className: boolean;
18
- private unsubscribe$;
19
- constructor(ganttUpper: GanttUpper, ngZone: NgZone, elementRef: ElementRef<HTMLElement>);
20
- setTodayPoint(): void;
21
- ngOnInit(): void;
22
- trackBy(index: number, point: GanttDatePoint): string | number;
23
- ngOnDestroy(): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<GanttCalendarComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<GanttCalendarComponent, "gantt-calendar-overlay", never, {}, {}, never, never, false, never>;
26
- }
@@ -1,41 +0,0 @@
1
- import { TemplateRef, QueryList, ElementRef, OnChanges, SimpleChanges, EventEmitter } from '@angular/core';
2
- import { GanttItemInternal, GanttGroupInternal, GanttSelectedEvent } from '../../class';
3
- import { NgxGanttTableColumnComponent } from '../../table/gantt-column.component';
4
- import { CdkDragEnd, CdkDragMove, CdkDragStart } from '@angular/cdk/drag-drop';
5
- import { GanttAbstractComponent } from '../../gantt-abstract';
6
- import { GanttUpper } from '../../gantt-upper';
7
- import * as i0 from "@angular/core";
8
- export declare const defaultColumnWidth = 100;
9
- export declare const minColumnWidth = 80;
10
- export declare class GanttTableComponent implements OnChanges {
11
- gantt: GanttAbstractComponent;
12
- ganttUpper: GanttUpper;
13
- private elementRef;
14
- columnList: QueryList<NgxGanttTableColumnComponent>;
15
- dragStartLeft: number;
16
- groups: GanttGroupInternal[];
17
- items: GanttItemInternal[];
18
- set columns(columns: QueryList<NgxGanttTableColumnComponent>);
19
- groupTemplate: TemplateRef<any>;
20
- emptyTemplate: TemplateRef<any>;
21
- rowBeforeTemplate: TemplateRef<any>;
22
- rowAfterTemplate: TemplateRef<any>;
23
- itemClick: EventEmitter<GanttSelectedEvent<unknown>>;
24
- draglineElementRef: ElementRef<HTMLElement>;
25
- ganttTableClass: boolean;
26
- ganttTableEmptyClass: boolean;
27
- constructor(gantt: GanttAbstractComponent, ganttUpper: GanttUpper, elementRef: ElementRef);
28
- ngOnChanges(changes: SimpleChanges): void;
29
- private dragFixed;
30
- expandGroup(group: GanttGroupInternal): void;
31
- expandChildren(event: MouseEvent, item: GanttItemInternal): void;
32
- dragStarted(event: CdkDragStart): void;
33
- dragMoved(event: CdkDragMove, column?: NgxGanttTableColumnComponent): void;
34
- columnDragEnded(event: CdkDragEnd, column: NgxGanttTableColumnComponent): void;
35
- tableDragEnded(event: CdkDragEnd): void;
36
- private showAuxiliaryLine;
37
- private hideAuxiliaryLine;
38
- trackBy(index: number, item: GanttGroupInternal | GanttItemInternal): string | number;
39
- static ɵfac: i0.ɵɵFactoryDeclaration<GanttTableComponent, never>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<GanttTableComponent, "gantt-table", never, { "groups": "groups"; "items": "items"; "columns": "columns"; "groupTemplate": "groupTemplate"; "emptyTemplate": "emptyTemplate"; "rowBeforeTemplate": "rowBeforeTemplate"; "rowAfterTemplate": "rowAfterTemplate"; }, { "itemClick": "itemClick"; }, never, never, false, never>;
41
- }
@@ -1,88 +0,0 @@
1
- import { Component, HostBinding, Inject } from '@angular/core';
2
- import { Subject, merge, from } from 'rxjs';
3
- import { take, takeUntil } from 'rxjs/operators';
4
- import { headerHeight, todayHeight, todayWidth, todayBorderRadius } from '../../gantt.styles';
5
- import { isNumber } from '../../utils/helpers';
6
- import { GanttDate } from '../../utils/date';
7
- import { GANTT_UPPER_TOKEN } from '../../gantt-upper';
8
- import { GanttViewType } from './../../class/view-type';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "@angular/common";
11
- import * as i2 from "../../gantt-upper";
12
- const mainHeight = 5000;
13
- export class GanttCalendarComponent {
14
- get view() {
15
- return this.ganttUpper.view;
16
- }
17
- constructor(ganttUpper, ngZone, elementRef) {
18
- this.ganttUpper = ganttUpper;
19
- this.ngZone = ngZone;
20
- this.elementRef = elementRef;
21
- this.headerHeight = headerHeight;
22
- this.mainHeight = mainHeight;
23
- this.todayHeight = todayHeight;
24
- this.todayWidth = todayWidth;
25
- this.todayBorderRadius = todayBorderRadius;
26
- this.viewTypes = GanttViewType;
27
- this.className = true;
28
- this.unsubscribe$ = new Subject();
29
- }
30
- setTodayPoint() {
31
- const x = this.view.getTodayXPoint();
32
- const today = new GanttDate().getDate();
33
- const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
34
- const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
35
- const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
36
- if (isNumber(x)) {
37
- if (rect) {
38
- rect.style.left = `${x - todayWidth / 2}px`;
39
- rect.style.top = `${headerHeight - todayHeight}px`;
40
- rect.innerHTML = today.toString();
41
- }
42
- if (line) {
43
- line.style.left = `${x}px`;
44
- line.style.top = `${headerHeight}px`;
45
- line.style.bottom = `${-mainHeight}px`;
46
- }
47
- }
48
- else {
49
- todayEle.style.display = 'none';
50
- }
51
- }
52
- ngOnInit() {
53
- // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
54
- // the `onStable` will never emit any value.
55
- const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
56
- // Normally this isn't in the zone, but it can cause performance regressions for apps
57
- // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
58
- this.ngZone.runOutsideAngular(() => {
59
- onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
60
- merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
61
- .pipe(takeUntil(this.unsubscribe$))
62
- .subscribe(() => {
63
- this.setTodayPoint();
64
- });
65
- });
66
- });
67
- }
68
- trackBy(index, point) {
69
- return point.text || index;
70
- }
71
- ngOnDestroy() {
72
- this.unsubscribe$.next();
73
- this.unsubscribe$.complete();
74
- }
75
- }
76
- GanttCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
77
- GanttCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttCalendarComponent, selector: "gantt-calendar-overlay", host: { properties: { "class.gantt-calendar-overlay": "this.className" } }, ngImport: i0, 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\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\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", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarComponent, decorators: [{
79
- type: Component,
80
- 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\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\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" }]
81
- }], ctorParameters: function () { return [{ type: i2.GanttUpper, decorators: [{
82
- type: Inject,
83
- args: [GANTT_UPPER_TOKEN]
84
- }] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
85
- type: HostBinding,
86
- args: ['class.gantt-calendar-overlay']
87
- }] } });
88
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvZ2FudHQvc3JjL2NvbXBvbmVudHMvY2FsZW5kYXIvY2FsZW5kYXIuY29tcG9uZW50LnRzIiwiLi4vLi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xuXG4gICAgICAgIGlmIChpc051bWJlcih4KSkge1xuICAgICAgICAgICAgaWYgKHJlY3QpIHtcbiAgICAgICAgICAgICAgICByZWN0LnN0eWxlLmxlZnQgPSBgJHt4IC0gdG9kYXlXaWR0aCAvIDJ9cHhgO1xuICAgICAgICAgICAgICAgIHJlY3Quc3R5bGUudG9wID0gYCR7aGVhZGVySGVpZ2h0IC0gdG9kYXlIZWlnaHR9cHhgO1xuICAgICAgICAgICAgICAgIHJlY3QuaW5uZXJIVE1MID0gdG9kYXkudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChsaW5lKSB7XG4gICAgICAgICAgICAgICAgbGluZS5zdHlsZS5sZWZ0ID0gYCR7eH1weGA7XG4gICAgICAgICAgICAgICAgbGluZS5zdHlsZS50b3AgPSBgJHtoZWFkZXJIZWlnaHR9cHhgO1xuICAgICAgICAgICAgICAgIGxpbmUuc3R5bGUuYm90dG9tID0gYCR7LW1haW5IZWlnaHR9cHhgO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdG9kYXlFbGUuc3R5bGUuZGlzcGxheSA9ICdub25lJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5nT25Jbml0KCkge1xuICAgICAgICAvLyBOb3RlOiB0aGUgem9uZSBtYXkgYmUgbm9vcGVkIHRocm91Z2ggYEJvb3RzdHJhcE9wdGlvbnNgIHdoZW4gYm9vdHN0cmFwcGluZyB0aGUgcm9vdCBtb2R1bGUuIFRoaXMgbWVhbnNcbiAgICAgICAgLy8gdGhlIGBvblN0YWJsZWAgd2lsbCBuZXZlciBlbWl0IGFueSB2YWx1ZS5cbiAgICAgICAgY29uc3Qgb25TdGFibGUkID0gdGhpcy5uZ1pvbmUuaXNTdGFibGUgPyBmcm9tKFByb21pc2UucmVzb2x2ZSgpKSA6IHRoaXMubmdab25lLm9uU3RhYmxlLnBpcGUodGFrZSgxKSk7XG4gICAgICAgIC8vI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