@worktile/gantt 12.1.0-next.0 → 12.2.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 (54) hide show
  1. package/bundles/worktile-gantt.umd.js +819 -936
  2. package/bundles/worktile-gantt.umd.js.map +1 -1
  3. package/class/item.d.ts +7 -7
  4. package/class/link.d.ts +39 -0
  5. package/components/calendar/{grid/calendar-grid.component.d.ts → calendar.component.d.ts} +10 -8
  6. package/components/links/links.component.d.ts +5 -15
  7. package/components/main/gantt-main.component.d.ts +4 -4
  8. package/components/table/gantt-table.component.d.ts +39 -0
  9. package/esm2015/class/item.js +14 -3
  10. package/esm2015/class/link.js +14 -0
  11. package/esm2015/components/bar/bar-drag.js +6 -1
  12. package/esm2015/components/calendar/calendar.component.js +86 -0
  13. package/esm2015/components/links/links.component.js +93 -33
  14. package/esm2015/components/main/gantt-main.component.js +5 -5
  15. package/esm2015/components/table/gantt-table.component.js +153 -0
  16. package/esm2015/gantt-dom.service.js +2 -5
  17. package/esm2015/gantt-drag-container.js +2 -1
  18. package/esm2015/gantt-item-upper.js +4 -5
  19. package/esm2015/gantt-print.service.js +2 -2
  20. package/esm2015/gantt-upper.js +67 -35
  21. package/esm2015/gantt.component.js +17 -172
  22. package/esm2015/gantt.config.js +13 -0
  23. package/esm2015/gantt.module.js +22 -18
  24. package/esm2015/public-api.js +2 -1
  25. package/esm2015/root.component.js +7 -8
  26. package/esm2015/table/gantt-table.component.js +9 -3
  27. package/esm2015/utils/helpers.js +10 -9
  28. package/esm2015/views/day.js +2 -2
  29. package/esm2015/views/month.js +3 -3
  30. package/esm2015/views/quarter.js +3 -3
  31. package/esm2015/views/view.js +4 -2
  32. package/esm2015/views/week.js +3 -3
  33. package/esm2015/views/year.js +2 -2
  34. package/fesm2015/worktile-gantt.js +806 -898
  35. package/fesm2015/worktile-gantt.js.map +1 -1
  36. package/gantt-dom.service.d.ts +0 -1
  37. package/gantt-drag-container.d.ts +1 -0
  38. package/gantt-upper.d.ts +12 -5
  39. package/gantt.component.d.ts +5 -26
  40. package/gantt.config.d.ts +23 -0
  41. package/gantt.module.d.ts +13 -16
  42. package/main.bundle.scss +195 -234
  43. package/package.json +1 -1
  44. package/public-api.d.ts +1 -0
  45. package/table/gantt-table.component.d.ts +4 -2
  46. package/utils/helpers.d.ts +3 -5
  47. package/views/view.d.ts +2 -0
  48. package/components/calendar/header/calendar-header.component.d.ts +0 -21
  49. package/components/table/body/gantt-table-body.component.d.ts +0 -24
  50. package/components/table/header/gantt-table-header.component.d.ts +0 -29
  51. package/esm2015/components/calendar/grid/calendar-grid.component.js +0 -76
  52. package/esm2015/components/calendar/header/calendar-header.component.js +0 -70
  53. package/esm2015/components/table/body/gantt-table-body.component.js +0 -68
  54. package/esm2015/components/table/header/gantt-table-header.component.js +0 -126
