@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,5 +1,5 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
- import { a8 as createCommonjsModule, k as kupManagerInstance, aE as KupDatesFormats, ak as getCellValueForDisplay, g as getProps, s as setProps, Y as FTextFieldMDC, c as componentWrapperId, an as FTextField, a as KupThemeIconValues, Z as KupLanguageSearch, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$f, t as defineCustomElement$g, u as defineCustomElement$h, v as defineCustomElement$i, w as defineCustomElement$j, x as defineCustomElement$k, y as defineCustomElement$l, z as defineCustomElement$m, A as defineCustomElement$n, B as defineCustomElement$o, C as defineCustomElement$p, D as defineCustomElement$q, E as defineCustomElement$r, G as defineCustomElement$s } from './kup-autocomplete2.js';
1
+ import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host, getAssetPath } from '@stencil/core/internal/client';
2
+ import { a8 as createCommonjsModule, aD as commonjsGlobal, k as kupManagerInstance, aE as KupDatesFormats, ak as getCellValueForDisplay, g as getProps, s as setProps, Y as FTextFieldMDC, c as componentWrapperId, am as FTextField, a as KupThemeIconValues, Z as KupLanguageSearch, d as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, h as defineCustomElement$6, i as defineCustomElement$7, j as defineCustomElement$8, l as defineCustomElement$9, m as defineCustomElement$a, n as defineCustomElement$b, o as defineCustomElement$c, p as defineCustomElement$d, q as defineCustomElement$e, r as defineCustomElement$f, t as defineCustomElement$g, u as defineCustomElement$h, v as defineCustomElement$i, w as defineCustomElement$j, x as defineCustomElement$k, y as defineCustomElement$l, z as defineCustomElement$m, A as defineCustomElement$n, B as defineCustomElement$o, C as defineCustomElement$p, D as defineCustomElement$q, E as defineCustomElement$r, G as defineCustomElement$s } from './kup-autocomplete2.js';
3
3
 
