@sme.up/ketchup 7.5.0-SNAPSHOT → 8.0.1

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 (166) hide show
  1. package/dist/cjs/{component-72a5b626.js → component-85c2bd4d.js} +1 -1
  2. package/dist/cjs/{f-button-a508a0a1.js → f-button-c0ede055.js} +1 -1
  3. package/dist/cjs/{f-cell-52d724f5.js → f-cell-1c17dbac.js} +15 -8
  4. package/dist/cjs/{f-chip-cbb70aed.js → f-chip-bace36bb.js} +2 -2
  5. package/dist/cjs/{f-image-510563ed.js → f-image-22174590.js} +1 -1
  6. package/dist/cjs/{f-paginator-utils-ff531caa.js → f-paginator-utils-e21e1f06.js} +2 -2
  7. package/dist/cjs/{f-text-field-d17e5aa0.js → f-text-field-503f2bb0.js} +82 -8
  8. package/dist/cjs/{f-text-field-mdc-85997738.js → f-text-field-mdc-0e22f3e3.js} +2 -2
  9. package/dist/cjs/ketchup.cjs.js +1 -1
  10. package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +851 -824
  12. package/dist/cjs/kup-box.cjs.entry.js +10 -10
  13. package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +2 -3
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +7 -7
  18. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-echart.cjs.entry.js +25 -8
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +7 -18
  21. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  23. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  25. package/dist/cjs/{kup-manager-9e1680dd.js → kup-manager-b994cf71.js} +164 -16
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +5 -5
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-planner.cjs.entry.js +1041 -192
  30. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +12 -4
  33. package/dist/cjs/loader.cjs.js +1 -1
  34. package/dist/cjs/{tslib.es6-0ee02c67.js → tslib.es6-386654de.js} +9 -5
  35. package/dist/collection/assets/data-table.js +44 -0
  36. package/dist/collection/components/kup-chip/kup-chip.js +4 -3
  37. package/dist/collection/components/kup-dash-list/kup-dash-list.js +1 -3
  38. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  39. package/dist/collection/components/kup-data-table/kup-data-table.js +5 -16
  40. package/dist/collection/components/kup-echart/kup-echart-declarations.js +2 -0
  41. package/dist/collection/components/kup-echart/kup-echart.js +23 -8
  42. package/dist/collection/components/kup-family-tree/kup-family-tree.js +4 -15
  43. package/dist/collection/components/kup-planner/kup-planner-declarations.js +1 -0
  44. package/dist/collection/components/kup-planner/kup-planner.css +1 -3
  45. package/dist/collection/components/kup-planner/kup-planner.js +302 -72
  46. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -3
  47. package/dist/collection/components/kup-snackbar/kup-snackbar.js +27 -0
  48. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
  49. package/dist/collection/components/kup-text-field/kup-text-field.js +109 -10
  50. package/dist/collection/components/kup-tree/kup-tree.js +66 -67
  51. package/dist/collection/f-components/f-cell/f-cell.js +12 -5
  52. package/dist/collection/f-components/f-text-field/f-text-field.js +80 -6
  53. package/dist/collection/managers/kup-manager/kup-manager.js +18 -0
  54. package/dist/collection/managers/kup-math/kup-math.js +85 -4
  55. package/dist/collection/utils/utils.js +1 -10
  56. package/dist/components/kup-autocomplete2.js +648 -386
  57. package/dist/components/kup-dash-list.js +2 -3
  58. package/dist/components/kup-dashboard.js +1 -1
  59. package/dist/components/kup-data-table.js +1 -1
  60. package/dist/components/kup-date-picker.js +1 -1
  61. package/dist/components/kup-dialog.js +1 -1
  62. package/dist/components/kup-dropdown-button.js +1 -1
  63. package/dist/components/kup-echart2.js +25 -8
  64. package/dist/components/kup-family-tree.js +5 -16
  65. package/dist/components/kup-form.js +1 -1
  66. package/dist/components/kup-gauge.js +1 -1
  67. package/dist/components/kup-image-list.js +1 -1
  68. package/dist/components/kup-image.js +1 -1
  69. package/dist/components/kup-list.js +1 -1
  70. package/dist/components/kup-magic-box.js +1 -1
  71. package/dist/components/kup-numeric-picker.js +1 -1
  72. package/dist/components/kup-planner.js +1041 -189
  73. package/dist/components/kup-snackbar.js +9 -1
  74. package/dist/esm/{component-b1bedf1d.js → component-120651a0.js} +1 -1
  75. package/dist/esm/{f-button-b7f77b26.js → f-button-c377973d.js} +1 -1
  76. package/dist/esm/{f-cell-dc3beffe.js → f-cell-e5a98bc8.js} +15 -8
  77. package/dist/esm/{f-chip-0a678211.js → f-chip-c8a18c48.js} +2 -2
  78. package/dist/esm/{f-image-f84dbd7c.js → f-image-5cbdf39d.js} +1 -1
  79. package/dist/esm/{f-paginator-utils-52902bd6.js → f-paginator-utils-a1dab059.js} +2 -2
  80. package/dist/esm/{f-text-field-7dd143be.js → f-text-field-dafb7c8b.js} +82 -8
  81. package/dist/esm/{f-text-field-mdc-d42d3f9e.js → f-text-field-mdc-cee583ea.js} +2 -2
  82. package/dist/esm/ketchup.js +1 -1
  83. package/dist/esm/kup-accordion.entry.js +4 -4
  84. package/dist/esm/kup-autocomplete_27.entry.js +851 -824
  85. package/dist/esm/kup-box.entry.js +10 -10
  86. package/dist/esm/kup-calendar.entry.js +5 -5
  87. package/dist/esm/kup-cell.entry.js +5 -5
  88. package/dist/esm/kup-dash-list.entry.js +2 -3
  89. package/dist/esm/kup-dash_2.entry.js +1 -1
  90. package/dist/esm/kup-dashboard.entry.js +7 -7
  91. package/dist/esm/kup-drawer.entry.js +1 -1
  92. package/dist/esm/kup-echart.entry.js +25 -8
  93. package/dist/esm/kup-family-tree.entry.js +7 -18
  94. package/dist/esm/kup-iframe.entry.js +1 -1
  95. package/dist/esm/kup-image-list.entry.js +8 -8
  96. package/dist/esm/kup-lazy.entry.js +1 -1
  97. package/dist/esm/kup-magic-box.entry.js +2 -2
  98. package/dist/esm/{kup-manager-a5ab58a0.js → kup-manager-3594cde8.js} +163 -16
  99. package/dist/esm/kup-nav-bar.entry.js +1 -1
  100. package/dist/esm/kup-numeric-picker.entry.js +5 -5
  101. package/dist/esm/kup-photo-frame.entry.js +1 -1
  102. package/dist/esm/kup-planner.entry.js +1042 -193
  103. package/dist/esm/kup-probe.entry.js +1 -1
  104. package/dist/esm/kup-qlik.entry.js +1 -1
  105. package/dist/esm/kup-snackbar.entry.js +12 -4
  106. package/dist/esm/loader.js +1 -1
  107. package/dist/esm/{tslib.es6-3eea2234.js → tslib.es6-8c2af864.js} +9 -5
  108. package/dist/ketchup/ketchup.esm.js +1 -1
  109. package/dist/ketchup/{p-98ff4101.entry.js → p-017418e7.entry.js} +1 -1
  110. package/dist/ketchup/{p-81605f08.js → p-10d84b1b.js} +1 -1
  111. package/dist/ketchup/{p-871cfe60.entry.js → p-22e72f06.entry.js} +1 -1
  112. package/dist/ketchup/{p-a203f78b.js → p-27a56c87.js} +1 -1
  113. package/dist/ketchup/{p-7065b172.js → p-2d32e3cd.js} +1 -1
  114. package/dist/ketchup/{p-a122b8d3.entry.js → p-31abf4b6.entry.js} +1 -1
  115. package/dist/ketchup/{p-beb0907a.entry.js → p-37ada0f0.entry.js} +1 -1
  116. package/dist/ketchup/p-38f16697.entry.js +9 -0
  117. package/dist/ketchup/{p-69f3b9da.js → p-4638fbff.js} +1 -1
  118. package/dist/ketchup/{p-00fc0f80.entry.js → p-473d2bea.entry.js} +1 -1
  119. package/dist/ketchup/{p-166257d0.entry.js → p-4c56e199.entry.js} +1 -1
  120. package/dist/ketchup/p-5205286a.entry.js +25 -0
  121. package/dist/ketchup/p-61319cfa.js +1 -0
  122. package/dist/ketchup/{p-de34eb56.js → p-6762d447.js} +1 -1
  123. package/dist/ketchup/{p-7040cab7.entry.js → p-6c726886.entry.js} +1 -1
  124. package/dist/ketchup/p-7be5ef32.entry.js +1 -0
  125. package/dist/ketchup/{p-e92d1972.entry.js → p-7f4f5f0f.entry.js} +1 -1
  126. package/dist/ketchup/p-7f59211b.js +1 -0
  127. package/dist/ketchup/{p-78d1fc60.entry.js → p-80815edf.entry.js} +1 -1
  128. package/dist/ketchup/p-8b248655.js +1 -0
  129. package/dist/ketchup/{p-a32cc181.entry.js → p-9fc6a9a8.entry.js} +1 -1
  130. package/dist/ketchup/{p-4fd6c34c.js → p-acaa171f.js} +3 -3
  131. package/dist/ketchup/{p-6022c951.entry.js → p-afff7a6e.entry.js} +1 -1
  132. package/dist/ketchup/{p-d315f7fa.entry.js → p-b718af72.entry.js} +1 -1
  133. package/dist/ketchup/p-bf4a881b.js +1 -0
  134. package/dist/ketchup/{p-c797ab39.entry.js → p-ce5b6ce7.entry.js} +1 -1
  135. package/dist/ketchup/p-cf322853.entry.js +1 -0
  136. package/dist/ketchup/{p-d2670436.entry.js → p-d1164680.entry.js} +1 -1
  137. package/dist/ketchup/{p-efb80719.entry.js → p-d4eb9a76.entry.js} +1 -1
  138. package/dist/ketchup/p-d76be079.entry.js +1 -0
  139. package/dist/ketchup/{p-d711e9ae.entry.js → p-ed7e118e.entry.js} +1 -1
  140. package/dist/ketchup/{p-f158836b.entry.js → p-ef0b4f19.entry.js} +2 -2
  141. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  142. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -0
  143. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +15 -2
  144. package/dist/types/components/kup-planner/kup-planner.d.ts +36 -11
  145. package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +5 -0
  146. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
  147. package/dist/types/components/kup-text-field/kup-text-field.d.ts +20 -2
  148. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -5
  149. package/dist/types/components.d.ts +72 -4
  150. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +3 -0
  151. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +1 -1
  152. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +1 -0
  153. package/dist/types/managers/kup-manager/kup-manager.d.ts +7 -0
  154. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
  155. package/dist/types/managers/kup-math/kup-math.d.ts +26 -2
  156. package/dist/types/utils/utils.d.ts +0 -1
  157. package/package.json +6 -18
  158. package/dist/ketchup/p-28efed63.js +0 -1
  159. package/dist/ketchup/p-3ae1409f.entry.js +0 -1
  160. package/dist/ketchup/p-71cb80ac.entry.js +0 -9
  161. package/dist/ketchup/p-79b0730b.js +0 -15
  162. package/dist/ketchup/p-8d0e6825.entry.js +0 -1
  163. package/dist/ketchup/p-9ae47a0d.entry.js +0 -1
  164. package/dist/ketchup/p-c5c6a2fb.js +0 -1
  165. package/dist/ketchup/p-d1e3573f.js +0 -1
  166. package/dist/ketchup/p-f69a6d89.entry.js +0 -10
