@worktile/gantt 12.1.3 → 12.2.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.
@@ -1,9 +1,23 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { GanttDragEvent, GanttLinkDragEvent } from './class/event';
3
3
  import { GanttItemInternal } from './class/item';
4
+ import { GanttUpper } from './gantt-upper';
4
5
  import * as i0 from "@angular/core";
5
- export declare type LinkDragFrom = 'source' | 'target';
6
+ export declare enum InBarPosition {
7
+ start = "start",
8
+ finish = "finish"
9
+ }
10
+ export declare type LinkDragPosition = {
11
+ element: HTMLElement;
12
+ item: GanttItemInternal;
13
+ pos?: InBarPosition;
14
+ };
15
+ export interface LinkDragPath {
16
+ from?: LinkDragPosition;
17
+ to?: LinkDragPosition;
18
+ }
6
19
  export declare class GanttDragContainer {
20
+ ganttUpper: GanttUpper;
7
21
  dragStarted: EventEmitter<GanttDragEvent<unknown>>;
8
22
  dragMoved: EventEmitter<GanttDragEvent<unknown>>;
9
23
  dragEnded: EventEmitter<GanttDragEvent<unknown>>;
@@ -11,14 +25,12 @@ export declare class GanttDragContainer {
11
25
  linkDragEntered: EventEmitter<GanttLinkDragEvent<unknown>>;
12
26
  linkDragEnded: EventEmitter<GanttLinkDragEvent<unknown>>;
13
27
  linkDraggingId: string;
14
- private linkDragSource;
15
- private linkDragTarget;
16
- private linkDragFrom;
17
- constructor();
18
- emitLinkDragStarted(from: LinkDragFrom, item: GanttItemInternal): void;
19
- emitLinkDragEntered(item: GanttItemInternal): void;
28
+ linkDragPath: LinkDragPath;
29
+ constructor(ganttUpper: GanttUpper);
30
+ emitLinkDragStarted(from: LinkDragPosition): void;
31
+ emitLinkDragEntered(to: LinkDragPosition): void;
20
32
  emitLinkDragLeaved(): void;
21
- emitLinkDragEnded(): void;
33
+ emitLinkDragEnded(to: LinkDragPosition): void;
22
34
  static ɵfac: i0.ɵɵFactoryDeclaration<GanttDragContainer, never>;
23
35
  static ɵprov: i0.ɵɵInjectableDeclaration<GanttDragContainer>;
24
36
  }
package/gantt-upper.d.ts CHANGED
@@ -5,6 +5,7 @@ import { GanttView, GanttViewOptions } from './views/view';
5
5
  import { GanttStyles } from './gantt.styles';
6
6
  import { GanttDragContainer } from './gantt-drag-container';
7
7
  import { GanttGlobalConfig } from './gantt.config';
8
+ import { GanttLinkOptions } from './class/link';
8
9
  import { SelectionModel } from '@angular/cdk/collections';
9
10
  import { BooleanInput } from '@angular/cdk/coercion';
10
11
  import * as i0 from "@angular/core";
@@ -12,7 +13,7 @@ export declare abstract class GanttUpper {
12
13
  protected elementRef: ElementRef<HTMLElement>;
13
14
  protected cdr: ChangeDetectorRef;
14
15
  protected ngZone: NgZone;
15
- protected config: GanttGlobalConfig;
16
+ config: GanttGlobalConfig;
16
17
  originItems: GanttItem[];
17
18
  originGroups: GanttGroup[];
18
19
  viewType: GanttViewType;
@@ -22,6 +23,8 @@ export declare abstract class GanttUpper {
22
23
  draggable: boolean;
23
24
  styles: GanttStyles;
24
25
  viewOptions: GanttViewOptions;
26
+ set linkOptions(options: GanttLinkOptions);
27
+ get linkOptions(): GanttLinkOptions;
25
28
  disabledLoadOnScroll: boolean;
26
29
  set selectable(value: BooleanInput);
27
30
  get selectable(): boolean;
@@ -52,6 +55,7 @@ export declare abstract class GanttUpper {
52
55
  private groupsMap;
53
56
  private _selectable;
54
57
  private _multiple;
58
+ private _linkOptions;
55
59
  ganttClass: boolean;
56
60
  constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, config: GanttGlobalConfig);
57
61
  private createView;
@@ -75,6 +79,6 @@ export declare abstract class GanttUpper {
75
79
  getGanttItems(ids: string[]): GanttItemInternal[];
76
80
  isSelected(id: string): boolean;
77
81
  static ɵfac: i0.ɵɵFactoryDeclaration<GanttUpper, never>;
78
- 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"; "selectable": "selectable"; "multiple": "multiple"; }, { "loadOnScroll": "loadOnScroll"; "dragStarted": "dragStarted"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "barClick": "barClick"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate"]>;
82
+ 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"; "linkOptions": "linkOptions"; "disabledLoadOnScroll": "disabledLoadOnScroll"; "selectable": "selectable"; "multiple": "multiple"; }, { "loadOnScroll": "loadOnScroll"; "dragStarted": "dragStarted"; "dragMoved": "dragMoved"; "dragEnded": "dragEnded"; "barClick": "barClick"; }, ["barTemplate", "rangeTemplate", "itemTemplate", "groupTemplate", "groupHeaderTemplate"]>;
79
83
  }
80
84
  export declare const GANTT_UPPER_TOKEN: InjectionToken<GanttUpper>;
package/gantt.config.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { GanttLinkType, GanttLinkOptions, GanttLinkLineType } from './class/link';
1
2
  import { InjectionToken } from '@angular/core';
2
3
  export interface GanttDateFormat {
3
4
  week?: string;
@@ -9,6 +10,7 @@ export interface GanttDateFormat {
9
10
  }
10
11
  export interface GanttGlobalConfig {
11
12
  dateFormat?: GanttDateFormat;
13
+ linkOptions?: GanttLinkOptions;
12
14
  }
13
15
  export declare const defaultConfig: {
14
16
  dateFormat: {
@@ -19,5 +21,10 @@ export declare const defaultConfig: {
19
21
  yearMonth: string;
20
22
  yearQuarter: string;
21
23
  };
24
+ linkOptions: {
25
+ dependencyTypes: GanttLinkType[];
26
+ showArrow: boolean;
27
+ lineType: GanttLinkLineType;
28
+ };
22
29
  };
23
30
  export declare const GANTT_GLOBAL_CONFIG: InjectionToken<GanttGlobalConfig>;
package/main.bundle.scss CHANGED
@@ -410,6 +410,7 @@ $gantt-table-header-drag-line-color: #348fe4 !default;
410
410
  $gantt-bar-layer-append-width: 32px;
411
411
  $gantt-bar-layer-append-height: 42px;
412
412
  $gantt-bar-link-height: 16px;
413
+ $gantt-bar-link-handle-size: 16px;
413
414
  $gantt-bar-link-drop-border: 5px;
414
415
 
415
416
  @mixin link-handles {
@@ -553,6 +554,7 @@ $gantt-bar-link-drop-border: 5px;
553
554
  background: $gantt-bar-background-color;
554
555
  overflow: hidden;
555
556
  box-sizing: border-box;
557
+
556
558
  .gantt-bar-content-progress {
557
559
  position: absolute;
558
560
  left: 0;
@@ -566,7 +568,7 @@ $gantt-bar-link-drop-border: 5px;
566
568
  @include active-bar();
567
569
  }
568
570
 
569
- &-link-drop {
571
+ &-single-drop-active {
570
572
  .gantt-bar-border {
571
573
  display: block;
572
574
  }
@@ -575,6 +577,34 @@ $gantt-bar-link-drop-border: 5px;
575
577
  box-shadow: none;
576
578
  }
577
579
  }
580
+
581
+ &-drop-active {
582
+ @include active-bar();
583
+
584
+ .gantt-bar-layer {
585
+ .link-handles {
586
+ .handle {
587
+ width: $gantt-bar-link-handle-size + 10px;
588
+ height: 100%;
589
+
590
+ &:first-child {
591
+ left: -$gantt-bar-link-handle-size - 5px;
592
+ }
593
+
594
+ &:last-child {
595
+ right: -$gantt-bar-link-handle-size - 5px;
596
+ }
597
+
598
+ &:hover {
599
+ .point {
600
+ width: 12px;
601
+ height: 12px;
602
+ }
603
+ }
604
+ }
605
+ }
606
+ }
607
+ }
578
608
  }
579
609
 
580
610
  .gantt-range {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
3
- "version": "12.1.3",
3
+ "version": "12.2.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.0.0",