4
4
  /**
5
5
  * Props of the kup-gantt component.
@@ -41,6 +41,7 @@ var KupPlannerTaskAction;
41
41
  KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
42
42
  KupPlannerTaskAction["onClick"] = "onClick";
43
43
  KupPlannerTaskAction["onResize"] = "onResize";
44
+ KupPlannerTaskAction["onRightClick"] = "onRightClick";
44
45
  })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
45
46
  var KupPlannerGanttRowType;
46
47
  (function (KupPlannerGanttRowType) {
@@ -8364,6 +8365,545 @@ exports.Zone = Zone;
8364
8365
  //# sourceMappingURL=luxon.js.map
8365
8366
  });
8366
8367
 
8368
+ var hexToCssFilter = createCommonjsModule(function (module, exports) {
8369
+ (function (global, factory) {
8370
+ factory(exports) ;
8371
+ }(commonjsGlobal, (function (exports) {
8372
+ /*! *****************************************************************************
8373
+ Copyright (c) Microsoft Corporation.
8374
+
8375
+ Permission to use, copy, modify, and/or distribute this software for any
8376
+ purpose with or without fee is hereby granted.
8377
+
8378
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8379
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8380
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8381
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8382
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
8383
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8384
+ PERFORMANCE OF THIS SOFTWARE.
8385
+ ***************************************************************************** */
8386
+
8387
+ function __read(o, n) {
8388
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
8389
+ if (!m) return o;
8390
+ var i = m.call(o), r, ar = [], e;
8391
+ try {
8392
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8393
+ }
8394
+ catch (error) { e = { error: error }; }
8395
+ finally {
8396
+ try {
8397
+ if (r && !r.done && (m = i["return"])) m.call(i);
8398
+ }
8399
+ finally { if (e) throw e.error; }
8400
+ }
8401
+ return ar;
8402
+ }
8403
+
8404
+ var Color = /** @class */ (function () {
8405
+ function Color(r, g, b) {
8406
+ this.r = 0;
8407
+ this.g = 0;
8408
+ this.b = 0;
8409
+ this.set(r, g, b);
8410
+ }
8411
+ Color.prototype.set = function (r, g, b) {
8412
+ this.r = this.clamp(r);
8413
+ this.g = this.clamp(g);
8414
+ this.b = this.clamp(b);
8415
+ };
8416
+ /**
8417
+ * Applying cals to get CSS filter for hue-rotate
8418
+ *
8419
+ * @param {number} [angle=0]
8420
+ * @memberof Color
8421
+ */
8422
+ Color.prototype.hueRotate = function (angle) {
8423
+ if (angle === void 0) { angle = 0; }
8424
+ angle = (angle / 180) * Math.PI;
8425
+ var sin = Math.sin(angle);
8426
+ var cos = Math.cos(angle);
8427
+ this.multiply([
8428
+ 0.213 + cos * 0.787 - sin * 0.213,
8429
+ 0.715 - cos * 0.715 - sin * 0.715,
8430
+ 0.072 - cos * 0.072 + sin * 0.928,
8431
+ 0.213 - cos * 0.213 + sin * 0.143,
8432
+ 0.715 + cos * 0.285 + sin * 0.14,
8433
+ 0.072 - cos * 0.072 - sin * 0.283,
8434
+ 0.213 - cos * 0.213 - sin * 0.787,
8435
+ 0.715 - cos * 0.715 + sin * 0.715,
8436
+ 0.072 + cos * 0.928 + sin * 0.072,
8437
+ ]);
8438
+ };
8439
+ /**
8440
+ * Applying cals to get CSS filter for grayscale
8441
+ *
8442
+ * @param {number} [value=1]
8443
+ * @memberof Color
8444
+ */
8445
+ Color.prototype.grayscale = function (value) {
8446
+ if (value === void 0) { value = 1; }
8447
+ this.multiply([
8448
+ 0.2126 + 0.7874 * (1 - value),
8449
+ 0.7152 - 0.7152 * (1 - value),
8450
+ 0.0722 - 0.0722 * (1 - value),
8451
+ 0.2126 - 0.2126 * (1 - value),
8452
+ 0.7152 + 0.2848 * (1 - value),
8453
+ 0.0722 - 0.0722 * (1 - value),
8454
+ 0.2126 - 0.2126 * (1 - value),
8455
+ 0.7152 - 0.7152 * (1 - value),
8456
+ 0.0722 + 0.9278 * (1 - value),
8457
+ ]);
8458
+ };
8459
+ /**
8460
+ * Applying cals to get CSS filter for sepia
8461
+ *
8462
+ * @param {number} [value=1]
8463
+ * @memberof Color
8464
+ */
8465
+ Color.prototype.sepia = function (value) {
8466
+ if (value === void 0) { value = 1; }
8467
+ this.multiply([
8468
+ 0.393 + 0.607 * (1 - value),
8469
+ 0.769 - 0.769 * (1 - value),
8470
+ 0.189 - 0.189 * (1 - value),
8471
+ 0.349 - 0.349 * (1 - value),
8472
+ 0.686 + 0.314 * (1 - value),
8473
+ 0.168 - 0.168 * (1 - value),
8474
+ 0.272 - 0.272 * (1 - value),
8475
+ 0.534 - 0.534 * (1 - value),
8476
+ 0.131 + 0.869 * (1 - value),
8477
+ ]);
8478
+ };
8479
+ /**
8480
+ * Applying cals to get CSS filter for saturate
8481
+ *
8482
+ * @param {number} [value=1]
8483
+ * @memberof Color
8484
+ */
8485
+ Color.prototype.saturate = function (value) {
8486
+ if (value === void 0) { value = 1; }
8487
+ this.multiply([
8488
+ 0.213 + 0.787 * value,
8489
+ 0.715 - 0.715 * value,
8490
+ 0.072 - 0.072 * value,
8491
+ 0.213 - 0.213 * value,
8492
+ 0.715 + 0.285 * value,
8493
+ 0.072 - 0.072 * value,
8494
+ 0.213 - 0.213 * value,
8495
+ 0.715 - 0.715 * value,
8496
+ 0.072 + 0.928 * value,
8497
+ ]);
8498
+ };
8499
+ Color.prototype.multiply = function (matrix) {
8500
+ // These values are needed. It's correct because the returned values will change
8501
+ var newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);
8502
+ var newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);
8503
+ var newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);
8504
+ this.r = newR;
8505
+ this.g = newG;
8506
+ this.b = newB;
8507
+ };
8508
+ /**
8509
+ * Applying cals to get CSS filter for brightness
8510
+ *
8511
+ * @param {number} [value=1]
8512
+ * @memberof Color
8513
+ */
8514
+ Color.prototype.brightness = function (value) {
8515
+ if (value === void 0) { value = 1; }
8516
+ this.linear(value);
8517
+ };
8518
+ /**
8519
+ * Applying cals to get CSS filter for contrast
8520
+ *
8521
+ * @param {number} [value=1]
8522
+ * @memberof Color
8523
+ */
8524
+ Color.prototype.contrast = function (value) {
8525
+ if (value === void 0) { value = 1; }
8526
+ this.linear(value, -(0.5 * value) + 0.5);
8527
+ };
8528
+ Color.prototype.linear = function (slope, intercept) {
8529
+ if (slope === void 0) { slope = 1; }
8530
+ if (intercept === void 0) { intercept = 0; }
8531
+ this.r = this.clamp(this.r * slope + intercept * 255);
8532
+ this.g = this.clamp(this.g * slope + intercept * 255);
8533
+ this.b = this.clamp(this.b * slope + intercept * 255);
8534
+ };
8535
+ /**
8536
+ * Applying cals to get CSS filter for invert
8537
+ *
8538
+ * @param {number} [value=1]
8539
+ * @memberof Color
8540
+ */
8541
+ Color.prototype.invert = function (value) {
8542
+ if (value === void 0) { value = 1; }
8543
+ this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);
8544
+ this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);
8545
+ this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);
8546
+ };
8547
+ /**
8548
+ * transform RGB into HSL values
8549
+ *
8550
+ * @returns {HSLData}
8551
+ * @memberof Color
8552
+ */
8553
+ Color.prototype.hsl = function () {
8554
+ var red = this.r / 255;
8555
+ var green = this.g / 255;
8556
+ var blue = this.b / 255;
8557
+ // find greatest and smallest channel values
8558
+ var max = Math.max(red, green, blue);
8559
+ var min = Math.min(red, green, blue);
8560
+ var hue = 0;
8561
+ var saturation = 0;
8562
+ var lightness = (max + min) / 2;
8563
+ // If min and max have the same values, it means
8564
+ // the given color is achromatic
8565
+ if (max === min) {
8566
+ return {
8567
+ h: 0,
8568
+ s: 0,
8569
+ l: lightness * 100,
8570
+ };
8571
+ }
8572
+ // Adding delta value of greatest and smallest channel values
8573
+ var delta = max - min;
8574
+ saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
8575
+ if (max === red) {
8576
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
8577
+ }
8578
+ else if (max === green) {
8579
+ hue = (blue - red) / delta + 2;
8580
+ }
8581
+ else if (max === blue) {
8582
+ hue = (red - green) / delta + 4;
8583
+ }
8584
+ hue /= 6;
8585
+ return {
8586
+ h: hue * 100,
8587
+ s: saturation * 100,
8588
+ l: lightness * 100,
8589
+ };
8590
+ };
8591
+ /**
8592
+ * Normalize the value to follow the min and max for RGB colors
8593
+ * min: 0
8594
+ * max: 255
8595
+ *
8596
+ * @private
8597
+ * @param {number} value
8598
+ * @returns {number}
8599
+ * @memberof Color
8600
+ */
8601
+ Color.prototype.clamp = function (value) {
8602
+ // Minimum RGB Value = 0;
8603
+ // Maximum RGB Value = 255;
8604
+ return Math.min(Math.max(value, 0), 255);
8605
+ };
8606
+ return Color;
8607
+ }());
8608
+
8609
+ var Solver = /** @class */ (function () {
8610
+ function Solver(target, options) {
8611
+ this.target = target;
8612
+ this.targetHSL = target.hsl();
8613
+ this.options = Object.assign({},
8614
+ // Adding default values for options
8615
+ {
8616
+ acceptanceLossPercentage: 5,
8617
+ maxChecks: 15,
8618
+ }, options);
8619
+ // All the calcs done by the library to generate
8620
+ // a CSS Filter are based on the color `#000`
8621
+ // in this case, `rgb(0, 0, 0)`
8622
+ // Please make sure the background of the element
8623
+ // is `#000` for better performance
8624
+ // and color similarity.
8625
+ this.reusedColor = new Color(0, 0, 0);
8626
+ }
8627
+ /**
8628
+ * Returns the solved values for the
8629
+ *
8630
+ * @returns {(SPSAPayload & { filter: string; })}
8631
+ * @memberof Solver
8632
+ */
8633
+ Solver.prototype.solve = function () {
8634
+ var result = this.solveNarrow(this.solveWide());
8635
+ return {
8636
+ values: result.values,
8637
+ called: result.called,
8638
+ loss: result.loss,
8639
+ filter: this.css(result.values),
8640
+ };
8641
+ };
8642
+ /**
8643
+ * Solve wide values based on the wide values for RGB and HSL values
8644
+ *
8645
+ * @private
8646
+ * @returns {SPSAPayload}
8647
+ * @memberof Solver
8648
+ */
8649
+ Solver.prototype.solveWide = function () {
8650
+ var A = 5;
8651
+ var c = 15;
8652
+ // Wide values for RGB and HSL values
8653
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8654
+ var a = [60, 180, 18000, 600, 1.2, 1.2];
8655
+ var best = { loss: Infinity };
8656
+ var counter = 0;
8657
+ while (best.loss > this.options.acceptanceLossPercentage) {
8658
+ var initialFilterValues = [50, 20, 3750, 50, 100, 100];
8659
+ var result = this.spsa({
8660
+ A: A,
8661
+ a: a,
8662
+ c: c,
8663
+ values: initialFilterValues,
8664
+ // for wide values we should use the double of tries in
8665
+ // comparison of `solveNarrow()` method
8666
+ maxTriesInLoop: 1000,
8667
+ });
8668
+ if (result.loss < best.loss) {
8669
+ best = result;
8670
+ }
8671
+ counter += 1;
8672
+ if (counter >= this.options.maxChecks) {
8673
+ break;
8674
+ }
8675
+ }
8676
+ return Object.assign({}, best, { called: counter });
8677
+ };
8678
+ /**
8679
+ * Solve narrow values based on the wide values for the filter
8680
+ *
8681
+ * @private
8682
+ * @param {SPSAPayload} wide
8683
+ * @returns {SPSAPayload}
8684
+ * @memberof Solver
8685
+ */
8686
+ Solver.prototype.solveNarrow = function (wide) {
8687
+ var A = wide.loss;
8688
+ var c = 2;
8689
+ var A1 = A + 1;
8690
+ // Narrow values for RGB and HSL values
8691
+ // the values in the order: [`r`, `g`, `b`, `h`, `s`, `l`]
8692
+ var a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];
8693
+ return this.spsa({
8694
+ A: A,
8695
+ a: a,
8696
+ c: c,
8697
+ values: wide.values,
8698
+ maxTriesInLoop: 500,
8699
+ called: wide.called,
8700
+ });
8701
+ };
8702
+ /**
8703
+ * Returns final value based on the current filter order
8704
+ * to get the order, please check the returned value
8705
+ * in `css()` method
8706
+ *
8707
+ * @private
8708
+ * @param {number} value
8709
+ * @param {number} idx
8710
+ * @returns {number}
8711
+ * @memberof Solver
8712
+ */
8713
+ Solver.prototype.fixValueByFilterIDX = function (value, idx) {
8714
+ var max = 100;
8715
+ // Fixing max, minimum and value by filter
8716
+ if (idx === 2 /* saturate */) {
8717
+ max = 7500;
8718
+ }
8719
+ else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {
8720
+ max = 200;
8721
+ }
8722
+ if (idx === 3 /* hue-rotate */) {
8723
+ if (value > max) {
8724
+ value %= max;
8725
+ }
8726
+ else if (value < 0) {
8727
+ value = max + (value % max);
8728
+ }
8729
+ }
8730
+ // Checking if value is below the minimum or above
8731
+ // the maximum allowed by filter
8732
+ else if (value < 0) {
8733
+ value = 0;
8734
+ }
8735
+ else if (value > max) {
8736
+ value = max;
8737
+ }
8738
+ return value;
8739
+ };
8740
+ Solver.prototype.spsa = function (_a) {
8741
+ 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;
8742
+ var alpha = 1;
8743
+ var gamma = 0.16666666666666666;
8744
+ var best = null;
8745
+ var bestLoss = Infinity;
8746
+ var deltas = new Array(6);
8747
+ var highArgs = new Array(6);
8748
+ var lowArgs = new Array(6);
8749
+ // Size of all CSS filters to be applied to get the correct color
8750
+ var filtersToBeAppliedSize = 6;
8751
+ for (var key = 0; key < maxTriesInLoop; key++) {
8752
+ var ck = c / Math.pow(key + 1, gamma);
8753
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8754
+ deltas[i] = Math.random() > 0.5 ? 1 : -1;
8755
+ highArgs[i] = values[i] + ck * deltas[i];
8756
+ lowArgs[i] = values[i] - ck * deltas[i];
8757
+ }
8758
+ var lossDiff = this.loss(highArgs) - this.loss(lowArgs);
8759
+ for (var i = 0; i < filtersToBeAppliedSize; i++) {
8760
+ var g = (lossDiff / (2 * ck)) * deltas[i];
8761
+ var ak = a[i] / Math.pow(A + key + 1, alpha);
8762
+ values[i] = this.fixValueByFilterIDX(values[i] - ak * g, i);
8763
+ }
8764
+ var loss = this.loss(values);
8765
+ if (loss < bestLoss) {
8766
+ best = values.slice(0);
8767
+ bestLoss = loss;
8768
+ }
8769
+ }
8770
+ return { values: best, loss: bestLoss, called: called };
8771
+ };
8772
+ /**
8773
+ * Checks how much is the loss for the filter in RGB and HSL colors
8774
+ *
8775
+ * @private
8776
+ * @param {SPSAPayload['values']} filters
8777
+ * @returns {number}
8778
+ * @memberof Solver
8779
+ */
8780
+ Solver.prototype.loss = function (filters) {
8781
+ // Argument as an Array of percentages.
8782
+ var color = this.reusedColor;
8783
+ // Resetting the color to black in case
8784
+ // it was called more than once
8785
+ color.set(0, 0, 0);
8786
+ color.invert(filters[0] / 100);
8787
+ color.sepia(filters[1] / 100);
8788
+ color.saturate(filters[2] / 100);
8789
+ color.hueRotate(filters[3] * 3.6);
8790
+ color.brightness(filters[4] / 100);
8791
+ color.contrast(filters[5] / 100);
8792
+ var colorHSL = color.hsl();
8793
+ return (Math.abs(color.r - this.target.r) +
8794
+ Math.abs(color.g - this.target.g) +
8795
+ Math.abs(color.b - this.target.b) +
8796
+ Math.abs(colorHSL.h - this.targetHSL.h) +
8797
+ Math.abs(colorHSL.s - this.targetHSL.s) +
8798
+ Math.abs(colorHSL.l - this.targetHSL.l));
8799
+ };
8800
+ /**
8801
+ * Returns the CSS filter list for the received HEX color
8802
+ *
8803
+ * @private
8804
+ * @param {number[]} filters
8805
+ * @returns {string}
8806
+ * @memberof Solver
8807
+ */
8808
+ Solver.prototype.css = function (filters) {
8809
+ var formatCssFilterValueByMultiplier = function (idx, multiplier) {
8810
+ if (multiplier === void 0) { multiplier = 1; }
8811
+ return Math.round(filters[idx] * multiplier);
8812
+ };
8813
+ return [
8814
+ "invert(" + formatCssFilterValueByMultiplier(0) + "%)",
8815
+ "sepia(" + formatCssFilterValueByMultiplier(1) + "%)",
8816
+ "saturate(" + formatCssFilterValueByMultiplier(2) + "%)",
8817
+ "hue-rotate(" + formatCssFilterValueByMultiplier(3, 3.6) + "deg)",
8818
+ "brightness(" + formatCssFilterValueByMultiplier(4) + "%)",
8819
+ "contrast(" + formatCssFilterValueByMultiplier(5) + "%);",
8820
+ ].join(' ');
8821
+ };
8822
+ return Solver;
8823
+ }());
8824
+
8825
+ /**
8826
+ * Transform a CSS Color from Hexadecimal to RGB color
8827
+ *
8828
+ * @param {string} hex hexadecimal color
8829
+ * @returns {([number, number, number] | [])} array with the RGB colors or empty array
8830
+ */
8831
+ var hexToRgb = function (hex) {
8832
+ if (hex.length === 4) {
8833
+ return [parseInt("0x" + hex[1] + hex[1]), parseInt("0x" + hex[2] + hex[2]), parseInt("0x" + hex[3] + hex[3])];
8834
+ }
8835
+ if (hex.length === 7) {
8836
+ return [parseInt("0x" + hex[1] + hex[2]), parseInt("0x" + hex[3] + hex[4]), parseInt("0x" + hex[5] + hex[6])];
8837
+ }
8838
+ return [];
8839
+ };
8840
+ var isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); };
8841
+ // Memory cache for the computed results to avoid multiple
8842
+ // calculations for the same color
8843
+ var results = {};
8844
+ /**
8845
+ * A function that transforms a HEX color into CSS filters
8846
+ *
8847
+ * @param colorValue string hexadecimal color
8848
+ * @param opts HexToCssConfiguration function configuration
8849
+ *
8850
+ */
8851
+ var hexToCSSFilter = function (colorValue, opts) {
8852
+ var _a;
8853
+ if (opts === void 0) { opts = {}; }
8854
+ var red;
8855
+ var green;
8856
+ var blue;
8857
+ if (results[colorValue] && !opts.forceFilterRecalculation) {
8858
+ return Object.assign({}, results[colorValue], { cache: true });
8859
+ }
8860
+ var color;
8861
+ try {
8862
+ _a = __read(hexToRgb(colorValue), 3), red = _a[0], green = _a[1], blue = _a[2];
8863
+ if (!isNumeric(red) || !isNumeric(green) || !isNumeric(blue)) {
8864
+ throw new Error("hextToRgb returned an invalid value for '" + colorValue + "'");
8865
+ }
8866
+ color = new Color(Number(red), Number(green), Number(blue));
8867
+ }
8868
+ catch (error) {
8869
+ throw new Error("Color value should be in HEX format. " + error);
8870
+ }
8871
+ var solver = new Solver(color, Object.assign({},
8872
+ // `HexToCssConfiguration` Defaults
8873
+ {
8874
+ acceptanceLossPercentage: 5,
8875
+ maxChecks: 30,
8876
+ forceFilterRecalculation: false,
8877
+ }, opts));
8878
+ return (results[colorValue] = Object.assign({}, solver.solve(), {
8879
+ hex: colorValue,
8880
+ rgb: [red, green, blue],
8881
+ cache: false,
8882
+ }));
8883
+ };
8884
+ /**
8885
+ * A function that clears cached results
8886
+ *
8887
+ * @param {string} key? HEX string value passed previously `#24639C`. If not passed, it clears all cached results
8888
+ * @returns void
8889
+ */
8890
+ var clearCache = function (key) {
8891
+ if (!key) {
8892
+ results = {};
8893
+ }
8894
+ else if (results[key]) {
8895
+ delete results[key];
8896
+ }
8897
+ };
8898
+
8899
+ exports.clearCache = clearCache;
8900
+ exports.hexToCSSFilter = hexToCSSFilter;
8901
+
8902
+ Object.defineProperty(exports, '__esModule', { value: true });
8903
+
8904
+ })));
8905
+ });
8906
+
8367
8907
  function _extends() {
8368
8908
  _extends = Object.assign ? Object.assign.bind() : function (target) {
8369
8909
  for (var i = 1; i < arguments.length; i++) {
@@ -8470,6 +9010,14 @@ var toViewMode = function toViewMode(timeUnit) {
8470
9010
  return ViewMode.Year;
8471
9011
  }
8472
9012
  };
9013
+ var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
9014
+ switch (timeUnit) {
9015
+ case TimeUnit.YEAR:
9016
+ return 60 * 2;
9017
+ default:
9018
+ return 60;
9019
+ }
9020
+ };
8473
9021
  var convertPhaseToTask = function convertPhaseToTask(item) {
8474
9022
  var mapPhase = function mapPhase(_ref) {
8475
9023
  var phaseStart = _ref.startDate,
@@ -8480,7 +9028,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8480
9028
  phaseId = _ref.id,
8481
9029
  color = _ref.color,
8482
9030
  selectedColor = _ref.selectedColor,
8483
- dependencies = _ref.dependencies;
9031
+ dependencies = _ref.dependencies,
9032
+ icon = _ref.icon;
8484
9033
  var _validDates = validDates(phaseStart, phaseEnd),
8485
9034
  start = _validDates.start,
8486
9035
  end = _validDates.end;
@@ -8503,7 +9052,8 @@ var convertPhaseToTask = function convertPhaseToTask(item) {
8503
9052
  progressColor: color,
8504
9053
  backgroundSelectedColor: selectedColor,
8505
9054
  progressSelectedColor: selectedColor
8506
- } : {}
9055
+ } : {},
9056
+ icon: icon
8507
9057
  };
8508
9058
  };
