@sme.up/ketchup 7.4.1 → 7.5.0-SNAPSHOT

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 (139) hide show
  1. package/dist/cjs/{f-button-5856cd74.js → f-button-a508a0a1.js} +1 -1
  2. package/dist/cjs/{f-cell-9d7a9e97.js → f-cell-52d724f5.js} +4 -4
  3. package/dist/cjs/{f-chip-675ed121.js → f-chip-cbb70aed.js} +2 -2
  4. package/dist/cjs/{f-image-48facc89.js → f-image-510563ed.js} +4 -4
  5. package/dist/cjs/{f-paginator-utils-0c1227f6.js → f-paginator-utils-ff531caa.js} +2 -2
  6. package/dist/cjs/{f-text-field-3d8e7417.js → f-text-field-d17e5aa0.js} +1 -1
  7. package/dist/cjs/ketchup.cjs.js +2 -2
  8. package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +18 -12
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
  12. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  13. package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
  14. package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
  15. package/dist/cjs/kup-dashboard.cjs.entry.js +4 -7
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
  19. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
  21. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  23. package/dist/cjs/{kup-manager-22bb9699.js → kup-manager-9e1680dd.js} +3 -0
  24. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-planner.cjs.entry.js +1043 -558
  28. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  30. package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
  31. package/dist/cjs/loader.cjs.js +2 -2
  32. package/dist/collection/collection-manifest.json +1 -1
  33. package/dist/collection/components/kup-card/kup-card.css +4 -8
  34. package/dist/collection/components/kup-dashboard/kup-dashboard.js +0 -3
  35. package/dist/collection/components/kup-data-table/kup-data-table.css +3 -6
  36. package/dist/collection/components/kup-data-table/kup-data-table.js +1 -4
  37. package/dist/collection/components/kup-family-tree/kup-family-tree.css +2 -2
  38. package/dist/collection/components/kup-image/kup-image.js +28 -0
  39. package/dist/collection/components/kup-list/kup-list.css +1 -1
  40. package/dist/collection/components/kup-planner/kup-planner-declarations.js +49 -16
  41. package/dist/collection/components/kup-planner/kup-planner-helper.js +54 -0
  42. package/dist/collection/components/kup-planner/kup-planner.css +21 -18
  43. package/dist/collection/components/kup-planner/kup-planner.js +483 -69
  44. package/dist/collection/components/kup-qlik/kup-qlik.css +4 -8
  45. package/dist/collection/components/kup-spinner/kup-spinner.css +2 -4
  46. package/dist/collection/f-components/f-image/f-image.js +3 -3
  47. package/dist/collection/managers/kup-data/kup-data-column-helper.js +1 -0
  48. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
  49. package/dist/collection/types/GenericTypes.js +1 -0
  50. package/dist/components/kup-autocomplete2.js +18 -9
  51. package/dist/components/kup-dashboard.js +0 -3
  52. package/dist/components/kup-family-tree.js +1 -1
  53. package/dist/components/kup-planner.js +1039 -547
  54. package/dist/components/kup-progress-bar.js +1 -1
  55. package/dist/components/kup-qlik.js +1 -1
  56. package/dist/components/kup-radio.js +1 -1
  57. package/dist/components/kup-rating.js +1 -1
  58. package/dist/components/kup-spinner.js +1 -1
  59. package/dist/components/kup-switch.js +1 -1
  60. package/dist/components/kup-tab-bar.js +1 -1
  61. package/dist/components/kup-text-field.js +1 -1
  62. package/dist/components/kup-time-picker.js +1 -1
  63. package/dist/components/kup-tree.js +1 -1
  64. package/dist/esm/{f-button-eedbdba1.js → f-button-b7f77b26.js} +1 -1
  65. package/dist/esm/{f-cell-90a418d2.js → f-cell-dc3beffe.js} +4 -4
  66. package/dist/esm/{f-chip-45e7b3f6.js → f-chip-0a678211.js} +2 -2
  67. package/dist/esm/{f-image-3026f0fe.js → f-image-f84dbd7c.js} +4 -4
  68. package/dist/esm/{f-paginator-utils-6369da7c.js → f-paginator-utils-52902bd6.js} +2 -2
  69. package/dist/esm/{f-text-field-3b70a6f0.js → f-text-field-7dd143be.js} +1 -1
  70. package/dist/esm/ketchup.js +2 -2
  71. package/dist/esm/kup-accordion.entry.js +2 -2
  72. package/dist/esm/kup-autocomplete_27.entry.js +18 -12
  73. package/dist/esm/kup-box.entry.js +7 -7
  74. package/dist/esm/kup-calendar.entry.js +4 -4
  75. package/dist/esm/kup-cell.entry.js +5 -5
  76. package/dist/esm/kup-dash-list.entry.js +1 -1
  77. package/dist/esm/kup-dash_2.entry.js +1 -1
  78. package/dist/esm/kup-dashboard.entry.js +4 -7
  79. package/dist/esm/kup-drawer.entry.js +1 -1
  80. package/dist/esm/kup-echart.entry.js +1 -1
  81. package/dist/esm/kup-family-tree.entry.js +4 -4
  82. package/dist/esm/kup-iframe.entry.js +1 -1
  83. package/dist/esm/kup-image-list.entry.js +6 -6
  84. package/dist/esm/kup-lazy.entry.js +1 -1
  85. package/dist/esm/kup-magic-box.entry.js +2 -2
  86. package/dist/esm/{kup-manager-cad802b1.js → kup-manager-a5ab58a0.js} +3 -0
  87. package/dist/esm/kup-nav-bar.entry.js +1 -1
  88. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  89. package/dist/esm/kup-photo-frame.entry.js +1 -1
  90. package/dist/esm/kup-planner.entry.js +1031 -546
  91. package/dist/esm/kup-probe.entry.js +1 -1
  92. package/dist/esm/kup-qlik.entry.js +2 -2
  93. package/dist/esm/kup-snackbar.entry.js +3 -3
  94. package/dist/esm/loader.js +2 -2
  95. package/dist/ketchup/ketchup.esm.js +1 -1
  96. package/dist/ketchup/{p-c1d8fd43.entry.js → p-00fc0f80.entry.js} +1 -1
  97. package/dist/ketchup/{p-b1da7902.entry.js → p-166257d0.entry.js} +1 -1
  98. package/dist/ketchup/{p-ae3e0d31.js → p-28efed63.js} +1 -1
  99. package/dist/ketchup/{p-fe34fa6e.entry.js → p-3ae1409f.entry.js} +1 -1
  100. package/dist/ketchup/p-4fd6c34c.js +30 -0
  101. package/dist/ketchup/{p-73becdb8.entry.js → p-6022c951.entry.js} +1 -1
  102. package/dist/ketchup/{p-4505a48d.js → p-69f3b9da.js} +1 -1
  103. package/dist/ketchup/p-7040cab7.entry.js +1 -0
  104. package/dist/ketchup/{p-a1adab40.js → p-7065b172.js} +1 -1
  105. package/dist/ketchup/p-71cb80ac.entry.js +9 -0
  106. package/dist/ketchup/{p-b0675bce.entry.js → p-78d1fc60.entry.js} +1 -1
  107. package/dist/ketchup/{p-a89f0884.entry.js → p-871cfe60.entry.js} +1 -1
  108. package/dist/ketchup/p-8d0e6825.entry.js +1 -0
  109. package/dist/ketchup/{p-9f1184cd.entry.js → p-98ff4101.entry.js} +6 -6
  110. package/dist/ketchup/{p-eea29062.entry.js → p-9ae47a0d.entry.js} +1 -1
  111. package/dist/ketchup/{p-1cd45a72.entry.js → p-a122b8d3.entry.js} +1 -1
  112. package/dist/ketchup/{p-23288eed.entry.js → p-a32cc181.entry.js} +1 -1
  113. package/dist/ketchup/{p-1ad48de4.entry.js → p-beb0907a.entry.js} +1 -1
  114. package/dist/ketchup/{p-32dc31ad.js → p-c5c6a2fb.js} +1 -1
  115. package/dist/ketchup/{p-138ac8b9.entry.js → p-c797ab39.entry.js} +1 -1
  116. package/dist/ketchup/p-d1e3573f.js +1 -0
  117. package/dist/ketchup/{p-d0f4457e.entry.js → p-d2670436.entry.js} +1 -1
  118. package/dist/ketchup/{p-97afbd71.entry.js → p-d315f7fa.entry.js} +1 -1
  119. package/dist/ketchup/{p-2d8b5bba.entry.js → p-d711e9ae.entry.js} +1 -1
  120. package/dist/ketchup/{p-7bd28eac.js → p-de34eb56.js} +1 -1
  121. package/dist/ketchup/{p-263b2c73.entry.js → p-e92d1972.entry.js} +1 -1
  122. package/dist/ketchup/{p-2217be0a.entry.js → p-efb80719.entry.js} +1 -1
  123. package/dist/ketchup/p-f158836b.entry.js +39 -0
  124. package/dist/ketchup/p-f69a6d89.entry.js +10 -0
  125. package/dist/types/components/kup-image/kup-image.d.ts +2 -0
  126. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +58 -17
  127. package/dist/types/components/kup-planner/kup-planner-helper.d.ts +6 -0
  128. package/dist/types/components/kup-planner/kup-planner.d.ts +120 -5
  129. package/dist/types/components.d.ts +235 -2
  130. package/dist/types/f-components/f-image/f-image-declarations.d.ts +1 -0
  131. package/dist/types/types/GenericTypes.d.ts +1 -0
  132. package/package.json +8 -6
  133. package/dist/ketchup/p-4e68f629.entry.js +0 -1
  134. package/dist/ketchup/p-a7ae0b4d.js +0 -1
  135. package/dist/ketchup/p-b63a5a44.js +0 -30
  136. package/dist/ketchup/p-bb6921bc.entry.js +0 -1
  137. package/dist/ketchup/p-cb6c8417.entry.js +0 -10
  138. package/dist/ketchup/p-fd948af0.entry.js +0 -9
  139. package/dist/ketchup/p-ff11d6d0.entry.js +0 -39
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
- import { a8 as createCommonjsModule, k as kupManagerInstance, g as getProps, s as setProps, c as componentWrapperId, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$f, t as defineCustomElement$g, u as defineCustomElement$h, v as defineCustomElement$i, w as defineCustomElement$j, x as defineCustomElement$k, y as defineCustomElement$l, z as defineCustomElement$m, A as defineCustomElement$n, B as defineCustomElement$o, C as defineCustomElement$p, D as defineCustomElement$q, E as defineCustomElement$r, G as defineCustomElement$s } from './kup-autocomplete2.js';
2
+ import { a8 as createCommonjsModule, k as kupManagerInstance, aE as KupDatesFormats, ak as getCellValueForDisplay, g as getProps, s as setProps, Y as FTextFieldMDC, c as componentWrapperId, an as FTextField, a as KupThemeIconValues, Z as KupLanguageSearch, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$f, t as defineCustomElement$g, u as defineCustomElement$h, v as defineCustomElement$i, w as defineCustomElement$j, x as defineCustomElement$k, y as defineCustomElement$l, z as defineCustomElement$m, A as defineCustomElement$n, B as defineCustomElement$o, C as defineCustomElement$p, D as defineCustomElement$q, E as defineCustomElement$r, G as defineCustomElement$s } from './kup-autocomplete2.js';
3
3
 