@@ -1,10 +1,10 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-8bd38435.js';
2
- import { as as createCommonjsModule, k as kupManagerInstance, f as KupDatesFormats, am as getCellValueForDisplay, g as getProps, s as setProps, K as KupThemeIconValues, I as KupLanguageSearch } from './kup-manager-a5ab58a0.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement, a as getAssetPath } from './index-8bd38435.js';
2
+ import { at as createCommonjsModule, az as commonjsGlobal, k as kupManagerInstance, f as KupDatesFormats, an as getCellValueForDisplay, g as getProps, s as setProps, K as KupThemeIconValues, I as KupLanguageSearch } from './kup-manager-3594cde8.js';
3
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
4
- import { F as FTextField } from './f-text-field-7dd143be.js';
5
- import { F as FTextFieldMDC } from './f-text-field-mdc-d42d3f9e.js';
6
- import './tslib.es6-3eea2234.js';
7
- import './component-b1bedf1d.js';
4
+ import { F as FTextField } from './f-text-field-dafb7c8b.js';
5
+ import { F as FTextFieldMDC } from './f-text-field-mdc-cee583ea.js';
6
+ import './tslib.es6-8c2af864.js';
7
+ import './component-120651a0.js';
8
8
 
9
9
  /**
10
10
  * Props of the kup-gantt component.
@@ -46,6 +46,7 @@ var KupPlannerTaskAction;
46
46
  KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
47
47
  KupPlannerTaskAction["onClick"] = "onClick";
48
48
  KupPlannerTaskAction["onResize"] = "onResize";
49
+ KupPlannerTaskAction["onRightClick"] = "onRightClick";
49
50
  })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
50
51
  var KupPlannerGanttRowType;
51
52
  (function (KupPlannerGanttRowType) {
@@ -8369,6 +8370,545 @@ exports.Zone = Zone;
8369
8370
  //# sourceMappingURL=luxon.js.map
8370
8371
  });
8371
8372
 
8373
+ var hexToCssFilter = createCommonjsModule(function (module, exports) {
8374
+ (function (global, factory) {
8375
+ factory(exports) ;
8376
+ }(commonjsGlobal, (function (exports) {
8377
+ /*! *****************************************************************************
8378
+ Copyright (c) Microsoft Corporation.
8379
+
8380
+ Permission to use, copy, modify, and/or distribute this software for any
8381
+ purpose with or without fee is hereby granted.
8382
+
8383
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8384
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8385
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8386
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8387
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
8388
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8389
+ PERFORMANCE OF THIS SOFTWARE.
8390
+ ***************************************************************************** */
8391
+
8392
+ function __read(o, n) {
8393
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
8394
+ if (!m) return o;
8395
+ var i = m.call(o), r, ar = [], e;
8396
+ try {
8397
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8398
+ }
8399
+ catch (error) { e = { error: error }; }
8400
+ finally {
8401
+ try {
8402
+ if (r && !r.done && (m = i["return"])) m.call(i);
8403
+ }
8404
+ finally { if (e) throw e.error; }
8405
+ }
8406
+ return ar;
8407
+ }
8408
+
8409
+ var Color = /** @class */ (function () {
8410
+ function Color(r, g, b) {
8411
+ this.r = 0;
8412
+ this.g = 0;
8413
+ this.b = 0;
8414
+ this.set(r, g, b);
8415
+ }
8416
+ Color.prototype.set = function (r, g, b) {
8417
+ this.r = this.clamp(r);
8418
+ this.g = this.clamp(g);
8419
+ this.b = this.clamp(b);
8420
+ };
8421
+ /**
8422
+ * Applying cals to get CSS filter for hue-rotate
8423
+ *
8424
+ * @param {number} [angle=0]
8425
+ * @memberof Color
8426
+ */
8427
+ Color.prototype.hueRotate = function (angle) {
8428
+ if (angle === void 0) { angle = 0; }
8429
+ angle = (angle / 180) * Math.PI;
8430
+ var sin = Math.sin(angle);
8431
+ var cos = Math.cos(angle);
8432
+ this.multiply([
8433
+ 0.213 + cos * 0.787 - sin * 0.213,
8434
+ 0.715 - cos * 0.715 - sin * 0.715,
8435
+ 0.072 - cos * 0.072 + sin * 0.928,
8436
+ 0.213 - cos * 0.213 + sin * 0.143,
8437
+ 0.715 + cos * 0.285 + sin * 0.14,
8438
+ 0.072 - cos * 0.072 - sin * 0.283,
8439
+ 0.213 - cos * 0.213 - sin * 0.787,
8440
+ 0.715 - cos * 0.715 + sin * 0.715,
8441
+ 0.072 + cos * 0.928 + sin * 0.072,
8442
+ ]);
8443
+ };
8444
+ /**
8445
+ * Applying cals to get CSS filter for grayscale
8446
+ *
8447
+ * @param {number} [value=1]
8448
+ * @memberof Color
8449
+ */
8450
+ Color.prototype.grayscale = function (value) {
8451
+ if (value === void 0) { value = 1; }
8452
+ this.multiply([
8453
+ 0.2126 + 0.7874 * (1 - value),
8454
+ 0.7152 - 0.7152 * (1 - value),
8455
+ 0.0722 - 0.0722 * (1 - value),
8456
+ 0.2126 - 0.2126 * (1 - value),
8457
+ 0.7152 + 0.2848 * (1 - value),
8458
+ 0.0722 - 0.0722 * (1 - value),
8459
+ 0.2126 - 0.2126 * (1 - value),
8460
+ 0.7152 - 0.7152 * (1 - value),
8461
+ 0.0722 + 0.9278 * (1 - value),
8462
+ ]);
8463
+ };
8464
+ /**
8465
+ * Applying cals to get CSS filter for sepia
8466
+ *
8467
+ * @param {number} [value=1]
8468
+ * @memberof Color
8469
+ */
8470
+ Color.prototype.sepia = function (value) {
8471
+ if (value === void 0) { value = 1; }
8472
+ this.multiply([
8473
+ 0.393 + 0.607 * (1 - value),
8474
+ 0.769 - 0.769 * (1 - value),
8475
+ 0.189 - 0.189 * (1 - value),
8476
+ 0.349 - 0.349 * (1 - value),
8477
+ 0.686 + 0.314 * (1 - value),
8478
+ 0.168 - 0.168 * (1 - value),
8479
+ 0.272 - 0.272 * (1 - value),
8480
+ 0.534 - 0.534 * (1 - value),
8481
+ 0.131 + 0.869 * (1 - value),
8482
+ ]);
8483
+ };
8484
+ /**
8485
+ * Applying cals to get CSS filter for saturate
8486
+ *
8487
+ * @param {number} [value=1]
8488
+ * @memberof Color
8489
+ */
8490
+ Color.prototype.saturate = function (value) {
8491
+ if (value === void 0) { value = 1; }
8492
+ this.multiply([
8493
+ 0.213 + 0.787 * value,
8494
+ 0.715 - 0.715 * value,
8495
+ 0.072 - 0.072 * value,
8496
+ 0.213 - 0.213 * value,
8497
+ 0.715 + 0.285 * value,
8498
+ 0.072 - 0.072 * value,
8499
+ 0.213 - 0.213 * value,
8500
+ 0.715 - 0.715 * value,
8501
+ 0.072 + 0.928 * value,
8502
+ ]);
8503
+ };
8504
+ Color.prototype.multiply = function (matrix) {
8505
+ // These values are needed. It's correct because the returned values will change
8506
+ var newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);
8507
+ var newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);
8508
+ var newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);
8509
+ this.r = newR;
8510
+ this.g = newG;
8511
+ this.b = newB;
8512
+ };
8513
+ /**
8514
+ * Applying cals to get CSS filter for brightness
8515
+ *
8516
+ * @param {number} [value=1]
8517
+ * @memberof Color
8518
+ */
8519
+ Color.prototype.brightness = function (value) {
8520
+ if (value === void 0) { value = 1; }
8521
+ this.linear(value);
8522
+ };
8523
+ /**
8524
+ * Applying cals to get CSS filter for contrast
8525
+ *
8526
+ * @param {number} [value=1]
8527
+ * @memberof Color
8528
+ */
8529
+ Color.prototype.contrast = function (value) {
8530
+ if (value === void 0) { value = 1; }
8531
+ this.linear(value, -(0.5 * value) + 0.5);
8532
+ };
8533
+ Color.prototype.linear = function (slope, intercept) {
8534
+ if (slope === void 0) { slope = 1; }
8535
+ if (intercept === void 0) { intercept = 0; }
8536
+ this.r = this.clamp(this.r * slope + intercept * 255);
8537
+ this.g = this.clamp(this.g * slope + intercept * 255);
8538
+ this.b = this.clamp(this.b * slope + intercept * 255);
8539
+ };
8540
+ /**
8541
+ * Applying cals to get CSS filter for invert
8542
+ *
8543
+ * @param {number} [value=1]
8544
+ * @memberof Color
8545
+ */
8546
+ Color.prototype.invert = function (value) {
8547
+ if (value === void 0) { value = 1; }
8548
+ this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);
8549
+ this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);
8550
+ this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);
8551
+ };
8552
+ /**
8553
+ * transform RGB into HSL values
8554
+ *
8555
+ * @returns {HSLData}
8556
+ * @memberof Color
8557
+ */
8558
+ Color.prototype.hsl = function () {
8559
+ var red = this.r / 255;
8560
+ var green = this.g / 255;
8561
+ var blue = this.b / 255;
8562
+ // find greatest and smallest channel values
8563
+ var max = Math.max(red, green, blue);
8564
+ var min = Math.min(red, green, blue);
8565
+ var hue = 0;
8566
+ var saturation = 0;
8567
+ var lightness = (max + min) / 2;
8568
+ // If min and max have the same values, it means
8569
+ // the given color is achromatic
8570
+ if (max === min) {
8571
+ return {
8572
+ h: 0,
8573
+ s: 0,
8574
+ l: lightness * 100,
8575
+ };
8576
+ }
8577
+ // Adding delta value of greatest and smallest channel values
8578
+ var delta = max - min;
8579
+ saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
8580
+ if (max === red) {
8581
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
8582
+ }
8583
+ else if (max === green) {
8584
+ hue = (blue - red) / delta + 2;
8585
+ }
8586
+ else if (max === blue) {
8587
+ hue = (red - green) / delta + 4;
8588
+ }
8589
+ hue /= 6;
8590
+ return {
8591
+ h: hue * 100,
8592
+ s: saturation * 100,
8593
+ l: lightness * 100,
8594
+ };
8595
+ };
8596
+ /**
8597
+ * Normalize the value to follow the min and max for RGB colors
8598
+ * min: 0
8599
+ * max: 255
8600
+ *
8601
+ * @private
8602
+ * @param {number} value
8603
+ * @returns {number}
8604
+ * @memberof Color
8605
+ */
8606
+ Color.prototype.clamp = function (value) {
8607
+ // Minimum RGB Value = 0;
8608
+ // Maximum RGB Value = 255;
8609
+ return Math.min(Math.max(value, 0), 255);
8610
+ };
8611
+ return Color;
8612
+ }());
8613
+
8614
+ var Solver = /** @class */ (function () {
8615
+ function Solver(target, options) {
8616
+ this.target = target;
8617
+ this.targetHSL = target.hsl();
8618
+ this.options = Object.assign({},
8619
+ // Adding default values for options
8620
+ {
8621
+ acceptanceLossPercentage: 5,
8622
+ maxChecks: 15,
8623
+ }, options);
8624
+ // All the calcs done by the library to generate
8625
+ // a CSS Filter are based on the color `#000`
8626
+ // in this case, `rgb(0, 0, 0)`
8627
+ // Please make sure the background of the element
8628
+ // is `#000` for better performance
8629
+ // and color similarity.
8630
+ this.reusedColor = new Color(0, 0, 0);
8631
+ }
8632
+ /**
8633
+ * Returns the solved values for the
8634
+ *
8635
+ * @returns {(SPSAPayload & { filter: string; })}
8636
+ * @memberof Solver
8637
+ */
8638
+ Solver.prototype.solve = function () {
8639
+ var result = this.solveNarrow(this.solveWide());
8640
+ return {
8641
+ values: result.values,
8642
+ called: result.called,
8643
+ loss: result.loss,
8644
+ filter: this.css(result.values),
8645
+ };
8646
+ };
8647
+ /**
8648
+ * Solve wide values based on the wide values for RGB and HSL values
8649
+ *
8650
+ * @private
8651
+ * @returns {SPSAPayload}
8652
+ * @memberof Solver
8653
+ */
8654
+ Solver.prototype.solveWide = function () {
8655
+ var A = 5;
8656
+ var c = 15;
8657
+ // Wide values for RGB and HSL values
8658
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8659
+ var a = [60, 180, 18000, 600, 1.2, 1.2];
8660
+ var best = { loss: Infinity };
8661
+ var counter = 0;
8662
+ while (best.loss > this.options.acceptanceLossPercentage) {
8663
+ var initialFilterValues = [50, 20, 3750, 50, 100, 100];
8664
+ var result = this.spsa({
8665
+ A: A,
8666
+ a: a,
8667
+ c: c,
8668
+ values: initialFilterValues,
8669
+ // for wide values we should use the double of tries in
8670
+ // comparison of `solveNarrow()` method
8671
+ maxTriesInLoop: 1000,
8672
+ });
8673
+ if (result.loss < best.loss) {
8674
+ best = result;
8675
+ }
8676
+ counter += 1;
8677
+ if (counter >= this.options.maxChecks) {
8678
+ break;
8679
+ }
8680
+ }
8681
+ return Object.assign({}, best, { called: counter });
8682
+ };
8683
+ /**
8684
+ * Solve narrow values based on the wide values for the filter
8685
+ *
8686
+ * @private
8687
+ * @param {SPSAPayload} wide
8688
+ * @returns {SPSAPayload}
8689
+ * @memberof Solver
8690
+ */
8691
+ Solver.prototype.solveNarrow = function (wide) {
8692
+ var A = wide.loss;
8693
+ var c = 2;
8694
+ var A1 = A + 1;
8695
+ // Narrow values for RGB and HSL values
8696
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8697
+ var a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];
8698
+ return this.spsa({
8699
+ A: A,
8700
+ a: a,
8701
+ c: c,
8702
+ values: wide.values,
8703
+ maxTriesInLoop: 500,
8704
+ called: wide.called,
8705
+ });
8706
+ };
8707
+ /**
8708
+ * Returns final value based on the current filter order
8709
+ * to get the order, please check the returned value
8710
+ * in `css()` method
8711
+ *
8712
+ * @private
8713
+ * @param {number} value
8714
+ * @param {number} idx
8715
+ * @returns {number}
8716
+ * @memberof Solver
8717
+ */
8718
+ Solver.prototype.fixValueByFilterIDX = function (value, idx) {
8719
+ var max = 100;
8720
+ // Fixing max, minimum and value by filter
8721
+ if (idx === 2 /* saturate */) {
8722
+ max = 7500;
8723
+ }
8724
+ else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {
8725
+ max = 200;
8726
+ }
8727
+ if (idx === 3 /* hue-rotate */) {
8728
+ if (value > max) {
8729
+ value %= max;
8730
+ }
8731
+ else if (value < 0) {
8732
+ value = max + (value % max);
8733
+ }
8734
+ }
8735
+ // Checking if value is below the minimum or above
8736
+ // the maximum allowed by filter
8737
+ else if (value < 0) {
8738
+ value = 0;
8739
+ }
8740
+ else if (value > max) {
8741
+ value = max;
8742
+ }
8743
+ return value;
8744
+ };
8745
+ Solver.prototype.spsa = function (_a) {
8746
+ var A = _a.A, a = _a.a, c = _a.c, values = _a.values, _b = _a.maxTriesInLoop, maxTriesInLoop = _b === void 0 ? 500 : _b, _c = _a.called, called = _c === void 0 ? 0 : _c;
8747
+ var alpha = 1;
8748
+ var gamma = 0.16666666666666666;
8749
+ var best = null;
8750
+ var bestLoss = Infinity;
8751
+ var deltas = new Array(6);
8752
+ var highArgs = new Array(6);
8753
+ var lowArgs = new Array(6);
8754
+ // Size of all CSS filters to be applied to get the correct color
8755
+ var filtersToBeAppliedSize = 6;
8756
+ for (var key = 0; key < maxTriesInLoop; key++) {
8757
+ var ck = c / Math.pow(key + 1, gamma);
8758
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8759
+ deltas[i] = Math.random() > 0.5 ? 1 : -1;
8760
+ highArgs[i] = values[i] + ck * deltas[i];
8761
+ lowArgs[i] = values[i] - ck * deltas[i];
8762
+ }
8763
+ var lossDiff = this.loss(highArgs) - this.loss(lowArgs);
8764
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8765
+ var g = (lossDiff / (2 * ck)) * deltas[i];
8766
+ var ak = a[i] / Math.pow(A + key + 1, alpha);
8767
+ values[i] = this.fixValueByFilterIDX(values[i] - ak * g, i);
8768
+ }
8769
+ var loss = this.loss(values);
8770
+ if (loss < bestLoss) {
8771
+ best = values.slice(0);
8772
+ bestLoss = loss;
8773
+ }
8774
+ }
8775
+ return { values: best, loss: bestLoss, called: called };
8776
+ };
8777
+ /**
8778
+ * Checks how much is the loss for the filter in RGB and HSL colors
8779
+ *
8780
+ * @private
8781
+ * @param {SPSAPayload['values']} filters
8782
+ * @returns {number}
8783
+ * @memberof Solver
8784
+ */
8785
+ Solver.prototype.loss = function (filters) {
8786
+ // Argument as an Array of percentages.
8787
+ var color = this.reusedColor;
8788
+ // Resetting the color to black in case
8789
+ // it was called more than once
8790
+ color.set(0, 0, 0);
8791
+ color.invert(filters[0] / 100);
8792
+ color.sepia(filters[1] / 100);
8793
+ color.saturate(filters[2] / 100);
8794
+ color.hueRotate(filters[3] * 3.6);
8795
+ color.brightness(filters[4] / 100);
8796
+ color.contrast(filters[5] / 100);
8797
+ var colorHSL = color.hsl();
8798
+ return (Math.abs(color.r - this.target.r) +
8799
+ Math.abs(color.g - this.target.g) +
8800
+ Math.abs(color.b - this.target.b) +
8801
+ Math.abs(colorHSL.h - this.targetHSL.h) +
8802
+ Math.abs(colorHSL.s - this.targetHSL.s) +
8803
+ Math.abs(colorHSL.l - this.targetHSL.l));
8804
+ };
8805
+ /**
8806
+ * Returns the CSS filter list for the received HEX color
8807
+ *
8808
+ * @private
8809
+ * @param {number[]} filters
8810
+ * @returns {string}
8811
+ * @memberof Solver
8812
+ */
8813
+ Solver.prototype.css = function (filters) {
8814
+ var formatCssFilterValueByMultiplier = function (idx, multiplier) {
8815
+ if (multiplier === void 0) { multiplier = 1; }
8816
+ return Math.round(filters[idx] * multiplier);
8817
+ };
8818
+ return [
8819
+ "invert(" + formatCssFilterValueByMultiplier(0) + "%)",
8820
+ "sepia(" + formatCssFilterValueByMultiplier(1) + "%)",
8821
+ "saturate(" + formatCssFilterValueByMultiplier(2) + "%)",
8822
+ "hue-rotate(" + formatCssFilterValueByMultiplier(3, 3.6) + "deg)",
8823
+ "brightness(" + formatCssFilterValueByMultiplier(4) + "%)",
8824
+ "contrast(" + formatCssFilterValueByMultiplier(5) + "%);",
8825
+ ].join(' ');
8826
+ };
8827
+ return Solver;
8828
+ }());
8829
+
8830
+ /**
8831
+ * Transform a CSS Color from Hexadecimal to RGB color
8832
+ *
8833
+ * @param {string} hex hexadecimal color
8834
+ * @returns {([number, number, number] | [])} array with the RGB colors or empty array
8835
+ */
8836
+ var hexToRgb = function (hex) {
8837
+ if (hex.length === 4) {
8838
+ return [parseInt("0x" + hex[1] + hex[1]), parseInt("0x" + hex[2] + hex[2]), parseInt("0x" + hex[3] + hex[3])];
8839
+ }
8840
+ if (hex.length === 7) {
8841
+ return [parseInt("0x" + hex[1] + hex[2]), parseInt("0x" + hex[3] + hex[4]), parseInt("0x" + hex[5] + hex[6])];
8842
+ }
8843
+ return [];
8844
+ };
8845
+ var isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); };
8846
+ // Memory cache for the computed results to avoid multiple
8847
+ // calculations for the same color
8848
+ var results = {};
8849
+ /**
8850
+ * A function that transforms a HEX color into CSS filters
8851
+ *
8852
+ * @param colorValue string hexadecimal color
8853
+ * @param opts HexToCssConfiguration function configuration
8854
+ *
8855
+ */
8856
+ var hexToCSSFilter = function (colorValue, opts) {
8857
+ var _a;
8858
+ if (opts === void 0) { opts = {}; }
8859
+ var red;
8860
+ var green;
8861
+ var blue;
8862
+ if (results[colorValue] && !opts.forceFilterRecalculation) {
8863
+ return Object.assign({}, results[colorValue], { cache: true });
8864
+ }
8865
+ var color;
8866
+ try {
8867
+ _a = __read(hexToRgb(colorValue), 3), red = _a[0], green = _a[1], blue = _a[2];
8868
+ if (!isNumeric(red) || !isNumeric(green) || !isNumeric(blue)) {
8869
+ throw new Error("hextToRgb returned an invalid value for '" + colorValue + "'");
8870
+ }
8871
+ color = new Color(Number(red), Number(green), Number(blue));
8872
+ }
8873
+ catch (error) {
8874
+ throw new Error("Color value should be in HEX format. " + error);
8875
+ }
8876
+ var solver = new Solver(color, Object.assign({},
8877
+ // `HexToCssConfiguration` Defaults
8878
+ {
8879
+ acceptanceLossPercentage: 5,
8880
+ maxChecks: 30,
8881
+ forceFilterRecalculation: false,
8882
+ }, opts));
8883
+ return (results[colorValue] = Object.assign({}, solver.solve(), {
8884
+ hex: colorValue,
8885
+ rgb: [red, green, blue],
8886
+ cache: false,
8887
+ }));
8888
+ };
8889
+ /**
8890
+ * A function that clears cached results
8891
+ *
8892
+ * @param {string} key? HEX string value passed previously `#24639C`. If not passed, it clears all cached results
8893
+ * @returns void
8894
+ */
8895
+ var clearCache = function (key) {
8896
+ if (!key) {
8897
+ results = {};
8898
+ }
8899
+ else if (results[key]) {
8900
+ delete results[key];
8901
+ }
8902
+ };
8903
+
8904
+ exports.clearCache = clearCache;
8905
+ exports.hexToCSSFilter = hexToCSSFilter;
8906
+
8907
+ Object.defineProperty(exports, '__esModule', { value: true });
8908
+
8909
+ })));
8910
+ });
8911
+
8372
8912
  function _extends() {
8373
8913
  _extends = Object.assign ? Object.assign.bind() : function (target) {
8374
8914
  for (var i = 1; i < arguments.length; i++) {
@@ -8475,6 +9015,14 @@ var toViewMode = function toViewMode(timeUnit) {
8475
9015
  return ViewMode.Year;
8476
9016
  }
8477
9017
  };
9018
+ var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
9019
+ switch (timeUnit) {
9020
+ case TimeUnit.YEAR:
9021
+ return 60 * 2;
9022
+ default:
9023
+ return 60;
9024
+ }
9025
+ };
8478
9026
  var convertPhaseToTask = function convertPhaseToTask(item) {
8479
9027
  var mapPhase = function mapPhase(_ref) {
8480
9028
  var phaseStart = _ref.startDate,
@@ -8485,7 +9033,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8485
9033
  phaseId = _ref.id,
8486
9034
  color = _ref.color,
8487
9035
  selectedColor = _ref.selectedColor,
8488
- dependencies = _ref.dependencies;
9036
+ dependencies = _ref.dependencies,
9037
+ icon = _ref.icon;
8489
9038
  var _validDates = validDates(phaseStart, phaseEnd),
8490
9039
  start = _validDates.start,
8491
9040
  end = _validDates.end;
@@ -8508,7 +9057,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8508
9057
  progressColor: color,
8509
9058
  backgroundSelectedColor: selectedColor,
8510
9059
  progressSelectedColor: selectedColor
8511
- } : {}
9060
+ } : {},
9061
+ icon: icon
8512
9062
  };