8509
9059
  return mapPhase(item);
@@ -8534,7 +9084,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8534
9084
  var startDate = x.startDate,
8535
9085
  endDate = x.endDate,
8536
9086
  color = x.color,
8537
- selectedColor = x.selectedColor;
9087
+ selectedColor = x.selectedColor,
9088
+ icon = x.icon;
8538
9089
  var _validDates3 = validDates(startDate, endDate),
8539
9090
  start = _validDates3.start,
8540
9091
  end = _validDates3.end;
@@ -8542,7 +9093,8 @@ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttSt
8542
9093
  start: start,
8543
9094
  end: end,
8544
9095
  backgroundColor: color != null ? color : "0xffffff",
8545
- backgroundSelectedColor: selectedColor != null ? selectedColor : color
9096
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color,
9097
+ icon: icon
8546
9098
  };
8547
9099
  };
8548
9100
  var defaultColor = "#595959";
@@ -8587,7 +9139,8 @@ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartD
8587
9139
  secondaryEnd: end2,
8588
9140
  progress: 100,
8589
9141
  isDisabled: false,
8590
- hideChildren: false
9142
+ hideChildren: false,
9143
+ icon: row.icon
8591
9144
  };
8592
9145
  var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
8593
9146
  return [mainTask].concat(children1);
@@ -9764,7 +10317,7 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9764
10317
  var _task$timeline;
9765
10318
  var y = taskYCoordinate(index, rowHeight, taskHeight);
9766
10319
  function convertFrameToTask(frame, j) {
9767
- var _frame$backgroundSele;
10320
+ var _frame$backgroundSele, _frame$icon;
9768
10321
  var _computeTypeAndXs2 = computeTypeAndXs(frame.start, frame.end, "task", dates, columnWidth, handleWidth, false),
9769
10322
  x1 = _computeTypeAndXs2.x1,
9770
10323
  x2 = _computeTypeAndXs2.x2;
@@ -9796,7 +10349,8 @@ var convertToTimeline = function convertToTimeline(task, index, dates, columnWid
9796
10349
  typeInternal: "timeline",
9797
10350
  x1: x1,
9798
10351
  x2: x2,
9799
- y: y
10352
+ y: y,
10353
+ icon: (_frame$icon = frame.icon) != null ? _frame$icon : undefined
9800
10354
  };
9801
10355
  }
9802
10356
  var _computeTypeAndXs3 = computeTypeAndXs(task.start, task.end, task.type, dates, columnWidth, handleWidth, false),
@@ -10155,6 +10709,25 @@ var BarProgressHandle = function BarProgressHandle(_ref) {
10155
10709
  });
10156
10710
  };
10157
10711
 
10712
+ var TaskIcon = function TaskIcon(_ref) {
10713
+ var _ref$color = _ref.color,
10714
+ color = _ref$color === void 0 ? "#000000" : _ref$color,
10715
+ url = _ref.url,
10716
+ height = _ref.height,
10717
+ width = _ref.width,
10718
+ x = _ref.x,
10719
+ y = _ref.y;
10720
+ var cssFilter = hexToCssFilter.hexToCSSFilter(color);
10721
+ return react.createElement("image", {
10722
+ href: url,
10723
+ filter: cssFilter.filter.replace(";", ""),
10724
+ x: x,
10725
+ y: y,
10726
+ width: width,
10727
+ height: height
10728
+ });
10729
+ };
10730
+
10158
10731
  var Bar = function Bar(_ref) {
10159
10732
  var _task$x2secondary, _task$x1secondary;
10160
10733
  var task = _ref.task,
@@ -10212,7 +10785,14 @@ var Bar = function Bar(_ref) {
10212
10785
  onMouseDown: function onMouseDown(e) {
10213
10786
  onEventStart("progress", task, e);
10214
10787
  }
10215
- })));
10788
+ })), task.icon && task.icon.url && react.createElement(TaskIcon, {
10789
+ color: task.icon.color,
10790
+ url: task.icon.url,
10791
+ width: task.height / 2 + "px",
10792
+ height: task.height / 2 + "px",
10793
+ x: task.x1 + (task.x2 - task.x1) - task.height / 2 / 2,
10794
+ y: task.y - task.height / 2 / 2 / 2 + (showSecondaryDates ? task.height / 2 : 0)
10795
+ }));
10216
10796
  };
