@worktile/gantt 14.0.1 → 14.0.3

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 (61) hide show
  1. package/class/date-point.d.ts +2 -1
  2. package/class/index.d.ts +1 -0
  3. package/class/item.d.ts +2 -3
  4. package/class/toolbar.d.ts +4 -0
  5. package/class/view-type.d.ts +4 -0
  6. package/components/toolbar/toolbar.component.d.ts +19 -0
  7. package/components/toolbar/toolbar.component.scss +30 -0
  8. package/esm2020/class/date-point.mjs +3 -2
  9. package/esm2020/class/index.mjs +2 -1
  10. package/esm2020/class/item.mjs +14 -22
  11. package/esm2020/class/toolbar.mjs +2 -0
  12. package/esm2020/class/view-type.mjs +23 -1
  13. package/esm2020/components/bar/bar-drag.mjs +6 -5
  14. package/esm2020/components/bar/bar.component.mjs +4 -4
  15. package/esm2020/components/baseline/baseline.component.mjs +4 -4
  16. package/esm2020/components/calendar/calendar.component.mjs +5 -5
  17. package/esm2020/components/drag-backdrop/drag-backdrop.component.mjs +4 -4
  18. package/esm2020/components/icon/icon.component.mjs +4 -4
  19. package/esm2020/components/links/links.component.mjs +4 -4
  20. package/esm2020/components/main/gantt-main.component.mjs +5 -5
  21. package/esm2020/components/range/range.component.mjs +4 -4
  22. package/esm2020/components/table/gantt-table.component.mjs +4 -4
  23. package/esm2020/components/toolbar/toolbar.component.mjs +32 -0
  24. package/esm2020/gantt-dom.service.mjs +4 -4
  25. package/esm2020/gantt-drag-container.mjs +4 -4
  26. package/esm2020/gantt-item-upper.mjs +4 -4
  27. package/esm2020/gantt-print.service.mjs +4 -4
  28. package/esm2020/gantt-upper.mjs +39 -15
  29. package/esm2020/gantt.component.mjs +4 -4
  30. package/esm2020/gantt.module.mjs +12 -7
  31. package/esm2020/gantt.pipe.mjs +10 -10
  32. package/esm2020/public-api.mjs +3 -1
  33. package/esm2020/root.component.mjs +8 -7
  34. package/esm2020/table/gantt-column.component.mjs +4 -4
  35. package/esm2020/table/gantt-table.component.mjs +4 -4
  36. package/esm2020/views/day.mjs +5 -2
  37. package/esm2020/views/factory.mjs +12 -15
  38. package/esm2020/views/month.mjs +5 -2
  39. package/esm2020/views/quarter.mjs +5 -2
  40. package/esm2020/views/view.mjs +1 -1
  41. package/esm2020/views/week.mjs +5 -2
  42. package/esm2020/views/year.mjs +5 -2
  43. package/fesm2015/worktile-gantt.mjs +218 -137
  44. package/fesm2015/worktile-gantt.mjs.map +1 -1
  45. package/fesm2020/worktile-gantt.mjs +214 -137
  46. package/fesm2020/worktile-gantt.mjs.map +1 -1
  47. package/gantt-upper.d.ts +8 -3
  48. package/gantt.component.scss +2 -0
  49. package/gantt.module.d.ts +5 -4
  50. package/package.json +1 -1
  51. package/public-api.d.ts +2 -0
  52. package/root.component.d.ts +1 -1
  53. package/styles/index.scss +1 -0
  54. package/styles/variables.scss +3 -0
  55. package/views/day.d.ts +2 -0
  56. package/views/factory.d.ts +2 -1
  57. package/views/month.d.ts +2 -0
  58. package/views/quarter.d.ts +2 -0
  59. package/views/view.d.ts +4 -0
  60. package/views/week.d.ts +2 -0
  61. package/views/year.d.ts +2 -0