@@ -15,7 +15,6 @@ export declare class GanttDomService implements OnDestroy {
15
15
  container: Element;
16
16
  sideContainer: Element;
17
17
  mainContainer: Element;
18
- calendarHeader: Element;
19
18
  calendarOverlay: Element;
20
19
  linksOverlay: Element;
21
20
  private unsubscribe$;
@@ -5,6 +5,7 @@ import * as i0 from "@angular/core";
5
5
  export declare type LinkDragFrom = 'source' | 'target';
6
6
  export declare class GanttDragContainer {
7
7
  dragStarted: EventEmitter<GanttDragEvent<unknown>>;
8
+ dragMoved: EventEmitter<GanttDragEvent<unknown>>;
8
9
  dragEnded: EventEmitter<GanttDragEvent<unknown>>;
9
10
  linkDragStarted: EventEmitter<GanttLinkDragEvent<unknown>>;
10
11
  linkDragEntered: EventEmitter<GanttLinkDragEvent<unknown>>;
package/gantt-upper.d.ts CHANGED
@@ -4,11 +4,13 @@ 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 { GanttGlobalConfig } from './gantt.config';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare abstract class GanttUpper {
9
10
  protected elementRef: ElementRef<HTMLElement>;
10
11
  protected cdr: ChangeDetectorRef;
11
12
  protected ngZone: NgZone;
13
+ protected config: GanttGlobalConfig;
12
14
  originItems: GanttItem[];
13
15
  originGroups: GanttGroup[];
14
16
  viewType: GanttViewType;
@@ -21,6 +23,7 @@ export declare abstract class GanttUpper {
21
23
  disabledLoadOnScroll: boolean;
22
24
  loadOnScroll: EventEmitter<GanttLoadOnScrollEvent>;
23
25
  dragStarted: EventEmitter<GanttDragEvent<unknown>>;
26
+ dragMoved: EventEmitter<GanttDragEvent<unknown>>;
24
27
  dragEnded: EventEmitter<GanttDragEvent<unknown>>;
25
28
  barClick: EventEmitter<GanttBarClickEvent<unknown>>;
26
29
  barTemplate: TemplateRef<any>;
@@ -29,7 +32,6 @@ export declare abstract class GanttUpper {
29
32
  groupTemplate: TemplateRef<any>;
30
33
  groupHeaderTemplate: TemplateRef<any>;
31
34
  linkable: boolean;
32
- computeAllRefs: boolean;
33
35
  linkDragEnded: EventEmitter<GanttLinkDragEvent<unknown>>;
34
36
  view: GanttView;
35
37
  items: GanttItemInternal[];
@@ -41,22 +43,27 @@ export declare abstract class GanttUpper {
41
43
  dragContainer: GanttDragContainer;
42
44
  unsubscribe$: Subject<unknown>;
43
45
  private groupsMap;
44
- private expandedItemIds;
45
46
  ganttClass: boolean;
46
- constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone);
47
+ constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, config: GanttGlobalConfig);
47
48
  private createView;
48
49
  private setupGroups;
49
50
  private setupItems;
50
51
  private setupExpandedState;
51
52
  private getViewDate;
52
53
  computeRefs(): void;
54
+ private expandGroups;
53
55
  onInit(): void;
54
56
  onChanges(changes: SimpleChanges): void;
55
57
  onDestroy(): void;
56
58
  computeItemsRefs(...items: GanttItemInternal[]): void;
57
- trackBy(item: GanttGroupInternal | GanttItemInternal, index: number): string | number;
59
+ trackBy(index: number, item: GanttGroupInternal | GanttItemInternal): string | number;
58
60
  detectChanges(): void;
61
+ expandGroup(group: GanttGroupInternal): void;
62
+ expandAll(): void;
63
+ collapseAll(): void;
64
+ getGanttItem(id: string): GanttItemInternal;
65
+ getGanttItems(ids: string[]): GanttItemInternal[];
59
66
  static ɵfac: i0.ɵɵFactoryDeclaration<GanttUpper, never>;
60
- 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"]>;
67
+ 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"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "barClick": "barClick"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate"]>;
61
68
  }
62
69
  export declare const GANTT_UPPER_TOKEN: InjectionToken<GanttUpper>;
@@ -1,18 +1,12 @@
1
1
  import { OnInit, ElementRef, EventEmitter, ChangeDetectorRef, NgZone, OnChanges, OnDestroy, SimpleChanges, QueryList, AfterViewInit, TemplateRef } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { GanttUpper } from './gantt-upper';
4
- import { GanttLinkDragEvent, GanttLineClickEvent, GanttItemInternal, GanttItem, GanttGroupInternal } from './class';
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
- import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
8
- import { GanttDomService } from './gantt-dom.service';
9
- import { GanttDragContainer } from './gantt-drag-container';
10
- import { GanttPrintService } from './gantt-print.service';
7
+ import { GanttGlobalConfig } from './gantt.config';
11
8
  import * as i0 from "@angular/core";
12
9
  export declare class NgxGanttComponent extends GanttUpper implements OnInit, AfterViewInit, OnChanges, OnDestroy {
13
- private dom;
14
- dragContainer: GanttDragContainer;
15
- private printService;
16
10
  maxLevel: number;
17
11
  async: boolean;
18
12
  childrenResolve: (GanttItem: any) => Observable<GanttItem[]>;
@@ -23,29 +17,14 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, Aft
23
17
  table: NgxGanttTableComponent;
24
18
  columns: QueryList<NgxGanttTableColumnComponent>;
25
19
  tableEmptyTemplate: TemplateRef<any>;
26
- virtualScroll: CdkVirtualScrollViewport;
27
- flatData: (GanttGroupInternal | GanttItemInternal)[];
28
- tempData: (GanttGroupInternal | GanttItemInternal)[];
29
- private rangeStart;
30
- private rangeEnd;
31
- private flatDataMap;
32
20
  private ngUnsubscribe$;
33
- constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, dom: GanttDomService, dragContainer: GanttDragContainer, printService: GanttPrintService);
21
+ sideTableWidth: number;
22
+ constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, config: GanttGlobalConfig);
34
23
  ngOnInit(): void;
35
24
  ngAfterViewInit(): void;
36
25
  ngOnChanges(changes: SimpleChanges): void;
37
- expandGroup(group: GanttGroupInternal): void;
38
- expandAll(): void;
39
- collapseAll(): void;
40
26
  expandChildren(item: GanttItemInternal): void;
41
- buildVirtualFlatData(): void;
42
- afterExpand(): void;
43
- trackBy(item: GanttGroupInternal | GanttItemInternal, index: number): string | number;
44
- private scrollToToday;
45
- private setupViewScroll;
46
- private expandGroups;
47
- private computeTempDataRefs;
48
27
  ngOnDestroy(): void;
49
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, [null, null, null, null, null, { optional: true; }]>;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, never>;
50
29
  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>;
51
30
  }