10217
10797
 
10218
10798
  var BarSmall = function BarSmall(_ref) {
@@ -10273,7 +10853,9 @@ var Timeline = function Timeline(_ref) {
10273
10853
  rx: 0,
10274
10854
  ry: 0
10275
10855
  }), task.barChildren.map(function (bar) {
10276
- return react.createElement("rect", {
10856
+ return react.createElement(react.Fragment, {
10857
+ key: bar.id + ".rf"
10858
+ }, react.createElement("rect", {
10277
10859
  style: {
10278
10860
  cursor: "pointer"
10279
10861
  },
@@ -10285,7 +10867,14 @@ var Timeline = function Timeline(_ref) {
10285
10867
  height: bar.height,
10286
10868
  rx: bar.barCornerRadius,
10287
10869
  ry: bar.barCornerRadius
10288
- });
10870
+ }), bar.icon && bar.icon.url && react.createElement(TaskIcon, {
10871
+ color: bar.icon.color,
10872
+ url: bar.icon.url,
10873
+ width: bar.height + "px",
10874
+ height: bar.height + "px",
10875
+ x: bar.x1 + (bar.x2 - bar.x1) - bar.height / 2,
10876
+ y: bar.y - bar.height / 2 / 2
10877
+ }));
10289
10878
  }));
10290
10879
  };
10291
10880
 
@@ -10322,7 +10911,7 @@ var TaskItem = function TaskItem(props) {
10322
10911
  setTaskItem(react.createElement(Bar, Object.assign({}, props)));
10323
10912
  break;
10324
10913
  }
