gantt-task-react-powern 0.3.9

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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -0
  3. package/dist/components/calendar/calendar.d.ts +14 -0
  4. package/dist/components/calendar/top-part-of-calendar.d.ts +11 -0
  5. package/dist/components/gantt/gantt.d.ts +3 -0
  6. package/dist/components/gantt/task-gantt-content.d.ts +25 -0
  7. package/dist/components/gantt/task-gantt.d.ts +13 -0
  8. package/dist/components/grid/grid-body.d.ts +12 -0
  9. package/dist/components/grid/grid.d.ts +4 -0
  10. package/dist/components/other/arrow.d.ts +12 -0
  11. package/dist/components/other/horizontal-scroll.d.ts +8 -0
  12. package/dist/components/other/tooltip.d.ts +29 -0
  13. package/dist/components/other/vertical-scroll.d.ts +9 -0
  14. package/dist/components/task-item/bar/bar-date-handle.d.ts +11 -0
  15. package/dist/components/task-item/bar/bar-display.d.ts +20 -0
  16. package/dist/components/task-item/bar/bar-progress-handle.d.ts +7 -0
  17. package/dist/components/task-item/bar/bar-small.d.ts +3 -0
  18. package/dist/components/task-item/bar/bar.d.ts +3 -0
  19. package/dist/components/task-item/milestone/milestone.d.ts +3 -0
  20. package/dist/components/task-item/project/project.d.ts +3 -0
  21. package/dist/components/task-item/task-item.d.ts +15 -0
  22. package/dist/components/task-list/task-list-header.d.ts +7 -0
  23. package/dist/components/task-list/task-list-table.d.ts +13 -0
  24. package/dist/components/task-list/task-list.d.ts +37 -0
  25. package/dist/helpers/bar-helper.d.ts +14 -0
  26. package/dist/helpers/date-helper.d.ts +14 -0
  27. package/dist/helpers/other-helper.d.ts +8 -0
  28. package/dist/index.css +312 -0
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.js +2708 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/index.modern.js +2707 -0
  33. package/dist/index.modern.js.map +1 -0
  34. package/dist/test/date-helper.test.d.ts +1 -0
  35. package/dist/test/gant.test.d.ts +1 -0
  36. package/dist/types/bar-task.d.ts +21 -0
  37. package/dist/types/date-setup.d.ts +5 -0
  38. package/dist/types/gantt-task-actions.d.ts +8 -0
  39. package/dist/types/public-types.d.ts +135 -0
  40. package/package.json +66 -0