4
4
  /**
5
5
  * Props of the kup-gantt component.
@@ -8,26 +8,46 @@ import { a8 as createCommonjsModule, k as kupManagerInstance, g as getProps, s a
8
8
  var KupPlannerProps;
9
9
  (function (KupPlannerProps) {
10
10
  KupPlannerProps["customStyle"] = "Custom style of the component.";
11
- KupPlannerProps["taskIdCol"] = "Unique task identifier";
12
- KupPlannerProps["taskNameCol"] = "Task name displayed";
13
- KupPlannerProps["taskDates"] = "Task duration, from (firstDate) to (secondDate)";
14
- KupPlannerProps["taskPrevDates"] = "Forecast task duration, from (firstDate) to (secondDate)";
15
- KupPlannerProps["taskColumns"] = "Columns containing informations displayed on the left box near the gantt";
16
- KupPlannerProps["phaseIdCol"] = "Unique phase identifier";
17
- KupPlannerProps["phaseNameCol"] = "Phase name displayed";
18
- KupPlannerProps["phaseDates"] = "Phase duration, from (firstDate) to (secondDate)";
19
- KupPlannerProps["phasePrevDates"] = "Forecast phase duration, from (firstDate) to (secondDate)";
20
- KupPlannerProps["phaseColumns"] = "Columns containing informations displayed on the left box near the gantt";
21
- KupPlannerProps["phaseColorCol"] = "Phase color in hex format";
22
- KupPlannerProps["phaseColParDep"] = "Names of the parent phases";
23
- KupPlannerProps["titleMess"] = "Message displayed";
24
- KupPlannerProps["data"] = "Dataset containg the task list";
11
+ KupPlannerProps["data"] = "Dataset containg the tasks list";
12
+ KupPlannerProps["detailData"] = "Dataset containg the details list";
13
+ KupPlannerProps["detailColorCol"] = "Column containing the detail color, in hex format";
14
+ KupPlannerProps["detailColumns"] = "Columns containing informations displayed in the left box, near the gantt of details";
15
+ KupPlannerProps["detailDates"] = "Columns containing detail duration, from (firstDate) to (secondDate)";
16
+ KupPlannerProps["detailHeight"] = "Height for detail gantt";
17
+ KupPlannerProps["detailIdCol"] = "Column containing unique detail identifier";
18
+ KupPlannerProps["detailNameCol"] = "Column containing detail name displayed";
19
+ KupPlannerProps["detailPrevDates"] = "Columns containing forecast detail duration, from (firstDate) to (secondDate)";
20
+ KupPlannerProps["listCellWidth"] = "Total size of the cells inside to the left box, near the gantt";
21
+ KupPlannerProps["maxWidth"] = "Max width for component";
22
+ KupPlannerProps["phaseColorCol"] = "Column containing the phase color in hex format";
23
+ KupPlannerProps["phaseColumns"] = "Columns containing informations displayed in the left box ,near the gantt of phases";
24
+ KupPlannerProps["phaseColParDep"] = "Column containing the name of the parent phases";
25
+ KupPlannerProps["phaseDates"] = "Columns containing phase duration, from (firstDate) to (secondDate)";
26
+ KupPlannerProps["phaseIdCol"] = "Column containing unique phase identifier";
27
+ KupPlannerProps["phaseNameCol"] = "Column containing phase name displayed";
28
+ KupPlannerProps["phasePrevDates"] = "Columns containing forecast phase duration, from (firstDate) to (secondDate)";
29
+ KupPlannerProps["showSecondaryDates"] = "Enable/disable display of secondary dates";
30
+ KupPlannerProps["taskColumns"] = "Columns containing informations displayed in the left box, near the gantt";
31
+ KupPlannerProps["taskDates"] = "Columns containing task duration, from (firstDate) to (secondDate)";
32
+ KupPlannerProps["taskHeight"] = "Height for main gantt";
33
+ KupPlannerProps["taskIdCol"] = "Column containing unique task identifier";
34
+ KupPlannerProps["taskNameCol"] = "Column containing task name displayed";
35
+ KupPlannerProps["taskPrevDates"] = "Columns containing forecast task duration, from (firstDate) to (secondDate)";
36
+ KupPlannerProps["titleMess"] = "Message displayed on top";
25
37
  })(KupPlannerProps || (KupPlannerProps = {}));
26
38
  var KupPlannerTaskAction;
27
39
  (function (KupPlannerTaskAction) {
28
- KupPlannerTaskAction["onOpening"] = "onOpening";
29
- KupPlannerTaskAction["onClosing"] = "onClosing";
40
+ KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
41
+ KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
42
+ KupPlannerTaskAction["onClick"] = "onClick";
43
+ KupPlannerTaskAction["onResize"] = "onResize";
30
44
  })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
45
+ var KupPlannerGanttRowType;
46
+ (function (KupPlannerGanttRowType) {
47
+ KupPlannerGanttRowType["TASK"] = "task";
48
+ KupPlannerGanttRowType["PHASE"] = "phase";
49
+ KupPlannerGanttRowType["DETAIL"] = "detail";
50
+ })(KupPlannerGanttRowType || (KupPlannerGanttRowType = {}));
31
51
  class KupPlannerLastOnChangeReceived {
32
52
  constructor(event, threshold = 100) {
33
53
  this.dateTime = new Date();
@@ -42,7 +62,20 @@ class KupPlannerLastOnChangeReceived {
42
62
  resetDateTime() {
43
63
  this.dateTime = new Date();
44
64
  }
45
- }
65
+ }
66
+ const defaultStylingOptions = {
67
+ listCellWidth: '300px',
68
+ rowHeight: 40,
69
+ barFill: 90,
70
+ projectProgressColor: '#CBCBCB',
71
+ projectProgressSelectedColor: '#CBCBCB',
72
+ projectBackgroundColor: '#CBCBCB',
73
+ projectBackgroundSelectedColor: '#CBCBCB',
74
+ barProgressColor: '#A2A415',
75
+ barProgressSelectedColor: '#A2A415',
76
+ barBackgroundColor: '#A2A415',
77
+ barBackgroundSelectedColor: '#A2A415',
78
+ };
46
79
 
47
80
  /**
48
81
  * @license React
@@ -8345,18 +8378,6 @@ function _extends() {
8345
8378
  };
8346
8379
  return _extends.apply(this, arguments);
8347
8380
  }
8348
- function _objectWithoutPropertiesLoose(source, excluded) {
8349
- if (source == null) return {};
8350
- var target = {};
8351
- var sourceKeys = Object.keys(source);
8352
- var key, i;
8353
- for (i = 0; i < sourceKeys.length; i++) {
8354
- key = sourceKeys[i];
8355
- if (excluded.indexOf(key) >= 0) continue;
8356
- target[key] = source[key];
8357
- }
8358
- return target;
8359
- }
8360
8381
  function _unsupportedIterableToArray(o, minLen) {
8361
8382
  if (!o) return;
8362
8383
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -8400,6 +8421,233 @@ var ViewMode;
8400
8421
  ViewMode["Year"] = "Year";
8401
8422
  })(ViewMode || (ViewMode = {}));
8402
8423
 
8424
+ var TimeUnit;
8425
+ (function (TimeUnit) {
8426
+ TimeUnit["DAY"] = "days";
8427
+ TimeUnit["WEEK"] = "weeks";
8428
+ TimeUnit["MONTH"] = "months";
8429
+ TimeUnit["YEAR"] = "YEAR";
8430
+ })(TimeUnit || (TimeUnit = {}));
8431
+ var parseToDayStart = function parseToDayStart(ymd) {
8432
+ return luxon.DateTime.fromISO(ymd).toJSDate();
8433
+ };
8434
+ var parseToDayEnd = function parseToDayEnd(endDate) {
8435
+ return luxon.DateTime.fromISO(endDate).plus({
8436
+ seconds: 86400 - 1
8437
+ }).toJSDate();
8438
+ };
8439
+ var formatToIsoDate = function formatToIsoDate(date) {
8440
+ var _DateTime$fromJSDate$;
8441
+ return (_DateTime$fromJSDate$ = luxon.DateTime.fromJSDate(date).toISODate()) != null ? _DateTime$fromJSDate$ : undefined;
8442
+ };
8443
+ var formatToLocaleSimple = function formatToLocaleSimple(date) {
8444
+ return luxon.DateTime.fromJSDate(date).toFormat("dd/MM/yyyy");
8445
+ };
8446
+ function validDates(startDate, endDate, _name) {
8447
+ var _start;
8448
+ var start = parseToDayStart(startDate);
8449
+ var end = parseToDayEnd(endDate);
8450
+ if (((_start = start) === null || _start === void 0 ? void 0 : _start.getTime()) > (end === null || end === void 0 ? void 0 : end.getTime())) {
8451
+ start = parseToDayStart(endDate);
8452
+ }
8453
+ return {
8454
+ start: start,
8455
+ end: end
8456
+ };
8457
+ }
8458
+
8459
+ var MAIN_GANTT_ID = "main";
8460
+ var SECONDARY_GANTT_ID = "secondary";
8461
+ var toViewMode = function toViewMode(timeUnit) {
8462
+ switch (timeUnit) {
8463
+ case TimeUnit.DAY:
8464
+ return ViewMode.Day;
8465
+ case TimeUnit.WEEK:
8466
+ return ViewMode.Week;
8467
+ case TimeUnit.MONTH:
8468
+ return ViewMode.Month;
8469
+ case TimeUnit.YEAR:
8470
+ return ViewMode.Year;
8471
+ }
8472
+ };
8473
+ var convertPhaseToTask = function convertPhaseToTask(item) {
8474
+ var mapPhase = function mapPhase(_ref) {
8475
+ var phaseStart = _ref.startDate,
8476
+ phaseEnd = _ref.endDate,
8477
+ secondaryStartDate = _ref.secondaryStartDate,
8478
+ secondaryEndDate = _ref.secondaryEndDate,
8479
+ phaseName = _ref.name,
8480
+ phaseId = _ref.id,
8481
+ color = _ref.color,
8482
+ selectedColor = _ref.selectedColor,
8483
+ dependencies = _ref.dependencies;
8484
+ var _validDates = validDates(phaseStart, phaseEnd),
8485
+ start = _validDates.start,
8486
+ end = _validDates.end;
8487
+ var _validDates2 = validDates(secondaryStartDate, secondaryEndDate),
8488
+ phaseStart2 = _validDates2.start,
8489
+ phaseEnd2 = _validDates2.end;
8490
+ return {
8491
+ start: start,
8492
+ end: end,
8493
+ secondaryStart: phaseStart2,
8494
+ secondaryEnd: phaseEnd2,
8495
+ name: phaseName,
8496
+ valuesToShow: item.valuesToShow,
8497
+ id: phaseId,
8498
+ type: "task",
8499
+ progress: 100,
8500
+ dependencies: dependencies,
8501
+ styles: color ? {
8502
+ backgroundColor: color,
8503
+ progressColor: color,
8504
+ backgroundSelectedColor: selectedColor,
8505
+ progressSelectedColor: selectedColor
8506
+ } : {}
8507
+ };
8508
+ };
8509
+ return mapPhase(item);
8510
+ };
8511
+ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttStartDate, mainGanttEndDate) {
8512
+ var id = item.id,
8513
+ name = item.name,
8514
+ schedule = item.schedule;
8515
+ var getDatesForTask = function getDatesForTask(item) {
8516
+ var start = mainGanttStartDate != null ? mainGanttStartDate : "";
8517
+ var end = mainGanttEndDate != null ? mainGanttEndDate : "";
8518
+ for (var i = 0; i < item.schedule.length; i++) {
8519
+ var lstart = item.schedule[i].startDate;
8520
+ var lend = item.schedule[i].endDate;
8521
+ if (!start || lstart.localeCompare(start) < 0) {
8522
+ start = lstart;
8523
+ }
8524
+ if (!end || lend.localeCompare(end) > 0) {
8525
+ end = lend;
8526
+ }
8527
+ }
8528
+ return validDates(start, end);
8529
+ };
8530
+ var _getDatesForTask = getDatesForTask(item),
8531
+ start = _getDatesForTask.start,
8532
+ end = _getDatesForTask.end;
8533
+ var convertToFrame = function convertToFrame(x) {
8534
+ var startDate = x.startDate,
8535
+ endDate = x.endDate,
8536
+ color = x.color,
8537
+ selectedColor = x.selectedColor;
8538
+ var _validDates3 = validDates(startDate, endDate),
8539
+ start = _validDates3.start,
8540
+ end = _validDates3.end;
8541
+ return {
8542
+ start: start,
8543
+ end: end,
8544
+ backgroundColor: color != null ? color : "0xffffff",
8545
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color
8546
+ };
8547
+ };
8548
+ var defaultColor = "#595959";
8549
+ return {
8550
+ id: id,
8551
+ type: "timeline",
8552
+ timeline: schedule.map(convertToFrame),
8553
+ name: name,
8554
+ valuesToShow: item.valuesToShow,
8555
+ start: start,
8556
+ end: end,
8557
+ progress: 100,
8558
+ styles: {
8559
+ backgroundColor: defaultColor,
8560
+ progressColor: defaultColor,
8561
+ backgroundSelectedColor: defaultColor,
8562
+ progressSelectedColor: defaultColor
8563
+ }
8564
+ };
8565
+ };
8566
+ var isDetail = function isDetail(row) {
8567
+ return row && row.schedule && row.schedule.length !== 0;
8568
+ };
8569
+ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartDate, mainGanttEndDate) {
8570
+ if (!isDetail(item)) {
8571
+ var _row$phases;
8572
+ var row = item;
8573
+ var _validDates4 = validDates(row.startDate, row.endDate),
8574
+ start = _validDates4.start,
8575
+ end = _validDates4.end;
8576
+ var _validDates5 = validDates(row.secondaryStartDate, row.secondaryEndDate),
8577
+ start2 = _validDates5.start,
8578
+ end2 = _validDates5.end;
8579
+ var mainTask = {
8580
+ start: start,
8581
+ end: end,
8582
+ id: row.id,
8583
+ name: row.name,
8584
+ type: row.type,
8585
+ valuesToShow: row.valuesToShow,
8586
+ secondaryStart: start2,
8587
+ secondaryEnd: end2,
8588
+ progress: 100,
8589
+ isDisabled: false,
8590
+ hideChildren: false
8591
+ };
8592
+ var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
8593
+ return [mainTask].concat(children1);
8594
+ } else {
8595
+ var _row = item;
8596
+ return [_extends({}, convertDetailToTimeline(_row, mainGanttStartDate, mainGanttEndDate))];
8597
+ }
8598
+ };
8599
+ var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref2) {
8600
+ var id = _ref2.id,
8601
+ start = _ref2.start,
8602
+ end = _ref2.end;
8603
+ return projects.map(function (project) {
8604
+ return project.id === id ? withNewDates(project, start, end) : project;
8605
+ });
8606
+ };
8607
+ var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref3) {
8608
+ var id = _ref3.id,
8609
+ start = _ref3.start,
8610
+ end = _ref3.end;
8611
+ if (phases) {
8612
+ return phases.map(function (phase) {
8613
+ return phase.id === id ? withNewDates(phase, start, end) : phase;
8614
+ });
8615
+ }
8616
+ return undefined;
8617
+ };
8618
+ var withNewDates = function withNewDates(p, start, end) {
8619
+ var startDate = formatToIsoDate(start);
8620
+ var endDate = formatToIsoDate(end);
8621
+ var extra = {
8622
+ startDate: startDate,
8623
+ endDate: endDate
8624
+ };
8625
+ return _extends({}, p, extra);
8626
+ };
8627
+ var getProjectById = function getProjectById(id, items) {
8628
+ for (var i = 0; i < items.length; i++) {
8629
+ if (items[i].id === id) {
8630
+ return items[i];
8631
+ }
8632
+ }
8633
+ return undefined;
8634
+ };
8635
+ var getPhaseById = function getPhaseById(id, items) {
8636
+ for (var i = 0; i < items.length; i++) {
8637
+ if (isDetail(items[i])) {
8638
+ continue;
8639
+ }
8640
+ var item = items[i];
8641
+ if (!item.phases) {
8642
+ continue;
8643
+ }
8644
+ for (var j = 0; j < item.phases.length; j++) if (item.phases[j].id === id) {
8645
+ return item.phases[j];
8646
+ }
8647
+ }
8648
+ return undefined;
8649
+ };
8650
+
8403
8651
  var intlDTCache = {};
8404
8652
  var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts) {
8405
8653
  if (opts === void 0) {
@@ -8414,80 +8662,157 @@ var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts)
8414
8662
  return dtf;
8415
8663
  };
8416
8664
  var addToDate = function addToDate(date, quantity, scale) {
8417
- 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));
8665
+ 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));
8418
8666
  return newDate;
8419
8667
  };
8420
8668
  var startOfDate = function startOfDate(date, scale) {
8421
- var scores = ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'];
8669
+ var scores = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
8422
8670
  var shouldReset = function shouldReset(_scale) {
8423
8671
  var maxScore = scores.indexOf(scale);
8424
8672
  return scores.indexOf(_scale) <= maxScore;
8425
8673
  };
8426
- 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());
8674
+ 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());
8427
8675
  return newDate;
8428
8676
  };
8429
- var ganttDateRange = function ganttDateRange(tasks, viewMode, preStepsCount, showSecondaryDates) {
8430
- var newStartDate = tasks[0].start;
8431
- var newEndDate = tasks[0].start;
8432
- for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
8433
- var task = _step.value;
8434
- if (task.start < newStartDate) {
8435
- newStartDate = task.start;
8677
+ var ganttDateRangeFromTask = function ganttDateRangeFromTask(tasks, viewMode, preStepsCount, showSecondaryDates, mainGanttStartDate, mainGanttEndDate) {
8678
+ var dates = [];
8679
+ tasks.forEach(function (item) {
8680
+ dates.push({
8681
+ start: item.start,
8682
+ end: item.end,
8683
+ secondaryStart: item.secondaryStart,
8684
+ secondaryEnd: item.secondaryEnd
8685
+ });
8686
+ });
8687
+ if (mainGanttStartDate && mainGanttEndDate) {
8688
+ dates.push({
8689
+ start: mainGanttStartDate,
8690
+ end: mainGanttEndDate,
8691
+ secondaryStart: undefined,
8692
+ secondaryEnd: undefined
8693
+ });
8694
+ }
8695
+ return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates);
8696
+ };
8697
+ var calculateDisplayedDateRange = function calculateDisplayedDateRange(mainGanttItems, timeUnit, mainGanttDoubleView, secondaryGanttItems, preStepsCount) {
8698
+ var dates = ganttDateRangeFromGanttTask(mainGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
8699
+ if (secondaryGanttItems) {
8700
+ var dates2 = ganttDateRangeFromDetail(secondaryGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
8701
+ if (dates2[0] < dates[0]) {
8702
+ dates[0] = dates2[0];
8703
+ }
8704
+ if (dates2[1] > dates[1]) {
8705
+ dates[1] = dates2[1];
8706
+ }
8707
+ }
8708
+ return {
8709
+ displayedStartDate: dates[0],
8710
+ displayedEndDate: dates[1]
8711
+ };
8712
+ };
8713
+ var ganttDateRangeFromGanttTask = function ganttDateRangeFromGanttTask(tasks, viewMode, preStepsCount, showSecondaryDates) {
8714
+ var dates = [];
8715
+ tasks.forEach(function (item) {
8716
+ var _item$phases;
8717
+ dates.push({
8718
+ start: parseToDayStart(item.startDate),
8719
+ end: parseToDayEnd(item.endDate),
8720
+ secondaryStart: parseToDayStart(item.secondaryStartDate),
8721
+ secondaryEnd: parseToDayEnd(item.secondaryEndDate)
8722
+ });
8723
+ (_item$phases = item.phases) === null || _item$phases === void 0 ? void 0 : _item$phases.forEach(function (phase) {
8724
+ dates.push({
8725
+ start: parseToDayStart(phase.startDate),
8726
+ end: parseToDayEnd(phase.endDate),
8727
+ secondaryStart: parseToDayStart(phase.secondaryStartDate),
8728
+ secondaryEnd: parseToDayEnd(phase.secondaryEndDate)
8729
+ });
8730
+ });
8731
+ });
8732
+ return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
8733
+ };
8734
+ var ganttDateRangeFromDetail = function ganttDateRangeFromDetail(details, viewMode, preStepsCount, showSecondaryDates) {
8735
+ var dates = [];
8736
+ details.forEach(function (item) {
8737
+ var scheduleItems = item.schedule;
8738
+ if (scheduleItems) {
8739
+ scheduleItems.forEach(function (item) {
8740
+ dates.push({
8741
+ start: parseToDayStart(item.startDate),
8742
+ end: parseToDayEnd(item.endDate),
8743
+ secondaryStart: undefined,
8744
+ secondaryEnd: undefined
8745
+ });
8746
+ });
8436
8747
  }
8437
- if (task.end > newEndDate) {
8438
- newEndDate = task.end;
8748
+ });
8749
+ return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
8750
+ };
8751
+ var ganttDateRangeGeneric = function ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, realDates) {
8752
+ var newStartDate = dates.length > 0 ? dates[0].start : new Date();
8753
+ var newEndDate = dates.length > 0 ? dates[0].end : new Date();
8754
+ for (var _iterator = _createForOfIteratorHelperLoose(dates), _step; !(_step = _iterator()).done;) {
8755
+ var d = _step.value;
8756
+ if (d.start < newStartDate) {
8757
+ newStartDate = d.start;
8758
+ }
8759
+ if (d.end > newEndDate) {
8760
+ newEndDate = d.end;
8439
8761
  }
8440
8762
  if (showSecondaryDates) {
8441
- if (task.secondaryStart && task.secondaryStart < newStartDate) {
8442
- newStartDate = task.secondaryStart;
8763
+ if (d.secondaryStart && d.secondaryStart < newStartDate) {
8764
+ newStartDate = d.secondaryStart;
8443
8765
  }
8444
- if (task.secondaryEnd && task.secondaryEnd > newEndDate) {
8445
- newEndDate = task.secondaryEnd;
8766
+ if (d.secondaryEnd && d.secondaryEnd > newEndDate) {
8767
+ newEndDate = d.secondaryEnd;
8446
8768
  }
8447
8769
  }
8448
8770
  }
8771
+ if (realDates) {
8772
+ return [newStartDate, newEndDate];
8773
+ }
8449
8774
  switch (viewMode) {
8450
8775
  case ViewMode.Year:
8451
- newStartDate = addToDate(newStartDate, -1, 'year');
8452
- newStartDate = startOfDate(newStartDate, 'year');
8453
- newEndDate = addToDate(newEndDate, 1, 'year');
8454
- newEndDate = startOfDate(newEndDate, 'year');
8776
+ newStartDate = addToDate(newStartDate, -1, "year");
8777
+ newStartDate = startOfDate(newStartDate, "year");
8778
+ newEndDate = addToDate(newEndDate, 1, "year");
8779
+ newEndDate = startOfDate(newEndDate, "year");
8455
8780
  break;
8456
8781
  case ViewMode.Month:
8457
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'month');
8458
- newStartDate = startOfDate(newStartDate, 'month');
8459
- newEndDate = addToDate(newEndDate, 1, 'year');
8460
- newEndDate = startOfDate(newEndDate, 'year');
8782
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "month");
8783
+ newStartDate = startOfDate(newStartDate, "month");
8784
+ newEndDate = addToDate(newEndDate, 1, "year");
8785
+ newEndDate = startOfDate(newEndDate, "year");
8461
8786
  break;
8462
8787
  case ViewMode.Week:
8463
- newStartDate = startOfDate(newStartDate, 'day');
8464
- newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, 'day');
8465
- newEndDate = startOfDate(newEndDate, 'day');
8466
- newEndDate = addToDate(newEndDate, 1.5, 'month');
8788
+ newStartDate = startOfDate(newStartDate, "day");
8789
+ newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, "day");
8790
+ newEndDate = startOfDate(newEndDate, "day");
8791
+ newEndDate = addToDate(newEndDate, 1.5, "month");
8467
8792
  break;
8468
8793
  case ViewMode.Day:
8469
- newStartDate = startOfDate(newStartDate, 'day');
8470
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'day');
8471
- newEndDate = startOfDate(newEndDate, 'day');
8472
- newEndDate = addToDate(newEndDate, 19, 'day');
8794
+ newStartDate = startOfDate(newStartDate, "day");
8795
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
8796
+ newEndDate = startOfDate(newEndDate, "day");
8797
+ newEndDate = addToDate(newEndDate, 19, "day");
8473
8798
  break;
8474
8799
  case ViewMode.QuarterDay:
8475
- newStartDate = startOfDate(newStartDate, 'day');
8476
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'day');
8477
- newEndDate = startOfDate(newEndDate, 'day');
8478
- newEndDate = addToDate(newEndDate, 66, 'hour');
8800
+ newStartDate = startOfDate(newStartDate, "day");
8801
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
8802
+ newEndDate = startOfDate(newEndDate, "day");
8803
+ newEndDate = addToDate(newEndDate, 66, "hour");
8479
8804
  break;
8480
8805
  case ViewMode.HalfDay:
8481
- newStartDate = startOfDate(newStartDate, 'day');
8482
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'day');
8483
- newEndDate = startOfDate(newEndDate, 'day');
8484
- newEndDate = addToDate(newEndDate, 108, 'hour');
8806
+ newStartDate = startOfDate(newStartDate, "day");
8807
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
8808
+ newEndDate = startOfDate(newEndDate, "day");
8809
+ newEndDate = addToDate(newEndDate, 108, "hour");
8485
8810
  break;
8486
8811
  case ViewMode.Hour:
8487
- newStartDate = startOfDate(newStartDate, 'hour');
8488
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, 'hour');
8489
- newEndDate = startOfDate(newEndDate, 'day');
8490
- newEndDate = addToDate(newEndDate, 1, 'day');
8812
+ newStartDate = startOfDate(newStartDate, "hour");
8813
+ newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
8814
+ newEndDate = startOfDate(newEndDate, "day");
8815
+ newEndDate = addToDate(newEndDate, 1, "day");
8491
8816
  break;
8492
8817
  }
8493
8818
  return [newStartDate, newEndDate];
@@ -8498,25 +8823,25 @@ var seedDates = function seedDates(startDate, endDate, viewMode) {
8498
8823
  while (currentDate < endDate) {
8499
8824
  switch (viewMode) {
8500
8825
  case ViewMode.Year:
8501
- currentDate = addToDate(currentDate, 1, 'year');
8826
+ currentDate = addToDate(currentDate, 1, "year");
8502
8827
  break;
8503
8828
  case ViewMode.Month:
8504
- currentDate = addToDate(currentDate, 1, 'month');
8829
+ currentDate = addToDate(currentDate, 1, "month");
8505
8830
  break;
8506
8831
  case ViewMode.Week:
8507
- currentDate = addToDate(currentDate, 7, 'day');
8832
+ currentDate = addToDate(currentDate, 7, "day");
8508
8833
  break;
8509
8834
  case ViewMode.Day:
8510
- currentDate = addToDate(currentDate, 1, 'day');
8835
+ currentDate = addToDate(currentDate, 1, "day");
8511
8836
  break;
8512
8837
  case ViewMode.HalfDay:
8513
- currentDate = addToDate(currentDate, 12, 'hour');
8838
+ currentDate = addToDate(currentDate, 12, "hour");
8514
8839
  break;
8515
8840
  case ViewMode.QuarterDay:
8516
- currentDate = addToDate(currentDate, 6, 'hour');
8841
+ currentDate = addToDate(currentDate, 6, "hour");
8517
8842
  break;
8518
8843
  case ViewMode.Hour:
8519
- currentDate = addToDate(currentDate, 1, 'hour');
8844
+ currentDate = addToDate(currentDate, 1, "hour");
8520
8845
  break;
8521
8846
  }
8522
8847
  dates.push(currentDate);
@@ -8525,7 +8850,7 @@ var seedDates = function seedDates(startDate, endDate, viewMode) {
8525
8850
  };
8526
8851
  var getLocaleMonth = function getLocaleMonth(date, locale) {
8527
8852
  var bottomValue = getCachedDateTimeFormat(locale, {
8528
- month: 'long'
8853
+ month: "long"
8529
8854
  }).format(date);
8530
8855
  bottomValue = bottomValue.replace(bottomValue[0], bottomValue[0].toLocaleUpperCase());
8531
8856
  return bottomValue;
@@ -8575,15 +8900,15 @@ var defaultDateTimeFormatters = {
8575
8900
  return "W" + getWeekNumberISO8601(date);
8576
8901
  },
8577
8902
  day: function day(date, locale) {
8578
- return getLocalDayOfWeek(date, locale, 'short') + ", " + date.getDate().toString();
8903
+ return getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
8579
8904
  },
8580
8905
  hour: function hour(date, locale) {
8581
8906
  return "" + getCachedDateTimeFormat(locale, {
8582
- hour: 'numeric'
8907
+ hour: "numeric"
8583
8908
  }).format(date);
8584
8909
  },
8585
8910
  dayAndMonth: function dayAndMonth(date, locale) {
8586
- return getLocalDayOfWeek(date, locale, 'short') + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
8911
+ return getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
8587
8912
  }
8588
8913
  };
8589
8914
 
@@ -8859,7 +9184,8 @@ var TaskList = function TaskList(_ref) {
8859
9184
  taskListRef = _ref.taskListRef,
8860
9185
  horizontalContainerClass = _ref.horizontalContainerClass,
8861
9186
  TaskListHeader = _ref.TaskListHeader,
8862
- TaskListTable = _ref.TaskListTable;
9187
+ TaskListTable = _ref.TaskListTable,
9188
+ filter = _ref.filter;
8863
9189
  var horizontalContainerRef = react.useRef(null);
8864
9190
  react.useEffect(function () {
8865
9191
  if (horizontalContainerRef.current) {
@@ -8884,6 +9210,10 @@ var TaskList = function TaskList(_ref) {
8884
9210
  setSelectedTask: setSelectedTask,
8885
9211
  onExpanderClick: onExpanderClick
8886
9212
  };
9213
+ react.useEffect(function () {
9214
+ var _taskListRef$current;
9215
+ (_taskListRef$current = taskListRef.current) === null || _taskListRef$current === void 0 ? void 0 : _taskListRef$current.prepend(filter);
9216
+ }, [taskListRef, filter]);
8887
9217
  return react.createElement("div", {
8888
9218
  ref: taskListRef,
8889
9219
  className: classes.tasks
@@ -8903,9 +9233,7 @@ var GridBody = function GridBody(_ref) {
8903
9233
  dates = _ref.dates,
8904
9234
  rowHeight = _ref.rowHeight,
8905
9235
  svgWidth = _ref.svgWidth,
8906
- columnWidth = _ref.columnWidth,
8907
- todayColor = _ref.todayColor,
8908
- rtl = _ref.rtl;
9236
+ columnWidth = _ref.columnWidth;
8909
9237
  var y = 0;
8910
9238
  var gridRows = [];
8911
9239
  var rowLines = [react.createElement("line", {
@@ -8919,7 +9247,7 @@ var GridBody = function GridBody(_ref) {
8919
9247
  for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
8920
9248
  var task = _step.value;
8921
9249
  gridRows.push(react.createElement("rect", {
8922
- key: 'Row' + task.id,
9250
+ key: "Row" + task.id,
8923
9251
  x: "0",
8924
9252
  y: y,
8925
9253
  width: svgWidth,
@@ -8927,7 +9255,7 @@ var GridBody = function GridBody(_ref) {
8927
9255
  className: styles$4.gridRow
8928
9256
  }));
8929
9257
  rowLines.push(react.createElement("line", {
8930
- key: 'RowLine' + task.id,
9258
+ key: "RowLine" + task.id,
8931
9259
  x: "0",
8932
9260
  y1: y + rowHeight,
8933
9261
  x2: svgWidth,
@@ -8939,7 +9267,6 @@ var GridBody = function GridBody(_ref) {
8939
9267
  var now = new Date();
8940
9268
  var tickX = 0;
8941
9269
  var ticks = [];
8942
- var today = react.createElement("rect", null);
8943
9270
  for (var i = 0; i < dates.length; i++) {
8944
9271
  var date = dates[i];
8945
9272
  ticks.push(react.createElement("line", {
@@ -8950,24 +9277,7 @@ var GridBody = function GridBody(_ref) {
8950
9277
  y2: y,
8951
9278
  className: styles$4.gridTick
8952
9279
  }));
8953
- 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()) {
8954
- today = react.createElement("rect", {
8955
- x: tickX + columnWidth / 2 - 1,
8956
- y: 0,
8957
- width: 2,
8958
- height: y,
8959
- fill: todayColor
8960
- });
8961
- }
8962
- if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
8963
- today = react.createElement("rect", {
8964
- x: tickX + columnWidth / 2,
8965
- y: 0,
8966
- width: 2,
8967
- height: y,
8968
- fill: todayColor
8969
- });
8970
- }
9280
+ 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()) ;
8971
9281
  tickX += columnWidth;
8972
9282
  }
8973
9283
  return react.createElement("g", {
@@ -8978,9 +9288,7 @@ var GridBody = function GridBody(_ref) {
8978
9288
  className: "rowLines"
8979
9289
  }, rowLines), react.createElement("g", {
8980
9290
  className: "ticks"
8981
- }, ticks), react.createElement("g", {
8982
- className: "today"
8983
- }, today));
9291
+ }, ticks));
8984
9292
  };
8985
9293
 
8986
9294
  var Grid = function Grid(props) {
@@ -9050,7 +9358,8 @@ var Calendar = function Calendar(_ref) {
9050
9358
  fontSize = _ref.fontSize,
9051
9359
  dateTimeFormatters = _ref.dateTimeFormatters,
9052
9360
  _ref$singleLineHeader = _ref.singleLineHeader,
9053
- singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader;
9361
+ singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader,
9362
+ currentDateIndicator = _ref.currentDateIndicator;
9054
9363
  var simplifiedHeader = singleLineHeader && dateSetup.viewMode !== ViewMode.Year;
9055
9364
  var TopCal = simplifiedHeader ? SinglePartOfCalendar : TopPartOfCalendar;
9056
9365
  var formatYear = (_dateTimeFormatters$y = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.year) != null ? _dateTimeFormatters$y : defaultDateTimeFormatters.year;
@@ -9136,7 +9445,7 @@ var Calendar = function Calendar(_ref) {
9136
9445
  var dates = dateSetup.dates;
9137
9446
  for (var i = dates.length - 1; i >= 0; i--) {
9138
9447
  var date = dates[i];
9139
- var topValue = '';
9448
+ var topValue = "";
9140
9449
  if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
9141
9450
  topValue = formatMonthAndYear(date, locale);
9142
9451
  }
@@ -9271,7 +9580,12 @@ var Calendar = function Calendar(_ref) {
9271
9580
  width: columnWidth * dateSetup.dates.length,
9272
9581
  height: headerHeight,
9273
9582
  className: styles$5.calendarHeader
9274
- }), simplifiedHeader ? null : bottomValues, " ", topValues);
9583
+ }), simplifiedHeader ? null : bottomValues, " ", topValues, currentDateIndicator && react.createElement("circle", {
9584
+ fill: currentDateIndicator.color,
9585
+ cx: currentDateIndicator.x + 2.5,
9586
+ cy: headerHeight - 8,
9587
+ r: "8"
9588
+ }));
9275
9589
  };
9276
9590
 
9277
9591
  // A type of promise-like that resolves synchronously and supports only one observer
@@ -9510,6 +9824,9 @@ var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
9510
9824
  var index = dates.findIndex(function (d) {
9511
9825
  return d.getTime() >= xDate.getTime();
9512
9826
  }) - 1;
9827
+ if (index < 0) {
9828
+ return 0;
9829
+ }
9513
9830
  var remainderMillis = xDate.getTime() - dates[index].getTime();
9514
9831
  var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
9515
9832
  var x = index * columnWidth + percentOfInterval * columnWidth;
@@ -9667,6 +9984,15 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
9667
9984
  changedTask: changedTask
9668
9985
  };
9669
9986
  };
9987
+ function calculateCurrentDateCalculator(dates, columnWidth) {
9988
+ return taskXCoordinate(new Date(), dates, columnWidth);
9989
+ }
9990
+ function calculateProjection(start, end, dates, columnWidth) {
9991
+ return {
9992
+ x0: taskXCoordinate(start, dates, columnWidth),
9993
+ xf: taskXCoordinate(end, dates, columnWidth)
9994
+ };
9995
+ }
9670
9996
 
9671
9997
  function isKeyboardEvent(event) {
9672
9998
  return event.key !== undefined;
@@ -9929,11 +10255,15 @@ var style = {"barLabel":"_3zRJQ","barLabelOutside":"_3KcaM"};
9929
10255
 
9930
10256
  var Timeline = function Timeline(_ref) {
9931
10257
  var task = _ref.task,
9932
- isSelected = _ref.isSelected;
10258
+ isSelected = _ref.isSelected,
10259
+ onEventStart = _ref.onEventStart;
9933
10260
  var styles = task.styles;
9934
10261
  var col = isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
9935
10262
  return react.createElement("g", {
9936
- tabIndex: 0
10263
+ tabIndex: 0,
10264
+ onMouseDown: function onMouseDown(e) {
10265
+ return onEventStart("move", task, e);
10266
+ }
9937
10267
  }, react.createElement("rect", {
9938
10268
  fill: col,
9939
10269
  x: "0",
@@ -9944,6 +10274,9 @@ var Timeline = function Timeline(_ref) {
9944
10274
  ry: 0
9945
10275
  }), task.barChildren.map(function (bar) {
9946
10276
  return react.createElement("rect", {
10277
+ style: {
10278
+ cursor: "pointer"
10279
+ },
9947
10280
  key: bar.id,
9948
10281
  fill: bar.styles.backgroundColor,
9949
10282
  x: bar.x1,
@@ -9989,7 +10322,7 @@ var TaskItem = function TaskItem(props) {
9989
10322
  setTaskItem(react.createElement(Bar, Object.assign({}, props)));
9990
10323
  break;
9991
10324
  }
9992
- }, [task.typeInternal, isSelected, props]);
10325
+ }, [task, isSelected]);
9993
10326
  react.useEffect(function () {
9994
10327
  if (textRef.current) {
9995
10328
  setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
@@ -10057,6 +10390,12 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10057
10390
  fontFamily = _ref.fontFamily,
10058
10391
  fontSize = _ref.fontSize,
10059
10392
  rtl = _ref.rtl,
10393
+ _ref$hideLabel = _ref.hideLabel,
10394
+ hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
10395
+ _ref$showSecondaryDat = _ref.showSecondaryDates,
10396
+ showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat,
10397
+ currentDateIndicator = _ref.currentDateIndicator,
10398
+ projection = _ref.projection,
10060
10399
  setGanttEvent = _ref.setGanttEvent,
10061
10400
  setFailedTask = _ref.setFailedTask,
10062
10401
  setSelectedTask = _ref.setSelectedTask,
@@ -10064,11 +10403,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10064
10403
  onProgressChange = _ref.onProgressChange,
10065
10404
  onDoubleClick = _ref.onDoubleClick,
10066
10405
  onClick = _ref.onClick,
10067
- onDelete = _ref.onDelete,
10068
- _ref$hideLabel = _ref.hideLabel,
10069
- hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
10070
- _ref$showSecondaryDat = _ref.showSecondaryDates,
10071
- showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat;
10406
+ onDelete = _ref.onDelete;
10072
10407
  var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
10073
10408
  var _useState = react.useState(0),
10074
10409
  xStep = _useState[0],
@@ -10256,7 +10591,20 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10256
10591
  };
10257
10592
  return react.createElement("g", {
10258
10593
  className: "content"
10259
- }, react.createElement("g", {
10594
+ }, currentDateIndicator && react.createElement("rect", {
10595
+ fill: currentDateIndicator.color,
10596
+ x: currentDateIndicator.x + 1.5,
10597
+ y: "0",
10598
+ width: "2",
10599
+ height: "100%"
10600
+ }), projection && react.createElement("rect", {
10601
+ fill: projection.color,
10602
+ x: projection.x0,
10603
+ y: "0",
10604
+ width: projection.xf - projection.x0,
10605
+ height: "100%",
10606
+ fillOpacity: "35%"
10607
+ }), react.createElement("g", {
10260
10608
  className: "arrows",
10261
10609
  fill: arrowColor,
10262
10610
  stroke: arrowColor
@@ -10303,6 +10651,7 @@ var TaskGantt = function TaskGantt(_ref) {
10303
10651
  calendarProps = _ref.calendarProps,
10304
10652
  barProps = _ref.barProps,
10305
10653
  ganttHeight = _ref.ganttHeight,
10654
+ taskGanttRef = _ref.taskGanttRef,
10306
10655
  scrollY = _ref.scrollY,
10307
10656
  scrollX = _ref.scrollX;
10308
10657
  var ganttSVGRef = react.useRef(null);
@@ -10322,7 +10671,8 @@ var TaskGantt = function TaskGantt(_ref) {
10322
10671
  }
10323
10672
  }, [scrollX]);
10324
10673
  return react.createElement("div", {
10325
- className: styles$7.ganttContainer
10674
+ className: styles$7.ganttContainer,
10675
+ ref: taskGanttRef
10326
10676
  }, react.createElement("div", {
10327
10677
  className: styles$7.ganttVerticalContainer,
10328
10678
  ref: verticalGanttContainerRef,
@@ -10353,9 +10703,10 @@ var TaskGantt = function TaskGantt(_ref) {
10353
10703
  var styles$8 = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
10354
10704
 
10355
10705
  var HorizontalScroll = function HorizontalScroll(_ref) {
10706
+ var _taskGanttRef$current;
10356
10707
  var scroll = _ref.scroll,
10357
10708
  svgWidth = _ref.svgWidth,
10358
- taskListWidth = _ref.taskListWidth,
10709
+ taskGanttRef = _ref.taskGanttRef,
10359
10710
  rtl = _ref.rtl,
10360
10711
  onScroll = _ref.onScroll;
10361
10712
  var scrollRef = react.useRef(null);
@@ -10364,11 +10715,12 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
10364
10715
  scrollRef.current.scrollLeft = scroll;
10365
10716
  }
10366
10717
  }, [scroll]);
10718
+ var rect = (_taskGanttRef$current = taskGanttRef.current) === null || _taskGanttRef$current === void 0 ? void 0 : _taskGanttRef$current.getBoundingClientRect();
10367
10719
  return react.createElement("div", {
10368
10720
  dir: "ltr",
10369
- style: {
10370
- margin: rtl ? "0px " + taskListWidth + "px 0px 0px" : "0px 0px 0px " + taskListWidth + "px"
10371
- },
10721
+ style: rect ? {
10722
+ margin: rtl ? "0px " + rect.x + "px 0px 0px" : "0px 0px 0px " + rect.x + "px"
10723
+ } : undefined,
10372
10724
  className: styles$8.scrollWrapper,
10373
10725
  onScroll: onScroll,
10374
10726
  ref: scrollRef
@@ -10381,15 +10733,17 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
10381
10733
  };
10382
10734
 
10383
10735
  var Gantt = function Gantt(_ref) {
10384
- var tasks = _ref.tasks,
10736
+ var id = _ref.id,
10737
+ tasks = _ref.tasks,
10385
10738
  _ref$headerHeight = _ref.headerHeight,
10386
- headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
10739
+ headerHeight = _ref$headerHeight === void 0 ? 114 : _ref$headerHeight,
10387
10740
  _ref$columnWidth = _ref.columnWidth,
10388
10741
  columnWidth = _ref$columnWidth === void 0 ? 60 : _ref$columnWidth,
10389
10742
  _ref$listCellWidth = _ref.listCellWidth,
10390
- listCellWidth = _ref$listCellWidth === void 0 ? "155px" : _ref$listCellWidth,
10743
+ listCellWidth = _ref$listCellWidth === void 0 ? "297px" : _ref$listCellWidth,
10391
10744
  _ref$rowHeight = _ref.rowHeight,
10392
10745
  rowHeight = _ref$rowHeight === void 0 ? 50 : _ref$rowHeight,
10746
+ filter = _ref.filter,
10393
10747
  _ref$ganttHeight = _ref.ganttHeight,
10394
10748
  ganttHeight = _ref$ganttHeight === void 0 ? 0 : _ref$ganttHeight,
10395
10749
  _ref$viewMode = _ref.viewMode,
@@ -10437,7 +10791,7 @@ var Gantt = function Gantt(_ref) {
10437
10791
  _ref$arrowIndent = _ref.arrowIndent,
10438
10792
  arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
10439
10793
  _ref$todayColor = _ref.todayColor,
10440
- todayColor = _ref$todayColor === void 0 ? "rgba(252, 248, 227, 0.5)" : _ref$todayColor,
10794
+ todayColor = _ref$todayColor === void 0 ? "#ff0000" : _ref$todayColor,
10441
10795
  viewDate = _ref.viewDate,
10442
10796
  _ref$TooltipContent = _ref.TooltipContent,
10443
10797
  TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
@@ -10445,13 +10799,6 @@ var Gantt = function Gantt(_ref) {
10445
10799
  TaskListHeader = _ref$TaskListHeader === void 0 ? TaskListHeaderDefault : _ref$TaskListHeader,
10446
10800
  _ref$TaskListTable = _ref.TaskListTable,
10447
10801
  TaskListTable = _ref$TaskListTable === void 0 ? TaskListTableDefault : _ref$TaskListTable,
10448
- onDateChange = _ref.onDateChange,
10449
- onProgressChange = _ref.onProgressChange,
10450
- onDoubleClick = _ref.onDoubleClick,
10451
- onClick = _ref.onClick,
10452
- onDelete = _ref.onDelete,
10453
- onSelect = _ref.onSelect,
10454
- onExpanderClick = _ref.onExpanderClick,
10455
10802
  dateTimeFormatters = _ref.dateTimeFormatters,
10456
10803
  _ref$singleLineHeader = _ref.singleLineHeader,
10457
10804
  singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader,
@@ -10460,13 +10807,24 @@ var Gantt = function Gantt(_ref) {
10460
10807
  _ref$showSecondaryDat = _ref.showSecondaryDates,
10461
10808
  showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat,
10462
10809
  _ref$hideDependencies = _ref.hideDependencies,
10463
- hideDependencies = _ref$hideDependencies === void 0 ? false : _ref$hideDependencies;
10810
+ hideDependencies = _ref$hideDependencies === void 0 ? false : _ref$hideDependencies,
10811
+ projection = _ref.projection,
10812
+ displayedStartDate = _ref.displayedStartDate,
10813
+ displayedEndDate = _ref.displayedEndDate,
10814
+ onDateChange = _ref.onDateChange,
10815
+ onProgressChange = _ref.onProgressChange,
10816
+ onDoubleClick = _ref.onDoubleClick,
10817
+ onClick = _ref.onClick,
10818
+ onDelete = _ref.onDelete,
10819
+ onSelect = _ref.onSelect,
10820
+ onExpanderClick = _ref.onExpanderClick;
10464
10821
  var wrapperRef = react.useRef(null);
10822
+ var taskGanttRef = react.useRef(null);
10465
10823
  var taskListRef = react.useRef(null);
10466
10824
  var _useState = react.useState(function () {
10467
- var _ganttDateRange = ganttDateRange(tasks, viewMode, preStepsCount, showSecondaryDates),
10468
- startDate = _ganttDateRange[0],
10469
- endDate = _ganttDateRange[1];
10825
+ var _ganttDateRangeFromTa = ganttDateRangeFromTask(tasks, viewMode, preStepsCount, showSecondaryDates, displayedStartDate, displayedEndDate),
10826
+ startDate = _ganttDateRangeFromTa[0],
10827
+ endDate = _ganttDateRangeFromTa[1];
10470
10828
  return {
10471
10829
  viewMode: viewMode,
10472
10830
  dates: seedDates(startDate, endDate, viewMode)
@@ -10520,6 +10878,19 @@ var Gantt = function Gantt(_ref) {
10520
10878
  var _useState12 = react.useState(false),
10521
10879
  ignoreScrollEvent = _useState12[0],
10522
10880
  setIgnoreScrollEvent = _useState12[1];
10881
+ var _useState13 = react.useState(),
10882
+ currentDateIndicatorContent = _useState13[0],
10883
+ setCurrentDateIndicatorContent = _useState13[1];
10884
+ var _useState14 = react.useState(),
10885
+ projectionContent = _useState14[0],
10886
+ setProjectionContent = _useState14[1];
10887
+ react.useEffect(function () {
10888
+ window.addEventListener("gantt-sync-scroll-event", function (e) {
10889
+ if (e.detail.id !== id) {
10890
+ setScrollX(e.detail.scrollX);
10891
+ }
10892
+ });
10893
+ }, [id]);
10523
10894
  react.useEffect(function () {
10524
10895
  var filteredTasks;
10525
10896
  if (onExpanderClick) {
@@ -10528,9 +10899,9 @@ var Gantt = function Gantt(_ref) {
10528
10899
  filteredTasks = tasks;
10529
10900
  }
10530
10901
  filteredTasks = filteredTasks.sort(sortTasks);
10531
- var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount, showSecondaryDates),
10532
- startDate = _ganttDateRange2[0],
10533
- endDate = _ganttDateRange2[1];
10902
+ var _ganttDateRangeFromTa2 = ganttDateRangeFromTask(filteredTasks, viewMode, preStepsCount, showSecondaryDates, displayedStartDate, displayedEndDate),
10903
+ startDate = _ganttDateRangeFromTa2[0],
10904
+ endDate = _ganttDateRangeFromTa2[1];
10534
10905
  var newDates = seedDates(startDate, endDate, viewMode);
10535
10906
  if (rtl) {
10536
10907
  newDates = newDates.reverse();
@@ -10543,7 +10914,7 @@ var Gantt = function Gantt(_ref) {
10543
10914
  viewMode: viewMode
10544
10915
  });
10545
10916
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
10546
- }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick]);
10917
+ }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
10547
10918
  react.useEffect(function () {
10548
10919
  if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
10549
10920
  var dates = dateSetup.dates;
@@ -10655,11 +11026,20 @@ var Gantt = function Gantt(_ref) {
10655
11026
  if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
10656
11027
  setScrollX(event.currentTarget.scrollLeft);
10657
11028
  setIgnoreScrollEvent(true);
11029
+ window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
11030
+ detail: {
11031
+ componentId: id,
11032
+ scrollX: event.currentTarget.scrollLeft
11033
+ }
11034
+ }));
10658
11035
  } else {
10659
11036
  setIgnoreScrollEvent(false);
10660
11037
  }
10661
11038
  };
10662
11039
  var handleKeyDown = function handleKeyDown(event) {
11040
+ if (event.target.tagName === "INPUT") {
11041
+ return;
11042
+ }
10663
11043
  event.preventDefault();
10664
11044
  var newScrollY = scrollY;
10665
11045
  var newScrollX = scrollX;
@@ -10691,6 +11071,12 @@ var Gantt = function Gantt(_ref) {
10691
11071
  newScrollX = svgWidth;
10692
11072
  }
10693
11073
  setScrollX(newScrollX);
11074
+ window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
11075
+ detail: {
11076
+ componentId: id,
11077
+ scrollX: newScrollX
11078
+ }
11079
+ }));
10694
11080
  } else {
10695
11081
  if (newScrollY < 0) {
10696
11082
  newScrollY = 0;
@@ -10701,6 +11087,29 @@ var Gantt = function Gantt(_ref) {
10701
11087
  }
10702
11088
  setIgnoreScrollEvent(true);
10703
11089
  };
11090
+ react.useEffect(function () {
11091
+ var x = calculateCurrentDateCalculator(dateSetup.dates, columnWidth);
11092
+ if (x !== 0) {
11093
+ setCurrentDateIndicatorContent({
11094
+ color: todayColor,
11095
+ x: x
11096
+ });
11097
+ }
11098
+ }, [columnWidth, dateSetup.dates, todayColor]);
11099
+ react.useEffect(function () {
11100
+ if (projection) {
11101
+ var _calculateProjection = calculateProjection(projection.start, projection.end, dateSetup.dates, columnWidth),
11102
+ x0 = _calculateProjection.x0,
11103
+ xf = _calculateProjection.xf;
11104
+ setProjectionContent({
11105
+ x0: x0,
11106
+ xf: xf,
11107
+ color: projection.color
11108
+ });
11109
+ } else {
11110
+ setProjectionContent(undefined);
11111
+ }
11112
+ }, [columnWidth, dateSetup.dates, projection]);
10704
11113
  var handleSelectedTask = function handleSelectedTask(taskId) {
10705
11114
  var newSelectedTask = barTasks.find(function (t) {
10706
11115
  return t.id === taskId;
@@ -10744,7 +11153,8 @@ var Gantt = function Gantt(_ref) {
10744
11153
  fontSize: fontSize,
10745
11154
  rtl: rtl,
10746
11155
  dateTimeFormatters: dateTimeFormatters,
10747
- singleLineHeader: singleLineHeader
11156
+ singleLineHeader: singleLineHeader,
11157
+ currentDateIndicator: currentDateIndicatorContent
10748
11158
  };
10749
11159
  var barProps = {
10750
11160
  tasks: barTasks,
@@ -10761,6 +11171,11 @@ var Gantt = function Gantt(_ref) {
10761
11171
  arrowIndent: arrowIndent,
10762
11172
  svgWidth: svgWidth,
10763
11173
  rtl: rtl,
11174
+ hideLabel: hideLabel,
11175
+ showSecondaryDates: showSecondaryDates,
11176
+ ganttHeight: ganttHeight,
11177
+ currentDateIndicator: currentDateIndicatorContent,
11178
+ projection: projectionContent,
10764
11179
  setGanttEvent: setGanttEvent,
10765
11180
  setFailedTask: setFailedTask,
10766
11181
  setSelectedTask: handleSelectedTask,
@@ -10768,9 +11183,7 @@ var Gantt = function Gantt(_ref) {
10768
11183
  onProgressChange: onProgressChange,
10769
11184
  onDoubleClick: onDoubleClick,
10770
11185
  onClick: onClick,
10771
- onDelete: onDelete,
10772
- hideLabel: hideLabel,
10773
- showSecondaryDates: showSecondaryDates
11186
+ onDelete: onDelete
10774
11187
  };
10775
11188
  var tableProps = {
10776
11189
  rowHeight: rowHeight,
@@ -10782,6 +11195,7 @@ var Gantt = function Gantt(_ref) {
10782
11195
  headerHeight: headerHeight,
10783
11196
  scrollY: scrollY,
10784
11197
  ganttHeight: ganttHeight,
11198
+ filter: filter,
10785
11199
  horizontalContainerClass: styles$7.horizontalContainer,
10786
11200
  selectedTask: selectedTask,
10787
11201
  taskListRef: taskListRef,
@@ -10800,6 +11214,7 @@ var Gantt = function Gantt(_ref) {
10800
11214
  calendarProps: calendarProps,
10801
11215
  barProps: barProps,
10802
11216
  ganttHeight: ganttHeight,
11217
+ taskGanttRef: taskGanttRef,
10803
11218
  scrollY: scrollY,
10804
11219
  scrollX: scrollX
10805
11220
  }), ganttEvent.changedTask && react.createElement(Tooltip, {
@@ -10826,6 +11241,7 @@ var Gantt = function Gantt(_ref) {
10826
11241
  rtl: rtl
10827
11242
  })), react.createElement(HorizontalScroll, {
10828
11243
  svgWidth: svgWidth,
11244
+ taskGanttRef: taskGanttRef,
10829
11245
  taskListWidth: taskListWidth,
10830
11246
  scroll: scrollX,
10831
11247
  rtl: rtl,
@@ -10833,195 +11249,6 @@ var Gantt = function Gantt(_ref) {
10833
11249
  }));
10834
11250
  };
10835
11251
 
10836
- var TimeUnit;
10837
- (function (TimeUnit) {
10838
- TimeUnit["DAY"] = "days";
10839
- TimeUnit["WEEK"] = "weeks";
10840
- TimeUnit["MONTH"] = "months";
10841
- TimeUnit["YEAR"] = "YEAR";
10842
- })(TimeUnit || (TimeUnit = {}));
10843
-
10844
- var parseToDayStart = function parseToDayStart(ymd) {
10845
- return luxon.DateTime.fromISO(ymd).toJSDate();
10846
- };
10847
- var parseToDayEnd = function parseToDayEnd(endDate) {
10848
- return luxon.DateTime.fromISO(endDate).plus({
10849
- seconds: 86400 - 1
10850
- }).toJSDate();
10851
- };
10852
- var formatToIsoDate = function formatToIsoDate(date) {
10853
- return luxon.DateTime.fromJSDate(date).toISODate();
10854
- };
10855
- var formatToLocaleSimple = function formatToLocaleSimple(date) {
10856
- return luxon.DateTime.fromJSDate(date).toFormat("dd/MM/yyyy");
10857
- };
10858
- function validDates(startDate, endDate, name) {
10859
- var _start;
10860
- var start = parseToDayStart(startDate);
10861
- var end = parseToDayEnd(endDate);
10862
- if (((_start = start) === null || _start === void 0 ? void 0 : _start.getTime()) > (end === null || end === void 0 ? void 0 : end.getTime())) {
10863
- start = parseToDayStart(endDate);
10864
- console.log("time-converters.ts validDates() Error date", {
10865
- name: name,
10866
- start: startDate,
10867
- end: endDate
10868
- });
10869
- }
10870
- return {
10871
- start: start,
10872
- end: end
10873
- };
10874
- }
10875
-
10876
- var toViewMode = function toViewMode(timeUnit) {
10877
- switch (timeUnit) {
10878
- case TimeUnit.DAY:
10879
- return ViewMode.Day;
10880
- case TimeUnit.WEEK:
10881
- return ViewMode.Week;
10882
- case TimeUnit.MONTH:
10883
- return ViewMode.Month;
10884
- case TimeUnit.YEAR:
10885
- return ViewMode.Year;
10886
- }
10887
- };
10888
- var convertPhaseToTask = function convertPhaseToTask(item) {
10889
- var mapPhase = function mapPhase(_ref) {
10890
- var phaseStart = _ref.startDate,
10891
- phaseEnd = _ref.endDate,
10892
- secondaryStartDate = _ref.secondaryStartDate,
10893
- secondaryEndDate = _ref.secondaryEndDate,
10894
- phaseName = _ref.name,
10895
- phaseId = _ref.id,
10896
- color = _ref.color,
10897
- selectedColor = _ref.selectedColor,
10898
- dependencies = _ref.dependencies;
10899
- var _validDates = validDates(phaseStart, phaseEnd, phaseName),
10900
- start = _validDates.start,
10901
- end = _validDates.end;
10902
- var _validDates2 = validDates(secondaryStartDate, secondaryEndDate, phaseName),
10903
- phaseStart2 = _validDates2.start,
10904
- phaseEnd2 = _validDates2.end;
10905
- return {
10906
- start: start,
10907
- end: end,
10908
- secondaryStart: phaseStart2,
10909
- secondaryEnd: phaseEnd2,
10910
- name: phaseName,
10911
- valuesToShow: item.valuesToShow,
10912
- id: phaseId,
10913
- type: "task",
10914
- progress: 100,
10915
- dependencies: dependencies,
10916
- styles: color ? {
10917
- backgroundColor: color,
10918
- progressColor: color,
10919
- backgroundSelectedColor: selectedColor,
10920
- progressSelectedColor: selectedColor
10921
- } : {}
10922
- };
10923
- };
10924
- return mapPhase(item);
10925
- };
10926
- var convertDetailToTimeline = function convertDetailToTimeline(item) {
10927
- var id = item.id,
10928
- name = item.name,
10929
- schedule = item.schedule;
10930
- var convertToFrame = function convertToFrame(x) {
10931
- var startDate = x.startDate,
10932
- endDate = x.endDate,
10933
- color = x.color,
10934
- selectedColor = x.selectedColor;
10935
- var _validDates3 = validDates(startDate, endDate, "time frame"),
10936
- start = _validDates3.start,
10937
- end = _validDates3.end;
10938
- return {
10939
- start: start,
10940
- end: end,
10941
- backgroundColor: color != null ? color : "0xffffff",
10942
- backgroundSelectedColor: selectedColor != null ? selectedColor : color
10943
- };
10944
- };
10945
- var defaultColor = "#595959";
10946
- return {
10947
- id: id,
10948
- type: "timeline",
10949
- timeline: schedule.map(convertToFrame),
10950
- name: name,
10951
- valuesToShow: item.valuesToShow,
10952
- start: new Date(),
10953
- end: new Date(),
10954
- progress: 100,
10955
- styles: {
10956
- backgroundColor: defaultColor,
10957
- progressColor: defaultColor,
10958
- backgroundSelectedColor: defaultColor,
10959
- progressSelectedColor: defaultColor
10960
- }
10961
- };
10962
- };
10963
- var convertProjectToTasks = function convertProjectToTasks(_ref2) {
10964
- var id = _ref2.id,
10965
- name = _ref2.name,
10966
- valuesToShow = _ref2.valuesToShow,
10967
- startDate = _ref2.startDate,
10968
- endDate = _ref2.endDate,
10969
- phases = _ref2.phases,
10970
- details = _ref2.details,
10971
- secondaryStartDate = _ref2.secondaryStartDate,
10972
- secondaryEndDate = _ref2.secondaryEndDate;
10973
- var _validDates4 = validDates(startDate, endDate, name),
10974
- start = _validDates4.start,
10975
- end = _validDates4.end;
10976
- var _validDates5 = validDates(secondaryStartDate, secondaryEndDate, name),
10977
- start2 = _validDates5.start,
10978
- end2 = _validDates5.end;
10979
- var mainTask = {
10980
- start: start,
10981
- end: end,
10982
- id: id,
10983
- name: name,
10984
- valuesToShow: valuesToShow,
10985
- secondaryStart: start2,
10986
- secondaryEnd: end2,
10987
- type: "project",
10988
- progress: 100,
10989
- isDisabled: false,
10990
- hideChildren: false
10991
- };
10992
- var children1 = (phases != null ? phases : []).map(convertPhaseToTask);
10993
- var children2 = (details != null ? details : []).map(convertDetailToTimeline);
10994
- return [mainTask].concat(children1, children2);
10995
- };
10996
- var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref3) {
10997
- var id = _ref3.id,
10998
- start = _ref3.start,
10999
- end = _ref3.end;
11000
- return projects.map(function (project) {
11001
- return project.id === id ? withNewDates(project, start, end) : project;
11002
- });
11003
- };
11004
- var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref4) {
11005
- var id = _ref4.id,
11006
- start = _ref4.start,
11007
- end = _ref4.end;
11008
- if (phases) {
11009
- return phases.map(function (phase) {
11010
- return phase.id === id ? withNewDates(phase, start, end) : phase;
11011
- });
11012
- }
11013
- return undefined;
11014
- };
11015
- var withNewDates = function withNewDates(p, start, end) {
11016
- var startDate = formatToIsoDate(start);
11017
- var endDate = formatToIsoDate(end);
11018
- var extra = {
11019
- startDate: startDate,
11020
- endDate: endDate
11021
- };
11022
- return _extends({}, p, extra);
11023
- };
11024
-
11025
11252
  var cachedFormats = {};
11026
11253
  var getOrBuildCachedFormat = function getOrBuildCachedFormat(locale, options) {
11027
11254
  var _cachedFormats$key;
@@ -11034,8 +11261,8 @@ var format = function format(date, locale, options) {
11034
11261
  var format1 = getOrBuildCachedFormat(locale, options).format(date);
11035
11262
  return format1;
11036
11263
  } catch (e) {
11037
- console.log("time-formatters.ts format", date, locale, options);
11038
- console.log(e);
11264
+ console.error("time-formatters.ts format", date, locale, options);
11265
+ console.error(e);
11039
11266
  }
11040
11267
  };
11041
11268
  var dayFormatter = function dayFormatter(date, locale) {
@@ -11058,120 +11285,22 @@ var ganttDateTimeFormatters = {
11058
11285
  month: monthFormatter
11059
11286
  };
11060
11287
 
11061
- var _excluded = ["projects", "timeUnit", "TooltipContent", "TaskListHeader", "TaskListTable", "onDateChange", "onClick", "stylingOptions"];
11062
- var locale = "it-IT";
11063
- var GanttByTask = function GanttByTask(_ref) {
11064
- var _stylingOptions$preSt, _DateTime$now$minus;
11065
- var _ref$projects = _ref.projects,
11066
- projects = _ref$projects === void 0 ? [] : _ref$projects,
11067
- _ref$timeUnit = _ref.timeUnit,
11068
- timeUnit = _ref$timeUnit === void 0 ? TimeUnit.DAY : _ref$timeUnit,
11069
- TooltipContent = _ref.TooltipContent,
11070
- TaskListHeader = _ref.TaskListHeader,
11071
- TaskListTable = _ref.TaskListTable,
11072
- onDateChange = _ref.onDateChange,
11073
- onClick = _ref.onClick,
11074
- _ref$stylingOptions = _ref.stylingOptions,
11075
- stylingOptions = _ref$stylingOptions === void 0 ? {} : _ref$stylingOptions,
11076
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
11077
- var _useState = react.useState(projects),
11078
- currentProjects = _useState[0],
11079
- setCurrentProjects = _useState[1];
11080
- react.useEffect(function () {
11081
- if (projects) setCurrentProjects(projects);
11082
- }, [projects]);
11083
- var _useState2 = react.useState(1),
11084
- key = _useState2[0],
11085
- setKey = _useState2[1];
11086
- var tasks = react.useMemo(function () {
11087
- setKey(function (k) {
11088
- return k + 1;
11089
- });
11090
- return currentProjects.flatMap(convertProjectToTasks);
11091
- }, [currentProjects]);
11092
- var getProjectById = function getProjectById(id) {
11093
- return currentProjects.find(function (p) {
11094
- return p.id === id;
11095
- });
11096
- };
11097
- var handleClick = function handleClick(task) {
11098
- var id = task === null || task === void 0 ? void 0 : task.id;
11099
- console.log("gantt-by-task.tsx onClick", id);
11100
- var project = getProjectById(id);
11101
- if (project) onClick === null || onClick === void 0 ? void 0 : onClick(project);
11102
- var phase = currentProjects.flatMap(function (p) {
11103
- return p.phases;
11104
- }).find(function (ph) {
11105
- return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
11106
- });
11107
- if (phase) onClick === null || onClick === void 0 ? void 0 : onClick(phase);
11108
- };
11109
- var handleDateChange = function handleDateChange(task) {
11110
- var id = task === null || task === void 0 ? void 0 : task.id;
11111
- console.log("gantt-by-task.tsx onDateChange", id);
11112
- var project = getProjectById(id);
11113
- if (project) {
11114
- var result = mergeTaskIntoProjects(currentProjects, task);
11115
- setCurrentProjects(result);
11116
- var _project = result.find(function (p) {
11117
- return p.id === id;
11118
- });
11119
- if (_project) onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(_project);
11120
- return;
11121
- }
11122
- var parentOfClickedPhase = currentProjects.find(function (p) {
11123
- var _p$phases;
11124
- return (_p$phases = p.phases) === null || _p$phases === void 0 ? void 0 : _p$phases.some(function (ph) {
11125
- return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
11126
- });
11127
- });
11128
- if (parentOfClickedPhase) {
11129
- var phases = mergeTaskIntoPhases(parentOfClickedPhase.phases, task);
11130
- var updatedProjects = currentProjects.map(function (p) {
11131
- return p.id === parentOfClickedPhase.id ? _extends({}, p, {
11132
- phases: phases
11133
- }) : p;
11134
- });
11135
- setCurrentProjects(updatedProjects);
11136
- var phase = updatedProjects.flatMap(function (p) {
11137
- return p.phases;
11138
- }).find(function (ph) {
11139
- return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
11140
- });
11141
- if (phase) onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(phase);
11142
- }
11143
- };
11144
- var viewDate = luxon.DateTime.now().minus((_DateTime$now$minus = {}, _DateTime$now$minus[timeUnit] = (_stylingOptions$preSt = stylingOptions === null || stylingOptions === void 0 ? void 0 : stylingOptions.preStepsCount) != null ? _stylingOptions$preSt : 2, _DateTime$now$minus)).toJSDate();
11145
- console.log("gantt-by-task.tsx TASKS", tasks);
11146
- var returnElement = (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 && react.createElement(Gantt, Object.assign({
11147
- key: key,
11148
- tasks: tasks,
11149
- locale: locale,
11150
- viewMode: toViewMode(timeUnit),
11151
- viewDate: viewDate,
11152
- onClick: handleClick,
11153
- onDateChange: handleDateChange,
11154
- TooltipContent: TooltipContent,
11155
- TaskListHeader: TaskListHeader,
11156
- TaskListTable: TaskListTable,
11157
- dateTimeFormatters: ganttDateTimeFormatters
11158
- }, stylingOptions, props));
11159
- if (returnElement) {
11160
- return returnElement;
11161
- } else {
11162
- return react.createElement("div", null);
11163
- }
11164
- };
11165
-
11166
- var classes$1 = {"wrapper":"_37E9D","title":"_WrYI6","toggler":"_c53zr","switch":"_2eBO5","input":"_hiyro","slider":"_2HI58","label":"_2gSdA"};
11288
+ var classes$1 = {"wrapper":"_37E9D","title":"_WrYI6","toggler":"_c53zr","switch":"_2eBO5","input":"_hiyro","slider":"_2HI58","label":"_2gSdA","filter":"_2cfRI"};
11167
11289
 
11168
11290
  var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView, setDoubleView) {
11169
- var CustomTaskListHeader = function CustomTaskListHeader() {
11291
+ var CustomTaskListHeader = function CustomTaskListHeader(_ref) {
11292
+ var fontFamily = _ref.fontFamily,
11293
+ fontSize = _ref.fontSize;
11170
11294
  return react.createElement("div", {
11295
+ style: {
11296
+ fontFamily: fontFamily,
11297
+ fontSize: fontSize,
11298
+ height: "50px"
11299
+ },
11171
11300
  className: classes$1.wrapper
11172
11301
  }, react.createElement("div", {
11173
11302
  className: classes$1.title
11174
- }, react.createElement("span", null, label)), react.createElement("div", {
11303
+ }, react.createElement("span", null, label)), setDoubleView && react.createElement("div", {
11175
11304
  className: classes$1.toggler
11176
11305
  }, react.createElement("label", {
11177
11306
  htmlFor: "ch2",
@@ -11188,12 +11317,12 @@ var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView
11188
11317
  className: classes$1.slider
11189
11318
  })), react.createElement("span", {
11190
11319
  className: classes$1.label
11191
- }, "Mostra previsioni")));
11320
+ }, "Previsioni")));
11192
11321
  };
11193
11322
  return CustomTaskListHeader;
11194
11323
  };
11195
11324
 
11196
- var styles$9 = {"container":"_lEI6r","project":"_RU6Aa","main":"_30j6y","subrow":"_T0HQN","timeline":"_yp2DW","timelineWrapper":"_1H4ue"};
11325
+ var styles$9 = {"container":"_lEI6r","project":"_RU6Aa","main":"_30j6y","subrow":"_T0HQN","timeline":"_yp2DW"};
11197
11326
 
11198
11327
  var ProjectRow = function ProjectRow(_ref) {
11199
11328
  var _ref$task = _ref.task,
@@ -11219,7 +11348,7 @@ var ProjectRow = function ProjectRow(_ref) {
11219
11348
  "--grid-project-columns": str
11220
11349
  };
11221
11350
  return react.createElement("div", {
11222
- key: id,
11351
+ key: "task_" + id,
11223
11352
  className: styles$9.project,
11224
11353
  style: customStyle,
11225
11354
  onClick: function onClick() {
@@ -11230,7 +11359,7 @@ var ProjectRow = function ProjectRow(_ref) {
11230
11359
  return react.createElement("span", {
11231
11360
  className: index === 0 ? styles$9.main : undefined,
11232
11361
  title: v.length > 10 ? v : undefined,
11233
- key: id + "_valuesToShow_" + index
11362
+ key: "task_" + id + "_valuesToShow_" + index
11234
11363
  }, v === "#START#" ? formatToLocaleSimple(start) : v === "#END#" ? formatToLocaleSimple(end) : v);
11235
11364
  }));
11236
11365
  };
@@ -11259,7 +11388,7 @@ var SubRow = function SubRow(_ref2) {
11259
11388
  "--grid-fasi-columns": str
11260
11389
  };
11261
11390
  return react.createElement("div", {
11262
- key: id,
11391
+ key: "phase_" + id,
11263
11392
  className: styles$9.subrow,
11264
11393
  style: customStyle,
11265
11394
  onClick: function onClick() {
@@ -11267,7 +11396,7 @@ var SubRow = function SubRow(_ref2) {
11267
11396
  onclickTaskList(id);
11268
11397
  }
11269
11398
  }, react.createElement("span", {
11270
- key: id + "_valuesToShow_color",
11399
+ key: "phase_" + id + "_valuesToShow_color",
11271
11400
  style: {
11272
11401
  height: 16,
11273
11402
  width: 16,
@@ -11277,41 +11406,42 @@ var SubRow = function SubRow(_ref2) {
11277
11406
  return react.createElement("span", {
11278
11407
  className: index === 0 ? styles$9.main : undefined,
11279
11408
  title: v.length > 10 ? v : undefined,
11280
- key: id + "_valuesToShow_" + index
11409
+ key: "phase_" + id + "_valuesToShow_" + index
11281
11410
  }, v === "#START#" ? formatToLocaleSimple(start) : v === "#END#" ? formatToLocaleSimple(end) : v);
11282
11411
  }));
11283
11412
  };
11284
11413
  var TimelineSubRow = function TimelineSubRow(_ref3) {
11285
11414
  var _ref3$task = _ref3.task,
11286
11415
  id = _ref3$task.id,
11287
- name = _ref3$task.name,
11416
+ valuesToShow = _ref3$task.valuesToShow,
11288
11417
  rowHeight = _ref3.rowHeight,
11289
11418
  rowWidth = _ref3.rowWidth,
11290
11419
  fontFamily = _ref3.fontFamily,
11291
11420
  fontSize = _ref3.fontSize;
11421
+ var str = "";
11422
+ for (var i = 0; i < valuesToShow.length; i++) {
11423
+ str += "1fr ";
11424
+ }
11425
+ var customStyle = {
11426
+ height: rowHeight,
11427
+ width: rowWidth,
11428
+ fontFamily: fontFamily,
11429
+ fontSize: fontSize,
11430
+ "--grid-fasi-columns": str
11431
+ };
11292
11432
  return react.createElement("div", {
11293
- key: id,
11294
- className: styles$9.timelineWrapper,
11295
- style: {
11296
- height: rowHeight,
11297
- width: rowWidth,
11298
- fontFamily: fontFamily,
11299
- fontSize: fontSize
11300
- }
11301
- }, react.createElement("div", {
11433
+ key: "detail_" + id,
11302
11434
  className: styles$9.timeline,
11303
- style: {
11304
- height: rowHeight - 5
11305
- }
11306
- }, react.createElement("span", {
11307
- key: id + "_valuesToShow_0"
11308
- }, name), react.createElement("span", {
11309
- key: id + "_valuesToShow_1"
11310
- }, "A"), react.createElement("span", {
11311
- key: id + "_valuesToShow_2"
11312
- }, "A")));
11435
+ style: customStyle
11436
+ }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11437
+ return react.createElement("span", {
11438
+ className: index === 0 ? styles$9.main : undefined,
11439
+ title: v.length > 10 ? v : undefined,
11440
+ key: "detail_" + id + "_valuesToShow_" + index
11441
+ }, v);
11442
+ }));
11313
11443
  };
11314
- var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList) {
11444
+ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
11315
11445
  var CustomTaskListTable = function CustomTaskListTable(_ref4) {
11316
11446
  var rowHeight = _ref4.rowHeight,
11317
11447
  rowWidth = _ref4.rowWidth,
@@ -11320,9 +11450,12 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList) {
11320
11450
  tasks = _ref4.tasks,
11321
11451
  setSelectedTask = _ref4.setSelectedTask;
11322
11452
  return react.createElement("div", {
11323
- className: styles$9.container
11453
+ className: styles$9.container,
11454
+ key: "tasks_container_" + id
11324
11455
  }, tasks.map(function (task) {
11325
- return react.createElement(react.Fragment, null, task.type === "project" && react.createElement(ProjectRow, {
11456
+ return react.createElement(react.Fragment, {
11457
+ key: task.id
11458
+ }, task.type === "project" && react.createElement(ProjectRow, {
11326
11459
  key: task.id + "_" + task.type,
11327
11460
  task: task,
11328
11461
  rowHeight: rowHeight,
@@ -11407,49 +11540,258 @@ var Switcher = function Switcher(_ref) {
11407
11540
  };
11408
11541
 
11409
11542
  var Planner = function Planner(props) {
11410
- var _props$showSecondaryD, _props$taskListHeader, _props$taskListTableP, _props$tooltipContent;
11543
+ var _props$secondaryGantt, _props$mainGantt$show, _props$mainGantt$task, _props$mainGantt$task2, _props$mainGantt$tool, _props$secondaryGantt3, _props$secondaryGantt4, _props$secondaryGantt5, _props$secondaryGantt6;
11411
11544
  var _useState = react.useState(TimeUnit.MONTH),
11412
11545
  timeUnit = _useState[0],
11413
11546
  setTimeUnit = _useState[1];
11414
- var _useState2 = react.useState((_props$showSecondaryD = props.showSecondaryDates) != null ? _props$showSecondaryD : false),
11415
- doubleView = _useState2[0],
11416
- setDoubleView = _useState2[1];
11417
- var commonProps = {
11418
- hideLabel: props.hideLabel,
11419
- showSecondaryDates: doubleView,
11420
- ganttHeight: props.ganttHeight,
11421
- hideDependencies: props.hideDependencies
11547
+ var _useState2 = react.useState(props.mainGantt.items),
11548
+ currentTasks = _useState2[0],
11549
+ setCurrentTasks = _useState2[1];
11550
+ var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
11551
+ currentDetails = _useState3[0],
11552
+ setCurrentDetails = _useState3[1];
11553
+ var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
11554
+ mainGanttDoubleView = _useState4[0],
11555
+ setMainGanttDoubleView = _useState4[1];
11556
+ var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
11557
+ displayedDates = _useState5[0],
11558
+ setDisplayedDates = _useState5[1];
11559
+ var _useState6 = react.useState(),
11560
+ viewDate = _useState6[0],
11561
+ setViewDate = _useState6[1];
11562
+ var _useState7 = react.useState(),
11563
+ projection = _useState7[0],
11564
+ setProjection = _useState7[1];
11565
+ var locale = "it-IT";
11566
+ var handleClick = function handleClick(row, onClick) {
11567
+ if (!row) {
11568
+ return;
11569
+ }
11570
+ if (row.type === "task" && props.secondaryGantt) {
11571
+ var _phase$color;
11572
+ var phase = row;
11573
+ setProjection({
11574
+ start: new Date(phase.startDate),
11575
+ end: new Date(phase.endDate),
11576
+ color: (_phase$color = phase.color) != null ? _phase$color : "#ED7D31"
11577
+ });
11578
+ } else {
11579
+ setProjection(undefined);
11580
+ }
11581
+ onClick === null || onClick === void 0 ? void 0 : onClick(row);
11422
11582
  };
11423
- console.log("planner.tsx commonProps", commonProps);
11424
- return react.createElement("div", {
11425
- style: {
11426
- maxWidth: "90vw"
11583
+ var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
11584
+ var id = task === null || task === void 0 ? void 0 : task.id;
11585
+ if (!id) {
11586
+ return;
11587
+ }
11588
+ var row = getProjectById(id, currentProjects);
11589
+ if (!row) {
11590
+ row = getPhaseById(id, currentProjects);
11591
+ }
11592
+ if (!row) {
11593
+ return;
11594
+ }
11595
+ if (row.type === "timeline") {
11596
+ console.log("planner.tsx onDateChange for timeline not managed yet", id, row.type);
11597
+ return;
11598
+ }
11599
+ if (row.type === "project") {
11600
+ var result = mergeTaskIntoProjects(currentProjects, task);
11601
+ row = getProjectById(row.id, result);
11602
+ setViewDate(task.start);
11603
+ setCurrentTasks(result);
11604
+ } else if (row.type === "task") {
11605
+ var parentOfClickedPhase = currentProjects.find(function (p) {
11606
+ var _p$phases;
11607
+ return (_p$phases = p.phases) === null || _p$phases === void 0 ? void 0 : _p$phases.some(function (ph) {
11608
+ return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
11609
+ });
11610
+ });
11611
+ if (parentOfClickedPhase) {
11612
+ var phases = mergeTaskIntoPhases(parentOfClickedPhase.phases, task);
11613
+ var updatedProjects = currentProjects.map(function (p) {
11614
+ return p.id === parentOfClickedPhase.id ? _extends({}, p, {
11615
+ phases: phases
11616
+ }) : p;
11617
+ });
11618
+ row = getPhaseById(row.id, updatedProjects);
11619
+ if (props.secondaryGantt && row) {
11620
+ var _row$color;
11621
+ setProjection({
11622
+ start: new Date(row.startDate),
11623
+ end: new Date(row.endDate),
11624
+ color: (_row$color = row.color) != null ? _row$color : "#ED7D31"
11625
+ });
11626
+ }
11627
+ setViewDate(task.start);
11628
+ setCurrentTasks(updatedProjects);
11629
+ }
11630
+ }
11631
+ onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(row);
11632
+ };
11633
+ react.useEffect(function () {
11634
+ var _props$secondaryGantt2;
11635
+ setCurrentTasks(props.mainGantt.items);
11636
+ setCurrentDetails((_props$secondaryGantt2 = props.secondaryGantt) === null || _props$secondaryGantt2 === void 0 ? void 0 : _props$secondaryGantt2.items);
11637
+ setProjection(undefined);
11638
+ }, [props]);
11639
+ react.useEffect(function () {
11640
+ var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
11641
+ setDisplayedDates(dates);
11642
+ if (!viewDate) {
11643
+ setViewDate(dates.displayedStartDate);
11427
11644
  }
11428
- }, react.createElement(Switcher, {
11645
+ }, [currentTasks, currentDetails]);
11646
+ var tasks = [];
11647
+ for (var i = 0; i < currentTasks.length; i++) {
11648
+ tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
11649
+ }
11650
+ var details = [];
11651
+ if (currentDetails) {
11652
+ for (var _i = 0; _i < currentDetails.length; _i++) {
11653
+ details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
11654
+ }
11655
+ }
11656
+ console.log("PLANNER render");
11657
+ return react.createElement("div", null, react.createElement(Switcher, {
11429
11658
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
11430
11659
  return setTimeUnit(timeUnit);
11431
11660
  }
11432
- }), react.createElement(GanttByTask, Object.assign({}, commonProps, {
11433
- projects: props.items,
11434
- timeUnit: timeUnit,
11435
- stylingOptions: props.stylingOptions,
11436
- onClick: function onClick(row) {
11437
- var _props$onClick;
11438
- return (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, row);
11661
+ }), react.createElement("div", {
11662
+ style: {
11663
+ display: "flex",
11664
+ flexDirection: "column"
11665
+ }
11666
+ }, react.createElement(Gantt, Object.assign({
11667
+ id: MAIN_GANTT_ID,
11668
+ key: MAIN_GANTT_ID,
11669
+ filter: props.mainGantt.filter,
11670
+ hideLabel: props.mainGantt.hideLabel,
11671
+ showSecondaryDates: mainGanttDoubleView,
11672
+ hideDependencies: props.mainGantt.hideDependencies,
11673
+ ganttHeight: props.mainGantt.ganttHeight,
11674
+ displayedStartDate: displayedDates.displayedStartDate,
11675
+ displayedEndDate: displayedDates.displayedEndDate,
11676
+ viewDate: viewDate,
11677
+ tasks: tasks,
11678
+ viewMode: toViewMode(timeUnit)
11679
+ }, props.mainGantt.stylingOptions, {
11680
+ TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView),
11681
+ TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
11682
+ var row = getProjectById(id, currentTasks);
11683
+ if (!row) {
11684
+ row = getPhaseById(id, currentTasks);
11685
+ }
11686
+ if (row) {
11687
+ handleClick(row, props.mainGantt.onClick);
11688
+ }
11689
+ }, MAIN_GANTT_ID),
11690
+ TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
11691
+ onClick: function onClick(e) {
11692
+ var row = getProjectById(e.id, currentTasks);
11693
+ if (!row) {
11694
+ row = getPhaseById(e.id, currentTasks);
11695
+ }
11696
+ if (row) {
11697
+ handleClick(row, props.mainGantt.onClick);
11698
+ }
11439
11699
  },
11440
- onDateChange: function onDateChange(row) {
11441
- var _props$onDateChange;
11442
- return (_props$onDateChange = props.onDateChange) === null || _props$onDateChange === void 0 ? void 0 : _props$onDateChange.call(props, row);
11700
+ onDateChange: function onDateChange(e) {
11701
+ return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
11443
11702
  },
11444
- TaskListHeader: (_props$taskListHeader = props.taskListHeaderProject) != null ? _props$taskListHeader : CustomTaskListHeaderHOC(props.title, doubleView != null ? doubleView : true, setDoubleView),
11445
- TaskListTable: (_props$taskListTableP = props.taskListTableProject) != null ? _props$taskListTableP : CustomTaskListTableHOC(function (id) {
11446
- console.log("planner.tsx Clicked on " + id);
11447
- }),
11448
- TooltipContent: (_props$tooltipContent = props.tooltipContent) != null ? _props$tooltipContent : CustomTooltipHOC()
11449
- })));
11703
+ locale: locale,
11704
+ dateTimeFormatters: ganttDateTimeFormatters
11705
+ })), props.secondaryGantt && react.createElement(Gantt, Object.assign({
11706
+ id: SECONDARY_GANTT_ID,
11707
+ key: SECONDARY_GANTT_ID,
11708
+ hideLabel: props.secondaryGantt.hideLabel,
11709
+ filter: props.secondaryGantt.filter,
11710
+ showSecondaryDates: mainGanttDoubleView,
11711
+ hideDependencies: props.secondaryGantt.hideDependencies,
11712
+ ganttHeight: props.secondaryGantt.ganttHeight,
11713
+ displayedStartDate: displayedDates.displayedStartDate,
11714
+ displayedEndDate: displayedDates.displayedEndDate,
11715
+ viewDate: viewDate,
11716
+ tasks: details,
11717
+ viewMode: toViewMode(timeUnit)
11718
+ }, props.mainGantt.stylingOptions, {
11719
+ TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
11720
+ TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
11721
+ console.log("planner.tsx secondaryGantt Clicked on " + id);
11722
+ }, SECONDARY_GANTT_ID),
11723
+ TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
11724
+ projection: projection,
11725
+ onClick: function onClick(e) {
11726
+ if (props.secondaryGantt) {
11727
+ var row = getProjectById(e.id, currentDetails);
11728
+ if (row) {
11729
+ handleClick(row, props.secondaryGantt.onClick);
11730
+ }
11731
+ }
11732
+ },
11733
+ onDateChange: function onDateChange(e) {
11734
+ var _props$secondaryGantt7;
11735
+ return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
11736
+ },
11737
+ locale: locale,
11738
+ dateTimeFormatters: ganttDateTimeFormatters
11739
+ }))));
11450
11740
  };
11451
11741
 
11452
- const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;dominant-baseline:central;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;font-family:var(--kup-font-family, inherit);justify-content:space-around;max-width:330px;padding:16px 0;place-items:\"center\";text-align:center}._WrYI6{font-size:14px;font-weight:bold;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right;width:100%}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:0 1px 1px 1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:34% 33% 33%;place-items:center;background:#fff;color:#595959;font-weight:400}._yp2DW>*{font-size:12px;line-height:14px;overflow:hidden;text-overflow:ellipsis}._yp2DW>*:first-child{width:100%;white-space:nowrap;padding-left:5.5px}._1H4ue{background:#f2f2f2;padding:3px}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}";
11742
+ const kupManager = kupManagerInstance();
11743
+ function sanitizeAllDates(startDateCell, endDateCell, secStartDateCell, secEndDateCell) {
11744
+ const sanitizedDateValues = sanitizeDates(startDateCell, endDateCell);
11745
+ let sanitizedSecDateValues = [];
11746
+ if (secStartDateCell && secEndDateCell) {
11747
+ if (isAtLeastOneDateValid(secStartDateCell, secEndDateCell)) {
11748
+ sanitizedSecDateValues = sanitizeDates(secStartDateCell, secEndDateCell);
11749
+ }
11750
+ else {
11751
+ sanitizedSecDateValues = [...sanitizedDateValues];
11752
+ }
11753
+ }
11754
+ return {
11755
+ dateValues: sanitizedDateValues,
11756
+ secDateValues: sanitizedSecDateValues,
11757
+ };
11758
+ }
11759
+ function sanitizeDates(startDateCell, endDateCell) {
11760
+ let returnValues = [startDateCell.value, endDateCell.value];
11761
+ if (isDateValid(startDateCell) && isDateValid(endDateCell)) {
11762
+ return returnValues;
11763
+ }
11764
+ else if (isDateValid(startDateCell)) {
11765
+ return [startDateCell.value, startDateCell.value];
11766
+ }
11767
+ else if (isDateValid(endDateCell)) {
11768
+ return [endDateCell.value, endDateCell.value];
11769
+ }
11770
+ else {
11771
+ return returnValues;
11772
+ }
11773
+ }
11774
+ function isDateValid(dateCell) {
11775
+ return (kupManager.objects.isDate(dateCell.obj) &&
11776
+ kupManager.dates.isValid(dateCell.value, KupDatesFormats.ISO_DATE));
11777
+ }
11778
+ function isAtLeastOneDateValid(startDateCell, endDateCell) {
11779
+ return isDateValid(startDateCell) || isDateValid(endDateCell);
11780
+ }
11781
+ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValuesFunction) {
11782
+ let toValuesFunction = () => columns.map((col) => {
11783
+ return getCellValueForDisplay(dataColumns.find((kCol) => kCol.name == col), row.cells[col]);
11784
+ });
11785
+ if (customToValuesFunction) {
11786
+ toValuesFunction = customToValuesFunction;
11787
+ }
11788
+ const valuesToShow = (columns === null || columns === void 0 ? void 0 : columns.length) >= 2
11789
+ ? toValuesFunction()
11790
+ : [row.cells[idCol].value, row.cells[nameCol].value];
11791
+ return valuesToShow;
11792
+ }
11793
+
11794
+ const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;dominant-baseline:central;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
11453
11795
 
11454
11796
  var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11455
11797
  if (kind === "a" && !f)
@@ -11467,7 +11809,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
11467
11809
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
11468
11810
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11469
11811
  };
11470
- var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_emitOnChangeEventsReceived;
11812
+ var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter;
11471
11813
  const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11472
11814
  constructor() {
11473
11815
  super();
@@ -11486,7 +11828,16 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11486
11828
  this.plannerProps = undefined;
11487
11829
  this.customStyle = '';
11488
11830
  this.data = undefined;
11489
- this.dataRaw = undefined;
11831
+ this.detailData = undefined;
11832
+ this.detailColorCol = undefined;
11833
+ this.detailColumns = undefined;
11834
+ this.detailDates = undefined;
11835
+ this.detailHeight = undefined;
11836
+ this.detailIdCol = undefined;
11837
+ this.detailNameCol = undefined;
11838
+ this.detailPrevDates = undefined;
11839
+ this.listCellWidth = '300px';
11840
+ this.maxWidth = '90vw';
11490
11841
  this.phaseColorCol = undefined;
11491
11842
  this.phaseColumns = undefined;
11492
11843
  this.phaseColParDep = undefined;
@@ -11494,8 +11845,10 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11494
11845
  this.phaseIdCol = undefined;
11495
11846
  this.phaseNameCol = undefined;
11496
11847
  this.phasePrevDates = undefined;
11848
+ this.showSecondaryDates = false;
11497
11849
  this.taskColumns = undefined;
11498
11850
  this.taskDates = undefined;
11851
+ this.taskHeight = undefined;
11499
11852
  this.taskIdCol = undefined;
11500
11853
  this.taskNameCol = undefined;
11501
11854
  this.taskPrevDates = undefined;
@@ -11509,11 +11862,12 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11509
11862
  taskAction: taskAction,
11510
11863
  });
11511
11864
  }
11512
- onKupDateChange(event) {
11865
+ onKupDateChange(event, taskAction) {
11513
11866
  this.kupDateChange.emit({
11514
11867
  comp: this,
11515
11868
  id: this.rootElement.id,
11516
11869
  value: event,
11870
+ taskAction: taskAction,
11517
11871
  });
11518
11872
  }
11519
11873
  /*-------------------------------------------------*/