10325
- }, [task, isSelected]);
10914
+ }, [task, isSelected, props]);
10326
10915
  react.useEffect(function () {
10327
10916
  if (textRef.current) {
10328
10917
  setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
@@ -10363,6 +10952,9 @@ var TaskItem = function TaskItem(props) {
10363
10952
  onClick: function onClick(e) {
10364
10953
  onEventStart("click", task, e);
10365
10954
  },
10955
+ onContextMenu: function onContextMenu(e) {
10956
+ onEventStart("contextmenu", task, e);
10957
+ },
10366
10958
  onFocus: function onFocus() {
10367
10959
  onEventStart("select", task);
10368
10960
  }
@@ -10403,6 +10995,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10403
10995
  onProgressChange = _ref.onProgressChange,
10404
10996
  onDoubleClick = _ref.onDoubleClick,
10405
10997
  onClick = _ref.onClick,
10998
+ onContextMenu = _ref.onContextMenu,
10406
10999
  onDelete = _ref.onDelete;
10407
11000
  var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
10408
11001
  var _useState = react.useState(0),
@@ -10564,6 +11157,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10564
11157
  } else if (action === "click") {
10565
11158
  var skipClick = !hasMovedHorizontally(event);
10566
11159
  skipClick && !!onClick && onClick(task);
11160
+ } else if (action === "contextmenu") {
11161
+ event.preventDefault();
11162
+ !!onContextMenu && onContextMenu(event, task);
10567
11163
  } else if (action === "move") {
10568
11164
  var _svg$current$getScree3;
10569
11165
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
@@ -10815,6 +11411,7 @@ var Gantt = function Gantt(_ref) {
10815
11411
  onProgressChange = _ref.onProgressChange,
10816
11412
  onDoubleClick = _ref.onDoubleClick,
10817
11413
  onClick = _ref.onClick,
11414
+ onContextMenu = _ref.onContextMenu,
10818
11415
  onDelete = _ref.onDelete,
10819
11416
  onSelect = _ref.onSelect,
10820
11417
  onExpanderClick = _ref.onExpanderClick;
@@ -10832,26 +11429,26 @@ var Gantt = function Gantt(_ref) {
10832
11429
  }),
10833
11430
  dateSetup = _useState[0],
10834
11431
  setDateSetup = _useState[1];
10835
- var _useState2 = react.useState(undefined),
10836
- currentViewDate = _useState2[0],
10837
- setCurrentViewDate = _useState2[1];
10838
- var _useState3 = react.useState(0),
10839
- taskListWidth = _useState3[0],
10840
- setTaskListWidth = _useState3[1];
10841
- var _useState4 = react.useState(0),
10842
- svgContainerWidth = _useState4[0],
10843
- setSvgContainerWidth = _useState4[1];
10844
- var _useState5 = react.useState(ganttHeight),
10845
- svgContainerHeight = _useState5[0],
10846
- setSvgContainerHeight = _useState5[1];
10847
- var _useState6 = react.useState([]),
10848
- barTasks = _useState6[0],
10849
- setBarTasks = _useState6[1];
10850
- var _useState7 = react.useState({
11432
+ var taskListWidth = react.useRef(0);
11433
+ var setTaskListWidth = function setTaskListWidth(width) {
11434
+ taskListWidth.current = width;
11435
+ };
11436
+ var svgContainerWidth = react.useRef(0);
11437
+ var setSvgContainerWidth = function setSvgContainerWidth(width) {
11438
+ svgContainerWidth.current = width;
11439
+ };
11440
+ var svgContainerHeight = react.useRef(ganttHeight);
11441
+ var setSvgContainerHeight = function setSvgContainerHeight(height) {
11442
+ svgContainerHeight.current = height;
11443
+ };
11444
+ var _useState2 = react.useState([]),
11445
+ barTasks = _useState2[0],
11446
+ setBarTasks = _useState2[1];
11447
+ var _useState3 = react.useState({
10851
11448
  action: ""
10852
11449
  }),
10853
- ganttEvent = _useState7[0],
10854
- setGanttEvent = _useState7[1];
11450
+ ganttEvent = _useState3[0],
11451
+ setGanttEvent = _useState3[1];
10855
11452
  var taskHeight = react.useMemo(function () {
10856
11453
  return rowHeight * barFill / 100;
10857
11454
  }, [rowHeight, barFill]);
@@ -10861,29 +11458,30 @@ var Gantt = function Gantt(_ref) {
10861
11458
  var timelineHeight = react.useMemo(function () {
10862
11459
  return rowHeight * timelineFill / 100;
10863
11460
  }, [rowHeight, timelineFill]);
10864
- var _useState8 = react.useState(),
10865
- selectedTask = _useState8[0],
10866
- setSelectedTask = _useState8[1];
10867
- var _useState9 = react.useState(null),
10868
- failedTask = _useState9[0],
10869
- setFailedTask = _useState9[1];
11461
+ var _useState4 = react.useState(),
11462
+ selectedTask = _useState4[0],
11463
+ setSelectedTask = _useState4[1];
11464
+ var _useState5 = react.useState(null),
11465
+ failedTask = _useState5[0],
11466
+ setFailedTask = _useState5[1];
10870
11467
  var svgWidth = dateSetup.dates.length * columnWidth;
10871
11468
  var ganttFullHeight = barTasks.length * rowHeight;
10872
- var _useState10 = react.useState(0),
10873
- scrollY = _useState10[0],
10874
- setScrollY = _useState10[1];
10875
- var _useState11 = react.useState(-1),
10876
- scrollX = _useState11[0],
10877
- setScrollX = _useState11[1];
10878
- var _useState12 = react.useState(false),
10879
- ignoreScrollEvent = _useState12[0],
10880
- setIgnoreScrollEvent = _useState12[1];
10881
- var _useState13 = react.useState(),
10882
- currentDateIndicatorContent = _useState13[0],
10883
- setCurrentDateIndicatorContent = _useState13[1];
10884
- var _useState14 = react.useState(),
10885
- projectionContent = _useState14[0],
10886
- setProjectionContent = _useState14[1];
11469
+ var _useState6 = react.useState(0),
11470
+ scrollY = _useState6[0],
11471
+ setScrollY = _useState6[1];
11472
+ var _useState7 = react.useState(-1),
11473
+ scrollX = _useState7[0],
11474
+ setScrollX = _useState7[1];
11475
+ var ignoreScrollEvent = react.useRef(false);
11476
+ var setIgnoreScrollEvent = function setIgnoreScrollEvent(value) {
11477
+ ignoreScrollEvent.current = value;
11478
+ };
11479
+ var _useState8 = react.useState(),
11480
+ currentDateIndicatorContent = _useState8[0],
11481
+ setCurrentDateIndicatorContent = _useState8[1];
11482
+ var _useState9 = react.useState(),
11483
+ projectionContent = _useState9[0],
11484
+ setProjectionContent = _useState9[1];
10887
11485
  react.useEffect(function () {
10888
11486
  window.addEventListener("gantt-sync-scroll-event", function (e) {
10889
11487
  if (e.detail.id !== id) {
@@ -10909,14 +11507,30 @@ var Gantt = function Gantt(_ref) {
10909
11507
  setScrollX(newDates.length * columnWidth);
10910
11508
  }
10911
11509
  }
10912
- setDateSetup({
10913
- dates: newDates,
10914
- viewMode: viewMode
10915
- });
11510
+ var set = false;
11511
+ if (dateSetup && dateSetup.dates) {
11512
+ var old = dateSetup.dates;
11513
+ if (old.length !== newDates.length) {
11514
+ set = true;
11515
+ } else {
11516
+ for (var i = 0; i < old.length; i++) {
11517
+ if (old[i].valueOf() !== newDates[i].valueOf()) {
11518
+ set = true;
11519
+ break;
11520
+ }
11521
+ }
11522
+ }
11523
+ }
11524
+ if (set) {
11525
+ setDateSetup({
11526
+ dates: newDates,
11527
+ viewMode: viewMode
11528
+ });
11529
+ }
10916
11530
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
10917
11531
  }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
10918
11532
  react.useEffect(function () {
10919
- if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
11533
+ if (viewMode === dateSetup.viewMode && viewDate) {
10920
11534
  var dates = dateSetup.dates;
10921
11535
  var index = dates.findIndex(function (d, i) {
10922
11536
  return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
@@ -10924,10 +11538,10 @@ var Gantt = function Gantt(_ref) {
10924
11538
  if (index === -1) {
10925
11539
  return;
10926
11540
  }
10927
- setCurrentViewDate(viewDate);
11541
+ setIgnoreScrollEvent(true);
10928
11542
  setScrollX(columnWidth * index);
10929
11543
  }
10930
- }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, currentViewDate, setCurrentViewDate]);
11544
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode]);
10931
11545
  react.useEffect(function () {
10932
11546
  var changedTask = ganttEvent.changedTask,
10933
11547
  action = ganttEvent.action;
@@ -10970,9 +11584,9 @@ var Gantt = function Gantt(_ref) {
10970
11584
  }, [taskListRef, listCellWidth]);
10971
11585
  react.useEffect(function () {
10972
11586
  if (wrapperRef.current) {
10973
- setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);
11587
+ setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth.current);
10974
11588
  }
10975
- }, [wrapperRef, taskListWidth]);
11589
+ }, [wrapperRef]);
10976
11590
  react.useEffect(function () {
10977
11591
  if (ganttHeight) {
10978
11592
  setSvgContainerHeight(ganttHeight + headerHeight);
@@ -11015,7 +11629,7 @@ var Gantt = function Gantt(_ref) {
11015
11629
  };
11016
11630
  }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
11017
11631
  var handleScrollY = function handleScrollY(event) {
11018
- if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {
11632
+ if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent.current) {
11019
11633
  setScrollY(event.currentTarget.scrollTop);
11020
11634
  setIgnoreScrollEvent(true);
11021
11635
  } else {
@@ -11023,7 +11637,7 @@ var Gantt = function Gantt(_ref) {
11023
11637
  }
11024
11638
  };
11025
11639
  var handleScrollX = function handleScrollX(event) {
11026
- if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
11640
+ if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent.current) {
11027
11641
  setScrollX(event.currentTarget.scrollLeft);
11028
11642
  setIgnoreScrollEvent(true);
11029
11643
  window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
@@ -11183,6 +11797,7 @@ var Gantt = function Gantt(_ref) {
11183
11797
  onProgressChange: onProgressChange,
11184
11798
  onDoubleClick: onDoubleClick,
11185
11799
  onClick: onClick,
11800
+ onContextMenu: onContextMenu,
11186
11801
  onDelete: onDelete
11187
11802
  };
11188
11803
  var tableProps = {
@@ -11220,15 +11835,15 @@ var Gantt = function Gantt(_ref) {
11220
11835
  }), ganttEvent.changedTask && react.createElement(Tooltip, {
11221
11836
  arrowIndent: arrowIndent,
11222
11837
  rowHeight: rowHeight,
11223
- svgContainerHeight: svgContainerHeight,
11224
- svgContainerWidth: svgContainerWidth,
11838
+ svgContainerHeight: svgContainerHeight.current,
11839
+ svgContainerWidth: svgContainerWidth.current,
11225
11840
  fontFamily: fontFamily,
11226
11841
  fontSize: fontSize,
11227
11842
  scrollX: scrollX,
11228
11843
  scrollY: scrollY,
11229
11844
  task: ganttEvent.changedTask,
11230
11845
  headerHeight: headerHeight,
11231
- taskListWidth: taskListWidth,
11846
+ taskListWidth: taskListWidth.current,
11232
11847
  TooltipContent: TooltipContent,
11233
11848
  rtl: rtl,
11234
11849
  svgWidth: svgWidth
@@ -11242,7 +11857,7 @@ var Gantt = function Gantt(_ref) {
11242
11857
  })), react.createElement(HorizontalScroll, {
11243
11858
  svgWidth: svgWidth,
11244
11859
  taskGanttRef: taskGanttRef,
11245
- taskListWidth: taskListWidth,
11860
+ taskListWidth: taskListWidth.current,
11246
11861
  scroll: scrollX,
11247
11862
  rtl: rtl,
11248
11863
  onScroll: handleScrollX
@@ -11263,6 +11878,7 @@ var format = function format(date, locale, options) {
11263
11878
  } catch (e) {
11264
11879
  console.error("time-formatters.ts format", date, locale, options);
11265
11880
  console.error(e);
11881
+ return "FORMAT-ERR";
11266
11882
  }
11267
11883
  };
11268
11884
  var dayFormatter = function dayFormatter(date, locale) {
@@ -11335,7 +11951,8 @@ var ProjectRow = function ProjectRow(_ref) {
11335
11951
  fontFamily = _ref.fontFamily,
11336
11952
  fontSize = _ref.fontSize,
11337
11953
  setSelectedTask = _ref.setSelectedTask,
11338
- onclickTaskList = _ref.onclickTaskList;
11954
+ onclickTaskList = _ref.onclickTaskList,
11955
+ oncontextmenuTaskList = _ref.oncontextmenuTaskList;
11339
11956
  var str = "";
11340
11957
  for (var i = 0; i < valuesToShow.length; i++) {
11341
11958
  str += "1fr ";
@@ -11354,6 +11971,11 @@ var ProjectRow = function ProjectRow(_ref) {
11354
11971
  onClick: function onClick() {
11355
11972
  setSelectedTask(id);
11356
11973
  onclickTaskList(id);
11974
+ },
11975
+ onContextMenu: function onContextMenu(e) {
11976
+ e.preventDefault();
11977
+ setSelectedTask(id);
11978
+ oncontextmenuTaskList(e, id);
11357
11979
  }
11358
11980
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11359
11981
  return react.createElement("span", {
@@ -11375,7 +11997,8 @@ var SubRow = function SubRow(_ref2) {
11375
11997
  fontFamily = _ref2.fontFamily,
11376
11998
  fontSize = _ref2.fontSize,
11377
11999
  setSelectedTask = _ref2.setSelectedTask,
11378
- onclickTaskList = _ref2.onclickTaskList;
12000
+ onclickTaskList = _ref2.onclickTaskList,
12001
+ oncontextmenuTaskList = _ref2.oncontextmenuTaskList;
11379
12002
  var str = "";
11380
12003
  for (var i = 0; i < valuesToShow.length + 1; i++) {
11381
12004
  str += "1fr ";
@@ -11394,6 +12017,11 @@ var SubRow = function SubRow(_ref2) {
11394
12017
  onClick: function onClick() {
11395
12018
  setSelectedTask(id);
11396
12019
  onclickTaskList(id);
12020
+ },
12021
+ onContextMenu: function onContextMenu(e) {
12022
+ e.preventDefault();
12023
+ setSelectedTask(id);
12024
+ oncontextmenuTaskList(e, id);
11397
12025
  }
11398
12026
  }, react.createElement("span", {
11399
12027
  key: "phase_" + id + "_valuesToShow_color",
@@ -11417,7 +12045,9 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11417
12045
  rowHeight = _ref3.rowHeight,
11418
12046
  rowWidth = _ref3.rowWidth,
11419
12047
  fontFamily = _ref3.fontFamily,
11420
- fontSize = _ref3.fontSize;
12048
+ fontSize = _ref3.fontSize,
12049
+ setSelectedTask = _ref3.setSelectedTask,
12050
+ oncontextmenuTaskList = _ref3.oncontextmenuTaskList;
11421
12051
  var str = "";
11422
12052
  for (var i = 0; i < valuesToShow.length; i++) {
11423
12053
  str += "1fr ";
@@ -11432,7 +12062,12 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11432
12062
  return react.createElement("div", {
11433
12063
  key: "detail_" + id,
11434
12064
  className: styles$9.timeline,
11435
- style: customStyle
12065
+ style: customStyle,
12066
+ onContextMenu: function onContextMenu(e) {
12067
+ e.preventDefault();
12068
+ setSelectedTask(id);
12069
+ oncontextmenuTaskList(e, id);
12070
+ }
11436
12071
  }, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
11437
12072
  return react.createElement("span", {
11438
12073
  className: index === 0 ? styles$9.main : undefined,
@@ -11441,7 +12076,7 @@ var TimelineSubRow = function TimelineSubRow(_ref3) {
11441
12076
  }, v);
11442
12077
  }));
11443
12078
  };
11444
- var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
12079
+ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, oncontextmenuTaskList, id) {
11445
12080
  var CustomTaskListTable = function CustomTaskListTable(_ref4) {
11446
12081
  var rowHeight = _ref4.rowHeight,
11447
12082
  rowWidth = _ref4.rowWidth,
@@ -11463,7 +12098,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11463
12098
  fontFamily: fontFamily,
11464
12099
  fontSize: fontSize,
11465
12100
  setSelectedTask: setSelectedTask,
11466
- onclickTaskList: onclickTaskList
12101
+ onclickTaskList: onclickTaskList,
12102
+ oncontextmenuTaskList: oncontextmenuTaskList
11467
12103
  }), task.type === "task" && react.createElement(SubRow, {
11468
12104
  key: task.id + "_" + task.type,
11469
12105
  task: task,
@@ -11472,7 +12108,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11472
12108
  fontFamily: fontFamily,
11473
12109
  fontSize: fontSize,
11474
12110
  setSelectedTask: setSelectedTask,
11475
- onclickTaskList: onclickTaskList
12111
+ onclickTaskList: onclickTaskList,
12112
+ oncontextmenuTaskList: oncontextmenuTaskList
11476
12113
  }), task.type === "timeline" && react.createElement(TimelineSubRow, {
11477
12114
  key: task.id + "_" + task.type,
11478
12115
  task: task,
@@ -11481,7 +12118,8 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id
11481
12118
  fontFamily: fontFamily,
11482
12119
  fontSize: fontSize,
11483
12120
  setSelectedTask: setSelectedTask,
11484
- onclickTaskList: onclickTaskList
12121
+ onclickTaskList: onclickTaskList,
12122
+ oncontextmenuTaskList: oncontextmenuTaskList
11485
12123
  }));
11486
12124
  }));
11487
12125
  };
@@ -11544,24 +12182,27 @@ var Planner = function Planner(props) {
11544
12182
  var _useState = react.useState(TimeUnit.MONTH),
11545
12183
  timeUnit = _useState[0],
11546
12184
  setTimeUnit = _useState[1];
11547
- var _useState2 = react.useState(props.mainGantt.items),
11548
- currentTasks = _useState2[0],
11549
- setCurrentTasks = _useState2[1];
11550
- var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
11551
- currentDetails = _useState3[0],
11552
- setCurrentDetails = _useState3[1];
11553
- var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
11554
- mainGanttDoubleView = _useState4[0],
11555
- setMainGanttDoubleView = _useState4[1];
11556
- var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
11557
- displayedDates = _useState5[0],
11558
- setDisplayedDates = _useState5[1];
11559
- var _useState6 = react.useState(),
11560
- viewDate = _useState6[0],
11561
- setViewDate = _useState6[1];
11562
- var _useState7 = react.useState(),
11563
- projection = _useState7[0],
11564
- setProjection = _useState7[1];
12185
+ var currentTasks = react.useRef(props.mainGantt.items);
12186
+ var setCurrentTasks = function setCurrentTasks(tasks) {
12187
+ currentTasks.current = tasks;
12188
+ };
12189
+ var currentDetails = react.useRef((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items);
12190
+ var setCurrentDetails = function setCurrentDetails(details) {
12191
+ currentDetails.current = details;
12192
+ };
12193
+ var _useState2 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12194
+ mainGanttDoubleView = _useState2[0],
12195
+ setMainGanttDoubleView = _useState2[1];
12196
+ var displayedDates = react.useRef(calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount));
12197
+ var setDisplayedDates = function setDisplayedDates(dates) {
12198
+ displayedDates.current = dates;
12199
+ };
12200
+ var _useState3 = react.useState(),
12201
+ viewDate = _useState3[0],
12202
+ setViewDate = _useState3[1];
12203
+ var _useState4 = react.useState(),
12204
+ projection = _useState4[0],
12205
+ setProjection = _useState4[1];
11565
12206
  var locale = "it-IT";
11566
12207
  var handleClick = function handleClick(row, onClick) {
11567
12208
  if (!row) {
@@ -11580,6 +12221,28 @@ var Planner = function Planner(props) {
11580
12221
  }
11581
12222
  onClick === null || onClick === void 0 ? void 0 : onClick(row);
11582
12223
  };
12224
+ var handleContextMenu = function handleContextMenu(event, row, onContextMenu) {
12225
+ if (!row) {
12226
+ return;
12227
+ }
12228
+ if (row.type === "task" && props.secondaryGantt) {
12229
+ var _phase$color2;
12230
+ var phase = row;
12231
+ setProjection({
12232
+ start: new Date(phase.startDate),
12233
+ end: new Date(phase.endDate),
12234
+ color: (_phase$color2 = phase.color) != null ? _phase$color2 : "#ED7D31"
12235
+ });
12236
+ } else {
12237
+ setProjection(undefined);
12238
+ }
12239
+ onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event, row);
12240
+ };
12241
+ var handleSetDoubleView = function handleSetDoubleView(checked) {
12242
+ var _props$onSetDoubleVie;
12243
+ setMainGanttDoubleView(checked);
12244
+ (_props$onSetDoubleVie = props.onSetDoubleView) === null || _props$onSetDoubleVie === void 0 ? void 0 : _props$onSetDoubleVie.call(props, checked);
12245
+ };
11583
12246
  var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
11584
12247
  var id = task === null || task === void 0 ? void 0 : task.id;
11585
12248
  if (!id) {
@@ -11637,26 +12300,32 @@ var Planner = function Planner(props) {
11637
12300
  setProjection(undefined);
11638
12301
  }, [props]);
11639
12302
  react.useEffect(function () {
11640
- var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
12303
+ var dates = calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount);
11641
12304
  setDisplayedDates(dates);
11642
12305
  if (!viewDate) {
11643
- setViewDate(dates.displayedStartDate);
12306
+ var now = new Date();
12307
+ if (dates.displayedStartDate <= now && dates.displayedEndDate >= now) {
12308
+ setViewDate(now);
12309
+ } else {
12310
+ setViewDate(dates.displayedStartDate);
12311
+ }
11644
12312
  }
11645
- }, [currentTasks, currentDetails]);
12313
+ }, [timeUnit, mainGanttDoubleView, props.preStepsCount, viewDate]);
11646
12314
  var tasks = [];
11647
- for (var i = 0; i < currentTasks.length; i++) {
11648
- tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12315
+ for (var i = 0; i < currentTasks.current.length; i++) {
12316
+ tasks.push.apply(tasks, convertProjectToTasks(currentTasks.current[i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11649
12317
  }
11650
12318
  var details = [];
11651
- if (currentDetails) {
11652
- for (var _i = 0; _i < currentDetails.length; _i++) {
11653
- details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
12319
+ if (currentDetails.current) {
12320
+ for (var _i = 0; _i < currentDetails.current.length; _i++) {
12321
+ details.push.apply(details, convertProjectToTasks(currentDetails.current[_i], formatToIsoDate(displayedDates.current.displayedStartDate), formatToIsoDate(displayedDates.current.displayedEndDate)));
11654
12322
  }
11655
12323
  }
11656
12324
  console.log("PLANNER render");
11657
12325
  return react.createElement("div", null, react.createElement(Switcher, {
11658
12326
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
11659
- return setTimeUnit(timeUnit);
12327
+ setTimeUnit(timeUnit);
12328
+ setViewDate(undefined);
11660
12329
  }
11661
12330
  }), react.createElement("div", {
11662
12331
  style: {
@@ -11671,34 +12340,52 @@ var Planner = function Planner(props) {
11671
12340
  showSecondaryDates: mainGanttDoubleView,
11672
12341
  hideDependencies: props.mainGantt.hideDependencies,
11673
12342
  ganttHeight: props.mainGantt.ganttHeight,
11674
- displayedStartDate: displayedDates.displayedStartDate,
11675
- displayedEndDate: displayedDates.displayedEndDate,
12343
+ displayedStartDate: displayedDates.current.displayedStartDate,
12344
+ displayedEndDate: displayedDates.current.displayedEndDate,
11676
12345
  viewDate: viewDate,
11677
12346
  tasks: tasks,
12347
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11678
12348
  viewMode: toViewMode(timeUnit)
11679
12349
  }, props.mainGantt.stylingOptions, {
11680
- TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView),
12350
+ TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, handleSetDoubleView),
11681
12351
  TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
11682
- var row = getProjectById(id, currentTasks);
12352
+ var row = getProjectById(id, currentTasks.current);
11683
12353
  if (!row) {
11684
- row = getPhaseById(id, currentTasks);
12354
+ row = getPhaseById(id, currentTasks.current);
11685
12355
  }
11686
12356
  if (row) {
11687
12357
  handleClick(row, props.mainGantt.onClick);
11688
12358
  }
12359
+ }, function (event, id) {
12360
+ var row = getProjectById(id, currentTasks.current);
12361
+ if (!row) {
12362
+ row = getPhaseById(id, currentTasks.current);
12363
+ }
12364
+ if (row) {
12365
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12366
+ }
11689
12367
  }, MAIN_GANTT_ID),
11690
12368
  TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
11691
- onClick: function onClick(e) {
11692
- var row = getProjectById(e.id, currentTasks);
12369
+ onClick: function onClick(task) {
12370
+ var row = getProjectById(task.id, currentTasks.current);
11693
12371
  if (!row) {
11694
- row = getPhaseById(e.id, currentTasks);
12372
+ row = getPhaseById(task.id, currentTasks.current);
11695
12373
  }
11696
12374
  if (row) {
11697
12375
  handleClick(row, props.mainGantt.onClick);
11698
12376
  }
11699
12377
  },
11700
- onDateChange: function onDateChange(e) {
11701
- return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
12378
+ onContextMenu: function onContextMenu(event, task) {
12379
+ var row = getProjectById(task.id, currentTasks.current);
12380
+ if (!row) {
12381
+ row = getPhaseById(task.id, currentTasks.current);
12382
+ }
12383
+ if (row) {
12384
+ handleContextMenu(event, row, props.mainGantt.onContextMenu);
12385
+ }
12386
+ },
12387
+ onDateChange: function onDateChange(task) {
12388
+ return handleDateChange(task, currentTasks.current, props.mainGantt.onDateChange);
11702
12389
  },
11703
12390
  locale: locale,
11704
12391
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11710,29 +12397,45 @@ var Planner = function Planner(props) {
11710
12397
  showSecondaryDates: mainGanttDoubleView,
11711
12398
  hideDependencies: props.secondaryGantt.hideDependencies,
11712
12399
  ganttHeight: props.secondaryGantt.ganttHeight,
11713
- displayedStartDate: displayedDates.displayedStartDate,
11714
- displayedEndDate: displayedDates.displayedEndDate,
12400
+ displayedStartDate: displayedDates.current.displayedStartDate,
12401
+ displayedEndDate: displayedDates.current.displayedEndDate,
11715
12402
  viewDate: viewDate,
11716
12403
  tasks: details,
12404
+ columnWidth: columnWidthForTimeUnit(timeUnit),
11717
12405
  viewMode: toViewMode(timeUnit)
11718
12406
  }, props.mainGantt.stylingOptions, {
11719
12407
  TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
11720
12408
  TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
11721
12409
  console.log("planner.tsx secondaryGantt Clicked on " + id);
12410
+ }, function (event, id) {
12411
+ if (props.secondaryGantt) {
12412
+ var row = getProjectById(id, currentDetails.current);
12413
+ if (row) {
12414
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12415
+ }
12416
+ }
11722
12417
  }, SECONDARY_GANTT_ID),
11723
12418
  TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
11724
12419
  projection: projection,
11725
- onClick: function onClick(e) {
12420
+ onClick: function onClick(task) {
11726
12421
  if (props.secondaryGantt) {
11727
- var row = getProjectById(e.id, currentDetails);
12422
+ var row = getProjectById(task.id, currentDetails.current);
11728
12423
  if (row) {
11729
12424
  handleClick(row, props.secondaryGantt.onClick);
11730
12425
  }
11731
12426
  }
11732
12427
  },
11733
- onDateChange: function onDateChange(e) {
12428
+ onContextMenu: function onContextMenu(event, task) {
12429
+ if (props.secondaryGantt) {
12430
+ var row = getProjectById(task.id, currentDetails.current);
12431
+ if (row) {
12432
+ handleContextMenu(event, row, props.secondaryGantt.onContextMenu);
12433
+ }
12434
+ }
12435
+ },
12436
+ onDateChange: function onDateChange(task) {
11734
12437
  var _props$secondaryGantt7;
11735
- return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
12438
+ return handleDateChange(task, currentDetails.current, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
11736
12439
  },
11737
12440
  locale: locale,
11738
12441
  dateTimeFormatters: ganttDateTimeFormatters
@@ -11791,15 +12494,8 @@ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValu
11791
12494
  return valuesToShow;
11792
12495
  }
11793
12496
 
11794
- const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;dominant-baseline:central;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
12497
+ 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}";
11795
12498
 
11796
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11797
- if (kind === "a" && !f)
11798
- throw new TypeError("Private accessor was defined without a getter");
11799
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
11800
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
11801
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11802
- };
11803
12499
  var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11804
12500
  if (kind === "m")
11805
12501
  throw new TypeError("Private method is not writable");
@@ -11809,7 +12505,14 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
11809
12505
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
11810
12506
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11811
12507
  };
11812
- var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter;
12508
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12509
+ if (kind === "a" && !f)
12510
+ throw new TypeError("Private accessor was defined without a getter");
12511
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12512
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
12513
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12514
+ };
12515
+ 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;
11813
12516
  const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11814
12517
  constructor() {
11815
12518
  super();
@@ -11818,14 +12521,17 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11818
12521
  this.kupClick = createEvent(this, "kup-planner-click", 6);
11819
12522
  this.kupDateChange = createEvent(this, "kup-planner-datechange", 6);
11820
12523
  this.kupReady = createEvent(this, "kup-planner-ready", 6);
12524
+ this.kupContextMenu = createEvent(this, "kup-planner-contextmenu", 6);
11821
12525
  _KupPlanner_instances.add(this);
11822
12526
  /*-------------------------------------------------*/
11823
12527
  /* I n t e r n a l V a r i a b l e s */
11824
12528
  /*-------------------------------------------------*/
11825
12529
  _KupPlanner_kupManager.set(this, kupManagerInstance());
11826
- _KupPlanner_rootPlanner.set(this, void 0);
11827
12530
  _KupPlanner_lastOnChangeReceived.set(this, void 0);
11828
- this.plannerProps = undefined;
12531
+ _KupPlanner_rootPlanner.set(this, void 0);
12532
+ _KupPlanner_phases.set(this, {});
12533
+ // no re-render
12534
+ _KupPlanner_showSecondaryDatesLocal.set(this, false);
11829
12535
  this.customStyle = '';
11830
12536
  this.data = undefined;
11831
12537
  this.detailData = undefined;
@@ -11833,6 +12539,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11833
12539
  this.detailColumns = undefined;
11834
12540
  this.detailDates = undefined;
11835
12541
  this.detailHeight = undefined;
12542
+ this.detailIconCol = undefined;
11836
12543
  this.detailIdCol = undefined;
11837
12544
  this.detailNameCol = undefined;
11838
12545
  this.detailPrevDates = undefined;
@@ -11842,6 +12549,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11842
12549
  this.phaseColumns = undefined;
11843
12550
  this.phaseColParDep = undefined;
11844
12551
  this.phaseDates = undefined;
12552
+ this.phaseIconCol = undefined;
11845
12553
  this.phaseIdCol = undefined;
11846
12554
  this.phaseNameCol = undefined;
11847
12555
  this.phasePrevDates = undefined;
@@ -11849,26 +12557,23 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11849
12557
  this.taskColumns = undefined;
11850
12558
  this.taskDates = undefined;
11851
12559
  this.taskHeight = undefined;
12560
+ this.taskIconCol = undefined;
11852
12561
  this.taskIdCol = undefined;
11853
12562
  this.taskNameCol = undefined;
11854
12563
  this.taskPrevDates = undefined;
11855
12564
  this.titleMess = undefined;
12565
+ this.plannerProps = undefined;
11856
12566
  }
11857
- onKupClick(event, taskAction) {
11858
- this.kupClick.emit({
11859
- comp: this,
11860
- id: this.rootElement.id,
11861
- value: event,
11862
- taskAction: taskAction,
11863
- });
12567
+ dataChanged() {
12568
+ __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
11864
12569
  }
11865
- onKupDateChange(event, taskAction) {
11866
- this.kupDateChange.emit({
11867
- comp: this,
11868
- id: this.rootElement.id,
11869
- value: event,
11870
- taskAction: taskAction,
11871
- });
12570
+ showSecondaryDatesChanged() {
12571
+ var _a;
12572
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12573
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12574
+ this.plannerProps.mainGantt.showSecondaryDates =
12575
+ this.showSecondaryDates;
12576
+ }
11872
12577
  }
11873
12578
  /*-------------------------------------------------*/
11874
12579
  /* P u b l i c M e t h o d s */
@@ -11903,6 +12608,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11903
12608
  var _a;
11904
12609
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
11905
12610
  if (task) {
12611
+ __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
11906
12612
  task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]])).map((row) => {
11907
12613
  const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
11908
12614
  const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
@@ -11910,6 +12616,8 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11910
12616
  : col == this.phaseDates[1]
11911
12617
  ? '#END#'
11912
12618
  : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12619
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12620
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
11913
12621
  let phase = {
11914
12622
  taskRow: task.taskRow,
11915
12623
  phaseRow: row,
@@ -11926,48 +12634,22 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11926
12634
  selectedColor: row.cells[this.phaseColorCol].value,
11927
12635
  valuesToShow: valuesToShow,
11928
12636
  rowType: KupPlannerGanttRowType.PHASE,
12637
+ icon: iconUrl
12638
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12639
+ : undefined,
11929
12640
  };
11930
12641
  return phase;
11931
12642
  });
11932
12643
  }
11933
12644
  this.plannerProps = Object.assign({}, this.plannerProps);
11934
12645
  }
11935
- handleOnClick(nativeEvent) {
11936
- console.log('kup-planner.handleOnClick', nativeEvent);
11937
- switch (nativeEvent.rowType) {
11938
- case KupPlannerGanttRowType.TASK:
11939
- const taskAction = nativeEvent.phases
11940
- ? KupPlannerTaskAction.onTaskClosing
11941
- : KupPlannerTaskAction.onTaskOpening;
11942
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
11943
- this.onKupClick(nativeEvent, taskAction);
11944
- }
11945
- break;
11946
- case KupPlannerGanttRowType.PHASE:
11947
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
11948
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11949
- }
11950
- break;
11951
- case KupPlannerGanttRowType.DETAIL:
11952
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
11953
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
11954
- }
11955
- break;
11956
- }
11957
- }
11958
- handleOnDateChange(nativeEvent) {
11959
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
11960
- if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
11961
- console.log('kup-planner.handleOnDateChange', nativeEvent);
11962
- this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
11963
- }
11964
- }
11965
- }
12646
+ //---- Lifecycle hooks ----
11966
12647
  componentWillLoad() {
11967
12648
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
11968
12649
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
11969
12650
  }
11970
12651
  componentDidLoad() {
12652
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
11971
12653
  let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
11972
12654
  if (details && details.length == 0) {
11973
12655
  details = undefined;
@@ -11986,8 +12668,9 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11986
12668
  filter: mainFilter,
11987
12669
  hideLabel: true,
11988
12670
  ganttHeight: this.taskHeight,
11989
- showSecondaryDates: this.showSecondaryDates,
12671
+ showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_showSecondaryDatesLocal, "f"),
11990
12672
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12673
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
11991
12674
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
11992
12675
  },
11993
12676
  secondaryGantt: details
@@ -11999,9 +12682,11 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11999
12682
  hideLabel: true,
12000
12683
  ganttHeight: this.detailHeight,
12001
12684
  onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12685
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12002
12686
  onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12003
12687
  }
12004
12688
  : undefined,
12689
+ onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
12005
12690
  };
12006
12691
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12007
12692
  this.kupReady.emit({
@@ -12017,9 +12702,116 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12017
12702
  componentDidRender() {
12018
12703
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12019
12704
  }
12705
+ onKupClick(event, taskAction) {
12706
+ this.kupClick.emit({
12707
+ comp: this,
12708
+ id: this.rootElement.id,
12709
+ value: event,
12710
+ taskAction: taskAction,
12711
+ });
12712
+ }
12713
+ onKupContextMenu(event, ganttRow, taskAction) {
12714
+ let row;
12715
+ let cell;
12716
+ let column;
12717
+ switch (ganttRow.type) {
12718
+ case 'project': {
12719
+ row = ganttRow.taskRow;
12720
+ cell = row.cells[this.taskIdCol];
12721
+ column = this.data.columns[this.taskIdCol];
12722
+ break;
12723
+ }
12724
+ case 'task': {
12725
+ row = ganttRow.phaseRow;
12726
+ cell = row.cells[this.phaseIdCol];
12727
+ //column = this.data.columns[this.taskIdCol];
12728
+ break;
12729
+ }
12730
+ case 'timeline': {
12731
+ row = ganttRow.detailRow;
12732
+ cell = row.cells[this.detailIdCol];
12733
+ column = this.data.columns[this.detailIdCol];
12734
+ break;
12735
+ }
12736
+ }
12737
+ this.kupContextMenu.emit({
12738
+ comp: this,
12739
+ id: this.rootElement.id,
12740
+ value: ganttRow,
12741
+ taskAction: taskAction,
12742
+ details: {
12743
+ cell: cell,
12744
+ column: column,
12745
+ originalEvent: event,
12746
+ row: row,
12747
+ },
12748
+ });
12749
+ }
12750
+ onKupDateChange(event, taskAction) {
12751
+ this.kupDateChange.emit({
12752
+ comp: this,
12753
+ id: this.rootElement.id,
12754
+ value: event,
12755
+ taskAction: taskAction,
12756
+ });
12757
+ }
12758
+ handleOnClick(nativeEvent) {
12759
+ switch (nativeEvent.rowType) {
12760
+ case KupPlannerGanttRowType.TASK:
12761
+ const taskAction = nativeEvent.phases
12762
+ ? KupPlannerTaskAction.onTaskClosing
12763
+ : KupPlannerTaskAction.onTaskOpening;
12764
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12765
+ this.onKupClick(nativeEvent, taskAction);
12766
+ }
12767
+ break;
12768
+ case KupPlannerGanttRowType.PHASE:
12769
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12770
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12771
+ }
12772
+ break;
12773
+ case KupPlannerGanttRowType.DETAIL:
12774
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12775
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12776
+ }
12777
+ break;
12778
+ }
12779
+ }
12780
+ handleOnContextMenu(event, row) {
12781
+ switch (row.rowType) {
12782
+ case KupPlannerGanttRowType.TASK:
12783
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12784
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12785
+ }
12786
+ break;
12787
+ case KupPlannerGanttRowType.PHASE:
12788
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12789
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12790
+ }
12791
+ break;
12792
+ case KupPlannerGanttRowType.DETAIL:
12793
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12794
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12795
+ }
12796
+ break;
12797
+ }
12798
+ }
12799
+ handleOnSetDoubleView(checked) {
12800
+ var _a;
12801
+ __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, checked, "f");
12802
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12803
+ this.plannerProps.mainGantt.showSecondaryDates = checked;
12804
+ }
12805
+ }
12806
+ handleOnDateChange(nativeEvent) {
12807
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12808
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12809
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12810
+ }
12811
+ }
12812
+ }
12020
12813
  render() {
12021
12814
  var _a;
12022
- //console.log('kup-planner.tsx render');
12023
12815
  return (h(Host, null, h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId, style: { maxWidth: this.maxWidth } }), h(FTextField, { icon: KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12024
12816
  if (e.key === 'Enter') {
12025
12817
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
@@ -12034,6 +12826,10 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12034
12826
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12035
12827
  }
12036
12828
  get rootElement() { return this; }
12829
+ static get watchers() { return {
12830
+ "data": ["dataChanged"],
12831
+ "showSecondaryDates": ["showSecondaryDatesChanged"]
12832
+ }; }
12037
12833
  static get style() { return kupPlannerCss; }
12038
12834
  }, [1, "kup-planner", {
12039
12835
  "customStyle": [1, "custom-style"],
@@ -12043,6 +12839,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12043
12839
  "detailColumns": [16],
12044
12840
  "detailDates": [16],
12045
12841
  "detailHeight": [2, "detail-height"],
12842
+ "detailIconCol": [1, "detail-icon-col"],
12046
12843
  "detailIdCol": [1, "detail-id-col"],
12047
12844
  "detailNameCol": [1, "detail-name-col"],
12048
12845
  "detailPrevDates": [16],
@@ -12052,6 +12849,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12052
12849
  "phaseColumns": [16],
12053
12850
  "phaseColParDep": [1, "phase-col-par-dep"],
12054
12851
  "phaseDates": [16],
12852
+ "phaseIconCol": [1, "phase-icon-col"],
12055
12853
  "phaseIdCol": [1, "phase-id-col"],
12056
12854
  "phaseNameCol": [1, "phase-name-col"],
12057
12855
  "phasePrevDates": [16],
@@ -12059,6 +12857,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12059
12857
  "taskColumns": [16],
12060
12858
  "taskDates": [16],
12061
12859
  "taskHeight": [2, "task-height"],
12860
+ "taskIconCol": [1, "task-icon-col"],
12062
12861
  "taskIdCol": [1, "task-id-col"],
12063
12862
  "taskNameCol": [1, "task-name-col"],
12064
12863
  "taskPrevDates": [16],
@@ -12069,7 +12868,7 @@ const KupPlanner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
12069
12868
  "setProps": [64],
12070
12869
  "addPhases": [64]
12071
12870
  }]);
12072
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12871
+ _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() {
12073
12872
  var _a;
12074
12873
  (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12075
12874
  const componentWrapperElement = this.rootElement.shadowRoot.getElementById(componentWrapperId);
@@ -12081,7 +12880,13 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12081
12880
  var _a;
12082
12881
  let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]])).map((row) => {
12083
12882
  const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12084
- const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12883
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12884
+ ? '#START#'
12885
+ : col == this.taskDates[1]
12886
+ ? '#END#'
12887
+ : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12888
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
12889
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
12085
12890
  let task = {
12086
12891
  taskRow: row,
12087
12892
  taskRowId: row.id,
@@ -12094,6 +12899,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12094
12899
  type: 'project',
12095
12900
  valuesToShow: valuesToShow,
12096
12901
  rowType: KupPlannerGanttRowType.TASK,
12902
+ icon: iconUrl
12903
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12904
+ : undefined,
12097
12905
  };
12098
12906
  return task;
12099
12907
  });
