@sme.up/ketchup 7.4.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/cjs/{component-72a5b626.js → component-85c2bd4d.js} +1 -1
  2. package/dist/cjs/{f-button-daddd700.js → f-button-49b2c37c.js} +1 -1
  3. package/dist/cjs/{f-cell-3682fad4.js → f-cell-9a6bc55c.js} +4 -4
  4. package/dist/cjs/{f-chip-9d540d94.js → f-chip-dee84122.js} +2 -2
  5. package/dist/cjs/{f-image-7b42d149.js → f-image-27f965ff.js} +4 -4
  6. package/dist/cjs/{f-paginator-utils-1baeba0f.js → f-paginator-utils-4a30189d.js} +2 -2
  7. package/dist/cjs/{f-text-field-a6ed2d22.js → f-text-field-04a663b4.js} +1 -1
  8. package/dist/cjs/{f-text-field-mdc-85997738.js → f-text-field-mdc-0e22f3e3.js} +2 -2
  9. package/dist/cjs/ketchup.cjs.js +2 -2
  10. package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +814 -819
  12. package/dist/cjs/kup-box.cjs.entry.js +10 -10
  13. package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +7 -10
  18. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-echart.cjs.entry.js +25 -8
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +8 -19
  21. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  23. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  25. package/dist/cjs/{kup-manager-10351449.js → kup-manager-2ff5d258.js} +80 -1
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +5 -5
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-planner.cjs.entry.js +1127 -218
  30. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/cjs/{tslib.es6-0ee02c67.js → tslib.es6-386654de.js} +9 -5
  35. package/dist/collection/collection-manifest.json +1 -1
  36. package/dist/collection/components/kup-card/kup-card.css +4 -8
  37. package/dist/collection/components/kup-chip/kup-chip.js +4 -3
  38. package/dist/collection/components/kup-dashboard/kup-dashboard.js +0 -3
  39. package/dist/collection/components/kup-data-table/kup-data-table.css +3 -6
  40. package/dist/collection/components/kup-data-table/kup-data-table.js +6 -20
  41. package/dist/collection/components/kup-echart/kup-echart-declarations.js +2 -0
  42. package/dist/collection/components/kup-echart/kup-echart.js +23 -8
  43. package/dist/collection/components/kup-family-tree/kup-family-tree.css +2 -2
  44. package/dist/collection/components/kup-family-tree/kup-family-tree.js +4 -15
  45. package/dist/collection/components/kup-image/kup-image.js +28 -0
  46. package/dist/collection/components/kup-list/kup-list.css +1 -1
  47. package/dist/collection/components/kup-planner/kup-planner-declarations.js +5 -2
  48. package/dist/collection/components/kup-planner/kup-planner.css +6 -3
  49. package/dist/collection/components/kup-planner/kup-planner.js +347 -65
  50. package/dist/collection/components/kup-qlik/kup-qlik.css +4 -8
  51. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -3
  52. package/dist/collection/components/kup-spinner/kup-spinner.css +2 -4
  53. package/dist/collection/components/kup-tree/kup-tree.js +66 -67
  54. package/dist/collection/f-components/f-image/f-image.js +3 -3
  55. package/dist/collection/managers/kup-data/kup-data-column-helper.js +1 -0
  56. package/dist/collection/managers/kup-manager/kup-manager.js +18 -0
  57. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
  58. package/dist/collection/types/GenericTypes.js +1 -0
  59. package/dist/components/kup-autocomplete2.js +228 -151
  60. package/dist/components/kup-dashboard.js +0 -3
  61. package/dist/components/kup-echart2.js +24 -7
  62. package/dist/components/kup-family-tree.js +5 -16
  63. package/dist/components/kup-planner.js +1127 -219
  64. package/dist/components/kup-progress-bar.js +1 -1
  65. package/dist/components/kup-qlik.js +1 -1
  66. package/dist/components/kup-radio.js +1 -1
  67. package/dist/components/kup-rating.js +1 -1
  68. package/dist/components/kup-snackbar.js +1 -1
  69. package/dist/components/kup-spinner.js +1 -1
  70. package/dist/components/kup-switch.js +1 -1
  71. package/dist/components/kup-tab-bar.js +1 -1
  72. package/dist/components/kup-text-field.js +1 -1
  73. package/dist/components/kup-time-picker.js +1 -1
  74. package/dist/components/kup-tree.js +1 -1
  75. package/dist/esm/{component-b1bedf1d.js → component-120651a0.js} +1 -1
  76. package/dist/esm/{f-button-8d15b5a0.js → f-button-744cf1f6.js} +1 -1
  77. package/dist/esm/{f-cell-7b706e57.js → f-cell-b319c869.js} +4 -4
  78. package/dist/esm/{f-chip-c671fe90.js → f-chip-7e3e4180.js} +2 -2
  79. package/dist/esm/{f-image-21451b15.js → f-image-098c26ce.js} +4 -4
  80. package/dist/esm/{f-paginator-utils-92bbf277.js → f-paginator-utils-674cb2ae.js} +2 -2
  81. package/dist/esm/{f-text-field-0bb2d109.js → f-text-field-c38ef113.js} +1 -1
  82. package/dist/esm/{f-text-field-mdc-d42d3f9e.js → f-text-field-mdc-cee583ea.js} +2 -2
  83. package/dist/esm/ketchup.js +2 -2
  84. package/dist/esm/kup-accordion.entry.js +4 -4
  85. package/dist/esm/kup-autocomplete_27.entry.js +814 -819
  86. package/dist/esm/kup-box.entry.js +10 -10
  87. package/dist/esm/kup-calendar.entry.js +5 -5
  88. package/dist/esm/kup-cell.entry.js +5 -5
  89. package/dist/esm/kup-dash-list.entry.js +1 -1
  90. package/dist/esm/kup-dash_2.entry.js +1 -1
  91. package/dist/esm/kup-dashboard.entry.js +7 -10
  92. package/dist/esm/kup-drawer.entry.js +1 -1
  93. package/dist/esm/kup-echart.entry.js +25 -8
  94. package/dist/esm/kup-family-tree.entry.js +8 -19
  95. package/dist/esm/kup-iframe.entry.js +1 -1
  96. package/dist/esm/kup-image-list.entry.js +8 -8
  97. package/dist/esm/kup-lazy.entry.js +1 -1
  98. package/dist/esm/kup-magic-box.entry.js +2 -2
  99. package/dist/esm/{kup-manager-6145d980.js → kup-manager-b41eb2a8.js} +80 -2
  100. package/dist/esm/kup-nav-bar.entry.js +1 -1
  101. package/dist/esm/kup-numeric-picker.entry.js +5 -5
  102. package/dist/esm/kup-photo-frame.entry.js +1 -1
  103. package/dist/esm/kup-planner.entry.js +1128 -219
  104. package/dist/esm/kup-probe.entry.js +1 -1
  105. package/dist/esm/kup-qlik.entry.js +2 -2
  106. package/dist/esm/kup-snackbar.entry.js +4 -4
  107. package/dist/esm/loader.js +2 -2
  108. package/dist/esm/{tslib.es6-3eea2234.js → tslib.es6-8c2af864.js} +9 -5
  109. package/dist/ketchup/ketchup.esm.js +1 -1
  110. package/dist/ketchup/{p-439ac105.entry.js → p-0b0b61cb.entry.js} +1 -1
  111. package/dist/ketchup/p-0b91f5f8.entry.js +1 -0
  112. package/dist/ketchup/{p-81605f08.js → p-10d84b1b.js} +1 -1
  113. package/dist/ketchup/{p-a203f78b.js → p-27a56c87.js} +1 -1
  114. package/dist/ketchup/{p-32517a99.entry.js → p-395e1960.entry.js} +1 -1
  115. package/dist/ketchup/{p-76bf53df.entry.js → p-3b41aca7.entry.js} +1 -1
  116. package/dist/ketchup/{p-4d039705.entry.js → p-3efe7f43.entry.js} +1 -1
  117. package/dist/ketchup/{p-a641780a.entry.js → p-4325d965.entry.js} +1 -1
  118. package/dist/ketchup/{p-2915a66a.entry.js → p-4ae2ca6f.entry.js} +1 -1
  119. package/dist/ketchup/{p-e4975ffa.entry.js → p-5ce2b4fc.entry.js} +1 -1
  120. package/dist/ketchup/p-5d398e42.js +1 -0
  121. package/dist/ketchup/{p-7cfdce27.js → p-77e3d537.js} +1 -1
  122. package/dist/ketchup/p-7f59211b.js +1 -0
  123. package/dist/ketchup/p-940a5feb.js +30 -0
  124. package/dist/ketchup/{p-826c91d7.js → p-9700eb32.js} +1 -1
  125. package/dist/ketchup/p-a7e19620.entry.js +39 -0
  126. package/dist/ketchup/p-a877a87b.entry.js +9 -0
  127. package/dist/ketchup/p-a9b7533b.entry.js +25 -0
  128. package/dist/ketchup/{p-89ac80c1.entry.js → p-af82131e.entry.js} +1 -1
  129. package/dist/ketchup/{p-da37c417.entry.js → p-b032f47d.entry.js} +1 -1
  130. package/dist/ketchup/{p-0c1cbf8b.entry.js → p-b244f5ca.entry.js} +1 -1
  131. package/dist/ketchup/{p-2a2dc2a8.entry.js → p-bb17c1ba.entry.js} +1 -1
  132. package/dist/ketchup/{p-0c9b7c80.entry.js → p-bd42562d.entry.js} +1 -1
  133. package/dist/ketchup/{p-849ad5d8.entry.js → p-c8b7790a.entry.js} +1 -1
  134. package/dist/ketchup/{p-c022824e.entry.js → p-c968e93d.entry.js} +1 -1
  135. package/dist/ketchup/{p-1242366a.entry.js → p-d739710a.entry.js} +1 -1
  136. package/dist/ketchup/{p-ae4fffe0.js → p-d98fdb9b.js} +1 -1
  137. package/dist/ketchup/{p-c222d070.entry.js → p-da891093.entry.js} +1 -1
  138. package/dist/ketchup/{p-281cff81.entry.js → p-df316daf.entry.js} +1 -1
  139. package/dist/ketchup/{p-d87fb5ff.entry.js → p-e02b5141.entry.js} +1 -1
  140. package/dist/ketchup/{p-ea16ddc0.js → p-e714f4dc.js} +1 -1
  141. package/dist/ketchup/{p-c4d9e3e2.js → p-ef614656.js} +1 -1
  142. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -0
  143. package/dist/types/components/kup-image/kup-image.d.ts +2 -0
  144. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +18 -3
  145. package/dist/types/components/kup-planner/kup-planner.d.ts +36 -11
  146. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -5
  147. package/dist/types/components.d.ts +39 -4
  148. package/dist/types/f-components/f-image/f-image-declarations.d.ts +1 -0
  149. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +1 -1
  150. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +1 -0
  151. package/dist/types/managers/kup-manager/kup-manager.d.ts +7 -0
  152. package/dist/types/types/GenericTypes.d.ts +1 -0
  153. package/package.json +8 -20
  154. package/dist/ketchup/p-02a26d59.entry.js +0 -9
  155. package/dist/ketchup/p-462475ac.entry.js +0 -10
  156. package/dist/ketchup/p-5292ef67.js +0 -30
  157. package/dist/ketchup/p-79b0730b.js +0 -15
  158. package/dist/ketchup/p-9f00ad0f.js +0 -1
  159. package/dist/ketchup/p-be61dd36.entry.js +0 -39
  160. package/dist/ketchup/p-e83e70e2.entry.js +0 -1
@@ -1,6 +1,10 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-b326ffc9.js';
2
- import { as as createCommonjsModule, k as kupManagerInstance, f as KupDatesFormats, am as getCellValueForDisplay, g as getProps, s as setProps } from './kup-manager-6145d980.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement, a as getAssetPath } from './index-b326ffc9.js';
2
+ import { as as createCommonjsModule, az as commonjsGlobal, k as kupManagerInstance, f as KupDatesFormats, am as getCellValueForDisplay, g as getProps, s as setProps, K as KupThemeIconValues, I as KupLanguageSearch } from './kup-manager-b41eb2a8.js';
3
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
4
+ import { F as FTextField } from './f-text-field-c38ef113.js';
5
+ import { F as FTextFieldMDC } from './f-text-field-mdc-cee583ea.js';
6
+ import './tslib.es6-8c2af864.js';
7
+ import './component-120651a0.js';
4
8
 