package/dist/index.js ADDED
@@ -0,0 +1,2708 @@
1
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
2
+
3
+ var React = require('react');
4
+ var React__default = _interopDefault(React);
5
+
6
+ function _extends() {
7
+ _extends = Object.assign || function (target) {
8
+ for (var i = 1; i < arguments.length; i++) {
9
+ var source = arguments[i];
10
+
11
+ for (var key in source) {
12
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13
+ target[key] = source[key];
14
+ }
15
+ }
16
+ }
17
+
18
+ return target;
19
+ };
20
+
21
+ return _extends.apply(this, arguments);
22
+ }
23
+
24
+ function _unsupportedIterableToArray(o, minLen) {
25
+ if (!o) return;
26
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
27
+ var n = Object.prototype.toString.call(o).slice(8, -1);
28
+ if (n === "Object" && o.constructor) n = o.constructor.name;
29
+ if (n === "Map" || n === "Set") return Array.from(o);
30
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
31
+ }
32
+
33
+ function _arrayLikeToArray(arr, len) {
34
+ if (len == null || len > arr.length) len = arr.length;
35
+
36
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
37
+
38
+ return arr2;
39
+ }
40
+
41
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
42
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
43
+ if (it) return (it = it.call(o)).next.bind(it);
44
+
45
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
46
+ if (it) o = it;
47
+ var i = 0;
48
+ return function () {
49
+ if (i >= o.length) return {
50
+ done: true
51
+ };
52
+ return {
53
+ done: false,
54
+ value: o[i++]
55
+ };
56
+ };
57
+ }
58
+
59
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
60
+ }
61
+
62
+ (function (ViewMode) {
63
+ ViewMode["Hour"] = "Hour";
64
+ ViewMode["QuarterDay"] = "Quarter Day";
65
+ ViewMode["HalfDay"] = "Half Day";
66
+ ViewMode["Day"] = "Day";
67
+ ViewMode["Week"] = "Week";
68
+ ViewMode["Month"] = "Month";
69
+ ViewMode["Year"] = "Year";
70
+ })(exports.ViewMode || (exports.ViewMode = {}));
71
+
72
+ var intlDTCache = {};
73
+ var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts) {
74
+ if (opts === void 0) {
75
+ opts = {};
76
+ }
77
+
78
+ var key = JSON.stringify([locString, opts]);
79
+ var dtf = intlDTCache[key];
80
+
81
+ if (!dtf) {
82
+ dtf = new Intl.DateTimeFormat(locString, opts);
83
+ intlDTCache[key] = dtf;
84
+ }
85
+
86
+ return dtf;
87
+ };
88
+ var addToDate = function addToDate(date, quantity, scale) {
89
+ var newDate = new Date(date.getFullYear() + (scale === "year" ? quantity : 0), date.getMonth() + (scale === "month" ? quantity : 0), date.getDate() + (scale === "day" ? quantity : 0), date.getHours() + (scale === "hour" ? quantity : 0), date.getMinutes() + (scale === "minute" ? quantity : 0), date.getSeconds() + (scale === "second" ? quantity : 0), date.getMilliseconds() + (scale === "millisecond" ? quantity : 0));
90
+ return newDate;
91
+ };
92
+ var startOfDate = function startOfDate(date, scale) {
93
+ var scores = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
94
+
95
+ var shouldReset = function shouldReset(_scale) {
96
+ var maxScore = scores.indexOf(scale);
97
+ return scores.indexOf(_scale) <= maxScore;
98
+ };
99
+
100
+ var newDate = new Date(date.getFullYear(), shouldReset("year") ? 0 : date.getMonth(), shouldReset("month") ? 1 : date.getDate(), shouldReset("day") ? 0 : date.getHours(), shouldReset("hour") ? 0 : date.getMinutes(), shouldReset("minute") ? 0 : date.getSeconds(), shouldReset("second") ? 0 : date.getMilliseconds());
101
+ return newDate;
102
+ };
103
+ var ganttDateRange = function ganttDateRange(tasks, viewMode, preStepsCount) {
104
+ var newStartDate = tasks[0].start;
105
+ var newEndDate = tasks[0].start;
106
+
107
+ for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
108
+ var task = _step.value;
109
+
110
+ if (task.start < newStartDate) {
111
+ newStartDate = task.start;
112
+ }
113
+
114
+ if (task.end > newEndDate) {
115
+ newEndDate = task.end;
116
+ }
117
+ }
118
+
119
+ switch (viewMode) {
120
+ case exports.ViewMode.Year:
121
+ newStartDate = addToDate(newStartDate, -1, "year");
122
+ newStartDate = startOfDate(newStartDate, "year");
123
+ newEndDate = addToDate(newEndDate, 1, "year");
124
+ newEndDate = startOfDate(newEndDate, "year");
125
+ break;
126
+
127
+ case exports.ViewMode.Month:
128
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "month");
129
+ newStartDate = startOfDate(newStartDate, "month");
130
+ newEndDate = addToDate(newEndDate, 1, "year");
131
+ newEndDate = startOfDate(newEndDate, "year");
132
+ break;
133
+
134
+ case exports.ViewMode.Week:
135
+ newStartDate = startOfDate(newStartDate, "day");
136
+ newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, "day");
137
+ newEndDate = startOfDate(newEndDate, "day");
138
+ newEndDate = addToDate(newEndDate, 1.5, "month");
139
+ break;
140
+
141
+ case exports.ViewMode.Day:
142
+ newStartDate = startOfDate(newStartDate, "day");
143
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
144
+ newEndDate = startOfDate(newEndDate, "day");
145
+ newEndDate = addToDate(newEndDate, 19, "day");
146
+ break;
147
+
148
+ case exports.ViewMode.QuarterDay:
149
+ newStartDate = startOfDate(newStartDate, "day");
150
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
151
+ newEndDate = startOfDate(newEndDate, "day");
152
+ newEndDate = addToDate(newEndDate, 66, "hour");
153
+ break;
154
+
155
+ case exports.ViewMode.HalfDay:
156
+ newStartDate = startOfDate(newStartDate, "day");
157
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
158
+ newEndDate = startOfDate(newEndDate, "day");
159
+ newEndDate = addToDate(newEndDate, 108, "hour");
160
+ break;
161
+
162
+ case exports.ViewMode.Hour:
163
+ newStartDate = startOfDate(newStartDate, "hour");
164
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
165
+ newEndDate = startOfDate(newEndDate, "day");
166
+ newEndDate = addToDate(newEndDate, 1, "day");
167
+ break;
168
+ }
169
+
170
+ return [newStartDate, newEndDate];
171
+ };
172
+ var seedDates = function seedDates(startDate, endDate, viewMode) {
173
+ var currentDate = new Date(startDate);
174
+ var dates = [currentDate];
175
+
176
+ while (currentDate < endDate) {
177
+ switch (viewMode) {
178
+ case exports.ViewMode.Year:
179
+ currentDate = addToDate(currentDate, 1, "year");
180
+ break;
181
+
182
+ case exports.ViewMode.Month:
183
+ currentDate = addToDate(currentDate, 1, "month");
184
+ break;
185
+
186
+ case exports.ViewMode.Week:
187
+ currentDate = addToDate(currentDate, 7, "day");
188
+ break;
189
+
190
+ case exports.ViewMode.Day:
191
+ currentDate = addToDate(currentDate, 1, "day");
192
+ break;
193
+
194
+ case exports.ViewMode.HalfDay:
195
+ currentDate = addToDate(currentDate, 12, "hour");
196
+ break;
197
+
198
+ case exports.ViewMode.QuarterDay:
199
+ currentDate = addToDate(currentDate, 6, "hour");
200
+ break;
201
+
202
+ case exports.ViewMode.Hour:
203
+ currentDate = addToDate(currentDate, 1, "hour");
204
+ break;
205
+ }
206
+
207
+ dates.push(currentDate);
208
+ }
209
+
210
+ return dates;
211
+ };
212
+ var getLocaleMonth = function getLocaleMonth(date, locale) {
213
+ var bottomValue = getCachedDateTimeFormat(locale, {
214
+ month: "long"
215
+ }).format(date);
216
+ bottomValue = bottomValue.replace(bottomValue[0], bottomValue[0].toLocaleUpperCase());
217
+ return bottomValue;
218
+ };
219
+ var getLocalDayOfWeek = function getLocalDayOfWeek(date, locale, format) {
220
+ var bottomValue = getCachedDateTimeFormat(locale, {
221
+ weekday: format
222
+ }).format(date);
223
+ bottomValue = bottomValue.replace(bottomValue[0], bottomValue[0].toLocaleUpperCase());
224
+ return bottomValue;
225
+ };
226
+
227
+ var getMonday = function getMonday(date) {
228
+ var day = date.getDay();
229
+ var diff = date.getDate() - day + (day === 0 ? -6 : 1);
230
+ return new Date(date.setDate(diff));
231
+ };
232
+
233
+ var getWeekNumberISO8601 = function getWeekNumberISO8601(date) {
234
+ var tmpDate = new Date(date.valueOf());
235
+ var dayNumber = (tmpDate.getDay() + 6) % 7;
236
+ tmpDate.setDate(tmpDate.getDate() - dayNumber + 3);
237
+ var firstThursday = tmpDate.valueOf();
238
+ tmpDate.setMonth(0, 1);
239
+
240
+ if (tmpDate.getDay() !== 4) {
241
+ tmpDate.setMonth(0, 1 + (4 - tmpDate.getDay() + 7) % 7);
242
+ }
243
+
244
+ var weekNumber = (1 + Math.ceil((firstThursday - tmpDate.valueOf()) / 604800000)).toString();
245
+
246
+ if (weekNumber.length === 1) {
247
+ return "0" + weekNumber;
248
+ } else {
249
+ return weekNumber;
250
+ }
251
+ };
252
+ var getDaysInMonth = function getDaysInMonth(month, year) {
253
+ return new Date(year, month + 1, 0).getDate();
254
+ };
255
+
256
+ var styles = {"ganttTable":"_3_ygE","ganttTable_Header":"_1nBOt","ganttTable_HeaderSeparator":"_2eZzQ","ganttTable_HeaderItem":"_WuQ0f"};
257
+
258
+ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
259
+ var headerHeight = _ref.headerHeight,
260
+ fontFamily = _ref.fontFamily,
261
+ fontSize = _ref.fontSize,
262
+ rowWidth = _ref.rowWidth;
263
+ return React__default.createElement("div", {
264
+ className: styles.ganttTable,
265
+ style: {
266
+ fontFamily: fontFamily,
267
+ fontSize: fontSize
268
+ }
269
+ }, React__default.createElement("div", {
270
+ className: styles.ganttTable_Header,
271
+ style: {
272
+ height: headerHeight - 2
273
+ }
274
+ }, React__default.createElement("div", {
275
+ className: styles.ganttTable_HeaderItem,
276
+ style: {
277
+ minWidth: rowWidth
278
+ }
279
+ }, "\xA0Wbs"), React__default.createElement("div", {
280
+ className: styles.ganttTable_HeaderSeparator,
281
+ style: {
282
+ height: headerHeight * 0.5,
283
+ marginTop: headerHeight * 0.2
284
+ }
285
+ }), React__default.createElement("div", {
286
+ className: styles.ganttTable_HeaderItem,
287
+ style: {
288
+ minWidth: rowWidth
289
+ }
290
+ }, "\xA0Name"), React__default.createElement("div", {
291
+ className: styles.ganttTable_HeaderSeparator,
292
+ style: {
293
+ height: headerHeight * 0.5,
294
+ marginTop: headerHeight * 0.2
295
+ }
296
+ }), React__default.createElement("div", {
297
+ className: styles.ganttTable_HeaderItem,
298
+ style: {
299
+ minWidth: rowWidth
300
+ }
301
+ }, "\xA0From"), React__default.createElement("div", {
302
+ className: styles.ganttTable_HeaderSeparator,
303
+ style: {
304
+ height: headerHeight * 0.5,
305
+ marginTop: headerHeight * 0.25
306
+ }
307
+ }), React__default.createElement("div", {
308
+ className: styles.ganttTable_HeaderItem,
309
+ style: {
310
+ minWidth: rowWidth
311
+ }
312
+ }, "\xA0To")));
313
+ };
314
+
315
+ var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListEmptyExpander":"_2TfEi"};
316
+
317
+ var localeDateStringCache = {};
318
+
319
+ var toLocaleDateStringFactory = function toLocaleDateStringFactory(locale) {
320
+ return function (date, dateTimeOptions) {
321
+ var key = date.toString();
322
+ var lds = localeDateStringCache[key];
323
+
324
+ if (!lds) {
325
+ lds = date.toLocaleDateString(locale, dateTimeOptions);
326
+ localeDateStringCache[key] = lds;
327
+ }
328
+
329
+ return lds;
330
+ };
331
+ };
332
+
333
+ var dateTimeOptions = {
334
+ weekday: "short",
335
+ year: "numeric",
336
+ month: "long",
337
+ day: "numeric"
338
+ };
339
+ var TaskListTableDefault = function TaskListTableDefault(_ref) {
340
+ var rowHeight = _ref.rowHeight,
341
+ rowWidth = _ref.rowWidth,
342
+ tasks = _ref.tasks,
343
+ fontFamily = _ref.fontFamily,
344
+ fontSize = _ref.fontSize,
345
+ locale = _ref.locale,
346
+ onExpanderClick = _ref.onExpanderClick;
347
+ var toLocaleDateString = React.useMemo(function () {
348
+ return toLocaleDateStringFactory(locale);
349
+ }, [locale]);
350
+ return React__default.createElement("div", {
351
+ className: styles$1.taskListWrapper,
352
+ style: {
353
+ fontFamily: fontFamily,
354
+ fontSize: fontSize
355
+ }
356
+ }, tasks.map(function (t) {
357
+ var expanderSymbol = "";
358
+
359
+ if (t.hideChildren === false) {
360
+ expanderSymbol = "▼";
361
+ } else if (t.hideChildren === true) {
362
+ expanderSymbol = "▶";
363
+ }
364
+
365
+ return React__default.createElement("div", {
366
+ className: styles$1.taskListTableRow,
367
+ style: {
368
+ height: rowHeight
369
+ },
370
+ key: t.id + "row"
371
+ }, React__default.createElement("div", {
372
+ className: styles$1.taskListCell,
373
+ style: {
374
+ minWidth: rowWidth,
375
+ maxWidth: rowWidth
376
+ },
377
+ title: t.id
378
+ }, React__default.createElement("div", {
379
+ className: styles$1.taskListNameWrapper
380
+ }, React__default.createElement("div", {
381
+ className: styles$1.taskListExpander,
382
+ onClick: function onClick() {
383
+ return onExpanderClick(t);
384
+ }
385
+ }, expanderSymbol), React__default.createElement("div", null, t.id))), React__default.createElement("div", {
386
+ className: styles$1.taskListCell,
387
+ style: {
388
+ minWidth: rowWidth,
389
+ maxWidth: rowWidth
390
+ }
391
+ }, "\xA0", t.name), React__default.createElement("div", {
392
+ className: styles$1.taskListCell,
393
+ style: {
394
+ minWidth: rowWidth,
395
+ maxWidth: rowWidth
396
+ }
397
+ }, "\xA0", toLocaleDateString(t.start, dateTimeOptions)), React__default.createElement("div", {
398
+ className: styles$1.taskListCell,
399
+ style: {
400
+ minWidth: rowWidth,
401
+ maxWidth: rowWidth
402
+ }
403
+ }, "\xA0", toLocaleDateString(t.end, dateTimeOptions)));
404
+ }));
405
+ };
406
+
407
+ var styles$2 = {"tooltipDefaultContainer":"_3T42e","tooltipDefaultContainerParagraph":"_29NTg","tooltipDetailsContainer":"_25P-K","tooltipDetailsContainerHidden":"_3gVAq"};
408
+
409
+ var Tooltip = function Tooltip(_ref) {
410
+ var task = _ref.task,
411
+ rowHeight = _ref.rowHeight,
412
+ rtl = _ref.rtl,
413
+ svgContainerHeight = _ref.svgContainerHeight,
414
+ svgContainerWidth = _ref.svgContainerWidth,
415
+ scrollX = _ref.scrollX,
416
+ scrollY = _ref.scrollY,
417
+ arrowIndent = _ref.arrowIndent,
418
+ fontSize = _ref.fontSize,
419
+ fontFamily = _ref.fontFamily,
420
+ headerHeight = _ref.headerHeight,
421
+ taskListWidth = _ref.taskListWidth,
422
+ TooltipContent = _ref.TooltipContent;
423
+ var tooltipRef = React.useRef(null);
424
+
425
+ var _useState = React.useState(0),
426
+ relatedY = _useState[0],
427
+ setRelatedY = _useState[1];
428
+
429
+ var _useState2 = React.useState(0),
430
+ relatedX = _useState2[0],
431
+ setRelatedX = _useState2[1];
432
+
433
+ React.useEffect(function () {
434
+ if (tooltipRef.current) {
435
+ var tooltipHeight = tooltipRef.current.offsetHeight * 1.1;
436
+ var tooltipWidth = tooltipRef.current.offsetWidth * 1.1;
437
+ var newRelatedY = task.index * rowHeight - scrollY + headerHeight;
438
+ var newRelatedX;
439
+
440
+ if (rtl) {
441
+ newRelatedX = task.x1 - arrowIndent * 1.5 - tooltipWidth - scrollX;
442
+
443
+ if (newRelatedX < 0) {
444
+ newRelatedX = task.x2 + arrowIndent * 1.5 - scrollX;
445
+ }
446
+
447
+ var tooltipLeftmostPoint = tooltipWidth + newRelatedX;
448
+
449
+ if (tooltipLeftmostPoint > svgContainerWidth) {
450
+ newRelatedX = svgContainerWidth - tooltipWidth;
451
+ newRelatedY += rowHeight;
452
+ }
453
+ } else {
454
+ newRelatedX = task.x2 + arrowIndent * 1.5 + taskListWidth - scrollX;
455
+
456
+ var _tooltipLeftmostPoint = tooltipWidth + newRelatedX;
457
+
458
+ var fullChartWidth = taskListWidth + svgContainerWidth;
459
+
460
+ if (_tooltipLeftmostPoint > fullChartWidth) {
461
+ newRelatedX = task.x1 + taskListWidth - arrowIndent * 1.5 - scrollX - tooltipWidth;
462
+ }
463
+
464
+ if (newRelatedX < taskListWidth) {
465
+ newRelatedX = svgContainerWidth + taskListWidth - tooltipWidth;
466
+ newRelatedY += rowHeight;
467
+ }
468
+ }
469
+
470
+ var tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;
471
+
472
+ if (tooltipLowerPoint > svgContainerHeight - scrollY) {
473
+ newRelatedY = svgContainerHeight - tooltipHeight;
474
+ }
475
+
476
+ setRelatedY(newRelatedY);
477
+ setRelatedX(newRelatedX);
478
+ }
479
+ }, [tooltipRef, task, arrowIndent, scrollX, scrollY, headerHeight, taskListWidth, rowHeight, svgContainerHeight, svgContainerWidth, rtl]);
480
+ return React__default.createElement("div", {
481
+ ref: tooltipRef,
482
+ className: relatedX ? styles$2.tooltipDetailsContainer : styles$2.tooltipDetailsContainerHidden,
483
+ style: {
484
+ left: relatedX,
485
+ top: relatedY
486
+ }
487
+ }, React__default.createElement(TooltipContent, {
488
+ task: task,
489
+ fontSize: fontSize,
490
+ fontFamily: fontFamily
491
+ }));
492
+ };
493
+ var StandardTooltipContent = function StandardTooltipContent(_ref2) {
494
+ var task = _ref2.task,
495
+ fontSize = _ref2.fontSize,
496
+ fontFamily = _ref2.fontFamily;
497
+ var style = {
498
+ fontSize: fontSize,
499
+ fontFamily: fontFamily
500
+ };
501
+ return React__default.createElement("div", {
502
+ className: styles$2.tooltipDefaultContainer,
503
+ style: style
504
+ }, React__default.createElement("b", {
505
+ style: {
506
+ fontSize: fontSize + 6
507
+ }
508
+ }, task.name + ": " + task.start.getDate() + "-" + (task.start.getMonth() + 1) + "-" + task.start.getFullYear() + " - " + task.end.getDate() + "-" + (task.end.getMonth() + 1) + "-" + task.end.getFullYear()), task.end.getTime() - task.start.getTime() !== 0 && React__default.createElement("p", {
509
+ className: styles$2.tooltipDefaultContainerParagraph
510
+ }, "Duration: " + ~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24)) + " day(s)"), React__default.createElement("p", {
511
+ className: styles$2.tooltipDefaultContainerParagraph
512
+ }, !!task.progress && "Progress: " + task.progress + " %"));
513
+ };
514
+
515
+ var styles$3 = {"scroll":"_1eT-t"};
516
+
517
+ var VerticalScroll = function VerticalScroll(_ref) {
518
+ var scroll = _ref.scroll,
519
+ ganttHeight = _ref.ganttHeight,
520
+ ganttFullHeight = _ref.ganttFullHeight,
521
+ headerHeight = _ref.headerHeight,
522
+ rtl = _ref.rtl,
523
+ onScroll = _ref.onScroll;
524
+ var scrollRef = React.useRef(null);
525
+ React.useEffect(function () {
526
+ if (scrollRef.current) {
527
+ scrollRef.current.scrollTop = scroll;
528
+ }
529
+ }, [scroll]);
530
+ return React__default.createElement("div", {
531
+ style: {
532
+ height: ganttHeight,
533
+ marginTop: headerHeight,
534
+ marginLeft: rtl ? "" : "-1rem"
535
+ },
536
+ className: styles$3.scroll,
537
+ onScroll: onScroll,
538
+ ref: scrollRef
539
+ }, React__default.createElement("div", {
540
+ style: {
541
+ height: ganttFullHeight,
542
+ width: 1
543
+ }
544
+ }));
545
+ };
546
+
547
+ var TaskList = function TaskList(_ref) {
548
+ var headerHeight = _ref.headerHeight,
549
+ fontFamily = _ref.fontFamily,
550
+ fontSize = _ref.fontSize,
551
+ rowWidth = _ref.rowWidth,
552
+ rowHeight = _ref.rowHeight,
553
+ scrollY = _ref.scrollY,
554
+ tasks = _ref.tasks,
555
+ selectedTask = _ref.selectedTask,
556
+ setSelectedTask = _ref.setSelectedTask,
557
+ onExpanderClick = _ref.onExpanderClick,
558
+ locale = _ref.locale,
559
+ ganttHeight = _ref.ganttHeight,
560
+ taskListRef = _ref.taskListRef,
561
+ horizontalContainerClass = _ref.horizontalContainerClass,
562
+ TaskListHeader = _ref.TaskListHeader,
563
+ TaskListTable = _ref.TaskListTable;
564
+ var horizontalContainerRef = React.useRef(null);
565
+ React.useEffect(function () {
566
+ if (horizontalContainerRef.current) {
567
+ horizontalContainerRef.current.scrollTop = scrollY;
568
+ }
569
+ }, [scrollY]);
570
+ var headerProps = {
571
+ headerHeight: headerHeight,
572
+ fontFamily: fontFamily,
573
+ fontSize: fontSize,
574
+ rowWidth: rowWidth
575
+ };
576
+ var selectedTaskId = selectedTask ? selectedTask.id : "";
577
+ var tableProps = {
578
+ rowHeight: rowHeight,
579
+ rowWidth: rowWidth,
580
+ fontFamily: fontFamily,
581
+ fontSize: fontSize,
582
+ tasks: tasks,
583
+ locale: locale,
584
+ selectedTaskId: selectedTaskId,
585
+ setSelectedTask: setSelectedTask,
586
+ onExpanderClick: onExpanderClick
587
+ };
588
+ return React__default.createElement("div", {
589
+ ref: taskListRef
590
+ }, React__default.createElement(TaskListHeader, Object.assign({}, headerProps)), React__default.createElement("div", {
591
+ ref: horizontalContainerRef,
592
+ className: horizontalContainerClass,
593
+ style: ganttHeight ? {
594
+ height: ganttHeight
595
+ } : {}
596
+ }, React__default.createElement(TaskListTable, Object.assign({}, tableProps))));
597
+ };
598
+
599
+ var styles$4 = {"gridRow":"_2dZTy","gridRowLine":"_3rUKi","gridTick":"_RuwuK"};
600
+
601
+ var GridBody = function GridBody(_ref) {
602
+ var tasks = _ref.tasks,
603
+ dates = _ref.dates,
604
+ rowHeight = _ref.rowHeight,
605
+ svgWidth = _ref.svgWidth,
606
+ columnWidth = _ref.columnWidth,
607
+ todayColor = _ref.todayColor,
608
+ rtl = _ref.rtl;
609
+ var y = 0;
610
+ var gridRows = [];
611
+ var rowLines = [React__default.createElement("line", {
612
+ key: "RowLineFirst",
613
+ x: "0",
614
+ y1: 0,
615
+ x2: svgWidth,
616
+ y2: 0,
617
+ className: styles$4.gridRowLine
618
+ })];
619
+
620
+ for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
621
+ var task = _step.value;
622
+ gridRows.push(React__default.createElement("rect", {
623
+ key: "Row" + task.id,
624
+ x: "0",
625
+ y: y,
626
+ width: svgWidth,
627
+ height: rowHeight,
628
+ className: styles$4.gridRow
629
+ }));
630
+ rowLines.push(React__default.createElement("line", {
631
+ key: "RowLine" + task.id,
632
+ x: "0",
633
+ y1: y + rowHeight,
634
+ x2: svgWidth,
635
+ y2: y + rowHeight,
636
+ className: styles$4.gridRowLine
637
+ }));
638
+ y += rowHeight;
639
+ }
640
+
641
+ var now = new Date();
642
+ var tickX = 0;
643
+ var ticks = [];
644
+ var today = React__default.createElement("rect", null);
645
+
646
+ for (var i = 0; i < dates.length; i++) {
647
+ var date = dates[i];
648
+ ticks.push(React__default.createElement("line", {
649
+ key: date.getTime(),
650
+ x1: tickX,
651
+ y1: 0,
652
+ x2: tickX,
653
+ y2: y,
654
+ className: styles$4.gridTick
655
+ }));
656
+
657
+ if (i + 1 !== dates.length && date.getTime() < now.getTime() && dates[i + 1].getTime() >= now.getTime() || i !== 0 && i + 1 === dates.length && date.getTime() < now.getTime() && addToDate(date, date.getTime() - dates[i - 1].getTime(), "millisecond").getTime() >= now.getTime()) {
658
+ today = React__default.createElement("rect", {
659
+ x: tickX,
660
+ y: 0,
661
+ width: columnWidth,
662
+ height: y,
663
+ fill: todayColor
664
+ });
665
+ }
666
+
667
+ if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
668
+ today = React__default.createElement("rect", {
669
+ x: tickX + columnWidth,
670
+ y: 0,
671
+ width: columnWidth,
672
+ height: y,
673
+ fill: todayColor
674
+ });
675
+ }
676
+
677
+ tickX += columnWidth;
678
+ }
679
+
680
+ return React__default.createElement("g", {
681
+ className: "gridBody"
682
+ }, React__default.createElement("g", {
683
+ className: "rows"
684
+ }, gridRows), React__default.createElement("g", {
685
+ className: "rowLines"
686
+ }, rowLines), React__default.createElement("g", {
687
+ className: "ticks"
688
+ }, ticks), React__default.createElement("g", {
689
+ className: "today"
690
+ }, today));
691
+ };
692
+
693
+ var Grid = function Grid(props) {
694
+ return React__default.createElement("g", {
695
+ className: "grid"
696
+ }, React__default.createElement(GridBody, Object.assign({}, props)));
697
+ };
698
+
699
+ var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX"};
700
+
701
+ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
702
+ var value = _ref.value,
703
+ x1Line = _ref.x1Line,
704
+ y1Line = _ref.y1Line,
705
+ y2Line = _ref.y2Line,
706
+ xText = _ref.xText,
707
+ yText = _ref.yText;
708
+ return React__default.createElement("g", {
709
+ className: "calendarTop"
710
+ }, React__default.createElement("line", {
711
+ x1: x1Line,
712
+ y1: y1Line,
713
+ x2: x1Line,
714
+ y2: y2Line,
715
+ className: styles$5.calendarTopTick,
716
+ key: value + "line"
717
+ }), React__default.createElement("text", {
718
+ key: value + "text",
719
+ y: yText,
720
+ x: xText,
721
+ className: styles$5.calendarTopText
722
+ }, value));
723
+ };
724
+
725
+ var Calendar = function Calendar(_ref) {
726
+ var dateSetup = _ref.dateSetup,
727
+ locale = _ref.locale,
728
+ viewMode = _ref.viewMode,
729
+ rtl = _ref.rtl,
730
+ headerHeight = _ref.headerHeight,
731
+ columnWidth = _ref.columnWidth,
732
+ fontFamily = _ref.fontFamily,
733
+ fontSize = _ref.fontSize;
734
+
735
+ var getCalendarValuesForYear = function getCalendarValuesForYear() {
736
+ var topValues = [];
737
+ var bottomValues = [];
738
+ var topDefaultHeight = headerHeight * 0.5;
739
+
740
+ for (var i = 0; i < dateSetup.dates.length; i++) {
741
+ var date = dateSetup.dates[i];
742
+ var bottomValue = date.getFullYear();
743
+ bottomValues.push(React__default.createElement("text", {
744
+ key: date.getFullYear(),
745
+ y: headerHeight * 0.8,
746
+ x: columnWidth * i + columnWidth * 0.5,
747
+ className: styles$5.calendarBottomText
748
+ }, bottomValue));
749
+
750
+ if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
751
+ var topValue = date.getFullYear().toString();
752
+ var xText = void 0;
753
+
754
+ if (rtl) {
755
+ xText = (6 + i + date.getFullYear() + 1) * columnWidth;
756
+ } else {
757
+ xText = (6 + i - date.getFullYear()) * columnWidth;
758
+ }
759
+
760
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
761
+ key: topValue,
762
+ value: topValue,
763
+ x1Line: columnWidth * i,
764
+ y1Line: 0,
765
+ y2Line: headerHeight,
766
+ xText: xText,
767
+ yText: topDefaultHeight * 0.9
768
+ }));
769
+ }
770
+ }
771
+
772
+ return [topValues, bottomValues];
773
+ };
774
+
775
+ var getCalendarValuesForMonth = function getCalendarValuesForMonth() {
776
+ var topValues = [];
777
+ var bottomValues = [];
778
+ var topDefaultHeight = headerHeight * 0.5;
779
+
780
+ for (var i = 0; i < dateSetup.dates.length; i++) {
781
+ var date = dateSetup.dates[i];
782
+ var bottomValue = getLocaleMonth(date, locale);
783
+ bottomValues.push(React__default.createElement("text", {
784
+ key: bottomValue + date.getFullYear(),
785
+ y: headerHeight * 0.8,
786
+ x: columnWidth * i + columnWidth * 0.5,
787
+ className: styles$5.calendarBottomText
788
+ }, bottomValue));
789
+
790
+ if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
791
+ var topValue = date.getFullYear().toString();
792
+ var xText = void 0;
793
+
794
+ if (rtl) {
795
+ xText = (6 + i + date.getMonth() + 1) * columnWidth;
796
+ } else {
797
+ xText = (6 + i - date.getMonth()) * columnWidth;
798
+ }
799
+
800
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
801
+ key: topValue,
802
+ value: topValue,
803
+ x1Line: columnWidth * i,
804
+ y1Line: 0,
805
+ y2Line: topDefaultHeight,
806
+ xText: xText,
807
+ yText: topDefaultHeight * 0.9
808
+ }));
809
+ }
810
+ }
811
+
812
+ return [topValues, bottomValues];
813
+ };
814
+
815
+ var getCalendarValuesForWeek = function getCalendarValuesForWeek() {
816
+ var topValues = [];
817
+ var bottomValues = [];
818
+ var weeksCount = 1;
819
+ var topDefaultHeight = headerHeight * 0.5;
820
+ var dates = dateSetup.dates;
821
+
822
+ for (var i = dates.length - 1; i >= 0; i--) {
823
+ var date = dates[i];
824
+ var topValue = "";
825
+
826
+ if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
827
+ topValue = getLocaleMonth(date, locale) + ", " + date.getFullYear();
828
+ }
829
+
830
+ var bottomValue = "W" + getWeekNumberISO8601(date);
831
+ bottomValues.push(React__default.createElement("text", {
832
+ key: date.getTime(),
833
+ y: headerHeight * 0.8,
834
+ x: columnWidth * (i + +rtl),
835
+ className: styles$5.calendarBottomText
836
+ }, bottomValue));
837
+
838
+ if (topValue) {
839
+ if (i !== dates.length - 1) {
840
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
841
+ key: topValue,
842
+ value: topValue,
843
+ x1Line: columnWidth * i + weeksCount * columnWidth,
844
+ y1Line: 0,
845
+ y2Line: topDefaultHeight,
846
+ xText: columnWidth * i + columnWidth * weeksCount * 0.5,
847
+ yText: topDefaultHeight * 0.9
848
+ }));
849
+ }
850
+
851
+ weeksCount = 0;
852
+ }
853
+
854
+ weeksCount++;
855
+ }
856
+
857
+ return [topValues, bottomValues];
858
+ };
859
+
860
+ var getCalendarValuesForDay = function getCalendarValuesForDay() {
861
+ var topValues = [];
862
+ var bottomValues = [];
863
+ var topDefaultHeight = headerHeight * 0.5;
864
+ var dates = dateSetup.dates;
865
+
866
+ for (var i = 0; i < dates.length; i++) {
867
+ var date = dates[i];
868
+ var bottomValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
869
+ bottomValues.push(React__default.createElement("text", {
870
+ key: date.getTime(),
871
+ y: headerHeight * 0.8,
872
+ x: columnWidth * i + columnWidth * 0.5,
873
+ className: styles$5.calendarBottomText
874
+ }, bottomValue));
875
+
876
+ if (i + 1 !== dates.length && date.getMonth() !== dates[i + 1].getMonth()) {
877
+ var topValue = getLocaleMonth(date, locale);
878
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
879
+ key: topValue + date.getFullYear(),
880
+ value: topValue,
881
+ x1Line: columnWidth * (i + 1),
882
+ y1Line: 0,
883
+ y2Line: topDefaultHeight,
884
+ xText: columnWidth * (i + 1) - getDaysInMonth(date.getMonth(), date.getFullYear()) * columnWidth * 0.5,
885
+ yText: topDefaultHeight * 0.9
886
+ }));
887
+ }
888
+ }
889
+
890
+ return [topValues, bottomValues];
891
+ };
892
+
893
+ var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
894
+ var topValues = [];
895
+ var bottomValues = [];
896
+ var ticks = viewMode === exports.ViewMode.HalfDay ? 2 : 4;
897
+ var topDefaultHeight = headerHeight * 0.5;
898
+ var dates = dateSetup.dates;
899
+
900
+ for (var i = 0; i < dates.length; i++) {
901
+ var date = dates[i];
902
+ var bottomValue = getCachedDateTimeFormat(locale, {
903
+ hour: "numeric"
904
+ }).format(date);
905
+ bottomValues.push(React__default.createElement("text", {
906
+ key: date.getTime(),
907
+ y: headerHeight * 0.8,
908
+ x: columnWidth * (i + +rtl),
909
+ className: styles$5.calendarBottomText,
910
+ fontFamily: fontFamily
911
+ }, bottomValue));
912
+
913
+ if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
914
+ var topValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
915
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
916
+ key: topValue + date.getFullYear(),
917
+ value: topValue,
918
+ x1Line: columnWidth * i + ticks * columnWidth,
919
+ y1Line: 0,
920
+ y2Line: topDefaultHeight,
921
+ xText: columnWidth * i + ticks * columnWidth * 0.5,
922
+ yText: topDefaultHeight * 0.9
923
+ }));
924
+ }
925
+ }
926
+
927
+ return [topValues, bottomValues];
928
+ };
929
+
930
+ var getCalendarValuesForHour = function getCalendarValuesForHour() {
931
+ var topValues = [];
932
+ var bottomValues = [];
933
+ var topDefaultHeight = headerHeight * 0.5;
934
+ var dates = dateSetup.dates;
935
+
936
+ for (var i = 0; i < dates.length; i++) {
937
+ var date = dates[i];
938
+ var bottomValue = getCachedDateTimeFormat(locale, {
939
+ hour: "numeric"
940
+ }).format(date);
941
+ bottomValues.push(React__default.createElement("text", {
942
+ key: date.getTime(),
943
+ y: headerHeight * 0.8,
944
+ x: columnWidth * (i + +rtl),
945
+ className: styles$5.calendarBottomText,
946
+ fontFamily: fontFamily
947
+ }, bottomValue));
948
+
949
+ if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
950
+ var displayDate = dates[i - 1];
951
+ var topValue = getLocalDayOfWeek(displayDate, locale, "long") + ", " + displayDate.getDate() + " " + getLocaleMonth(displayDate, locale);
952
+ var topPosition = (date.getHours() - 24) / 2;
953
+ topValues.push(React__default.createElement(TopPartOfCalendar, {
954
+ key: topValue + displayDate.getFullYear(),
955
+ value: topValue,
956
+ x1Line: columnWidth * i,
957
+ y1Line: 0,
958
+ y2Line: topDefaultHeight,
959
+ xText: columnWidth * (i + topPosition),
960
+ yText: topDefaultHeight * 0.9
961
+ }));
962
+ }
963
+ }
964
+
965
+ return [topValues, bottomValues];
966
+ };
967
+
968
+ var topValues = [];
969
+ var bottomValues = [];
970
+
971
+ switch (dateSetup.viewMode) {
972
+ case exports.ViewMode.Year:
973
+ var _getCalendarValuesFor = getCalendarValuesForYear();
974
+
975
+ topValues = _getCalendarValuesFor[0];
976
+ bottomValues = _getCalendarValuesFor[1];
977
+ break;
978
+
979
+ case exports.ViewMode.Month:
980
+ var _getCalendarValuesFor2 = getCalendarValuesForMonth();
981
+
982
+ topValues = _getCalendarValuesFor2[0];
983
+ bottomValues = _getCalendarValuesFor2[1];
984
+ break;
985
+
986
+ case exports.ViewMode.Week:
987
+ var _getCalendarValuesFor3 = getCalendarValuesForWeek();
988
+
989
+ topValues = _getCalendarValuesFor3[0];
990
+ bottomValues = _getCalendarValuesFor3[1];
991
+ break;
992
+
993
+ case exports.ViewMode.Day:
994
+ var _getCalendarValuesFor4 = getCalendarValuesForDay();
995
+
996
+ topValues = _getCalendarValuesFor4[0];
997
+ bottomValues = _getCalendarValuesFor4[1];
998
+ break;
999
+
1000
+ case exports.ViewMode.QuarterDay:
1001
+ case exports.ViewMode.HalfDay:
1002
+ var _getCalendarValuesFor5 = getCalendarValuesForPartOfDay();
1003
+
1004
+ topValues = _getCalendarValuesFor5[0];
1005
+ bottomValues = _getCalendarValuesFor5[1];
1006
+ break;
1007
+
1008
+ case exports.ViewMode.Hour:
1009
+ var _getCalendarValuesFor6 = getCalendarValuesForHour();
1010
+
1011
+ topValues = _getCalendarValuesFor6[0];
1012
+ bottomValues = _getCalendarValuesFor6[1];
1013
+ }
1014
+
1015
+ return React__default.createElement("g", {
1016
+ className: "calendar",
1017
+ fontSize: fontSize,
1018
+ fontFamily: fontFamily
1019
+ }, React__default.createElement("rect", {
1020
+ x: 0,
1021
+ y: 0,
1022
+ width: columnWidth * dateSetup.dates.length,
1023
+ height: headerHeight,
1024
+ className: styles$5.calendarHeader
1025
+ }), bottomValues, " ", topValues);
1026
+ };
1027
+
1028
+ // A type of promise-like that resolves synchronously and supports only one observer
1029
+
1030
+ const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
1031
+
1032
+ const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
1033
+
1034
+ // Asynchronously call a function and send errors to recovery continuation
1035
+ function _catch(body, recover) {
1036
+ try {
1037
+ var result = body();
1038
+ } catch(e) {
1039
+ return recover(e);
1040
+ }
1041
+ if (result && result.then) {
1042
+ return result.then(void 0, recover);
1043
+ }
1044
+ return result;
1045
+ }
1046
+
1047
+ var Arrow = function Arrow(_ref) {
1048
+ var taskFrom = _ref.taskFrom,
1049
+ taskTo = _ref.taskTo,
1050
+ rowHeight = _ref.rowHeight,
1051
+ taskHeight = _ref.taskHeight,
1052
+ arrowIndent = _ref.arrowIndent,
1053
+ rtl = _ref.rtl;
1054
+ var path;
1055
+ var trianglePoints;
1056
+
1057
+ if (rtl) {
1058
+ var _drownPathAndTriangle = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1059
+
1060
+ path = _drownPathAndTriangle[0];
1061
+ trianglePoints = _drownPathAndTriangle[1];
1062
+ } else {
1063
+ var _drownPathAndTriangle2 = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1064
+
1065
+ path = _drownPathAndTriangle2[0];
1066
+ trianglePoints = _drownPathAndTriangle2[1];
1067
+ }
1068
+
1069
+ return React__default.createElement("g", {
1070
+ className: "arrow"
1071
+ }, React__default.createElement("path", {
1072
+ strokeWidth: "1.5",
1073
+ d: path,
1074
+ fill: "none"
1075
+ }), React__default.createElement("polygon", {
1076
+ points: trianglePoints
1077
+ }));
1078
+ };
1079
+
1080
+ var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1081
+ var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1082
+ var taskToEndPosition = taskTo.y + taskHeight / 2;
1083
+ var taskFromEndPosition = taskFrom.x2 + arrowIndent * 2;
1084
+ var taskFromHorizontalOffsetValue = taskFromEndPosition < taskTo.x1 ? "" : "H " + (taskTo.x1 - arrowIndent);
1085
+ var taskToHorizontalOffsetValue = taskFromEndPosition > taskTo.x1 ? arrowIndent : taskTo.x1 - taskFrom.x2 - arrowIndent;
1086
+ var path = "M " + taskFrom.x2 + " " + (taskFrom.y + taskHeight / 2) + " \n h " + arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1087
+ var trianglePoints = taskTo.x1 + "," + taskToEndPosition + " \n " + (taskTo.x1 - 5) + "," + (taskToEndPosition - 5) + " \n " + (taskTo.x1 - 5) + "," + (taskToEndPosition + 5);
1088
+ return [path, trianglePoints];
1089
+ };
1090
+
1091
+ var drownPathAndTriangleRTL = function drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1092
+ var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1093
+ var taskToEndPosition = taskTo.y + taskHeight / 2;
1094
+ var taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1095
+ var taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : "H " + (taskTo.x2 + arrowIndent);
1096
+ var taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1097
+ var path = "M " + taskFrom.x1 + " " + (taskFrom.y + taskHeight / 2) + " \n h " + -arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1098
+ var trianglePoints = taskTo.x2 + "," + taskToEndPosition + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition + 5) + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition - 5);
1099
+ return [path, trianglePoints];
1100
+ };
1101
+
1102
+ var convertToBarTasks = function convertToBarTasks(tasks, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1103
+ var barTasks = tasks.map(function (t, i) {
1104
+ return convertToBarTask(t, i, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor);
1105
+ });
1106
+ barTasks = barTasks.map(function (task) {
1107
+ var dependencies = task.dependencies || [];
1108
+
1109
+ var _loop = function _loop(j) {
1110
+ var dependence = barTasks.findIndex(function (value) {
1111
+ return value.id === dependencies[j];
1112
+ });
1113
+ if (dependence !== -1) barTasks[dependence].barChildren.push(task);
1114
+ };
1115
+
1116
+ for (var j = 0; j < dependencies.length; j++) {
1117
+ _loop(j);
1118
+ }
1119
+
1120
+ return task;
1121
+ });
1122
+ return barTasks;
1123
+ };
1124
+
1125
+ var convertToBarTask = function convertToBarTask(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1126
+ var barTask;
1127
+
1128
+ switch (task.type) {
1129
+ case "milestone":
1130
+ barTask = convertToMilestone(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor);
1131
+ break;
1132
+
1133
+ case "project":
1134
+ barTask = convertToBar(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor);
1135
+ break;
1136
+
1137
+ default:
1138
+ barTask = convertToBar(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor);
1139
+ break;
1140
+ }
1141
+
1142
+ return barTask;
1143
+ };
1144
+
1145
+ var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) {
1146
+ var x1;
1147
+ var x2;
1148
+
1149
+ if (rtl) {
1150
+ x2 = taskXCoordinateRTL(task.start, dates, columnWidth);
1151
+ x1 = taskXCoordinateRTL(task.end, dates, columnWidth);
1152
+ } else {
1153
+ x1 = taskXCoordinate(task.start, dates, columnWidth);
1154
+ x2 = taskXCoordinate(task.end, dates, columnWidth);
1155
+ }
1156
+
1157
+ var typeInternal = task.type;
1158
+
1159
+ if (typeInternal === "task" && x2 - x1 < handleWidth * 2) {
1160
+ typeInternal = "smalltask";
1161
+ x2 = x1 + handleWidth * 2;
1162
+ }
1163
+
1164
+ var _progressWithByParams = progressWithByParams(x1, x2, task.progress, rtl),
1165
+ progressWidth = _progressWithByParams[0],
1166
+ progressX = _progressWithByParams[1];
1167
+
1168
+ var y = taskYCoordinate(index, rowHeight, taskHeight);
1169
+ var hideChildren = task.hideChildren || false;
1170
+
1171
+ var styles = _extends({
1172
+ backgroundColor: barBackgroundColor,
1173
+ backgroundSelectedColor: barBackgroundSelectedColor,
1174
+ progressColor: barProgressColor,
1175
+ progressSelectedColor: barProgressSelectedColor
1176
+ }, task.styles);
1177
+
1178
+ return _extends({}, task, {
1179
+ typeInternal: typeInternal,
1180
+ x1: x1,
1181
+ x2: x2,
1182
+ y: y,
1183
+ index: index,
1184
+ progressX: progressX,
1185
+ progressWidth: progressWidth,
1186
+ barCornerRadius: barCornerRadius,
1187
+ handleWidth: handleWidth,
1188
+ hideChildren: hideChildren,
1189
+ height: taskHeight,
1190
+ barChildren: [],
1191
+ styles: styles
1192
+ });
1193
+ };
1194
+
1195
+ var convertToMilestone = function convertToMilestone(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1196
+ var x = taskXCoordinate(task.start, dates, columnWidth);
1197
+ var y = taskYCoordinate(index, rowHeight, taskHeight);
1198
+ var x1 = x - taskHeight * 0.5;
1199
+ var x2 = x + taskHeight * 0.5;
1200
+ var rotatedHeight = taskHeight / 1.414;
1201
+
1202
+ var styles = _extends({
1203
+ backgroundColor: milestoneBackgroundColor,
1204
+ backgroundSelectedColor: milestoneBackgroundSelectedColor,
1205
+ progressColor: "",
1206
+ progressSelectedColor: ""
1207
+ }, task.styles);
1208
+
1209
+ return _extends({}, task, {
1210
+ end: task.start,
1211
+ x1: x1,
1212
+ x2: x2,
1213
+ y: y,
1214
+ index: index,
1215
+ progressX: 0,
1216
+ progressWidth: 0,
1217
+ barCornerRadius: barCornerRadius,
1218
+ handleWidth: handleWidth,
1219
+ typeInternal: task.type,
1220
+ progress: 0,
1221
+ height: rotatedHeight,
1222
+ hideChildren: undefined,
1223
+ barChildren: [],
1224
+ styles: styles
1225
+ });
1226
+ };
1227
+
1228
+ var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
1229
+ var index = dates.findIndex(function (d) {
1230
+ return d.getTime() >= xDate.getTime();
1231
+ }) - 1;
1232
+ var remainderMillis = xDate.getTime() - dates[index].getTime();
1233
+ var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
1234
+ var x = index * columnWidth + percentOfInterval * columnWidth;
1235
+ return x;
1236
+ };
1237
+
1238
+ var taskXCoordinateRTL = function taskXCoordinateRTL(xDate, dates, columnWidth) {
1239
+ var x = taskXCoordinate(xDate, dates, columnWidth);
1240
+ x += columnWidth;
1241
+ return x;
1242
+ };
1243
+
1244
+ var taskYCoordinate = function taskYCoordinate(index, rowHeight, taskHeight) {
1245
+ var y = index * rowHeight + (rowHeight - taskHeight) / 2;
1246
+ return y;
1247
+ };
1248
+
1249
+ var progressWithByParams = function progressWithByParams(taskX1, taskX2, progress, rtl) {
1250
+ var progressWidth = (taskX2 - taskX1) * progress * 0.01;
1251
+ var progressX;
1252
+
1253
+ if (rtl) {
1254
+ progressX = taskX2 - progressWidth;
1255
+ } else {
1256
+ progressX = taskX1;
1257
+ }
1258
+
1259
+ return [progressWidth, progressX];
1260
+ };
1261
+
1262
+ var progressByX = function progressByX(x, task) {
1263
+ if (x >= task.x2) return 100;else if (x <= task.x1) return 0;else {
1264
+ var barWidth = task.x2 - task.x1;
1265
+ var progressPercent = Math.round((x - task.x1) * 100 / barWidth);
1266
+ return progressPercent;
1267
+ }
1268
+ };
1269
+
1270
+ var progressByXRTL = function progressByXRTL(x, task) {
1271
+ if (x >= task.x2) return 0;else if (x <= task.x1) return 100;else {
1272
+ var barWidth = task.x2 - task.x1;
1273
+ var progressPercent = Math.round((task.x2 - x) * 100 / barWidth);
1274
+ return progressPercent;
1275
+ }
1276
+ };
1277
+
1278
+ var getProgressPoint = function getProgressPoint(progressX, taskY, taskHeight) {
1279
+ var point = [progressX - 5, taskY + taskHeight, progressX + 5, taskY + taskHeight, progressX, taskY + taskHeight - 8.66];
1280
+ return point.join(",");
1281
+ };
1282
+
1283
+ var startByX = function startByX(x, xStep, task) {
1284
+ if (x >= task.x2 - task.handleWidth * 2) {
1285
+ x = task.x2 - task.handleWidth * 2;
1286
+ }
1287
+
1288
+ var steps = Math.round((x - task.x1) / xStep);
1289
+ var additionalXValue = steps * xStep;
1290
+ var newX = task.x1 + additionalXValue;
1291
+ return newX;
1292
+ };
1293
+
1294
+ var endByX = function endByX(x, xStep, task) {
1295
+ if (x <= task.x1 + task.handleWidth * 2) {
1296
+ x = task.x1 + task.handleWidth * 2;
1297
+ }
1298
+
1299
+ var steps = Math.round((x - task.x2) / xStep);
1300
+ var additionalXValue = steps * xStep;
1301
+ var newX = task.x2 + additionalXValue;
1302
+ return newX;
1303
+ };
1304
+
1305
+ var moveByX = function moveByX(x, xStep, task) {
1306
+ var steps = Math.round((x - task.x1) / xStep);
1307
+ var additionalXValue = steps * xStep;
1308
+ var newX1 = task.x1 + additionalXValue;
1309
+ var newX2 = newX1 + task.x2 - task.x1;
1310
+ return [newX1, newX2];
1311
+ };
1312
+
1313
+ var dateByX = function dateByX(x, taskX, taskDate, xStep, timeStep) {
1314
+ var newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
1315
+ newDate = new Date(newDate.getTime() + (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 60000);
1316
+ return newDate;
1317
+ };
1318
+
1319
+ var handleTaskBySVGMouseEvent = function handleTaskBySVGMouseEvent(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl) {
1320
+ var result;
1321
+
1322
+ switch (selectedTask.type) {
1323
+ case "milestone":
1324
+ result = handleTaskBySVGMouseEventForMilestone(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta);
1325
+ break;
1326
+
1327
+ default:
1328
+ result = handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl);
1329
+ break;
1330
+ }
1331
+
1332
+ return result;
1333
+ };
1334
+
1335
+ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta, rtl) {
1336
+ var changedTask = _extends({}, selectedTask);
1337
+
1338
+ var isChanged = false;
1339
+
1340
+ switch (action) {
1341
+ case "progress":
1342
+ if (rtl) {
1343
+ changedTask.progress = progressByXRTL(svgX, selectedTask);
1344
+ } else {
1345
+ changedTask.progress = progressByX(svgX, selectedTask);
1346
+ }
1347
+
1348
+ isChanged = changedTask.progress !== selectedTask.progress;
1349
+
1350
+ if (isChanged) {
1351
+ var _progressWithByParams2 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1352
+ progressWidth = _progressWithByParams2[0],
1353
+ progressX = _progressWithByParams2[1];
1354
+
1355
+ changedTask.progressWidth = progressWidth;
1356
+ changedTask.progressX = progressX;
1357
+ }
1358
+
1359
+ break;
1360
+
1361
+ case "start":
1362
+ {
1363
+ var newX1 = startByX(svgX, xStep, selectedTask);
1364
+ changedTask.x1 = newX1;
1365
+ isChanged = changedTask.x1 !== selectedTask.x1;
1366
+
1367
+ if (isChanged) {
1368
+ if (rtl) {
1369
+ changedTask.end = dateByX(newX1, selectedTask.x1, selectedTask.end, xStep, timeStep);
1370
+ } else {
1371
+ changedTask.start = dateByX(newX1, selectedTask.x1, selectedTask.start, xStep, timeStep);
1372
+ }
1373
+
1374
+ var _progressWithByParams3 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1375
+ _progressWidth = _progressWithByParams3[0],
1376
+ _progressX = _progressWithByParams3[1];
1377
+
1378
+ changedTask.progressWidth = _progressWidth;
1379
+ changedTask.progressX = _progressX;
1380
+ }
1381
+
1382
+ break;
1383
+ }
1384
+
1385
+ case "end":
1386
+ {
1387
+ var newX2 = endByX(svgX, xStep, selectedTask);
1388
+ changedTask.x2 = newX2;
1389
+ isChanged = changedTask.x2 !== selectedTask.x2;
1390
+
1391
+ if (isChanged) {
1392
+ if (rtl) {
1393
+ changedTask.start = dateByX(newX2, selectedTask.x2, selectedTask.start, xStep, timeStep);
1394
+ } else {
1395
+ changedTask.end = dateByX(newX2, selectedTask.x2, selectedTask.end, xStep, timeStep);
1396
+ }
1397
+
1398
+ var _progressWithByParams4 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1399
+ _progressWidth2 = _progressWithByParams4[0],
1400
+ _progressX2 = _progressWithByParams4[1];
1401
+
1402
+ changedTask.progressWidth = _progressWidth2;
1403
+ changedTask.progressX = _progressX2;
1404
+ }
1405
+
1406
+ break;
1407
+ }
1408
+
1409
+ case "move":
1410
+ {
1411
+ var _moveByX = moveByX(svgX - initEventX1Delta, xStep, selectedTask),
1412
+ newMoveX1 = _moveByX[0],
1413
+ newMoveX2 = _moveByX[1];
1414
+
1415
+ isChanged = newMoveX1 !== selectedTask.x1;
1416
+
1417
+ if (isChanged) {
1418
+ changedTask.start = dateByX(newMoveX1, selectedTask.x1, selectedTask.start, xStep, timeStep);
1419
+ changedTask.end = dateByX(newMoveX2, selectedTask.x2, selectedTask.end, xStep, timeStep);
1420
+ changedTask.x1 = newMoveX1;
1421
+ changedTask.x2 = newMoveX2;
1422
+
1423
+ var _progressWithByParams5 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1424
+ _progressWidth3 = _progressWithByParams5[0],
1425
+ _progressX3 = _progressWithByParams5[1];
1426
+
1427
+ changedTask.progressWidth = _progressWidth3;
1428
+ changedTask.progressX = _progressX3;
1429
+ }
1430
+
1431
+ break;
1432
+ }
1433
+ }
1434
+
1435
+ return {
1436
+ isChanged: isChanged,
1437
+ changedTask: changedTask
1438
+ };
1439
+ };
1440
+
1441
+ var handleTaskBySVGMouseEventForMilestone = function handleTaskBySVGMouseEventForMilestone(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta) {
1442
+ var changedTask = _extends({}, selectedTask);
1443
+
1444
+ var isChanged = false;
1445
+
1446
+ switch (action) {
1447
+ case "move":
1448
+ {
1449
+ var _moveByX2 = moveByX(svgX - initEventX1Delta, xStep, selectedTask),
1450
+ newMoveX1 = _moveByX2[0],
1451
+ newMoveX2 = _moveByX2[1];
1452
+
1453
+ isChanged = newMoveX1 !== selectedTask.x1;
1454
+
1455
+ if (isChanged) {
1456
+ changedTask.start = dateByX(newMoveX1, selectedTask.x1, selectedTask.start, xStep, timeStep);
1457
+ changedTask.end = changedTask.start;
1458
+ changedTask.x1 = newMoveX1;
1459
+ changedTask.x2 = newMoveX2;
1460
+ }
1461
+
1462
+ break;
1463
+ }
1464
+ }
1465
+
1466
+ return {
1467
+ isChanged: isChanged,
1468
+ changedTask: changedTask
1469
+ };
1470
+ };
1471
+
1472
+ function isKeyboardEvent(event) {
1473
+ return event.key !== undefined;
1474
+ }
1475
+ function removeHiddenTasks(tasks) {
1476
+ var groupedTasks = tasks.filter(function (t) {
1477
+ return t.hideChildren && t.type === "project";
1478
+ });
1479
+
1480
+ if (groupedTasks.length > 0) {
1481
+ var _loop = function _loop(i) {
1482
+ var groupedTask = groupedTasks[i];
1483
+ var children = getChildren(tasks, groupedTask);
1484
+ tasks = tasks.filter(function (t) {
1485
+ return children.indexOf(t) === -1;
1486
+ });
1487
+ };
1488
+
1489
+ for (var i = 0; groupedTasks.length > i; i++) {
1490
+ _loop(i);
1491
+ }
1492
+ }
1493
+
1494
+ return tasks;
1495
+ }
1496
+
1497
+ function getChildren(taskList, task) {
1498
+ var tasks = [];
1499
+
1500
+ if (task.type !== "project") {
1501
+ tasks = taskList.filter(function (t) {
1502
+ return t.dependencies && t.dependencies.indexOf(task.id) !== -1;
1503
+ });
1504
+ } else {
1505
+ tasks = taskList.filter(function (t) {
1506
+ return t.project && t.project === task.id;
1507
+ });
1508
+ }
1509
+
1510
+ var taskChildren = [];
1511
+ tasks.forEach(function (t) {
1512
+ taskChildren.push.apply(taskChildren, getChildren(taskList, t));
1513
+ });
1514
+ tasks = tasks.concat(tasks, taskChildren);
1515
+ return tasks;
1516
+ }
1517
+
1518
+ var sortTasks = function sortTasks(taskA, taskB) {
1519
+ var orderA = taskA.displayOrder || Number.MAX_VALUE;
1520
+ var orderB = taskB.displayOrder || Number.MAX_VALUE;
1521
+
1522
+ if (orderA > orderB) {
1523
+ return 1;
1524
+ } else if (orderA < orderB) {
1525
+ return -1;
1526
+ } else {
1527
+ return 0;
1528
+ }
1529
+ };
1530
+
1531
+ var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1532
+
1533
+ var BarDisplay = function BarDisplay(_ref) {
1534
+ var x = _ref.x,
1535
+ y = _ref.y,
1536
+ width = _ref.width,
1537
+ height = _ref.height,
1538
+ isSelected = _ref.isSelected,
1539
+ progressX = _ref.progressX,
1540
+ progressWidth = _ref.progressWidth,
1541
+ barCornerRadius = _ref.barCornerRadius,
1542
+ styles = _ref.styles,
1543
+ onMouseDown = _ref.onMouseDown;
1544
+
1545
+ var getProcessColor = function getProcessColor() {
1546
+ return isSelected ? styles.progressSelectedColor : styles.progressColor;
1547
+ };
1548
+
1549
+ var getBarColor = function getBarColor() {
1550
+ return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
1551
+ };
1552
+
1553
+ return React__default.createElement("g", {
1554
+ onMouseDown: onMouseDown
1555
+ }, React__default.createElement("rect", {
1556
+ x: x,
1557
+ width: width,
1558
+ y: y,
1559
+ height: height,
1560
+ ry: barCornerRadius,
1561
+ rx: barCornerRadius,
1562
+ fill: getBarColor(),
1563
+ className: styles$6.barBackground
1564
+ }), React__default.createElement("rect", {
1565
+ x: progressX,
1566
+ width: progressWidth,
1567
+ y: y,
1568
+ height: height,
1569
+ ry: barCornerRadius,
1570
+ rx: barCornerRadius,
1571
+ fill: getProcessColor()
1572
+ }));
1573
+ };
1574
+
1575
+ var BarDateHandle = function BarDateHandle(_ref) {
1576
+ var x = _ref.x,
1577
+ y = _ref.y,
1578
+ width = _ref.width,
1579
+ height = _ref.height,
1580
+ barCornerRadius = _ref.barCornerRadius,
1581
+ onMouseDown = _ref.onMouseDown;
1582
+ return React__default.createElement("rect", {
1583
+ x: x,
1584
+ y: y,
1585
+ width: width,
1586
+ height: height,
1587
+ className: styles$6.barHandle,
1588
+ ry: barCornerRadius,
1589
+ rx: barCornerRadius,
1590
+ onMouseDown: onMouseDown
1591
+ });
1592
+ };
1593
+
1594
+ var BarProgressHandle = function BarProgressHandle(_ref) {
1595
+ var progressPoint = _ref.progressPoint,
1596
+ onMouseDown = _ref.onMouseDown;
1597
+ return React__default.createElement("polygon", {
1598
+ className: styles$6.barHandle,
1599
+ points: progressPoint,
1600
+ onMouseDown: onMouseDown
1601
+ });
1602
+ };
1603
+
1604
+ var Bar = function Bar(_ref) {
1605
+ var task = _ref.task,
1606
+ isProgressChangeable = _ref.isProgressChangeable,
1607
+ isDateChangeable = _ref.isDateChangeable,
1608
+ rtl = _ref.rtl,
1609
+ onEventStart = _ref.onEventStart,
1610
+ isSelected = _ref.isSelected;
1611
+ var progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1612
+ var handleHeight = task.height - 2;
1613
+ return React__default.createElement("g", {
1614
+ className: styles$6.barWrapper,
1615
+ tabIndex: 0
1616
+ }, React__default.createElement(BarDisplay, {
1617
+ x: task.x1,
1618
+ y: task.y,
1619
+ width: task.x2 - task.x1,
1620
+ height: task.height,
1621
+ progressX: task.progressX,
1622
+ progressWidth: task.progressWidth,
1623
+ barCornerRadius: task.barCornerRadius,
1624
+ styles: task.styles,
1625
+ isSelected: isSelected,
1626
+ onMouseDown: function onMouseDown(e) {
1627
+ isDateChangeable && onEventStart("move", task, e);
1628
+ }
1629
+ }), React__default.createElement("g", {
1630
+ className: "handleGroup"
1631
+ }, isDateChangeable && React__default.createElement("g", null, React__default.createElement(BarDateHandle, {
1632
+ x: task.x1 + 1,
1633
+ y: task.y + 1,
1634
+ width: task.handleWidth,
1635
+ height: handleHeight,
1636
+ barCornerRadius: task.barCornerRadius,
1637
+ onMouseDown: function onMouseDown(e) {
1638
+ onEventStart("start", task, e);
1639
+ }
1640
+ }), React__default.createElement(BarDateHandle, {
1641
+ x: task.x2 - task.handleWidth - 1,
1642
+ y: task.y + 1,
1643
+ width: task.handleWidth,
1644
+ height: handleHeight,
1645
+ barCornerRadius: task.barCornerRadius,
1646
+ onMouseDown: function onMouseDown(e) {
1647
+ onEventStart("end", task, e);
1648
+ }
1649
+ })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1650
+ progressPoint: progressPoint,
1651
+ onMouseDown: function onMouseDown(e) {
1652
+ onEventStart("progress", task, e);
1653
+ }
1654
+ })));
1655
+ };
1656
+
1657
+ var BarSmall = function BarSmall(_ref) {
1658
+ var task = _ref.task,
1659
+ isProgressChangeable = _ref.isProgressChangeable,
1660
+ isDateChangeable = _ref.isDateChangeable,
1661
+ onEventStart = _ref.onEventStart,
1662
+ isSelected = _ref.isSelected;
1663
+ var progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
1664
+ return React__default.createElement("g", {
1665
+ className: styles$6.barWrapper,
1666
+ tabIndex: 0
1667
+ }, React__default.createElement(BarDisplay, {
1668
+ x: task.x1,
1669
+ y: task.y,
1670
+ width: task.x2 - task.x1,
1671
+ height: task.height,
1672
+ progressX: task.progressX,
1673
+ progressWidth: task.progressWidth,
1674
+ barCornerRadius: task.barCornerRadius,
1675
+ styles: task.styles,
1676
+ isSelected: isSelected,
1677
+ onMouseDown: function onMouseDown(e) {
1678
+ isDateChangeable && onEventStart("move", task, e);
1679
+ }
1680
+ }), React__default.createElement("g", {
1681
+ className: "handleGroup"
1682
+ }, isProgressChangeable && React__default.createElement(BarProgressHandle, {
1683
+ progressPoint: progressPoint,
1684
+ onMouseDown: function onMouseDown(e) {
1685
+ onEventStart("progress", task, e);
1686
+ }
1687
+ })));
1688
+ };
1689
+
1690
+ var styles$7 = {"milestoneWrapper":"_RRr13","milestoneBackground":"_2P2B1"};
1691
+
1692
+ var Milestone = function Milestone(_ref) {
1693
+ var task = _ref.task,
1694
+ isDateChangeable = _ref.isDateChangeable,
1695
+ onEventStart = _ref.onEventStart,
1696
+ isSelected = _ref.isSelected;
1697
+ var transform = "rotate(45 " + (task.x1 + task.height * 0.356) + " \n " + (task.y + task.height * 0.85) + ")";
1698
+
1699
+ var getBarColor = function getBarColor() {
1700
+ return isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1701
+ };
1702
+
1703
+ return React__default.createElement("g", {
1704
+ tabIndex: 0,
1705
+ className: styles$7.milestoneWrapper
1706
+ }, React__default.createElement("rect", {
1707
+ fill: getBarColor(),
1708
+ x: task.x1,
1709
+ width: task.height,
1710
+ y: task.y,
1711
+ height: task.height,
1712
+ rx: task.barCornerRadius,
1713
+ ry: task.barCornerRadius,
1714
+ transform: transform,
1715
+ className: styles$7.milestoneBackground,
1716
+ onMouseDown: function onMouseDown(e) {
1717
+ isDateChangeable && onEventStart("move", task, e);
1718
+ }
1719
+ }));
1720
+ };
1721
+
1722
+ var styles$8 = {"projectWrapper":"_1KJ6x","projectBackground":"_2RbVy","projectTop":"_2pZMF"};
1723
+
1724
+ var Project = function Project(_ref) {
1725
+ var task = _ref.task,
1726
+ isSelected = _ref.isSelected;
1727
+ var barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1728
+ var processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1729
+ var projectWith = task.x2 - task.x1;
1730
+ var projectLeftTriangle = [task.x1, task.y + task.height / 2 - 1, task.x1, task.y + task.height, task.x1 + 15, task.y + task.height / 2 - 1].join(",");
1731
+ var projectRightTriangle = [task.x2, task.y + task.height / 2 - 1, task.x2, task.y + task.height, task.x2 - 15, task.y + task.height / 2 - 1].join(",");
1732
+ return React__default.createElement("g", {
1733
+ tabIndex: 0,
1734
+ className: styles$8.projectWrapper
1735
+ }, React__default.createElement("rect", {
1736
+ fill: barColor,
1737
+ x: task.x1,
1738
+ width: projectWith,
1739
+ y: task.y,
1740
+ height: task.height,
1741
+ rx: task.barCornerRadius,
1742
+ ry: task.barCornerRadius,
1743
+ className: styles$8.projectBackground
1744
+ }), React__default.createElement("rect", {
1745
+ x: task.progressX,
1746
+ width: task.progressWidth,
1747
+ y: task.y,
1748
+ height: task.height,
1749
+ ry: task.barCornerRadius,
1750
+ rx: task.barCornerRadius,
1751
+ fill: processColor
1752
+ }), React__default.createElement("rect", {
1753
+ fill: barColor,
1754
+ x: task.x1,
1755
+ width: projectWith,
1756
+ y: task.y,
1757
+ height: task.height / 2,
1758
+ rx: task.barCornerRadius,
1759
+ ry: task.barCornerRadius,
1760
+ className: styles$8.projectTop
1761
+ }), React__default.createElement("polygon", {
1762
+ className: styles$8.projectTop,
1763
+ points: projectLeftTriangle,
1764
+ fill: barColor
1765
+ }), React__default.createElement("polygon", {
1766
+ className: styles$8.projectTop,
1767
+ points: projectRightTriangle,
1768
+ fill: barColor
1769
+ }));
1770
+ };
1771
+
1772
+ var style = {"barLabel":"_3zRJQ","barLabelOutside":"_3KcaM"};
1773
+
1774
+ var TaskItem = function TaskItem(props) {
1775
+ var _props = _extends({}, props),
1776
+ task = _props.task,
1777
+ arrowIndent = _props.arrowIndent,
1778
+ isDelete = _props.isDelete,
1779
+ taskHeight = _props.taskHeight,
1780
+ isSelected = _props.isSelected,
1781
+ rtl = _props.rtl,
1782
+ onEventStart = _props.onEventStart;
1783
+
1784
+ var textRef = React.useRef(null);
1785
+
1786
+ var _useState = React.useState(React__default.createElement("div", null)),
1787
+ taskItem = _useState[0],
1788
+ setTaskItem = _useState[1];
1789
+
1790
+ var _useState2 = React.useState(true),
1791
+ isTextInside = _useState2[0],
1792
+ setIsTextInside = _useState2[1];
1793
+
1794
+ React.useEffect(function () {
1795
+ switch (task.typeInternal) {
1796
+ case "milestone":
1797
+ setTaskItem(React__default.createElement(Milestone, Object.assign({}, props)));
1798
+ break;
1799
+
1800
+ case "project":
1801
+ setTaskItem(React__default.createElement(Project, Object.assign({}, props)));
1802
+ break;
1803
+
1804
+ case "smalltask":
1805
+ setTaskItem(React__default.createElement(BarSmall, Object.assign({}, props)));
1806
+ break;
1807
+
1808
+ default:
1809
+ setTaskItem(React__default.createElement(Bar, Object.assign({}, props)));
1810
+ break;
1811
+ }
1812
+ }, [task, isSelected]);
1813
+ React.useEffect(function () {
1814
+ if (textRef.current) {
1815
+ setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
1816
+ }
1817
+ }, [textRef, task]);
1818
+
1819
+ var getX = function getX() {
1820
+ var width = task.x2 - task.x1;
1821
+ var hasChild = task.barChildren.length > 0;
1822
+
1823
+ if (isTextInside) {
1824
+ return task.x1 + width * 0.5;
1825
+ }
1826
+
1827
+ if (rtl && textRef.current) {
1828
+ return task.x1 - textRef.current.getBBox().width - arrowIndent * +hasChild - arrowIndent * 0.2;
1829
+ } else {
1830
+ return task.x1 + width + arrowIndent * +hasChild + arrowIndent * 0.2;
1831
+ }
1832
+ };
1833
+
1834
+ return React__default.createElement("g", {
1835
+ onKeyDown: function onKeyDown(e) {
1836
+ switch (e.key) {
1837
+ case "Delete":
1838
+ {
1839
+ if (isDelete) onEventStart("delete", task, e);
1840
+ break;
1841
+ }
1842
+ }
1843
+
1844
+ e.stopPropagation();
1845
+ },
1846
+ onMouseEnter: function onMouseEnter(e) {
1847
+ onEventStart("mouseenter", task, e);
1848
+ },
1849
+ onMouseLeave: function onMouseLeave(e) {
1850
+ onEventStart("mouseleave", task, e);
1851
+ },
1852
+ onDoubleClick: function onDoubleClick(e) {
1853
+ onEventStart("dblclick", task, e);
1854
+ },
1855
+ onClick: function onClick(e) {
1856
+ onEventStart("click", task, e);
1857
+ },
1858
+ onFocus: function onFocus() {
1859
+ onEventStart("select", task);
1860
+ }
1861
+ }, taskItem, React__default.createElement("text", {
1862
+ x: getX(),
1863
+ y: task.y + taskHeight * 0.5,
1864
+ className: isTextInside ? style.barLabel : style.barLabelOutside,
1865
+ ref: textRef
1866
+ }, task.name));
1867
+ };
1868
+
1869
+ var TaskGanttContent = function TaskGanttContent(_ref) {
1870
+ var _svg$current;
1871
+
1872
+ var tasks = _ref.tasks,
1873
+ dates = _ref.dates,
1874
+ ganttEvent = _ref.ganttEvent,
1875
+ selectedTask = _ref.selectedTask,
1876
+ rowHeight = _ref.rowHeight,
1877
+ columnWidth = _ref.columnWidth,
1878
+ timeStep = _ref.timeStep,
1879
+ svg = _ref.svg,
1880
+ taskHeight = _ref.taskHeight,
1881
+ arrowColor = _ref.arrowColor,
1882
+ arrowIndent = _ref.arrowIndent,
1883
+ fontFamily = _ref.fontFamily,
1884
+ fontSize = _ref.fontSize,
1885
+ rtl = _ref.rtl,
1886
+ setGanttEvent = _ref.setGanttEvent,
1887
+ setFailedTask = _ref.setFailedTask,
1888
+ setSelectedTask = _ref.setSelectedTask,
1889
+ onDateChange = _ref.onDateChange,
1890
+ onProgressChange = _ref.onProgressChange,
1891
+ onDoubleClick = _ref.onDoubleClick,
1892
+ onClick = _ref.onClick,
1893
+ onDelete = _ref.onDelete;
1894
+ var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
1895
+
1896
+ var _useState = React.useState(0),
1897
+ xStep = _useState[0],
1898
+ setXStep = _useState[1];
1899
+
1900
+ var _useState2 = React.useState(0),
1901
+ initEventX1Delta = _useState2[0],
1902
+ setInitEventX1Delta = _useState2[1];
1903
+
1904
+ var _useState3 = React.useState(false),
1905
+ isMoving = _useState3[0],
1906
+ setIsMoving = _useState3[1];
1907
+
1908
+ React.useEffect(function () {
1909
+ var dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
1910
+ var newXStep = timeStep * columnWidth / dateDelta;
1911
+ setXStep(newXStep);
1912
+ }, [columnWidth, dates, timeStep]);
1913
+ React.useEffect(function () {
1914
+ var handleMouseMove = function handleMouseMove(event) {
1915
+ try {
1916
+ var _svg$current$getScree;
1917
+
1918
+ if (!ganttEvent.changedTask || !point || !(svg !== null && svg !== void 0 && svg.current)) return Promise.resolve();
1919
+ event.preventDefault();
1920
+ point.x = event.clientX;
1921
+ var cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree = svg.current.getScreenCTM()) === null || _svg$current$getScree === void 0 ? void 0 : _svg$current$getScree.inverse());
1922
+
1923
+ var _handleTaskBySVGMouse = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, xStep, timeStep, initEventX1Delta, rtl),
1924
+ isChanged = _handleTaskBySVGMouse.isChanged,
1925
+ changedTask = _handleTaskBySVGMouse.changedTask;
1926
+
1927
+ if (isChanged) {
1928
+ setGanttEvent({
1929
+ action: ganttEvent.action,
1930
+ changedTask: changedTask
1931
+ });
1932
+ }
1933
+
1934
+ return Promise.resolve();
1935
+ } catch (e) {
1936
+ return Promise.reject(e);
1937
+ }
1938
+ };
1939
+
1940
+ var handleMouseUp = function handleMouseUp(event) {
1941
+ try {
1942
+ var _svg$current$getScree2;
1943
+
1944
+ var _temp6 = function _temp6() {
1945
+ if (!operationSuccess) {
1946
+ setFailedTask(originalSelectedTask);
1947
+ }
1948
+ };
1949
+
1950
+ var action = ganttEvent.action,
1951
+ originalSelectedTask = ganttEvent.originalSelectedTask,
1952
+ changedTask = ganttEvent.changedTask;
1953
+ if (!changedTask || !point || !(svg !== null && svg !== void 0 && svg.current) || !originalSelectedTask) return Promise.resolve();
1954
+ event.preventDefault();
1955
+ point.x = event.clientX;
1956
+ var cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree2 = svg.current.getScreenCTM()) === null || _svg$current$getScree2 === void 0 ? void 0 : _svg$current$getScree2.inverse());
1957
+
1958
+ var _handleTaskBySVGMouse2 = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, xStep, timeStep, initEventX1Delta, rtl),
1959
+ newChangedTask = _handleTaskBySVGMouse2.changedTask;
1960
+
1961
+ var isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.progress !== newChangedTask.progress;
1962
+ svg.current.removeEventListener("mousemove", handleMouseMove);
1963
+ svg.current.removeEventListener("mouseup", handleMouseUp);
1964
+ setGanttEvent({
1965
+ action: ""
1966
+ });
1967
+ setIsMoving(false);
1968
+ var operationSuccess = true;
1969
+
1970
+ var _temp7 = function () {
1971
+ if ((action === "move" || action === "end" || action === "start") && onDateChange && isNotLikeOriginal) {
1972
+ var _temp8 = _catch(function () {
1973
+ return Promise.resolve(onDateChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
1974
+ if (result !== undefined) {
1975
+ operationSuccess = result;
1976
+ }
1977
+ });
1978
+ }, function () {
1979
+ operationSuccess = false;
1980
+ });
1981
+
1982
+ if (_temp8 && _temp8.then) return _temp8.then(function () {});
1983
+ } else {
1984
+ var _temp9 = function () {
1985
+ if (onProgressChange && isNotLikeOriginal) {
1986
+ var _temp10 = _catch(function () {
1987
+ return Promise.resolve(onProgressChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
1988
+ if (result !== undefined) {
1989
+ operationSuccess = result;
1990
+ }
1991
+ });
1992
+ }, function () {
1993
+ operationSuccess = false;
1994
+ });
1995
+
1996
+ if (_temp10 && _temp10.then) return _temp10.then(function () {});
1997
+ }
1998
+ }();
1999
+
2000
+ if (_temp9 && _temp9.then) return _temp9.then(function () {});
2001
+ }
2002
+ }();
2003
+
2004
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
2005
+ } catch (e) {
2006
+ return Promise.reject(e);
2007
+ }
2008
+ };
2009
+
2010
+ if (!isMoving && (ganttEvent.action === "move" || ganttEvent.action === "end" || ganttEvent.action === "start" || ganttEvent.action === "progress") && svg !== null && svg !== void 0 && svg.current) {
2011
+ svg.current.addEventListener("mousemove", handleMouseMove);
2012
+ svg.current.addEventListener("mouseup", handleMouseUp);
2013
+ setIsMoving(true);
2014
+ }
2015
+ }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
2016
+
2017
+ var handleBarEventStart = function handleBarEventStart(action, task, event) {
2018
+ try {
2019
+ return Promise.resolve(function () {
2020
+ if (!event) {
2021
+ if (action === "select") {
2022
+ setSelectedTask(task.id);
2023
+ }
2024
+ } else return function () {
2025
+ if (isKeyboardEvent(event)) {
2026
+ var _temp14 = function () {
2027
+ if (action === "delete") {
2028
+ var _temp15 = function () {
2029
+ if (onDelete) {
2030
+ var _temp16 = _catch(function () {
2031
+ return Promise.resolve(onDelete(task)).then(function (result) {
2032
+ if (result !== undefined && result) {
2033
+ setGanttEvent({
2034
+ action: action,
2035
+ changedTask: task
2036
+ });
2037
+ }
2038
+ });
2039
+ }, function (error) {
2040
+ console.error("Error on Delete. " + error);
2041
+ });
2042
+
2043
+ if (_temp16 && _temp16.then) return _temp16.then(function () {});
2044
+ }
2045
+ }();
2046
+
2047
+ if (_temp15 && _temp15.then) return _temp15.then(function () {});
2048
+ }
2049
+ }();
2050
+
2051
+ if (_temp14 && _temp14.then) return _temp14.then(function () {});
2052
+ } else if (action === "mouseenter") {
2053
+ if (!ganttEvent.action) {
2054
+ setGanttEvent({
2055
+ action: action,
2056
+ changedTask: task,
2057
+ originalSelectedTask: task
2058
+ });
2059
+ }
2060
+ } else if (action === "mouseleave") {
2061
+ if (ganttEvent.action === "mouseenter") {
2062
+ setGanttEvent({
2063
+ action: ""
2064
+ });
2065
+ }
2066
+ } else if (action === "dblclick") {
2067
+ !!onDoubleClick && onDoubleClick(task);
2068
+ } else if (action === "click") {
2069
+ !!onClick && onClick(task);
2070
+ } else if (action === "move") {
2071
+ var _svg$current$getScree3;
2072
+
2073
+ if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
2074
+ point.x = event.clientX;
2075
+ var cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2076
+ setInitEventX1Delta(cursor.x - task.x1);
2077
+ setGanttEvent({
2078
+ action: action,
2079
+ changedTask: task,
2080
+ originalSelectedTask: task
2081
+ });
2082
+ } else {
2083
+ setGanttEvent({
2084
+ action: action,
2085
+ changedTask: task,
2086
+ originalSelectedTask: task
2087
+ });
2088
+ }
2089
+ }();
2090
+ }());
2091
+ } catch (e) {
2092
+ return Promise.reject(e);
2093
+ }
2094
+ };
2095
+
2096
+ return React__default.createElement("g", {
2097
+ className: "content"
2098
+ }, React__default.createElement("g", {
2099
+ className: "arrows",
2100
+ fill: arrowColor,
2101
+ stroke: arrowColor
2102
+ }, tasks.map(function (task) {
2103
+ return task.barChildren.map(function (child) {
2104
+ return React__default.createElement(Arrow, {
2105
+ key: "Arrow from " + task.id + " to " + tasks[child.index].id,
2106
+ taskFrom: task,
2107
+ taskTo: tasks[child.index],
2108
+ rowHeight: rowHeight,
2109
+ taskHeight: taskHeight,
2110
+ arrowIndent: arrowIndent,
2111
+ rtl: rtl
2112
+ });
2113
+ });
2114
+ })), React__default.createElement("g", {
2115
+ className: "bar",
2116
+ fontFamily: fontFamily,
2117
+ fontSize: fontSize
2118
+ }, tasks.map(function (task) {
2119
+ return React__default.createElement(TaskItem, {
2120
+ task: task,
2121
+ arrowIndent: arrowIndent,
2122
+ taskHeight: taskHeight,
2123
+ isProgressChangeable: !!onProgressChange && !task.isDisabled,
2124
+ isDateChangeable: !!onDateChange && !task.isDisabled,
2125
+ isDelete: !task.isDisabled,
2126
+ onEventStart: handleBarEventStart,
2127
+ key: task.id,
2128
+ isSelected: !!selectedTask && task.id === selectedTask.id,
2129
+ rtl: rtl
2130
+ });
2131
+ })));
2132
+ };
2133
+
2134
+ var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf"};
2135
+
2136
+ var TaskGantt = function TaskGantt(_ref) {
2137
+ var gridProps = _ref.gridProps,
2138
+ calendarProps = _ref.calendarProps,
2139
+ barProps = _ref.barProps,
2140
+ ganttHeight = _ref.ganttHeight,
2141
+ scrollY = _ref.scrollY,
2142
+ scrollX = _ref.scrollX;
2143
+ var ganttSVGRef = React.useRef(null);
2144
+ var horizontalContainerRef = React.useRef(null);
2145
+ var verticalGanttContainerRef = React.useRef(null);
2146
+
2147
+ var newBarProps = _extends({}, barProps, {
2148
+ svg: ganttSVGRef
2149
+ });
2150
+
2151
+ React.useEffect(function () {
2152
+ if (horizontalContainerRef.current) {
2153
+ horizontalContainerRef.current.scrollTop = scrollY;
2154
+ }
2155
+ }, [scrollY]);
2156
+ React.useEffect(function () {
2157
+ if (verticalGanttContainerRef.current) {
2158
+ verticalGanttContainerRef.current.scrollLeft = scrollX;
2159
+ }
2160
+ }, [scrollX]);
2161
+ return React__default.createElement("div", {
2162
+ className: styles$9.ganttVerticalContainer,
2163
+ ref: verticalGanttContainerRef,
2164
+ dir: "ltr"
2165
+ }, React__default.createElement("svg", {
2166
+ xmlns: "http://www.w3.org/2000/svg",
2167
+ width: gridProps.svgWidth,
2168
+ height: calendarProps.headerHeight,
2169
+ fontFamily: barProps.fontFamily
2170
+ }, React__default.createElement(Calendar, Object.assign({}, calendarProps))), React__default.createElement("div", {
2171
+ ref: horizontalContainerRef,
2172
+ className: styles$9.horizontalContainer,
2173
+ style: ganttHeight ? {
2174
+ height: ganttHeight,
2175
+ width: gridProps.svgWidth
2176
+ } : {
2177
+ width: gridProps.svgWidth
2178
+ }
2179
+ }, React__default.createElement("svg", {
2180
+ xmlns: "http://www.w3.org/2000/svg",
2181
+ width: gridProps.svgWidth,
2182
+ height: barProps.rowHeight * barProps.tasks.length,
2183
+ fontFamily: barProps.fontFamily,
2184
+ ref: ganttSVGRef
2185
+ }, React__default.createElement(Grid, Object.assign({}, gridProps)), React__default.createElement(TaskGanttContent, Object.assign({}, newBarProps)))));
2186
+ };
2187
+
2188
+ var styles$a = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
2189
+
2190
+ var HorizontalScroll = function HorizontalScroll(_ref) {
2191
+ var scroll = _ref.scroll,
2192
+ svgWidth = _ref.svgWidth,
2193
+ taskListWidth = _ref.taskListWidth,
2194
+ rtl = _ref.rtl,
2195
+ onScroll = _ref.onScroll;
2196
+ var scrollRef = React.useRef(null);
2197
+ React.useEffect(function () {
2198
+ if (scrollRef.current) {
2199
+ scrollRef.current.scrollLeft = scroll;
2200
+ }
2201
+ }, [scroll]);
2202
+ return React__default.createElement("div", {
2203
+ dir: "ltr",
2204
+ style: {
2205
+ margin: rtl ? "0px " + taskListWidth + "px 0px 0px" : "0px 0px 0px " + taskListWidth + "px"
2206
+ },
2207
+ className: styles$a.scrollWrapper,
2208
+ onScroll: onScroll,
2209
+ ref: scrollRef
2210
+ }, React__default.createElement("div", {
2211
+ style: {
2212
+ width: svgWidth
2213
+ },
2214
+ className: styles$a.scroll
2215
+ }));
2216
+ };
2217
+
2218
+ var Gantt = function Gantt(_ref) {
2219
+ var tasks = _ref.tasks,
2220
+ _ref$headerHeight = _ref.headerHeight,
2221
+ headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
2222
+ _ref$columnWidth = _ref.columnWidth,
2223
+ columnWidth = _ref$columnWidth === void 0 ? 60 : _ref$columnWidth,
2224
+ _ref$listCellWidth = _ref.listCellWidth,
2225
+ listCellWidth = _ref$listCellWidth === void 0 ? "155px" : _ref$listCellWidth,
2226
+ _ref$rowHeight = _ref.rowHeight,
2227
+ rowHeight = _ref$rowHeight === void 0 ? 50 : _ref$rowHeight,
2228
+ _ref$ganttHeight = _ref.ganttHeight,
2229
+ ganttHeight = _ref$ganttHeight === void 0 ? 0 : _ref$ganttHeight,
2230
+ _ref$viewMode = _ref.viewMode,
2231
+ viewMode = _ref$viewMode === void 0 ? exports.ViewMode.Day : _ref$viewMode,
2232
+ _ref$preStepsCount = _ref.preStepsCount,
2233
+ preStepsCount = _ref$preStepsCount === void 0 ? 1 : _ref$preStepsCount,
2234
+ _ref$locale = _ref.locale,
2235
+ locale = _ref$locale === void 0 ? "en-GB" : _ref$locale,
2236
+ _ref$barFill = _ref.barFill,
2237
+ barFill = _ref$barFill === void 0 ? 60 : _ref$barFill,
2238
+ _ref$barCornerRadius = _ref.barCornerRadius,
2239
+ barCornerRadius = _ref$barCornerRadius === void 0 ? 3 : _ref$barCornerRadius,
2240
+ _ref$barProgressColor = _ref.barProgressColor,
2241
+ barProgressColor = _ref$barProgressColor === void 0 ? "#a3a3ff" : _ref$barProgressColor,
2242
+ _ref$barProgressSelec = _ref.barProgressSelectedColor,
2243
+ barProgressSelectedColor = _ref$barProgressSelec === void 0 ? "#8282f5" : _ref$barProgressSelec,
2244
+ _ref$barBackgroundCol = _ref.barBackgroundColor,
2245
+ barBackgroundColor = _ref$barBackgroundCol === void 0 ? "#b8c2cc" : _ref$barBackgroundCol,
2246
+ _ref$barBackgroundSel = _ref.barBackgroundSelectedColor,
2247
+ barBackgroundSelectedColor = _ref$barBackgroundSel === void 0 ? "#aeb8c2" : _ref$barBackgroundSel,
2248
+ _ref$projectProgressC = _ref.projectProgressColor,
2249
+ projectProgressColor = _ref$projectProgressC === void 0 ? "#7db59a" : _ref$projectProgressC,
2250
+ _ref$projectProgressS = _ref.projectProgressSelectedColor,
2251
+ projectProgressSelectedColor = _ref$projectProgressS === void 0 ? "#59a985" : _ref$projectProgressS,
2252
+ _ref$projectBackgroun = _ref.projectBackgroundColor,
2253
+ projectBackgroundColor = _ref$projectBackgroun === void 0 ? "#fac465" : _ref$projectBackgroun,
2254
+ _ref$projectBackgroun2 = _ref.projectBackgroundSelectedColor,
2255
+ projectBackgroundSelectedColor = _ref$projectBackgroun2 === void 0 ? "#f7bb53" : _ref$projectBackgroun2,
2256
+ _ref$milestoneBackgro = _ref.milestoneBackgroundColor,
2257
+ milestoneBackgroundColor = _ref$milestoneBackgro === void 0 ? "#f1c453" : _ref$milestoneBackgro,
2258
+ _ref$milestoneBackgro2 = _ref.milestoneBackgroundSelectedColor,
2259
+ milestoneBackgroundSelectedColor = _ref$milestoneBackgro2 === void 0 ? "#f29e4c" : _ref$milestoneBackgro2,
2260
+ _ref$rtl = _ref.rtl,
2261
+ rtl = _ref$rtl === void 0 ? false : _ref$rtl,
2262
+ _ref$handleWidth = _ref.handleWidth,
2263
+ handleWidth = _ref$handleWidth === void 0 ? 8 : _ref$handleWidth,
2264
+ _ref$timeStep = _ref.timeStep,
2265
+ timeStep = _ref$timeStep === void 0 ? 300000 : _ref$timeStep,
2266
+ _ref$arrowColor = _ref.arrowColor,
2267
+ arrowColor = _ref$arrowColor === void 0 ? "grey" : _ref$arrowColor,
2268
+ _ref$fontFamily = _ref.fontFamily,
2269
+ fontFamily = _ref$fontFamily === void 0 ? "Arial, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue" : _ref$fontFamily,
2270
+ _ref$fontSize = _ref.fontSize,
2271
+ fontSize = _ref$fontSize === void 0 ? "14px" : _ref$fontSize,
2272
+ _ref$arrowIndent = _ref.arrowIndent,
2273
+ arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
2274
+ _ref$todayColor = _ref.todayColor,
2275
+ todayColor = _ref$todayColor === void 0 ? "rgba(252, 248, 227, 0.5)" : _ref$todayColor,
2276
+ viewDate = _ref.viewDate,
2277
+ _ref$TooltipContent = _ref.TooltipContent,
2278
+ TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
2279
+ _ref$TaskListHeader = _ref.TaskListHeader,
2280
+ TaskListHeader = _ref$TaskListHeader === void 0 ? TaskListHeaderDefault : _ref$TaskListHeader,
2281
+ _ref$TaskListTable = _ref.TaskListTable,
2282
+ TaskListTable = _ref$TaskListTable === void 0 ? TaskListTableDefault : _ref$TaskListTable,
2283
+ onDateChange = _ref.onDateChange,
2284
+ onProgressChange = _ref.onProgressChange,
2285
+ onDoubleClick = _ref.onDoubleClick,
2286
+ onClick = _ref.onClick,
2287
+ onDelete = _ref.onDelete,
2288
+ onSelect = _ref.onSelect,
2289
+ onExpanderClick = _ref.onExpanderClick;
2290
+ var wrapperRef = React.useRef(null);
2291
+ var taskListRef = React.useRef(null);
2292
+
2293
+ var _useState = React.useState(function () {
2294
+ var _ganttDateRange = ganttDateRange(tasks, viewMode, preStepsCount),
2295
+ startDate = _ganttDateRange[0],
2296
+ endDate = _ganttDateRange[1];
2297
+
2298
+ return {
2299
+ viewMode: viewMode,
2300
+ dates: seedDates(startDate, endDate, viewMode)
2301
+ };
2302
+ }),
2303
+ dateSetup = _useState[0],
2304
+ setDateSetup = _useState[1];
2305
+
2306
+ var _useState2 = React.useState(undefined),
2307
+ currentViewDate = _useState2[0],
2308
+ setCurrentViewDate = _useState2[1];
2309
+
2310
+ var _useState3 = React.useState(0),
2311
+ taskListWidth = _useState3[0],
2312
+ setTaskListWidth = _useState3[1];
2313
+
2314
+ var _useState4 = React.useState(0),
2315
+ svgContainerWidth = _useState4[0],
2316
+ setSvgContainerWidth = _useState4[1];
2317
+
2318
+ var _useState5 = React.useState(ganttHeight),
2319
+ svgContainerHeight = _useState5[0],
2320
+ setSvgContainerHeight = _useState5[1];
2321
+
2322
+ var _useState6 = React.useState([]),
2323
+ barTasks = _useState6[0],
2324
+ setBarTasks = _useState6[1];
2325
+
2326
+ var _useState7 = React.useState({
2327
+ action: ""
2328
+ }),
2329
+ ganttEvent = _useState7[0],
2330
+ setGanttEvent = _useState7[1];
2331
+
2332
+ var taskHeight = React.useMemo(function () {
2333
+ return rowHeight * barFill / 100;
2334
+ }, [rowHeight, barFill]);
2335
+
2336
+ var _useState8 = React.useState(),
2337
+ selectedTask = _useState8[0],
2338
+ setSelectedTask = _useState8[1];
2339
+
2340
+ var _useState9 = React.useState(null),
2341
+ failedTask = _useState9[0],
2342
+ setFailedTask = _useState9[1];
2343
+
2344
+ var svgWidth = dateSetup.dates.length * columnWidth;
2345
+ var ganttFullHeight = barTasks.length * rowHeight;
2346
+
2347
+ var _useState10 = React.useState(0),
2348
+ scrollY = _useState10[0],
2349
+ setScrollY = _useState10[1];
2350
+
2351
+ var _useState11 = React.useState(-1),
2352
+ scrollX = _useState11[0],
2353
+ setScrollX = _useState11[1];
2354
+
2355
+ var _useState12 = React.useState(false),
2356
+ ignoreScrollEvent = _useState12[0],
2357
+ setIgnoreScrollEvent = _useState12[1];
2358
+
2359
+ React.useEffect(function () {
2360
+ var filteredTasks;
2361
+
2362
+ if (onExpanderClick) {
2363
+ filteredTasks = removeHiddenTasks(tasks);
2364
+ } else {
2365
+ filteredTasks = tasks;
2366
+ }
2367
+
2368
+ filteredTasks = filteredTasks.sort(sortTasks);
2369
+
2370
+ var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
2371
+ startDate = _ganttDateRange2[0],
2372
+ endDate = _ganttDateRange2[1];
2373
+
2374
+ var newDates = seedDates(startDate, endDate, viewMode);
2375
+
2376
+ if (rtl) {
2377
+ newDates = newDates.reverse();
2378
+
2379
+ if (scrollX === -1) {
2380
+ setScrollX(newDates.length * columnWidth);
2381
+ }
2382
+ }
2383
+
2384
+ setDateSetup({
2385
+ dates: newDates,
2386
+ viewMode: viewMode
2387
+ });
2388
+ setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
2389
+ }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor, rtl, scrollX, onExpanderClick]);
2390
+ React.useEffect(function () {
2391
+ if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
2392
+ var dates = dateSetup.dates;
2393
+ var index = dates.findIndex(function (d, i) {
2394
+ return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
2395
+ });
2396
+
2397
+ if (index === -1) {
2398
+ return;
2399
+ }
2400
+
2401
+ setCurrentViewDate(viewDate);
2402
+ setScrollX(columnWidth * index);
2403
+ }
2404
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, currentViewDate, setCurrentViewDate]);
2405
+ React.useEffect(function () {
2406
+ var changedTask = ganttEvent.changedTask,
2407
+ action = ganttEvent.action;
2408
+
2409
+ if (changedTask) {
2410
+ if (action === "delete") {
2411
+ setGanttEvent({
2412
+ action: ""
2413
+ });
2414
+ setBarTasks(barTasks.filter(function (t) {
2415
+ return t.id !== changedTask.id;
2416
+ }));
2417
+ } else if (action === "move" || action === "end" || action === "start" || action === "progress") {
2418
+ var prevStateTask = barTasks.find(function (t) {
2419
+ return t.id === changedTask.id;
2420
+ });
2421
+
2422
+ if (prevStateTask && (prevStateTask.start.getTime() !== changedTask.start.getTime() || prevStateTask.end.getTime() !== changedTask.end.getTime() || prevStateTask.progress !== changedTask.progress)) {
2423
+ var newTaskList = barTasks.map(function (t) {
2424
+ return t.id === changedTask.id ? changedTask : t;
2425
+ });
2426
+ setBarTasks(newTaskList);
2427
+ }
2428
+ }
2429
+ }
2430
+ }, [ganttEvent, barTasks]);
2431
+ React.useEffect(function () {
2432
+ if (failedTask) {
2433
+ setBarTasks(barTasks.map(function (t) {
2434
+ return t.id !== failedTask.id ? t : failedTask;
2435
+ }));
2436
+ setFailedTask(null);
2437
+ }
2438
+ }, [failedTask, barTasks]);
2439
+ React.useEffect(function () {
2440
+ if (!listCellWidth) {
2441
+ setTaskListWidth(0);
2442
+ }
2443
+
2444
+ if (taskListRef.current) {
2445
+ setTaskListWidth(taskListRef.current.offsetWidth);
2446
+ }
2447
+ }, [taskListRef, listCellWidth]);
2448
+ React.useEffect(function () {
2449
+ if (wrapperRef.current) {
2450
+ setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);
2451
+ }
2452
+ }, [wrapperRef, taskListWidth]);
2453
+ React.useEffect(function () {
2454
+ if (ganttHeight) {
2455
+ setSvgContainerHeight(ganttHeight + headerHeight);
2456
+ } else {
2457
+ setSvgContainerHeight(tasks.length * rowHeight + headerHeight);
2458
+ }
2459
+ }, [ganttHeight, tasks, headerHeight, rowHeight]);
2460
+ React.useEffect(function () {
2461
+ var _wrapperRef$current;
2462
+
2463
+ var handleWheel = function handleWheel(event) {
2464
+ if (event.shiftKey || event.deltaX) {
2465
+ var scrollMove = event.deltaX ? event.deltaX : event.deltaY;
2466
+ var newScrollX = scrollX + scrollMove;
2467
+
2468
+ if (newScrollX < 0) {
2469
+ newScrollX = 0;
2470
+ } else if (newScrollX > svgWidth) {
2471
+ newScrollX = svgWidth;
2472
+ }
2473
+
2474
+ setScrollX(newScrollX);
2475
+ event.preventDefault();
2476
+ } else if (ganttHeight) {
2477
+ var newScrollY = scrollY + event.deltaY;
2478
+
2479
+ if (newScrollY < 0) {
2480
+ newScrollY = 0;
2481
+ } else if (newScrollY > ganttFullHeight - ganttHeight) {
2482
+ newScrollY = ganttFullHeight - ganttHeight;
2483
+ }
2484
+
2485
+ if (newScrollY !== scrollY) {
2486
+ setScrollY(newScrollY);
2487
+ event.preventDefault();
2488
+ }
2489
+ }
2490
+
2491
+ setIgnoreScrollEvent(true);
2492
+ };
2493
+
2494
+ console.log(scrollX, scrollY);
2495
+ (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.addEventListener("wheel", handleWheel, {
2496
+ passive: false
2497
+ });
2498
+ return function () {
2499
+ var _wrapperRef$current2;
2500
+
2501
+ (_wrapperRef$current2 = wrapperRef.current) === null || _wrapperRef$current2 === void 0 ? void 0 : _wrapperRef$current2.removeEventListener("wheel", handleWheel);
2502
+ };
2503
+ }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
2504
+
2505
+ var handleScrollY = function handleScrollY(event) {
2506
+ if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
2507
+ setScrollY(event.currentTarget.scrollTop);
2508
+ setIgnoreScrollEvent(true);
2509
+ } else {
2510
+ setIgnoreScrollEvent(false);
2511
+ }
2512
+ };
2513
+
2514
+ var handleScrollX = function handleScrollX(event) {
2515
+ if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
2516
+ setScrollX(event.currentTarget.scrollLeft);
2517
+ setIgnoreScrollEvent(true);
2518
+ } else {
2519
+ setIgnoreScrollEvent(false);
2520
+ }
2521
+ };
2522
+
2523
+ var handleKeyDown = function handleKeyDown(event) {
2524
+ event.preventDefault();
2525
+ var newScrollY = scrollY;
2526
+ var newScrollX = scrollX;
2527
+ var isX = true;
2528
+
2529
+ switch (event.key) {
2530
+ case "Down":
2531
+ case "ArrowDown":
2532
+ newScrollY += rowHeight;
2533
+ isX = false;
2534
+ break;
2535
+
2536
+ case "Up":
2537
+ case "ArrowUp":
2538
+ newScrollY -= rowHeight;
2539
+ isX = false;
2540
+ break;
2541
+
2542
+ case "Left":
2543
+ case "ArrowLeft":
2544
+ newScrollX -= columnWidth;
2545
+ break;
2546
+
2547
+ case "Right":
2548
+ case "ArrowRight":
2549
+ newScrollX += columnWidth;
2550
+ break;
2551
+ }
2552
+
2553
+ if (isX) {
2554
+ if (newScrollX < 0) {
2555
+ newScrollX = 0;
2556
+ } else if (newScrollX > svgWidth) {
2557
+ newScrollX = svgWidth;
2558
+ }
2559
+
2560
+ setScrollX(newScrollX);
2561
+ } else {
2562
+ if (newScrollY < 0) {
2563
+ newScrollY = 0;
2564
+ } else if (newScrollY > ganttFullHeight - ganttHeight) {
2565
+ newScrollY = ganttFullHeight - ganttHeight;
2566
+ }
2567
+
2568
+ setScrollY(newScrollY);
2569
+ }
2570
+
2571
+ setIgnoreScrollEvent(true);
2572
+ };
2573
+
2574
+ var handleSelectedTask = function handleSelectedTask(taskId) {
2575
+ var newSelectedTask = barTasks.find(function (t) {
2576
+ return t.id === taskId;
2577
+ });
2578
+ var oldSelectedTask = barTasks.find(function (t) {
2579
+ return !!selectedTask && t.id === selectedTask.id;
2580
+ });
2581
+
2582
+ if (onSelect) {
2583
+ if (oldSelectedTask) {
2584
+ onSelect(oldSelectedTask, false);
2585
+ }
2586
+
2587
+ if (newSelectedTask) {
2588
+ onSelect(newSelectedTask, true);
2589
+ }
2590
+ }
2591
+
2592
+ setSelectedTask(newSelectedTask);
2593
+ };
2594
+
2595
+ var handleExpanderClick = function handleExpanderClick(task) {
2596
+ if (onExpanderClick && task.hideChildren !== undefined) {
2597
+ onExpanderClick(_extends({}, task, {
2598
+ hideChildren: !task.hideChildren
2599
+ }));
2600
+ }
2601
+ };
2602
+
2603
+ var gridProps = {
2604
+ columnWidth: columnWidth,
2605
+ svgWidth: svgWidth,
2606
+ tasks: tasks,
2607
+ rowHeight: rowHeight,
2608
+ dates: dateSetup.dates,
2609
+ todayColor: todayColor,
2610
+ rtl: rtl
2611
+ };
2612
+ var calendarProps = {
2613
+ dateSetup: dateSetup,
2614
+ locale: locale,
2615
+ viewMode: viewMode,
2616
+ headerHeight: headerHeight,
2617
+ columnWidth: columnWidth,
2618
+ fontFamily: fontFamily,
2619
+ fontSize: fontSize,
2620
+ rtl: rtl
2621
+ };
2622
+ var barProps = {
2623
+ tasks: barTasks,
2624
+ dates: dateSetup.dates,
2625
+ ganttEvent: ganttEvent,
2626
+ selectedTask: selectedTask,
2627
+ rowHeight: rowHeight,
2628
+ taskHeight: taskHeight,
2629
+ columnWidth: columnWidth,
2630
+ arrowColor: arrowColor,
2631
+ timeStep: timeStep,
2632
+ fontFamily: fontFamily,
2633
+ fontSize: fontSize,
2634
+ arrowIndent: arrowIndent,
2635
+ svgWidth: svgWidth,
2636
+ rtl: rtl,
2637
+ setGanttEvent: setGanttEvent,
2638
+ setFailedTask: setFailedTask,
2639
+ setSelectedTask: handleSelectedTask,
2640
+ onDateChange: onDateChange,
2641
+ onProgressChange: onProgressChange,
2642
+ onDoubleClick: onDoubleClick,
2643
+ onClick: onClick,
2644
+ onDelete: onDelete
2645
+ };
2646
+ var tableProps = {
2647
+ rowHeight: rowHeight,
2648
+ rowWidth: listCellWidth,
2649
+ fontFamily: fontFamily,
2650
+ fontSize: fontSize,
2651
+ tasks: barTasks,
2652
+ locale: locale,
2653
+ headerHeight: headerHeight,
2654
+ scrollY: scrollY,
2655
+ ganttHeight: ganttHeight,
2656
+ horizontalContainerClass: styles$9.horizontalContainer,
2657
+ selectedTask: selectedTask,
2658
+ taskListRef: taskListRef,
2659
+ setSelectedTask: handleSelectedTask,
2660
+ onExpanderClick: handleExpanderClick,
2661
+ TaskListHeader: TaskListHeader,
2662
+ TaskListTable: TaskListTable
2663
+ };
2664
+ return React__default.createElement("div", null, React__default.createElement("div", {
2665
+ className: styles$9.wrapper,
2666
+ onKeyDown: handleKeyDown,
2667
+ tabIndex: 0,
2668
+ ref: wrapperRef
2669
+ }, listCellWidth && React__default.createElement(TaskList, Object.assign({}, tableProps)), React__default.createElement(TaskGantt, {
2670
+ gridProps: gridProps,
2671
+ calendarProps: calendarProps,
2672
+ barProps: barProps,
2673
+ ganttHeight: ganttHeight,
2674
+ scrollY: scrollY,
2675
+ scrollX: scrollX
2676
+ }), ganttEvent.changedTask && React__default.createElement(Tooltip, {
2677
+ arrowIndent: arrowIndent,
2678
+ rowHeight: rowHeight,
2679
+ svgContainerHeight: svgContainerHeight,
2680
+ svgContainerWidth: svgContainerWidth,
2681
+ fontFamily: fontFamily,
2682
+ fontSize: fontSize,
2683
+ scrollX: scrollX,
2684
+ scrollY: scrollY,
2685
+ task: ganttEvent.changedTask,
2686
+ headerHeight: headerHeight,
2687
+ taskListWidth: taskListWidth,
2688
+ TooltipContent: TooltipContent,
2689
+ rtl: rtl,
2690
+ svgWidth: svgWidth
2691
+ }), React__default.createElement(VerticalScroll, {
2692
+ ganttFullHeight: ganttFullHeight,
2693
+ ganttHeight: ganttHeight,
2694
+ headerHeight: headerHeight,
2695
+ scroll: scrollY,
2696
+ onScroll: handleScrollY,
2697
+ rtl: rtl
2698
+ })), React__default.createElement(HorizontalScroll, {
2699
+ svgWidth: svgWidth,
2700
+ taskListWidth: taskListWidth,
2701
+ scroll: scrollX,
2702
+ rtl: rtl,
2703
+ onScroll: handleScrollX
2704
+ }));
2705
+ };
2706
+
2707
+ exports.Gantt = Gantt;
2708
+ //# sourceMappingURL=index.js.map