@@ -11549,21 +11903,29 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11549
11903
  var _a;
11550
11904
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11551
11905
  if (task) {
11552
- task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((row) => {
11906
+ task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]])).map((row) => {
11907
+ const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
11908
+ const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
11909
+ ? '#START#'
11910
+ : col == this.phaseDates[1]
11911
+ ? '#END#'
11912
+ : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
11553
11913
  let phase = {
11554
11914
  taskRow: task.taskRow,
11555
11915
  phaseRow: row,
11556
- id: row.cells[this.phaseIdCol].value,
11916
+ id: task.id + '_' + row.cells[this.phaseIdCol].value,
11557
11917
  phaseRowId: row.id,
11558
11918
  taskRowId: task.taskRowId,
11559
11919
  name: row.cells[this.phaseNameCol].value,
11560
- startDate: row.cells[this.phaseDates[0]].value,
11561
- endDate: row.cells[this.phaseDates[1]].value,
11562
- secondaryStartDate: row.cells[this.phasePrevDates[0]].value,
11563
- secondaryEndDate: row.cells[this.phasePrevDates[1]].value,
11564
- type: 'phase',
11920
+ startDate: datesSanitized.dateValues[0],
11921
+ endDate: datesSanitized.dateValues[1],
11922
+ secondaryStartDate: datesSanitized.secDateValues[0],
11923
+ secondaryEndDate: datesSanitized.secDateValues[1],
11924
+ type: 'task',
11565
11925
  color: row.cells[this.phaseColorCol].value,
11566
- valuesToShow: this.phaseColumns.map((col) => row.cells[col].value),
11926
+ selectedColor: row.cells[this.phaseColorCol].value,
11927
+ valuesToShow: valuesToShow,
11928
+ rowType: KupPlannerGanttRowType.PHASE,
11567
11929
  };
11568
11930
  return phase;
11569
11931
  });
