@sme.up/ketchup 7.5.0-SNAPSHOT → 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 (147) hide show
  1. package/dist/cjs/{component-72a5b626.js → component-85c2bd4d.js} +1 -1
  2. package/dist/cjs/{f-button-a508a0a1.js → f-button-49b2c37c.js} +2 -2
  3. package/dist/cjs/{f-cell-52d724f5.js → f-cell-9a6bc55c.js} +6 -6
  4. package/dist/cjs/{f-checkbox-1148e791.js → f-checkbox-593f72c3.js} +1 -1
  5. package/dist/cjs/{f-chip-cbb70aed.js → f-chip-dee84122.js} +3 -3
  6. package/dist/cjs/{f-image-510563ed.js → f-image-27f965ff.js} +2 -2
  7. package/dist/cjs/{f-paginator-utils-ff531caa.js → f-paginator-utils-4a30189d.js} +3 -3
  8. package/dist/cjs/{f-text-field-d17e5aa0.js → f-text-field-04a663b4.js} +2 -2
  9. package/dist/cjs/{f-text-field-mdc-85997738.js → f-text-field-mdc-0e22f3e3.js} +2 -2
  10. package/dist/cjs/{index-1f177abc.js → index-74433248.js} +3 -0
  11. package/dist/cjs/ketchup.cjs.js +2 -2
  12. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  13. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +805 -816
  14. package/dist/cjs/kup-box.cjs.entry.js +13 -13
  15. package/dist/cjs/kup-calendar.cjs.entry.js +6 -6
  16. package/dist/cjs/kup-cell.cjs.entry.js +7 -7
  17. package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
  18. package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-dashboard.cjs.entry.js +9 -9
  20. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-echart.cjs.entry.js +26 -9
  22. package/dist/cjs/kup-family-tree.cjs.entry.js +8 -19
  23. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-image-list.cjs.entry.js +10 -10
  25. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  27. package/dist/cjs/{kup-manager-9e1680dd.js → kup-manager-2ff5d258.js} +78 -2
  28. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-numeric-picker.cjs.entry.js +6 -6
  30. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-planner.cjs.entry.js +1042 -193
  32. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  33. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  34. package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
  35. package/dist/cjs/loader.cjs.js +2 -2
  36. package/dist/cjs/{tslib.es6-0ee02c67.js → tslib.es6-386654de.js} +9 -5
  37. package/dist/collection/components/kup-chip/kup-chip.js +4 -3
  38. package/dist/collection/components/kup-data-table/kup-data-table.js +5 -16
  39. package/dist/collection/components/kup-echart/kup-echart-declarations.js +2 -0
  40. package/dist/collection/components/kup-echart/kup-echart.js +23 -8
  41. package/dist/collection/components/kup-family-tree/kup-family-tree.js +4 -15
  42. package/dist/collection/components/kup-planner/kup-planner-declarations.js +1 -0
  43. package/dist/collection/components/kup-planner/kup-planner.css +1 -3
  44. package/dist/collection/components/kup-planner/kup-planner.js +302 -72
  45. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -3
  46. package/dist/collection/components/kup-tree/kup-tree.js +66 -67
  47. package/dist/collection/managers/kup-manager/kup-manager.js +18 -0
  48. package/dist/components/kup-autocomplete2.js +211 -143
  49. package/dist/components/kup-echart2.js +24 -7
  50. package/dist/components/kup-family-tree.js +4 -15
  51. package/dist/components/kup-planner.js +1041 -189
  52. package/dist/components/kup-progress-bar.js +1 -1
  53. package/dist/components/kup-radio.js +1 -1
  54. package/dist/components/kup-rating.js +1 -1
  55. package/dist/components/kup-snackbar.js +1 -1
  56. package/dist/components/kup-spinner.js +1 -1
  57. package/dist/components/kup-switch.js +1 -1
  58. package/dist/components/kup-tab-bar.js +1 -1
  59. package/dist/components/kup-text-field.js +1 -1
  60. package/dist/components/kup-time-picker.js +1 -1
  61. package/dist/components/kup-tree.js +1 -1
  62. package/dist/esm/{component-b1bedf1d.js → component-120651a0.js} +1 -1
  63. package/dist/esm/{f-button-b7f77b26.js → f-button-744cf1f6.js} +2 -2
  64. package/dist/esm/{f-cell-dc3beffe.js → f-cell-b319c869.js} +6 -6
  65. package/dist/esm/{f-checkbox-9b3f5f5b.js → f-checkbox-ec85b437.js} +1 -1
  66. package/dist/esm/{f-chip-0a678211.js → f-chip-7e3e4180.js} +3 -3
  67. package/dist/esm/{f-image-f84dbd7c.js → f-image-098c26ce.js} +2 -2
  68. package/dist/esm/{f-paginator-utils-52902bd6.js → f-paginator-utils-674cb2ae.js} +3 -3
  69. package/dist/esm/{f-text-field-7dd143be.js → f-text-field-c38ef113.js} +2 -2
  70. package/dist/esm/{f-text-field-mdc-d42d3f9e.js → f-text-field-mdc-cee583ea.js} +2 -2
  71. package/dist/esm/{index-8bd38435.js → index-b326ffc9.js} +3 -1
  72. package/dist/esm/ketchup.js +3 -3
  73. package/dist/esm/kup-accordion.entry.js +5 -5
  74. package/dist/esm/kup-autocomplete_27.entry.js +805 -816
  75. package/dist/esm/kup-box.entry.js +13 -13
  76. package/dist/esm/kup-calendar.entry.js +6 -6
  77. package/dist/esm/kup-cell.entry.js +7 -7
  78. package/dist/esm/kup-dash-list.entry.js +2 -2
  79. package/dist/esm/kup-dash_2.entry.js +2 -2
  80. package/dist/esm/kup-dashboard.entry.js +9 -9
  81. package/dist/esm/kup-drawer.entry.js +2 -2
  82. package/dist/esm/kup-echart.entry.js +26 -9
  83. package/dist/esm/kup-family-tree.entry.js +8 -19
  84. package/dist/esm/kup-iframe.entry.js +2 -2
  85. package/dist/esm/kup-image-list.entry.js +10 -10
  86. package/dist/esm/kup-lazy.entry.js +2 -2
  87. package/dist/esm/kup-magic-box.entry.js +3 -3
  88. package/dist/esm/{kup-manager-a5ab58a0.js → kup-manager-b41eb2a8.js} +78 -3
  89. package/dist/esm/kup-nav-bar.entry.js +2 -2
  90. package/dist/esm/kup-numeric-picker.entry.js +6 -6
  91. package/dist/esm/kup-photo-frame.entry.js +2 -2
  92. package/dist/esm/kup-planner.entry.js +1042 -193
  93. package/dist/esm/kup-probe.entry.js +2 -2
  94. package/dist/esm/kup-qlik.entry.js +2 -2
  95. package/dist/esm/kup-snackbar.entry.js +5 -5
  96. package/dist/esm/loader.js +3 -3
  97. package/dist/esm/{tslib.es6-3eea2234.js → tslib.es6-8c2af864.js} +9 -5
  98. package/dist/ketchup/ketchup.esm.js +1 -1
  99. package/dist/ketchup/{p-9ae47a0d.entry.js → p-0b0b61cb.entry.js} +1 -1
  100. package/dist/ketchup/p-0b91f5f8.entry.js +1 -0
  101. package/dist/ketchup/{p-81605f08.js → p-10d84b1b.js} +1 -1
  102. package/dist/ketchup/{p-a203f78b.js → p-27a56c87.js} +1 -1
  103. package/dist/ketchup/{p-871cfe60.entry.js → p-395e1960.entry.js} +1 -1
  104. package/dist/ketchup/{p-e92d1972.entry.js → p-3b41aca7.entry.js} +1 -1
  105. package/dist/ketchup/{p-98ff4101.entry.js → p-3efe7f43.entry.js} +1 -1
  106. package/dist/ketchup/{p-a32cc181.entry.js → p-4325d965.entry.js} +1 -1
  107. package/dist/ketchup/{p-6022c951.entry.js → p-4ae2ca6f.entry.js} +1 -1
  108. package/dist/ketchup/{p-a122b8d3.entry.js → p-5ce2b4fc.entry.js} +1 -1
  109. package/dist/ketchup/{p-d1e3573f.js → p-5d398e42.js} +1 -1
  110. package/dist/ketchup/{p-7065b172.js → p-77e3d537.js} +1 -1
  111. package/dist/ketchup/p-7f59211b.js +1 -0
  112. package/dist/ketchup/{p-4fd6c34c.js → p-940a5feb.js} +2 -2
  113. package/dist/ketchup/{p-69f3b9da.js → p-9700eb32.js} +1 -1
  114. package/dist/ketchup/{p-f158836b.entry.js → p-a7e19620.entry.js} +2 -2
  115. package/dist/ketchup/p-a877a87b.entry.js +9 -0
  116. package/dist/ketchup/p-a9b7533b.entry.js +25 -0
  117. package/dist/ketchup/{p-00fc0f80.entry.js → p-af82131e.entry.js} +1 -1
  118. package/dist/ketchup/{p-78d1fc60.entry.js → p-b032f47d.entry.js} +1 -1
  119. package/dist/ketchup/{p-beb0907a.entry.js → p-b244f5ca.entry.js} +1 -1
  120. package/dist/ketchup/{p-d2670436.entry.js → p-bb17c1ba.entry.js} +1 -1
  121. package/dist/ketchup/{p-d315f7fa.entry.js → p-bd42562d.entry.js} +1 -1
  122. package/dist/ketchup/{p-9f9b6656.js → p-c26975bf.js} +1 -1
  123. package/dist/ketchup/p-c8b7790a.entry.js +1 -0
  124. package/dist/ketchup/p-c968e93d.entry.js +1 -0
  125. package/dist/ketchup/{p-9dcfbb1e.js → p-d4ece435.js} +2 -2
  126. package/dist/ketchup/{p-c797ab39.entry.js → p-d739710a.entry.js} +1 -1
  127. package/dist/ketchup/{p-c5c6a2fb.js → p-d98fdb9b.js} +1 -1
  128. package/dist/ketchup/{p-166257d0.entry.js → p-da891093.entry.js} +1 -1
  129. package/dist/ketchup/{p-3ae1409f.entry.js → p-df316daf.entry.js} +1 -1
  130. package/dist/ketchup/{p-d711e9ae.entry.js → p-e02b5141.entry.js} +1 -1
  131. package/dist/ketchup/{p-28efed63.js → p-e714f4dc.js} +1 -1
  132. package/dist/ketchup/{p-de34eb56.js → p-ef614656.js} +1 -1
  133. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -0
  134. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +15 -2
  135. package/dist/types/components/kup-planner/kup-planner.d.ts +36 -11
  136. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -5
  137. package/dist/types/components.d.ts +38 -4
  138. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +1 -1
  139. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +1 -0
  140. package/dist/types/managers/kup-manager/kup-manager.d.ts +7 -0
  141. package/package.json +6 -18
  142. package/dist/ketchup/p-7040cab7.entry.js +0 -1
  143. package/dist/ketchup/p-71cb80ac.entry.js +0 -9
  144. package/dist/ketchup/p-79b0730b.js +0 -15
  145. package/dist/ketchup/p-8d0e6825.entry.js +0 -1
  146. package/dist/ketchup/p-efb80719.entry.js +0 -1
  147. package/dist/ketchup/p-f69a6d89.entry.js +0 -10
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1f177abc.js');
6
- const kupManager$1 = require('./kup-manager-9e1680dd.js');
5
+ const index = require('./index-74433248.js');
6
+ const kupManager$1 = require('./kup-manager-2ff5d258.js');
7
7
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
8
- const fTextField = require('./f-text-field-d17e5aa0.js');
9
- const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
10
- require('./tslib.es6-0ee02c67.js');
11
- require('./component-72a5b626.js');
8
+ const fTextField = require('./f-text-field-04a663b4.js');
9
+ const fTextFieldMdc = require('./f-text-field-mdc-0e22f3e3.js');
10
+ require('./tslib.es6-386654de.js');
11
+ require('./component-85c2bd4d.js');
12
12
 