8513
9063
  };
8514
9064
  return mapPhase(item);
@@ -8539,7 +9089,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8539
9089
  var startDate = x.startDate,
8540
9090
  endDate = x.endDate,
8541
9091
  color = x.color,
8542
- selectedColor = x.selectedColor;
9092
+ selectedColor = x.selectedColor,
9093
+ icon = x.icon;
8543
9094
  var _validDates3 = validDates(startDate, endDate),
8544
9095
  start = _validDates3.start,
8545
9096
  end = _validDates3.end;
@@ -8547,7 +9098,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8547
9098
  start: start,
8548
9099
  end: end,
8549
9100
  backgroundColor: color != null ? color : "0xffffff",
8550
- backgroundSelectedColor: selectedColor != null ? selectedColor : color
9101
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color,
9102
+ icon: icon
8551
9103
  };
8552
9104
  };
8553
9105
  var defaultColor = "#595959";
@@ -8592,7 +9144,8 @@ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartD
8592
9144
  secondaryEnd: end2,
8593
9145
  progress: 100,
8594
9146
  isDisabled: false,
8595
- hideChildren: false
9147
+ hideChildren: false,
9148
+ icon: row.icon
8596
9149
  };
8597
9150
  var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
8598
9151
  return [mainTask].concat(children1);