@@ -11571,27 +11933,34 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11571
11933
  this.plannerProps = Object.assign({}, this.plannerProps);
11572
11934
  }
11573
11935
  handleOnClick(nativeEvent) {
11574
- console.log('handleOnClick', nativeEvent);
11575
- switch (nativeEvent.type) {
11576
- case 'task':
11936
+ console.log('kup-planner.handleOnClick', nativeEvent);
11937
+ switch (nativeEvent.rowType) {
11938
+ case KupPlannerGanttRowType.TASK:
11577
11939
  const taskAction = nativeEvent.phases
11578
- ? KupPlannerTaskAction.onClosing
11579
- : KupPlannerTaskAction.onOpening;
11940
+ ? KupPlannerTaskAction.onTaskClosing
11941
+ : KupPlannerTaskAction.onTaskOpening;
11580
11942
  if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
11581
11943
  this.onKupClick(nativeEvent, taskAction);
11582
11944
  }
11583
11945
  break;
11584
- case 'phase':
11946
+ case KupPlannerGanttRowType.PHASE:
11585
11947
  if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
11586
- this.onKupClick(nativeEvent);
11948
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11949
+ }
11950
+ break;
11951
+ case KupPlannerGanttRowType.DETAIL:
11952
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
11953
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11587
11954
  }
