@worktile/gantt 15.1.0-next.8 → 15.1.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 (32) hide show
  1. package/class/event.d.ts +8 -0
  2. package/class/link.d.ts +1 -1
  3. package/components/bar/bar-drag.d.ts +11 -1
  4. package/components/bar/bar.component.scss +2 -2
  5. package/components/links/links.component.d.ts +2 -2
  6. package/components/main/gantt-main.component.d.ts +3 -3
  7. package/components/table/body/gantt-table-body.component.d.ts +8 -6
  8. package/esm2020/class/event.mjs +5 -1
  9. package/esm2020/class/link.mjs +2 -2
  10. package/esm2020/components/bar/bar-drag.mjs +110 -40
  11. package/esm2020/components/bar/bar.component.mjs +5 -2
  12. package/esm2020/components/links/links.component.mjs +5 -5
  13. package/esm2020/components/main/gantt-main.component.mjs +5 -5
  14. package/esm2020/components/table/body/gantt-table-body.component.mjs +32 -18
  15. package/esm2020/gantt.component.mjs +46 -28
  16. package/esm2020/gantt.module.mjs +1 -7
  17. package/esm2020/gantt.styles.mjs +2 -2
  18. package/esm2020/table/gantt-table.component.mjs +8 -2
  19. package/esm2020/utils/drag-scroll.mjs +20 -1
  20. package/fesm2015/worktile-gantt.mjs +232 -101
  21. package/fesm2015/worktile-gantt.mjs.map +1 -1
  22. package/fesm2020/worktile-gantt.mjs +229 -100
  23. package/fesm2020/worktile-gantt.mjs.map +1 -1
  24. package/gantt.component.d.ts +7 -6
  25. package/gantt.component.scss +13 -0
  26. package/gantt.styles.d.ts +1 -1
  27. package/package.json +1 -1
  28. package/styles/variables.scss +3 -2
  29. package/table/gantt-table.component.d.ts +4 -2
  30. package/utils/drag-scroll.d.ts +7 -0
  31. package/components/calendar/calendar.component.scss +0 -79
  32. package/components/table/gantt-table.component.scss +0 -237
@@ -17,7 +17,7 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, OnC
17
17
  childrenResolve: (GanttItem: any) => Observable<GanttItem[]>;
18
18
  linkable: boolean;
19
19
  set loading(loading: boolean);
20
- get loading(): boolean;
20
+ virtualScrollEnabled: boolean;
21
21
  loadingDelay: number;
22
22
  linkDragStarted: EventEmitter<GanttLinkDragEvent<unknown>>;
23
23
  linkDragEnded: EventEmitter<GanttLinkDragEvent<unknown>>;
@@ -28,18 +28,19 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, OnC
28
28
  tableEmptyTemplate: TemplateRef<any>;
29
29
  ganttRoot: NgxGanttRootComponent;
30
30
  virtualScroll: CdkVirtualScrollViewport;
31
- flatData: (GanttGroupInternal | GanttItemInternal)[];
32
- renderData: (GanttGroupInternal | GanttItemInternal)[];
31
+ get loading(): boolean;
32
+ flatItems: (GanttGroupInternal | GanttItemInternal)[];
33
+ viewportItems: (GanttGroupInternal | GanttItemInternal)[];
33
34
  private _loading;
34
35
  private loadingTimer;
35
36
  private rangeStart;
36
37
  private rangeEnd;
37
- private flatDataMap;
38
+ private flatItemsMap;
38
39
  constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, ngZone: NgZone, printService: GanttPrintService, config: GanttGlobalConfig);
39
40
  ngOnInit(): void;
40
41
  ngOnChanges(changes: SimpleChanges): void;
41
42
  ngAfterViewInit(): void;
42
- private buildVirtualFlatData;
43
+ private buildFlatItems;
43
44
  private afterExpand;
44
45
  private computeTempDataRefs;
45
46
  expandChildren(item: GanttItemInternal): void;
@@ -49,5 +50,5 @@ export declare class NgxGanttComponent extends GanttUpper implements OnInit, OnC
49
50
  expandGroups(expanded: boolean): void;
50
51
  expandGroup(group: GanttGroupInternal): void;
51
52
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttComponent, [null, null, null, { optional: true; }, null]>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttComponent, "ngx-gantt", never, { "maxLevel": "maxLevel"; "async": "async"; "childrenResolve": "childrenResolve"; "linkable": "linkable"; "loading": "loading"; "loadingDelay": "loadingDelay"; }, { "linkDragStarted": "linkDragStarted"; "linkDragEnded": "linkDragEnded"; "lineClick": "lineClick"; "selectedChange": "selectedChange"; }, ["table", "tableEmptyTemplate", "columns"], never, false, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttComponent, "ngx-gantt", never, { "maxLevel": "maxLevel"; "async": "async"; "childrenResolve": "childrenResolve"; "linkable": "linkable"; "loading": "loading"; "virtualScrollEnabled": "virtualScrollEnabled"; "loadingDelay": "loadingDelay"; }, { "linkDragStarted": "linkDragStarted"; "linkDragEnded": "linkDragEnded"; "lineClick": "lineClick"; "selectedChange": "selectedChange"; }, ["table", "tableEmptyTemplate", "columns"], never, false, never>;
53
54
  }