@@ -9769,7 +10322,7 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9769
10322
  var _task$timeline;
9770
10323
  var y = taskYCoordinate(index, rowHeight, taskHeight);
9771
10324
  function convertFrameToTask(frame, j) {
9772
- var _frame$backgroundSele;
10325
+ var _frame$backgroundSele, _frame$icon;
9773
10326
  var _computeTypeAndXs2 = computeTypeAndXs(frame.start, frame.end, "task", dates, columnWidth, handleWidth, false),
9774
10327
  x1 = _computeTypeAndXs2.x1,
9775
10328
  x2 = _computeTypeAndXs2.x2;
@@ -9801,7 +10354,8 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9801
10354
  typeInternal: "timeline",
9802
10355
  x1: x1,
9803
10356
  x2: x2,
9804
- y: y
10357
+ y: y,
10358
+ icon: (_frame$icon = frame.icon) != null ? _frame$icon : undefined
9805
10359
  };
9806
10360
  }
9807
10361
  var _computeTypeAndXs3 = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, false),
@@ -10160,6 +10714,25 @@ var BarProgressHandle = function BarProgressHandle(_ref) {
10160
10714
  });
10161
10715
  };
10162
10716
 
10717
+ var TaskIcon = function TaskIcon(_ref) {
10718
+ var _ref$color = _ref.color,
10719
+ color = _ref$color === void 0 ? "#000000" : _ref$color,
10720
+ url = _ref.url,
10721
+ height = _ref.height,
10722
+ width = _ref.width,
10723
+ x = _ref.x,
10724
+ y = _ref.y;
10725
+ var cssFilter = hexToCssFilter.hexToCSSFilter(color);
10726
+ return react.createElement("image", {
10727
+ href: url,
10728
+ filter: cssFilter.filter.replace(";", ""),
10729
+ x: x,
10730
+ y: y,
10731
+ width: width,
10732
+ height: height
10733
+ });
10734
+ };
10735
+
10163
10736
  var Bar = function Bar(_ref) {
10164
10737
  var _task$x2secondary, _task$x1secondary;
10165
10738
  var task = _ref.task,
@@ -10217,7 +10790,14 @@ var Bar = function Bar(_ref) {
10217
10790
  onMouseDown: function onMouseDown(e) {
10218
10791
  onEventStart("progress", task, e);
10219
10792
  }
10220
- })));
10793
+ })), task.icon && task.icon.url && react.createElement(TaskIcon, {
10794
+ color: task.icon.color,
10795
+ url: task.icon.url,
10796
+ width: task.height / 2 + "px",
10797
+ height: task.height / 2 + "px",
10798
+ x: task.x1 + (task.x2 - task.x1) - task.height / 2 / 2,
10799
+ y: task.y - task.height / 2 / 2 / 2 + (showSecondaryDates ? task.height / 2 : 0)
10800
+ }));
10221
10801
  };
10222
10802
 
10223
10803
  var BarSmall = function BarSmall(_ref) {
@@ -10278,7 +10858,9 @@ var Timeline = function Timeline(_ref) {
10278
10858
  rx: 0,
10279
10859
  ry: 0
10280
10860
  }), task.barChildren.map(function (bar) {
10281
- return react.createElement("rect", {
10861
+ return react.createElement(react.Fragment, {
10862
+ key: bar.id + ".rf"
10863
+ }, react.createElement("rect", {
10282
10864
  style: {
10283
10865
  cursor: "pointer"
10284
10866
  },
@@ -10290,7 +10872,14 @@ var Timeline = function Timeline(_ref) {
10290
10872
  height: bar.height,
10291
10873
  rx: bar.barCornerRadius,
10292
10874
  ry: bar.barCornerRadius
10293
- });
10875
+ }), bar.icon && bar.icon.url && react.createElement(TaskIcon, {
10876
+ color: bar.icon.color,
10877
+ url: bar.icon.url,
10878
+ width: bar.height + "px",
10879
+ height: bar.height + "px",
10880
+ x: bar.x1 + (bar.x2 - bar.x1) - bar.height / 2,
10881
+ y: bar.y - bar.height / 2 / 2
10882
+ }));
10294
10883
  }));
10295
10884
  };
10296
10885
 
@@ -10327,7 +10916,7 @@ var TaskItem = function TaskItem(props) {
10327
10916
  setTaskItem(react.createElement(Bar, Object.assign({}, props)));
10328
10917
  break;
10329
10918
  }