@@ -12116,6 +12924,7 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12116
12924
  detail = {
12117
12925
  id: detailId,
12118
12926
  name: detailNameId,
12927
+ detailRow: row,
12119
12928
  type: 'timeline',
12120
12929
  valuesToShow: valuesToShow,
12121
12930
  rowType: KupPlannerGanttRowType.DETAIL,
@@ -12123,6 +12932,8 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12123
12932
  };
12124
12933
  details.push(detail);
12125
12934
  }
12935
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
12936
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
12126
12937
  detail.schedule.push({
12127
12938
  startDate: datesSanitized.dateValues[0],
12128
12939
  endDate: datesSanitized.dateValues[1],
@@ -12132,6 +12943,9 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12132
12943
  selectedColor: this.detailColorCol
12133
12944
  ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12134
12945
  : '#D9D9D8',
12946
+ icon: iconUrl
12947
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12948
+ : undefined,
12135
12949
  });
12136
12950
  });
12137
12951
  return details;
@@ -12141,9 +12955,6 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12141
12955
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12142
12956
  if (task)
12143
12957
  task.phases = undefined;
12144
- // this.plannerProps.mainGantt = JSON.parse(
12145
- // JSON.stringify(this.plannerProps.mainGantt)
12146
- // );
12147
12958
  this.plannerProps = Object.assign({}, this.plannerProps);