5
9
  /**
6
10
  * Props of the kup-gantt component.
@@ -38,8 +42,11 @@ var KupPlannerProps;
38
42
  })(KupPlannerProps || (KupPlannerProps = {}));
39
43
  var KupPlannerTaskAction;
40
44
  (function (KupPlannerTaskAction) {
41
- KupPlannerTaskAction["onOpening"] = "onOpening";
42
- KupPlannerTaskAction["onClosing"] = "onClosing";
45
+ KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
46
+ KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
47
+ KupPlannerTaskAction["onClick"] = "onClick";
48
+ KupPlannerTaskAction["onResize"] = "onResize";
49
+ KupPlannerTaskAction["onRightClick"] = "onRightClick";
43
50
  })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
44
51
  var KupPlannerGanttRowType;
45
52
  (function (KupPlannerGanttRowType) {
@@ -8363,6 +8370,545 @@ exports.Zone = Zone;
8363
8370
  //# sourceMappingURL=luxon.js.map
8364
8371
  });
8365
8372
 
8373
+ var hexToCssFilter = createCommonjsModule(function (module, exports) {
8374
+ (function (global, factory) {
8375
+ factory(exports) ;
8376
+ }(commonjsGlobal, (function (exports) {
8377
+ /*! *****************************************************************************
8378
+ Copyright (c) Microsoft Corporation.
8379
+
8380
+ Permission to use, copy, modify, and/or distribute this software for any
8381
+ purpose with or without fee is hereby granted.
8382
+
8383
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8384
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8385
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8386
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8387
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
8388
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8389
+ PERFORMANCE OF THIS SOFTWARE.
8390
+ ***************************************************************************** */
8391
+
8392
+ function __read(o, n) {
8393
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
8394
+ if (!m) return o;
8395
+ var i = m.call(o), r, ar = [], e;
8396
+ try {
8397
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8398
+ }
8399
+ catch (error) { e = { error: error }; }
8400
+ finally {
8401
+ try {
8402
+ if (r && !r.done && (m = i["return"])) m.call(i);
8403
+ }
8404
+ finally { if (e) throw e.error; }
8405
+ }
8406
+ return ar;
8407
+ }
8408
+
8409
+ var Color = /** @class */ (function () {
8410
+ function Color(r, g, b) {
8411
+ this.r = 0;
8412
+ this.g = 0;
8413
+ this.b = 0;
8414
+ this.set(r, g, b);
8415
+ }
8416
+ Color.prototype.set = function (r, g, b) {
8417
+ this.r = this.clamp(r);
8418
+ this.g = this.clamp(g);
8419
+ this.b = this.clamp(b);
8420
+ };
8421
+ /**
8422
+ * Applying cals to get CSS filter for hue-rotate
8423
+ *
8424
+ * @param {number} [angle=0]
8425
+ * @memberof Color
8426
+ */
8427
+ Color.prototype.hueRotate = function (angle) {
8428
+ if (angle === void 0) { angle = 0; }
8429
+ angle = (angle / 180) * Math.PI;
8430
+ var sin = Math.sin(angle);
8431
+ var cos = Math.cos(angle);
8432
+ this.multiply([
8433
+ 0.213 + cos * 0.787 - sin * 0.213,
8434
+ 0.715 - cos * 0.715 - sin * 0.715,
8435
+ 0.072 - cos * 0.072 + sin * 0.928,
8436
+ 0.213 - cos * 0.213 + sin * 0.143,
8437
+ 0.715 + cos * 0.285 + sin * 0.14,
8438
+ 0.072 - cos * 0.072 - sin * 0.283,
8439
+ 0.213 - cos * 0.213 - sin * 0.787,
8440
+ 0.715 - cos * 0.715 + sin * 0.715,
8441
+ 0.072 + cos * 0.928 + sin * 0.072,
8442
+ ]);
8443
+ };
8444
+ /**
8445
+ * Applying cals to get CSS filter for grayscale
8446
+ *
8447
+ * @param {number} [value=1]
8448
+ * @memberof Color
8449
+ */
8450
+ Color.prototype.grayscale = function (value) {
8451
+ if (value === void 0) { value = 1; }
8452
+ this.multiply([
8453
+ 0.2126 + 0.7874 * (1 - value),
8454
+ 0.7152 - 0.7152 * (1 - value),
8455
+ 0.0722 - 0.0722 * (1 - value),
8456
+ 0.2126 - 0.2126 * (1 - value),
8457
+ 0.7152 + 0.2848 * (1 - value),
8458
+ 0.0722 - 0.0722 * (1 - value),
8459
+ 0.2126 - 0.2126 * (1 - value),
8460
+ 0.7152 - 0.7152 * (1 - value),
8461
+ 0.0722 + 0.9278 * (1 - value),
8462
+ ]);
8463
+ };
8464
+ /**
8465
+ * Applying cals to get CSS filter for sepia
8466
+ *
8467
+ * @param {number} [value=1]
8468
+ * @memberof Color
8469
+ */
8470
+ Color.prototype.sepia = function (value) {
8471
+ if (value === void 0) { value = 1; }
8472
+ this.multiply([
8473
+ 0.393 + 0.607 * (1 - value),
8474
+ 0.769 - 0.769 * (1 - value),
8475
+ 0.189 - 0.189 * (1 - value),
8476
+ 0.349 - 0.349 * (1 - value),
8477
+ 0.686 + 0.314 * (1 - value),
8478
+ 0.168 - 0.168 * (1 - value),
8479
+ 0.272 - 0.272 * (1 - value),
8480
+ 0.534 - 0.534 * (1 - value),
8481
+ 0.131 + 0.869 * (1 - value),
8482
+ ]);
8483
+ };
8484
+ /**
8485
+ * Applying cals to get CSS filter for saturate
8486
+ *
8487
+ * @param {number} [value=1]
8488
+ * @memberof Color
8489
+ */
8490
+ Color.prototype.saturate = function (value) {
8491
+ if (value === void 0) { value = 1; }
8492
+ this.multiply([
8493
+ 0.213 + 0.787 * value,
8494
+ 0.715 - 0.715 * value,
8495
+ 0.072 - 0.072 * value,
8496
+ 0.213 - 0.213 * value,
8497
+ 0.715 + 0.285 * value,
8498
+ 0.072 - 0.072 * value,
8499
+ 0.213 - 0.213 * value,
8500
+ 0.715 - 0.715 * value,
8501
+ 0.072 + 0.928 * value,
8502
+ ]);
8503
+ };
8504
+ Color.prototype.multiply = function (matrix) {
8505
+ // These values are needed. It's correct because the returned values will change
8506
+ var newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);
8507
+ var newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);
8508
+ var newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);
8509
+ this.r = newR;
8510
+ this.g = newG;
8511
+ this.b = newB;
8512
+ };
8513
+ /**
8514
+ * Applying cals to get CSS filter for brightness
8515
+ *
8516
+ * @param {number} [value=1]
8517
+ * @memberof Color
8518
+ */
8519
+ Color.prototype.brightness = function (value) {
8520
+ if (value === void 0) { value = 1; }
8521
+ this.linear(value);
8522
+ };
8523
+ /**
8524
+ * Applying cals to get CSS filter for contrast
8525
+ *
8526
+ * @param {number} [value=1]
8527
+ * @memberof Color
8528
+ */
8529
+ Color.prototype.contrast = function (value) {
8530
+ if (value === void 0) { value = 1; }
8531
+ this.linear(value, -(0.5 * value) + 0.5);
8532
+ };
8533
+ Color.prototype.linear = function (slope, intercept) {
8534
+ if (slope === void 0) { slope = 1; }
8535
+ if (intercept === void 0) { intercept = 0; }
8536
+ this.r = this.clamp(this.r * slope + intercept * 255);
8537
+ this.g = this.clamp(this.g * slope + intercept * 255);
8538
+ this.b = this.clamp(this.b * slope + intercept * 255);
8539
+ };
8540
+ /**
8541
+ * Applying cals to get CSS filter for invert
8542
+ *
8543
+ * @param {number} [value=1]
8544
+ * @memberof Color
8545
+ */
8546
+ Color.prototype.invert = function (value) {
8547
+ if (value === void 0) { value = 1; }
8548
+ this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);
8549
+ this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);
8550
+ this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);
8551
+ };
8552
+ /**
8553
+ * transform RGB into HSL values
8554
+ *
8555
+ * @returns {HSLData}
8556
+ * @memberof Color
8557
+ */
8558
+ Color.prototype.hsl = function () {
8559
+ var red = this.r / 255;
8560
+ var green = this.g / 255;
8561
+ var blue = this.b / 255;
8562
+ // find greatest and smallest channel values
8563
+ var max = Math.max(red, green, blue);
8564
+ var min = Math.min(red, green, blue);
8565
+ var hue = 0;
8566
+ var saturation = 0;
8567
+ var lightness = (max + min) / 2;
8568
+ // If min and max have the same values, it means
8569
+ // the given color is achromatic
8570
+ if (max === min) {
8571
+ return {
8572
+ h: 0,
8573
+ s: 0,
8574
+ l: lightness * 100,
8575
+ };
8576
+ }
8577
+ // Adding delta value of greatest and smallest channel values
8578
+ var delta = max - min;
8579
+ saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
8580
+ if (max === red) {
8581
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
8582
+ }
8583
+ else if (max === green) {
8584
+ hue = (blue - red) / delta + 2;
8585
+ }
8586
+ else if (max === blue) {
8587
+ hue = (red - green) / delta + 4;
8588
+ }
8589
+ hue /= 6;
8590
+ return {
8591
+ h: hue * 100,
8592
+ s: saturation * 100,
8593
+ l: lightness * 100,
8594
+ };
8595
+ };
8596
+ /**
8597
+ * Normalize the value to follow the min and max for RGB colors
8598
+ * min: 0
8599
+ * max: 255
8600
+ *
8601
+ * @private
8602
+ * @param {number} value
8603
+ * @returns {number}
8604
+ * @memberof Color
8605
+ */
8606
+ Color.prototype.clamp = function (value) {
8607
+ // Minimum RGB Value = 0;
8608
+ // Maximum RGB Value = 255;
8609
+ return Math.min(Math.max(value, 0), 255);
8610
+ };
8611
+ return Color;
8612
+ }());
8613
+
8614
+ var Solver = /** @class */ (function () {
8615
+ function Solver(target, options) {
8616
+ this.target = target;
8617
+ this.targetHSL = target.hsl();
8618
+ this.options = Object.assign({},
8619
+ // Adding default values for options
8620
+ {
8621
+ acceptanceLossPercentage: 5,
8622
+ maxChecks: 15,
8623
+ }, options);
8624
+ // All the calcs done by the library to generate
8625
+ // a CSS Filter are based on the color `#000`
8626
+ // in this case, `rgb(0, 0, 0)`
8627
+ // Please make sure the background of the element
8628
+ // is `#000` for better performance
8629
+ // and color similarity.
8630
+ this.reusedColor = new Color(0, 0, 0);
8631
+ }
8632
+ /**
8633
+ * Returns the solved values for the
8634
+ *
8635
+ * @returns {(SPSAPayload & { filter: string; })}
8636
+ * @memberof Solver
8637
+ */
8638
+ Solver.prototype.solve = function () {
8639
+ var result = this.solveNarrow(this.solveWide());
8640
+ return {
8641
+ values: result.values,
8642
+ called: result.called,
8643
+ loss: result.loss,
8644
+ filter: this.css(result.values),
8645
+ };
8646
+ };
8647
+ /**
8648
+ * Solve wide values based on the wide values for RGB and HSL values
8649
+ *
8650
+ * @private
8651
+ * @returns {SPSAPayload}
8652
+ * @memberof Solver
8653
+ */
8654
+ Solver.prototype.solveWide = function () {
8655
+ var A = 5;
8656
+ var c = 15;
8657
+ // Wide values for RGB and HSL values
8658
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8659
+ var a = [60, 180, 18000, 600, 1.2, 1.2];
8660
+ var best = { loss: Infinity };
8661
+ var counter = 0;
8662
+ while (best.loss > this.options.acceptanceLossPercentage) {
8663
+ var initialFilterValues = [50, 20, 3750, 50, 100, 100];
8664
+ var result = this.spsa({
8665
+ A: A,
8666
+ a: a,
8667
+ c: c,
8668
+ values: initialFilterValues,
8669
+ // for wide values we should use the double of tries in
8670
+ // comparison of `solveNarrow()` method
8671
+ maxTriesInLoop: 1000,
8672
+ });
8673
+ if (result.loss < best.loss) {
8674
+ best = result;
8675
+ }
8676
+ counter += 1;
8677
+ if (counter >= this.options.maxChecks) {
8678
+ break;
8679
+ }
8680
+ }
8681
+ return Object.assign({}, best, { called: counter });
8682
+ };
8683
+ /**
8684
+ * Solve narrow values based on the wide values for the filter
8685
+ *
8686
+ * @private
8687
+ * @param {SPSAPayload} wide
8688
+ * @returns {SPSAPayload}
8689
+ * @memberof Solver
8690
+ */
8691
+ Solver.prototype.solveNarrow = function (wide) {
8692
+ var A = wide.loss;
8693
+ var c = 2;
8694
+ var A1 = A + 1;
8695
+ // Narrow values for RGB and HSL values
8696
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8697
+ var a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];
8698
+ return this.spsa({
8699
+ A: A,
8700
+ a: a,
8701
+ c: c,
8702
+ values: wide.values,
8703
+ maxTriesInLoop: 500,
8704
+ called: wide.called,
8705
+ });
8706
+ };
8707
+ /**
8708
+ * Returns final value based on the current filter order
8709
+ * to get the order, please check the returned value
8710
+ * in `css()` method
8711
+ *
8712
+ * @private
8713
+ * @param {number} value
8714
+ * @param {number} idx
8715
+ * @returns {number}
8716
+ * @memberof Solver
8717
+ */
8718
+ Solver.prototype.fixValueByFilterIDX = function (value, idx) {
8719
+ var max = 100;
8720
+ // Fixing max, minimum and value by filter
8721
+ if (idx === 2 /* saturate */) {
8722
+ max = 7500;
8723
+ }
8724
+ else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {
8725
+ max = 200;
8726
+ }
8727
+ if (idx === 3 /* hue-rotate */) {
8728
+ if (value > max) {
8729
+ value %= max;
8730
+ }
8731
+ else if (value < 0) {
8732
+ value = max + (value % max);
8733
+ }
8734
+ }
8735
+ // Checking if value is below the minimum or above
8736
+ // the maximum allowed by filter
8737
+ else if (value < 0) {
8738
+ value = 0;
8739
+ }
8740
+ else if (value > max) {
8741
+ value = max;
8742
+ }
8743
+ return value;
8744
+ };
8745
+ Solver.prototype.spsa = function (_a) {
8746
+ var A = _a.A, a = _a.a, c = _a.c, values = _a.values, _b = _a.maxTriesInLoop, maxTriesInLoop = _b === void 0 ? 500 : _b, _c = _a.called, called = _c === void 0 ? 0 : _c;
8747
+ var alpha = 1;
8748
+ var gamma = 0.16666666666666666;
8749
+ var best = null;
8750
+ var bestLoss = Infinity;
8751
+ var deltas = new Array(6);
8752
+ var highArgs = new Array(6);
8753
+ var lowArgs = new Array(6);
8754
+ // Size of all CSS filters to be applied to get the correct color
8755
+ var filtersToBeAppliedSize = 6;
8756
+ for (var key = 0; key < maxTriesInLoop; key++) {
8757
+ var ck = c / Math.pow(key + 1, gamma);
8758
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8759
+ deltas[i] = Math.random() > 0.5 ? 1 : -1;
8760
+ highArgs[i] = values[i] + ck * deltas[i];
8761
+ lowArgs[i] = values[i] - ck * deltas[i];
8762
+ }
8763
+ var lossDiff = this.loss(highArgs) - this.loss(lowArgs);
8764
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8765
+ var g = (lossDiff / (2 * ck)) * deltas[i];
8766
+ var ak = a[i] / Math.pow(A + key + 1, alpha);
8767
+ values[i] = this.fixValueByFilterIDX(values[i] - ak * g, i);
8768
+ }
8769
+ var loss = this.loss(values);
8770
+ if (loss < bestLoss) {
8771
+ best = values.slice(0);
8772
+ bestLoss = loss;
8773
+ }
8774
+ }
8775
+ return { values: best, loss: bestLoss, called: called };
8776
+ };
8777
+ /**
8778
+ * Checks how much is the loss for the filter in RGB and HSL colors
8779
+ *
8780
+ * @private
8781
+ * @param {SPSAPayload['values']} filters
8782
+ * @returns {number}
8783
+ * @memberof Solver
8784
+ */
8785
+ Solver.prototype.loss = function (filters) {
8786
+ // Argument as an Array of percentages.
8787
+ var color = this.reusedColor;
8788
+ // Resetting the color to black in case
8789
+ // it was called more than once
8790
+ color.set(0, 0, 0);
8791
+ color.invert(filters[0] / 100);
8792
+ color.sepia(filters[1] / 100);
8793
+ color.saturate(filters[2] / 100);
8794
+ color.hueRotate(filters[3] * 3.6);
8795
+ color.brightness(filters[4] / 100);
8796
+ color.contrast(filters[5] / 100);
8797
+ var colorHSL = color.hsl();
8798
+ return (Math.abs(color.r - this.target.r) +
8799
+ Math.abs(color.g - this.target.g) +
8800
+ Math.abs(color.b - this.target.b) +
8801
+ Math.abs(colorHSL.h - this.targetHSL.h) +
8802
+ Math.abs(colorHSL.s - this.targetHSL.s) +
8803
+ Math.abs(colorHSL.l - this.targetHSL.l));
8804
+ };
8805
+ /**
8806
+ * Returns the CSS filter list for the received HEX color
8807
+ *
8808
+ * @private
8809
+ * @param {number[]} filters
8810
+ * @returns {string}
8811
+ * @memberof Solver
8812
+ */
8813
+ Solver.prototype.css = function (filters) {
8814
+ var formatCssFilterValueByMultiplier = function (idx, multiplier) {
8815
+ if (multiplier === void 0) { multiplier = 1; }
8816
+ return Math.round(filters[idx] * multiplier);
8817
+ };
8818
+ return [
8819
+ "invert(" + formatCssFilterValueByMultiplier(0) + "%)",
8820
+ "sepia(" + formatCssFilterValueByMultiplier(1) + "%)",
8821
+ "saturate(" + formatCssFilterValueByMultiplier(2) + "%)",
8822
+ "hue-rotate(" + formatCssFilterValueByMultiplier(3, 3.6) + "deg)",
8823
+ "brightness(" + formatCssFilterValueByMultiplier(4) + "%)",
8824
+ "contrast(" + formatCssFilterValueByMultiplier(5) + "%);",
8825
+ ].join(' ');
8826
+ };
8827
+ return Solver;
8828
+ }());
8829
+
8830
+ /**
8831
+ * Transform a CSS Color from Hexadecimal to RGB color
8832
+ *
8833
+ * @param {string} hex hexadecimal color
8834
+ * @returns {([number, number, number] | [])} array with the RGB colors or empty array
8835
+ */
8836
+ var hexToRgb = function (hex) {
8837
+ if (hex.length === 4) {
8838
+ return [parseInt("0x" + hex[1] + hex[1]), parseInt("0x" + hex[2] + hex[2]), parseInt("0x" + hex[3] + hex[3])];
8839
+ }
8840
+ if (hex.length === 7) {
8841
+ return [parseInt("0x" + hex[1] + hex[2]), parseInt("0x" + hex[3] + hex[4]), parseInt("0x" + hex[5] + hex[6])];
8842
+ }
8843
+ return [];
8844
+ };
8845
+ var isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); };
8846
+ // Memory cache for the computed results to avoid multiple
8847
+ // calculations for the same color
8848
+ var results = {};
8849
+ /**
8850
+ * A function that transforms a HEX color into CSS filters
8851
+ *
8852
+ * @param colorValue string hexadecimal color
8853
+ * @param opts HexToCssConfiguration function configuration
8854
+ *
8855
+ */
8856
+ var hexToCSSFilter = function (colorValue, opts) {
8857
+ var _a;
8858
+ if (opts === void 0) { opts = {}; }
8859
+ var red;
8860
+ var green;
8861
+ var blue;
8862
+ if (results[colorValue] && !opts.forceFilterRecalculation) {
8863
+ return Object.assign({}, results[colorValue], { cache: true });
8864
+ }
8865
+ var color;
8866
+ try {
8867
+ _a = __read(hexToRgb(colorValue), 3), red = _a[0], green = _a[1], blue = _a[2];
8868
+ if (!isNumeric(red) || !isNumeric(green) || !isNumeric(blue)) {
8869
+ throw new Error("hextToRgb returned an invalid value for '" + colorValue + "'");
8870
+ }
8871
+ color = new Color(Number(red), Number(green), Number(blue));
8872
+ }
8873
+ catch (error) {
8874
+ throw new Error("Color value should be in HEX format. " + error);
8875
+ }
8876
+ var solver = new Solver(color, Object.assign({},
8877
+ // `HexToCssConfiguration` Defaults
8878
+ {
8879
+ acceptanceLossPercentage: 5,
8880
+ maxChecks: 30,
8881
+ forceFilterRecalculation: false,
8882
+ }, opts));
8883
+ return (results[colorValue] = Object.assign({}, solver.solve(), {
8884
+ hex: colorValue,
8885
+ rgb: [red, green, blue],
8886
+ cache: false,
8887
+ }));
8888
+ };
8889
+ /**
8890
+ * A function that clears cached results
8891
+ *
8892
+ * @param {string} key? HEX string value passed previously `#24639C`. If not passed, it clears all cached results
8893
+ * @returns void
8894
+ */
8895
+ var clearCache = function (key) {
8896
+ if (!key) {
8897
+ results = {};
8898
+ }
8899
+ else if (results[key]) {
8900
+ delete results[key];
8901
+ }
8902
+ };
8903
+
8904
+ exports.clearCache = clearCache;
8905
+ exports.hexToCSSFilter = hexToCSSFilter;
8906
+
8907
+ Object.defineProperty(exports, '__esModule', { value: true });
8908
+
8909
+ })));
8910
+ });
8911
+
8366
8912
  function _extends() {
8367
8913
  _extends = Object.assign ? Object.assign.bind() : function (target) {
8368
8914
  for (var i = 1; i < arguments.length; i++) {
@@ -8436,7 +8982,8 @@ var parseToDayEnd = function parseToDayEnd(endDate) {
8436
8982
  }).toJSDate();
8437
8983
  };
8438
8984
  var formatToIsoDate = function formatToIsoDate(date) {
8439
- return luxon.DateTime.fromJSDate(date).toISODate();
8985
+ var _DateTime$fromJSDate$;
8986
+ return (_DateTime$fromJSDate$ = luxon.DateTime.fromJSDate(date).toISODate()) != null ? _DateTime$fromJSDate$ : undefined;
8440
8987
  };
8441
8988
  var formatToLocaleSimple = function formatToLocaleSimple(date) {
8442
8989
  return luxon.DateTime.fromJSDate(date).toFormat("dd/MM/yyyy");
@@ -8454,6 +9001,8 @@ function validDates(startDate, endDate, _name) {
8454
9001
  };
8455
9002
  }
8456
9003
 
9004
+ var MAIN_GANTT_ID = "main";
9005
+ var SECONDARY_GANTT_ID = "secondary";
8457
9006
  var toViewMode = function toViewMode(timeUnit) {
8458
9007
  switch (timeUnit) {
8459
9008
  case TimeUnit.DAY:
@@ -8466,6 +9015,14 @@ var toViewMode = function toViewMode(timeUnit) {
8466
9015
  return ViewMode.Year;
8467
9016
  }
8468
9017
  };
9018
+ var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
9019
+ switch (timeUnit) {
9020
+ case TimeUnit.YEAR:
9021
+ return 60 * 2;
9022
+ default:
9023
+ return 60;
9024
+ }
9025
+ };
8469
9026
  var convertPhaseToTask = function convertPhaseToTask(item) {
8470
9027
  var mapPhase = function mapPhase(_ref) {
8471
9028
  var phaseStart = _ref.startDate,
@@ -8476,7 +9033,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8476
9033
  phaseId = _ref.id,
8477
9034
  color = _ref.color,
8478
9035
  selectedColor = _ref.selectedColor,
8479
- dependencies = _ref.dependencies;
9036
+ dependencies = _ref.dependencies,
9037
+ icon = _ref.icon;
8480
9038
  var _validDates = validDates(phaseStart, phaseEnd),
8481
9039
  start = _validDates.start,
8482
9040
  end = _validDates.end;
@@ -8499,7 +9057,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8499
9057
  progressColor: color,
8500
9058
  backgroundSelectedColor: selectedColor,
8501
9059
  progressSelectedColor: selectedColor
8502
- } : {}
9060
+ } : {},
9061
+ icon: icon
8503
9062
  };