13
13
  /**
14
14
  * Props of the kup-gantt component.
@@ -50,6 +50,7 @@ var KupPlannerTaskAction;
50
50
  KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
51
51
  KupPlannerTaskAction["onClick"] = "onClick";
52
52
  KupPlannerTaskAction["onResize"] = "onResize";
53
+ KupPlannerTaskAction["onRightClick"] = "onRightClick";
53
54
  })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
54
55
  var KupPlannerGanttRowType;
55
56
  (function (KupPlannerGanttRowType) {
@@ -8373,6 +8374,545 @@ exports.Zone = Zone;
8373
8374
  //# sourceMappingURL=luxon.js.map
8374
8375
  });
8375
8376
 
8377
+ var hexToCssFilter = kupManager$1.createCommonjsModule(function (module, exports) {
8378
+ (function (global, factory) {
8379
+ factory(exports) ;
8380
+ }(kupManager$1.commonjsGlobal, (function (exports) {
8381
+ /*! *****************************************************************************
8382
+ Copyright (c) Microsoft Corporation.
8383
+
8384
+ Permission to use, copy, modify, and/or distribute this software for any
8385
+ purpose with or without fee is hereby granted.
8386
+
8387
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8388
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8389
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8390
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8391
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
8392
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8393
+ PERFORMANCE OF THIS SOFTWARE.
8394
+ ***************************************************************************** */
8395
+
8396
+ function __read(o, n) {
8397
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
8398
+ if (!m) return o;
8399
+ var i = m.call(o), r, ar = [], e;
8400
+ try {
8401
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8402
+ }
8403
+ catch (error) { e = { error: error }; }
8404
+ finally {
8405
+ try {
8406
+ if (r && !r.done && (m = i["return"])) m.call(i);
8407
+ }
8408
+ finally { if (e) throw e.error; }
8409
+ }
8410
+ return ar;
8411
+ }
8412
+
8413
+ var Color = /** @class */ (function () {
8414
+ function Color(r, g, b) {
8415
+ this.r = 0;
8416
+ this.g = 0;
8417
+ this.b = 0;
8418
+ this.set(r, g, b);
8419
+ }
8420
+ Color.prototype.set = function (r, g, b) {
8421
+ this.r = this.clamp(r);
8422
+ this.g = this.clamp(g);
8423
+ this.b = this.clamp(b);
8424
+ };
8425
+ /**
8426
+ * Applying cals to get CSS filter for hue-rotate
8427
+ *
8428
+ * @param {number} [angle=0]
8429
+ * @memberof Color
8430
+ */
8431
+ Color.prototype.hueRotate = function (angle) {
8432
+ if (angle === void 0) { angle = 0; }
8433
+ angle = (angle / 180) * Math.PI;
8434
+ var sin = Math.sin(angle);
8435
+ var cos = Math.cos(angle);
8436
+ this.multiply([
8437
+ 0.213 + cos * 0.787 - sin * 0.213,
8438
+ 0.715 - cos * 0.715 - sin * 0.715,
8439
+ 0.072 - cos * 0.072 + sin * 0.928,
8440
+ 0.213 - cos * 0.213 + sin * 0.143,
8441
+ 0.715 + cos * 0.285 + sin * 0.14,
8442
+ 0.072 - cos * 0.072 - sin * 0.283,
8443
+ 0.213 - cos * 0.213 - sin * 0.787,
8444
+ 0.715 - cos * 0.715 + sin * 0.715,
8445
+ 0.072 + cos * 0.928 + sin * 0.072,
8446
+ ]);
8447
+ };
8448
+ /**
8449
+ * Applying cals to get CSS filter for grayscale
8450
+ *
8451
+ * @param {number} [value=1]
8452
+ * @memberof Color
8453
+ */
8454
+ Color.prototype.grayscale = function (value) {
8455
+ if (value === void 0) { value = 1; }
8456
+ this.multiply([
8457
+ 0.2126 + 0.7874 * (1 - value),
8458
+ 0.7152 - 0.7152 * (1 - value),
8459
+ 0.0722 - 0.0722 * (1 - value),
8460
+ 0.2126 - 0.2126 * (1 - value),
8461
+ 0.7152 + 0.2848 * (1 - value),
8462
+ 0.0722 - 0.0722 * (1 - value),
8463
+ 0.2126 - 0.2126 * (1 - value),
8464
+ 0.7152 - 0.7152 * (1 - value),
8465
+ 0.0722 + 0.9278 * (1 - value),
8466
+ ]);
8467
+ };
8468
+ /**
8469
+ * Applying cals to get CSS filter for sepia
8470
+ *
8471
+ * @param {number} [value=1]
8472
+ * @memberof Color
8473
+ */
8474
+ Color.prototype.sepia = function (value) {
8475
+ if (value === void 0) { value = 1; }
8476
+ this.multiply([
8477
+ 0.393 + 0.607 * (1 - value),
8478
+ 0.769 - 0.769 * (1 - value),
8479
+ 0.189 - 0.189 * (1 - value),
8480
+ 0.349 - 0.349 * (1 - value),
8481
+ 0.686 + 0.314 * (1 - value),
8482
+ 0.168 - 0.168 * (1 - value),
8483
+ 0.272 - 0.272 * (1 - value),
8484
+ 0.534 - 0.534 * (1 - value),
8485
+ 0.131 + 0.869 * (1 - value),
8486
+ ]);
8487
+ };
8488
+ /**
8489
+ * Applying cals to get CSS filter for saturate
8490
+ *
8491
+ * @param {number} [value=1]
8492
+ * @memberof Color
8493
+ */
8494
+ Color.prototype.saturate = function (value) {
8495
+ if (value === void 0) { value = 1; }
8496
+ this.multiply([
8497
+ 0.213 + 0.787 * value,
8498
+ 0.715 - 0.715 * value,
8499
+ 0.072 - 0.072 * value,
8500
+ 0.213 - 0.213 * value,
8501
+ 0.715 + 0.285 * value,
8502
+ 0.072 - 0.072 * value,
8503
+ 0.213 - 0.213 * value,
8504
+ 0.715 - 0.715 * value,
8505
+ 0.072 + 0.928 * value,
8506
+ ]);
8507
+ };
8508
+ Color.prototype.multiply = function (matrix) {
8509
+ // These values are needed. It's correct because the returned values will change
8510
+ var newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);
8511
+ var newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);
8512
+ var newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);
8513
+ this.r = newR;
8514
+ this.g = newG;
8515
+ this.b = newB;
8516
+ };
8517
+ /**
8518
+ * Applying cals to get CSS filter for brightness
8519
+ *
8520
+ * @param {number} [value=1]
8521
+ * @memberof Color
8522
+ */
8523
+ Color.prototype.brightness = function (value) {
8524
+ if (value === void 0) { value = 1; }
8525
+ this.linear(value);
8526
+ };
8527
+ /**
8528
+ * Applying cals to get CSS filter for contrast
8529
+ *
8530
+ * @param {number} [value=1]
8531
+ * @memberof Color
8532
+ */
8533
+ Color.prototype.contrast = function (value) {
8534
+ if (value === void 0) { value = 1; }
8535
+ this.linear(value, -(0.5 * value) + 0.5);
8536
+ };
8537
+ Color.prototype.linear = function (slope, intercept) {
8538
+ if (slope === void 0) { slope = 1; }
8539
+ if (intercept === void 0) { intercept = 0; }
8540
+ this.r = this.clamp(this.r * slope + intercept * 255);
8541
+ this.g = this.clamp(this.g * slope + intercept * 255);
8542
+ this.b = this.clamp(this.b * slope + intercept * 255);
8543
+ };
8544
+ /**
8545
+ * Applying cals to get CSS filter for invert
8546
+ *
8547
+ * @param {number} [value=1]
8548
+ * @memberof Color
8549
+ */
8550
+ Color.prototype.invert = function (value) {
8551
+ if (value === void 0) { value = 1; }
8552
+ this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);
8553
+ this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);
8554
+ this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);
8555
+ };
8556
+ /**
8557
+ * transform RGB into HSL values
8558
+ *
8559
+ * @returns {HSLData}
8560
+ * @memberof Color
8561
+ */
8562
+ Color.prototype.hsl = function () {
8563
+ var red = this.r / 255;
8564
+ var green = this.g / 255;
8565
+ var blue = this.b / 255;
8566
+ // find greatest and smallest channel values
8567
+ var max = Math.max(red, green, blue);
8568
+ var min = Math.min(red, green, blue);
8569
+ var hue = 0;
8570
+ var saturation = 0;
8571
+ var lightness = (max + min) / 2;
8572
+ // If min and max have the same values, it means
8573
+ // the given color is achromatic
8574
+ if (max === min) {
8575
+ return {
8576
+ h: 0,
8577
+ s: 0,
8578
+ l: lightness * 100,
8579
+ };
8580
+ }
8581
+ // Adding delta value of greatest and smallest channel values
8582
+ var delta = max - min;
8583
+ saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
8584
+ if (max === red) {
8585
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
8586
+ }
8587
+ else if (max === green) {
8588
+ hue = (blue - red) / delta + 2;
8589
+ }
8590
+ else if (max === blue) {
8591
+ hue = (red - green) / delta + 4;
8592
+ }
8593
+ hue /= 6;
8594
+ return {
8595
+ h: hue * 100,
8596
+ s: saturation * 100,
8597
+ l: lightness * 100,
8598
+ };
8599
+ };
8600
+ /**
8601
+ * Normalize the value to follow the min and max for RGB colors
8602
+ * min: 0
8603
+ * max: 255
8604
+ *
8605
+ * @private
8606
+ * @param {number} value
8607
+ * @returns {number}
8608
+ * @memberof Color
8609
+ */
8610
+ Color.prototype.clamp = function (value) {
8611
+ // Minimum RGB Value = 0;
8612
+ // Maximum RGB Value = 255;
8613
+ return Math.min(Math.max(value, 0), 255);
8614
+ };
8615
+ return Color;
8616
+ }());
8617
+
8618
+ var Solver = /** @class */ (function () {
8619
+ function Solver(target, options) {
8620
+ this.target = target;
8621
+ this.targetHSL = target.hsl();
8622
+ this.options = Object.assign({},
8623
+ // Adding default values for options
8624
+ {
8625
+ acceptanceLossPercentage: 5,
8626
+ maxChecks: 15,
8627
+ }, options);
8628
+ // All the calcs done by the library to generate
8629
+ // a CSS Filter are based on the color `#000`
8630
+ // in this case, `rgb(0, 0, 0)`
8631
+ // Please make sure the background of the element
8632
+ // is `#000` for better performance
8633
+ // and color similarity.
8634
+ this.reusedColor = new Color(0, 0, 0);
8635
+ }
8636
+ /**
8637
+ * Returns the solved values for the
8638
+ *
8639
+ * @returns {(SPSAPayload & { filter: string; })}
8640
+ * @memberof Solver
8641
+ */
8642
+ Solver.prototype.solve = function () {
8643
+ var result = this.solveNarrow(this.solveWide());
8644
+ return {
8645
+ values: result.values,
8646
+ called: result.called,
8647
+ loss: result.loss,
8648
+ filter: this.css(result.values),
8649
+ };
8650
+ };
8651
+ /**
8652
+ * Solve wide values based on the wide values for RGB and HSL values
8653
+ *
8654
+ * @private
8655
+ * @returns {SPSAPayload}
8656
+ * @memberof Solver
8657
+ */
8658
+ Solver.prototype.solveWide = function () {
8659
+ var A = 5;
8660
+ var c = 15;
8661
+ // Wide values for RGB and HSL values
8662
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8663
+ var a = [60, 180, 18000, 600, 1.2, 1.2];
8664
+ var best = { loss: Infinity };
8665
+ var counter = 0;
8666
+ while (best.loss > this.options.acceptanceLossPercentage) {
8667
+ var initialFilterValues = [50, 20, 3750, 50, 100, 100];
8668
+ var result = this.spsa({
8669
+ A: A,
8670
+ a: a,
8671
+ c: c,
8672
+ values: initialFilterValues,
8673
+ // for wide values we should use the double of tries in
8674
+ // comparison of `solveNarrow()` method
8675
+ maxTriesInLoop: 1000,
8676
+ });
8677
+ if (result.loss < best.loss) {
8678
+ best = result;
8679
+ }
8680
+ counter += 1;
8681
+ if (counter >= this.options.maxChecks) {
8682
+ break;
8683
+ }
8684
+ }
8685
+ return Object.assign({}, best, { called: counter });
8686
+ };
8687
+ /**
8688
+ * Solve narrow values based on the wide values for the filter
8689
+ *
8690
+ * @private
8691
+ * @param {SPSAPayload} wide
8692
+ * @returns {SPSAPayload}
8693
+ * @memberof Solver
8694
+ */
8695
+ Solver.prototype.solveNarrow = function (wide) {
8696
+ var A = wide.loss;
8697
+ var c = 2;
8698
+ var A1 = A + 1;
8699
+ // Narrow values for RGB and HSL values
8700
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8701
+ var a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];
8702
+ return this.spsa({
8703
+ A: A,
8704
+ a: a,
8705
+ c: c,
8706
+ values: wide.values,
8707
+ maxTriesInLoop: 500,
8708
+ called: wide.called,
8709
+ });
8710
+ };
8711
+ /**
8712
+ * Returns final value based on the current filter order
8713
+ * to get the order, please check the returned value
8714
+ * in `css()` method
8715
+ *
8716
+ * @private
8717
+ * @param {number} value
8718
+ * @param {number} idx
8719
+ * @returns {number}
8720
+ * @memberof Solver
8721
+ */
8722
+ Solver.prototype.fixValueByFilterIDX = function (value, idx) {
8723
+ var max = 100;
8724
+ // Fixing max, minimum and value by filter
8725
+ if (idx === 2 /* saturate */) {
8726
+ max = 7500;
8727
+ }
8728
+ else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {
8729
+ max = 200;
8730
+ }
8731
+ if (idx === 3 /* hue-rotate */) {
8732
+ if (value > max) {
8733
+ value %= max;
8734
+ }
8735
+ else if (value < 0) {
8736
+ value = max + (value % max);
8737
+ }
8738
+ }
8739
+ // Checking if value is below the minimum or above
8740
+ // the maximum allowed by filter
8741
+ else if (value < 0) {
8742
+ value = 0;
8743
+ }
8744
+ else if (value > max) {
8745
+ value = max;
8746
+ }
8747
+ return value;
8748
+ };
8749
+ Solver.prototype.spsa = function (_a) {
8750
+ 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;
8751
+ var alpha = 1;
8752
+ var gamma = 0.16666666666666666;
8753
+ var best = null;
8754
+ var bestLoss = Infinity;
8755
+ var deltas = new Array(6);
8756
+ var highArgs = new Array(6);
8757
+ var lowArgs = new Array(6);
8758
+ // Size of all CSS filters to be applied to get the correct color
8759
+ var filtersToBeAppliedSize = 6;
8760
+ for (var key = 0; key < maxTriesInLoop; key++) {
8761
+ var ck = c / Math.pow(key + 1, gamma);
8762
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8763
+ deltas[i] = Math.random() > 0.5 ? 1 : -1;
8764
+ highArgs[i] = values[i] + ck * deltas[i];
8765
+ lowArgs[i] = values[i] - ck * deltas[i];
8766
+ }
8767
+ var lossDiff = this.loss(highArgs) - this.loss(lowArgs);
8768
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8769
+ var g = (lossDiff / (2 * ck)) * deltas[i];
8770
+ var ak = a[i] / Math.pow(A + key + 1, alpha);
8771
+ values[i] = this.fixValueByFilterIDX(values[i] - ak * g, i);
8772
+ }
8773
+ var loss = this.loss(values);
8774
+ if (loss < bestLoss) {
8775
+ best = values.slice(0);
8776
+ bestLoss = loss;
8777
+ }
8778
+ }
8779
+ return { values: best, loss: bestLoss, called: called };
8780
+ };
8781
+ /**
8782
+ * Checks how much is the loss for the filter in RGB and HSL colors
8783
+ *
8784
+ * @private
8785
+ * @param {SPSAPayload['values']} filters
8786
+ * @returns {number}
8787
+ * @memberof Solver
8788
+ */
8789
+ Solver.prototype.loss = function (filters) {
8790
+ // Argument as an Array of percentages.
8791
+ var color = this.reusedColor;
8792
+ // Resetting the color to black in case
8793
+ // it was called more than once
8794
+ color.set(0, 0, 0);
8795
+ color.invert(filters[0] / 100);
8796
+ color.sepia(filters[1] / 100);
8797
+ color.saturate(filters[2] / 100);
8798
+ color.hueRotate(filters[3] * 3.6);
8799
+ color.brightness(filters[4] / 100);
8800
+ color.contrast(filters[5] / 100);
8801
+ var colorHSL = color.hsl();
8802
+ return (Math.abs(color.r - this.target.r) +
8803
+ Math.abs(color.g - this.target.g) +
8804
+ Math.abs(color.b - this.target.b) +
8805
+ Math.abs(colorHSL.h - this.targetHSL.h) +
8806
+ Math.abs(colorHSL.s - this.targetHSL.s) +
8807
+ Math.abs(colorHSL.l - this.targetHSL.l));
8808
+ };
8809
+ /**
8810
+ * Returns the CSS filter list for the received HEX color
8811
+ *
8812
+ * @private
8813
+ * @param {number[]} filters
8814
+ * @returns {string}
8815
+ * @memberof Solver
8816
+ */
8817
+ Solver.prototype.css = function (filters) {
8818
+ var formatCssFilterValueByMultiplier = function (idx, multiplier) {
8819
+ if (multiplier === void 0) { multiplier = 1; }
8820
+ return Math.round(filters[idx] * multiplier);
8821
+ };
8822
+ return [
8823
+ "invert(" + formatCssFilterValueByMultiplier(0) + "%)",
8824
+ "sepia(" + formatCssFilterValueByMultiplier(1) + "%)",
8825
+ "saturate(" + formatCssFilterValueByMultiplier(2) + "%)",
8826
+ "hue-rotate(" + formatCssFilterValueByMultiplier(3, 3.6) + "deg)",
8827
+ "brightness(" + formatCssFilterValueByMultiplier(4) + "%)",
8828
+ "contrast(" + formatCssFilterValueByMultiplier(5) + "%);",
8829
+ ].join(' ');
8830
+ };
8831
+ return Solver;
8832
+ }());
8833
+
8834
+ /**
8835
+ * Transform a CSS Color from Hexadecimal to RGB color
8836
+ *
8837
+ * @param {string} hex hexadecimal color
8838
+ * @returns {([number, number, number] | [])} array with the RGB colors or empty array
8839
+ */
8840
+ var hexToRgb = function (hex) {
8841
+ if (hex.length === 4) {
8842
+ return [parseInt("0x" + hex[1] + hex[1]), parseInt("0x" + hex[2] + hex[2]), parseInt("0x" + hex[3] + hex[3])];
8843
+ }
8844
+ if (hex.length === 7) {
8845
+ return [parseInt("0x" + hex[1] + hex[2]), parseInt("0x" + hex[3] + hex[4]), parseInt("0x" + hex[5] + hex[6])];
8846
+ }
8847
+ return [];
8848
+ };
8849
+ var isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); };
8850
+ // Memory cache for the computed results to avoid multiple
8851
+ // calculations for the same color
8852
+ var results = {};
8853
+ /**
8854
+ * A function that transforms a HEX color into CSS filters
8855
+ *
8856
+ * @param colorValue string hexadecimal color
8857
+ * @param opts HexToCssConfiguration function configuration
8858
+ *
8859
+ */
8860
+ var hexToCSSFilter = function (colorValue, opts) {
8861
+ var _a;
8862
+ if (opts === void 0) { opts = {}; }
8863
+ var red;
8864
+ var green;
8865
+ var blue;
8866
+ if (results[colorValue] && !opts.forceFilterRecalculation) {
8867
+ return Object.assign({}, results[colorValue], { cache: true });
8868
+ }
8869
+ var color;
8870
+ try {
8871
+ _a = __read(hexToRgb(colorValue), 3), red = _a[0], green = _a[1], blue = _a[2];
8872
+ if (!isNumeric(red) || !isNumeric(green) || !isNumeric(blue)) {
8873
+ throw new Error("hextToRgb returned an invalid value for '" + colorValue + "'");
8874
+ }
8875
+ color = new Color(Number(red), Number(green), Number(blue));
8876
+ }
8877
+ catch (error) {
8878
+ throw new Error("Color value should be in HEX format. " + error);
8879
+ }
8880
+ var solver = new Solver(color, Object.assign({},
8881
+ // `HexToCssConfiguration` Defaults
8882
+ {
8883
+ acceptanceLossPercentage: 5,
8884
+ maxChecks: 30,
8885
+ forceFilterRecalculation: false,
8886
+ }, opts));
8887
+ return (results[colorValue] = Object.assign({}, solver.solve(), {
8888
+ hex: colorValue,
8889
+ rgb: [red, green, blue],
8890
+ cache: false,
8891
+ }));
8892
+ };
8893
+ /**
8894
+ * A function that clears cached results
8895
+ *
8896
+ * @param {string} key? HEX string value passed previously `#24639C`. If not passed, it clears all cached results
8897
+ * @returns void
8898
+ */
8899
+ var clearCache = function (key) {
8900
+ if (!key) {
8901
+ results = {};
8902
+ }
8903
+ else if (results[key]) {
8904
+ delete results[key];
8905
+ }
8906
+ };
8907
+
8908
+ exports.clearCache = clearCache;
8909
+ exports.hexToCSSFilter = hexToCSSFilter;
8910
+
8911
+ Object.defineProperty(exports, '__esModule', { value: true });
8912
+
8913
+ })));
8914
+ });
8915
+
8376
8916
  function _extends() {
8377
8917
  _extends = Object.assign ? Object.assign.bind() : function (target) {
8378
8918
  for (var i = 1; i < arguments.length; i++) {
@@ -8479,6 +9019,14 @@ var toViewMode = function toViewMode(timeUnit) {
8479
9019
  return ViewMode.Year;
8480
9020
  }
8481
9021
  };
9022
+ var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
9023
+ switch (timeUnit) {
9024
+ case TimeUnit.YEAR:
9025
+ return 60 * 2;
9026
+ default:
9027
+ return 60;
9028
+ }
9029
+ };
8482
9030
  var convertPhaseToTask = function convertPhaseToTask(item) {
8483
9031
  var mapPhase = function mapPhase(_ref) {
8484
9032
  var phaseStart = _ref.startDate,
@@ -8489,7 +9037,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8489
9037
  phaseId = _ref.id,
8490
9038
  color = _ref.color,
8491
9039
  selectedColor = _ref.selectedColor,
8492
- dependencies = _ref.dependencies;
9040
+ dependencies = _ref.dependencies,
9041
+ icon = _ref.icon;
8493
9042
  var _validDates = validDates(phaseStart, phaseEnd),
8494
9043
  start = _validDates.start,
8495
9044
  end = _validDates.end;
@@ -8512,7 +9061,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8512
9061
  progressColor: color,
8513
9062
  backgroundSelectedColor: selectedColor,
8514
9063
  progressSelectedColor: selectedColor
8515
- } : {}
9064
+ } : {},
9065
+ icon: icon
8516
9066
  };