package/gantt-upper.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { TemplateRef, EventEmitter, ElementRef, ChangeDetectorRef, NgZone, SimpleChanges, InjectionToken, OnInit, OnDestroy, OnChanges } from '@angular/core';
2
2
  import { Subject } from 'rxjs';
3
- import { GanttItem, GanttGroup, GanttViewType, GanttLoadOnScrollEvent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttBarClickEvent, GanttLinkDragEvent } from './class';
3
+ import { GanttItem, GanttGroup, GanttViewType, GanttLoadOnScrollEvent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttBarClickEvent, GanttLinkDragEvent, GanttToolbarOptions } from './class';
4
4
  import { GanttView, GanttViewOptions } from './views/view';
5
5
  import { GanttStyles } from './gantt.styles';
6
6
  import { Dictionary } from './utils/helpers';
@@ -25,6 +25,8 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
25
25
  showTodayLine: boolean;
26
26
  draggable: boolean;
27
27
  styles: GanttStyles;
28
+ showToolbar: boolean;
29
+ toolbarOptions: GanttToolbarOptions;
28
30
  viewOptions: GanttViewOptions;
29
31
  set linkOptions(options: GanttLinkOptions);
30
32
  get linkOptions(): GanttLinkOptions;
@@ -38,11 +40,13 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
38
40
  dragMoved: EventEmitter<GanttDragEvent<unknown>>;
39
41
  dragEnded: EventEmitter<GanttDragEvent<unknown>>;
40
42
  barClick: EventEmitter<GanttBarClickEvent<unknown>>;
43
+ viewChange: EventEmitter<GanttView>;
41
44
  barTemplate: TemplateRef<any>;
42
45
  rangeTemplate: TemplateRef<any>;
43
46
  itemTemplate: TemplateRef<any>;
44
47
  groupTemplate: TemplateRef<any>;
45
48
  groupHeaderTemplate: TemplateRef<any>;
49
+ toolbarTemplate: TemplateRef<any>;
46
50
  linkable: boolean;
47
51
  linkDragEnded: EventEmitter<GanttLinkDragEvent<unknown>>;
48
52
  view: GanttView;
@@ -50,7 +54,6 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
50
54
  groups: GanttGroupInternal[];
51
55
  baselineItems: GanttBaselineItemInternal[];
52
56
  baselineItemsMap: Dictionary<GanttBaselineItemInternal>;
53
- viewChange: EventEmitter<GanttView>;
54
57
  expandChange: EventEmitter<void>;
55
58
  get element(): HTMLElement;
56
59
  firstChange: boolean;
@@ -84,7 +87,9 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
84
87
  getGanttItem(id: string): GanttItemInternal;
85
88
  getGanttItems(ids: string[]): GanttItemInternal[];
86
89
  isSelected(id: string): boolean;
90
+ changeView(type: GanttViewType): void;
91
+ rerenderView(): void;
87
92
  static ɵfac: i0.ɵɵFactoryDeclaration<GanttUpper, never>;