8504
9063
  };
8505
9064
  return mapPhase(item);
@@ -8530,7 +9089,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8530
9089
  var startDate = x.startDate,
8531
9090
  endDate = x.endDate,
8532
9091
  color = x.color,
8533
- selectedColor = x.selectedColor;
9092
+ selectedColor = x.selectedColor,
9093
+ icon = x.icon;
8534
9094
  var _validDates3 = validDates(startDate, endDate),
8535
9095
  start = _validDates3.start,
8536
9096
  end = _validDates3.end;
@@ -8538,7 +9098,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8538
9098
  start: start,
8539
9099
  end: end,
8540
9100
  backgroundColor: color != null ? color : "0xffffff",
8541
- backgroundSelectedColor: selectedColor != null ? selectedColor : color
9101
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color,
9102
+ icon: icon
8542
9103
  };
8543
9104
  };
8544
9105
  var defaultColor = "#595959";
@@ -8583,7 +9144,8 @@ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartD
8583
9144
  secondaryEnd: end2,
8584
9145
  progress: 100,
8585
9146
  isDisabled: false,
8586
- hideChildren: false
9147
+ hideChildren: false,
9148
+ icon: row.icon
8587
9149
  };
8588
9150
  var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
8589
9151
  return [mainTask].concat(children1);