@@ -87,6 +87,10 @@
87
87
  }
88
88
  }
89
89
 
90
+ .gantt-normal-viewport {
91
+ display: flex;
92
+ }
93
+
90
94
  .gantt-virtual-scroll-viewport {
91
95
  position: absolute;
92
96
  left: 0;
@@ -109,6 +113,15 @@
109
113
  }
110
114
  }
111
115
  }
116
+
117
+ &.gantt-normal-viewport {
118
+ .cdk-virtual-scroll-content-wrapper {
119
+ height: 100%;
120
+ }
121
+ .cdk-virtual-scroll-spacer {
122
+ display: none;
123
+ }
124
+ }
112
125
  }
113
126
  }
114
127
 
package/gantt.styles.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const sideWidth = 400;
8
8
  export declare const sideMiddleWidth = 500;
9
9
  export declare const sideMaxWidth = 600;
10
10
  export declare const sideMinWidth = 400;
11
- export declare const barBackground = "#348fe4";
11
+ export declare const barBackground = "#6698ff";
12
12
  export declare const rangeHeight = 17;
13
13
  export declare const todayHeight = 24;
14
14
  export declare const todayWidth = 35;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
3
- "version": "15.1.0-next.8",
3
+ "version": "15.1.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  // basic
2
2
  $gantt-color: #333 !default;
3
- $gantt-primary-color: #348fe4 !default;
3
+ $gantt-primary-color: #6698ff !default;
4
4
  $gantt-header-height: 44px !default;
5
5
  $gantt-border-color: #eee !default;
6
6
  $gantt-bg-color: #fff !default;
@@ -33,6 +33,7 @@ $gantt-bar-bg: #fff !default;
33
33
  $gantt-bar-layer-bg: #fff !default;
34
34
  $gantt-bar-handle-color: #cacaca !default;
35
35
  $gantt-bar-handle-height: 12px !default;
36
+ $gantt-bar-link-handle-point: $gantt-primary-color !default;
36
37
  $gantt-bar-background-color: $gantt-primary-color !default;
37
38
 
38
39
  // drag
@@ -54,4 +55,4 @@ $gantt-baseline-background-color: #cacaca !default;
54
55
  $gantt-toolbar-view-active-color: $gantt-primary-color !default;
55
56
 
56
57
  // loader
57
- $gantt-loader-loading-color: #6698ff !default;
58
+ $gantt-loader-loading-color: $gantt-primary-color !default;
@@ -1,13 +1,15 @@
1
1
  import { EventEmitter, TemplateRef } from '@angular/core';
2
- import { GanttTableDragEnterPredicateContext, GanttTableDragDroppedEvent, GanttTableEvent } from '../class';
2
+ import { GanttTableDragEnterPredicateContext, GanttTableDragDroppedEvent, GanttTableEvent, GanttTableDragStartedEvent, GanttTableDragEndedEvent } from '../class';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class NgxGanttTableComponent {
5
5
  draggable: boolean;
6
6
  dropEnterPredicate?: (context: GanttTableDragEnterPredicateContext) => boolean;
7
7
  dragDropped: EventEmitter<GanttTableDragDroppedEvent<unknown>>;
8
+ dragStarted: EventEmitter<GanttTableDragStartedEvent<unknown>>;
9
+ dragEnded: EventEmitter<GanttTableDragEndedEvent<unknown>>;
8
10
  columnChanges: EventEmitter<GanttTableEvent>;
9
11
  rowBeforeTemplate: TemplateRef<any>;
10
12
  rowAfterTemplate: TemplateRef<any>;
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, { "draggable": "draggable"; "dropEnterPredicate": "dropEnterPredicate"; }, { "dragDropped": "dragDropped"; "columnChanges": "columnChanges"; }, ["rowBeforeTemplate", "rowAfterTemplate"], never, false, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, { "draggable": "draggable"; "dropEnterPredicate": "dropEnterPredicate"; }, { "dragDropped": "dragDropped"; "dragStarted": "dragStarted"; "dragEnded": "dragEnded"; "columnChanges": "columnChanges"; }, ["rowBeforeTemplate", "rowAfterTemplate"], never, false, never>;
13
15
  }