88
- static ɵdir: i0.ɵɵDirectiveDeclaration<GanttUpper, never, never, { "originItems": "items"; "originGroups": "groups"; "originBaselineItems": "baselineItems"; "viewType": "viewType"; "start": "start"; "end": "end"; "showTodayLine": "showTodayLine"; "draggable": "draggable"; "styles": "styles"; "viewOptions": "viewOptions"; "linkOptions": "linkOptions"; "disabledLoadOnScroll": "disabledLoadOnScroll"; "selectable": "selectable"; "multiple": "multiple"; }, { "loadOnScroll": "loadOnScroll"; "dragStarted": "dragStarted"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "barClick": "barClick"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate"], never, false>;
93
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GanttUpper, never, never, { "originItems": "items"; "originGroups": "groups"; "originBaselineItems": "baselineItems"; "viewType": "viewType"; "start": "start"; "end": "end"; "showTodayLine": "showTodayLine"; "draggable": "draggable"; "styles": "styles"; "showToolbar": "showToolbar"; "toolbarOptions": "toolbarOptions"; "viewOptions": "viewOptions"; "linkOptions": "linkOptions"; "disabledLoadOnScroll": "disabledLoadOnScroll"; "selectable": "selectable"; "multiple": "multiple"; }, { "loadOnScroll": "loadOnScroll"; "dragStarted": "dragStarted"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "barClick": "barClick"; "viewChange": "viewChange"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate", "toolbarTemplate"], never, false>;
89
94
  }
90
95
  export declare const GANTT_UPPER_TOKEN: InjectionToken<GanttUpper>;
@@ -54,7 +54,9 @@
54
54
  bottom: 0;
55
55
  left: 0;
56
56
  right: 0;
57
+ // 兼容火狐浏览器
57
58
  overflow: auto;
59
+ overflow: overlay;
58
60
  background-color: variables.$gantt-container-background-color;
59
61
 
60
62
  .gantt-main-groups,
package/gantt.module.d.ts CHANGED
@@ -12,11 +12,12 @@ import * as i10 from "./components/drag-backdrop/drag-backdrop.component";
12
12
  import * as i11 from "./components/range/range.component";
13
13
  import * as i12 from "./root.component";
14
14
  import * as i13 from "./components/baseline/baseline.component";
15
- import * as i14 from "./gantt.pipe";
16
- import * as i15 from "@angular/common";
17
- import * as i16 from "@angular/cdk/drag-drop";
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";
18
19
  export declare class NgxGanttModule {
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttModule, never>;
20
- 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.IsGanttRangeItemPipe, typeof i14.IsGanttBarItemPipe, typeof i14.IsGanttCustomItemPipe], [typeof i15.CommonModule, typeof i16.DragDropModule], [typeof i1.NgxGanttComponent, typeof i2.NgxGanttTableComponent, typeof i3.NgxGanttTableColumnComponent, typeof i12.NgxGanttRootComponent, typeof i8.NgxGanttBarComponent, typeof i11.NgxGanttRangeComponent, typeof i13.NgxGanttBaselineComponent]>;
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]>;
21
22
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxGanttModule>;
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
3
- "version": "14.0.1",
3
+ "version": "14.0.3",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "exports": {
6
6
  ".": {
package/public-api.d.ts CHANGED
@@ -7,9 +7,11 @@ export * from './table/gantt-column.component';
7
7
  export * from './components/bar/bar.component';
8
8
  export * from './components/range/range.component';
9
9
  export * from './components/baseline/baseline.component';
10
+ export * from './components/toolbar/toolbar.component';
10
11
  export * from './utils/date';
11
12
  export * from './class';
12
13
  export * from './views/view';
14
+ export { registerView } from './views/factory';
13
15
  export * from './gantt-item-upper';
14
16
  export * from './gantt.pipe';
15
17
  export * from './gantt-print.service';
@@ -10,7 +10,7 @@ export declare class NgxGanttRootComponent implements OnInit, OnDestroy {
10
10
  private ngZone;
11
11
  private dom;
12
12
  dragContainer: GanttDragContainer;
13
- private ganttUpper;
13
+ ganttUpper: GanttUpper;
14
14
  private printService;
15
15
  sideWidth: number;
16
16
  sideTemplate: TemplateRef<any>;
package/styles/index.scss CHANGED
@@ -8,3 +8,4 @@
8
8
  @use '../components/icon/icon.component.scss';
9
9
  @use '../components/links/links.component.scss';
10
10
  @use '../components/baseline/baseline.component.scss';
11
+ @use '../components/toolbar/toolbar.component.scss';
@@ -47,3 +47,6 @@ $gantt-table-header-drag-line-color: #348fe4 !default;
47
47
 
48
48
  // baseline
49
49
  $gantt-baseline-background-color: #cacaca !default;
50
+
51
+ // toobar
52
+ $gantt-toolbar-view-active-color: #348fe4 !default;
package/views/day.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
2
  import { GanttDate } from '../utils/date';
3
3
  import { GanttDatePoint } from '../class/date-point';
4
+ import { GanttViewType } from '../class';
4
5
  export declare class GanttViewDay extends GanttView {
5
6
  showWeekBackdrop: boolean;
6
7
  showTimeline: boolean;
8
+ viewType: GanttViewType;
7
9
  constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
8
10
  startOf(date: GanttDate): GanttDate;
9
11
  endOf(date: GanttDate): GanttDate;
@@ -1,8 +1,9 @@
1
- import { GanttViewOptions, GanttViewDate } from './view';
1
+ import { GanttViewOptions, GanttViewDate, GanttView } from './view';
2
2
  import { GanttViewMonth } from './month';
3
3
  import { GanttViewType } from '../class/view-type';
4
4
  import { GanttViewQuarter } from './quarter';
5
5
  import { GanttViewDay } from './day';
6
6
  import { GanttViewWeek } from './week';
7
7
  import { GanttViewYear } from './year';
8
+ export declare function registerView<T extends typeof GanttView>(type: string, view: T): void;
8
9
  export declare function createViewFactory(type: GanttViewType, start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions): GanttViewMonth | GanttViewQuarter | GanttViewDay | GanttViewWeek | GanttViewYear;
package/views/month.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
2
  import { GanttDate } from '../utils/date';
3
3
  import { GanttDatePoint } from '../class/date-point';
4
+ import { GanttViewType } from '../class';
4
5
  export declare class GanttViewMonth extends GanttView {
6
+ viewType: GanttViewType;
5
7
  constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
8
  startOf(date: GanttDate): GanttDate;
7
9
  endOf(date: GanttDate): GanttDate;
@@ -1,7 +1,9 @@
1
1
  import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
2
  import { GanttDate } from '../utils/date';
3
3
  import { GanttDatePoint } from '../class/date-point';
4
+ import { GanttViewType } from '../class';
4
5
  export declare class GanttViewQuarter extends GanttView {
6
+ viewType: GanttViewType;
5
7
  constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
8
  startOf(date: GanttDate): GanttDate;
7
9
  endOf(date: GanttDate): GanttDate;
package/views/view.d.ts CHANGED
@@ -2,6 +2,7 @@ import { GanttDate, GanttDateUtil } from '../utils/date';
2
2
  import { GanttDatePoint } from '../class/date-point';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { GanttDateFormat } from '../gantt.config';
5
+ import { GanttViewType } from '../class';
5
6
  export declare const primaryDatePointTop = 18;
6
7
  export declare const secondaryDatePointTop = 36;
7
8
  export interface GanttViewDate {
@@ -17,8 +18,11 @@ export interface GanttViewOptions {
17
18
  addAmount?: number;
18
19
  addUnit?: GanttDateUtil;
19
20
  dateFormat?: GanttDateFormat;
21
+ fillDays?: number;
22
+ [key: string]: any;
20
23
  }
21
24
  export declare abstract class GanttView {
25
+ viewType: GanttViewType;
22
26
  start$: BehaviorSubject<GanttDate>;
23
27
  end$: BehaviorSubject<GanttDate>;
24
28
  get start(): GanttDate;
package/views/week.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import { GanttViewType } from '../class';
1
2
  import { GanttDatePoint } from '../class/date-point';
2
3
  import { GanttDate } from '../utils/date';
3
4
  import { GanttView, GanttViewDate, GanttViewOptions } from './view';
4
5
  export declare class GanttViewWeek extends GanttView {
6
+ viewType: GanttViewType;
5
7
  constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
8
  startOf(date: GanttDate): GanttDate;
7
9
  endOf(date: GanttDate): GanttDate;
package/views/year.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
2
  import { GanttDate } from '../utils/date';
3
3
  import { GanttDatePoint } from '../class/date-point';
4
+ import { GanttViewType } from '../class';
4
5
  export declare class GanttViewYear extends GanttView {
6
+ viewType: GanttViewType;
5
7
  constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
8
  startOf(date: GanttDate): GanttDate;
7
9
  endOf(date: GanttDate): GanttDate;