8517
9067
  };
8518
9068
  return mapPhase(item);
@@ -8543,7 +9093,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8543
9093
  var startDate = x.startDate,
8544
9094
  endDate = x.endDate,
8545
9095
  color = x.color,
8546
- selectedColor = x.selectedColor;
9096
+ selectedColor = x.selectedColor,
9097
+ icon = x.icon;
8547
9098
  var _validDates3 = validDates(startDate, endDate),
8548
9099
  start = _validDates3.start,
8549
9100
  end = _validDates3.end;
@@ -8551,7 +9102,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8551
9102
  start: start,
8552
9103
  end: end,
8553
9104
  backgroundColor: color != null ? color : "0xffffff",
8554
- backgroundSelectedColor: selectedColor != null ? selectedColor : color
9105
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color,
9106
+ icon: icon
8555
9107
  };
8556
9108
  };
8557
9109
  var defaultColor = "#595959";
@@ -8596,7 +9148,8 @@ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartD
8596
9148
  secondaryEnd: end2,
8597
9149
  progress: 100,
8598
9150
  isDisabled: false,
8599
- hideChildren: false
9151
+ hideChildren: false,
9152
+ icon: row.icon
8600
9153
  };
8601
9154
  var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
8602
9155
  return [mainTask].concat(children1);