@@ -18,3 +18,10 @@ export declare function getHorizontalScrollDirection(clientRect: DOMRect, pointe
18
18
  * @param pointerY Coordinates along the Y axis.
19
19
  */
20
20
  export declare function isPointerNearClientRect(rect: DOMRect, threshold: number, pointerX: number, pointerY: number): boolean;
21
+ /**
22
+ * Gets the speed rate of auto scrolling
23
+ * @param clientRect Dimensions of the node.
24
+ * @param pointerX Position of the user's pointer along the x axis.
25
+ * @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
26
+ */
27
+ export declare function getAutoScrollSpeedRates(clientRect: DOMRect, pointerX: number, horizontalScrollDirection: AutoScrollHorizontalDirection): number;
@@ -1,79 +0,0 @@
1
- @use '../../styles/variables';
2
-
3
- .gantt-calendar-overlay {
4
- display: block;
5
- height: 100%;
6
- overflow: hidden;
7
-
8
- .gantt-calendar-today-overlay {
9
- position: relative;
10
- z-index: 2;
11
- .today-rect {
12
- width: 35px;
13
- height: 24px;
14
- position: absolute;
15
- background: variables.$gantt-date-today-color;
16
- color: variables.$gantt-date-today-text-color;
17
- text-align: center;
18
- border-radius: 4px;
19
- }
20
- .today-line {
21
- position: absolute;
22
- width: 3px;
23
- background: variables.$gantt-date-today-color;
24
- transform: scaleX(0.5);
25
- transform-origin: 100% 0;
26
- margin-left: -2px;
27
- }
28
- }
29
-
30
- .gantt-calendar-overlay-main {
31
- position: relative;
32
- z-index: 1;
33
- background-color: variables.$gantt-bg-color;
34
- }
35
-
36
- svg {
37
- overflow: visible;
38
- }
39
-
40
- line {
41
- shape-rendering: crispEdges;
42
- }
43
-
44
- .primary-text {
45
- fill: variables.$gantt-date-primary-color;
46
- font-size: variables.$gantt-date-primary-font-size;
47
- }
48
-
49
- .secondary-text {
50
- fill: variables.$gantt-date-secondary-color;
51
- font-size: variables.$gantt-date-secondary-font-size;
52
-
53
- &-weekend {
54
- fill: variables.$gantt-date-secondary-weekend-color;
55
- }
56
- }
57
-
58
- .primary-text,
59
- .secondary-text {
60
- text-anchor: middle;
61
- }
62
-
63
- .primary-line {
64
- stroke: variables.$gantt-date-primary-border;
65
- }
66
-
67
- .secondary-line {
68
- stroke-dasharray: 2px 5px;
69
- stroke: #cacaca;
70
- }
71
-
72
- .header-line {
73
- stroke: variables.$gantt-border-color;
74
- }
75
-
76
- .secondary-backdrop {
77
- fill: variables.$gantt-date-week-backdrop-bg;
78
- }
79
- }
@@ -1,237 +0,0 @@
1
- @use '../../styles/variables';
2
-
3
- @mixin gantt-table-item-base() {
4
- display: flex;
5
- flex-wrap: wrap;
6
- box-sizing: border-box;
7
- border-bottom: 1px solid variables.$gantt-border-color;
8
-
9
- .gantt-table-column {
10
- overflow: hidden;
11
- border-right: 1px solid variables.$gantt-border-color;
12
- box-sizing: border-box;
13
- position: relative;
14
-
15
- &:last-child {
16
- border-right: none;
17
- }
18
- }
19
- }
20
-
21
- @mixin gantt-table-item {
22
- @include gantt-table-item-base();
23
- position: relative;
24
- cursor: pointer;
25
-
26
- &-first-level-group {
27
- background: variables.$gantt-group-background-color;
28
- }
29
-
30
- &-with-group {
31
- .gantt-table-column {
32
- &:first-child {
33
- padding: 0 15px 0 32px;
34
- }
35
- }
36
- }
37
-
38
- .gantt-table-column {
39
- display: flex;
40
- padding: variables.$gantt-table-td-padding;
41
-
42
- &:last-child {
43
- border-right: none;
44
- }
45
- }
46
-
47
- .gantt-table-column-content {
48
- flex: 1;
49
- position: relative;
50
- overflow: hidden;
51
- text-overflow: ellipsis;
52
- white-space: nowrap;
53
- }
54
-
55
- .gantt-expand-icon {
56
- display: inline-block;
57
- width: 20px;
58
- color: #aaa;
59
- }
60
-
61
- .gantt-drag-handle {
62
- width: 1rem;
63
- padding: 0 5px 0 0;
64
- display: flex;
65
- align-items: center;
66
- margin-left: -10px;
67
- }
68
-
69
- &:hover {
70
- background-color: variables.$gantt-container-background-color;
71
- }
72
-
73
- &-active {
74
- background-color: rgba($color: variables.$gantt-table-header-drag-line-color, $alpha: 0.1);
75
- &:hover {
76
- background-color: rgba($color: variables.$gantt-table-header-drag-line-color, $alpha: 0.1);
77
- }
78
- }
79
- }
80
-
81
- @mixin gantt-items-drag-drop() {
82
- .cdk-drag-preview.gantt-table-item {
83
- box-sizing: border-box;
84
- box-shadow: 0px 0px 8px 2px rgba(0, 0, 0, 0.08);
85
- opacity: 0.9;
86
- @include gantt-table-item();
87
- }
88
-
89
- .gantt-table.gantt-table-draggable {
90
- .cdk-drag-placeholder {
91
- display: none !important;
92
- & + .cdk-drop-list {
93
- display: none !important;
94
- }
95
- }
96
-
97
- .cdk-drag-disabled.gantt-table-item {
98
- .gantt-drag-handle {
99
- svg {
100
- display: none;
101
- }
102
- }
103
- }
104
-
105
- .drop-position-inside {
106
- // border: 2px dashed variables.$gantt-primary-color !important;
107
- .gantt-table-column {
108
- height: 100%;
109
- border-top: 2px dashed variables.$gantt-primary-color !important;
110
- border-bottom: 2px dashed variables.$gantt-primary-color !important;
111
- &:first-child {
112
- border-left: 2px dashed variables.$gantt-primary-color !important;
113
- }
114
- &:last-child {
115
- border-right: 2px dashed variables.$gantt-primary-color !important;
116
- }
117
- }
118
- }
119
-
120
- .drop-position-before {
121
- background: #f5f5f5;
122
- border-top: 2px solid variables.$gantt-primary-color !important;
123
- }
124
-
125
- .drop-position-after {
126
- background: #f5f5f5;
127
- border-bottom: 2px solid variables.$gantt-primary-color !important;
128
- }
129
-
130
- &.gantt-table-dragging {
131
- .gantt-table-item {
132
- &:hover {
133
- background: unset !important;
134
- .gantt-drag-handle {
135
- visibility: hidden !important;
136
- }
137
- }
138
- }
139
- }
140
- }
141
- }
142
-
143
- .gantt-table {
144
- display: block;
145
-
146
- &-empty {
147
- height: 100%;
148
- position: relative;
149
- .gantt-table-body {
150
- position: absolute;
151
- text-align: center;
152
- top: 50%;
153
- left: 50%;
154
- transform: translate(-50%, -50%);
155
- margin-top: 22px;
156
- .empty-icon {
157
- svg {
158
- height: 78px;
159
- width: 78px;
160
- }
161
- }
162
- .empty-text {
163
- color: #cacaca;
164
- }
165
- }
166
- }
167
-
168
- .gantt-table-header {
169
- text-align: center;
170
- position: sticky;
171
- top: 0;
172
- background: #fff;
173
- z-index: 2;
174
- height: variables.$gantt-header-height;
175
- line-height: variables.$gantt-header-height;
176
-
177
- @include gantt-table-item-base();
178
-
179
- .gantt-table-column {
180
- font-weight: 400;
181
- }
182
- }
183
-
184
- .gantt-table-body {
185
- .gantt-table-group {
186
- display: flex;
187
- height: variables.$gantt-group-height;
188
- background: variables.$gantt-group-background-color;
189
- padding: 0 10px;
190
- align-items: center;
191
- border-bottom: 1px solid variables.$gantt-border-color;
192
- box-sizing: border-box;
193
- position: relative;
194
-
195
- .gantt-table-group-title {
196
- cursor: pointer;
197
-
198
- .expand-icon {
199
- color: #aaa;
200
- margin-right: 6px;
201
- }
202
- }
203
- }
204
-
205
- .gantt-table-item {
206
- @include gantt-table-item();
207
- }
208
- }
209
-
210
- .table-resize-trigger,
211
- .column-resize-handle {
212
- width: variables.$gantt-table-header-drag-line-width;
213
- position: absolute;
214
- top: 0;
215
- right: 0;
216
- bottom: 0;
217
- cursor: ew-resize;
218
- z-index: 1;
219
-
220
- &:hover {
221
- background: variables.$gantt-table-header-drag-line-color;
222
- z-index: 2;
223
- }
224
- }
225
-
226
- .table-resize-line {
227
- width: variables.$gantt-table-header-drag-line-width;
228
- background: variables.$gantt-table-header-drag-line-color;
229
- position: absolute;
230
- top: 0;
231
- bottom: 0;
232
- z-index: 100;
233
- display: none;
234
- }
235
- }
236
-
237
- @include gantt-items-drag-drop();