11588
11955
  break;
11589
11956
  }
11590
11957
  }
11591
11958
  handleOnDateChange(nativeEvent) {
11592
11959
  if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
11593
- console.log('handleOnDateChange', nativeEvent);
11594
- this.onKupDateChange(nativeEvent);
11960
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
11961
+ console.log('kup-planner.handleOnDateChange', nativeEvent);
11962
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
11963
+ }
11595
11964
  }
11596
11965
  }
11597
11966
  componentWillLoad() {
@@ -11599,11 +11968,40 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11599
11968
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
11600
11969
  }
11601
11970
  componentDidLoad() {
11971
+ let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
11972
+ if (details && details.length == 0) {
11973
+ details = undefined;
11974
+ }
11975
+ const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
11976
+ FTextFieldMDC(mainFilter);
11977
+ const secondaryFilter = this.rootElement.shadowRoot.querySelector('#secondary-filter');
11978
+ if (details) {
11979
+ FTextFieldMDC(secondaryFilter);
11980
+ }
11602
11981
  this.plannerProps = {
11603
- title: this.titleMess,
11604
- items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
11605
- onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
11606
- onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11982
+ mainGantt: {
11983
+ title: this.titleMess,
11984
+ items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
11985
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
11986
+ filter: mainFilter,
11987
+ hideLabel: true,
11988
+ ganttHeight: this.taskHeight,
11989
+ showSecondaryDates: this.showSecondaryDates,
11990
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
11991
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11992
+ },
11993
+ secondaryGantt: details
11994
+ ? {
11995
+ title: '',
11996
+ items: details,
11997
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
11998
+ filter: secondaryFilter,
11999
+ hideLabel: true,
12000
+ ganttHeight: this.detailHeight,
12001
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12002
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12003
+ }
12004
+ : undefined,
11607
12005
  };
11608
12006
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
11609
12007
  this.kupReady.emit({
@@ -11620,7 +12018,17 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11620
12018
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
11621
12019
  }
11622
12020
  render() {
11623
- return (h(Host, null, h("div", { id: componentWrapperId })));
12021
+ var _a;
12022
+ //console.log('kup-planner.tsx render');
12023
+ return (h(Host, null, h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId, style: { maxWidth: this.maxWidth } }), h(FTextField, { icon: KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12024
+ if (e.key === 'Enter') {
12025
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
12026
+ }
12027
+ }, wrapperClass: "filter" }), ((_a = this.detailData) === null || _a === void 0 ? void 0 : _a.rows) && this.detailData.rows.length > 0 ? (h(FTextField, { icon: KupThemeIconValues.SEARCH, id: "secondary-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12028
+ if (e.key === 'Enter') {
12029
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e, true);
12030
+ }
12031
+ }, wrapperClass: "filter" })) : null));
11624
12032
  }