@@ -8745,8 +9307,8 @@ var ganttDateRangeFromDetail = function ganttDateRangeFromDetail(details, viewMo
8745
9307
  return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
8746
9308
  };
8747
9309
  var ganttDateRangeGeneric = function ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, realDates) {
8748
- var newStartDate = dates[0].start;
8749
- var newEndDate = dates[0].end;
9310
+ var newStartDate = dates.length > 0 ? dates[0].start : new Date();
9311
+ var newEndDate = dates.length > 0 ? dates[0].end : new Date();
8750
9312
  for (var _iterator = _createForOfIteratorHelperLoose(dates), _step; !(_step = _iterator()).done;) {
8751
9313
  var d = _step.value;
8752
9314
  if (d.start < newStartDate) {
@@ -9180,7 +9742,8 @@ var TaskList = function TaskList(_ref) {
9180
9742
  taskListRef = _ref.taskListRef,
9181
9743
  horizontalContainerClass = _ref.horizontalContainerClass,
9182
9744
  TaskListHeader = _ref.TaskListHeader,
9183
- TaskListTable = _ref.TaskListTable;
9745
+ TaskListTable = _ref.TaskListTable,
9746
+ filter = _ref.filter;
9184
9747
  var horizontalContainerRef = react.useRef(null);
9185
9748
  react.useEffect(function () {
9186
9749
  if (horizontalContainerRef.current) {
@@ -9205,6 +9768,10 @@ var TaskList = function TaskList(_ref) {
9205
9768
  setSelectedTask: setSelectedTask,
9206
9769
  onExpanderClick: onExpanderClick
9207
9770
  };
9771
+ react.useEffect(function () {
9772
+ var _taskListRef$current;
9773
+ (_taskListRef$current = taskListRef.current) === null || _taskListRef$current === void 0 ? void 0 : _taskListRef$current.prepend(filter);
9774
+ }, [taskListRef, filter]);
9208
9775
  return react.createElement("div", {
9209
9776
  ref: taskListRef,
9210
9777
  className: classes.tasks
@@ -9755,7 +10322,7 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9755
10322
  var _task$timeline;
9756
10323
  var y = taskYCoordinate(index, rowHeight, taskHeight);
9757
10324
  function convertFrameToTask(frame, j) {
9758
- var _frame$backgroundSele;
10325
+ var _frame$backgroundSele, _frame$icon;
9759
10326
  var _computeTypeAndXs2 = computeTypeAndXs(frame.start, frame.end, "task", dates, columnWidth, handleWidth, false),
9760
10327
  x1 = _computeTypeAndXs2.x1,
9761
10328
  x2 = _computeTypeAndXs2.x2;
@@ -9787,7 +10354,8 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9787
10354
  typeInternal: "timeline",
9788
10355
  x1: x1,
9789
10356
  x2: x2,
9790
- y: y
10357
+ y: y,
10358
+ icon: (_frame$icon = frame.icon) != null ? _frame$icon : undefined
9791
10359
  };
9792
10360
  }
9793
10361
  var _computeTypeAndXs3 = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, false),
@@ -10146,6 +10714,25 @@ var BarProgressHandle = function BarProgressHandle(_ref) {
10146
10714
  });
10147
10715
  };
10148
10716
 
10717
+ var TaskIcon = function TaskIcon(_ref) {
10718
+ var _ref$color = _ref.color,
10719
+ color = _ref$color === void 0 ? "#000000" : _ref$color,
10720
+ url = _ref.url,
10721
+ height = _ref.height,
10722
+ width = _ref.width,
10723
+ x = _ref.x,
10724
+ y = _ref.y;
10725
+ var cssFilter = hexToCssFilter.hexToCSSFilter(color);
10726
+ return react.createElement("image", {
10727
+ href: url,
10728
+ filter: cssFilter.filter.replace(";", ""),
10729
+ x: x,
10730
+ y: y,
10731
+ width: width,
10732
+ height: height
10733
+ });
10734
+ };
10735
+
10149
10736
  var Bar = function Bar(_ref) {
10150
10737
  var _task$x2secondary, _task$x1secondary;
10151
10738
  var task = _ref.task,
@@ -10203,7 +10790,14 @@ var Bar = function Bar(_ref) {
10203
10790
  onMouseDown: function onMouseDown(e) {
10204
10791
  onEventStart("progress", task, e);
10205
10792
  }
10206
- })));
10793
+ })), task.icon && task.icon.url && react.createElement(TaskIcon, {
10794
+ color: task.icon.color,
10795
+ url: task.icon.url,
10796
+ width: task.height / 2 + "px",
10797
+ height: task.height / 2 + "px",
10798
+ x: task.x1 + (task.x2 - task.x1) - task.height / 2 / 2,
10799
+ y: task.y - task.height / 2 / 2 / 2 + (showSecondaryDates ? task.height / 2 : 0)
10800
+ }));
10207
10801
  };
10208
10802
 
10209
10803
  var BarSmall = function BarSmall(_ref) {
@@ -10264,7 +10858,9 @@ var Timeline = function Timeline(_ref) {
10264
10858
  rx: 0,
10265
10859
  ry: 0
10266
10860
  }), task.barChildren.map(function (bar) {
10267
- return react.createElement("rect", {
10861
+ return react.createElement(react.Fragment, {
10862
+ key: bar.id + ".rf"
10863
+ }, react.createElement("rect", {
10268
10864
  style: {
10269
10865
  cursor: "pointer"
10270
10866
  },
@@ -10276,7 +10872,14 @@ var Timeline = function Timeline(_ref) {
10276
10872
  height: bar.height,
10277
10873
  rx: bar.barCornerRadius,
10278
10874
  ry: bar.barCornerRadius
10279
- });
10875
+ }), bar.icon && bar.icon.url && react.createElement(TaskIcon, {
10876
+ color: bar.icon.color,
10877
+ url: bar.icon.url,
10878
+ width: bar.height + "px",
10879
+ height: bar.height + "px",
10880
+ x: bar.x1 + (bar.x2 - bar.x1) - bar.height / 2,
10881
+ y: bar.y - bar.height / 2 / 2
10882
+ }));
10280
10883
  }));
10281
10884
  };
10282
10885
 
@@ -10313,7 +10916,7 @@ var TaskItem = function TaskItem(props) {
10313
10916
  setTaskItem(react.createElement(Bar, Object.assign({}, props)));
10314
10917
  break;
10315
10918
  }