@@ -9773,7 +10326,7 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9773
10326
  var _task$timeline;
9774
10327
  var y = taskYCoordinate(index, rowHeight, taskHeight);
9775
10328
  function convertFrameToTask(frame, j) {
9776
- var _frame$backgroundSele;
10329
+ var _frame$backgroundSele, _frame$icon;
9777
10330
  var _computeTypeAndXs2 = computeTypeAndXs(frame.start, frame.end, "task", dates, columnWidth, handleWidth, false),
9778
10331
  x1 = _computeTypeAndXs2.x1,
9779
10332
  x2 = _computeTypeAndXs2.x2;
@@ -9805,7 +10358,8 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9805
10358
  typeInternal: "timeline",
9806
10359
  x1: x1,
9807
10360
  x2: x2,
9808
- y: y
10361
+ y: y,
10362
+ icon: (_frame$icon = frame.icon) != null ? _frame$icon : undefined
9809
10363
  };
9810
10364
  }
9811
10365
  var _computeTypeAndXs3 = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, false),
@@ -10164,6 +10718,25 @@ var BarProgressHandle = function BarProgressHandle(_ref) {
10164
10718
  });
10165
10719
  };
10166
10720
 
10721
+ var TaskIcon = function TaskIcon(_ref) {
10722
+ var _ref$color = _ref.color,
10723
+ color = _ref$color === void 0 ? "#000000" : _ref$color,
10724
+ url = _ref.url,
10725
+ height = _ref.height,
10726
+ width = _ref.width,
10727
+ x = _ref.x,
10728
+ y = _ref.y;
10729
+ var cssFilter = hexToCssFilter.hexToCSSFilter(color);
10730
+ return react.createElement("image", {
10731
+ href: url,
10732
+ filter: cssFilter.filter.replace(";", ""),
10733
+ x: x,
10734
+ y: y,
10735
+ width: width,
10736
+ height: height
10737
+ });
10738
+ };
10739
+
10167
10740
  var Bar = function Bar(_ref) {
10168
10741
  var _task$x2secondary, _task$x1secondary;
10169
10742
  var task = _ref.task,
@@ -10221,7 +10794,14 @@ var Bar = function Bar(_ref) {
10221
10794
  onMouseDown: function onMouseDown(e) {
10222
10795
  onEventStart("progress", task, e);
10223
10796
  }
10224
- })));
10797
+ })), task.icon && task.icon.url && react.createElement(TaskIcon, {
10798
+ color: task.icon.color,
10799
+ url: task.icon.url,
10800
+ width: task.height / 2 + "px",
10801
+ height: task.height / 2 + "px",
10802
+ x: task.x1 + (task.x2 - task.x1) - task.height / 2 / 2,
10803
+ y: task.y - task.height / 2 / 2 / 2 + (showSecondaryDates ? task.height / 2 : 0)
10804
+ }));
10225
10805
  };
10226
10806
 
10227
10807
  var BarSmall = function BarSmall(_ref) {
@@ -10282,7 +10862,9 @@ var Timeline = function Timeline(_ref) {
10282
10862
  rx: 0,
10283
10863
  ry: 0
10284
10864
  }), task.barChildren.map(function (bar) {
10285
- return react.createElement("rect", {
10865
+ return react.createElement(react.Fragment, {
10866
+ key: bar.id + ".rf"
10867
+ }, react.createElement("rect", {
10286
10868
  style: {
10287
10869
  cursor: "pointer"
10288
10870
  },
@@ -10294,7 +10876,14 @@ var Timeline = function Timeline(_ref) {
10294
10876
  height: bar.height,
10295
10877
  rx: bar.barCornerRadius,
10296
10878
  ry: bar.barCornerRadius
10297
- });
10879
+ }), bar.icon && bar.icon.url && react.createElement(TaskIcon, {
10880
+ color: bar.icon.color,
10881
+ url: bar.icon.url,
10882
+ width: bar.height + "px",
10883
+ height: bar.height + "px",
10884
+ x: bar.x1 + (bar.x2 - bar.x1) - bar.height / 2,
10885
+ y: bar.y - bar.height / 2 / 2
10886
+ }));
10298
10887
  }));
10299
10888
  };
10300
10889
 
@@ -10331,7 +10920,7 @@ var TaskItem = function TaskItem(props) {
10331
10920
  setTaskItem(react.createElement(Bar, Object.assign({}, props)));
10332
10921
  break;
10333
10922
  }