11625
12033
  disconnectedCallback() {
11626
12034
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
@@ -11630,7 +12038,16 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11630
12038
  }, [1, "kup-planner", {
11631
12039
  "customStyle": [1, "custom-style"],
11632
12040
  "data": [16],
11633
- "dataRaw": [8, "data-raw"],
12041
+ "detailData": [16],
12042
+ "detailColorCol": [1, "detail-color-col"],
12043
+ "detailColumns": [16],
12044
+ "detailDates": [16],
12045
+ "detailHeight": [2, "detail-height"],
12046
+ "detailIdCol": [1, "detail-id-col"],
12047
+ "detailNameCol": [1, "detail-name-col"],
12048
+ "detailPrevDates": [16],
12049
+ "listCellWidth": [1, "list-cell-width"],
12050
+ "maxWidth": [1, "max-width"],
11634
12051
  "phaseColorCol": [1, "phase-color-col"],
11635
12052
  "phaseColumns": [16],
11636
12053
  "phaseColParDep": [1, "phase-col-par-dep"],
@@ -11638,8 +12055,10 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11638
12055
  "phaseIdCol": [1, "phase-id-col"],
11639
12056
  "phaseNameCol": [1, "phase-name-col"],
11640
12057
  "phasePrevDates": [16],
12058
+ "showSecondaryDates": [4, "show-secondary-dates"],
11641
12059
  "taskColumns": [16],
11642
12060
  "taskDates": [16],
12061
+ "taskHeight": [2, "task-height"],
11643
12062
  "taskIdCol": [1, "task-id-col"],
11644
12063
  "taskNameCol": [1, "task-name-col"],
11645
12064
  "taskPrevDates": [16],
@@ -11660,28 +12079,71 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
11660
12079
  }
11661
12080
  }, _KupPlanner_toTasks = function _KupPlanner_toTasks(data) {
11662
12081
  var _a;
11663
- let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((row) => {
12082
+ let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]])).map((row) => {
12083
+ const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12084
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
11664
12085
  let task = {
11665
12086
  taskRow: row,
11666
12087
  taskRowId: row.id,
11667
12088
  id: row.cells[this.taskIdCol].value,
11668
12089
  name: row.cells[this.taskNameCol].value,
11669
- startDate: row.cells[this.taskDates[0]].value,
11670
- endDate: row.cells[this.taskDates[1]].value,
11671
- secondaryStartDate: row.cells[this.taskPrevDates[0]].value,
11672
- secondaryEndDate: row.cells[this.taskPrevDates[1]].value,
11673
- type: 'task',
11674
- valuesToShow: this.taskColumns.map((col) => row.cells[col].value),
12090
+ startDate: datesSanitized.dateValues[0],
12091
+ endDate: datesSanitized.dateValues[1],
12092
+ secondaryStartDate: datesSanitized.secDateValues[0],
12093
+ secondaryEndDate: datesSanitized.secDateValues[1],
12094
+ type: 'project',
12095
+ valuesToShow: valuesToShow,
12096
+ rowType: KupPlannerGanttRowType.TASK,
11675
12097
  };
11676
12098
  return task;
11677
12099
  });