10316
- }, [task, isSelected]);
10919
+ }, [task, isSelected, props]);
10317
10920
  react.useEffect(function () {
10318
10921
  if (textRef.current) {
10319
10922
  setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
@@ -10354,6 +10957,9 @@ var TaskItem = function TaskItem(props) {
10354
10957
  onClick: function onClick(e) {
10355
10958
  onEventStart("click", task, e);
10356
10959
  },
10960
+ onContextMenu: function onContextMenu(e) {
10961
+ onEventStart("contextmenu", task, e);
10962
+ },
10357
10963
  onFocus: function onFocus() {
10358
10964
  onEventStart("select", task);
10359
10965
  }
@@ -10394,6 +11000,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10394
11000
  onProgressChange = _ref.onProgressChange,
10395
11001
  onDoubleClick = _ref.onDoubleClick,
10396
11002
  onClick = _ref.onClick,
11003
+ onContextMenu = _ref.onContextMenu,
10397
11004
  onDelete = _ref.onDelete;
10398
11005
  var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
10399
11006
  var _useState = react.useState(0),
@@ -10555,6 +11162,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10555
11162
  } else if (action === "click") {
10556
11163
  var skipClick = !hasMovedHorizontally(event);
10557
11164
  skipClick && !!onClick && onClick(task);
11165
+ } else if (action === "contextmenu") {
11166
+ event.preventDefault();
11167
+ !!onContextMenu && onContextMenu(event, task);
10558
11168
  } else if (action === "move") {
10559
11169
  var _svg$current$getScree3;
10560
11170
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
@@ -10642,6 +11252,7 @@ var TaskGantt = function TaskGantt(_ref) {
10642
11252
  calendarProps = _ref.calendarProps,
10643
11253
  barProps = _ref.barProps,
10644
11254
  ganttHeight = _ref.ganttHeight,
11255
+ taskGanttRef = _ref.taskGanttRef,
10645
11256
  scrollY = _ref.scrollY,
10646
11257
  scrollX = _ref.scrollX;
10647
11258
  var ganttSVGRef = react.useRef(null);
@@ -10661,7 +11272,8 @@ var TaskGantt = function TaskGantt(_ref) {
10661
11272
  }
10662
11273
  }, [scrollX]);
10663
11274
  return react.createElement("div", {
10664
- className: styles$7.ganttContainer
11275
+ className: styles$7.ganttContainer,
11276
+ ref: taskGanttRef
10665
11277
  }, react.createElement("div", {
10666
11278
  className: styles$7.ganttVerticalContainer,
10667
11279
  ref: verticalGanttContainerRef,
@@ -10692,9 +11304,10 @@ var TaskGantt = function TaskGantt(_ref) {
10692
11304
  var styles$8 = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
10693
11305
 
10694
11306
  var HorizontalScroll = function HorizontalScroll(_ref) {
11307
+ var _taskGanttRef$current;
10695
11308
  var scroll = _ref.scroll,
10696
11309
  svgWidth = _ref.svgWidth,
10697
- taskListWidth = _ref.taskListWidth,
11310
+ taskGanttRef = _ref.taskGanttRef,
10698
11311
  rtl = _ref.rtl,
10699
11312
  onScroll = _ref.onScroll;
10700
11313
  var scrollRef = react.useRef(null);
@@ -10703,12 +11316,12 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
10703
11316
  scrollRef.current.scrollLeft = scroll;
10704
11317
  }
10705
11318
  }, [scroll]);
10706
- console.log("HORIZONTAL-SCROLL svgWidth: " + svgWidth);
11319
+ var rect = (_taskGanttRef$current = taskGanttRef.current) === null || _taskGanttRef$current === void 0 ? void 0 : _taskGanttRef$current.getBoundingClientRect();
10707
11320
  return react.createElement("div", {
10708
11321
  dir: "ltr",
10709
- style: {
10710
- margin: rtl ? "0px " + taskListWidth + "px 0px 0px" : "0px 0px 0px " + taskListWidth + "px"
10711
- },
11322
+ style: rect ? {
11323
+ margin: rtl ? "0px " + rect.x + "px 0px 0px" : "0px 0px 0px " + rect.x + "px"
11324
+ } : undefined,
10712
11325
  className: styles$8.scrollWrapper,
10713
11326
  onScroll: onScroll,
10714
11327
  ref: scrollRef
@@ -10724,13 +11337,14 @@ var Gantt = function Gantt(_ref) {
10724
11337
  var id = _ref.id,
10725
11338
  tasks = _ref.tasks,
10726
11339
  _ref$headerHeight = _ref.headerHeight,
10727
- headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
11340
+ headerHeight = _ref$headerHeight === void 0 ? 114 : _ref$headerHeight,
10728
11341
  _ref$columnWidth = _ref.columnWidth,
10729
11342
  columnWidth = _ref$columnWidth === void 0 ? 60 : _ref$columnWidth,
10730
11343
  _ref$listCellWidth = _ref.listCellWidth,
10731
11344
  listCellWidth = _ref$listCellWidth === void 0 ? "297px" : _ref$listCellWidth,
10732
11345
  _ref$rowHeight = _ref.rowHeight,
10733
11346
  rowHeight = _ref$rowHeight === void 0 ? 50 : _ref$rowHeight,
11347
+ filter = _ref.filter,
10734
11348
  _ref$ganttHeight = _ref.ganttHeight,
10735
11349
  ganttHeight = _ref$ganttHeight === void 0 ? 0 : _ref$ganttHeight,
10736
11350
  _ref$viewMode = _ref.viewMode,
@@ -10802,10 +11416,12 @@ var Gantt = function Gantt(_ref) {
10802
11416
  onProgressChange = _ref.onProgressChange,
10803
11417
  onDoubleClick = _ref.onDoubleClick,
10804
11418
  onClick = _ref.onClick,
11419
+ onContextMenu = _ref.onContextMenu,
10805
11420
  onDelete = _ref.onDelete,
10806
11421
  onSelect = _ref.onSelect,
10807
11422
  onExpanderClick = _ref.onExpanderClick;
10808
11423
  var wrapperRef = react.useRef(null);
11424
+ var taskGanttRef = react.useRef(null);
10809
11425
  var taskListRef = react.useRef(null);
10810
11426
  var _useState = react.useState(function () {
10811
11427
  var _ganttDateRangeFromTa = ganttDateRangeFromTask(tasks, viewMode, preStepsCount, showSecondaryDates, displayedStartDate, displayedEndDate),
@@ -10818,26 +11434,26 @@ var Gantt = function Gantt(_ref) {
10818
11434
  }),
10819
11435
  dateSetup = _useState[0],
10820
11436
  setDateSetup = _useState[1];
10821
- var _useState2 = react.useState(undefined),
10822
- currentViewDate = _useState2[0],
10823
- setCurrentViewDate = _useState2[1];
10824
- var _useState3 = react.useState(0),
10825
- taskListWidth = _useState3[0],
10826
- setTaskListWidth = _useState3[1];
10827
- var _useState4 = react.useState(0),
10828
- svgContainerWidth = _useState4[0],
10829
- setSvgContainerWidth = _useState4[1];
10830
- var _useState5 = react.useState(ganttHeight),
10831
- svgContainerHeight = _useState5[0],
10832
- setSvgContainerHeight = _useState5[1];
10833
- var _useState6 = react.useState([]),
10834
- barTasks = _useState6[0],
10835
- setBarTasks = _useState6[1];
10836
- var _useState7 = react.useState({
11437
+ var taskListWidth = react.useRef(0);
11438
+ var setTaskListWidth = function setTaskListWidth(width) {
11439
+ taskListWidth.current = width;
11440
+ };
11441
+ var svgContainerWidth = react.useRef(0);
11442
+ var setSvgContainerWidth = function setSvgContainerWidth(width) {
11443
+ svgContainerWidth.current = width;
11444
+ };
11445
+ var svgContainerHeight = react.useRef(ganttHeight);
11446
+ var setSvgContainerHeight = function setSvgContainerHeight(height) {
11447
+ svgContainerHeight.current = height;
11448
+ };
11449
+ var _useState2 = react.useState([]),
11450
+ barTasks = _useState2[0],
11451
+ setBarTasks = _useState2[1];
11452
+ var _useState3 = react.useState({
10837
11453
  action: ""
10838
11454
  }),
10839
- ganttEvent = _useState7[0],
10840
- setGanttEvent = _useState7[1];
11455
+ ganttEvent = _useState3[0],
11456
+ setGanttEvent = _useState3[1];
10841
11457
  var taskHeight = react.useMemo(function () {
10842
11458
  return rowHeight * barFill / 100;
10843
11459
  }, [rowHeight, barFill]);
@@ -10847,29 +11463,30 @@ var Gantt = function Gantt(_ref) {
10847
11463
  var timelineHeight = react.useMemo(function () {
10848
11464
  return rowHeight * timelineFill / 100;
10849
11465
  }, [rowHeight, timelineFill]);
10850
- var _useState8 = react.useState(),
10851
- selectedTask = _useState8[0],
10852
- setSelectedTask = _useState8[1];
10853
- var _useState9 = react.useState(null),
10854
- failedTask = _useState9[0],
10855
- setFailedTask = _useState9[1];
11466
+ var _useState4 = react.useState(),
11467
+ selectedTask = _useState4[0],
11468
+ setSelectedTask = _useState4[1];
11469
+ var _useState5 = react.useState(null),
11470
+ failedTask = _useState5[0],
11471
+ setFailedTask = _useState5[1];
10856
11472
  var svgWidth = dateSetup.dates.length * columnWidth;
10857
11473
  var ganttFullHeight = barTasks.length * rowHeight;
10858
- var _useState10 = react.useState(0),
10859
- scrollY = _useState10[0],
10860
- setScrollY = _useState10[1];
10861
- var _useState11 = react.useState(-1),
10862
- scrollX = _useState11[0],
10863
- setScrollX = _useState11[1];
10864
- var _useState12 = react.useState(false),
10865
- ignoreScrollEvent = _useState12[0],
10866
- setIgnoreScrollEvent = _useState12[1];
10867
- var _useState13 = react.useState(),
10868
- currentDateIndicatorContent = _useState13[0],
10869
- setCurrentDateIndicatorContent = _useState13[1];
10870
- var _useState14 = react.useState(),
10871
- projectionContent = _useState14[0],
10872
- setProjectionContent = _useState14[1];
11474
+ var _useState6 = react.useState(0),
11475
+ scrollY = _useState6[0],
11476
+ setScrollY = _useState6[1];
11477
+ var _useState7 = react.useState(-1),
11478
+ scrollX = _useState7[0],
11479
+ setScrollX = _useState7[1];
11480
+ var ignoreScrollEvent = react.useRef(false);
11481
+ var setIgnoreScrollEvent = function setIgnoreScrollEvent(value) {
11482
+ ignoreScrollEvent.current = value;
11483
+ };
11484
+ var _useState8 = react.useState(),
11485
+ currentDateIndicatorContent = _useState8[0],
11486
+ setCurrentDateIndicatorContent = _useState8[1];
11487
+ var _useState9 = react.useState(),
11488
+ projectionContent = _useState9[0],
11489
+ setProjectionContent = _useState9[1];
10873
11490
  react.useEffect(function () {
10874
11491
  window.addEventListener("gantt-sync-scroll-event", function (e) {
10875
11492
  if (e.detail.id !== id) {
@@ -10895,14 +11512,30 @@ var Gantt = function Gantt(_ref) {
10895
11512
  setScrollX(newDates.length * columnWidth);
10896
11513
  }
10897
11514
  }
10898
- setDateSetup({
10899
- dates: newDates,
10900
- viewMode: viewMode
10901
- });
11515
+ var set = false;
11516
+ if (dateSetup && dateSetup.dates) {
11517
+ var old = dateSetup.dates;
11518
+ if (old.length !== newDates.length) {
11519
+ set = true;
11520
+ } else {
11521
+ for (var i = 0; i < old.length; i++) {
11522
+ if (old[i].valueOf() !== newDates[i].valueOf()) {
11523
+ set = true;
11524
+ break;
11525
+ }
11526
+ }
11527
+ }
11528
+ }
11529
+ if (set) {
11530
+ setDateSetup({
11531
+ dates: newDates,
11532
+ viewMode: viewMode
11533
+ });
11534
+ }
10902
11535
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
10903
11536
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
10904
11537
  react.useEffect(function () {
10905
- if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
11538
+ if (viewMode === dateSetup.viewMode && viewDate) {
10906
11539
  var dates = dateSetup.dates;
10907
11540
  var index = dates.findIndex(function (d, i) {
10908
11541
  return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
@@ -10910,10 +11543,10 @@ var Gantt = function Gantt(_ref) {
10910
11543
  if (index === -1) {
10911
11544
  return;
10912
11545
  }
10913
- setCurrentViewDate(viewDate);
11546
+ setIgnoreScrollEvent(true);
10914
11547
  setScrollX(columnWidth * index);
10915
11548
  }
10916
- }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, currentViewDate, setCurrentViewDate]);
11549
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode]);
10917
11550
  react.useEffect(function () {
10918
11551
  var changedTask = ganttEvent.changedTask,
10919
11552
  action = ganttEvent.action;
@@ -10956,9 +11589,9 @@ var Gantt = function Gantt(_ref) {
10956
11589
  }, [taskListRef, listCellWidth]);
10957
11590
  react.useEffect(function () {
10958
11591
  if (wrapperRef.current) {
10959
- setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);
11592
+ setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth.current);
10960
11593
  }
10961
- }, [wrapperRef, taskListWidth]);
11594
+ }, [wrapperRef]);
10962
11595
  react.useEffect(function () {
10963
11596
  if (ganttHeight) {
10964
11597
  setSvgContainerHeight(ganttHeight + headerHeight);
@@ -11001,7 +11634,7 @@ var Gantt = function Gantt(_ref) {
11001
11634
  };
11002
11635
  }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
11003
11636
  var handleScrollY = function handleScrollY(event) {
11004
- if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
11637
+ if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent.current) {
11005
11638
  setScrollY(event.currentTarget.scrollTop);
11006
11639
  setIgnoreScrollEvent(true);
11007
11640
  } else {
@@ -11009,7 +11642,7 @@ var Gantt = function Gantt(_ref) {
11009
11642
  }
11010
11643
  };
11011
11644
  var handleScrollX = function handleScrollX(event) {
11012
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
11645
+ if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent.current) {
11013
11646
  setScrollX(event.currentTarget.scrollLeft);
11014
11647
  setIgnoreScrollEvent(true);
11015
11648
  window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
@@ -11169,6 +11802,7 @@ var Gantt = function Gantt(_ref) {
11169
11802
  onProgressChange: onProgressChange,
11170
11803
  onDoubleClick: onDoubleClick,
11171
11804
  onClick: onClick,
11805
+ onContextMenu: onContextMenu,
11172
11806
  onDelete: onDelete
11173
11807
  };
11174
11808
  var tableProps = {
@@ -11181,6 +11815,7 @@ var Gantt = function Gantt(_ref) {
11181
11815
  headerHeight: headerHeight,
11182
11816
  scrollY: scrollY,
11183
11817
  ganttHeight: ganttHeight,
11818
+ filter: filter,
11184
11819
  horizontalContainerClass: styles$7.horizontalContainer,
11185
11820
  selectedTask: selectedTask,
11186
11821
  taskListRef: taskListRef,
@@ -11199,20 +11834,21 @@ var Gantt = function Gantt(_ref) {
11199
11834
  calendarProps: calendarProps,
11200
11835
  barProps: barProps,
11201
11836
  ganttHeight: ganttHeight,
11837
+ taskGanttRef: taskGanttRef,
11202
11838
  scrollY: scrollY,
11203
11839
  scrollX: scrollX
11204
11840
  }), ganttEvent.changedTask && react.createElement(Tooltip, {
11205
11841
  arrowIndent: arrowIndent,
11206
11842
  rowHeight: rowHeight,
11207
- svgContainerHeight: svgContainerHeight,
11208
- svgContainerWidth: svgContainerWidth,
11843
+ svgContainerHeight: svgContainerHeight.current,
11844
+ svgContainerWidth: svgContainerWidth.current,
11209
11845
  fontFamily: fontFamily,
11210
11846
  fontSize: fontSize,
11211
11847
  scrollX: scrollX,
11212
11848
  scrollY: scrollY,
11213
11849
  task: ganttEvent.changedTask,
11214
11850
  headerHeight: headerHeight,
11215
- taskListWidth: taskListWidth,
11851
+ taskListWidth: taskListWidth.current,
11216
11852
  TooltipContent: TooltipContent,
11217
11853
  rtl: rtl,
11218
11854
  svgWidth: svgWidth
@@ -11225,7 +11861,8 @@ var Gantt = function Gantt(_ref) {
11225
11861
  rtl: rtl
11226
11862
  })), react.createElement(HorizontalScroll, {
11227
11863
  svgWidth: svgWidth,
11228
- taskListWidth: taskListWidth,
11864
+ taskGanttRef: taskGanttRef,
11865
+ taskListWidth: taskListWidth.current,
11229
11866
  scroll: scrollX,
11230
11867
  rtl: rtl,
11231
11868
  onScroll: handleScrollX
@@ -11246,6 +11883,7 @@ var format = function format(date, locale, options) {
11246
11883
  } catch (e) {
11247
11884
  console.error("time-formatters.ts format", date, locale, options);
11248
11885
  console.error(e);
11886
+ return "FORMAT-ERR";
11249
11887
  }
11250
11888
  };
11251
11889
  var dayFormatter = function dayFormatter(date, locale) {
@@ -11270,16 +11908,15 @@ var ganttDateTimeFormatters = {
11270
11908
 
11271
11909
  var classes$1 = {"wrapper":"_37E9D","title":"_WrYI6","toggler":"_c53zr","switch":"_2eBO5","input":"_hiyro","slider":"_2HI58","label":"_2gSdA","filter":"_2cfRI"};
11272
11910
 
11273
- var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView, setDoubleView, onFilterInput) {
11911
+ var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView, setDoubleView) {
11274
11912
  var CustomTaskListHeader = function CustomTaskListHeader(_ref) {
11275
- var headerHeight = _ref.headerHeight,
11276
- fontFamily = _ref.fontFamily,
11913
+ var fontFamily = _ref.fontFamily,
11277
11914
  fontSize = _ref.fontSize;
11278
11915
  return react.createElement("div", {
11279
11916
  style: {
11280
11917
  fontFamily: fontFamily,
11281
11918
  fontSize: fontSize,
11282
- height: headerHeight
11919
+ height: "50px"
11283
11920
  },
11284
11921
  className: classes$1.wrapper
11285
11922
  }, react.createElement("div", {
@@ -11301,16 +11938,7 @@ var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView
11301
11938
  className: classes$1.slider
11302
11939
  })), react.createElement("span", {
11303
11940
  className: classes$1.label
11304
- }, "Mostra previsioni")), react.createElement("div", {
11305
- className: classes$1.filter
11306
- }, react.createElement("input", {
11307
- type: "text",
11308
- name: "filter",
11309
- size: 30,
11310
- onInput: function onInput(e) {
11311
- return onFilterInput === null || onFilterInput === void 0 ? void 0 : onFilterInput(e);
11312
- }
11313
- })));
11941
+ }, "Previsioni")));
11314
11942
  };
11315
11943
  return CustomTaskListHeader;
11316
11944
  };
@@ -11328,7 +11956,8 @@ var ProjectRow = function ProjectRow(_ref) {
11328
11956
  fontFamily = _ref.fontFamily,
11329
11957
  fontSize = _ref.fontSize,
11330
11958
  setSelectedTask = _ref.setSelectedTask,
11331
- onclickTaskList = _ref.onclickTaskList;
11959
+ onclickTaskList = _ref.onclickTaskList,
11960
+ oncontextmenuTaskList = _ref.oncontextmenuTaskList;
11332
11961
  var str = "";
11333
11962
  for (var i = 0; i < valuesToShow.length; i++) {
11334
11963
  str += "1fr ";
@@ -11347,6 +11976,11 @@ var ProjectRow = function ProjectRow(_ref) {
11347
11976
  onClick: function onClick() {
11348
11977
  setSelectedTask(id);
11349
11978
  onclickTaskList(id);
11979
+ },
11980
+ onContextMenu: function onContextMenu(e) {
11981
+ e.preventDefault();
11982
+ setSelectedTask(id);
11983
+ oncontextmenuTaskList(e, id);
11350
11984
  }
11351
11985
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11352
11986
  return react.createElement("span", {
@@ -11368,7 +12002,8 @@ var SubRow = function SubRow(_ref2) {
11368
12002
  fontFamily = _ref2.fontFamily,
11369
12003
  fontSize = _ref2.fontSize,
11370
12004
  setSelectedTask = _ref2.setSelectedTask,
11371
- onclickTaskList = _ref2.onclickTaskList;
12005
+ onclickTaskList = _ref2.onclickTaskList,
12006
+ oncontextmenuTaskList = _ref2.oncontextmenuTaskList;
11372
12007
  var str = "";
11373
12008
  for (var i = 0; i < valuesToShow.length + 1; i++) {
11374
12009
  str += "1fr ";
@@ -11387,6 +12022,11 @@ var SubRow = function SubRow(_ref2) {
11387
12022
  onClick: function onClick() {
11388
12023
  setSelectedTask(id);
11389
12024
  onclickTaskList(id);
12025
+ },
12026
+ onContextMenu: function onContextMenu(e) {
12027
+ e.preventDefault();
12028
+ setSelectedTask(id);
12029
+ oncontextmenuTaskList(e, id);
11390
12030
  }
11391
12031
  }, react.createElement("span", {
11392
12032
  key: "phase_" + id + "_valuesToShow_color",
@@ -11410,7 +12050,9 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11410
12050
  rowHeight = _ref3.rowHeight,
11411
12051
  rowWidth = _ref3.rowWidth,
11412
12052
  fontFamily = _ref3.fontFamily,
11413
- fontSize = _ref3.fontSize;
12053
+ fontSize = _ref3.fontSize,
12054
+ setSelectedTask = _ref3.setSelectedTask,
12055
+ oncontextmenuTaskList = _ref3.oncontextmenuTaskList;
11414
12056
  var str = "";
11415
12057
  for (var i = 0; i < valuesToShow.length; i++) {
11416
12058
  str += "1fr ";
@@ -11425,7 +12067,12 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11425
12067
  return react.createElement("div", {
11426
12068
  key: "detail_" + id,
11427
12069
  className: styles$9.timeline,
11428
- style: customStyle
12070
+ style: customStyle,
12071
+ onContextMenu: function onContextMenu(e) {
12072
+ e.preventDefault();
12073
+ setSelectedTask(id);
12074
+ oncontextmenuTaskList(e, id);
12075
+ }
11429
12076
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11430
12077
  return react.createElement("span", {
11431
12078
  className: index === 0 ? styles$9.main : undefined,
@@ -11434,7 +12081,7 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11434
12081
  }, v);
11435
12082
  }));
11436
12083
  };
11437
- var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
12084
+ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, oncontextmenuTaskList, id) {
11438
12085
  var CustomTaskListTable = function CustomTaskListTable(_ref4) {
11439
12086
  var rowHeight = _ref4.rowHeight,
11440
12087
  rowWidth = _ref4.rowWidth,
@@ -11456,7 +12103,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11456
12103
  fontFamily: fontFamily,
11457
12104
  fontSize: fontSize,
11458
12105
  setSelectedTask: setSelectedTask,
11459
- onclickTaskList: onclickTaskList
12106
+ onclickTaskList: onclickTaskList,
12107
+ oncontextmenuTaskList: oncontextmenuTaskList
11460
12108
  }), task.type === "task" && react.createElement(SubRow, {
11461
12109
  key: task.id + "_" + task.type,
11462
12110
  task: task,
@@ -11465,7 +12113,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11465
12113
  fontFamily: fontFamily,
11466
12114
  fontSize: fontSize,
11467
12115
  setSelectedTask: setSelectedTask,
11468
- onclickTaskList: onclickTaskList
12116
+ onclickTaskList: onclickTaskList,
12117
+ oncontextmenuTaskList: oncontextmenuTaskList
11469
12118
  }), task.type === "timeline" && react.createElement(TimelineSubRow, {
11470
12119
  key: task.id + "_" + task.type,
11471
12120
  task: task,
@@ -11474,7 +12123,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11474
12123
  fontFamily: fontFamily,
11475
12124
  fontSize: fontSize,
11476
12125
  setSelectedTask: setSelectedTask,
11477
- onclickTaskList: onclickTaskList
12126
+ onclickTaskList: onclickTaskList,
12127
+ oncontextmenuTaskList: oncontextmenuTaskList
11478
12128
  }));
11479
12129
  }));
11480
12130
  };
@@ -11537,28 +12187,28 @@ var Planner = function Planner(props) {
11537
12187
  var _useState = react.useState(TimeUnit.MONTH),
11538
12188
  timeUnit = _useState[0],
11539
12189
  setTimeUnit = _useState[1];
11540
- var _useState2 = react.useState(props.mainGantt.items),
11541
- currentTasks = _useState2[0],
11542
- setCurrentTasks = _useState2[1];
11543
- var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
11544
- currentDetails = _useState3[0],
11545
- setCurrentDetails = _useState3[1];
11546
- var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
11547
- mainGanttDoubleView = _useState4[0],
11548
- setMainGanttDoubleView = _useState4[1];
11549
- var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
11550
- displayedDates = _useState5[0],
11551
- setDisplayedDates = _useState5[1];
11552
- var _useState6 = react.useState(),
11553
- viewDate = _useState6[0],
11554
- setViewDate = _useState6[1];
11555
- var _useState7 = react.useState(),
11556
- projection = _useState7[0],
11557
- setProjection = _useState7[1];
11558
- var locale = "it-IT";
11559
- var onFilterInput = function onFilterInput(e) {
11560
- console.log("PLANNER onFilterInput", e);
12190
+ var currentTasks = react.useRef(props.mainGantt.items);
12191
+ var setCurrentTasks = function setCurrentTasks(tasks) {
12192
+ currentTasks.current = tasks;
11561
12193
  };
12194
+ var currentDetails = react.useRef((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items);
12195
+ var setCurrentDetails = function setCurrentDetails(details) {
12196
+ currentDetails.current = details;
12197
+ };
12198
+ var _useState2 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12199
+ mainGanttDoubleView = _useState2[0],
12200
+ setMainGanttDoubleView = _useState2[1];
12201
+ var displayedDates = react.useRef(calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount));
12202
+ var setDisplayedDates = function setDisplayedDates(dates) {
12203
+ displayedDates.current = dates;
12204
+ };
12205
+ var _useState3 = react.useState(),
12206
+ viewDate = _useState3[0],
12207
+ setViewDate = _useState3[1];
12208
+ var _useState4 = react.useState(),
12209
+ projection = _useState4[0],
12210
+ setProjection = _useState4[1];
12211
+ var locale = "it-IT";
11562
12212
  var handleClick = function handleClick(row, onClick) {
11563
12213
  if (!row) {
11564
12214
  return;
@@ -11576,6 +12226,28 @@ var Planner = function Planner(props) {
11576
12226
  }
11577
12227
  onClick === null || onClick === void 0 ? void 0 : onClick(row);
11578
12228
  };
12229
+ var handleContextMenu = function handleContextMenu(event, row, onContextMenu) {
12230
+ if (!row) {
12231
+ return;
12232
+ }
12233
+ if (row.type === "task" && props.secondaryGantt) {
12234
+ var _phase$color2;
12235
+ var phase = row;
12236
+ setProjection({
12237
+ start: new Date(phase.startDate),
12238
+ end: new Date(phase.endDate),
12239
+ color: (_phase$color2 = phase.color) != null ? _phase$color2 : "#ED7D31"
12240
+ });
12241
+ } else {
12242
+ setProjection(undefined);
12243
+ }
12244
+ onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event, row);
12245
+ };
12246
+ var handleSetDoubleView = function handleSetDoubleView(checked) {
12247
+ var _props$onSetDoubleVie;
12248
+ setMainGanttDoubleView(checked);
12249
+ (_props$onSetDoubleVie = props.onSetDoubleView) === null || _props$onSetDoubleVie === void 0 ? void 0 : _props$onSetDoubleVie.call(props, checked);
12250
+ };
11579
12251
  var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
11580
12252
  var id = task === null || task === void 0 ? void 0 : task.id;
11581
12253
  if (!id) {
@@ -11633,25 +12305,32 @@ var Planner = function Planner(props) {
11633
12305
  setProjection(undefined);
11634
12306
  }, [props]);
11635
12307
  react.useEffect(function () {
11636
- var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
12308
+ var dates = calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount);
11637
12309
  setDisplayedDates(dates);
11638
12310
  if (!viewDate) {
11639
- setViewDate(dates.displayedStartDate);
12311
+ var now = new Date();
12312
+ if (dates.displayedStartDate <= now && dates.displayedEndDate >= now) {
12313
+ setViewDate(now);
12314
+ } else {
12315
+ setViewDate(dates.displayedStartDate);
12316
+ }
11640
12317
  }
11641
- }, [currentTasks, currentDetails]);
12318
+ }, [timeUnit, mainGanttDoubleView, props.preStepsCount, viewDate]);
11642
12319
  var tasks = [];
11643
- for (var i = 0; i < currentTasks.length; i++) {
11644
- tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12320
+ for (var i = 0; i < currentTasks.current.length; i++) {
12321
+ tasks.push.apply(tasks, convertProjectToTasks(currentTasks.current[i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11645
12322
  }
11646
12323
  var details = [];
11647
- if (currentDetails) {
11648
- for (var _i = 0; _i < currentDetails.length; _i++) {
11649
- details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12324
+ if (currentDetails.current) {
12325
+ for (var _i = 0; _i < currentDetails.current.length; _i++) {
12326
+ details.push.apply(details, convertProjectToTasks(currentDetails.current[_i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11650
12327
  }
11651
12328
  }
12329
+ console.log("PLANNER render");
11652
12330
  return react.createElement("div", null, react.createElement(Switcher, {
11653
12331
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
11654
- return setTimeUnit(timeUnit);
12332
+ setTimeUnit(timeUnit);
12333
+ setViewDate(undefined);
11655
12334
  }
11656
12335
  }), react.createElement("div", {
11657
12336
  style: {
@@ -11659,73 +12338,109 @@ var Planner = function Planner(props) {
11659
12338
  flexDirection: "column"
11660
12339
  }
11661
12340
  }, react.createElement(Gantt, Object.assign({
11662
- id: "main",
11663
- key: "main",
12341
+ id: MAIN_GANTT_ID,
12342
+ key: MAIN_GANTT_ID,
12343
+ filter: props.mainGantt.filter,
11664
12344
  hideLabel: props.mainGantt.hideLabel,
11665
12345
  showSecondaryDates: mainGanttDoubleView,
11666
12346
  hideDependencies: props.mainGantt.hideDependencies,
11667
12347
  ganttHeight: props.mainGantt.ganttHeight,
11668
- displayedStartDate: displayedDates.displayedStartDate,
11669
- displayedEndDate: displayedDates.displayedEndDate,
12348
+ displayedStartDate: displayedDates.current.displayedStartDate,
12349
+ displayedEndDate: displayedDates.current.displayedEndDate,
11670
12350
  viewDate: viewDate,
11671
12351
  tasks: tasks,
12352
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11672
12353
  viewMode: toViewMode(timeUnit)
11673
12354
  }, props.mainGantt.stylingOptions, {
11674
- TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView, onFilterInput),
12355
+ TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, handleSetDoubleView),
11675
12356
  TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
11676
- var row = getProjectById(id, currentTasks);
12357
+ var row = getProjectById(id, currentTasks.current);
11677
12358
  if (!row) {
11678
- row = getPhaseById(id, currentTasks);
12359
+ row = getPhaseById(id, currentTasks.current);
11679
12360
  }
11680
12361
  if (row) {
11681
12362
  handleClick(row, props.mainGantt.onClick);
11682
12363
  }
11683
- }, "main"),
12364
+ }, function (event, id) {
12365
+ var row = getProjectById(id, currentTasks.current);
12366
+ if (!row) {
12367
+ row = getPhaseById(id, currentTasks.current);
12368
+ }
12369
+ if (row) {
12370
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12371
+ }
12372
+ }, MAIN_GANTT_ID),
11684
12373
  TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
11685
- onClick: function onClick(e) {
11686
- var row = getProjectById(e.id, currentTasks);
12374
+ onClick: function onClick(task) {
12375
+ var row = getProjectById(task.id, currentTasks.current);
11687
12376
  if (!row) {
11688
- row = getPhaseById(e.id, currentTasks);
12377
+ row = getPhaseById(task.id, currentTasks.current);
11689
12378
  }
11690
12379
  if (row) {
11691
12380
  handleClick(row, props.mainGantt.onClick);
11692
12381
  }
11693
12382
  },
11694
- onDateChange: function onDateChange(e) {
11695
- return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
12383
+ onContextMenu: function onContextMenu(event, task) {
12384
+ var row = getProjectById(task.id, currentTasks.current);
12385
+ if (!row) {
12386
+ row = getPhaseById(task.id, currentTasks.current);
12387
+ }
12388
+ if (row) {
12389
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12390
+ }
12391
+ },
12392
+ onDateChange: function onDateChange(task) {
12393
+ return handleDateChange(task, currentTasks.current, props.mainGantt.onDateChange);
11696
12394
  },
11697
12395
  locale: locale,
11698
12396
  dateTimeFormatters: ganttDateTimeFormatters
11699
12397
  })), props.secondaryGantt && react.createElement(Gantt, Object.assign({
11700
- id: "secondary",
11701
- key: "secondary",
12398
+ id: SECONDARY_GANTT_ID,
12399
+ key: SECONDARY_GANTT_ID,
11702
12400
  hideLabel: props.secondaryGantt.hideLabel,
12401
+ filter: props.secondaryGantt.filter,
11703
12402
  showSecondaryDates: mainGanttDoubleView,
11704
12403
  hideDependencies: props.secondaryGantt.hideDependencies,
11705
12404
  ganttHeight: props.secondaryGantt.ganttHeight,
11706
- displayedStartDate: displayedDates.displayedStartDate,
11707
- displayedEndDate: displayedDates.displayedEndDate,
12405
+ displayedStartDate: displayedDates.current.displayedStartDate,
12406
+ displayedEndDate: displayedDates.current.displayedEndDate,
11708
12407
  viewDate: viewDate,
11709
12408
  tasks: details,
12409
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11710
12410
  viewMode: toViewMode(timeUnit)
11711
12411
  }, props.mainGantt.stylingOptions, {
11712
- TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title, undefined, undefined, onFilterInput),
12412
+ TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
11713
12413
  TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
11714
12414
  console.log("planner.tsx secondaryGantt Clicked on " + id);
11715
- }, "secondary"),
12415
+ }, function (event, id) {
12416
+ if (props.secondaryGantt) {
12417
+ var row = getProjectById(id, currentDetails.current);
12418
+ if (row) {
12419
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12420
+ }
12421
+ }
12422
+ }, SECONDARY_GANTT_ID),
11716
12423
  TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
11717
12424
  projection: projection,
11718
- onClick: function onClick(e) {
12425
+ onClick: function onClick(task) {
11719
12426
  if (props.secondaryGantt) {
11720
- var row = getProjectById(e.id, currentDetails);
12427
+ var row = getProjectById(task.id, currentDetails.current);
11721
12428
  if (row) {
11722
12429
  handleClick(row, props.secondaryGantt.onClick);
11723
12430
  }
11724
12431
  }
11725
12432
  },
11726
- onDateChange: function onDateChange(e) {
12433
+ onContextMenu: function onContextMenu(event, task) {
12434
+ if (props.secondaryGantt) {
12435
+ var row = getProjectById(task.id, currentDetails.current);
12436
+ if (row) {
12437
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12438
+ }
12439
+ }
12440
+ },
12441
+ onDateChange: function onDateChange(task) {
11727
12442
  var _props$secondaryGantt7;
11728
- return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
12443
+ return handleDateChange(task, currentDetails.current, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
11729
12444
  },
11730
12445
  locale: locale,
11731
12446
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11784,15 +12499,8 @@ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValu
11784
12499
  return valuesToShow;
11785
12500
  }
11786
12501
 
11787
- 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}";
12502
+ 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;-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}";
11788
12503
 
11789
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11790
- if (kind === "a" && !f)
11791
- throw new TypeError("Private accessor was defined without a getter");
11792
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
11793
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
11794
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11795
- };
11796
12504
  var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11797
12505
  if (kind === "m")
11798
12506
  throw new TypeError("Private method is not writable");
@@ -11802,21 +12510,31 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
11802
12510
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
11803
12511
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11804
12512
  };
11805
- 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;
12513
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12514
+ if (kind === "a" && !f)
12515
+ throw new TypeError("Private accessor was defined without a getter");
12516
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12517
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
12518
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12519
+ };
12520
+ var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_lastOnChangeReceived, _KupPlanner_rootPlanner, _KupPlanner_phases, _KupPlanner_showSecondaryDatesLocal, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_handleOnContextMenuOnTask, _KupPlanner_handleOnContextMenuOnPhase, _KupPlanner_handleOnContextMenuOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter, _KupPlanner_getIconUrl, _KupPlanner_getIconColor;
11806
12521
  const KupPlanner = class {
11807
12522
  constructor(hostRef) {
11808
12523
  registerInstance(this, hostRef);
11809
12524
  this.kupClick = createEvent(this, "kup-planner-click", 6);
11810
12525
  this.kupDateChange = createEvent(this, "kup-planner-datechange", 6);
11811
12526
  this.kupReady = createEvent(this, "kup-planner-ready", 6);
12527
+ this.kupContextMenu = createEvent(this, "kup-planner-contextmenu", 6);
11812
12528
  _KupPlanner_instances.add(this);
11813
12529
  /*-------------------------------------------------*/
11814
12530
  /* I n t e r n a l V a r i a b l e s */
11815
12531
  /*-------------------------------------------------*/
11816
12532
  _KupPlanner_kupManager.set(this, kupManagerInstance());
11817
- _KupPlanner_rootPlanner.set(this, void 0);
11818
12533
  _KupPlanner_lastOnChangeReceived.set(this, void 0);
11819
- this.plannerProps = undefined;
12534
+ _KupPlanner_rootPlanner.set(this, void 0);
12535
+ _KupPlanner_phases.set(this, {});
12536
+ // no re-render
12537
+ _KupPlanner_showSecondaryDatesLocal.set(this, false);
11820
12538
  this.customStyle = '';
11821
12539
  this.data = undefined;
11822
12540
  this.detailData = undefined;
@@ -11824,6 +12542,7 @@ const KupPlanner = class {
11824
12542
  this.detailColumns = undefined;
11825
12543
  this.detailDates = undefined;
11826
12544
  this.detailHeight = undefined;
12545
+ this.detailIconCol = undefined;
11827
12546
  this.detailIdCol = undefined;
11828
12547
  this.detailNameCol = undefined;
11829
12548
  this.detailPrevDates = undefined;
@@ -11833,6 +12552,7 @@ const KupPlanner = class {
11833
12552
  this.phaseColumns = undefined;
11834
12553
  this.phaseColParDep = undefined;
11835
12554
  this.phaseDates = undefined;
12555
+ this.phaseIconCol = undefined;
11836
12556
  this.phaseIdCol = undefined;
11837
12557
  this.phaseNameCol = undefined;
11838
12558
  this.phasePrevDates = undefined;
@@ -11840,25 +12560,23 @@ const KupPlanner = class {
11840
12560
  this.taskColumns = undefined;
11841
12561
  this.taskDates = undefined;
11842
12562
  this.taskHeight = undefined;
12563
+ this.taskIconCol = undefined;
11843
12564
  this.taskIdCol = undefined;
11844
12565
  this.taskNameCol = undefined;
11845
12566
  this.taskPrevDates = undefined;
11846
12567
  this.titleMess = undefined;
12568
+ this.plannerProps = undefined;
11847
12569
  }
11848
- onKupClick(event, taskAction) {
11849
- this.kupClick.emit({
11850
- comp: this,
11851
- id: this.rootElement.id,
11852
- value: event,
11853
- taskAction: taskAction,
11854
- });
12570
+ dataChanged() {
12571
+ __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
11855
12572
  }
11856
- onKupDateChange(event) {
11857
- this.kupDateChange.emit({
11858
- comp: this,
11859
- id: this.rootElement.id,
11860
- value: event,
11861
- });
12573
+ showSecondaryDatesChanged() {
12574
+ var _a;
12575
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12576
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12577
+ this.plannerProps.mainGantt.showSecondaryDates =
12578
+ this.showSecondaryDates;
12579
+ }
11862
12580
  }
11863
12581
  /*-------------------------------------------------*/
11864
12582
  /* P u b l i c M e t h o d s */
@@ -11893,6 +12611,7 @@ const KupPlanner = class {
11893
12611
  var _a;
11894
12612
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11895
12613
  if (task) {
12614
+ __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
11896
12615
  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) => {
11897
12616
  const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
11898
12617
  const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
@@ -11900,6 +12619,8 @@ const KupPlanner = class {
11900
12619
  : col == this.phaseDates[1]
11901
12620
  ? '#END#'
11902
12621
  : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12622
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12623
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
11903
12624
  let phase = {
11904
12625
  taskRow: task.taskRow,
11905
12626
  phaseRow: row,
@@ -11916,59 +12637,43 @@ const KupPlanner = class {
11916
12637
  selectedColor: row.cells[this.phaseColorCol].value,
11917
12638
  valuesToShow: valuesToShow,
11918
12639
  rowType: KupPlannerGanttRowType.PHASE,
12640
+ icon: iconUrl
12641
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12642
+ : undefined,
11919
12643
  };
11920
12644
  return phase;
11921
12645
  });
11922
12646
  }
11923
12647
  this.plannerProps = Object.assign({}, this.plannerProps);
11924
12648
  }
11925
- handleOnClick(nativeEvent) {
11926
- console.log('handleOnClick', nativeEvent);
11927
- switch (nativeEvent.rowType) {
11928
- case KupPlannerGanttRowType.TASK:
11929
- const taskAction = nativeEvent.phases
11930
- ? KupPlannerTaskAction.onClosing
11931
- : KupPlannerTaskAction.onOpening;
11932
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
11933
- this.onKupClick(nativeEvent, taskAction);
11934
- }
11935
- break;
11936
- case KupPlannerGanttRowType.PHASE:
11937
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
11938
- this.onKupClick(nativeEvent);
11939
- }
11940
- break;
11941
- case KupPlannerGanttRowType.DETAIL:
11942
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
11943
- this.onKupClick(nativeEvent);
11944
- }
11945
- break;
11946
- }
11947
- }
11948
- handleOnDateChange(nativeEvent) {
11949
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
11950
- console.log('handleOnDateChange', nativeEvent);
11951
- this.onKupDateChange(nativeEvent);
11952
- }
11953
- }
12649
+ //---- Lifecycle hooks ----
11954
12650
  componentWillLoad() {
11955
12651
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
11956
12652
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
11957
12653
  }
11958
12654
  componentDidLoad() {
12655
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
11959
12656
  let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
11960
12657
  if (details && details.length == 0) {
11961
12658
  details = undefined;
11962
12659
  }
12660
+ const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
12661
+ FTextFieldMDC(mainFilter);
12662
+ const secondaryFilter = this.rootElement.shadowRoot.querySelector('#secondary-filter');
12663
+ if (details) {
12664
+ FTextFieldMDC(secondaryFilter);
12665
+ }
11963
12666
  this.plannerProps = {
11964
12667
  mainGantt: {
11965
12668
  title: this.titleMess,
11966
12669
  items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
11967
12670
  stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12671
+ filter: mainFilter,
11968
12672
  hideLabel: true,
11969
12673
  ganttHeight: this.taskHeight,
11970
- showSecondaryDates: this.showSecondaryDates,
12674
+ showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_showSecondaryDatesLocal, "f"),
11971
12675
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12676
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
11972
12677
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11973
12678
  },
11974
12679
  secondaryGantt: details
@@ -11976,14 +12681,16 @@ const KupPlanner = class {
11976
12681
  title: '',
11977
12682
  items: details,
11978
12683
  stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12684
+ filter: secondaryFilter,
11979
12685
  hideLabel: true,
11980
12686
  ganttHeight: this.detailHeight,
11981
12687
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12688
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
11982
12689
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11983
12690
  }
11984
12691
  : undefined,
12692
+ onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
11985
12693
  };
11986
- console.log('kup-planner.tsx componentDidLoad plannerProps', this.plannerProps);
11987
12694
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
11988
12695
  this.kupReady.emit({
11989
12696
  comp: this,
@@ -11998,16 +12705,136 @@ const KupPlanner = class {
11998
12705
  componentDidRender() {
11999
12706
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12000
12707
  }
12708
+ onKupClick(event, taskAction) {
12709
+ this.kupClick.emit({
12710
+ comp: this,
12711
+ id: this.rootElement.id,
12712
+ value: event,
12713
+ taskAction: taskAction,
12714
+ });
12715
+ }
12716
+ onKupContextMenu(event, ganttRow, taskAction) {
12717
+ let row;
12718
+ let cell;
12719
+ let column;
12720
+ switch (ganttRow.type) {
12721
+ case 'project': {
12722
+ row = ganttRow.taskRow;
12723
+ cell = row.cells[this.taskIdCol];
12724
+ column = this.data.columns[this.taskIdCol];
12725
+ break;
12726
+ }
12727
+ case 'task': {
12728
+ row = ganttRow.phaseRow;
12729
+ cell = row.cells[this.phaseIdCol];
12730
+ //column = this.data.columns[this.taskIdCol];
12731
+ break;
12732
+ }
12733
+ case 'timeline': {
12734
+ row = ganttRow.detailRow;
12735
+ cell = row.cells[this.detailIdCol];
12736
+ column = this.data.columns[this.detailIdCol];
12737
+ break;
12738
+ }
12739
+ }
12740
+ this.kupContextMenu.emit({
12741
+ comp: this,
12742
+ id: this.rootElement.id,
12743
+ value: ganttRow,
12744
+ taskAction: taskAction,
12745
+ details: {
12746
+ cell: cell,
12747
+ column: column,
12748
+ originalEvent: event,
12749
+ row: row,
12750
+ },
12751
+ });
12752
+ }
12753
+ onKupDateChange(event, taskAction) {
12754
+ this.kupDateChange.emit({
12755
+ comp: this,
12756
+ id: this.rootElement.id,
12757
+ value: event,
12758
+ taskAction: taskAction,
12759
+ });
12760
+ }
12761
+ handleOnClick(nativeEvent) {
12762
+ switch (nativeEvent.rowType) {
12763
+ case KupPlannerGanttRowType.TASK:
12764
+ const taskAction = nativeEvent.phases
12765
+ ? KupPlannerTaskAction.onTaskClosing
12766
+ : KupPlannerTaskAction.onTaskOpening;
12767
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12768
+ this.onKupClick(nativeEvent, taskAction);
12769
+ }
12770
+ break;
12771
+ case KupPlannerGanttRowType.PHASE:
12772
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12773
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12774
+ }
12775
+ break;
12776
+ case KupPlannerGanttRowType.DETAIL:
12777
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12778
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12779
+ }
12780
+ break;
12781
+ }
12782
+ }
12783
+ handleOnContextMenu(event, row) {
12784
+ switch (row.rowType) {
12785
+ case KupPlannerGanttRowType.TASK:
12786
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12787
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12788
+ }
12789
+ break;
12790
+ case KupPlannerGanttRowType.PHASE:
12791
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12792
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12793
+ }
12794
+ break;
12795
+ case KupPlannerGanttRowType.DETAIL:
12796
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12797
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12798
+ }
12799
+ break;
12800
+ }
12801
+ }
12802
+ handleOnSetDoubleView(checked) {
12803
+ var _a;
12804
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, checked, "f");
12805
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12806
+ this.plannerProps.mainGantt.showSecondaryDates = checked;
12807
+ }
12808
+ }
12809
+ handleOnDateChange(nativeEvent) {
12810
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12811
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12812
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12813
+ }
12814
+ }
12815
+ }
12001
12816
  render() {
12002
- //console.log('kup-planner.tsx render');
12003
- return (h(Host, null, h("div", { id: componentWrapperId, style: { maxWidth: this.maxWidth } })));
12817
+ var _a;
12818
+ 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) => {
12819
+ if (e.key === 'Enter') {
12820
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
12821
+ }
12822
+ }, 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) => {
12823
+ if (e.key === 'Enter') {
12824
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e, true);
12825
+ }
12826
+ }, wrapperClass: "filter" })) : null));
12004
12827
  }
12005
12828
  disconnectedCallback() {
12006
12829
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12007
12830
  }
12008
12831
  get rootElement() { return getElement(this); }
12832
+ static get watchers() { return {
12833
+ "data": ["dataChanged"],
12834
+ "showSecondaryDates": ["showSecondaryDatesChanged"]
12835
+ }; }
12009
12836
  };
12010
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12837
+ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_phases = new WeakMap(), _KupPlanner_showSecondaryDatesLocal = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12011
12838
  var _a;
12012
12839
  (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12013
12840
  const componentWrapperElement = this.rootElement.shadowRoot.getElementById(componentWrapperId);
@@ -12019,7 +12846,13 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12019
12846
  var _a;
12020
12847
  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) => {
12021
12848
  const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12022
- const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12849
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12850
+ ? '#START#'
12851
+ : col == this.taskDates[1]
12852
+ ? '#END#'
12853
+ : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12854
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
12855
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
12023
12856
  let task = {
12024
12857
  taskRow: row,
12025
12858
  taskRowId: row.id,
@@ -12032,6 +12865,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12032
12865
  type: 'project',
12033
12866
  valuesToShow: valuesToShow,
12034
12867
  rowType: KupPlannerGanttRowType.TASK,
12868
+ icon: iconUrl
12869
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12870
+ : undefined,
12035
12871
  };
12036
12872
  return task;
12037
12873
  });
@@ -12044,6 +12880,7 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12044
12880
  data.rows
12045
12881
  .filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
12046
12882
  .forEach((row) => {
12883
+ var _a, _b;
12047
12884
  const detailId = row.cells[this.detailIdCol].value;
12048
12885
  const detailNameId = row.cells[this.detailNameCol].value;
12049
12886
  const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
@@ -12053,6 +12890,7 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12053
12890
  detail = {
12054
12891
  id: detailId,
12055
12892
  name: detailNameId,
12893
+ detailRow: row,
12056
12894
  type: 'timeline',
12057
12895
  valuesToShow: valuesToShow,
12058
12896
  rowType: KupPlannerGanttRowType.DETAIL,
@@ -12060,15 +12898,20 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12060
12898
  };
12061
12899
  details.push(detail);
12062
12900
  }
12901
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
12902
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
12063
12903
  detail.schedule.push({
12064
12904
  startDate: datesSanitized.dateValues[0],
12065
12905
  endDate: datesSanitized.dateValues[1],
12066
12906
  color: this.detailColorCol
12067
- ? row.cells[this.detailColorCol].value
12907
+ ? (_a = row.cells[this.detailColorCol].value) !== null && _a !== void 0 ? _a : '#D9D9D8'
12068
12908
  : '#D9D9D8',
12069
12909
  selectedColor: this.detailColorCol
12070
- ? row.cells[this.detailColorCol].value
12910
+ ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12071
12911
  : '#D9D9D8',
12912
+ icon: iconUrl
12913
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12914
+ : undefined,
12072
12915
  });
12073
12916
  });