10334
- }, [task, isSelected]);
10923
+ }, [task, isSelected, props]);
10335
10924
  react.useEffect(function () {
10336
10925
  if (textRef.current) {
10337
10926
  setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
@@ -10372,6 +10961,9 @@ var TaskItem = function TaskItem(props) {
10372
10961
  onClick: function onClick(e) {
10373
10962
  onEventStart("click", task, e);
10374
10963
  },
10964
+ onContextMenu: function onContextMenu(e) {
10965
+ onEventStart("contextmenu", task, e);
10966
+ },
10375
10967
  onFocus: function onFocus() {
10376
10968
  onEventStart("select", task);
10377
10969
  }
@@ -10412,6 +11004,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10412
11004
  onProgressChange = _ref.onProgressChange,
10413
11005
  onDoubleClick = _ref.onDoubleClick,
10414
11006
  onClick = _ref.onClick,
11007
+ onContextMenu = _ref.onContextMenu,
10415
11008
  onDelete = _ref.onDelete;
10416
11009
  var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
10417
11010
  var _useState = react.useState(0),
@@ -10573,6 +11166,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10573
11166
  } else if (action === "click") {
10574
11167
  var skipClick = !hasMovedHorizontally(event);
10575
11168
  skipClick && !!onClick && onClick(task);
11169
+ } else if (action === "contextmenu") {
11170
+ event.preventDefault();
11171
+ !!onContextMenu && onContextMenu(event, task);
10576
11172
  } else if (action === "move") {
10577
11173
  var _svg$current$getScree3;
10578
11174
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
@@ -10824,6 +11420,7 @@ var Gantt = function Gantt(_ref) {
10824
11420
  onProgressChange = _ref.onProgressChange,
10825
11421
  onDoubleClick = _ref.onDoubleClick,
10826
11422
  onClick = _ref.onClick,
11423
+ onContextMenu = _ref.onContextMenu,
10827
11424
  onDelete = _ref.onDelete,
10828
11425
  onSelect = _ref.onSelect,
10829
11426
  onExpanderClick = _ref.onExpanderClick;
@@ -10841,26 +11438,26 @@ var Gantt = function Gantt(_ref) {
10841
11438
  }),
10842
11439
  dateSetup = _useState[0],
10843
11440
  setDateSetup = _useState[1];
10844
- var _useState2 = react.useState(undefined),
10845
- currentViewDate = _useState2[0],
10846
- setCurrentViewDate = _useState2[1];
10847
- var _useState3 = react.useState(0),
10848
- taskListWidth = _useState3[0],
10849
- setTaskListWidth = _useState3[1];
10850
- var _useState4 = react.useState(0),
10851
- svgContainerWidth = _useState4[0],
10852
- setSvgContainerWidth = _useState4[1];
10853
- var _useState5 = react.useState(ganttHeight),
10854
- svgContainerHeight = _useState5[0],
10855
- setSvgContainerHeight = _useState5[1];
10856
- var _useState6 = react.useState([]),
10857
- barTasks = _useState6[0],
10858
- setBarTasks = _useState6[1];
10859
- var _useState7 = react.useState({
11441
+ var taskListWidth = react.useRef(0);
11442
+ var setTaskListWidth = function setTaskListWidth(width) {
11443
+ taskListWidth.current = width;
11444
+ };
11445
+ var svgContainerWidth = react.useRef(0);
11446
+ var setSvgContainerWidth = function setSvgContainerWidth(width) {
11447
+ svgContainerWidth.current = width;
11448
+ };
11449
+ var svgContainerHeight = react.useRef(ganttHeight);
11450
+ var setSvgContainerHeight = function setSvgContainerHeight(height) {
11451
+ svgContainerHeight.current = height;
11452
+ };
11453
+ var _useState2 = react.useState([]),
11454
+ barTasks = _useState2[0],
11455
+ setBarTasks = _useState2[1];
11456
+ var _useState3 = react.useState({
10860
11457
  action: ""
10861
11458
  }),
10862
- ganttEvent = _useState7[0],
10863
- setGanttEvent = _useState7[1];
11459
+ ganttEvent = _useState3[0],
11460
+ setGanttEvent = _useState3[1];
10864
11461
  var taskHeight = react.useMemo(function () {
10865
11462
  return rowHeight * barFill / 100;
10866
11463
  }, [rowHeight, barFill]);
@@ -10870,29 +11467,30 @@ var Gantt = function Gantt(_ref) {
10870
11467
  var timelineHeight = react.useMemo(function () {
10871
11468
  return rowHeight * timelineFill / 100;
10872
11469
  }, [rowHeight, timelineFill]);
10873
- var _useState8 = react.useState(),
10874
- selectedTask = _useState8[0],
10875
- setSelectedTask = _useState8[1];
10876
- var _useState9 = react.useState(null),
10877
- failedTask = _useState9[0],
10878
- setFailedTask = _useState9[1];
11470
+ var _useState4 = react.useState(),
11471
+ selectedTask = _useState4[0],
11472
+ setSelectedTask = _useState4[1];
11473
+ var _useState5 = react.useState(null),
11474
+ failedTask = _useState5[0],
11475
+ setFailedTask = _useState5[1];
10879
11476
  var svgWidth = dateSetup.dates.length * columnWidth;
10880
11477
  var ganttFullHeight = barTasks.length * rowHeight;
10881
- var _useState10 = react.useState(0),
10882
- scrollY = _useState10[0],
10883
- setScrollY = _useState10[1];
10884
- var _useState11 = react.useState(-1),
10885
- scrollX = _useState11[0],
10886
- setScrollX = _useState11[1];
10887
- var _useState12 = react.useState(false),
10888
- ignoreScrollEvent = _useState12[0],
10889
- setIgnoreScrollEvent = _useState12[1];
10890
- var _useState13 = react.useState(),
10891
- currentDateIndicatorContent = _useState13[0],
10892
- setCurrentDateIndicatorContent = _useState13[1];
10893
- var _useState14 = react.useState(),
10894
- projectionContent = _useState14[0],
10895
- setProjectionContent = _useState14[1];
11478
+ var _useState6 = react.useState(0),
11479
+ scrollY = _useState6[0],
11480
+ setScrollY = _useState6[1];
11481
+ var _useState7 = react.useState(-1),
11482
+ scrollX = _useState7[0],
11483
+ setScrollX = _useState7[1];
11484
+ var ignoreScrollEvent = react.useRef(false);
11485
+ var setIgnoreScrollEvent = function setIgnoreScrollEvent(value) {
11486
+ ignoreScrollEvent.current = value;
11487
+ };
11488
+ var _useState8 = react.useState(),
11489
+ currentDateIndicatorContent = _useState8[0],
11490
+ setCurrentDateIndicatorContent = _useState8[1];
11491
+ var _useState9 = react.useState(),
11492
+ projectionContent = _useState9[0],
11493
+ setProjectionContent = _useState9[1];
10896
11494
  react.useEffect(function () {
10897
11495
  window.addEventListener("gantt-sync-scroll-event", function (e) {
10898
11496
  if (e.detail.id !== id) {
@@ -10918,14 +11516,30 @@ var Gantt = function Gantt(_ref) {
10918
11516
  setScrollX(newDates.length * columnWidth);
10919
11517
  }
10920
11518
  }
10921
- setDateSetup({
10922
- dates: newDates,
10923
- viewMode: viewMode
10924
- });
11519
+ var set = false;
11520
+ if (dateSetup && dateSetup.dates) {
11521
+ var old = dateSetup.dates;
11522
+ if (old.length !== newDates.length) {
11523
+ set = true;
11524
+ } else {
11525
+ for (var i = 0; i < old.length; i++) {
11526
+ if (old[i].valueOf() !== newDates[i].valueOf()) {
11527
+ set = true;
11528
+ break;
11529
+ }
11530
+ }
11531
+ }
11532
+ }
11533
+ if (set) {
11534
+ setDateSetup({
11535
+ dates: newDates,
11536
+ viewMode: viewMode
11537
+ });
11538
+ }
10925
11539
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
10926
11540
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
10927
11541
  react.useEffect(function () {
10928
- if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
11542
+ if (viewMode === dateSetup.viewMode && viewDate) {
10929
11543
  var dates = dateSetup.dates;
10930
11544
  var index = dates.findIndex(function (d, i) {
10931
11545
  return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
@@ -10933,10 +11547,10 @@ var Gantt = function Gantt(_ref) {
10933
11547
  if (index === -1) {
10934
11548
  return;
10935
11549
  }
10936
- setCurrentViewDate(viewDate);
11550
+ setIgnoreScrollEvent(true);
10937
11551
  setScrollX(columnWidth * index);
10938
11552
  }
10939
- }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, currentViewDate, setCurrentViewDate]);
11553
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode]);
10940
11554
  react.useEffect(function () {
10941
11555
  var changedTask = ganttEvent.changedTask,
10942
11556
  action = ganttEvent.action;
@@ -10979,9 +11593,9 @@ var Gantt = function Gantt(_ref) {
10979
11593
  }, [taskListRef, listCellWidth]);
10980
11594
  react.useEffect(function () {
10981
11595
  if (wrapperRef.current) {
10982
- setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);
11596
+ setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth.current);
10983
11597
  }
10984
- }, [wrapperRef, taskListWidth]);
11598
+ }, [wrapperRef]);
10985
11599
  react.useEffect(function () {
10986
11600
  if (ganttHeight) {
10987
11601
  setSvgContainerHeight(ganttHeight + headerHeight);
@@ -11024,7 +11638,7 @@ var Gantt = function Gantt(_ref) {
11024
11638
  };
11025
11639
  }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
11026
11640
  var handleScrollY = function handleScrollY(event) {
11027
- if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
11641
+ if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent.current) {
11028
11642
  setScrollY(event.currentTarget.scrollTop);
11029
11643
  setIgnoreScrollEvent(true);
11030
11644
  } else {
@@ -11032,7 +11646,7 @@ var Gantt = function Gantt(_ref) {
11032
11646
  }
11033
11647
  };
11034
11648
  var handleScrollX = function handleScrollX(event) {
11035
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
11649
+ if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent.current) {
11036
11650
  setScrollX(event.currentTarget.scrollLeft);
11037
11651
  setIgnoreScrollEvent(true);
11038
11652
  window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
@@ -11192,6 +11806,7 @@ var Gantt = function Gantt(_ref) {
11192
11806
  onProgressChange: onProgressChange,
11193
11807
  onDoubleClick: onDoubleClick,
11194
11808
  onClick: onClick,
11809
+ onContextMenu: onContextMenu,
11195
11810
  onDelete: onDelete
11196
11811
  };
11197
11812
  var tableProps = {
@@ -11229,15 +11844,15 @@ var Gantt = function Gantt(_ref) {
11229
11844
  }), ganttEvent.changedTask && react.createElement(Tooltip, {
11230
11845
  arrowIndent: arrowIndent,
11231
11846
  rowHeight: rowHeight,
11232
- svgContainerHeight: svgContainerHeight,
11233
- svgContainerWidth: svgContainerWidth,
11847
+ svgContainerHeight: svgContainerHeight.current,
11848
+ svgContainerWidth: svgContainerWidth.current,
11234
11849
  fontFamily: fontFamily,
11235
11850
  fontSize: fontSize,
11236
11851
  scrollX: scrollX,
11237
11852
  scrollY: scrollY,
11238
11853
  task: ganttEvent.changedTask,
11239
11854
  headerHeight: headerHeight,
11240
- taskListWidth: taskListWidth,
11855
+ taskListWidth: taskListWidth.current,
11241
11856
  TooltipContent: TooltipContent,
11242
11857
  rtl: rtl,
11243
11858
  svgWidth: svgWidth
@@ -11251,7 +11866,7 @@ var Gantt = function Gantt(_ref) {
11251
11866
  })), react.createElement(HorizontalScroll, {
11252
11867
  svgWidth: svgWidth,
11253
11868
  taskGanttRef: taskGanttRef,
11254
- taskListWidth: taskListWidth,
11869
+ taskListWidth: taskListWidth.current,
11255
11870
  scroll: scrollX,
11256
11871
  rtl: rtl,
11257
11872
  onScroll: handleScrollX
@@ -11272,6 +11887,7 @@ var format = function format(date, locale, options) {
11272
11887
  } catch (e) {
11273
11888
  console.error("time-formatters.ts format", date, locale, options);
11274
11889
  console.error(e);
11890
+ return "FORMAT-ERR";
11275
11891
  }
11276
11892
  };
11277
11893
  var dayFormatter = function dayFormatter(date, locale) {
@@ -11344,7 +11960,8 @@ var ProjectRow = function ProjectRow(_ref) {
11344
11960
  fontFamily = _ref.fontFamily,
11345
11961
  fontSize = _ref.fontSize,
11346
11962
  setSelectedTask = _ref.setSelectedTask,
11347
- onclickTaskList = _ref.onclickTaskList;
11963
+ onclickTaskList = _ref.onclickTaskList,
11964
+ oncontextmenuTaskList = _ref.oncontextmenuTaskList;
11348
11965
  var str = "";
11349
11966
  for (var i = 0; i < valuesToShow.length; i++) {
11350
11967
  str += "1fr ";
@@ -11363,6 +11980,11 @@ var ProjectRow = function ProjectRow(_ref) {
11363
11980
  onClick: function onClick() {
11364
11981
  setSelectedTask(id);
11365
11982
  onclickTaskList(id);
11983
+ },
11984
+ onContextMenu: function onContextMenu(e) {
11985
+ e.preventDefault();
11986
+ setSelectedTask(id);
11987
+ oncontextmenuTaskList(e, id);
11366
11988
  }
11367
11989
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11368
11990
  return react.createElement("span", {
@@ -11384,7 +12006,8 @@ var SubRow = function SubRow(_ref2) {
11384
12006
  fontFamily = _ref2.fontFamily,
11385
12007
  fontSize = _ref2.fontSize,
11386
12008
  setSelectedTask = _ref2.setSelectedTask,
11387
- onclickTaskList = _ref2.onclickTaskList;
12009
+ onclickTaskList = _ref2.onclickTaskList,
12010
+ oncontextmenuTaskList = _ref2.oncontextmenuTaskList;
11388
12011
  var str = "";
11389
12012
  for (var i = 0; i < valuesToShow.length + 1; i++) {
11390
12013
  str += "1fr ";
@@ -11403,6 +12026,11 @@ var SubRow = function SubRow(_ref2) {
11403
12026
  onClick: function onClick() {
11404
12027
  setSelectedTask(id);
11405
12028
  onclickTaskList(id);
12029
+ },
12030
+ onContextMenu: function onContextMenu(e) {
12031
+ e.preventDefault();
12032
+ setSelectedTask(id);
12033
+ oncontextmenuTaskList(e, id);
11406
12034
  }
11407
12035
  }, react.createElement("span", {
11408
12036
  key: "phase_" + id + "_valuesToShow_color",
@@ -11426,7 +12054,9 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11426
12054
  rowHeight = _ref3.rowHeight,
11427
12055
  rowWidth = _ref3.rowWidth,
11428
12056
  fontFamily = _ref3.fontFamily,
11429
- fontSize = _ref3.fontSize;
12057
+ fontSize = _ref3.fontSize,
12058
+ setSelectedTask = _ref3.setSelectedTask,
12059
+ oncontextmenuTaskList = _ref3.oncontextmenuTaskList;
11430
12060
  var str = "";
11431
12061
  for (var i = 0; i < valuesToShow.length; i++) {
11432
12062
  str += "1fr ";
@@ -11441,7 +12071,12 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11441
12071
  return react.createElement("div", {
11442
12072
  key: "detail_" + id,
11443
12073
  className: styles$9.timeline,
11444
- style: customStyle
12074
+ style: customStyle,
12075
+ onContextMenu: function onContextMenu(e) {
12076
+ e.preventDefault();
12077
+ setSelectedTask(id);
12078
+ oncontextmenuTaskList(e, id);
12079
+ }
11445
12080
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11446
12081
  return react.createElement("span", {
11447
12082
  className: index === 0 ? styles$9.main : undefined,
@@ -11450,7 +12085,7 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11450
12085
  }, v);
11451
12086
  }));
11452
12087
  };
11453
- var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
12088
+ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, oncontextmenuTaskList, id) {
11454
12089
  var CustomTaskListTable = function CustomTaskListTable(_ref4) {
11455
12090
  var rowHeight = _ref4.rowHeight,
11456
12091
  rowWidth = _ref4.rowWidth,
@@ -11472,7 +12107,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11472
12107
  fontFamily: fontFamily,
11473
12108
  fontSize: fontSize,
11474
12109
  setSelectedTask: setSelectedTask,
11475
- onclickTaskList: onclickTaskList
12110
+ onclickTaskList: onclickTaskList,
12111
+ oncontextmenuTaskList: oncontextmenuTaskList
11476
12112
  }), task.type === "task" && react.createElement(SubRow, {
11477
12113
  key: task.id + "_" + task.type,
11478
12114
  task: task,
@@ -11481,7 +12117,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11481
12117
  fontFamily: fontFamily,
11482
12118
  fontSize: fontSize,
11483
12119
  setSelectedTask: setSelectedTask,
11484
- onclickTaskList: onclickTaskList
12120
+ onclickTaskList: onclickTaskList,
12121
+ oncontextmenuTaskList: oncontextmenuTaskList
11485
12122
  }), task.type === "timeline" && react.createElement(TimelineSubRow, {
11486
12123
  key: task.id + "_" + task.type,
11487
12124
  task: task,
@@ -11490,7 +12127,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11490
12127
  fontFamily: fontFamily,
11491
12128
  fontSize: fontSize,
11492
12129
  setSelectedTask: setSelectedTask,
11493
- onclickTaskList: onclickTaskList
12130
+ onclickTaskList: onclickTaskList,
12131
+ oncontextmenuTaskList: oncontextmenuTaskList
11494
12132
  }));
11495
12133
  }));
11496
12134
  };
@@ -11553,24 +12191,27 @@ var Planner = function Planner(props) {
11553
12191
  var _useState = react.useState(TimeUnit.MONTH),
11554
12192
  timeUnit = _useState[0],
11555
12193
  setTimeUnit = _useState[1];
11556
- var _useState2 = react.useState(props.mainGantt.items),
11557
- currentTasks = _useState2[0],
11558
- setCurrentTasks = _useState2[1];
11559
- var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
11560
- currentDetails = _useState3[0],
11561
- setCurrentDetails = _useState3[1];
11562
- var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
11563
- mainGanttDoubleView = _useState4[0],
11564
- setMainGanttDoubleView = _useState4[1];
11565
- var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
11566
- displayedDates = _useState5[0],
11567
- setDisplayedDates = _useState5[1];
11568
- var _useState6 = react.useState(),
11569
- viewDate = _useState6[0],
11570
- setViewDate = _useState6[1];
11571
- var _useState7 = react.useState(),
11572
- projection = _useState7[0],
11573
- setProjection = _useState7[1];
12194
+ var currentTasks = react.useRef(props.mainGantt.items);
12195
+ var setCurrentTasks = function setCurrentTasks(tasks) {
12196
+ currentTasks.current = tasks;
12197
+ };
12198
+ var currentDetails = react.useRef((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items);
12199
+ var setCurrentDetails = function setCurrentDetails(details) {
12200
+ currentDetails.current = details;
12201
+ };
12202
+ var _useState2 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12203
+ mainGanttDoubleView = _useState2[0],
12204
+ setMainGanttDoubleView = _useState2[1];
12205
+ var displayedDates = react.useRef(calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount));
12206
+ var setDisplayedDates = function setDisplayedDates(dates) {
12207
+ displayedDates.current = dates;
12208
+ };
12209
+ var _useState3 = react.useState(),
12210
+ viewDate = _useState3[0],
12211
+ setViewDate = _useState3[1];
12212
+ var _useState4 = react.useState(),
12213
+ projection = _useState4[0],
12214
+ setProjection = _useState4[1];
11574
12215
  var locale = "it-IT";
11575
12216
  var handleClick = function handleClick(row, onClick) {
11576
12217
  if (!row) {
@@ -11589,6 +12230,28 @@ var Planner = function Planner(props) {
11589
12230
  }
11590
12231
  onClick === null || onClick === void 0 ? void 0 : onClick(row);
11591
12232
  };
12233
+ var handleContextMenu = function handleContextMenu(event, row, onContextMenu) {
12234
+ if (!row) {
12235
+ return;
12236
+ }
12237
+ if (row.type === "task" && props.secondaryGantt) {
12238
+ var _phase$color2;
12239
+ var phase = row;
12240
+ setProjection({
12241
+ start: new Date(phase.startDate),
12242
+ end: new Date(phase.endDate),
12243
+ color: (_phase$color2 = phase.color) != null ? _phase$color2 : "#ED7D31"
12244
+ });
12245
+ } else {
12246
+ setProjection(undefined);
12247
+ }
12248
+ onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event, row);
12249
+ };
12250
+ var handleSetDoubleView = function handleSetDoubleView(checked) {
12251
+ var _props$onSetDoubleVie;
12252
+ setMainGanttDoubleView(checked);
12253
+ (_props$onSetDoubleVie = props.onSetDoubleView) === null || _props$onSetDoubleVie === void 0 ? void 0 : _props$onSetDoubleVie.call(props, checked);
12254
+ };
11592
12255
  var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
11593
12256
  var id = task === null || task === void 0 ? void 0 : task.id;
11594
12257
  if (!id) {
@@ -11646,26 +12309,32 @@ var Planner = function Planner(props) {
11646
12309
  setProjection(undefined);
11647
12310
  }, [props]);
11648
12311
  react.useEffect(function () {
11649
- var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
12312
+ var dates = calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount);
11650
12313
  setDisplayedDates(dates);
11651
12314
  if (!viewDate) {
11652
- setViewDate(dates.displayedStartDate);
12315
+ var now = new Date();
12316
+ if (dates.displayedStartDate <= now && dates.displayedEndDate >= now) {
12317
+ setViewDate(now);
12318
+ } else {
12319
+ setViewDate(dates.displayedStartDate);
12320
+ }
11653
12321
  }
11654
- }, [currentTasks, currentDetails]);
12322
+ }, [timeUnit, mainGanttDoubleView, props.preStepsCount, viewDate]);
11655
12323
  var tasks = [];
11656
- for (var i = 0; i < currentTasks.length; i++) {
11657
- tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12324
+ for (var i = 0; i < currentTasks.current.length; i++) {
12325
+ tasks.push.apply(tasks, convertProjectToTasks(currentTasks.current[i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11658
12326
  }
11659
12327
  var details = [];
11660
- if (currentDetails) {
11661
- for (var _i = 0; _i < currentDetails.length; _i++) {
11662
- details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12328
+ if (currentDetails.current) {
12329
+ for (var _i = 0; _i < currentDetails.current.length; _i++) {
12330
+ details.push.apply(details, convertProjectToTasks(currentDetails.current[_i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11663
12331
  }
11664
12332
  }
11665
12333
  console.log("PLANNER render");
11666
12334
  return react.createElement("div", null, react.createElement(Switcher, {
11667
12335
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
11668
- return setTimeUnit(timeUnit);
12336
+ setTimeUnit(timeUnit);
12337
+ setViewDate(undefined);
11669
12338
  }
11670
12339
  }), react.createElement("div", {
11671
12340
  style: {
@@ -11680,34 +12349,52 @@ var Planner = function Planner(props) {
11680
12349
  showSecondaryDates: mainGanttDoubleView,
11681
12350
  hideDependencies: props.mainGantt.hideDependencies,
11682
12351
  ganttHeight: props.mainGantt.ganttHeight,
11683
- displayedStartDate: displayedDates.displayedStartDate,
11684
- displayedEndDate: displayedDates.displayedEndDate,
12352
+ displayedStartDate: displayedDates.current.displayedStartDate,
12353
+ displayedEndDate: displayedDates.current.displayedEndDate,
11685
12354
  viewDate: viewDate,
11686
12355
  tasks: tasks,
12356
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11687
12357
  viewMode: toViewMode(timeUnit)
11688
12358
  }, props.mainGantt.stylingOptions, {
11689
- TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView),
12359
+ TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, handleSetDoubleView),
11690
12360
  TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
11691
- var row = getProjectById(id, currentTasks);
12361
+ var row = getProjectById(id, currentTasks.current);
11692
12362
  if (!row) {
11693
- row = getPhaseById(id, currentTasks);
12363
+ row = getPhaseById(id, currentTasks.current);
11694
12364
  }
11695
12365
  if (row) {
11696
12366
  handleClick(row, props.mainGantt.onClick);
11697
12367
  }
12368
+ }, function (event, id) {
12369
+ var row = getProjectById(id, currentTasks.current);
12370
+ if (!row) {
12371
+ row = getPhaseById(id, currentTasks.current);
12372
+ }
12373
+ if (row) {
12374
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12375
+ }
11698
12376
  }, MAIN_GANTT_ID),
11699
12377
  TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
11700
- onClick: function onClick(e) {
11701
- var row = getProjectById(e.id, currentTasks);
12378
+ onClick: function onClick(task) {
12379
+ var row = getProjectById(task.id, currentTasks.current);
11702
12380
  if (!row) {
11703
- row = getPhaseById(e.id, currentTasks);
12381
+ row = getPhaseById(task.id, currentTasks.current);
11704
12382
  }
11705
12383
  if (row) {
11706
12384
  handleClick(row, props.mainGantt.onClick);
11707
12385
  }
11708
12386
  },
11709
- onDateChange: function onDateChange(e) {
11710
- return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
12387
+ onContextMenu: function onContextMenu(event, task) {
12388
+ var row = getProjectById(task.id, currentTasks.current);
12389
+ if (!row) {
12390
+ row = getPhaseById(task.id, currentTasks.current);
12391
+ }
12392
+ if (row) {
12393
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12394
+ }
12395
+ },
12396
+ onDateChange: function onDateChange(task) {
12397
+ return handleDateChange(task, currentTasks.current, props.mainGantt.onDateChange);
11711
12398
  },
11712
12399
  locale: locale,
11713
12400
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11719,29 +12406,45 @@ var Planner = function Planner(props) {
11719
12406
  showSecondaryDates: mainGanttDoubleView,
11720
12407
  hideDependencies: props.secondaryGantt.hideDependencies,
11721
12408
  ganttHeight: props.secondaryGantt.ganttHeight,
11722
- displayedStartDate: displayedDates.displayedStartDate,
11723
- displayedEndDate: displayedDates.displayedEndDate,
12409
+ displayedStartDate: displayedDates.current.displayedStartDate,
12410
+ displayedEndDate: displayedDates.current.displayedEndDate,
11724
12411
  viewDate: viewDate,
11725
12412
  tasks: details,
12413
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11726
12414
  viewMode: toViewMode(timeUnit)
11727
12415
  }, props.mainGantt.stylingOptions, {
11728
12416
  TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
11729
12417
  TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
11730
12418
  console.log("planner.tsx secondaryGantt Clicked on " + id);
12419
+ }, function (event, id) {
12420
+ if (props.secondaryGantt) {
12421
+ var row = getProjectById(id, currentDetails.current);
12422
+ if (row) {
12423
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12424
+ }
12425
+ }
11731
12426
  }, SECONDARY_GANTT_ID),
11732
12427
  TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
11733
12428
  projection: projection,
11734
- onClick: function onClick(e) {
12429
+ onClick: function onClick(task) {
11735
12430
  if (props.secondaryGantt) {
11736
- var row = getProjectById(e.id, currentDetails);
12431
+ var row = getProjectById(task.id, currentDetails.current);
11737
12432
  if (row) {
11738
12433
  handleClick(row, props.secondaryGantt.onClick);
11739
12434
  }
11740
12435
  }
11741
12436
  },
11742
- onDateChange: function onDateChange(e) {
12437
+ onContextMenu: function onContextMenu(event, task) {
12438
+ if (props.secondaryGantt) {
12439
+ var row = getProjectById(task.id, currentDetails.current);
12440
+ if (row) {
12441
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12442
+ }
12443
+ }
12444
+ },
12445
+ onDateChange: function onDateChange(task) {
11743
12446
  var _props$secondaryGantt7;
11744
- return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
12447
+ return handleDateChange(task, currentDetails.current, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
11745
12448
  },
11746
12449
  locale: locale,
11747
12450
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11800,15 +12503,8 @@ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValu
11800
12503
  return valuesToShow;
11801
12504
  }
11802
12505
 
11803
- const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;dominant-baseline:central;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
12506
+ 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}";
11804
12507
 
11805
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11806
- if (kind === "a" && !f)
11807
- throw new TypeError("Private accessor was defined without a getter");
11808
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
11809
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
11810
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11811
- };
11812
12508
  var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11813
12509
  if (kind === "m")
11814
12510
  throw new TypeError("Private method is not writable");
@@ -11818,21 +12514,31 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
11818
12514
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
11819
12515
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11820
12516
  };
11821
- var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter;
12517
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12518
+ if (kind === "a" && !f)
12519
+ throw new TypeError("Private accessor was defined without a getter");
12520
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12521
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
12522
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12523
+ };
12524
+ 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;
11822
12525
  const KupPlanner = class {
11823
12526
  constructor(hostRef) {
11824
12527
  index.registerInstance(this, hostRef);
11825
12528
  this.kupClick = index.createEvent(this, "kup-planner-click", 6);
11826
12529
  this.kupDateChange = index.createEvent(this, "kup-planner-datechange", 6);
11827
12530
  this.kupReady = index.createEvent(this, "kup-planner-ready", 6);
12531
+ this.kupContextMenu = index.createEvent(this, "kup-planner-contextmenu", 6);
11828
12532
  _KupPlanner_instances.add(this);
11829
12533
  /*-------------------------------------------------*/
11830
12534
  /* I n t e r n a l V a r i a b l e s */
11831
12535
  /*-------------------------------------------------*/
11832
12536
  _KupPlanner_kupManager.set(this, kupManager$1.kupManagerInstance());
11833
- _KupPlanner_rootPlanner.set(this, void 0);
11834
12537
  _KupPlanner_lastOnChangeReceived.set(this, void 0);
11835
- this.plannerProps = undefined;
12538
+ _KupPlanner_rootPlanner.set(this, void 0);
12539
+ _KupPlanner_phases.set(this, {});
12540
+ // no re-render
12541
+ _KupPlanner_showSecondaryDatesLocal.set(this, false);
11836
12542
  this.customStyle = '';
11837
12543
  this.data = undefined;
11838
12544
  this.detailData = undefined;
@@ -11840,6 +12546,7 @@ const KupPlanner = class {
11840
12546
  this.detailColumns = undefined;
11841
12547
  this.detailDates = undefined;
11842
12548
  this.detailHeight = undefined;
12549
+ this.detailIconCol = undefined;
11843
12550
  this.detailIdCol = undefined;
11844
12551
  this.detailNameCol = undefined;
11845
12552
  this.detailPrevDates = undefined;
@@ -11849,6 +12556,7 @@ const KupPlanner = class {
11849
12556
  this.phaseColumns = undefined;
11850
12557
  this.phaseColParDep = undefined;
11851
12558
  this.phaseDates = undefined;
12559
+ this.phaseIconCol = undefined;
11852
12560
  this.phaseIdCol = undefined;
11853
12561
  this.phaseNameCol = undefined;
11854
12562
  this.phasePrevDates = undefined;
@@ -11856,26 +12564,23 @@ const KupPlanner = class {
11856
12564
  this.taskColumns = undefined;
11857
12565
  this.taskDates = undefined;
11858
12566
  this.taskHeight = undefined;
12567
+ this.taskIconCol = undefined;
11859
12568
  this.taskIdCol = undefined;
11860
12569
  this.taskNameCol = undefined;
11861
12570
  this.taskPrevDates = undefined;
11862
12571
  this.titleMess = undefined;
12572
+ this.plannerProps = undefined;
11863
12573
  }
11864
- onKupClick(event, taskAction) {
11865
- this.kupClick.emit({
11866
- comp: this,
11867
- id: this.rootElement.id,
11868
- value: event,
11869
- taskAction: taskAction,
11870
- });
12574
+ dataChanged() {
12575
+ __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
11871
12576
  }
11872
- onKupDateChange(event, taskAction) {
11873
- this.kupDateChange.emit({
11874
- comp: this,
11875
- id: this.rootElement.id,
11876
- value: event,
11877
- taskAction: taskAction,
11878
- });
12577
+ showSecondaryDatesChanged() {
12578
+ var _a;
12579
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12580
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12581
+ this.plannerProps.mainGantt.showSecondaryDates =
12582
+ this.showSecondaryDates;
12583
+ }
11879
12584
  }
11880
12585
  /*-------------------------------------------------*/
11881
12586
  /* P u b l i c M e t h o d s */
@@ -11910,6 +12615,7 @@ const KupPlanner = class {
11910
12615
  var _a;
11911
12616
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11912
12617
  if (task) {
12618
+ __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
11913
12619
  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) => {
11914
12620
  const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
11915
12621
  const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
@@ -11917,6 +12623,8 @@ const KupPlanner = class {
11917
12623
  : col == this.phaseDates[1]
11918
12624
  ? '#END#'
11919
12625
  : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12626
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12627
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
11920
12628
  let phase = {
11921
12629
  taskRow: task.taskRow,
11922
12630
  phaseRow: row,
@@ -11933,48 +12641,22 @@ const KupPlanner = class {
11933
12641
  selectedColor: row.cells[this.phaseColorCol].value,
11934
12642
  valuesToShow: valuesToShow,
11935
12643
  rowType: KupPlannerGanttRowType.PHASE,
12644
+ icon: iconUrl
12645
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12646
+ : undefined,
11936
12647
  };
11937
12648
  return phase;
11938
12649
  });
11939
12650
  }
11940
12651
  this.plannerProps = Object.assign({}, this.plannerProps);
11941
12652
  }
11942
- handleOnClick(nativeEvent) {
11943
- console.log('kup-planner.handleOnClick', nativeEvent);
11944
- switch (nativeEvent.rowType) {
11945
- case KupPlannerGanttRowType.TASK:
11946
- const taskAction = nativeEvent.phases
11947
- ? KupPlannerTaskAction.onTaskClosing
11948
- : KupPlannerTaskAction.onTaskOpening;
11949
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
11950
- this.onKupClick(nativeEvent, taskAction);
11951
- }
11952
- break;
11953
- case KupPlannerGanttRowType.PHASE:
11954
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
11955
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11956
- }
11957
- break;
11958
- case KupPlannerGanttRowType.DETAIL:
11959
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
11960
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11961
- }
11962
- break;
11963
- }
11964
- }
11965
- handleOnDateChange(nativeEvent) {
11966
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
11967
- if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
11968
- console.log('kup-planner.handleOnDateChange', nativeEvent);
11969
- this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
11970
- }
11971
- }
11972
- }
12653
+ //---- Lifecycle hooks ----
11973
12654
  componentWillLoad() {
11974
12655
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
11975
12656
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
11976
12657
  }
11977
12658
  componentDidLoad() {
12659
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
11978
12660
  let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
11979
12661
  if (details && details.length == 0) {
11980
12662
  details = undefined;
@@ -11993,8 +12675,9 @@ const KupPlanner = class {
11993
12675
  filter: mainFilter,
11994
12676
  hideLabel: true,
11995
12677
  ganttHeight: this.taskHeight,
11996
- showSecondaryDates: this.showSecondaryDates,
12678
+ showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_showSecondaryDatesLocal, "f"),
11997
12679
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12680
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
11998
12681
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11999
12682
  },
12000
12683
  secondaryGantt: details
@@ -12006,9 +12689,11 @@ const KupPlanner = class {
12006
12689
  hideLabel: true,
12007
12690
  ganttHeight: this.detailHeight,
12008
12691
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12692
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12009
12693
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12010
12694
  }
12011
12695
  : undefined,
12696
+ onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
12012
12697
  };
12013
12698
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12014
12699
  this.kupReady.emit({
@@ -12024,9 +12709,116 @@ const KupPlanner = class {
12024
12709
  componentDidRender() {
12025
12710
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12026
12711
  }
12712
+ onKupClick(event, taskAction) {
12713
+ this.kupClick.emit({
12714
+ comp: this,
12715
+ id: this.rootElement.id,
12716
+ value: event,
12717
+ taskAction: taskAction,
12718
+ });
12719
+ }
12720
+ onKupContextMenu(event, ganttRow, taskAction) {
12721
+ let row;
12722
+ let cell;
12723
+ let column;
12724
+ switch (ganttRow.type) {
12725
+ case 'project': {
12726
+ row = ganttRow.taskRow;
12727
+ cell = row.cells[this.taskIdCol];
12728
+ column = this.data.columns[this.taskIdCol];
12729
+ break;
12730
+ }
12731
+ case 'task': {
12732
+ row = ganttRow.phaseRow;
12733
+ cell = row.cells[this.phaseIdCol];
12734
+ //column = this.data.columns[this.taskIdCol];
12735
+ break;
12736
+ }
12737
+ case 'timeline': {
12738
+ row = ganttRow.detailRow;
12739
+ cell = row.cells[this.detailIdCol];
12740
+ column = this.data.columns[this.detailIdCol];
12741
+ break;
12742
+ }
12743
+ }
12744
+ this.kupContextMenu.emit({
12745
+ comp: this,
12746
+ id: this.rootElement.id,
12747
+ value: ganttRow,
12748
+ taskAction: taskAction,
12749
+ details: {
12750
+ cell: cell,
12751
+ column: column,
12752
+ originalEvent: event,
12753
+ row: row,
12754
+ },
12755
+ });
12756
+ }
12757
+ onKupDateChange(event, taskAction) {
12758
+ this.kupDateChange.emit({
12759
+ comp: this,
12760
+ id: this.rootElement.id,
12761
+ value: event,
12762
+ taskAction: taskAction,
12763
+ });
12764
+ }
12765
+ handleOnClick(nativeEvent) {
12766
+ switch (nativeEvent.rowType) {
12767
+ case KupPlannerGanttRowType.TASK:
12768
+ const taskAction = nativeEvent.phases
12769
+ ? KupPlannerTaskAction.onTaskClosing
12770
+ : KupPlannerTaskAction.onTaskOpening;
12771
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12772
+ this.onKupClick(nativeEvent, taskAction);
12773
+ }
12774
+ break;
12775
+ case KupPlannerGanttRowType.PHASE:
12776
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12777
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12778
+ }
12779
+ break;
12780
+ case KupPlannerGanttRowType.DETAIL:
12781
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12782
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12783
+ }
12784
+ break;
12785
+ }
12786
+ }
12787
+ handleOnContextMenu(event, row) {
12788
+ switch (row.rowType) {
12789
+ case KupPlannerGanttRowType.TASK:
12790
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12791
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12792
+ }
12793
+ break;
12794
+ case KupPlannerGanttRowType.PHASE:
12795
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12796
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12797
+ }
12798
+ break;
12799
+ case KupPlannerGanttRowType.DETAIL:
12800
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12801
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12802
+ }
12803
+ break;
12804
+ }
12805
+ }
12806
+ handleOnSetDoubleView(checked) {
12807
+ var _a;
12808
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, checked, "f");
12809
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12810
+ this.plannerProps.mainGantt.showSecondaryDates = checked;
12811
+ }
12812
+ }
12813
+ handleOnDateChange(nativeEvent) {
12814
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12815
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12816
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12817
+ }
12818
+ }
12819
+ }
12027
12820
  render() {
12028
12821
  var _a;
12029
- //console.log('kup-planner.tsx render');
12030
12822
  return (index.h(index.Host, null, index.h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId, style: { maxWidth: this.maxWidth } }), index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12031
12823
  if (e.key === 'Enter') {
12032
12824
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
@@ -12041,8 +12833,12 @@ const KupPlanner = class {
12041
12833
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12042
12834
  }
12043
12835
  get rootElement() { return index.getElement(this); }
12836
+ static get watchers() { return {
12837
+ "data": ["dataChanged"],
12838
+ "showSecondaryDates": ["showSecondaryDatesChanged"]
12839
+ }; }
12044
12840
  };
12045
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12841
+ _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() {
12046
12842
  var _a;
12047
12843
  (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12048
12844
  const componentWrapperElement = this.rootElement.shadowRoot.getElementById(GenericVariables.componentWrapperId);
@@ -12054,7 +12850,13 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12054
12850
  var _a;
12055
12851
  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) => {
12056
12852
  const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12057
- const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12853
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12854
+ ? '#START#'
12855
+ : col == this.taskDates[1]
12856
+ ? '#END#'
12857
+ : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12858
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
12859
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
12058
12860
  let task = {
12059
12861
  taskRow: row,
12060
12862
  taskRowId: row.id,
@@ -12067,6 +12869,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12067
12869
  type: 'project',
12068
12870
  valuesToShow: valuesToShow,
12069
12871
  rowType: KupPlannerGanttRowType.TASK,
12872
+ icon: iconUrl
12873
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12874
+ : undefined,
12070
12875
  };
12071
12876
  return task;
12072
12877
  });
@@ -12089,6 +12894,7 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12089
12894
  detail = {
12090
12895
  id: detailId,
12091
12896
  name: detailNameId,
12897
+ detailRow: row,
12092
12898
  type: 'timeline',
12093
12899
  valuesToShow: valuesToShow,
12094
12900
  rowType: KupPlannerGanttRowType.DETAIL,
@@ -12096,6 +12902,8 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12096
12902
  };
12097
12903
  details.push(detail);
12098
12904
  }
12905
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
12906
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
12099
12907
  detail.schedule.push({
12100
12908
  startDate: datesSanitized.dateValues[0],
12101
12909
  endDate: datesSanitized.dateValues[1],
@@ -12105,6 +12913,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12105
12913
  selectedColor: this.detailColorCol
12106
12914
  ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12107
12915
  : '#D9D9D8',
12916
+ icon: iconUrl
12917
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12918
+ : undefined,
12108
12919
  });
12109
12920
  });
12110
12921
  return details;
@@ -12114,9 +12925,6 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12114
12925
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12115
12926
  if (task)
12116
12927
  task.phases = undefined;
12117
- // this.plannerProps.mainGantt = JSON.parse(
12118
- // JSON.stringify(this.plannerProps.mainGantt)
12119
- // );
12120
12928
  this.plannerProps = Object.assign({}, this.plannerProps);
12121
12929
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
12122
12930
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -12128,6 +12936,12 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12128
12936
  return true;
12129
12937
  }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12130
12938
  return true;
12939
+ }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
12940
+ return true;
12941
+ }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
12942
+ return true;
12943
+ }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
12944
+ return true;
12131
12945
  }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
12132
12946
  let emitEvent = false;
12133
12947
  if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
@@ -12146,19 +12960,28 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12146
12960
  };
12147
12961
  const value = e.target.value;
12148
12962
  const data = isDetail ? this.detailData : this.data;
12963
+ const tempRows = [];
12149
12964
  for (let index = 0; index < data.rows.length; index++) {
12150
12965
  const row = data.rows[index];
12151
- const valuesToShow = isDetail
12152
- ? getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns)
12153
- : getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12154
- for (let index = 0; index < valuesToShow.length; index++) {
12155
- const valueToShow = valuesToShow[index];
12156
- if (valueToShow.toLowerCase().indexOf(value.toLowerCase()) > -1) {
12157
- tempData.rows.push(row);
12158
- break;
12966
+ const cells = row.cells;
12967
+ for (let index = 0; index < data.columns.length; index++) {
12968
+ const column = data.columns[index];
12969
+ const cell = cells[column.name];
12970
+ if (cell) {
12971
+ const dValue = kupManager$1.getCellValueForDisplay(data.columns[index], cell);
12972
+ const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
12973
+ if (found) {
12974
+ tempRows.push({ row, weight: index });
12975
+ break;
12976
+ }
12159
12977
  }
12160
12978
  }
12161
12979
  }
12980
+ tempRows
12981
+ .sort((a, b) => a.weight - b.weight)
12982
+ .forEach((tempRow) => {
12983
+ tempData.rows.push(tempRow.row);
12984
+ });
12162
12985
  const newGantt = isDetail
12163
12986
  ? {
12164
12987
  secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
@@ -12167,6 +12990,32 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12167
12990
  mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12168
12991
  };
12169
12992
  this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
12993
+ }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
12994
+ var _a;
12995
+ let iconUrl = undefined;
12996
+ if (columnName) {
12997
+ const iconCell = row.cells[columnName];
12998
+ let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
12999
+ if (!icon) {
13000
+ icon = iconCell.value;
13001
+ }
13002
+ if (icon) {
13003
+ iconUrl = index.getAssetPath('./assets/svg/' + icon + '.svg');
13004
+ }
13005
+ }
13006
+ return iconUrl;
13007
+ }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13008
+ var _a;
13009
+ let iconColor = undefined;
13010
+ if (columnName) {
13011
+ const iconCell = row.cells[columnName];
13012
+ iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13013
+ if (iconColor) {
13014
+ iconColor =
13015
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13016
+ }
13017
+ }
13018
+ return iconColor;
12170
13019
  };
12171
13020
  KupPlanner.style = kupPlannerCss;
12172
13021