11678
12100
  return tasks;
12101
+ }, _KupPlanner_toDetails = function _KupPlanner_toDetails(data) {
12102
+ let details = [];
12103
+ if (!data || !data.rows) {
12104
+ return details;
12105
+ }
12106
+ data.rows
12107
+ .filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
12108
+ .forEach((row) => {
12109
+ var _a, _b;
12110
+ const detailId = row.cells[this.detailIdCol].value;
12111
+ const detailNameId = row.cells[this.detailNameCol].value;
12112
+ const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
12113
+ const valuesToShow = getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns);
12114
+ let detail = details.find((det) => det.id == detailId);
12115
+ if (!detail) {
12116
+ detail = {
12117
+ id: detailId,
12118
+ name: detailNameId,
12119
+ type: 'timeline',
12120
+ valuesToShow: valuesToShow,
12121
+ rowType: KupPlannerGanttRowType.DETAIL,
12122
+ schedule: [],
12123
+ };
12124
+ details.push(detail);
12125
+ }
12126
+ detail.schedule.push({
12127
+ startDate: datesSanitized.dateValues[0],
12128
+ endDate: datesSanitized.dateValues[1],
12129
+ color: this.detailColorCol
12130
+ ? (_a = row.cells[this.detailColorCol].value) !== null && _a !== void 0 ? _a : '#D9D9D8'
12131
+ : '#D9D9D8',
12132
+ selectedColor: this.detailColorCol
12133
+ ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12134
+ : '#D9D9D8',
12135
+ });
12136
+ });
12137
+ return details;
11679
12138
  }, _KupPlanner_getTask = function _KupPlanner_getTask(taskId) {
11680
- return this.plannerProps.items.find((task) => task.id == taskId);
12139
+ return this.plannerProps.mainGantt.items.find((task) => task.id == taskId);
11681
12140
  }, _KupPlanner_removePhases = function _KupPlanner_removePhases(taskId) {
11682
12141
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11683
12142
  if (task)
11684
12143
  task.phases = undefined;
12144
+ // this.plannerProps.mainGantt = JSON.parse(
12145
+ // JSON.stringify(this.plannerProps.mainGantt)
12146
+ // );
11685
12147
  this.plannerProps = Object.assign({}, this.plannerProps);
11686
12148
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
11687
12149
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -11691,6 +12153,8 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
11691
12153
  return true;
11692
12154
  }, _KupPlanner_handleOnClickOnPhase = function _KupPlanner_handleOnClickOnPhase() {
11693
12155
  return true;
12156
+ }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12157
+ return true;
11694
12158
  }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
