tltv-gantt-element 1.0.33 → 1.0.34
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.
- package/dist/src/gantt-element.d.ts +65 -51
- package/dist/src/gantt-element.js +375 -287
- package/dist/src/gantt-element.js.map +1 -1
- package/package.json +2 -2
- package/src/gantt-element.ts +92 -2
- package/src/index.html +15 -0
|
@@ -1,51 +1,65 @@
|
|
|
1
|
-
import { Resolution } from 'tltv-timeline-element/dist/src/model/Resolution.js';
|
|
2
|
-
import { GanttEventsBase } from './gantt-events-base';
|
|
3
|
-
declare const GanttElement_base: typeof GanttEventsBase & {
|
|
4
|
-
new (...args: any[]): import("./css-background-grid-mixin").BackgroundGridInterface;
|
|
5
|
-
prototype: import("./css-background-grid-mixin").BackgroundGridInterface;
|
|
6
|
-
};
|
|
7
|
-
export declare class GanttElement extends GanttElement_base {
|
|
8
|
-
resolution: Resolution;
|
|
9
|
-
start: string;
|
|
10
|
-
end: string;
|
|
11
|
-
zone: string;
|
|
12
|
-
locale: string;
|
|
13
|
-
firstDayOfWeek: number;
|
|
14
|
-
twelveHourClock: boolean;
|
|
15
|
-
monthRowVisible: boolean;
|
|
16
|
-
yearRowVisible: boolean;
|
|
17
|
-
monthNames: string[];
|
|
18
|
-
weekdayNames: string[];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
import { Resolution } from 'tltv-timeline-element/dist/src/model/Resolution.js';
|
|
2
|
+
import { GanttEventsBase } from './gantt-events-base';
|
|
3
|
+
declare const GanttElement_base: typeof GanttEventsBase & {
|
|
4
|
+
new (...args: any[]): import("./css-background-grid-mixin").BackgroundGridInterface;
|
|
5
|
+
prototype: import("./css-background-grid-mixin").BackgroundGridInterface;
|
|
6
|
+
};
|
|
7
|
+
export declare class GanttElement extends GanttElement_base {
|
|
8
|
+
resolution: Resolution;
|
|
9
|
+
start: string;
|
|
10
|
+
end: string;
|
|
11
|
+
zone: string;
|
|
12
|
+
locale: string;
|
|
13
|
+
firstDayOfWeek: number;
|
|
14
|
+
twelveHourClock: boolean;
|
|
15
|
+
monthRowVisible: boolean;
|
|
16
|
+
yearRowVisible: boolean;
|
|
17
|
+
monthNames: string[];
|
|
18
|
+
weekdayNames: string[];
|
|
19
|
+
currentTimeVisible: boolean;
|
|
20
|
+
private _currentTimeTimer;
|
|
21
|
+
private _lastCurrentTimeHour;
|
|
22
|
+
_resizeObserver: ResizeObserver;
|
|
23
|
+
scrollbarWidth: number;
|
|
24
|
+
static get styles(): import("lit").CSSResult;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
constructor();
|
|
27
|
+
firstUpdated(changedProperties: any): void;
|
|
28
|
+
updated(changedProperties: any): void;
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
disconnectedCallback(): void;
|
|
31
|
+
handleSlotchange(e: Event): void;
|
|
32
|
+
updateSize(): void;
|
|
33
|
+
timelineUpdated(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Update position and visibility of the current time indicator line in the content.
|
|
36
|
+
* Line is hidden when feature is disabled or current time is outside of the timeline range.
|
|
37
|
+
*/
|
|
38
|
+
updateCurrentTimeIndicator(): void;
|
|
39
|
+
private updateCurrentTimeTimer;
|
|
40
|
+
private stopCurrentTimeTimer;
|
|
41
|
+
private onCurrentTimeTick;
|
|
42
|
+
private getCurrentHourStamp;
|
|
43
|
+
updateContentWidth(): void;
|
|
44
|
+
updateContentHeight(): void;
|
|
45
|
+
calculateScrollbarWidth(): number;
|
|
46
|
+
private convertGanttHeightToContainerHeight;
|
|
47
|
+
private updateGanttContainerStyle;
|
|
48
|
+
private updateContainerStyle;
|
|
49
|
+
private updateContainerBackgroundSize;
|
|
50
|
+
private updateContainerBackgroundPosition;
|
|
51
|
+
private getBgGridCellHeight;
|
|
52
|
+
/**
|
|
53
|
+
* Return true, if content is overflowing horizontally. This means also that
|
|
54
|
+
* horizontal scroll bar is visible.
|
|
55
|
+
*/
|
|
56
|
+
isContentOverflowingHorizontally(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Return true, if content is overflowing vertically.This means also that
|
|
59
|
+
* vertical scroll bar is visible.
|
|
60
|
+
*/
|
|
61
|
+
isContentOverflowingVertically(): boolean;
|
|
62
|
+
private _handleGanttTouchStart;
|
|
63
|
+
private _handleGanttMouseDown;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { html, css } from 'lit';
|
|
8
|
-
import { property, customElement } from 'lit/decorators.js';
|
|
9
|
-
import { Resolution } from 'tltv-timeline-element/dist/src/model/Resolution.js';
|
|
10
|
-
import * as ElementUtil from 'tltv-timeline-element/dist/src/util/elementUtil.js';
|
|
11
|
-
import { GanttEventsBase } from './gantt-events-base';
|
|
12
|
-
import { BackgroundGridMixin } from './css-background-grid-mixin';
|
|
13
|
-
import { getElementHeightWithMargin } from "./util/ganttUtil";
|
|
14
|
-
export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
15
|
-
static get styles() {
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, css } from 'lit';
|
|
8
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
9
|
+
import { Resolution } from 'tltv-timeline-element/dist/src/model/Resolution.js';
|
|
10
|
+
import * as ElementUtil from 'tltv-timeline-element/dist/src/util/elementUtil.js';
|
|
11
|
+
import { GanttEventsBase } from './gantt-events-base';
|
|
12
|
+
import { BackgroundGridMixin } from './css-background-grid-mixin';
|
|
13
|
+
import { getElementHeightWithMargin } from "./util/ganttUtil";
|
|
14
|
+
export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
15
|
+
static get styles() {
|
|
16
16
|
return css `
|
|
17
17
|
:host {
|
|
18
18
|
display: block;
|
|
@@ -21,6 +21,7 @@ export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEv
|
|
|
21
21
|
--grid-line-color: #eee;
|
|
22
22
|
--gantt-element-width: 100%;
|
|
23
23
|
--gantt-element-height: auto;
|
|
24
|
+
--gantt-current-time-color: #e53935;
|
|
24
25
|
|
|
25
26
|
width: var(--gantt-element-width);
|
|
26
27
|
height: var(--gantt-element-height);
|
|
@@ -63,6 +64,16 @@ export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEv
|
|
|
63
64
|
overflow: hidden;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
#current-time {
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
width: 0;
|
|
72
|
+
border-left: 1px solid var(--gantt-current-time-color);
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
66
77
|
#mv-el {
|
|
67
78
|
position: absolute;
|
|
68
79
|
top: 0;
|
|
@@ -73,9 +84,9 @@ export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEv
|
|
|
73
84
|
border-right: 1px dashed #999;
|
|
74
85
|
pointer-events: none;
|
|
75
86
|
}
|
|
76
|
-
`;
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
79
90
|
return html `
|
|
80
91
|
<div id="gantt-container">
|
|
81
92
|
<timeline-element id="timeline" scrollContainerId="container"
|
|
@@ -90,281 +101,358 @@ export let GanttElement = class GanttElement extends BackgroundGridMixin(GanttEv
|
|
|
90
101
|
.monthRowVisible="${this.monthRowVisible}"
|
|
91
102
|
.yearRowVisible="${this.yearRowVisible}"
|
|
92
103
|
.monthNames="${this.monthNames}"
|
|
93
|
-
.weekdayNames="${this.weekdayNames}"
|
|
104
|
+
.weekdayNames="${this.weekdayNames}"
|
|
105
|
+
.currentDateVisible="${this.currentTimeVisible}">
|
|
94
106
|
</timeline-element>
|
|
95
107
|
<div id="container">
|
|
96
108
|
<div id="content">
|
|
97
109
|
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
110
|
+
<div id="current-time" style="display: none;"></div>
|
|
98
111
|
</div>
|
|
99
112
|
</div>
|
|
100
113
|
<div id="mv-el" style="display: none;"></div>
|
|
101
114
|
</div>
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
constructor() {
|
|
105
|
-
super();
|
|
106
|
-
this.resolution = Resolution.Day;
|
|
107
|
-
this.zone = "Europe/London";
|
|
108
|
-
this.locale = "en-US";
|
|
109
|
-
this.firstDayOfWeek = 1; // sunday;
|
|
110
|
-
this.twelveHourClock = false;
|
|
111
|
-
this.monthRowVisible = true;
|
|
112
|
-
this.yearRowVisible = true;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
this.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
this.
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
constructor() {
|
|
118
|
+
super();
|
|
119
|
+
this.resolution = Resolution.Day;
|
|
120
|
+
this.zone = "Europe/London";
|
|
121
|
+
this.locale = "en-US";
|
|
122
|
+
this.firstDayOfWeek = 1; // sunday;
|
|
123
|
+
this.twelveHourClock = false;
|
|
124
|
+
this.monthRowVisible = true;
|
|
125
|
+
this.yearRowVisible = true;
|
|
126
|
+
/* Show current day highlighted in the timeline and current time as a vertical line in the content. */
|
|
127
|
+
this.currentTimeVisible = false;
|
|
128
|
+
this._currentTimeTimer = null;
|
|
129
|
+
this._lastCurrentTimeHour = null;
|
|
130
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
131
|
+
this.updateSize();
|
|
132
|
+
});
|
|
133
|
+
this.scrollbarWidth = 18;
|
|
134
|
+
}
|
|
135
|
+
firstUpdated(changedProperties) {
|
|
136
|
+
this.scrollbarWidth = this.calculateScrollbarWidth();
|
|
137
|
+
this.initGrid(this._container, this._content);
|
|
138
|
+
super.firstUpdated(changedProperties);
|
|
139
|
+
this._resizeObserver.observe(this);
|
|
140
|
+
this.addEventListener('touchstart', this._handleGanttTouchStart, { passive: true });
|
|
141
|
+
this.addEventListener('mousedown', this._handleGanttMouseDown);
|
|
142
|
+
this.dispatchEvent(new Event('gantt-element-ready'));
|
|
143
|
+
}
|
|
144
|
+
updated(changedProperties) {
|
|
145
|
+
if (changedProperties.has('resolution')
|
|
146
|
+
|| changedProperties.has('start')
|
|
147
|
+
|| changedProperties.has('end')
|
|
148
|
+
|| changedProperties.has('yearRowVisible')
|
|
149
|
+
|| changedProperties.has('monthRowVisible')) {
|
|
150
|
+
this.timelineUpdated();
|
|
151
|
+
}
|
|
152
|
+
else if (changedProperties.has('resizableSteps')) {
|
|
153
|
+
this._steps.forEach(step => step.refresh());
|
|
154
|
+
}
|
|
155
|
+
if (changedProperties.has('currentTimeVisible')) {
|
|
156
|
+
this.updateCurrentTimeTimer();
|
|
157
|
+
this.updateCurrentTimeIndicator();
|
|
158
|
+
}
|
|
159
|
+
super.updated(changedProperties);
|
|
160
|
+
}
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
super.connectedCallback();
|
|
163
|
+
this.updateCurrentTimeTimer();
|
|
164
|
+
}
|
|
165
|
+
disconnectedCallback() {
|
|
166
|
+
this.stopCurrentTimeTimer();
|
|
167
|
+
super.disconnectedCallback();
|
|
168
|
+
}
|
|
169
|
+
handleSlotchange(e) {
|
|
170
|
+
super.handleSlotchange(e);
|
|
171
|
+
this.firePendingMoveEvents();
|
|
172
|
+
// to make sure that all steps are rendered before we calculate the height - in case that steps have margins around them
|
|
173
|
+
setTimeout(() => {
|
|
174
|
+
this.updateContentHeight();
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
updateSize() {
|
|
178
|
+
let self = this;
|
|
179
|
+
this.getTimeline().then(timeline => {
|
|
180
|
+
timeline.updateWidths();
|
|
181
|
+
self.updateGanttContainerStyle();
|
|
182
|
+
self.updateContainerStyle();
|
|
183
|
+
self.updateContentWidth();
|
|
184
|
+
self.updateCurrentTimeIndicator();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
async timelineUpdated() {
|
|
188
|
+
await this._timeline.updateComplete;
|
|
189
|
+
this.updateContentWidth();
|
|
190
|
+
this._steps.forEach(step => step.refresh());
|
|
191
|
+
this.updateContainerStyle();
|
|
192
|
+
this.updateCurrentTimeIndicator();
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Update position and visibility of the current time indicator line in the content.
|
|
196
|
+
* Line is hidden when feature is disabled or current time is outside of the timeline range.
|
|
197
|
+
*/
|
|
198
|
+
updateCurrentTimeIndicator() {
|
|
199
|
+
var _a;
|
|
200
|
+
const indicator = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('current-time');
|
|
201
|
+
if (!indicator) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const timeline = this._timeline;
|
|
205
|
+
const now = new Date();
|
|
206
|
+
if (!this.currentTimeVisible || !timeline
|
|
207
|
+
|| !timeline.internalInclusiveStartDateTime || !timeline.internalInclusiveEndDateTime
|
|
208
|
+
|| now.getTime() < timeline.internalInclusiveStartDateTime.getTime()
|
|
209
|
+
|| now.getTime() > timeline.internalInclusiveEndDateTime.getTime()) {
|
|
210
|
+
indicator.style.display = 'none';
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
indicator.style.left = timeline.getLeftPositionPercentageStringForDate(now, this.getContentWidth());
|
|
214
|
+
indicator.style.display = '';
|
|
215
|
+
}
|
|
216
|
+
updateCurrentTimeTimer() {
|
|
217
|
+
if (this.currentTimeVisible && this.isConnected) {
|
|
218
|
+
if (this._currentTimeTimer == null) {
|
|
219
|
+
this._lastCurrentTimeHour = this.getCurrentHourStamp();
|
|
220
|
+
this._currentTimeTimer = window.setInterval(() => this.onCurrentTimeTick(), 60 * 1000);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
this.stopCurrentTimeTimer();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
stopCurrentTimeTimer() {
|
|
228
|
+
if (this._currentTimeTimer != null) {
|
|
229
|
+
window.clearInterval(this._currentTimeTimer);
|
|
230
|
+
this._currentTimeTimer = null;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
onCurrentTimeTick() {
|
|
234
|
+
this.updateCurrentTimeIndicator();
|
|
235
|
+
const hourStamp = this.getCurrentHourStamp();
|
|
236
|
+
if (hourStamp !== this._lastCurrentTimeHour) {
|
|
237
|
+
// day or hour has changed, let timeline update its current date/hour highlight
|
|
238
|
+
this._lastCurrentTimeHour = hourStamp;
|
|
239
|
+
if (this._timeline) {
|
|
240
|
+
this._timeline.refreshCurrentDate();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
getCurrentHourStamp() {
|
|
245
|
+
// 15 minute slots so that hour/day changes are noticed also in time zones with 30/45 minute offsets
|
|
246
|
+
return Math.floor(Date.now() / (15 * 60 * 1000));
|
|
247
|
+
}
|
|
248
|
+
updateContentWidth() {
|
|
249
|
+
if ((ElementUtil.getHeight(this.getContent()) > ElementUtil.getHeight(this._container))) {
|
|
250
|
+
this.getContent().style.width = ElementUtil.getWidth(this._timeline) - this.scrollbarWidth + "px";
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.getContent().style.width = ElementUtil.getWidth(this._timeline) + "px";
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
updateContentHeight() {
|
|
257
|
+
let heightOfSteps = this._steps.map(step => getElementHeightWithMargin(step)).reduce((a, b) => a + b);
|
|
258
|
+
console.log(`GanttElement.updateContentHeight calculated ${heightOfSteps}px height for content by steps`);
|
|
259
|
+
this.getContent().style.height = heightOfSteps + 'px';
|
|
260
|
+
}
|
|
261
|
+
calculateScrollbarWidth() {
|
|
262
|
+
const outer = document.createElement('div');
|
|
263
|
+
outer.style.visibility = 'hidden';
|
|
264
|
+
outer.style.overflow = 'scroll';
|
|
265
|
+
document.body.appendChild(outer);
|
|
266
|
+
const inner = document.createElement('div');
|
|
267
|
+
outer.appendChild(inner);
|
|
268
|
+
const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);
|
|
269
|
+
outer.parentNode.removeChild(outer);
|
|
270
|
+
return scrollbarWidth;
|
|
271
|
+
}
|
|
272
|
+
convertGanttHeightToContainerHeight() {
|
|
273
|
+
let ganttHeight = this.ownerDocument.defaultView.getComputedStyle(this).getPropertyValue("--gantt-element-height");
|
|
274
|
+
if (ganttHeight && (ganttHeight.trim().endsWith("%") || ganttHeight.trim().endsWith("vm"))) {
|
|
275
|
+
return "100%"; // containers should fill whole available height when gantt height is in percentages
|
|
276
|
+
}
|
|
277
|
+
return ganttHeight;
|
|
278
|
+
}
|
|
279
|
+
updateGanttContainerStyle() {
|
|
280
|
+
// gantt container height should always match with host element's height
|
|
281
|
+
this._ganttContainer.style.height = this.convertGanttHeightToContainerHeight();
|
|
282
|
+
}
|
|
283
|
+
updateContainerStyle() {
|
|
284
|
+
// update container height based on timeline height
|
|
285
|
+
let ganttHeight = this.convertGanttHeightToContainerHeight();
|
|
286
|
+
let timelineHeight = ElementUtil.getHeight(this._timeline);
|
|
287
|
+
if (ganttHeight === "auto") {
|
|
288
|
+
this._container.style.height = "auto";
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this._container.style.height = "calc(" + ganttHeight + " - " + timelineHeight + "px)";
|
|
292
|
+
}
|
|
293
|
+
if (this.backgroundGridEnabled) {
|
|
294
|
+
this.showGrid();
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
this.hideGrid();
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
// Container element has a background image that is positioned, sized
|
|
301
|
+
// and repeated to fill the whole container with a nice grid background.
|
|
302
|
+
// Update 'background-size' in container element to match the background
|
|
303
|
+
// grid's cell width and height to match with the timeline and rows.
|
|
304
|
+
// Update also 'background-position' in container to match the first
|
|
305
|
+
// resolution element width in the timeline, IF it's not same as all
|
|
306
|
+
// other resolution element widths.
|
|
307
|
+
let resDivElementCount = this._timeline.resolutionDiv.childElementCount;
|
|
308
|
+
if (resDivElementCount == 0) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
let secondResolutionBlock = null;
|
|
312
|
+
let firstResolutionBlockWidth = this._timeline.getFirstResolutionElementWidth();
|
|
313
|
+
if (firstResolutionBlockWidth == null) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
let secondResolutionBlockWidth = null;
|
|
317
|
+
if (resDivElementCount > 2) {
|
|
318
|
+
secondResolutionBlock = this._timeline.resolutionDiv.children[1];
|
|
319
|
+
secondResolutionBlockWidth = ElementUtil.getWidth(secondResolutionBlock);
|
|
320
|
+
}
|
|
321
|
+
let contentOverflowingHorizontally = this.isContentOverflowingHorizontally();
|
|
322
|
+
let adjustBgPosition = secondResolutionBlockWidth != null
|
|
323
|
+
&& firstResolutionBlockWidth !== secondResolutionBlockWidth;
|
|
324
|
+
let gridBlockWidthPx = 0.0;
|
|
325
|
+
if (!adjustBgPosition) {
|
|
326
|
+
gridBlockWidthPx = firstResolutionBlockWidth;
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
gridBlockWidthPx = secondResolutionBlockWidth;
|
|
330
|
+
}
|
|
331
|
+
this.updateContainerBackgroundSize(contentOverflowingHorizontally, gridBlockWidthPx);
|
|
332
|
+
this.updateContainerBackgroundPosition(firstResolutionBlockWidth, contentOverflowingHorizontally, gridBlockWidthPx, adjustBgPosition);
|
|
333
|
+
}
|
|
334
|
+
updateContainerBackgroundSize(contentOverflowingHorizontally, gridBlockWidthPx) {
|
|
335
|
+
let gridBlockWidth = null;
|
|
336
|
+
if (contentOverflowingHorizontally || this.useAlwaysPxSizeInBackground) {
|
|
337
|
+
gridBlockWidth = gridBlockWidthPx + "px";
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
let contentWidth = ElementUtil.getWidth(this.getContent());
|
|
341
|
+
gridBlockWidth = (100.0 / contentWidth) * gridBlockWidthPx + "%";
|
|
342
|
+
}
|
|
343
|
+
let gridBlockHeightPx = this.getBgGridCellHeight();
|
|
344
|
+
this.setBackgroundSize(gridBlockWidth, gridBlockWidthPx, gridBlockHeightPx);
|
|
345
|
+
}
|
|
346
|
+
updateContainerBackgroundPosition(firstResolutionBlockWidth, contentOverflowingHorizontally, gridBlockWidthPx, adjustBgPosition) {
|
|
347
|
+
if (adjustBgPosition) {
|
|
348
|
+
let realBgPosXPx = firstResolutionBlockWidth - 1.0;
|
|
349
|
+
if (this.useAlwaysPxSizeInBackground || contentOverflowingHorizontally) {
|
|
350
|
+
this.setBackgroundPosition(realBgPosXPx + "px", "0px", realBgPosXPx, 0);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
let timelineWidth = this._timeline.calculateTimelineWidth();
|
|
354
|
+
let relativeBgAreaWidth = timelineWidth - gridBlockWidthPx;
|
|
355
|
+
let bgPosX = (100.0 / relativeBgAreaWidth) * realBgPosXPx;
|
|
356
|
+
this.setBackgroundPosition(bgPosX + "%", "0px", realBgPosXPx, 0);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.setBackgroundPosition("-1px", "0", -1, 0);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
getBgGridCellHeight() {
|
|
364
|
+
let gridBlockHeightPx = 0;
|
|
365
|
+
let firstStepIndex = 0;
|
|
366
|
+
if (firstStepIndex < this.getSteps().length) {
|
|
367
|
+
let firstStep = this.getSteps()[firstStepIndex];
|
|
368
|
+
gridBlockHeightPx = getElementHeightWithMargin(firstStep);
|
|
369
|
+
if ((this.getContentHeight() % gridBlockHeightPx) != 0) {
|
|
370
|
+
// height is not divided evenly for each bar.
|
|
371
|
+
// Can't use background grid with background-size trick.
|
|
372
|
+
gridBlockHeightPx = 0;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return gridBlockHeightPx;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Return true, if content is overflowing horizontally. This means also that
|
|
379
|
+
* horizontal scroll bar is visible.
|
|
380
|
+
*/
|
|
381
|
+
isContentOverflowingHorizontally() {
|
|
382
|
+
// state of horizontal overflow is handled by timeline widget
|
|
383
|
+
if (!this._content || !this._container || !this._timeline) {
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
386
|
+
return this._timeline.isTimelineOverflowingHorizontally();
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Return true, if content is overflowing vertically.This means also that
|
|
390
|
+
* vertical scroll bar is visible.
|
|
391
|
+
*/
|
|
392
|
+
isContentOverflowingVertically() {
|
|
393
|
+
if (!this._content || !this._container) {
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
return this._container.scrollHeight > this._container.clientHeight;
|
|
397
|
+
}
|
|
398
|
+
_handleGanttTouchStart(event) {
|
|
399
|
+
this.handleTouchStart(event);
|
|
400
|
+
}
|
|
401
|
+
_handleGanttMouseDown(event) {
|
|
402
|
+
this.handleMouseDown(event);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
__decorate([
|
|
406
|
+
property({
|
|
407
|
+
reflect: true,
|
|
408
|
+
converter: {
|
|
409
|
+
fromAttribute: (value, type) => {
|
|
410
|
+
return Resolution[value];
|
|
411
|
+
},
|
|
412
|
+
toAttribute: (value, type) => {
|
|
413
|
+
return Resolution[value];
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
], GanttElement.prototype, "resolution", void 0);
|
|
418
|
+
__decorate([
|
|
419
|
+
property({
|
|
420
|
+
reflect: true
|
|
421
|
+
})
|
|
422
|
+
], GanttElement.prototype, "start", void 0);
|
|
423
|
+
__decorate([
|
|
424
|
+
property({
|
|
425
|
+
reflect: true
|
|
426
|
+
})
|
|
427
|
+
], GanttElement.prototype, "end", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
property({ reflect: true })
|
|
430
|
+
], GanttElement.prototype, "zone", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
property({ reflect: true })
|
|
433
|
+
], GanttElement.prototype, "locale", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
property({ reflect: true })
|
|
436
|
+
], GanttElement.prototype, "firstDayOfWeek", void 0);
|
|
437
|
+
__decorate([
|
|
438
|
+
property({ reflect: true, type: Boolean })
|
|
439
|
+
], GanttElement.prototype, "twelveHourClock", void 0);
|
|
440
|
+
__decorate([
|
|
441
|
+
property({ type: Boolean })
|
|
442
|
+
], GanttElement.prototype, "monthRowVisible", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
property({ type: Boolean })
|
|
445
|
+
], GanttElement.prototype, "yearRowVisible", void 0);
|
|
446
|
+
__decorate([
|
|
447
|
+
property()
|
|
448
|
+
], GanttElement.prototype, "monthNames", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
property()
|
|
451
|
+
], GanttElement.prototype, "weekdayNames", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
property({ type: Boolean })
|
|
454
|
+
], GanttElement.prototype, "currentTimeVisible", void 0);
|
|
455
|
+
GanttElement = __decorate([
|
|
456
|
+
customElement('gantt-element')
|
|
457
|
+
], GanttElement);
|
|
370
458
|
//# sourceMappingURL=gantt-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gantt-element.js","sourceRoot":"","sources":["../../src/gantt-element.ts"],"names":[],"mappings":";;;;;;AA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
|
|
5
5
|
"main": "gantt-element.js",
|
|
6
6
|
"module": "gantt-element.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"date-fns": "^4.1.0",
|
|
10
10
|
"date-fns-tz": "^3.0.0",
|
|
11
11
|
"lit": "^2.8.0",
|
|
12
|
-
"tltv-timeline-element": "^1.0.
|
|
12
|
+
"tltv-timeline-element": "^1.0.22"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"clean-webpack-plugin": "^4.0.0",
|
package/src/gantt-element.ts
CHANGED
|
@@ -44,7 +44,11 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
44
44
|
@property({ type: Boolean }) yearRowVisible: boolean = true;
|
|
45
45
|
@property() monthNames: string[];
|
|
46
46
|
@property() weekdayNames: string[];
|
|
47
|
+
/* Show current day highlighted in the timeline and current time as a vertical line in the content. */
|
|
48
|
+
@property({ type: Boolean }) currentTimeVisible: boolean = false;
|
|
47
49
|
|
|
50
|
+
private _currentTimeTimer: number = null;
|
|
51
|
+
private _lastCurrentTimeHour: number = null;
|
|
48
52
|
|
|
49
53
|
_resizeObserver = new ResizeObserver(() => {
|
|
50
54
|
this.updateSize();
|
|
@@ -61,6 +65,7 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
61
65
|
--grid-line-color: #eee;
|
|
62
66
|
--gantt-element-width: 100%;
|
|
63
67
|
--gantt-element-height: auto;
|
|
68
|
+
--gantt-current-time-color: #e53935;
|
|
64
69
|
|
|
65
70
|
width: var(--gantt-element-width);
|
|
66
71
|
height: var(--gantt-element-height);
|
|
@@ -103,6 +108,16 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
103
108
|
overflow: hidden;
|
|
104
109
|
}
|
|
105
110
|
|
|
111
|
+
#current-time {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
bottom: 0;
|
|
115
|
+
width: 0;
|
|
116
|
+
border-left: 1px solid var(--gantt-current-time-color);
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
z-index: 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
106
121
|
#mv-el {
|
|
107
122
|
position: absolute;
|
|
108
123
|
top: 0;
|
|
@@ -131,11 +146,13 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
131
146
|
.monthRowVisible="${this.monthRowVisible}"
|
|
132
147
|
.yearRowVisible="${this.yearRowVisible}"
|
|
133
148
|
.monthNames="${this.monthNames}"
|
|
134
|
-
.weekdayNames="${this.weekdayNames}"
|
|
149
|
+
.weekdayNames="${this.weekdayNames}"
|
|
150
|
+
.currentDateVisible="${this.currentTimeVisible}">
|
|
135
151
|
</timeline-element>
|
|
136
152
|
<div id="container">
|
|
137
153
|
<div id="content">
|
|
138
154
|
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
155
|
+
<div id="current-time" style="display: none;"></div>
|
|
139
156
|
</div>
|
|
140
157
|
</div>
|
|
141
158
|
<div id="mv-el" style="display: none;"></div>
|
|
@@ -168,10 +185,24 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
168
185
|
else if (changedProperties.has('resizableSteps')) {
|
|
169
186
|
this._steps.forEach(step => step.refresh());
|
|
170
187
|
}
|
|
171
|
-
|
|
188
|
+
if (changedProperties.has('currentTimeVisible')) {
|
|
189
|
+
this.updateCurrentTimeTimer();
|
|
190
|
+
this.updateCurrentTimeIndicator();
|
|
191
|
+
}
|
|
192
|
+
|
|
172
193
|
super.updated(changedProperties);
|
|
173
194
|
}
|
|
174
195
|
|
|
196
|
+
connectedCallback() {
|
|
197
|
+
super.connectedCallback();
|
|
198
|
+
this.updateCurrentTimeTimer();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
disconnectedCallback() {
|
|
202
|
+
this.stopCurrentTimeTimer();
|
|
203
|
+
super.disconnectedCallback();
|
|
204
|
+
}
|
|
205
|
+
|
|
175
206
|
handleSlotchange(e: Event) {
|
|
176
207
|
super.handleSlotchange(e);
|
|
177
208
|
this.firePendingMoveEvents();
|
|
@@ -189,6 +220,7 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
189
220
|
self.updateGanttContainerStyle();
|
|
190
221
|
self.updateContainerStyle();
|
|
191
222
|
self.updateContentWidth();
|
|
223
|
+
self.updateCurrentTimeIndicator();
|
|
192
224
|
})
|
|
193
225
|
}
|
|
194
226
|
|
|
@@ -197,6 +229,64 @@ export class GanttElement extends BackgroundGridMixin(GanttEventsBase) {
|
|
|
197
229
|
this.updateContentWidth();
|
|
198
230
|
this._steps.forEach(step => step.refresh());
|
|
199
231
|
this.updateContainerStyle();
|
|
232
|
+
this.updateCurrentTimeIndicator();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Update position and visibility of the current time indicator line in the content.
|
|
237
|
+
* Line is hidden when feature is disabled or current time is outside of the timeline range.
|
|
238
|
+
*/
|
|
239
|
+
public updateCurrentTimeIndicator() {
|
|
240
|
+
const indicator = <HTMLElement>this.shadowRoot?.getElementById('current-time');
|
|
241
|
+
if (!indicator) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const timeline = this._timeline;
|
|
245
|
+
const now = new Date();
|
|
246
|
+
if (!this.currentTimeVisible || !timeline
|
|
247
|
+
|| !timeline.internalInclusiveStartDateTime || !timeline.internalInclusiveEndDateTime
|
|
248
|
+
|| now.getTime() < timeline.internalInclusiveStartDateTime.getTime()
|
|
249
|
+
|| now.getTime() > timeline.internalInclusiveEndDateTime.getTime()) {
|
|
250
|
+
indicator.style.display = 'none';
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
indicator.style.left = timeline.getLeftPositionPercentageStringForDate(now, this.getContentWidth());
|
|
254
|
+
indicator.style.display = '';
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
private updateCurrentTimeTimer() {
|
|
258
|
+
if (this.currentTimeVisible && this.isConnected) {
|
|
259
|
+
if (this._currentTimeTimer == null) {
|
|
260
|
+
this._lastCurrentTimeHour = this.getCurrentHourStamp();
|
|
261
|
+
this._currentTimeTimer = window.setInterval(() => this.onCurrentTimeTick(), 60 * 1000);
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
this.stopCurrentTimeTimer();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
private stopCurrentTimeTimer() {
|
|
269
|
+
if (this._currentTimeTimer != null) {
|
|
270
|
+
window.clearInterval(this._currentTimeTimer);
|
|
271
|
+
this._currentTimeTimer = null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
private onCurrentTimeTick() {
|
|
276
|
+
this.updateCurrentTimeIndicator();
|
|
277
|
+
const hourStamp = this.getCurrentHourStamp();
|
|
278
|
+
if (hourStamp !== this._lastCurrentTimeHour) {
|
|
279
|
+
// day or hour has changed, let timeline update its current date/hour highlight
|
|
280
|
+
this._lastCurrentTimeHour = hourStamp;
|
|
281
|
+
if (this._timeline) {
|
|
282
|
+
this._timeline.refreshCurrentDate();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
private getCurrentHourStamp(): number {
|
|
288
|
+
// 15 minute slots so that hour/day changes are noticed also in time zones with 30/45 minute offsets
|
|
289
|
+
return Math.floor(Date.now() / (15 * 60 * 1000));
|
|
200
290
|
}
|
|
201
291
|
|
|
202
292
|
|
package/src/index.html
CHANGED
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
Width:<input id="ganttwidth" type="text" onchange="onWidthChange()" value="100%"></input>
|
|
71
71
|
Height:<input id="ganttheight" type="text" onchange="onHeightChange()" value="100%"></input>
|
|
72
72
|
Fast Touch Mode:<input id="ganttfasttouchmode" type="checkbox" onchange="onFastTouchModeChange()" value="false" title="Fast Touch Mode makes touch move events more responsive but in expense of scrolling working anywhere over the content area."></input>
|
|
73
|
+
Current Time:<input id="ganttcurrenttime" type="checkbox" onchange="onCurrentTimeChange()" title="Highlight current day in the timeline and show current time as a vertical line. Moves the range around today if needed."></input>
|
|
73
74
|
</div>
|
|
74
75
|
<div class="wrapper-for-gantt">
|
|
75
76
|
<div id="left-wrapper">
|
|
@@ -155,6 +156,20 @@
|
|
|
155
156
|
document.getElementById("gantt").ignoreTouchTimeWindow = fastTouchMode ? 0 : 100;
|
|
156
157
|
}
|
|
157
158
|
|
|
159
|
+
function onCurrentTimeChange() {
|
|
160
|
+
let gantt = document.getElementById("gantt");
|
|
161
|
+
let visible = document.getElementById("ganttcurrenttime").checked;
|
|
162
|
+
if (visible) {
|
|
163
|
+
let now = new Date();
|
|
164
|
+
let today = now.toISOString().substring(0, 10);
|
|
165
|
+
if (today < gantt.start.substring(0, 10) || today > gantt.end.substring(0, 10)) {
|
|
166
|
+
gantt.start = new Date(now.getTime() - 14 * 24 * 3600 * 1000).toISOString().substring(0, 10);
|
|
167
|
+
gantt.end = new Date(now.getTime() + 50 * 24 * 3600 * 1000).toISOString().substring(0, 10);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
gantt.currentTimeVisible = visible;
|
|
171
|
+
}
|
|
172
|
+
|
|
158
173
|
document.getElementById("gantt").addEventListener('gantt-element-ready', event => {
|
|
159
174
|
document.getElementById("left-content").style.height = "calc(" + document.getElementById("gantt").childElementCount + " * 30px)";
|
|
160
175
|
document.getElementById("gantt").registerScrollElement(document.getElementById("left-scroller"));
|