12148
12959
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
12149
12960
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -12155,6 +12966,12 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12155
12966
  return true;
12156
12967
  }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12157
12968
  return true;
12969
+ }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
12970
+ return true;
12971
+ }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
12972
+ return true;
12973
+ }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
12974
+ return true;
12158
12975
  }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
12159
12976
  let emitEvent = false;
12160
12977
  if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
@@ -12173,19 +12990,28 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12173
12990
  };
12174
12991
  const value = e.target.value;
12175
12992
  const data = isDetail ? this.detailData : this.data;
12993
+ const tempRows = [];
12176
12994
  for (let index = 0; index < data.rows.length; index++) {
12177
12995
  const row = data.rows[index];
12178
- const valuesToShow = isDetail
12179
- ? getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns)
12180
- : getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
12181
- for (let index = 0; index < valuesToShow.length; index++) {
12182
- const valueToShow = valuesToShow[index];
12183
- if (valueToShow.toLowerCase().indexOf(value.toLowerCase()) > -1) {
12184
- tempData.rows.push(row);
12185
- break;
12996
+ const cells = row.cells;
12997
+ for (let index = 0; index < data.columns.length; index++) {
12998
+ const column = data.columns[index];
12999
+ const cell = cells[column.name];
13000
+ if (cell) {
13001
+ const dValue = getCellValueForDisplay(data.columns[index], cell);
13002
+ const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
13003
+ if (found) {
13004
+ tempRows.push({ row, weight: index });
13005
+ break;
13006
+ }
12186
13007
  }
12187
13008
  }
12188
13009
  }
13010
+ tempRows
13011
+ .sort((a, b) => a.weight - b.weight)
13012
+ .forEach((tempRow) => {
13013
+ tempData.rows.push(tempRow.row);
13014
+ });
12189
13015
  const newGantt = isDetail
12190
13016
  ? {
12191
13017
  secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
@@ -12194,6 +13020,32 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
12194
13020
  mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12195
13021
  };
12196
13022
  this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
13023
+ }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
13024
+ var _a;
13025
+ let iconUrl = undefined;
13026
+ if (columnName) {
13027
+ const iconCell = row.cells[columnName];
13028
+ let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
13029
+ if (!icon) {
13030
+ icon = iconCell.value;
13031
+ }
13032
+ if (icon) {
13033
+ iconUrl = getAssetPath('./assets/svg/' + icon + '.svg');
13034
+ }
13035
+ }
13036
+ return iconUrl;
13037
+ }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13038
+ var _a;
13039
+ let iconColor = undefined;
13040
+ if (columnName) {
13041
+ const iconCell = row.cells[columnName];
13042
+ iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13043
+ if (iconColor) {
13044
+ iconColor =
13045
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13046
+ }
13047
+ }
13048
+ return iconColor;
12197
13049
  };
12198
13050
  function defineCustomElement$1() {
12199
13051
  if (typeof customElements === "undefined") {