11695
12159
  let emitEvent = false;
11696
12160
  if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
@@ -11702,6 +12166,34 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
11702
12166
  emitEvent = true;
11703
12167
  }
11704
12168
  return emitEvent;
12169
+ }, _KupPlanner_onFilter = function _KupPlanner_onFilter(e, isDetail) {
12170
+ const tempData = {
12171
+ columns: this.data.columns,
12172
+ rows: [],
12173
+ };
12174
+ const value = e.target.value;
12175
+ const data = isDetail ? this.detailData : this.data;
12176
+ for (let index = 0; index < data.rows.length; index++) {
12177
+ const row = data.rows[index];
12178
+ const valuesToShow = isDetail
12179
+ ? getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns)
12180
+ : getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12181
+ for (let index = 0; index < valuesToShow.length; index++) {
12182
+ const valueToShow = valuesToShow[index];
12183
+ if (valueToShow.toLowerCase().indexOf(value.toLowerCase()) > -1) {
12184
+ tempData.rows.push(row);
12185
+ break;
12186
+ }
12187
+ }
12188
+ }
12189
+ const newGantt = isDetail
12190
+ ? {
12191
+ secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
12192
+ }
12193
+ : {
12194
+ mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12195
+ };
12196
+ this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
11705
12197
  };
11706
12198
  function defineCustomElement$1() {
11707
12199
  if (typeof customElements === "undefined") {