@@ -0,0 +1,23 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export interface GanttDateFormat {
3
+ week?: string;
4
+ month?: string;
5
+ quarter?: string;
6
+ year?: string;
7
+ yearMonth?: string;
8
+ yearQuarter?: string;
9
+ }
10
+ export interface GanttGlobalConfig {
11
+ dateFormat?: GanttDateFormat;
12
+ }
13
+ export declare const defaultConfig: {
14
+ dateFormat: {
15
+ week: string;
16
+ month: string;
17
+ quarter: string;
18
+ year: string;
19
+ yearMonth: string;
20
+ yearQuarter: string;
21
+ };
22
+ };
23
+ export declare const GANTT_GLOBAL_CONFIG: InjectionToken<GanttGlobalConfig>;
package/gantt.module.d.ts CHANGED
@@ -2,23 +2,20 @@ 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/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 "./gantt.pipe";
17
- import * as i16 from "@angular/common";
18
- import * as i17 from "@angular/cdk/drag-drop";
19
- import * as i18 from "@angular/cdk/scrolling";
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";
20
17
  export declare class NgxGanttModule {
21
18
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttModule, never>;
22
- 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.IsGanttRangeItemPipe, typeof i15.IsGanttBarItemPipe, typeof i15.IsGanttCustomItemPipe], [typeof i16.CommonModule, typeof i17.DragDropModule, typeof i18.ScrollingModule], [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i14.NgxGanttRootComponent, typeof i10.NgxGanttBarComponent, typeof i13.NgxGanttRangeComponent]>;
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]>;
23
20
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxGanttModule>;
24
21
  }