10330
- }, [task, isSelected]);
10919
+ }, [task, isSelected, props]);
10331
10920
  react.useEffect(function () {
10332
10921
  if (textRef.current) {
10333
10922
  setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
@@ -10368,6 +10957,9 @@ var TaskItem = function TaskItem(props) {
10368
10957
  onClick: function onClick(e) {
10369
10958
  onEventStart("click", task, e);
10370
10959
  },
10960
+ onContextMenu: function onContextMenu(e) {
10961
+ onEventStart("contextmenu", task, e);
10962
+ },
10371
10963
  onFocus: function onFocus() {
10372
10964
  onEventStart("select", task);
10373
10965
  }
@@ -10408,6 +11000,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10408
11000
  onProgressChange = _ref.onProgressChange,
10409
11001
  onDoubleClick = _ref.onDoubleClick,
10410
11002
  onClick = _ref.onClick,
11003
+ onContextMenu = _ref.onContextMenu,
10411
11004
  onDelete = _ref.onDelete;
10412
11005
  var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
10413
11006
  var _useState = react.useState(0),
@@ -10569,6 +11162,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10569
11162
  } else if (action === "click") {
10570
11163
  var skipClick = !hasMovedHorizontally(event);
10571
11164
  skipClick && !!onClick && onClick(task);
11165
+ } else if (action === "contextmenu") {
11166
+ event.preventDefault();
11167
+ !!onContextMenu && onContextMenu(event, task);
10572
11168
  } else if (action === "move") {
10573
11169
  var _svg$current$getScree3;
10574
11170
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
@@ -10820,6 +11416,7 @@ var Gantt = function Gantt(_ref) {
10820
11416
  onProgressChange = _ref.onProgressChange,
10821
11417
  onDoubleClick = _ref.onDoubleClick,
10822
11418
  onClick = _ref.onClick,
11419
+ onContextMenu = _ref.onContextMenu,
10823
11420
  onDelete = _ref.onDelete,
10824
11421
  onSelect = _ref.onSelect,
10825
11422
  onExpanderClick = _ref.onExpanderClick;
@@ -10837,26 +11434,26 @@ var Gantt = function Gantt(_ref) {
10837
11434
  }),
10838
11435
  dateSetup = _useState[0],
10839
11436
  setDateSetup = _useState[1];
10840
- var _useState2 = react.useState(undefined),
10841
- currentViewDate = _useState2[0],
10842
- setCurrentViewDate = _useState2[1];
10843
- var _useState3 = react.useState(0),
10844
- taskListWidth = _useState3[0],
10845
- setTaskListWidth = _useState3[1];
10846
- var _useState4 = react.useState(0),
10847
- svgContainerWidth = _useState4[0],
10848
- setSvgContainerWidth = _useState4[1];
10849
- var _useState5 = react.useState(ganttHeight),
10850
- svgContainerHeight = _useState5[0],
10851
- setSvgContainerHeight = _useState5[1];
10852
- var _useState6 = react.useState([]),
10853
- barTasks = _useState6[0],
10854
- setBarTasks = _useState6[1];
10855
- var _useState7 = react.useState({
11437
+ var taskListWidth = react.useRef(0);
11438
+ var setTaskListWidth = function setTaskListWidth(width) {
11439
+ taskListWidth.current = width;
11440
+ };
11441
+ var svgContainerWidth = react.useRef(0);
11442
+ var setSvgContainerWidth = function setSvgContainerWidth(width) {
11443
+ svgContainerWidth.current = width;
11444
+ };
11445
+ var svgContainerHeight = react.useRef(ganttHeight);
11446
+ var setSvgContainerHeight = function setSvgContainerHeight(height) {
11447
+ svgContainerHeight.current = height;
11448
+ };
11449
+ var _useState2 = react.useState([]),
11450
+ barTasks = _useState2[0],
11451
+ setBarTasks = _useState2[1];
11452
+ var _useState3 = react.useState({
10856
11453
  action: ""
10857
11454
  }),
10858
- ganttEvent = _useState7[0],
10859
- setGanttEvent = _useState7[1];
11455
+ ganttEvent = _useState3[0],
11456
+ setGanttEvent = _useState3[1];
10860
11457
  var taskHeight = react.useMemo(function () {
10861
11458
  return rowHeight * barFill / 100;
10862
11459
  }, [rowHeight, barFill]);
@@ -10866,29 +11463,30 @@ var Gantt = function Gantt(_ref) {
10866
11463
  var timelineHeight = react.useMemo(function () {
10867
11464
  return rowHeight * timelineFill / 100;
10868
11465
  }, [rowHeight, timelineFill]);
10869
- var _useState8 = react.useState(),
10870
- selectedTask = _useState8[0],
10871
- setSelectedTask = _useState8[1];
10872
- var _useState9 = react.useState(null),
10873
- failedTask = _useState9[0],
10874
- setFailedTask = _useState9[1];
11466
+ var _useState4 = react.useState(),
11467
+ selectedTask = _useState4[0],
11468
+ setSelectedTask = _useState4[1];
11469
+ var _useState5 = react.useState(null),
11470
+ failedTask = _useState5[0],
11471
+ setFailedTask = _useState5[1];
10875
11472
  var svgWidth = dateSetup.dates.length * columnWidth;
10876
11473
  var ganttFullHeight = barTasks.length * rowHeight;
10877
- var _useState10 = react.useState(0),
10878
- scrollY = _useState10[0],
10879
- setScrollY = _useState10[1];
10880
- var _useState11 = react.useState(-1),
10881
- scrollX = _useState11[0],
10882
- setScrollX = _useState11[1];
10883
- var _useState12 = react.useState(false),
10884
- ignoreScrollEvent = _useState12[0],
10885
- setIgnoreScrollEvent = _useState12[1];
10886
- var _useState13 = react.useState(),
10887
- currentDateIndicatorContent = _useState13[0],
10888
- setCurrentDateIndicatorContent = _useState13[1];
10889
- var _useState14 = react.useState(),
10890
- projectionContent = _useState14[0],
10891
- setProjectionContent = _useState14[1];
11474
+ var _useState6 = react.useState(0),
11475
+ scrollY = _useState6[0],
11476
+ setScrollY = _useState6[1];
11477
+ var _useState7 = react.useState(-1),
11478
+ scrollX = _useState7[0],
11479
+ setScrollX = _useState7[1];
11480
+ var ignoreScrollEvent = react.useRef(false);
11481
+ var setIgnoreScrollEvent = function setIgnoreScrollEvent(value) {
11482
+ ignoreScrollEvent.current = value;
11483
+ };
11484
+ var _useState8 = react.useState(),
11485
+ currentDateIndicatorContent = _useState8[0],
11486
+ setCurrentDateIndicatorContent = _useState8[1];
11487
+ var _useState9 = react.useState(),
11488
+ projectionContent = _useState9[0],
11489
+ setProjectionContent = _useState9[1];
10892
11490
  react.useEffect(function () {
10893
11491
  window.addEventListener("gantt-sync-scroll-event", function (e) {
10894
11492
  if (e.detail.id !== id) {
@@ -10914,14 +11512,30 @@ var Gantt = function Gantt(_ref) {
10914
11512
  setScrollX(newDates.length * columnWidth);
10915
11513
  }
10916
11514
  }
10917
- setDateSetup({
10918
- dates: newDates,
10919
- viewMode: viewMode
10920
- });
11515
+ var set = false;
11516
+ if (dateSetup && dateSetup.dates) {
11517
+ var old = dateSetup.dates;
11518
+ if (old.length !== newDates.length) {
11519
+ set = true;
11520
+ } else {
11521
+ for (var i = 0; i < old.length; i++) {
11522
+ if (old[i].valueOf() !== newDates[i].valueOf()) {
11523
+ set = true;
11524
+ break;
11525
+ }
11526
+ }
11527
+ }
11528
+ }
11529
+ if (set) {
11530
+ setDateSetup({
11531
+ dates: newDates,
11532
+ viewMode: viewMode
11533
+ });
11534
+ }
10921
11535
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
10922
11536
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
10923
11537
  react.useEffect(function () {
10924
- if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
11538
+ if (viewMode === dateSetup.viewMode && viewDate) {
10925
11539
  var dates = dateSetup.dates;
10926
11540
  var index = dates.findIndex(function (d, i) {
10927
11541
  return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
@@ -10929,10 +11543,10 @@ var Gantt = function Gantt(_ref) {
10929
11543
  if (index === -1) {
10930
11544
  return;
10931
11545
  }
10932
- setCurrentViewDate(viewDate);
11546
+ setIgnoreScrollEvent(true);
10933
11547
  setScrollX(columnWidth * index);
10934
11548
  }
10935
- }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, currentViewDate, setCurrentViewDate]);
11549
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode]);
10936
11550
  react.useEffect(function () {
10937
11551
  var changedTask = ganttEvent.changedTask,
10938
11552
  action = ganttEvent.action;
@@ -10975,9 +11589,9 @@ var Gantt = function Gantt(_ref) {
10975
11589
  }, [taskListRef, listCellWidth]);
10976
11590
  react.useEffect(function () {
10977
11591
  if (wrapperRef.current) {
10978
- setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);
11592
+ setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth.current);
10979
11593
  }
10980
- }, [wrapperRef, taskListWidth]);
11594
+ }, [wrapperRef]);
10981
11595
  react.useEffect(function () {
10982
11596
  if (ganttHeight) {
10983
11597
  setSvgContainerHeight(ganttHeight + headerHeight);
@@ -11020,7 +11634,7 @@ var Gantt = function Gantt(_ref) {
11020
11634
  };
11021
11635
  }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
11022
11636
  var handleScrollY = function handleScrollY(event) {
11023
- if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
11637
+ if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent.current) {
11024
11638
  setScrollY(event.currentTarget.scrollTop);
11025
11639
  setIgnoreScrollEvent(true);
11026
11640
  } else {
@@ -11028,7 +11642,7 @@ var Gantt = function Gantt(_ref) {
11028
11642
  }
11029
11643
  };
11030
11644
  var handleScrollX = function handleScrollX(event) {
11031
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
11645
+ if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent.current) {
11032
11646
  setScrollX(event.currentTarget.scrollLeft);
11033
11647
  setIgnoreScrollEvent(true);
11034
11648
  window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
@@ -11188,6 +11802,7 @@ var Gantt = function Gantt(_ref) {
11188
11802
  onProgressChange: onProgressChange,
11189
11803
  onDoubleClick: onDoubleClick,
11190
11804
  onClick: onClick,
11805
+ onContextMenu: onContextMenu,
11191
11806
  onDelete: onDelete
11192
11807
  };
11193
11808
  var tableProps = {
@@ -11225,15 +11840,15 @@ var Gantt = function Gantt(_ref) {
11225
11840
  }), ganttEvent.changedTask && react.createElement(Tooltip, {
11226
11841
  arrowIndent: arrowIndent,
11227
11842
  rowHeight: rowHeight,
11228
- svgContainerHeight: svgContainerHeight,
11229
- svgContainerWidth: svgContainerWidth,
11843
+ svgContainerHeight: svgContainerHeight.current,
11844
+ svgContainerWidth: svgContainerWidth.current,
11230
11845
  fontFamily: fontFamily,
11231
11846
  fontSize: fontSize,
11232
11847
  scrollX: scrollX,
11233
11848
  scrollY: scrollY,
11234
11849
  task: ganttEvent.changedTask,
11235
11850
  headerHeight: headerHeight,
11236
- taskListWidth: taskListWidth,
11851
+ taskListWidth: taskListWidth.current,
11237
11852
  TooltipContent: TooltipContent,
11238
11853
  rtl: rtl,
11239
11854
  svgWidth: svgWidth
@@ -11247,7 +11862,7 @@ var Gantt = function Gantt(_ref) {
11247
11862
  })), react.createElement(HorizontalScroll, {
11248
11863
  svgWidth: svgWidth,
11249
11864
  taskGanttRef: taskGanttRef,
11250
- taskListWidth: taskListWidth,
11865
+ taskListWidth: taskListWidth.current,
11251
11866
  scroll: scrollX,
11252
11867
  rtl: rtl,
11253
11868
  onScroll: handleScrollX
@@ -11268,6 +11883,7 @@ var format = function format(date, locale, options) {
11268
11883
  } catch (e) {
11269
11884
  console.error("time-formatters.ts format", date, locale, options);
11270
11885
  console.error(e);
11886
+ return "FORMAT-ERR";
11271
11887
  }
11272
11888
  };
11273
11889
  var dayFormatter = function dayFormatter(date, locale) {
@@ -11340,7 +11956,8 @@ var ProjectRow = function ProjectRow(_ref) {
11340
11956
  fontFamily = _ref.fontFamily,
11341
11957
  fontSize = _ref.fontSize,
11342
11958
  setSelectedTask = _ref.setSelectedTask,
11343
- onclickTaskList = _ref.onclickTaskList;
11959
+ onclickTaskList = _ref.onclickTaskList,
11960
+ oncontextmenuTaskList = _ref.oncontextmenuTaskList;
11344
11961
  var str = "";
11345
11962
  for (var i = 0; i < valuesToShow.length; i++) {
11346
11963
  str += "1fr ";
@@ -11359,6 +11976,11 @@ var ProjectRow = function ProjectRow(_ref) {
11359
11976
  onClick: function onClick() {
11360
11977
  setSelectedTask(id);
11361
11978
  onclickTaskList(id);
11979
+ },
11980
+ onContextMenu: function onContextMenu(e) {
11981
+ e.preventDefault();
11982
+ setSelectedTask(id);
11983
+ oncontextmenuTaskList(e, id);
11362
11984
  }
11363
11985
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11364
11986
  return react.createElement("span", {
@@ -11380,7 +12002,8 @@ var SubRow = function SubRow(_ref2) {
11380
12002
  fontFamily = _ref2.fontFamily,
11381
12003
  fontSize = _ref2.fontSize,
11382
12004
  setSelectedTask = _ref2.setSelectedTask,
11383
- onclickTaskList = _ref2.onclickTaskList;
12005
+ onclickTaskList = _ref2.onclickTaskList,
12006
+ oncontextmenuTaskList = _ref2.oncontextmenuTaskList;
11384
12007
  var str = "";
11385
12008
  for (var i = 0; i < valuesToShow.length + 1; i++) {
11386
12009
  str += "1fr ";
@@ -11399,6 +12022,11 @@ var SubRow = function SubRow(_ref2) {
11399
12022
  onClick: function onClick() {
11400
12023
  setSelectedTask(id);
11401
12024
  onclickTaskList(id);
12025
+ },
12026
+ onContextMenu: function onContextMenu(e) {
12027
+ e.preventDefault();
12028
+ setSelectedTask(id);
12029
+ oncontextmenuTaskList(e, id);
11402
12030
  }
11403
12031
  }, react.createElement("span", {
11404
12032
  key: "phase_" + id + "_valuesToShow_color",
@@ -11422,7 +12050,9 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11422
12050
  rowHeight = _ref3.rowHeight,
11423
12051
  rowWidth = _ref3.rowWidth,
11424
12052
  fontFamily = _ref3.fontFamily,
11425
- fontSize = _ref3.fontSize;
12053
+ fontSize = _ref3.fontSize,
12054
+ setSelectedTask = _ref3.setSelectedTask,
12055
+ oncontextmenuTaskList = _ref3.oncontextmenuTaskList;
11426
12056
  var str = "";
11427
12057
  for (var i = 0; i < valuesToShow.length; i++) {
11428
12058
  str += "1fr ";
@@ -11437,7 +12067,12 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11437
12067
  return react.createElement("div", {
11438
12068
  key: "detail_" + id,
11439
12069
  className: styles$9.timeline,
11440
- style: customStyle
12070
+ style: customStyle,
12071
+ onContextMenu: function onContextMenu(e) {
12072
+ e.preventDefault();
12073
+ setSelectedTask(id);
12074
+ oncontextmenuTaskList(e, id);
12075
+ }
11441
12076
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11442
12077
  return react.createElement("span", {
11443
12078
  className: index === 0 ? styles$9.main : undefined,
@@ -11446,7 +12081,7 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11446
12081
  }, v);
11447
12082
  }));
11448
12083
  };
11449
- var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
12084
+ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, oncontextmenuTaskList, id) {
11450
12085
  var CustomTaskListTable = function CustomTaskListTable(_ref4) {
11451
12086
  var rowHeight = _ref4.rowHeight,
11452
12087
  rowWidth = _ref4.rowWidth,
@@ -11468,7 +12103,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11468
12103
  fontFamily: fontFamily,
11469
12104
  fontSize: fontSize,
11470
12105
  setSelectedTask: setSelectedTask,
11471
- onclickTaskList: onclickTaskList
12106
+ onclickTaskList: onclickTaskList,
12107
+ oncontextmenuTaskList: oncontextmenuTaskList
11472
12108
  }), task.type === "task" && react.createElement(SubRow, {
11473
12109
  key: task.id + "_" + task.type,
11474
12110
  task: task,
@@ -11477,7 +12113,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11477
12113
  fontFamily: fontFamily,
11478
12114
  fontSize: fontSize,
11479
12115
  setSelectedTask: setSelectedTask,
11480
- onclickTaskList: onclickTaskList
12116
+ onclickTaskList: onclickTaskList,
12117
+ oncontextmenuTaskList: oncontextmenuTaskList
11481
12118
  }), task.type === "timeline" && react.createElement(TimelineSubRow, {
11482
12119
  key: task.id + "_" + task.type,
11483
12120
  task: task,
@@ -11486,7 +12123,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11486
12123
  fontFamily: fontFamily,
11487
12124
  fontSize: fontSize,
11488
12125
  setSelectedTask: setSelectedTask,
11489
- onclickTaskList: onclickTaskList
12126
+ onclickTaskList: onclickTaskList,
12127
+ oncontextmenuTaskList: oncontextmenuTaskList
11490
12128
  }));
11491
12129
  }));
11492
12130
  };
@@ -11549,24 +12187,27 @@ var Planner = function Planner(props) {
11549
12187
  var _useState = react.useState(TimeUnit.MONTH),
11550
12188
  timeUnit = _useState[0],
11551
12189
  setTimeUnit = _useState[1];
11552
- var _useState2 = react.useState(props.mainGantt.items),
11553
- currentTasks = _useState2[0],
11554
- setCurrentTasks = _useState2[1];
11555
- var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
11556
- currentDetails = _useState3[0],
11557
- setCurrentDetails = _useState3[1];
11558
- var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
11559
- mainGanttDoubleView = _useState4[0],
11560
- setMainGanttDoubleView = _useState4[1];
11561
- var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
11562
- displayedDates = _useState5[0],
11563
- setDisplayedDates = _useState5[1];
11564
- var _useState6 = react.useState(),
11565
- viewDate = _useState6[0],
11566
- setViewDate = _useState6[1];
11567
- var _useState7 = react.useState(),
11568
- projection = _useState7[0],
11569
- setProjection = _useState7[1];
12190
+ var currentTasks = react.useRef(props.mainGantt.items);
12191
+ var setCurrentTasks = function setCurrentTasks(tasks) {
12192
+ currentTasks.current = tasks;
12193
+ };
12194
+ var currentDetails = react.useRef((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items);
12195
+ var setCurrentDetails = function setCurrentDetails(details) {
12196
+ currentDetails.current = details;
12197
+ };
12198
+ var _useState2 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12199
+ mainGanttDoubleView = _useState2[0],
12200
+ setMainGanttDoubleView = _useState2[1];
12201
+ var displayedDates = react.useRef(calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount));
12202
+ var setDisplayedDates = function setDisplayedDates(dates) {
12203
+ displayedDates.current = dates;
12204
+ };
12205
+ var _useState3 = react.useState(),
12206
+ viewDate = _useState3[0],
12207
+ setViewDate = _useState3[1];
12208
+ var _useState4 = react.useState(),
12209
+ projection = _useState4[0],
12210
+ setProjection = _useState4[1];
11570
12211
  var locale = "it-IT";
11571
12212
  var handleClick = function handleClick(row, onClick) {
11572
12213
  if (!row) {
@@ -11585,6 +12226,28 @@ var Planner = function Planner(props) {
11585
12226
  }
11586
12227
  onClick === null || onClick === void 0 ? void 0 : onClick(row);
11587
12228
  };
12229
+ var handleContextMenu = function handleContextMenu(event, row, onContextMenu) {
12230
+ if (!row) {
12231
+ return;
12232
+ }
12233
+ if (row.type === "task" && props.secondaryGantt) {
12234
+ var _phase$color2;
12235
+ var phase = row;
12236
+ setProjection({
12237
+ start: new Date(phase.startDate),
12238
+ end: new Date(phase.endDate),
12239
+ color: (_phase$color2 = phase.color) != null ? _phase$color2 : "#ED7D31"
12240
+ });
12241
+ } else {
12242
+ setProjection(undefined);
12243
+ }
12244
+ onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event, row);
12245
+ };
12246
+ var handleSetDoubleView = function handleSetDoubleView(checked) {
12247
+ var _props$onSetDoubleVie;
12248
+ setMainGanttDoubleView(checked);
12249
+ (_props$onSetDoubleVie = props.onSetDoubleView) === null || _props$onSetDoubleVie === void 0 ? void 0 : _props$onSetDoubleVie.call(props, checked);
12250
+ };
11588
12251
  var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
11589
12252
  var id = task === null || task === void 0 ? void 0 : task.id;
11590
12253
  if (!id) {
@@ -11642,26 +12305,32 @@ var Planner = function Planner(props) {
11642
12305
  setProjection(undefined);
11643
12306
  }, [props]);
11644
12307
  react.useEffect(function () {
11645
- var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
12308
+ var dates = calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount);
11646
12309
  setDisplayedDates(dates);
11647
12310
  if (!viewDate) {
11648
- setViewDate(dates.displayedStartDate);
12311
+ var now = new Date();
12312
+ if (dates.displayedStartDate <= now && dates.displayedEndDate >= now) {
12313
+ setViewDate(now);
12314
+ } else {
12315
+ setViewDate(dates.displayedStartDate);
12316
+ }
11649
12317
  }
11650
- }, [currentTasks, currentDetails]);
12318
+ }, [timeUnit, mainGanttDoubleView, props.preStepsCount, viewDate]);
11651
12319
  var tasks = [];
11652
- for (var i = 0; i < currentTasks.length; i++) {
11653
- tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12320
+ for (var i = 0; i < currentTasks.current.length; i++) {
12321
+ tasks.push.apply(tasks, convertProjectToTasks(currentTasks.current[i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11654
12322
  }
11655
12323
  var details = [];
11656
- if (currentDetails) {
11657
- for (var _i = 0; _i < currentDetails.length; _i++) {
11658
- details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12324
+ if (currentDetails.current) {
12325
+ for (var _i = 0; _i < currentDetails.current.length; _i++) {
12326
+ details.push.apply(details, convertProjectToTasks(currentDetails.current[_i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11659
12327
  }
11660
12328
  }
11661
12329
  console.log("PLANNER render");
11662
12330
  return react.createElement("div", null, react.createElement(Switcher, {
11663
12331
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
11664
- return setTimeUnit(timeUnit);
12332
+ setTimeUnit(timeUnit);
12333
+ setViewDate(undefined);
11665
12334
  }
11666
12335
  }), react.createElement("div", {
11667
12336
  style: {
@@ -11676,34 +12345,52 @@ var Planner = function Planner(props) {
11676
12345
  showSecondaryDates: mainGanttDoubleView,
11677
12346
  hideDependencies: props.mainGantt.hideDependencies,
11678
12347
  ganttHeight: props.mainGantt.ganttHeight,
11679
- displayedStartDate: displayedDates.displayedStartDate,
11680
- displayedEndDate: displayedDates.displayedEndDate,
12348
+ displayedStartDate: displayedDates.current.displayedStartDate,
12349
+ displayedEndDate: displayedDates.current.displayedEndDate,
11681
12350
  viewDate: viewDate,
11682
12351
  tasks: tasks,
12352
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11683
12353
  viewMode: toViewMode(timeUnit)
11684
12354
  }, props.mainGantt.stylingOptions, {
11685
- TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView),
12355
+ TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, handleSetDoubleView),
11686
12356
  TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
11687
- var row = getProjectById(id, currentTasks);
12357
+ var row = getProjectById(id, currentTasks.current);
11688
12358
  if (!row) {
11689
- row = getPhaseById(id, currentTasks);
12359
+ row = getPhaseById(id, currentTasks.current);
11690
12360
  }
11691
12361
  if (row) {
11692
12362
  handleClick(row, props.mainGantt.onClick);
11693
12363
  }
12364
+ }, function (event, id) {
12365
+ var row = getProjectById(id, currentTasks.current);
12366
+ if (!row) {
12367
+ row = getPhaseById(id, currentTasks.current);
12368
+ }
12369
+ if (row) {
12370
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12371
+ }
11694
12372
  }, MAIN_GANTT_ID),
11695
12373
  TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
11696
- onClick: function onClick(e) {
11697
- var row = getProjectById(e.id, currentTasks);
12374
+ onClick: function onClick(task) {
12375
+ var row = getProjectById(task.id, currentTasks.current);
11698
12376
  if (!row) {
11699
- row = getPhaseById(e.id, currentTasks);
12377
+ row = getPhaseById(task.id, currentTasks.current);
11700
12378
  }
11701
12379
  if (row) {
11702
12380
  handleClick(row, props.mainGantt.onClick);
11703
12381
  }
11704
12382
  },
11705
- onDateChange: function onDateChange(e) {
11706
- return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
12383
+ onContextMenu: function onContextMenu(event, task) {
12384
+ var row = getProjectById(task.id, currentTasks.current);
12385
+ if (!row) {
12386
+ row = getPhaseById(task.id, currentTasks.current);
12387
+ }
12388
+ if (row) {
12389
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12390
+ }
12391
+ },
12392
+ onDateChange: function onDateChange(task) {
12393
+ return handleDateChange(task, currentTasks.current, props.mainGantt.onDateChange);
11707
12394
  },
11708
12395
  locale: locale,
11709
12396
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11715,29 +12402,45 @@ var Planner = function Planner(props) {
11715
12402
  showSecondaryDates: mainGanttDoubleView,
11716
12403
  hideDependencies: props.secondaryGantt.hideDependencies,
11717
12404
  ganttHeight: props.secondaryGantt.ganttHeight,
11718
- displayedStartDate: displayedDates.displayedStartDate,
11719
- displayedEndDate: displayedDates.displayedEndDate,
12405
+ displayedStartDate: displayedDates.current.displayedStartDate,
12406
+ displayedEndDate: displayedDates.current.displayedEndDate,
11720
12407
  viewDate: viewDate,
11721
12408
  tasks: details,
12409
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11722
12410
  viewMode: toViewMode(timeUnit)
11723
12411
  }, props.mainGantt.stylingOptions, {
11724
12412
  TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
11725
12413
  TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
11726
12414
  console.log("planner.tsx secondaryGantt Clicked on " + id);
12415
+ }, function (event, id) {
12416
+ if (props.secondaryGantt) {
12417
+ var row = getProjectById(id, currentDetails.current);
12418
+ if (row) {
12419
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12420
+ }
12421
+ }
11727
12422
  }, SECONDARY_GANTT_ID),
11728
12423
  TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
11729
12424
  projection: projection,
11730
- onClick: function onClick(e) {
12425
+ onClick: function onClick(task) {
11731
12426
  if (props.secondaryGantt) {
11732
- var row = getProjectById(e.id, currentDetails);
12427
+ var row = getProjectById(task.id, currentDetails.current);
11733
12428
  if (row) {
11734
12429
  handleClick(row, props.secondaryGantt.onClick);
11735
12430
  }
11736
12431
  }
11737
12432
  },
11738
- onDateChange: function onDateChange(e) {
12433
+ onContextMenu: function onContextMenu(event, task) {
12434
+ if (props.secondaryGantt) {
12435
+ var row = getProjectById(task.id, currentDetails.current);
12436
+ if (row) {
12437
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12438
+ }
12439
+ }
12440
+ },
12441
+ onDateChange: function onDateChange(task) {
11739
12442
  var _props$secondaryGantt7;
11740
- return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
12443
+ return handleDateChange(task, currentDetails.current, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
11741
12444
  },
11742
12445
  locale: locale,
11743
12446
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11796,15 +12499,8 @@ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValu
11796
12499
  return valuesToShow;
11797
12500
  }
11798
12501
 
11799
- 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}";
12502
+ const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
11800
12503
 
11801
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11802
- if (kind === "a" && !f)
11803
- throw new TypeError("Private accessor was defined without a getter");
11804
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
11805
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
11806
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11807
- };
11808
12504
  var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11809
12505
  if (kind === "m")
11810
12506
  throw new TypeError("Private method is not writable");
@@ -11814,21 +12510,31 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
11814
12510
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
11815
12511
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11816
12512
  };
11817
- 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;
12513
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12514
+ if (kind === "a" && !f)
12515
+ throw new TypeError("Private accessor was defined without a getter");
12516
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12517
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
12518
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12519
+ };
12520
+ var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_lastOnChangeReceived, _KupPlanner_rootPlanner, _KupPlanner_phases, _KupPlanner_showSecondaryDatesLocal, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_handleOnContextMenuOnTask, _KupPlanner_handleOnContextMenuOnPhase, _KupPlanner_handleOnContextMenuOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter, _KupPlanner_getIconUrl, _KupPlanner_getIconColor;
11818
12521
  const KupPlanner = class {
11819
12522
  constructor(hostRef) {
11820
12523
  registerInstance(this, hostRef);
11821
12524
  this.kupClick = createEvent(this, "kup-planner-click", 6);
11822
12525
  this.kupDateChange = createEvent(this, "kup-planner-datechange", 6);
11823
12526
  this.kupReady = createEvent(this, "kup-planner-ready", 6);
12527
+ this.kupContextMenu = createEvent(this, "kup-planner-contextmenu", 6);
11824
12528
  _KupPlanner_instances.add(this);
11825
12529
  /*-------------------------------------------------*/
11826
12530
  /* I n t e r n a l V a r i a b l e s */
11827
12531
  /*-------------------------------------------------*/
11828
12532
  _KupPlanner_kupManager.set(this, kupManagerInstance());
11829
- _KupPlanner_rootPlanner.set(this, void 0);
11830
12533
  _KupPlanner_lastOnChangeReceived.set(this, void 0);
11831
- this.plannerProps = undefined;
12534
+ _KupPlanner_rootPlanner.set(this, void 0);
12535
+ _KupPlanner_phases.set(this, {});
12536
+ // no re-render
12537
+ _KupPlanner_showSecondaryDatesLocal.set(this, false);
11832
12538
  this.customStyle = '';
11833
12539
  this.data = undefined;
11834
12540
  this.detailData = undefined;
@@ -11836,6 +12542,7 @@ const KupPlanner = class {
11836
12542
  this.detailColumns = undefined;
11837
12543
  this.detailDates = undefined;
11838
12544
  this.detailHeight = undefined;
12545
+ this.detailIconCol = undefined;
11839
12546
  this.detailIdCol = undefined;
11840
12547
  this.detailNameCol = undefined;
11841
12548
  this.detailPrevDates = undefined;
@@ -11845,6 +12552,7 @@ const KupPlanner = class {
11845
12552
  this.phaseColumns = undefined;
11846
12553
  this.phaseColParDep = undefined;
11847
12554
  this.phaseDates = undefined;
12555
+ this.phaseIconCol = undefined;
11848
12556
  this.phaseIdCol = undefined;
11849
12557
  this.phaseNameCol = undefined;
11850
12558
  this.phasePrevDates = undefined;
@@ -11852,26 +12560,23 @@ const KupPlanner = class {
11852
12560
  this.taskColumns = undefined;
11853
12561
  this.taskDates = undefined;
11854
12562
  this.taskHeight = undefined;
12563
+ this.taskIconCol = undefined;
11855
12564
  this.taskIdCol = undefined;
11856
12565
  this.taskNameCol = undefined;
11857
12566
  this.taskPrevDates = undefined;
11858
12567
  this.titleMess = undefined;
12568
+ this.plannerProps = undefined;
11859
12569
  }
11860
- onKupClick(event, taskAction) {
11861
- this.kupClick.emit({
11862
- comp: this,
11863
- id: this.rootElement.id,
11864
- value: event,
11865
- taskAction: taskAction,
11866
- });
12570
+ dataChanged() {
12571
+ __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
11867
12572
  }
11868
- onKupDateChange(event, taskAction) {
11869
- this.kupDateChange.emit({
11870
- comp: this,
11871
- id: this.rootElement.id,
11872
- value: event,
11873
- taskAction: taskAction,
11874
- });
12573
+ showSecondaryDatesChanged() {
12574
+ var _a;
12575
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12576
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12577
+ this.plannerProps.mainGantt.showSecondaryDates =
12578
+ this.showSecondaryDates;
12579
+ }
11875
12580
  }
11876
12581
  /*-------------------------------------------------*/
11877
12582
  /* P u b l i c M e t h o d s */
@@ -11906,6 +12611,7 @@ const KupPlanner = class {
11906
12611
  var _a;
11907
12612
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11908
12613
  if (task) {
12614
+ __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
11909
12615
  task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]])).map((row) => {
11910
12616
  const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
11911
12617
  const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
@@ -11913,6 +12619,8 @@ const KupPlanner = class {
11913
12619
  : col == this.phaseDates[1]
11914
12620
  ? '#END#'
11915
12621
  : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12622
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12623
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
11916
12624
  let phase = {
11917
12625
  taskRow: task.taskRow,
11918
12626
  phaseRow: row,
@@ -11929,48 +12637,22 @@ const KupPlanner = class {
11929
12637
  selectedColor: row.cells[this.phaseColorCol].value,
11930
12638
  valuesToShow: valuesToShow,
11931
12639
  rowType: KupPlannerGanttRowType.PHASE,
12640
+ icon: iconUrl
12641
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12642
+ : undefined,
11932
12643
  };
11933
12644
  return phase;
11934
12645
  });
11935
12646
  }
11936
12647
  this.plannerProps = Object.assign({}, this.plannerProps);
11937
12648
  }
11938
- handleOnClick(nativeEvent) {
11939
- console.log('kup-planner.handleOnClick', nativeEvent);
11940
- switch (nativeEvent.rowType) {
11941
- case KupPlannerGanttRowType.TASK:
11942
- const taskAction = nativeEvent.phases
11943
- ? KupPlannerTaskAction.onTaskClosing
11944
- : KupPlannerTaskAction.onTaskOpening;
11945
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
11946
- this.onKupClick(nativeEvent, taskAction);
11947
- }
11948
- break;
11949
- case KupPlannerGanttRowType.PHASE:
11950
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
11951
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11952
- }
11953
- break;
11954
- case KupPlannerGanttRowType.DETAIL:
11955
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
11956
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11957
- }
11958
- break;
11959
- }
11960
- }
11961
- handleOnDateChange(nativeEvent) {
11962
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
11963
- if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
11964
- console.log('kup-planner.handleOnDateChange', nativeEvent);
11965
- this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
11966
- }
11967
- }
11968
- }
12649
+ //---- Lifecycle hooks ----
11969
12650
  componentWillLoad() {
11970
12651
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
11971
12652
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
11972
12653
  }
11973
12654
  componentDidLoad() {
12655
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
11974
12656
  let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
11975
12657
  if (details && details.length == 0) {
11976
12658
  details = undefined;
@@ -11989,8 +12671,9 @@ const KupPlanner = class {
11989
12671
  filter: mainFilter,
11990
12672
  hideLabel: true,
11991
12673
  ganttHeight: this.taskHeight,
11992
- showSecondaryDates: this.showSecondaryDates,
12674
+ showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_showSecondaryDatesLocal, "f"),
11993
12675
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12676
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
11994
12677
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11995
12678
  },
11996
12679
  secondaryGantt: details
@@ -12002,9 +12685,11 @@ const KupPlanner = class {
12002
12685
  hideLabel: true,
12003
12686
  ganttHeight: this.detailHeight,
12004
12687
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12688
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12005
12689
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12006
12690
  }
12007
12691
  : undefined,
12692
+ onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
12008
12693
  };
12009
12694
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12010
12695
  this.kupReady.emit({
@@ -12020,9 +12705,116 @@ const KupPlanner = class {
12020
12705
  componentDidRender() {
12021
12706
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12022
12707
  }
12708
+ onKupClick(event, taskAction) {
12709
+ this.kupClick.emit({
12710
+ comp: this,
12711
+ id: this.rootElement.id,
12712
+ value: event,
12713
+ taskAction: taskAction,
12714
+ });
12715
+ }
12716
+ onKupContextMenu(event, ganttRow, taskAction) {
12717
+ let row;
12718
+ let cell;
12719
+ let column;
12720
+ switch (ganttRow.type) {
12721
+ case 'project': {
12722
+ row = ganttRow.taskRow;
12723
+ cell = row.cells[this.taskIdCol];
12724
+ column = this.data.columns[this.taskIdCol];
12725
+ break;
12726
+ }
12727
+ case 'task': {
12728
+ row = ganttRow.phaseRow;
12729
+ cell = row.cells[this.phaseIdCol];
12730
+ //column = this.data.columns[this.taskIdCol];
12731
+ break;
12732
+ }
12733
+ case 'timeline': {
12734
+ row = ganttRow.detailRow;
12735
+ cell = row.cells[this.detailIdCol];
12736
+ column = this.data.columns[this.detailIdCol];
12737
+ break;
12738
+ }
12739
+ }
12740
+ this.kupContextMenu.emit({
12741
+ comp: this,
12742
+ id: this.rootElement.id,
12743
+ value: ganttRow,
12744
+ taskAction: taskAction,
12745
+ details: {
12746
+ cell: cell,
12747
+ column: column,
12748
+ originalEvent: event,
12749
+ row: row,
12750
+ },
12751
+ });
12752
+ }
12753
+ onKupDateChange(event, taskAction) {
12754
+ this.kupDateChange.emit({
12755
+ comp: this,
12756
+ id: this.rootElement.id,
12757
+ value: event,
12758
+ taskAction: taskAction,
12759
+ });
12760
+ }
12761
+ handleOnClick(nativeEvent) {
12762
+ switch (nativeEvent.rowType) {
12763
+ case KupPlannerGanttRowType.TASK:
12764
+ const taskAction = nativeEvent.phases
12765
+ ? KupPlannerTaskAction.onTaskClosing
12766
+ : KupPlannerTaskAction.onTaskOpening;
12767
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12768
+ this.onKupClick(nativeEvent, taskAction);
12769
+ }
12770
+ break;
12771
+ case KupPlannerGanttRowType.PHASE:
12772
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12773
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12774
+ }
12775
+ break;
12776
+ case KupPlannerGanttRowType.DETAIL:
12777
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12778
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12779
+ }
12780
+ break;
12781
+ }
12782
+ }
12783
+ handleOnContextMenu(event, row) {
12784
+ switch (row.rowType) {
12785
+ case KupPlannerGanttRowType.TASK:
12786
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12787
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12788
+ }
12789
+ break;
12790
+ case KupPlannerGanttRowType.PHASE:
12791
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12792
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12793
+ }
12794
+ break;
12795
+ case KupPlannerGanttRowType.DETAIL:
12796
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12797
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12798
+ }
12799
+ break;
12800
+ }
12801
+ }
12802
+ handleOnSetDoubleView(checked) {
12803
+ var _a;
12804
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, checked, "f");
12805
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12806
+ this.plannerProps.mainGantt.showSecondaryDates = checked;
12807
+ }
12808
+ }
12809
+ handleOnDateChange(nativeEvent) {
12810
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12811
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12812
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12813
+ }
12814
+ }
12815
+ }
12023
12816
  render() {
12024
12817
  var _a;
12025
- //console.log('kup-planner.tsx render');
12026
12818
  return (h(Host, null, h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId, style: { maxWidth: this.maxWidth } }), h(FTextField, { icon: KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12027
12819
  if (e.key === 'Enter') {
12028
12820
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
@@ -12037,8 +12829,12 @@ const KupPlanner = class {
12037
12829
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12038
12830
  }
12039
12831
  get rootElement() { return getElement(this); }
12832
+ static get watchers() { return {
12833
+ "data": ["dataChanged"],
12834
+ "showSecondaryDates": ["showSecondaryDatesChanged"]
12835
+ }; }
12040
12836
  };
12041
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12837
+ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_phases = new WeakMap(), _KupPlanner_showSecondaryDatesLocal = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12042
12838
  var _a;
12043
12839
  (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12044
12840
  const componentWrapperElement = this.rootElement.shadowRoot.getElementById(componentWrapperId);
@@ -12050,7 +12846,13 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12050
12846
  var _a;
12051
12847
  let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]])).map((row) => {
12052
12848
  const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12053
- const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12849
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12850
+ ? '#START#'
12851
+ : col == this.taskDates[1]
12852
+ ? '#END#'
12853
+ : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12854
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
12855
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
12054
12856
  let task = {
12055
12857
  taskRow: row,
12056
12858
  taskRowId: row.id,
@@ -12063,6 +12865,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12063
12865
  type: 'project',
12064
12866
  valuesToShow: valuesToShow,
12065
12867
  rowType: KupPlannerGanttRowType.TASK,
12868
+ icon: iconUrl
12869
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12870
+ : undefined,
12066
12871
  };
12067
12872
  return task;
12068
12873
  });
@@ -12085,6 +12890,7 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12085
12890
  detail = {
12086
12891
  id: detailId,
12087
12892
  name: detailNameId,
12893
+ detailRow: row,
12088
12894
  type: 'timeline',
12089
12895
  valuesToShow: valuesToShow,
12090
12896
  rowType: KupPlannerGanttRowType.DETAIL,
@@ -12092,6 +12898,8 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12092
12898
  };
12093
12899
  details.push(detail);
12094
12900
  }
12901
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
12902
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
12095
12903
  detail.schedule.push({
12096
12904
  startDate: datesSanitized.dateValues[0],
12097
12905
  endDate: datesSanitized.dateValues[1],
@@ -12101,6 +12909,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12101
12909
  selectedColor: this.detailColorCol
12102
12910
  ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12103
12911
  : '#D9D9D8',
12912
+ icon: iconUrl
12913
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12914
+ : undefined,
12104
12915
  });
12105
12916
  });
12106
12917
  return details;
@@ -12110,9 +12921,6 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12110
12921
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12111
12922
  if (task)
12112
12923
  task.phases = undefined;
12113
- // this.plannerProps.mainGantt = JSON.parse(
12114
- // JSON.stringify(this.plannerProps.mainGantt)
12115
- // );
12116
12924
  this.plannerProps = Object.assign({}, this.plannerProps);
12117
12925
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
12118
12926
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -12124,6 +12932,12 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12124
12932
  return true;
12125
12933
  }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12126
12934
  return true;
12935
+ }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
12936
+ return true;
12937
+ }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
12938
+ return true;
12939
+ }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
12940
+ return true;
12127
12941
  }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
12128
12942
  let emitEvent = false;
12129
12943
  if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
@@ -12142,19 +12956,28 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12142
12956
  };
12143
12957
  const value = e.target.value;
12144
12958
  const data = isDetail ? this.detailData : this.data;
12959
+ const tempRows = [];
12145
12960
  for (let index = 0; index < data.rows.length; index++) {
12146
12961
  const row = data.rows[index];
12147
- const valuesToShow = isDetail
12148
- ? getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns)
12149
- : getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12150
- for (let index = 0; index < valuesToShow.length; index++) {
12151
- const valueToShow = valuesToShow[index];
12152
- if (valueToShow.toLowerCase().indexOf(value.toLowerCase()) > -1) {
12153
- tempData.rows.push(row);
12154
- break;
12962
+ const cells = row.cells;
12963
+ for (let index = 0; index < data.columns.length; index++) {
12964
+ const column = data.columns[index];
12965
+ const cell = cells[column.name];
12966
+ if (cell) {
12967
+ const dValue = getCellValueForDisplay(data.columns[index], cell);
12968
+ const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
12969
+ if (found) {
12970
+ tempRows.push({ row, weight: index });
12971
+ break;
12972
+ }
12155
12973
  }
12156
12974
  }
12157
12975
  }
12976
+ tempRows
12977
+ .sort((a, b) => a.weight - b.weight)
12978
+ .forEach((tempRow) => {
12979
+ tempData.rows.push(tempRow.row);
12980
+ });
12158
12981
  const newGantt = isDetail
12159
12982
  ? {
12160
12983
  secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
@@ -12163,6 +12986,32 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12163
12986
  mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12164
12987
  };
12165
12988
  this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
12989
+ }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
12990
+ var _a;
12991
+ let iconUrl = undefined;
12992
+ if (columnName) {
12993
+ const iconCell = row.cells[columnName];
12994
+ let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
12995
+ if (!icon) {
12996
+ icon = iconCell.value;
12997
+ }
12998
+ if (icon) {
12999
+ iconUrl = getAssetPath('./assets/svg/' + icon + '.svg');
13000
+ }
13001
+ }
13002
+ return iconUrl;
13003
+ }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13004
+ var _a;
13005
+ let iconColor = undefined;
13006
+ if (columnName) {
13007
+ const iconCell = row.cells[columnName];
13008
+ iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13009
+ if (iconColor) {
13010
+ iconColor =
13011
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13012
+ }
13013
+ }
13014
+ return iconColor;
12166
13015
  };
12167
13016
  KupPlanner.style = kupPlannerCss;
12168
13017