12074
12917
  return details;
@@ -12078,9 +12921,6 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12078
12921
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12079
12922
  if (task)
12080
12923
  task.phases = undefined;
12081
- // this.plannerProps.mainGantt = JSON.parse(
12082
- // JSON.stringify(this.plannerProps.mainGantt)
12083
- // );
12084
12924
  this.plannerProps = Object.assign({}, this.plannerProps);
12085
12925
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
12086
12926
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -12092,6 +12932,12 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12092
12932
  return true;
12093
12933
  }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12094
12934
  return true;
12935
+ }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
12936
+ return true;
12937
+ }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
12938
+ return true;
12939
+ }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
12940
+ return true;
12095
12941
  }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
12096
12942
  let emitEvent = false;
12097
12943
  if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
@@ -12103,6 +12949,69 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12103
12949
  emitEvent = true;
12104
12950
  }
12105
12951
  return emitEvent;
12952
+ }, _KupPlanner_onFilter = function _KupPlanner_onFilter(e, isDetail) {
12953
+ const tempData = {
12954
+ columns: this.data.columns,
12955
+ rows: [],
12956
+ };
12957
+ const value = e.target.value;
12958
+ const data = isDetail ? this.detailData : this.data;
12959
+ const tempRows = [];
12960
+ for (let index = 0; index < data.rows.length; index++) {
12961
+ const row = data.rows[index];
12962
+ const cells = row.cells;
12963
+ for (let index = 0; index < data.columns.length; index++) {
12964
+ const column = data.columns[index];
12965
+ const cell = cells[column.name];
12966
+ if (cell) {
12967
+ const dValue = getCellValueForDisplay(data.columns[index], cell);
12968
+ const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
12969
+ if (found) {
12970
+ tempRows.push({ row, weight: index });
12971
+ break;
12972
+ }
12973
+ }
12974
+ }
12975
+ }
12976
+ tempRows
12977
+ .sort((a, b) => a.weight - b.weight)
12978
+ .forEach((tempRow) => {
12979
+ tempData.rows.push(tempRow.row);
12980
+ });
12981
+ const newGantt = isDetail
12982
+ ? {
12983
+ secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
12984
+ }
12985
+ : {
12986
+ mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12987
+ };
12988
+ this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
12989
+ }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
12990
+ var _a;
12991
+ let iconUrl = undefined;
12992
+ if (columnName) {
12993
+ const iconCell = row.cells[columnName];
12994
+ let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
12995
+ if (!icon) {
12996
+ icon = iconCell.value;
12997
+ }
12998
+ if (icon) {
12999
+ iconUrl = getAssetPath('./assets/svg/' + icon + '.svg');
13000
+ }
13001
+ }
13002
+ return iconUrl;
13003
+ }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13004
+ var _a;
13005
+ let iconColor = undefined;
13006
+ if (columnName) {
13007
+ const iconCell = row.cells[columnName];
13008
+ iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13009
+ if (iconColor) {
13010
+ iconColor =
13011
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13012
+ }
13013
+ }
13014
+ return iconColor;
12106
13015
  };
12107
13016
  KupPlanner.style = kupPlannerCss;
12108
13017