@sme.up/ketchup 8.0.2 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/dist/cjs/{GenericVariables-a9ed17ee.js → GenericVariables-9cd88034.js} +3 -3
  2. package/dist/cjs/{component-85c2bd4d.js → component-2c7ddef7.js} +91 -10
  3. package/dist/cjs/{f-button-9524bbf7.js → f-button-797c8e7f.js} +99 -99
  4. package/dist/cjs/{f-button-declarations-b611587f.js → f-button-declarations-76b4fb4c.js} +16 -16
  5. package/dist/cjs/{f-cell-bcb75ade.js → f-cell-9c8ed48b.js} +478 -472
  6. package/dist/cjs/{f-checkbox-1148e791.js → f-checkbox-cff77b2c.js} +23 -23
  7. package/dist/cjs/{f-chip-2249b386.js → f-chip-318863df.js} +125 -125
  8. package/dist/cjs/{f-image-47d74999.js → f-image-f10144e9.js} +107 -107
  9. package/dist/cjs/{f-paginator-utils-b0a9ae5f.js → f-paginator-utils-8c44a37b.js} +1548 -1548
  10. package/dist/cjs/{f-text-field-579c0fc0.js → f-text-field-9610c198.js} +172 -172
  11. package/dist/cjs/{f-text-field-mdc-0e22f3e3.js → f-text-field-mdc-d38d80b5.js} +59 -60
  12. package/dist/cjs/{index-1f177abc.js → index-a9a3b467.js} +93 -24
  13. package/dist/cjs/ketchup.cjs.js +3 -3
  14. package/dist/cjs/kup-accordion.cjs.entry.js +199 -200
  15. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +17557 -17508
  16. package/dist/cjs/kup-box.cjs.entry.js +1289 -1232
  17. package/dist/cjs/kup-calendar.cjs.entry.js +9542 -10035
  18. package/dist/cjs/kup-cell.cjs.entry.js +172 -172
  19. package/dist/cjs/kup-dash-list.cjs.entry.js +106 -106
  20. package/dist/cjs/kup-dash_2.cjs.entry.js +162 -162
  21. package/dist/cjs/kup-dashboard.cjs.entry.js +400 -401
  22. package/dist/cjs/kup-drawer.cjs.entry.js +138 -138
  23. package/dist/cjs/kup-echart.cjs.entry.js +7228 -6598
  24. package/dist/cjs/kup-family-tree.cjs.entry.js +439 -439
  25. package/dist/cjs/kup-iframe.cjs.entry.js +94 -94
  26. package/dist/cjs/kup-image-list.cjs.entry.js +255 -256
  27. package/dist/cjs/kup-lazy.cjs.entry.js +186 -186
  28. package/dist/cjs/kup-magic-box.cjs.entry.js +298 -298
  29. package/dist/cjs/{kup-manager-85b2a756.js → kup-manager-7747decd.js} +7287 -7287
  30. package/dist/cjs/kup-nav-bar.cjs.entry.js +130 -130
  31. package/dist/cjs/kup-numeric-picker.cjs.entry.js +367 -368
  32. package/dist/cjs/kup-photo-frame.cjs.entry.js +144 -144
  33. package/dist/cjs/kup-planner.cjs.entry.js +1185 -1027
  34. package/dist/cjs/kup-probe.cjs.entry.js +246 -246
  35. package/dist/cjs/kup-qlik.cjs.entry.js +138 -138
  36. package/dist/cjs/kup-snackbar.cjs.entry.js +116 -116
  37. package/dist/cjs/loader.cjs.js +3 -3
  38. package/dist/collection/assets/dash-list.js +466 -293
  39. package/dist/collection/assets/data-table.js +45 -0
  40. package/dist/collection/assets/echart.js +176 -0
  41. package/dist/collection/assets/index.js +4 -0
  42. package/dist/collection/assets/planner.js +8189 -0
  43. package/dist/collection/collection-manifest.json +2 -2
  44. package/dist/collection/components/kup-accordion/kup-accordion-declarations.js +10 -10
  45. package/dist/collection/components/kup-accordion/kup-accordion.js +445 -445
  46. package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +27 -27
  47. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +908 -908
  48. package/dist/collection/components/kup-badge/kup-badge-declarations.js +10 -10
  49. package/dist/collection/components/kup-badge/kup-badge.js +276 -276
  50. package/dist/collection/components/kup-box/kup-box-declarations.js +33 -33
  51. package/dist/collection/components/kup-box/kup-box-state.js +15 -15
  52. package/dist/collection/components/kup-box/kup-box.js +2134 -2079
  53. package/dist/collection/components/kup-button/kup-button-declarations.js +18 -18
  54. package/dist/collection/components/kup-button/kup-button.js +580 -580
  55. package/dist/collection/components/kup-button-list/kup-button-list-declarations.js +13 -13
  56. package/dist/collection/components/kup-button-list/kup-button-list.e2e.js +144 -0
  57. package/dist/collection/components/kup-button-list/kup-button-list.js +527 -527
  58. package/dist/collection/components/kup-calendar/kup-calendar-declarations.js +35 -35
  59. package/dist/collection/components/kup-calendar/kup-calendar.css +0 -4
  60. package/dist/collection/components/kup-calendar/kup-calendar.js +690 -690
  61. package/dist/collection/components/kup-card/box/kup-card-box.js +227 -227
  62. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +56 -56
  63. package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +393 -393
  64. package/dist/collection/components/kup-card/built-in/kup-card-clock.js +308 -308
  65. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +165 -165
  66. package/dist/collection/components/kup-card/built-in/kup-card-message-box.js +10 -10
  67. package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +118 -118
  68. package/dist/collection/components/kup-card/collapsible/kup-card-collapsible.js +64 -64
  69. package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +217 -217
  70. package/dist/collection/components/kup-card/free/kup-card-free.js +22 -22
  71. package/dist/collection/components/kup-card/kup-card-declarations.js +98 -98
  72. package/dist/collection/components/kup-card/kup-card-helper.js +196 -196
  73. package/dist/collection/components/kup-card/kup-card.js +809 -809
  74. package/dist/collection/components/kup-card/scalable/kup-card-scalable.js +251 -251
  75. package/dist/collection/components/kup-card/standard/kup-card-standard.js +593 -593
  76. package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -11
  77. package/dist/collection/components/kup-cell/kup-cell.js +401 -401
  78. package/dist/collection/components/kup-chart/kup-chart-builder.js +93 -93
  79. package/dist/collection/components/kup-chart/kup-chart-declarations.js +49 -49
  80. package/dist/collection/components/kup-chart/kup-chart.js +1080 -1080
  81. package/dist/collection/components/kup-checkbox/kup-checkbox-declarations.js +13 -13
  82. package/dist/collection/components/kup-checkbox/kup-checkbox.js +433 -433
  83. package/dist/collection/components/kup-chip/kup-chip-declarations.js +12 -12
  84. package/dist/collection/components/kup-chip/kup-chip.js +558 -558
  85. package/dist/collection/components/kup-color-picker/kup-color-picker-declarations.js +12 -12
  86. package/dist/collection/components/kup-color-picker/kup-color-picker.js +546 -546
  87. package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +15 -15
  88. package/dist/collection/components/kup-combobox/kup-combobox.js +821 -821
  89. package/dist/collection/components/kup-dash/kup-dash.js +171 -171
  90. package/dist/collection/components/kup-dash-list/kup-dash-list.js +327 -327
  91. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -10
  92. package/dist/collection/components/kup-dashboard/kup-dashboard.js +588 -588
  93. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +157 -156
  94. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +808 -808
  95. package/dist/collection/components/kup-data-table/kup-data-table-state.js +36 -36
  96. package/dist/collection/components/kup-data-table/kup-data-table.css +1 -0
  97. package/dist/collection/components/kup-data-table/kup-data-table.js +5572 -5527
  98. package/dist/collection/components/kup-date-picker/kup-date-picker-declarations.js +18 -18
  99. package/dist/collection/components/kup-date-picker/kup-date-picker.js +816 -816
  100. package/dist/collection/components/kup-dialog/kup-dialog-declarations.js +14 -14
  101. package/dist/collection/components/kup-dialog/kup-dialog.js +467 -467
  102. package/dist/collection/components/kup-drawer/kup-drawer-declarations.js +10 -10
  103. package/dist/collection/components/kup-drawer/kup-drawer.e2e.js +9 -0
  104. package/dist/collection/components/kup-drawer/kup-drawer.js +383 -383
  105. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button-declarations.js +18 -18
  106. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +800 -800
  107. package/dist/collection/components/kup-echart/kup-echart-declarations.js +53 -52
  108. package/dist/collection/components/kup-echart/kup-echart.js +1519 -1437
  109. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +15 -15
  110. package/dist/collection/components/kup-family-tree/kup-family-tree.js +829 -829
  111. package/dist/collection/components/kup-form/kup-form-declarations.js +29 -29
  112. package/dist/collection/components/kup-form/kup-form.js +734 -731
  113. package/dist/collection/components/kup-gauge/kup-gauge-declarations.js +26 -26
  114. package/dist/collection/components/kup-gauge/kup-gauge.js +764 -764
  115. package/dist/collection/components/kup-grid/kup-grid-declarations.js +10 -10
  116. package/dist/collection/components/kup-grid/kup-grid.js +253 -253
  117. package/dist/collection/components/kup-iframe/kup-iframe-declarations.js +10 -10
  118. package/dist/collection/components/kup-iframe/kup-iframe.js +281 -281
  119. package/dist/collection/components/kup-image/canvas/kup-image-canvas-declarations.js +184 -184
  120. package/dist/collection/components/kup-image/canvas/kup-image-canvas-helper.js +19 -19
  121. package/dist/collection/components/kup-image/canvas/kup-image-canvas.js +225 -225
  122. package/dist/collection/components/kup-image/kup-image-declarations.js +16 -16
  123. package/dist/collection/components/kup-image/kup-image.js +491 -491
  124. package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -10
  125. package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -9
  126. package/dist/collection/components/kup-image-list/kup-image-list.js +533 -533
  127. package/dist/collection/components/kup-lazy/kup-lazy-declarations.js +20 -20
  128. package/dist/collection/components/kup-lazy/kup-lazy.js +430 -430
  129. package/dist/collection/components/kup-list/kup-list-declarations.js +34 -34
  130. package/dist/collection/components/kup-list/kup-list-helper.js +121 -121
  131. package/dist/collection/components/kup-list/kup-list.js +949 -949
  132. package/dist/collection/components/kup-magic-box/kup-magic-box-declarations.js +23 -23
  133. package/dist/collection/components/kup-magic-box/kup-magic-box.js +431 -431
  134. package/dist/collection/components/kup-nav-bar/kup-nav-bar-declarations.js +21 -21
  135. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +315 -315
  136. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -16
  137. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +864 -864
  138. package/dist/collection/components/kup-photo-frame/kup-photo-frame-declarations.js +10 -10
  139. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +372 -372
  140. package/dist/collection/components/kup-planner/kup-planner-declarations.js +83 -76
  141. package/dist/collection/components/kup-planner/kup-planner-helper.js +54 -54
  142. package/dist/collection/components/kup-planner/kup-planner-state.js +16 -0
  143. package/dist/collection/components/kup-planner/kup-planner.css +2 -2
  144. package/dist/collection/components/kup-planner/kup-planner.js +1732 -1352
  145. package/dist/collection/components/kup-probe/kup-probe.js +358 -358
  146. package/dist/collection/components/kup-progress-bar/kup-progress-bar-declarations.js +14 -14
  147. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +405 -405
  148. package/dist/collection/components/kup-qlik/kup-qlik-declarations.js +1 -1
  149. package/dist/collection/components/kup-qlik/kup-qlik.js +326 -326
  150. package/dist/collection/components/kup-radio/kup-radio-declarations.js +12 -12
  151. package/dist/collection/components/kup-radio/kup-radio.js +398 -398
  152. package/dist/collection/components/kup-rating/kup-rating-declarations.js +11 -11
  153. package/dist/collection/components/kup-rating/kup-rating.js +332 -332
  154. package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -13
  155. package/dist/collection/components/kup-snackbar/kup-snackbar.js +389 -389
  156. package/dist/collection/components/kup-spinner/kup-spinner-declarations.js +15 -15
  157. package/dist/collection/components/kup-spinner/kup-spinner.js +468 -468
  158. package/dist/collection/components/kup-state/kup-state.js +1 -1
  159. package/dist/collection/components/kup-state/kup-store.js +1 -1
  160. package/dist/collection/components/kup-state/mock-store.js +13 -13
  161. package/dist/collection/components/kup-switch/kup-switch-declarations.js +12 -12
  162. package/dist/collection/components/kup-switch/kup-switch.js +402 -402
  163. package/dist/collection/components/kup-tab-bar/kup-tab-bar-declarations.js +10 -10
  164. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +443 -443
  165. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +35 -35
  166. package/dist/collection/components/kup-text-field/kup-text-field.js +1193 -1189
  167. package/dist/collection/components/kup-time-picker/kup-time-picker-declarations.js +14 -14
  168. package/dist/collection/components/kup-time-picker/kup-time-picker.js +921 -921
  169. package/dist/collection/components/kup-tree/kup-tree-declarations.js +43 -43
  170. package/dist/collection/components/kup-tree/kup-tree-faker.js +305 -305
  171. package/dist/collection/components/kup-tree/kup-tree-state.js +15 -15
  172. package/dist/collection/components/kup-tree/kup-tree.js +2479 -2479
  173. package/dist/collection/f-components/f-button/f-button-declarations.js +17 -17
  174. package/dist/collection/f-components/f-button/f-button.js +91 -91
  175. package/dist/collection/f-components/f-cell/f-cell-declarations.js +158 -158
  176. package/dist/collection/f-components/f-cell/f-cell.js +435 -429
  177. package/dist/collection/f-components/f-checkbox/f-checkbox-declarations.js +1 -1
  178. package/dist/collection/f-components/f-checkbox/f-checkbox.js +16 -16
  179. package/dist/collection/f-components/f-chip/f-chip-declarations.js +15 -15
  180. package/dist/collection/f-components/f-chip/f-chip.js +101 -101
  181. package/dist/collection/f-components/f-image/f-image-declarations.js +8 -8
  182. package/dist/collection/f-components/f-image/f-image.js +100 -100
  183. package/dist/collection/f-components/f-paginator/f-paginator-declarations.js +5 -5
  184. package/dist/collection/f-components/f-paginator/f-paginator-utils.js +28 -28
  185. package/dist/collection/f-components/f-paginator/f-paginator.js +86 -86
  186. package/dist/collection/f-components/f-switch/f-switch-declarations.js +1 -1
  187. package/dist/collection/f-components/f-switch/f-switch.js +12 -12
  188. package/dist/collection/f-components/f-text-field/f-text-field-declarations.js +1 -1
  189. package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +29 -29
  190. package/dist/collection/f-components/f-text-field/f-text-field.js +151 -151
  191. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +86 -86
  192. package/dist/collection/managers/kup-data/kup-data-column-helper.js +300 -300
  193. package/dist/collection/managers/kup-data/kup-data-declarations.js +10 -10
  194. package/dist/collection/managers/kup-data/kup-data-node-helper.js +165 -165
  195. package/dist/collection/managers/kup-data/kup-data-row-helper.js +28 -28
  196. package/dist/collection/managers/kup-data/kup-data.js +499 -499
  197. package/dist/collection/managers/kup-dates/kup-dates-declarations.js +43 -43
  198. package/dist/collection/managers/kup-dates/kup-dates.js +654 -654
  199. package/dist/collection/managers/kup-debug/kup-debug-declarations.js +20 -20
  200. package/dist/collection/managers/kup-debug/kup-debug.js +670 -670
  201. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position-declarations.js +27 -27
  202. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +244 -244
  203. package/dist/collection/managers/kup-interact/kup-interact-declarations.js +49 -49
  204. package/dist/collection/managers/kup-interact/kup-interact.js +397 -397
  205. package/dist/collection/managers/kup-language/kup-language-declarations.js +211 -211
  206. package/dist/collection/managers/kup-language/kup-language.js +151 -151
  207. package/dist/collection/managers/kup-manager/kup-manager-declarations.js +1 -1
  208. package/dist/collection/managers/kup-manager/kup-manager.js +303 -303
  209. package/dist/collection/managers/kup-math/kup-math-declarations.js +13 -13
  210. package/dist/collection/managers/kup-math/kup-math-helper.js +39 -39
  211. package/dist/collection/managers/kup-math/kup-math.js +413 -413
  212. package/dist/collection/managers/kup-objects/kup-objects-declarations.js +1 -1
  213. package/dist/collection/managers/kup-objects/kup-objects.js +387 -387
  214. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +10 -10
  215. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +334 -334
  216. package/dist/collection/managers/kup-search/kup-search-declarations.js +1 -1
  217. package/dist/collection/managers/kup-search/kup-search.js +75 -75
  218. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +177 -177
  219. package/dist/collection/managers/kup-theme/kup-theme.js +715 -715
  220. package/dist/collection/managers/kup-toolbar/kup-toolbar-declarations.js +9 -9
  221. package/dist/collection/managers/kup-toolbar/kup-toolbar.js +111 -111
  222. package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -1
  223. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +229 -229
  224. package/dist/collection/types/GenericTypes.js +54 -54
  225. package/dist/collection/utils/cell-utils.js +156 -156
  226. package/dist/collection/utils/filters/filters-column-menu.js +360 -360
  227. package/dist/collection/utils/filters/filters-declarations.js +25 -25
  228. package/dist/collection/utils/filters/filters-rows.js +238 -238
  229. package/dist/collection/utils/filters/filters-tree-items.js +117 -117
  230. package/dist/collection/utils/filters/filters.js +287 -287
  231. package/dist/collection/utils/kup-column-menu/kup-column-menu-declarations.js +20 -20
  232. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +751 -751
  233. package/dist/collection/utils/utils.js +84 -80
  234. package/dist/collection/variables/GenericVariables.js +4 -4
  235. package/dist/components/kup-accordion.js +355 -355
  236. package/dist/components/kup-autocomplete2.js +31821 -31763
  237. package/dist/components/kup-box2.js +1463 -1405
  238. package/dist/components/kup-calendar.js +9788 -10280
  239. package/dist/components/kup-card.js +1 -1
  240. package/dist/components/kup-cell.js +325 -325
  241. package/dist/components/kup-chart.js +1 -1
  242. package/dist/components/kup-checkbox.js +1 -1
  243. package/dist/components/kup-chip.js +1 -1
  244. package/dist/components/kup-color-picker.js +1 -1
  245. package/dist/components/kup-combobox.js +1 -1
  246. package/dist/components/kup-dash-list.js +276 -276
  247. package/dist/components/kup-dash2.js +220 -220
  248. package/dist/components/kup-dashboard.js +549 -549
  249. package/dist/components/kup-data-table.js +1 -1
  250. package/dist/components/kup-date-picker.js +1 -1
  251. package/dist/components/kup-dialog.js +1 -1
  252. package/dist/components/kup-drawer.js +295 -295
  253. package/dist/components/kup-dropdown-button.js +1 -1
  254. package/dist/components/kup-echart2.js +7395 -6765
  255. package/dist/components/kup-family-tree.js +604 -604
  256. package/dist/components/kup-form.js +1 -1
  257. package/dist/components/kup-gauge.js +1 -1
  258. package/dist/components/kup-grid2.js +251 -251
  259. package/dist/components/kup-iframe.js +249 -249
  260. package/dist/components/kup-image-list.js +407 -407
  261. package/dist/components/kup-image.js +1 -1
  262. package/dist/components/kup-lazy.js +344 -344
  263. package/dist/components/kup-list.js +1 -1
  264. package/dist/components/kup-magic-box.js +461 -461
  265. package/dist/components/kup-nav-bar.js +284 -284
  266. package/dist/components/kup-numeric-picker.js +529 -529
  267. package/dist/components/kup-photo-frame.js +300 -300
  268. package/dist/components/kup-planner.js +1376 -1207
  269. package/dist/components/kup-probe.js +399 -399
  270. package/dist/components/kup-progress-bar.js +1 -1
  271. package/dist/components/kup-qlik.js +296 -296
  272. package/dist/components/kup-radio.js +1 -1
  273. package/dist/components/kup-rating.js +1 -1
  274. package/dist/components/kup-snackbar.js +273 -273
  275. package/dist/components/kup-spinner.js +1 -1
  276. package/dist/components/kup-switch.js +1 -1
  277. package/dist/components/kup-tab-bar.js +1 -1
  278. package/dist/components/kup-text-field.js +1 -1
  279. package/dist/components/kup-time-picker.js +1 -1
  280. package/dist/components/kup-tree.js +1 -1
  281. package/dist/esm/{GenericVariables-665de00a.js → GenericVariables-6dfdd433.js} +3 -3
  282. package/dist/esm/{component-120651a0.js → component-e86c51ea.js} +81 -2
  283. package/dist/esm/{f-button-declarations-b1b4cac4.js → f-button-declarations-fd4965d1.js} +16 -16
  284. package/dist/esm/{f-button-024f0cfe.js → f-button-e0e6f65f.js} +99 -99
  285. package/dist/esm/{f-cell-90240a8c.js → f-cell-359dfe28.js} +478 -472
  286. package/dist/esm/{f-checkbox-9b3f5f5b.js → f-checkbox-91358c27.js} +23 -23
  287. package/dist/esm/{f-chip-2238ad43.js → f-chip-0fd043b4.js} +125 -125
  288. package/dist/esm/{f-image-f2e9bf79.js → f-image-b853b0cc.js} +107 -107
  289. package/dist/esm/{f-paginator-utils-8cb3c023.js → f-paginator-utils-124c146a.js} +1548 -1548
  290. package/dist/esm/{f-text-field-d231982c.js → f-text-field-92bb3a1f.js} +172 -172
  291. package/dist/esm/{f-text-field-mdc-cee583ea.js → f-text-field-mdc-a1b4a919.js} +27 -28
  292. package/dist/esm/{index-8bd38435.js → index-bb15ce14.js} +93 -25
  293. package/dist/esm/ketchup.js +4 -4
  294. package/dist/esm/kup-accordion.entry.js +199 -200
  295. package/dist/esm/kup-autocomplete_27.entry.js +17557 -17508
  296. package/dist/esm/kup-box.entry.js +1289 -1232
  297. package/dist/esm/kup-calendar.entry.js +9557 -10050
  298. package/dist/esm/kup-cell.entry.js +172 -172
  299. package/dist/esm/kup-dash-list.entry.js +106 -106
  300. package/dist/esm/kup-dash_2.entry.js +162 -162
  301. package/dist/esm/kup-dashboard.entry.js +400 -401
  302. package/dist/esm/kup-drawer.entry.js +138 -138
  303. package/dist/esm/kup-echart.entry.js +7228 -6598
  304. package/dist/esm/kup-family-tree.entry.js +439 -439
  305. package/dist/esm/kup-iframe.entry.js +94 -94
  306. package/dist/esm/kup-image-list.entry.js +255 -256
  307. package/dist/esm/kup-lazy.entry.js +186 -186
  308. package/dist/esm/kup-magic-box.entry.js +298 -298
  309. package/dist/esm/{kup-manager-d1da769e.js → kup-manager-1e6ea451.js} +7288 -7287
  310. package/dist/esm/kup-nav-bar.entry.js +130 -130
  311. package/dist/esm/kup-numeric-picker.entry.js +367 -368
  312. package/dist/esm/kup-photo-frame.entry.js +144 -144
  313. package/dist/esm/kup-planner.entry.js +1185 -1027
  314. package/dist/esm/kup-probe.entry.js +246 -246
  315. package/dist/esm/kup-qlik.entry.js +138 -138
  316. package/dist/esm/kup-snackbar.entry.js +116 -116
  317. package/dist/esm/loader.js +4 -4
  318. package/dist/ketchup/ketchup.esm.js +1 -1
  319. package/dist/ketchup/{p-3cf64473.js → p-0143e942.js} +1 -1
  320. package/dist/ketchup/{p-5f3680f2.js → p-1ca9aece.js} +1 -1
  321. package/dist/ketchup/p-1cd5785e.entry.js +9 -0
  322. package/dist/ketchup/{p-410c102a.js → p-2ac2c05e.js} +1 -1
  323. package/dist/ketchup/{p-8b46e7ce.js → p-349d4715.js} +1 -1
  324. package/dist/ketchup/{p-83435e6c.entry.js → p-374f867e.entry.js} +1 -1
  325. package/dist/ketchup/{p-c42b80c1.entry.js → p-41c00681.entry.js} +1 -1
  326. package/dist/ketchup/p-5dbd4402.entry.js +1 -0
  327. package/dist/ketchup/{p-89743989.entry.js → p-620faa59.entry.js} +1 -1
  328. package/dist/ketchup/{p-10d84b1b.js → p-6507e9eb.js} +7 -6
  329. package/dist/ketchup/{p-a84f1d24.entry.js → p-6837f725.entry.js} +1 -1
  330. package/dist/ketchup/p-6d46cbb0.js +30 -0
  331. package/dist/ketchup/{p-e1f1e661.entry.js → p-6e79b764.entry.js} +1 -1
  332. package/dist/ketchup/{p-1ad628fb.entry.js → p-818a4a09.entry.js} +1 -1
  333. package/dist/ketchup/p-81e20baa.entry.js +1 -0
  334. package/dist/ketchup/p-85d6bb1f.entry.js +1 -0
  335. package/dist/ketchup/p-8c1804d7.entry.js +1 -0
  336. package/dist/ketchup/{p-163b18b9.entry.js → p-ad919f87.entry.js} +1 -1
  337. package/dist/ketchup/{p-651d89c8.entry.js → p-adad6804.entry.js} +1 -1
  338. package/dist/ketchup/{p-37067ee6.entry.js → p-adebe276.entry.js} +1 -1
  339. package/dist/ketchup/p-b5deb573.js +2 -0
  340. package/dist/ketchup/{p-f876125d.entry.js → p-b73b3b52.entry.js} +1 -1
  341. package/dist/ketchup/{p-0d7d59c7.entry.js → p-ba0c4019.entry.js} +1 -1
  342. package/dist/ketchup/p-c010483d.entry.js +25 -0
  343. package/dist/ketchup/p-c1b10c9c.entry.js +1 -0
  344. package/dist/ketchup/{p-063d4c27.entry.js → p-c28be862.entry.js} +1 -1
  345. package/dist/ketchup/p-c6088459.entry.js +39 -0
  346. package/dist/ketchup/{p-43b67de4.entry.js → p-cf24193b.entry.js} +1 -1
  347. package/dist/ketchup/p-e646523d.js +1 -0
  348. package/dist/ketchup/p-e8977116.entry.js +1 -0
  349. package/dist/ketchup/{p-27a56c87.js → p-fb03f2f5.js} +2 -2
  350. package/dist/ketchup/{p-eda7f130.js → p-fb29ba2a.js} +1 -1
  351. package/dist/ketchup/{p-9f9b6656.js → p-fd1323da.js} +1 -1
  352. package/dist/loader/index.d.ts +1 -1
  353. package/dist/types/components/kup-accordion/kup-accordion-declarations.d.ts +20 -20
  354. package/dist/types/components/kup-accordion/kup-accordion.d.ts +80 -80
  355. package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +35 -35
  356. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +119 -119
  357. package/dist/types/components/kup-badge/kup-badge-declarations.d.ts +9 -9
  358. package/dist/types/components/kup-badge/kup-badge.d.ts +51 -51
  359. package/dist/types/components/kup-box/kup-box-declarations.d.ts +113 -113
  360. package/dist/types/components/kup-box/kup-box-state.d.ts +10 -10
  361. package/dist/types/components/kup-box/kup-box.d.ts +270 -270
  362. package/dist/types/components/kup-button/kup-button-declarations.d.ts +24 -24
  363. package/dist/types/components/kup-button/kup-button.d.ts +111 -111
  364. package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +24 -24
  365. package/dist/types/components/kup-button-list/kup-button-list.d.ts +82 -82
  366. package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +70 -70
  367. package/dist/types/components/kup-calendar/kup-calendar.d.ts +100 -100
  368. package/dist/types/components/kup-card/box/kup-card-box.d.ts +50 -50
  369. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +39 -39
  370. package/dist/types/components/kup-card/built-in/kup-card-calendar.d.ts +2 -2
  371. package/dist/types/components/kup-card/built-in/kup-card-clock.d.ts +2 -2
  372. package/dist/types/components/kup-card/built-in/kup-card-column-drop-menu.d.ts +3 -3
  373. package/dist/types/components/kup-card/built-in/kup-card-message-box.d.ts +3 -3
  374. package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -2
  375. package/dist/types/components/kup-card/collapsible/kup-card-collapsible.d.ts +14 -14
  376. package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +44 -44
  377. package/dist/types/components/kup-card/free/kup-card-free.d.ts +14 -14
  378. package/dist/types/components/kup-card/kup-card-declarations.d.ts +236 -236
  379. package/dist/types/components/kup-card/kup-card-helper.d.ts +27 -27
  380. package/dist/types/components/kup-card/kup-card.d.ts +159 -159
  381. package/dist/types/components/kup-card/scalable/kup-card-scalable.d.ts +56 -56
  382. package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +92 -92
  383. package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -10
  384. package/dist/types/components/kup-cell/kup-cell.d.ts +67 -67
  385. package/dist/types/components/kup-chart/kup-chart-builder.d.ts +7 -7
  386. package/dist/types/components/kup-chart/kup-chart-declarations.d.ts +135 -135
  387. package/dist/types/components/kup-chart/kup-chart.d.ts +170 -170
  388. package/dist/types/components/kup-checkbox/kup-checkbox-declarations.d.ts +17 -17
  389. package/dist/types/components/kup-checkbox/kup-checkbox.d.ts +85 -85
  390. package/dist/types/components/kup-chip/kup-chip-declarations.d.ts +22 -22
  391. package/dist/types/components/kup-chip/kup-chip.d.ts +89 -89
  392. package/dist/types/components/kup-color-picker/kup-color-picker-declarations.d.ts +15 -15
  393. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +89 -89
  394. package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +24 -24
  395. package/dist/types/components/kup-combobox/kup-combobox.d.ts +95 -95
  396. package/dist/types/components/kup-dash/kup-dash.d.ts +33 -33
  397. package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +22 -22
  398. package/dist/types/components/kup-dashboard/kup-dashboard-declarations.d.ts +61 -61
  399. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +80 -80
  400. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +258 -254
  401. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +25 -25
  402. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +36 -36
  403. package/dist/types/components/kup-data-table/kup-data-table.d.ts +452 -444
  404. package/dist/types/components/kup-date-picker/kup-date-picker-declarations.d.ts +20 -20
  405. package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +110 -110
  406. package/dist/types/components/kup-dialog/kup-dialog-declarations.d.ts +26 -26
  407. package/dist/types/components/kup-dialog/kup-dialog.d.ts +77 -77
  408. package/dist/types/components/kup-drawer/kup-drawer-declarations.d.ts +9 -9
  409. package/dist/types/components/kup-drawer/kup-drawer.d.ts +74 -74
  410. package/dist/types/components/kup-dropdown-button/kup-dropdown-button-declarations.d.ts +21 -21
  411. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +161 -161
  412. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +63 -62
  413. package/dist/types/components/kup-echart/kup-echart.d.ts +111 -111
  414. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +38 -38
  415. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +87 -87
  416. package/dist/types/components/kup-form/kup-form-declarations.d.ts +64 -64
  417. package/dist/types/components/kup-form/kup-form.d.ts +83 -83
  418. package/dist/types/components/kup-gauge/kup-gauge-declarations.d.ts +25 -25
  419. package/dist/types/components/kup-gauge/kup-gauge.d.ts +147 -147
  420. package/dist/types/components/kup-grid/kup-grid-declarations.d.ts +9 -9
  421. package/dist/types/components/kup-grid/kup-grid.d.ts +48 -48
  422. package/dist/types/components/kup-iframe/kup-iframe-declarations.d.ts +9 -9
  423. package/dist/types/components/kup-iframe/kup-iframe.d.ts +49 -49
  424. package/dist/types/components/kup-image/canvas/kup-image-canvas-declarations.d.ts +23 -23
  425. package/dist/types/components/kup-image/canvas/kup-image-canvas-helper.d.ts +2 -2
  426. package/dist/types/components/kup-image/canvas/kup-image-canvas.d.ts +28 -28
  427. package/dist/types/components/kup-image/kup-image-declarations.d.ts +19 -19
  428. package/dist/types/components/kup-image/kup-image.d.ts +103 -103
  429. package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -14
  430. package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -6
  431. package/dist/types/components/kup-image-list/kup-image-list.d.ts +73 -73
  432. package/dist/types/components/kup-lazy/kup-lazy-declarations.d.ts +18 -18
  433. package/dist/types/components/kup-lazy/kup-lazy.d.ts +78 -78
  434. package/dist/types/components/kup-list/kup-list-declarations.d.ts +48 -48
  435. package/dist/types/components/kup-list/kup-list-helper.d.ts +6 -6
  436. package/dist/types/components/kup-list/kup-list.d.ts +128 -128
  437. package/dist/types/components/kup-magic-box/kup-magic-box-declarations.d.ts +21 -21
  438. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +65 -65
  439. package/dist/types/components/kup-nav-bar/kup-nav-bar-declarations.d.ts +19 -19
  440. package/dist/types/components/kup-nav-bar/kup-nav-bar.d.ts +65 -65
  441. package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -19
  442. package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -121
  443. package/dist/types/components/kup-photo-frame/kup-photo-frame-declarations.d.ts +9 -9
  444. package/dist/types/components/kup-photo-frame/kup-photo-frame.d.ts +61 -61
  445. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +127 -106
  446. package/dist/types/components/kup-planner/kup-planner-helper.d.ts +6 -6
  447. package/dist/types/components/kup-planner/kup-planner-state.d.ts +13 -0
  448. package/dist/types/components/kup-planner/kup-planner.d.ts +266 -212
  449. package/dist/types/components/kup-probe/kup-probe.d.ts +72 -72
  450. package/dist/types/components/kup-progress-bar/kup-progress-bar-declarations.d.ts +13 -13
  451. package/dist/types/components/kup-progress-bar/kup-progress-bar.d.ts +69 -69
  452. package/dist/types/components/kup-qlik/kup-qlik-declarations.d.ts +19 -19
  453. package/dist/types/components/kup-qlik/kup-qlik.d.ts +100 -100
  454. package/dist/types/components/kup-radio/kup-radio-declarations.d.ts +23 -23
  455. package/dist/types/components/kup-radio/kup-radio.d.ts +80 -80
  456. package/dist/types/components/kup-rating/kup-rating-declarations.d.ts +14 -14
  457. package/dist/types/components/kup-rating/kup-rating.d.ts +62 -62
  458. package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -12
  459. package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +84 -84
  460. package/dist/types/components/kup-spinner/kup-spinner-declarations.d.ts +14 -14
  461. package/dist/types/components/kup-spinner/kup-spinner.d.ts +79 -79
  462. package/dist/types/components/kup-state/kup-state.d.ts +3 -3
  463. package/dist/types/components/kup-state/kup-store.d.ts +4 -4
  464. package/dist/types/components/kup-state/mock-store.d.ts +8 -8
  465. package/dist/types/components/kup-switch/kup-switch-declarations.d.ts +15 -15
  466. package/dist/types/components/kup-switch/kup-switch.d.ts +80 -80
  467. package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +21 -21
  468. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +77 -77
  469. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +38 -38
  470. package/dist/types/components/kup-text-field/kup-text-field.d.ts +253 -253
  471. package/dist/types/components/kup-time-picker/kup-time-picker-declarations.d.ts +17 -17
  472. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +125 -125
  473. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +97 -97
  474. package/dist/types/components/kup-tree/kup-tree-faker.d.ts +54 -54
  475. package/dist/types/components/kup-tree/kup-tree-state.d.ts +14 -14
  476. package/dist/types/components/kup-tree/kup-tree.d.ts +362 -362
  477. package/dist/types/components.d.ts +112 -14
  478. package/dist/types/f-components/f-button/f-button-declarations.d.ts +41 -41
  479. package/dist/types/f-components/f-button/f-button.d.ts +3 -3
  480. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +162 -162
  481. package/dist/types/f-components/f-cell/f-cell.d.ts +3 -3
  482. package/dist/types/f-components/f-checkbox/f-checkbox-declarations.d.ts +15 -15
  483. package/dist/types/f-components/f-checkbox/f-checkbox.d.ts +3 -3
  484. package/dist/types/f-components/f-chip/f-chip-declarations.d.ts +29 -29
  485. package/dist/types/f-components/f-chip/f-chip.d.ts +3 -3
  486. package/dist/types/f-components/f-image/f-image-declarations.d.ts +36 -36
  487. package/dist/types/f-components/f-image/f-image.d.ts +3 -3
  488. package/dist/types/f-components/f-paginator/f-paginator-declarations.d.ts +22 -22
  489. package/dist/types/f-components/f-paginator/f-paginator-utils.d.ts +2 -2
  490. package/dist/types/f-components/f-paginator/f-paginator.d.ts +3 -3
  491. package/dist/types/f-components/f-switch/f-switch-declarations.d.ts +14 -14
  492. package/dist/types/f-components/f-switch/f-switch.d.ts +3 -3
  493. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +42 -42
  494. package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +6 -6
  495. package/dist/types/f-components/f-text-field/f-text-field.d.ts +3 -3
  496. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +31 -31
  497. package/dist/types/managers/kup-data/kup-data-column-helper.d.ts +39 -39
  498. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +173 -173
  499. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +44 -44
  500. package/dist/types/managers/kup-data/kup-data-row-helper.d.ts +14 -14
  501. package/dist/types/managers/kup-data/kup-data.d.ts +86 -86
  502. package/dist/types/managers/kup-dates/kup-dates-declarations.d.ts +39 -39
  503. package/dist/types/managers/kup-dates/kup-dates.d.ts +207 -207
  504. package/dist/types/managers/kup-debug/kup-debug-declarations.d.ts +38 -38
  505. package/dist/types/managers/kup-debug/kup-debug.d.ts +95 -95
  506. package/dist/types/managers/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +50 -50
  507. package/dist/types/managers/kup-dynamic-position/kup-dynamic-position.d.ts +61 -61
  508. package/dist/types/managers/kup-interact/kup-interact-declarations.d.ts +128 -128
  509. package/dist/types/managers/kup-interact/kup-interact.d.ts +105 -105
  510. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +225 -225
  511. package/dist/types/managers/kup-language/kup-language.d.ts +52 -52
  512. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +162 -162
  513. package/dist/types/managers/kup-manager/kup-manager.d.ts +95 -95
  514. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +33 -33
  515. package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -17
  516. package/dist/types/managers/kup-math/kup-math.d.ts +147 -146
  517. package/dist/types/managers/kup-objects/kup-objects-declarations.d.ts +15 -15
  518. package/dist/types/managers/kup-objects/kup-objects.d.ts +210 -210
  519. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +28 -28
  520. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +62 -62
  521. package/dist/types/managers/kup-search/kup-search-declarations.d.ts +7 -7
  522. package/dist/types/managers/kup-search/kup-search.d.ts +20 -20
  523. package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +185 -185
  524. package/dist/types/managers/kup-theme/kup-theme.d.ts +127 -127
  525. package/dist/types/managers/kup-toolbar/kup-toolbar-declarations.d.ts +8 -8
  526. package/dist/types/managers/kup-toolbar/kup-toolbar.d.ts +39 -39
  527. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -8
  528. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +51 -51
  529. package/dist/types/stencil-public-runtime.d.ts +3 -0
  530. package/dist/types/types/GenericTypes.d.ts +110 -110
  531. package/dist/types/utils/cell-utils.d.ts +10 -10
  532. package/dist/types/utils/filters/filters-column-menu.d.ts +96 -96
  533. package/dist/types/utils/filters/filters-declarations.d.ts +39 -39
  534. package/dist/types/utils/filters/filters-rows.d.ts +30 -30
  535. package/dist/types/utils/filters/filters-tree-items.d.ts +19 -19
  536. package/dist/types/utils/filters/filters.d.ts +72 -72
  537. package/dist/types/utils/kup-column-menu/kup-column-menu-declarations.d.ts +19 -19
  538. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +142 -142
  539. package/dist/types/utils/utils.d.ts +37 -35
  540. package/dist/types/variables/GenericVariables.d.ts +4 -4
  541. package/package.json +21 -16
  542. package/dist/cjs/tslib.es6-386654de.js +0 -87
  543. package/dist/esm/tslib.es6-8c2af864.js +0 -82
  544. package/dist/ketchup/p-0bcda0e2.entry.js +0 -1
  545. package/dist/ketchup/p-33aff1ca.entry.js +0 -25
  546. package/dist/ketchup/p-3432ebaf.entry.js +0 -9
  547. package/dist/ketchup/p-35b29b22.entry.js +0 -1
  548. package/dist/ketchup/p-36dac88e.js +0 -30
  549. package/dist/ketchup/p-39a55c47.js +0 -1
  550. package/dist/ketchup/p-489d55ff.entry.js +0 -39
  551. package/dist/ketchup/p-73c8d651.entry.js +0 -1
  552. package/dist/ketchup/p-7f59211b.js +0 -1
  553. package/dist/ketchup/p-9dcfbb1e.js +0 -2
  554. package/dist/ketchup/p-b2fd2dbf.entry.js +0 -1
  555. package/dist/ketchup/p-d1b050d0.entry.js +0 -27
  556. package/dist/ketchup/p-d6ea709e.entry.js +0 -1
  557. /package/dist/ketchup/{p-6c77a36c.js → p-0fd98ab4.js} +0 -0
  558. /package/dist/ketchup/{p-97e8ea42.js → p-ad2e21d2.js} +0 -0
@@ -2,89 +2,95 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1f177abc.js');
6
- const kupManager$1 = require('./kup-manager-85b2a756.js');
7
- const GenericVariables = require('./GenericVariables-a9ed17ee.js');
8
- const fTextField = require('./f-text-field-579c0fc0.js');
9
- const fTextFieldMdc = require('./f-text-field-mdc-0e22f3e3.js');
10
- require('./tslib.es6-386654de.js');
11
- require('./component-85c2bd4d.js');
12
-
13
- /**
14
- * Props of the kup-gantt component.
15
- * Used to export every prop in an object.
16
- */
17
- var KupPlannerProps;
18
- (function (KupPlannerProps) {
19
- KupPlannerProps["customStyle"] = "Custom style of the component.";
20
- KupPlannerProps["data"] = "Dataset containg the tasks list";
21
- KupPlannerProps["detailData"] = "Dataset containg the details list";
22
- KupPlannerProps["detailColorCol"] = "Column containing the detail color, in hex format";
23
- KupPlannerProps["detailColumns"] = "Columns containing informations displayed in the left box, near the gantt of details";
24
- KupPlannerProps["detailDates"] = "Columns containing detail duration, from (firstDate) to (secondDate)";
25
- KupPlannerProps["detailHeight"] = "Height for detail gantt";
26
- KupPlannerProps["detailIdCol"] = "Column containing unique detail identifier";
27
- KupPlannerProps["detailNameCol"] = "Column containing detail name displayed";
28
- KupPlannerProps["detailPrevDates"] = "Columns containing forecast detail duration, from (firstDate) to (secondDate)";
29
- KupPlannerProps["listCellWidth"] = "Total size of the cells inside to the left box, near the gantt";
30
- KupPlannerProps["maxWidth"] = "Max width for component";
31
- KupPlannerProps["phaseColorCol"] = "Column containing the phase color in hex format";
32
- KupPlannerProps["phaseColumns"] = "Columns containing informations displayed in the left box ,near the gantt of phases";
33
- KupPlannerProps["phaseColParDep"] = "Column containing the name of the parent phases";
34
- KupPlannerProps["phaseDates"] = "Columns containing phase duration, from (firstDate) to (secondDate)";
35
- KupPlannerProps["phaseIdCol"] = "Column containing unique phase identifier";
36
- KupPlannerProps["phaseNameCol"] = "Column containing phase name displayed";
37
- KupPlannerProps["phasePrevDates"] = "Columns containing forecast phase duration, from (firstDate) to (secondDate)";
38
- KupPlannerProps["showSecondaryDates"] = "Enable/disable display of secondary dates";
39
- KupPlannerProps["taskColumns"] = "Columns containing informations displayed in the left box, near the gantt";
40
- KupPlannerProps["taskDates"] = "Columns containing task duration, from (firstDate) to (secondDate)";
41
- KupPlannerProps["taskHeight"] = "Height for main gantt";
42
- KupPlannerProps["taskIdCol"] = "Column containing unique task identifier";
43
- KupPlannerProps["taskNameCol"] = "Column containing task name displayed";
44
- KupPlannerProps["taskPrevDates"] = "Columns containing forecast task duration, from (firstDate) to (secondDate)";
45
- KupPlannerProps["titleMess"] = "Message displayed on top";
46
- })(KupPlannerProps || (KupPlannerProps = {}));
47
- var KupPlannerTaskAction;
48
- (function (KupPlannerTaskAction) {
49
- KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
50
- KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
51
- KupPlannerTaskAction["onClick"] = "onClick";
52
- KupPlannerTaskAction["onResize"] = "onResize";
53
- KupPlannerTaskAction["onRightClick"] = "onRightClick";
54
- })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
55
- var KupPlannerGanttRowType;
56
- (function (KupPlannerGanttRowType) {
57
- KupPlannerGanttRowType["TASK"] = "task";
58
- KupPlannerGanttRowType["PHASE"] = "phase";
59
- KupPlannerGanttRowType["DETAIL"] = "detail";
60
- })(KupPlannerGanttRowType || (KupPlannerGanttRowType = {}));
61
- class KupPlannerLastOnChangeReceived {
62
- constructor(event, threshold = 100) {
63
- this.dateTime = new Date();
64
- this.event = event;
65
- this.threshold = threshold;
66
- }
67
- isEquivalent(newEvent) {
68
- const intervalTime = new Date().valueOf() - this.dateTime.valueOf();
69
- const equals = JSON.stringify(this.event) === JSON.stringify(newEvent);
70
- return equals && intervalTime < this.threshold;
71
- }
72
- resetDateTime() {
73
- this.dateTime = new Date();
74
- }
75
- }
76
- const defaultStylingOptions = {
77
- listCellWidth: '300px',
78
- rowHeight: 40,
79
- barFill: 90,
80
- projectProgressColor: '#CBCBCB',
81
- projectProgressSelectedColor: '#CBCBCB',
82
- projectBackgroundColor: '#CBCBCB',
83
- projectBackgroundSelectedColor: '#CBCBCB',
84
- barProgressColor: '#A2A415',
85
- barProgressSelectedColor: '#A2A415',
86
- barBackgroundColor: '#A2A415',
87
- barBackgroundSelectedColor: '#A2A415',
5
+ const index = require('./index-a9a3b467.js');
6
+ const kupManager$1 = require('./kup-manager-7747decd.js');
7
+ const GenericVariables = require('./GenericVariables-9cd88034.js');
8
+ const fTextField = require('./f-text-field-9610c198.js');
9
+ const fTextFieldMdc = require('./f-text-field-mdc-d38d80b5.js');
10
+ require('./component-2c7ddef7.js');
11
+
12
+ /**
13
+ * Props of the kup-gantt component.
14
+ * Used to export every prop in an object.
15
+ */
16
+ var KupPlannerProps;
17
+ (function (KupPlannerProps) {
18
+ KupPlannerProps["customStyle"] = "Custom style of the component.";
19
+ KupPlannerProps["data"] = "Dataset containg the tasks list";
20
+ KupPlannerProps["detailData"] = "Dataset containg the details list";
21
+ KupPlannerProps["detailColorCol"] = "Column containing the detail color, in hex format";
22
+ KupPlannerProps["detailColumns"] = "Columns containing informations displayed in the left box, near the gantt of details";
23
+ KupPlannerProps["detailDates"] = "Columns containing detail duration, from (firstDate) to (secondDate)";
24
+ KupPlannerProps["detailFilter"] = "Sets the detail's filter.";
25
+ KupPlannerProps["detailHeight"] = "Height for detail gantt";
26
+ KupPlannerProps["detailIdCol"] = "Column containing unique detail identifier";
27
+ KupPlannerProps["detailNameCol"] = "Column containing detail name displayed";
28
+ KupPlannerProps["detailPrevDates"] = "Columns containing forecast detail duration, from (firstDate) to (secondDate)";
29
+ KupPlannerProps["detailInitialScrollX"] = "Sets the initial scroll X for the detail.";
30
+ KupPlannerProps["detailInitialScrollY"] = "Sets the initial scroll Y for the detail.";
31
+ KupPlannerProps["listCellWidth"] = "Total size of the cells inside to the left box, near the gantt";
32
+ KupPlannerProps["maxWidth"] = "Max width for component";
33
+ KupPlannerProps["phaseColorCol"] = "Column containing the phase color in hex format";
34
+ KupPlannerProps["phaseColumns"] = "Columns containing informations displayed in the left box ,near the gantt of phases";
35
+ KupPlannerProps["phaseColParDep"] = "Column containing the name of the parent phases";
36
+ KupPlannerProps["phaseDates"] = "Columns containing phase duration, from (firstDate) to (secondDate)";
37
+ KupPlannerProps["phaseIdCol"] = "Column containing unique phase identifier";
38
+ KupPlannerProps["phaseNameCol"] = "Column containing phase name displayed";
39
+ KupPlannerProps["phasePrevDates"] = "Columns containing forecast phase duration, from (firstDate) to (secondDate)";
40
+ KupPlannerProps["readOnly"] = "When true, the two gantts are not interactable.";
41
+ KupPlannerProps["showSecondaryDates"] = "Enable/disable display of secondary dates";
42
+ KupPlannerProps["taskColumns"] = "Columns containing informations displayed in the left box, near the gantt";
43
+ KupPlannerProps["taskDates"] = "Columns containing task duration, from (firstDate) to (secondDate)";
44
+ KupPlannerProps["taskFilter"] = "Sets the task's filter.";
45
+ KupPlannerProps["taskHeight"] = "Height for main gantt";
46
+ KupPlannerProps["taskIdCol"] = "Column containing unique task identifier";
47
+ KupPlannerProps["taskNameCol"] = "Column containing task name displayed";
48
+ KupPlannerProps["taskPrevDates"] = "Columns containing forecast task duration, from (firstDate) to (secondDate)";
49
+ KupPlannerProps["taskInitialScrollX"] = "Sets the initial scroll X for the task.";
50
+ KupPlannerProps["taskInitialScrollY"] = "Sets the initial scroll Y for the task.";
51
+ KupPlannerProps["titleMess"] = "Message displayed on top";
52
+ })(KupPlannerProps || (KupPlannerProps = {}));
53
+ var KupPlannerTaskAction;
54
+ (function (KupPlannerTaskAction) {
55
+ KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
56
+ KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
57
+ KupPlannerTaskAction["onClick"] = "onClick";
58
+ KupPlannerTaskAction["onResize"] = "onResize";
59
+ KupPlannerTaskAction["onRightClick"] = "onRightClick";
60
+ })(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
61
+ var KupPlannerGanttRowType;
62
+ (function (KupPlannerGanttRowType) {
63
+ KupPlannerGanttRowType["TASK"] = "task";
64
+ KupPlannerGanttRowType["PHASE"] = "phase";
65
+ KupPlannerGanttRowType["DETAIL"] = "detail";
66
+ })(KupPlannerGanttRowType || (KupPlannerGanttRowType = {}));
67
+ class KupPlannerLastOnChangeReceived {
68
+ constructor(event, threshold = 100) {
69
+ this.dateTime = new Date();
70
+ this.event = event;
71
+ this.threshold = threshold;
72
+ }
73
+ isEquivalent(newEvent) {
74
+ const intervalTime = new Date().valueOf() - this.dateTime.valueOf();
75
+ const equals = JSON.stringify(this.event) === JSON.stringify(newEvent);
76
+ return equals && intervalTime < this.threshold;
77
+ }
78
+ resetDateTime() {
79
+ this.dateTime = new Date();
80
+ }
81
+ }
82
+ const defaultStylingOptions = {
83
+ listCellWidth: '300px',
84
+ rowHeight: 40,
85
+ barFill: 90,
86
+ projectProgressColor: '#CBCBCB',
87
+ projectProgressSelectedColor: '#CBCBCB',
88
+ projectBackgroundColor: '#CBCBCB',
89
+ projectBackgroundSelectedColor: '#CBCBCB',
90
+ barProgressColor: '#A2A415',
91
+ barProgressSelectedColor: '#A2A415',
92
+ barBackgroundColor: '#A2A415',
93
+ barBackgroundSelectedColor: '#A2A415',
88
94
  };
89
95
 
90
96
  /**
@@ -8958,25 +8964,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
8958
8964
  }
8959
8965
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8960
8966
  }
8961
-
8962
- var ViewMode;
8963
- (function (ViewMode) {
8964
- ViewMode["Hour"] = "Hour";
8965
- ViewMode["QuarterDay"] = "Quarter Day";
8966
- ViewMode["HalfDay"] = "Half Day";
8967
- ViewMode["Day"] = "Day";
8968
- ViewMode["Week"] = "Week";
8969
- ViewMode["Month"] = "Month";
8970
- ViewMode["Year"] = "Year";
8971
- })(ViewMode || (ViewMode = {}));
8972
-
8973
- var TimeUnit;
8974
- (function (TimeUnit) {
8975
- TimeUnit["DAY"] = "days";
8976
- TimeUnit["WEEK"] = "weeks";
8977
- TimeUnit["MONTH"] = "months";
8978
- TimeUnit["YEAR"] = "YEAR";
8979
- })(TimeUnit || (TimeUnit = {}));
8980
8967
  var parseToDayStart = function parseToDayStart(ymd) {
8981
8968
  return luxon.DateTime.fromISO(ymd).toJSDate();
8982
8969
  };
@@ -9005,211 +8992,6 @@ function validDates(startDate, endDate, _name) {
9005
8992
  };
9006
8993
  }
9007
8994
 
9008
- var MAIN_GANTT_ID = "main";
9009
- var SECONDARY_GANTT_ID = "secondary";
9010
- var toViewMode = function toViewMode(timeUnit) {
9011
- switch (timeUnit) {
9012
- case TimeUnit.DAY:
9013
- return ViewMode.Day;
9014
- case TimeUnit.WEEK:
9015
- return ViewMode.Week;
9016
- case TimeUnit.MONTH:
9017
- return ViewMode.Month;
9018
- case TimeUnit.YEAR:
9019
- return ViewMode.Year;
9020
- }
9021
- };
9022
- var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
9023
- switch (timeUnit) {
9024
- case TimeUnit.YEAR:
9025
- return 60 * 2;
9026
- default:
9027
- return 60;
9028
- }
9029
- };
9030
- var convertPhaseToTask = function convertPhaseToTask(item) {
9031
- var mapPhase = function mapPhase(_ref) {
9032
- var phaseStart = _ref.startDate,
9033
- phaseEnd = _ref.endDate,
9034
- secondaryStartDate = _ref.secondaryStartDate,
9035
- secondaryEndDate = _ref.secondaryEndDate,
9036
- phaseName = _ref.name,
9037
- phaseId = _ref.id,
9038
- color = _ref.color,
9039
- selectedColor = _ref.selectedColor,
9040
- dependencies = _ref.dependencies,
9041
- icon = _ref.icon;
9042
- var _validDates = validDates(phaseStart, phaseEnd),
9043
- start = _validDates.start,
9044
- end = _validDates.end;
9045
- var _validDates2 = validDates(secondaryStartDate, secondaryEndDate),
9046
- phaseStart2 = _validDates2.start,
9047
- phaseEnd2 = _validDates2.end;
9048
- return {
9049
- start: start,
9050
- end: end,
9051
- secondaryStart: phaseStart2,
9052
- secondaryEnd: phaseEnd2,
9053
- name: phaseName,
9054
- valuesToShow: item.valuesToShow,
9055
- id: phaseId,
9056
- type: "task",
9057
- progress: 100,
9058
- dependencies: dependencies,
9059
- styles: color ? {
9060
- backgroundColor: color,
9061
- progressColor: color,
9062
- backgroundSelectedColor: selectedColor,
9063
- progressSelectedColor: selectedColor
9064
- } : {},
9065
- icon: icon
9066
- };
9067
- };
9068
- return mapPhase(item);
9069
- };
9070
- var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttStartDate, mainGanttEndDate) {
9071
- var id = item.id,
9072
- name = item.name,
9073
- schedule = item.schedule;
9074
- var getDatesForTask = function getDatesForTask(item) {
9075
- var start = mainGanttStartDate != null ? mainGanttStartDate : "";
9076
- var end = mainGanttEndDate != null ? mainGanttEndDate : "";
9077
- for (var i = 0; i < item.schedule.length; i++) {
9078
- var lstart = item.schedule[i].startDate;
9079
- var lend = item.schedule[i].endDate;
9080
- if (!start || lstart.localeCompare(start) < 0) {
9081
- start = lstart;
9082
- }
9083
- if (!end || lend.localeCompare(end) > 0) {
9084
- end = lend;
9085
- }
9086
- }
9087
- return validDates(start, end);
9088
- };
9089
- var _getDatesForTask = getDatesForTask(item),
9090
- start = _getDatesForTask.start,
9091
- end = _getDatesForTask.end;
9092
- var convertToFrame = function convertToFrame(x) {
9093
- var startDate = x.startDate,
9094
- endDate = x.endDate,
9095
- color = x.color,
9096
- selectedColor = x.selectedColor,
9097
- icon = x.icon;
9098
- var _validDates3 = validDates(startDate, endDate),
9099
- start = _validDates3.start,
9100
- end = _validDates3.end;
9101
- return {
9102
- start: start,
9103
- end: end,
9104
- backgroundColor: color != null ? color : "0xffffff",
9105
- backgroundSelectedColor: selectedColor != null ? selectedColor : color,
9106
- icon: icon
9107
- };
9108
- };
9109
- var defaultColor = "#595959";
9110
- return {
9111
- id: id,
9112
- type: "timeline",
9113
- timeline: schedule.map(convertToFrame),
9114
- name: name,
9115
- valuesToShow: item.valuesToShow,
9116
- start: start,
9117
- end: end,
9118
- progress: 100,
9119
- styles: {
9120
- backgroundColor: defaultColor,
9121
- progressColor: defaultColor,
9122
- backgroundSelectedColor: defaultColor,
9123
- progressSelectedColor: defaultColor
9124
- }
9125
- };
9126
- };
9127
- var isDetail = function isDetail(row) {
9128
- return row && row.schedule && row.schedule.length !== 0;
9129
- };
9130
- var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartDate, mainGanttEndDate) {
9131
- if (!isDetail(item)) {
9132
- var _row$phases;
9133
- var row = item;
9134
- var _validDates4 = validDates(row.startDate, row.endDate),
9135
- start = _validDates4.start,
9136
- end = _validDates4.end;
9137
- var _validDates5 = validDates(row.secondaryStartDate, row.secondaryEndDate),
9138
- start2 = _validDates5.start,
9139
- end2 = _validDates5.end;
9140
- var mainTask = {
9141
- start: start,
9142
- end: end,
9143
- id: row.id,
9144
- name: row.name,
9145
- type: row.type,
9146
- valuesToShow: row.valuesToShow,
9147
- secondaryStart: start2,
9148
- secondaryEnd: end2,
9149
- progress: 100,
9150
- isDisabled: false,
9151
- hideChildren: false,
9152
- icon: row.icon
9153
- };
9154
- var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
9155
- return [mainTask].concat(children1);
9156
- } else {
9157
- var _row = item;
9158
- return [_extends({}, convertDetailToTimeline(_row, mainGanttStartDate, mainGanttEndDate))];
9159
- }
9160
- };
9161
- var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref2) {
9162
- var id = _ref2.id,
9163
- start = _ref2.start,
9164
- end = _ref2.end;
9165
- return projects.map(function (project) {
9166
- return project.id === id ? withNewDates(project, start, end) : project;
9167
- });
9168
- };
9169
- var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref3) {
9170
- var id = _ref3.id,
9171
- start = _ref3.start,
9172
- end = _ref3.end;
9173
- if (phases) {
9174
- return phases.map(function (phase) {
9175
- return phase.id === id ? withNewDates(phase, start, end) : phase;
9176
- });
9177
- }
9178
- return undefined;
9179
- };
9180
- var withNewDates = function withNewDates(p, start, end) {
9181
- var startDate = formatToIsoDate(start);
9182
- var endDate = formatToIsoDate(end);
9183
- var extra = {
9184
- startDate: startDate,
9185
- endDate: endDate
9186
- };
9187
- return _extends({}, p, extra);
9188
- };
9189
- var getProjectById = function getProjectById(id, items) {
9190
- for (var i = 0; i < items.length; i++) {
9191
- if (items[i].id === id) {
9192
- return items[i];
9193
- }
9194
- }
9195
- return undefined;
9196
- };
9197
- var getPhaseById = function getPhaseById(id, items) {
9198
- for (var i = 0; i < items.length; i++) {
9199
- if (isDetail(items[i])) {
9200
- continue;
9201
- }
9202
- var item = items[i];
9203
- if (!item.phases) {
9204
- continue;
9205
- }
9206
- for (var j = 0; j < item.phases.length; j++) if (item.phases[j].id === id) {
9207
- return item.phases[j];
9208
- }
9209
- }
9210
- return undefined;
9211
- };
9212
-
9213
8995
  var intlDTCache = {};
9214
8996
  var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts) {
9215
8997
  if (opts === void 0) {
@@ -9257,9 +9039,9 @@ var ganttDateRangeFromTask = function ganttDateRangeFromTask(tasks, viewMode, pr
9257
9039
  return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates);
9258
9040
  };
9259
9041
  var calculateDisplayedDateRange = function calculateDisplayedDateRange(mainGanttItems, timeUnit, mainGanttDoubleView, secondaryGanttItems, preStepsCount) {
9260
- var dates = ganttDateRangeFromGanttTask(mainGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
9042
+ var dates = ganttDateRangeFromGanttTask(mainGanttItems, timeUnit, preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
9261
9043
  if (secondaryGanttItems) {
9262
- var dates2 = ganttDateRangeFromDetail(secondaryGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
9044
+ var dates2 = ganttDateRangeFromDetail(secondaryGanttItems, timeUnit, preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
9263
9045
  if (dates2[0] < dates[0]) {
9264
9046
  dates[0] = dates2[0];
9265
9047
  }
@@ -9334,48 +9116,30 @@ var ganttDateRangeGeneric = function ganttDateRangeGeneric(dates, viewMode, preS
9334
9116
  return [newStartDate, newEndDate];
9335
9117
  }
9336
9118
  switch (viewMode) {
9337
- case ViewMode.Year:
9119
+ case "year":
9338
9120
  newStartDate = addToDate(newStartDate, -1, "year");
9339
9121
  newStartDate = startOfDate(newStartDate, "year");
9340
9122
  newEndDate = addToDate(newEndDate, 1, "year");
9341
9123
  newEndDate = startOfDate(newEndDate, "year");
9342
9124
  break;
9343
- case ViewMode.Month:
9125
+ case "month":
9344
9126
  newStartDate = addToDate(newStartDate, -1 * preStepsCount, "month");
9345
9127
  newStartDate = startOfDate(newStartDate, "month");
9346
9128
  newEndDate = addToDate(newEndDate, 1, "year");
9347
9129
  newEndDate = startOfDate(newEndDate, "year");
9348
9130
  break;
9349
- case ViewMode.Week:
9131
+ case "week":
9350
9132
  newStartDate = startOfDate(newStartDate, "day");
9351
9133
  newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, "day");
9352
9134
  newEndDate = startOfDate(newEndDate, "day");
9353
9135
  newEndDate = addToDate(newEndDate, 1.5, "month");
9354
9136
  break;
9355
- case ViewMode.Day:
9137
+ case "day":
9356
9138
  newStartDate = startOfDate(newStartDate, "day");
9357
9139
  newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
9358
9140
  newEndDate = startOfDate(newEndDate, "day");
9359
9141
  newEndDate = addToDate(newEndDate, 19, "day");
9360
9142
  break;
9361
- case ViewMode.QuarterDay:
9362
- newStartDate = startOfDate(newStartDate, "day");
9363
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
9364
- newEndDate = startOfDate(newEndDate, "day");
9365
- newEndDate = addToDate(newEndDate, 66, "hour");
9366
- break;
9367
- case ViewMode.HalfDay:
9368
- newStartDate = startOfDate(newStartDate, "day");
9369
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
9370
- newEndDate = startOfDate(newEndDate, "day");
9371
- newEndDate = addToDate(newEndDate, 108, "hour");
9372
- break;
9373
- case ViewMode.Hour:
9374
- newStartDate = startOfDate(newStartDate, "hour");
9375
- newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
9376
- newEndDate = startOfDate(newEndDate, "day");
9377
- newEndDate = addToDate(newEndDate, 1, "day");
9378
- break;
9379
9143
  }
9380
9144
  return [newStartDate, newEndDate];
9381
9145
  };
@@ -9384,27 +9148,18 @@ var seedDates = function seedDates(startDate, endDate, viewMode) {
9384
9148
  var dates = [currentDate];
9385
9149
  while (currentDate < endDate) {
9386
9150
  switch (viewMode) {
9387
- case ViewMode.Year:
9151
+ case "year":
9388
9152
  currentDate = addToDate(currentDate, 1, "year");
9389
9153
  break;
9390
- case ViewMode.Month:
9154
+ case "month":
9391
9155
  currentDate = addToDate(currentDate, 1, "month");
9392
9156
  break;
9393
- case ViewMode.Week:
9157
+ case "week":
9394
9158
  currentDate = addToDate(currentDate, 7, "day");
9395
9159
  break;
9396
- case ViewMode.Day:
9160
+ case "day":
9397
9161
  currentDate = addToDate(currentDate, 1, "day");
9398
9162
  break;
9399
- case ViewMode.HalfDay:
9400
- currentDate = addToDate(currentDate, 12, "hour");
9401
- break;
9402
- case ViewMode.QuarterDay:
9403
- currentDate = addToDate(currentDate, 6, "hour");
9404
- break;
9405
- case ViewMode.Hour:
9406
- currentDate = addToDate(currentDate, 1, "hour");
9407
- break;
9408
9163
  }
9409
9164
  dates.push(currentDate);
9410
9165
  }
@@ -9706,6 +9461,15 @@ var VerticalScroll = function VerticalScroll(_ref) {
9706
9461
  rtl = _ref.rtl,
9707
9462
  onScroll = _ref.onScroll;
9708
9463
  var scrollRef = react.useRef(null);
9464
+ react.useEffect(function () {
9465
+ if (scrollRef.current) {
9466
+ var wrap = scrollRef.current;
9467
+ var setScrollTop = function setScrollTop() {
9468
+ wrap.scrollTop = scroll;
9469
+ };
9470
+ setTimeout(setScrollTop, 250);
9471
+ }
9472
+ }, []);
9709
9473
  react.useEffect(function () {
9710
9474
  if (scrollRef.current) {
9711
9475
  scrollRef.current.scrollTop = scroll;
@@ -9748,12 +9512,12 @@ var TaskList = function TaskList(_ref) {
9748
9512
  TaskListHeader = _ref.TaskListHeader,
9749
9513
  TaskListTable = _ref.TaskListTable,
9750
9514
  filter = _ref.filter;
9751
- var horizontalContainerRef = react.useRef(null);
9515
+ var horizontalContainerRef = react.createRef();
9752
9516
  react.useEffect(function () {
9753
9517
  if (horizontalContainerRef.current) {
9754
9518
  horizontalContainerRef.current.scrollTop = scrollY;
9755
9519
  }
9756
- }, [scrollY]);
9520
+ }, [horizontalContainerRef, scrollY]);
9757
9521
  var headerProps = {
9758
9522
  headerHeight: headerHeight,
9759
9523
  fontFamily: fontFamily,
@@ -9909,10 +9673,9 @@ var SinglePartOfCalendar = function SinglePartOfCalendar(_ref) {
9909
9673
  };
9910
9674
 
9911
9675
  var Calendar = function Calendar(_ref) {
9912
- var _dateTimeFormatters$y, _dateTimeFormatters$m, _dateTimeFormatters$m2, _dateTimeFormatters$w, _dateTimeFormatters$d, _dateTimeFormatters$h, _dateTimeFormatters$d2, _getters;
9676
+ var _dateTimeFormatters$y, _dateTimeFormatters$m, _dateTimeFormatters$m2, _dateTimeFormatters$w, _dateTimeFormatters$d;
9913
9677
  var dateSetup = _ref.dateSetup,
9914
9678
  locale = _ref.locale,
9915
- viewMode = _ref.viewMode,
9916
9679
  rtl = _ref.rtl,
9917
9680
  headerHeight = _ref.headerHeight,
9918
9681
  columnWidth = _ref.columnWidth,
@@ -9922,15 +9685,13 @@ var Calendar = function Calendar(_ref) {
9922
9685
  _ref$singleLineHeader = _ref.singleLineHeader,
9923
9686
  singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader,
9924
9687
  currentDateIndicator = _ref.currentDateIndicator;
9925
- var simplifiedHeader = singleLineHeader && dateSetup.viewMode !== ViewMode.Year;
9688
+ var simplifiedHeader = singleLineHeader && dateSetup.viewMode !== "year";
9926
9689
  var TopCal = simplifiedHeader ? SinglePartOfCalendar : TopPartOfCalendar;
9927
9690
  var formatYear = (_dateTimeFormatters$y = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.year) != null ? _dateTimeFormatters$y : defaultDateTimeFormatters.year;
9928
9691
  var formatMonth = (_dateTimeFormatters$m = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.month) != null ? _dateTimeFormatters$m : defaultDateTimeFormatters.month;
9929
9692
  var formatMonthAndYear = (_dateTimeFormatters$m2 = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.monthAndYear) != null ? _dateTimeFormatters$m2 : defaultDateTimeFormatters.monthAndYear;
9930
9693
  var formatWeek = (_dateTimeFormatters$w = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.week) != null ? _dateTimeFormatters$w : defaultDateTimeFormatters.week;
9931
9694
  var formatDay = (_dateTimeFormatters$d = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.day) != null ? _dateTimeFormatters$d : defaultDateTimeFormatters.day;
9932
- var formatHour = (_dateTimeFormatters$h = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.hour) != null ? _dateTimeFormatters$h : defaultDateTimeFormatters.hour;
9933
- var formatDayAndMonth = (_dateTimeFormatters$d2 = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.dayAndMonth) != null ? _dateTimeFormatters$d2 : defaultDateTimeFormatters.dayAndMonth;
9934
9695
  var getCalendarValuesForYear = function getCalendarValuesForYear() {
9935
9696
  var topValues = [];
9936
9697
  var bottomValues = [];
@@ -10065,70 +9826,12 @@ var Calendar = function Calendar(_ref) {
10065
9826
  }
10066
9827
  return [topValues, bottomValues];
10067
9828
  };
10068
- var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
10069
- var topValues = [];
10070
- var bottomValues = [];
10071
- var ticks = viewMode === ViewMode.HalfDay ? 2 : 4;
10072
- var topDefaultHeight = headerHeight * 0.5;
10073
- var dates = dateSetup.dates;
10074
- for (var i = 0; i < dates.length; i++) {
10075
- var date = dates[i];
10076
- var bottomValue = formatHour(date, locale);
10077
- bottomValues.push(react.createElement("text", {
10078
- key: date.getTime(),
10079
- y: headerHeight * 0.8,
10080
- x: columnWidth * (i + +rtl),
10081
- className: styles$5.calendarBottomText,
10082
- fontFamily: fontFamily
10083
- }, bottomValue));
10084
- if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
10085
- var topValue = formatDayAndMonth(date, locale);
10086
- topValues.push(react.createElement(TopCal, {
10087
- key: date.toISOString(),
10088
- value: topValue,
10089
- x1Line: columnWidth * i + ticks * columnWidth,
10090
- y1Line: 0,
10091
- y2Line: topDefaultHeight,
10092
- xText: columnWidth * i + ticks * columnWidth * 0.5,
10093
- yText: topDefaultHeight * 0.9
10094
- }));
10095
- }
10096
- }
10097
- return [topValues, bottomValues];
9829
+ var getters = {
9830
+ year: getCalendarValuesForYear,
9831
+ month: getCalendarValuesForMonth,
9832
+ week: getCalendarValuesForWeek,
9833
+ day: getCalendarValuesForDay
10098
9834
  };
10099
- var getCalendarValuesForHour = function getCalendarValuesForHour() {
10100
- var topValues = [];
10101
- var bottomValues = [];
10102
- var topDefaultHeight = headerHeight * 0.5;
10103
- var dates = dateSetup.dates;
10104
- for (var i = 0; i < dates.length; i++) {
10105
- var date = dates[i];
10106
- var bottomValue = formatHour(date, locale);
10107
- bottomValues.push(react.createElement("text", {
10108
- key: date.getTime(),
10109
- y: headerHeight * 0.8,
10110
- x: columnWidth * (i + +rtl),
10111
- className: styles$5.calendarBottomText,
10112
- fontFamily: fontFamily
10113
- }, bottomValue));
10114
- if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
10115
- var displayDate = dates[i - 1];
10116
- var topValue = formatDayAndMonth(date, locale);
10117
- var topPosition = (date.getHours() - 24) / 2;
10118
- topValues.push(react.createElement(TopCal, {
10119
- key: topValue + displayDate.getFullYear(),
10120
- value: topValue,
10121
- x1Line: columnWidth * i,
10122
- y1Line: 0,
10123
- y2Line: topDefaultHeight,
10124
- xText: columnWidth * (i + topPosition),
10125
- yText: topDefaultHeight * 0.9
10126
- }));
10127
- }
10128
- }
10129
- return [topValues, bottomValues];
10130
- };
10131
- var getters = (_getters = {}, _getters[ViewMode.Year] = getCalendarValuesForYear, _getters[ViewMode.Month] = getCalendarValuesForMonth, _getters[ViewMode.Week] = getCalendarValuesForWeek, _getters[ViewMode.Day] = getCalendarValuesForDay, _getters[ViewMode.QuarterDay] = getCalendarValuesForPartOfDay, _getters[ViewMode.HalfDay] = getCalendarValuesForPartOfDay, _getters[ViewMode.Hour] = getCalendarValuesForHour, _getters);
10132
9835
  var _getters$dateSetup$vi = getters[dateSetup.viewMode](),
10133
9836
  topValues = _getters$dateSetup$vi[0],
10134
9837
  bottomValues = _getters$dateSetup$vi[1];
@@ -10997,6 +10700,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
10997
10700
  showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat,
10998
10701
  currentDateIndicator = _ref.currentDateIndicator,
10999
10702
  projection = _ref.projection,
10703
+ readOnly = _ref.readOnly,
11000
10704
  setGanttEvent = _ref.setGanttEvent,
11001
10705
  setFailedTask = _ref.setFailedTask,
11002
10706
  setSelectedTask = _ref.setSelectedTask,
@@ -11113,6 +10817,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
11113
10817
  }
11114
10818
  }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
11115
10819
  var hasMovedHorizontally = function hasMovedHorizontally(event) {
10820
+ if (readOnly) {
10821
+ return false;
10822
+ }
11116
10823
  return initEventXClick !== (event === null || event === void 0 ? void 0 : event.clientX);
11117
10824
  };
11118
10825
  var handleBarEventStart = function handleBarEventStart(action, task, event) {
@@ -11164,8 +10871,8 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
11164
10871
  } else if (action === "dblclick") {
11165
10872
  !!onDoubleClick && onDoubleClick(task);
11166
10873
  } else if (action === "click") {
11167
- var skipClick = !hasMovedHorizontally(event);
11168
- skipClick && !!onClick && onClick(task);
10874
+ var skipClick = hasMovedHorizontally(event);
10875
+ !skipClick && !!onClick && onClick(task);
11169
10876
  } else if (action === "contextmenu") {
11170
10877
  event.preventDefault();
11171
10878
  !!onContextMenu && onContextMenu(event, task);
@@ -11235,9 +10942,9 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
11235
10942
  task: task,
11236
10943
  arrowIndent: arrowIndent,
11237
10944
  taskHeight: taskHeight,
11238
- isProgressChangeable: !!onProgressChange && !task.isDisabled,
11239
- isDateMovable: !!onDateChange && !task.isDisabled,
11240
- isDateResizable: !!onDateChange && !task.isDisabled && !forbidResize,
10945
+ isProgressChangeable: !readOnly && !!onProgressChange && !task.isDisabled,
10946
+ isDateMovable: !readOnly && !!onDateChange && !task.isDisabled,
10947
+ isDateResizable: !readOnly && !!onDateChange && !task.isDisabled && !forbidResize,
11241
10948
  isDelete: !task.isDisabled,
11242
10949
  onEventStart: handleBarEventStart,
11243
10950
  key: task.id,
@@ -11260,8 +10967,8 @@ var TaskGantt = function TaskGantt(_ref) {
11260
10967
  scrollY = _ref.scrollY,
11261
10968
  scrollX = _ref.scrollX;
11262
10969
  var ganttSVGRef = react.useRef(null);
11263
- var horizontalContainerRef = react.useRef(null);
11264
- var verticalGanttContainerRef = react.useRef(null);
10970
+ var horizontalContainerRef = react.createRef();
10971
+ var verticalGanttContainerRef = react.createRef();
11265
10972
  var newBarProps = _extends({}, barProps, {
11266
10973
  svg: ganttSVGRef
11267
10974
  });
@@ -11269,12 +10976,12 @@ var TaskGantt = function TaskGantt(_ref) {
11269
10976
  if (horizontalContainerRef.current) {
11270
10977
  horizontalContainerRef.current.scrollTop = scrollY;
11271
10978
  }
11272
- }, [scrollY]);
10979
+ }, [horizontalContainerRef, scrollY]);
11273
10980
  react.useEffect(function () {
11274
10981
  if (verticalGanttContainerRef.current) {
11275
10982
  verticalGanttContainerRef.current.scrollLeft = scrollX;
11276
10983
  }
11277
- }, [scrollX]);
10984
+ }, [verticalGanttContainerRef, scrollX]);
11278
10985
  return react.createElement("div", {
11279
10986
  className: styles$7.ganttContainer,
11280
10987
  ref: taskGanttRef
@@ -11314,12 +11021,20 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
11314
11021
  taskGanttRef = _ref.taskGanttRef,
11315
11022
  rtl = _ref.rtl,
11316
11023
  onScroll = _ref.onScroll;
11317
- var scrollRef = react.useRef(null);
11024
+ var scrollRef = react.createRef();
11318
11025
  react.useEffect(function () {
11026
+ var id;
11319
11027
  if (scrollRef.current) {
11320
- scrollRef.current.scrollLeft = scroll;
11028
+ var wrap = scrollRef.current;
11029
+ var setScrollLeft = function setScrollLeft() {
11030
+ wrap.scrollLeft = scroll;
11031
+ };
11032
+ id = setTimeout(setScrollLeft, 50);
11321
11033
  }
11322
- }, [scroll]);
11034
+ return function () {
11035
+ clearTimeout(id);
11036
+ };
11037
+ }, [scroll, scrollRef]);
11323
11038
  var rect = (_taskGanttRef$current = taskGanttRef.current) === null || _taskGanttRef$current === void 0 ? void 0 : _taskGanttRef$current.getBoundingClientRect();
11324
11039
  return react.createElement("div", {
11325
11040
  dir: "ltr",
@@ -11328,6 +11043,7 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
11328
11043
  } : undefined,
11329
11044
  className: styles$8.scrollWrapper,
11330
11045
  onScroll: onScroll,
11046
+ "data-scrollx": "true",
11331
11047
  ref: scrollRef
11332
11048
  }, react.createElement("div", {
11333
11049
  style: {
@@ -11351,8 +11067,6 @@ var Gantt = function Gantt(_ref) {
11351
11067
  filter = _ref.filter,
11352
11068
  _ref$ganttHeight = _ref.ganttHeight,
11353
11069
  ganttHeight = _ref$ganttHeight === void 0 ? 0 : _ref$ganttHeight,
11354
- _ref$viewMode = _ref.viewMode,
11355
- viewMode = _ref$viewMode === void 0 ? ViewMode.Day : _ref$viewMode,
11356
11070
  _ref$preStepsCount = _ref.preStepsCount,
11357
11071
  preStepsCount = _ref$preStepsCount === void 0 ? 1 : _ref$preStepsCount,
11358
11072
  _ref$locale = _ref.locale,
@@ -11416,6 +11130,12 @@ var Gantt = function Gantt(_ref) {
11416
11130
  projection = _ref.projection,
11417
11131
  displayedStartDate = _ref.displayedStartDate,
11418
11132
  displayedEndDate = _ref.displayedEndDate,
11133
+ _ref$initialScrollX = _ref.initialScrollX,
11134
+ initialScrollX = _ref$initialScrollX === void 0 ? -1 : _ref$initialScrollX,
11135
+ _ref$initialScrollY = _ref.initialScrollY,
11136
+ initialScrollY = _ref$initialScrollY === void 0 ? 0 : _ref$initialScrollY,
11137
+ _ref$readOnly = _ref.readOnly,
11138
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
11419
11139
  onDateChange = _ref.onDateChange,
11420
11140
  onProgressChange = _ref.onProgressChange,
11421
11141
  onDoubleClick = _ref.onDoubleClick,
@@ -11423,7 +11143,11 @@ var Gantt = function Gantt(_ref) {
11423
11143
  onContextMenu = _ref.onContextMenu,
11424
11144
  onDelete = _ref.onDelete,
11425
11145
  onSelect = _ref.onSelect,
11426
- onExpanderClick = _ref.onExpanderClick;
11146
+ onExpanderClick = _ref.onExpanderClick,
11147
+ _ref$viewMode = _ref.viewMode,
11148
+ viewMode = _ref$viewMode === void 0 ? "month" : _ref$viewMode,
11149
+ onScrollX = _ref.onScrollX,
11150
+ onScrollY = _ref.onScrollY;
11427
11151
  var wrapperRef = react.useRef(null);
11428
11152
  var taskGanttRef = react.useRef(null);
11429
11153
  var taskListRef = react.useRef(null);
@@ -11475,12 +11199,12 @@ var Gantt = function Gantt(_ref) {
11475
11199
  setFailedTask = _useState5[1];
11476
11200
  var svgWidth = dateSetup.dates.length * columnWidth;
11477
11201
  var ganttFullHeight = barTasks.length * rowHeight;
11478
- var _useState6 = react.useState(0),
11479
- scrollY = _useState6[0],
11480
- setScrollY = _useState6[1];
11481
- var _useState7 = react.useState(-1),
11482
- scrollX = _useState7[0],
11483
- setScrollX = _useState7[1];
11202
+ var _useState6 = react.useState(initialScrollX),
11203
+ scrollX = _useState6[0],
11204
+ setScrollX = _useState6[1];
11205
+ var _useState7 = react.useState(initialScrollY),
11206
+ scrollY = _useState7[0],
11207
+ setScrollY = _useState7[1];
11484
11208
  var ignoreScrollEvent = react.useRef(false);
11485
11209
  var setIgnoreScrollEvent = function setIgnoreScrollEvent(value) {
11486
11210
  ignoreScrollEvent.current = value;
@@ -11495,9 +11219,12 @@ var Gantt = function Gantt(_ref) {
11495
11219
  window.addEventListener("gantt-sync-scroll-event", function (e) {
11496
11220
  if (e.detail.id !== id) {
11497
11221
  setScrollX(e.detail.scrollX);
11222
+ if (onScrollX) {
11223
+ onScrollX(e.detail.scrollX);
11224
+ }
11498
11225
  }
11499
11226
  });
11500
- }, [id]);
11227
+ }, [id, onScrollX]);
11501
11228
  react.useEffect(function () {
11502
11229
  var filteredTasks;
11503
11230
  if (onExpanderClick) {
@@ -11537,9 +11264,9 @@ var Gantt = function Gantt(_ref) {
11537
11264
  });
11538
11265
  }
11539
11266
  setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
11540
- }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
11267
+ }, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate, dateSetup]);
11541
11268
  react.useEffect(function () {
11542
- if (viewMode === dateSetup.viewMode && viewDate) {
11269
+ if (viewMode === dateSetup.viewMode && viewDate && initialScrollX < 1) {
11543
11270
  var dates = dateSetup.dates;
11544
11271
  var index = dates.findIndex(function (d, i) {
11545
11272
  return viewDate.valueOf() >= d.valueOf() && i + 1 !== dates.length && viewDate.valueOf() < dates[i + 1].valueOf();
@@ -11550,7 +11277,7 @@ var Gantt = function Gantt(_ref) {
11550
11277
  setIgnoreScrollEvent(true);
11551
11278
  setScrollX(columnWidth * index);
11552
11279
  }
11553
- }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode]);
11280
+ }, [viewDate, columnWidth, dateSetup.dates, dateSetup.viewMode, viewMode, initialScrollX]);
11554
11281
  react.useEffect(function () {
11555
11282
  var changedTask = ganttEvent.changedTask,
11556
11283
  action = ganttEvent.action;
@@ -11591,6 +11318,24 @@ var Gantt = function Gantt(_ref) {
11591
11318
  setTaskListWidth(taskListRef.current.offsetWidth);
11592
11319
  }
11593
11320
  }, [taskListRef, listCellWidth]);
11321
+ react.useEffect(function () {
11322
+ if (wrapperRef.current) {
11323
+ if (scrollX !== -1) {
11324
+ var wrap = wrapperRef.current;
11325
+ var setScrollLeft = function setScrollLeft() {
11326
+ wrap.scrollLeft = scrollX;
11327
+ };
11328
+ setTimeout(setScrollLeft, 125);
11329
+ }
11330
+ if (scrollY !== 0) {
11331
+ var _wrap = wrapperRef.current;
11332
+ var setScrollTop = function setScrollTop() {
11333
+ _wrap.scrollTop = scrollY;
11334
+ };
11335
+ setTimeout(setScrollTop, 125);
11336
+ }
11337
+ }
11338
+ }, []);
11594
11339
  react.useEffect(function () {
11595
11340
  if (wrapperRef.current) {
11596
11341
  setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth.current);
@@ -11615,6 +11360,12 @@ var Gantt = function Gantt(_ref) {
11615
11360
  newScrollX = svgWidth;
11616
11361
  }
11617
11362
  setScrollX(newScrollX);
11363
+ window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
11364
+ detail: {
11365
+ componentId: id,
11366
+ scrollX: newScrollX
11367
+ }
11368
+ }));
11618
11369
  event.preventDefault();
11619
11370
  } else if (ganttHeight) {
11620
11371
  var newScrollY = scrollY + event.deltaY;
@@ -11638,9 +11389,16 @@ var Gantt = function Gantt(_ref) {
11638
11389
  };
11639
11390
  }, [wrapperRef, scrollY, scrollX, ganttHeight, svgWidth, rtl, ganttFullHeight]);
11640
11391
  var handleScrollY = function handleScrollY(event) {
11641
- if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent.current) {
11642
- setScrollY(event.currentTarget.scrollTop);
11643
- setIgnoreScrollEvent(true);
11392
+ if (scrollY !== event.currentTarget.scrollTop) {
11393
+ if (onScrollY) {
11394
+ onScrollY(event.currentTarget.scrollTop);
11395
+ }
11396
+ if (!ignoreScrollEvent.current) {
11397
+ setScrollY(event.currentTarget.scrollTop);
11398
+ setIgnoreScrollEvent(true);
11399
+ } else {
11400
+ setIgnoreScrollEvent(false);
11401
+ }
11644
11402
  } else {
11645
11403
  setIgnoreScrollEvent(false);
11646
11404
  }
@@ -11706,6 +11464,9 @@ var Gantt = function Gantt(_ref) {
11706
11464
  } else if (newScrollY > ganttFullHeight - ganttHeight) {
11707
11465
  newScrollY = ganttFullHeight - ganttHeight;
11708
11466
  }
11467
+ if (onScrollY) {
11468
+ onScrollY(event.currentTarget.scrollTop);
11469
+ }
11709
11470
  setScrollY(newScrollY);
11710
11471
  }
11711
11472
  setIgnoreScrollEvent(true);
@@ -11799,6 +11560,7 @@ var Gantt = function Gantt(_ref) {
11799
11560
  ganttHeight: ganttHeight,
11800
11561
  currentDateIndicator: currentDateIndicatorContent,
11801
11562
  projection: projectionContent,
11563
+ readOnly: readOnly,
11802
11564
  setGanttEvent: setGanttEvent,
11803
11565
  setFailedTask: setFailedTask,
11804
11566
  setSelectedTask: handleSelectedTask,
@@ -11829,7 +11591,7 @@ var Gantt = function Gantt(_ref) {
11829
11591
  TaskListTable: TaskListTable
11830
11592
  };
11831
11593
  return react.createElement("div", null, react.createElement("div", {
11832
- className: styles$7.wrapper,
11594
+ className: "" + styles$7.wrapper,
11833
11595
  onKeyDown: handleKeyDown,
11834
11596
  tabIndex: 0,
11835
11597
  ref: wrapperRef
@@ -11873,6 +11635,199 @@ var Gantt = function Gantt(_ref) {
11873
11635
  }));
11874
11636
  };
11875
11637
 
11638
+ var MAIN_GANTT_ID = "main";
11639
+ var SECONDARY_GANTT_ID = "secondary";
11640
+ var columnWidthForTimeUnit = function columnWidthForTimeUnit(timeUnit) {
11641
+ switch (timeUnit) {
11642
+ case "year":
11643
+ return 60 * 2;
11644
+ default:
11645
+ return 60;
11646
+ }
11647
+ };
11648
+ var convertPhaseToTask = function convertPhaseToTask(item) {
11649
+ var mapPhase = function mapPhase(_ref) {
11650
+ var phaseStart = _ref.startDate,
11651
+ phaseEnd = _ref.endDate,
11652
+ secondaryStartDate = _ref.secondaryStartDate,
11653
+ secondaryEndDate = _ref.secondaryEndDate,
11654
+ phaseName = _ref.name,
11655
+ phaseId = _ref.id,
11656
+ color = _ref.color,
11657
+ selectedColor = _ref.selectedColor,
11658
+ dependencies = _ref.dependencies,
11659
+ icon = _ref.icon;
11660
+ var _validDates = validDates(phaseStart, phaseEnd),
11661
+ start = _validDates.start,
11662
+ end = _validDates.end;
11663
+ var _validDates2 = validDates(secondaryStartDate, secondaryEndDate),
11664
+ phaseStart2 = _validDates2.start,
11665
+ phaseEnd2 = _validDates2.end;
11666
+ return {
11667
+ start: start,
11668
+ end: end,
11669
+ secondaryStart: phaseStart2,
11670
+ secondaryEnd: phaseEnd2,
11671
+ name: phaseName,
11672
+ valuesToShow: item.valuesToShow,
11673
+ id: phaseId,
11674
+ type: "task",
11675
+ progress: 100,
11676
+ dependencies: dependencies,
11677
+ styles: color ? {
11678
+ backgroundColor: color,
11679
+ progressColor: color,
11680
+ backgroundSelectedColor: selectedColor,
11681
+ progressSelectedColor: selectedColor
11682
+ } : {},
11683
+ icon: icon
11684
+ };
11685
+ };
11686
+ return mapPhase(item);
11687
+ };
11688
+ var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttStartDate, mainGanttEndDate) {
11689
+ var id = item.id,
11690
+ name = item.name,
11691
+ schedule = item.schedule;
11692
+ var getDatesForTask = function getDatesForTask(item) {
11693
+ var start = mainGanttStartDate != null ? mainGanttStartDate : "";
11694
+ var end = mainGanttEndDate != null ? mainGanttEndDate : "";
11695
+ for (var i = 0; i < item.schedule.length; i++) {
11696
+ var lstart = item.schedule[i].startDate;
11697
+ var lend = item.schedule[i].endDate;
11698
+ if (!start || lstart.localeCompare(start) < 0) {
11699
+ start = lstart;
11700
+ }
11701
+ if (!end || lend.localeCompare(end) > 0) {
11702
+ end = lend;
11703
+ }
11704
+ }
11705
+ return validDates(start, end);
11706
+ };
11707
+ var _getDatesForTask = getDatesForTask(item),
11708
+ start = _getDatesForTask.start,
11709
+ end = _getDatesForTask.end;
11710
+ var convertToFrame = function convertToFrame(x) {
11711
+ var startDate = x.startDate,
11712
+ endDate = x.endDate,
11713
+ color = x.color,
11714
+ selectedColor = x.selectedColor,
11715
+ icon = x.icon;
11716
+ var _validDates3 = validDates(startDate, endDate),
11717
+ start = _validDates3.start,
11718
+ end = _validDates3.end;
11719
+ return {
11720
+ start: start,
11721
+ end: end,
11722
+ backgroundColor: color != null ? color : "0xffffff",
11723
+ backgroundSelectedColor: selectedColor != null ? selectedColor : color,
11724
+ icon: icon
11725
+ };
11726
+ };
11727
+ var defaultColor = "#595959";
11728
+ return {
11729
+ id: id,
11730
+ type: "timeline",
11731
+ timeline: schedule.map(convertToFrame),
11732
+ name: name,
11733
+ valuesToShow: item.valuesToShow,
11734
+ start: start,
11735
+ end: end,
11736
+ progress: 100,
11737
+ styles: {
11738
+ backgroundColor: defaultColor,
11739
+ progressColor: defaultColor,
11740
+ backgroundSelectedColor: defaultColor,
11741
+ progressSelectedColor: defaultColor
11742
+ }
11743
+ };
11744
+ };
11745
+ var isDetail = function isDetail(row) {
11746
+ return row && row.schedule && row.schedule.length !== 0;
11747
+ };
11748
+ var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartDate, mainGanttEndDate) {
11749
+ if (!isDetail(item)) {
11750
+ var _row$phases;
11751
+ var row = item;
11752
+ var _validDates4 = validDates(row.startDate, row.endDate),
11753
+ start = _validDates4.start,
11754
+ end = _validDates4.end;
11755
+ var _validDates5 = validDates(row.secondaryStartDate, row.secondaryEndDate),
11756
+ start2 = _validDates5.start,
11757
+ end2 = _validDates5.end;
11758
+ var mainTask = {
11759
+ start: start,
11760
+ end: end,
11761
+ id: row.id,
11762
+ name: row.name,
11763
+ type: row.type,
11764
+ valuesToShow: row.valuesToShow,
11765
+ secondaryStart: start2,
11766
+ secondaryEnd: end2,
11767
+ progress: 100,
11768
+ isDisabled: false,
11769
+ hideChildren: false,
11770
+ icon: row.icon
11771
+ };
11772
+ var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
11773
+ return [mainTask].concat(children1);
11774
+ } else {
11775
+ var _row = item;
11776
+ return [_extends({}, convertDetailToTimeline(_row, mainGanttStartDate, mainGanttEndDate))];
11777
+ }
11778
+ };
11779
+ var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref2) {
11780
+ var id = _ref2.id,
11781
+ start = _ref2.start,
11782
+ end = _ref2.end;
11783
+ return projects.map(function (project) {
11784
+ return project.id === id ? withNewDates(project, start, end) : project;
11785
+ });
11786
+ };
11787
+ var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref3) {
11788
+ var id = _ref3.id,
11789
+ start = _ref3.start,
11790
+ end = _ref3.end;
11791
+ if (phases) {
11792
+ return phases.map(function (phase) {
11793
+ return phase.id === id ? withNewDates(phase, start, end) : phase;
11794
+ });
11795
+ }
11796
+ return undefined;
11797
+ };
11798
+ var withNewDates = function withNewDates(p, start, end) {
11799
+ var startDate = formatToIsoDate(start);
11800
+ var endDate = formatToIsoDate(end);
11801
+ var extra = {
11802
+ startDate: startDate,
11803
+ endDate: endDate
11804
+ };
11805
+ return _extends({}, p, extra);
11806
+ };
11807
+ var getProjectById = function getProjectById(id, items) {
11808
+ for (var i = 0; i < items.length; i++) {
11809
+ if (items[i].id === id) {
11810
+ return items[i];
11811
+ }
11812
+ }
11813
+ return undefined;
11814
+ };
11815
+ var getPhaseById = function getPhaseById(id, items) {
11816
+ for (var i = 0; i < items.length; i++) {
11817
+ if (isDetail(items[i])) {
11818
+ continue;
11819
+ }
11820
+ var item = items[i];
11821
+ if (!item.phases) {
11822
+ continue;
11823
+ }
11824
+ for (var j = 0; j < item.phases.length; j++) if (item.phases[j].id === id) {
11825
+ return item.phases[j];
11826
+ }
11827
+ }
11828
+ return undefined;
11829
+ };
11830
+
11876
11831
  var cachedFormats = {};
11877
11832
  var getOrBuildCachedFormat = function getOrBuildCachedFormat(locale, options) {
11878
11833
  var _cachedFormats$key;
@@ -12146,16 +12101,16 @@ var classes$2 = {"switcher":"_3P0WE","button":"_1oXbe","label":"_1R9mh"};
12146
12101
  var Switcher = function Switcher(_ref) {
12147
12102
  var onTimeUnitChange = _ref.onTimeUnitChange;
12148
12103
  var day = function day() {
12149
- return onTimeUnitChange(TimeUnit.DAY);
12104
+ return onTimeUnitChange("day");
12150
12105
  };
12151
12106
  var week = function week() {
12152
- return onTimeUnitChange(TimeUnit.WEEK);
12107
+ return onTimeUnitChange("week");
12153
12108
  };
12154
12109
  var month = function month() {
12155
- return onTimeUnitChange(TimeUnit.MONTH);
12110
+ return onTimeUnitChange("month");
12156
12111
  };
12157
12112
  var year = function year() {
12158
- return onTimeUnitChange(TimeUnit.YEAR);
12113
+ return onTimeUnitChange("year");
12159
12114
  };
12160
12115
  return react.createElement("div", {
12161
12116
  className: classes$2.switcher
@@ -12188,7 +12143,7 @@ var Switcher = function Switcher(_ref) {
12188
12143
 
12189
12144
  var Planner = function Planner(props) {
12190
12145
  var _props$secondaryGantt, _props$mainGantt$show, _props$mainGantt$task, _props$mainGantt$task2, _props$mainGantt$tool, _props$secondaryGantt3, _props$secondaryGantt4, _props$secondaryGantt5, _props$secondaryGantt6;
12191
- var _useState = react.useState(TimeUnit.MONTH),
12146
+ var _useState = react.useState(props.viewMode),
12192
12147
  timeUnit = _useState[0],
12193
12148
  setTimeUnit = _useState[1];
12194
12149
  var currentTasks = react.useRef(props.mainGantt.items);
@@ -12199,19 +12154,22 @@ var Planner = function Planner(props) {
12199
12154
  var setCurrentDetails = function setCurrentDetails(details) {
12200
12155
  currentDetails.current = details;
12201
12156
  };
12202
- var _useState2 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12203
- mainGanttDoubleView = _useState2[0],
12204
- setMainGanttDoubleView = _useState2[1];
12157
+ var _useState2 = react.useState(props.mainGantt.initialScrollX ? props.mainGantt.initialScrollX : -1),
12158
+ scrollX = _useState2[0],
12159
+ setScrollX = _useState2[1];
12160
+ var _useState3 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
12161
+ mainGanttDoubleView = _useState3[0],
12162
+ setMainGanttDoubleView = _useState3[1];
12205
12163
  var displayedDates = react.useRef(calculateDisplayedDateRange(currentTasks.current, timeUnit, mainGanttDoubleView, currentDetails.current, props.preStepsCount));
12206
12164
  var setDisplayedDates = function setDisplayedDates(dates) {
12207
12165
  displayedDates.current = dates;
12208
12166
  };
12209
- var _useState3 = react.useState(),
12210
- viewDate = _useState3[0],
12211
- setViewDate = _useState3[1];
12212
12167
  var _useState4 = react.useState(),
12213
- projection = _useState4[0],
12214
- setProjection = _useState4[1];
12168
+ viewDate = _useState4[0],
12169
+ setViewDate = _useState4[1];
12170
+ var _useState5 = react.useState(),
12171
+ projection = _useState5[0],
12172
+ setProjection = _useState5[1];
12215
12173
  var locale = "it-IT";
12216
12174
  var handleClick = function handleClick(row, onClick) {
12217
12175
  if (!row) {
@@ -12301,6 +12259,17 @@ var Planner = function Planner(props) {
12301
12259
  }
12302
12260
  }
12303
12261
  onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(row);
12262
+ var getScrollX = function getScrollX() {
12263
+ if (wrapperRef.current) {
12264
+ var _wrapperRef$current$q;
12265
+ var x = (_wrapperRef$current$q = wrapperRef.current.querySelector('[data-scrollx="true"]')) === null || _wrapperRef$current$q === void 0 ? void 0 : _wrapperRef$current$q.scrollLeft;
12266
+ if (x !== undefined) {
12267
+ var _props$onScrollX;
12268
+ (_props$onScrollX = props.onScrollX) === null || _props$onScrollX === void 0 ? void 0 : _props$onScrollX.call(props, x);
12269
+ }
12270
+ }
12271
+ };
12272
+ setTimeout(getScrollX, 500);
12304
12273
  };
12305
12274
  react.useEffect(function () {
12306
12275
  var _props$secondaryGantt2;
@@ -12331,10 +12300,16 @@ var Planner = function Planner(props) {
12331
12300
  }
12332
12301
  }
12333
12302
  console.log("PLANNER render");
12334
- return react.createElement("div", null, react.createElement(Switcher, {
12303
+ var wrapperRef = react.useRef(null);
12304
+ return react.createElement("div", {
12305
+ ref: wrapperRef
12306
+ }, react.createElement(Switcher, {
12335
12307
  onTimeUnitChange: function onTimeUnitChange(timeUnit) {
12308
+ var _props$onSetViewMode;
12309
+ (_props$onSetViewMode = props.onSetViewMode) === null || _props$onSetViewMode === void 0 ? void 0 : _props$onSetViewMode.call(props, timeUnit);
12336
12310
  setTimeUnit(timeUnit);
12337
12311
  setViewDate(undefined);
12312
+ setScrollX(-1);
12338
12313
  }
12339
12314
  }), react.createElement("div", {
12340
12315
  style: {
@@ -12354,7 +12329,7 @@ var Planner = function Planner(props) {
12354
12329
  viewDate: viewDate,
12355
12330
  tasks: tasks,
12356
12331
  columnWidth: columnWidthForTimeUnit(timeUnit),
12357
- viewMode: toViewMode(timeUnit)
12332
+ viewMode: timeUnit
12358
12333
  }, props.mainGantt.stylingOptions, {
12359
12334
  TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, handleSetDoubleView),
12360
12335
  TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
@@ -12397,7 +12372,12 @@ var Planner = function Planner(props) {
12397
12372
  return handleDateChange(task, currentTasks.current, props.mainGantt.onDateChange);
12398
12373
  },
12399
12374
  locale: locale,
12400
- dateTimeFormatters: ganttDateTimeFormatters
12375
+ dateTimeFormatters: ganttDateTimeFormatters,
12376
+ initialScrollX: scrollX,
12377
+ initialScrollY: props.mainGantt.initialScrollY,
12378
+ readOnly: props.mainGantt.readOnly,
12379
+ onScrollX: props.onScrollX,
12380
+ onScrollY: props.mainGantt.onScrollY
12401
12381
  })), props.secondaryGantt && react.createElement(Gantt, Object.assign({
12402
12382
  id: SECONDARY_GANTT_ID,
12403
12383
  key: SECONDARY_GANTT_ID,
@@ -12411,7 +12391,7 @@ var Planner = function Planner(props) {
12411
12391
  viewDate: viewDate,
12412
12392
  tasks: details,
12413
12393
  columnWidth: columnWidthForTimeUnit(timeUnit),
12414
- viewMode: toViewMode(timeUnit)
12394
+ viewMode: timeUnit
12415
12395
  }, props.mainGantt.stylingOptions, {
12416
12396
  TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
12417
12397
  TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
@@ -12447,576 +12427,754 @@ var Planner = function Planner(props) {
12447
12427
  return handleDateChange(task, currentDetails.current, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
12448
12428
  },
12449
12429
  locale: locale,
12450
- dateTimeFormatters: ganttDateTimeFormatters
12430
+ dateTimeFormatters: ganttDateTimeFormatters,
12431
+ initialScrollX: scrollX,
12432
+ initialScrollY: props.secondaryGantt.initialScrollY,
12433
+ readOnly: props.secondaryGantt.readOnly,
12434
+ onScrollY: props.secondaryGantt.onScrollY
12451
12435
  }))));
12452
12436
  };
12453
12437
 
12454
- const kupManager = kupManager$1.kupManagerInstance();
12455
- function sanitizeAllDates(startDateCell, endDateCell, secStartDateCell, secEndDateCell) {
12456
- const sanitizedDateValues = sanitizeDates(startDateCell, endDateCell);
12457
- let sanitizedSecDateValues = [];
12458
- if (secStartDateCell && secEndDateCell) {
12459
- if (isAtLeastOneDateValid(secStartDateCell, secEndDateCell)) {
12460
- sanitizedSecDateValues = sanitizeDates(secStartDateCell, secEndDateCell);
12461
- }
12462
- else {
12463
- sanitizedSecDateValues = [...sanitizedDateValues];
12464
- }
12465
- }
12466
- return {
12467
- dateValues: sanitizedDateValues,
12468
- secDateValues: sanitizedSecDateValues,
12469
- };
12470
- }
12471
- function sanitizeDates(startDateCell, endDateCell) {
12472
- let returnValues = [startDateCell.value, endDateCell.value];
12473
- if (isDateValid(startDateCell) && isDateValid(endDateCell)) {
12474
- return returnValues;
12475
- }
12476
- else if (isDateValid(startDateCell)) {
12477
- return [startDateCell.value, startDateCell.value];
12478
- }
12479
- else if (isDateValid(endDateCell)) {
12480
- return [endDateCell.value, endDateCell.value];
12481
- }
12482
- else {
12483
- return returnValues;
12484
- }
12485
- }
12486
- function isDateValid(dateCell) {
12487
- return (kupManager.objects.isDate(dateCell.obj) &&
12488
- kupManager.dates.isValid(dateCell.value, kupManager$1.KupDatesFormats.ISO_DATE));
12489
- }
12490
- function isAtLeastOneDateValid(startDateCell, endDateCell) {
12491
- return isDateValid(startDateCell) || isDateValid(endDateCell);
12492
- }
12493
- function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValuesFunction) {
12494
- let toValuesFunction = () => columns.map((col) => {
12495
- return kupManager$1.getCellValueForDisplay(dataColumns.find((kCol) => kCol.name == col), row.cells[col]);
12496
- });
12497
- if (customToValuesFunction) {
12498
- toValuesFunction = customToValuesFunction;
12499
- }
12500
- const valuesToShow = (columns === null || columns === void 0 ? void 0 : columns.length) >= 2
12501
- ? toValuesFunction()
12502
- : [row.cells[idCol].value, row.cells[nameCol].value];
12503
- return valuesToShow;
12504
- }
12505
-
12506
- const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
12507
-
12508
- var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12509
- if (kind === "m")
12510
- throw new TypeError("Private method is not writable");
12511
- if (kind === "a" && !f)
12512
- throw new TypeError("Private accessor was defined without a setter");
12513
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12514
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
12515
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12516
- };
12517
- var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12518
- if (kind === "a" && !f)
12519
- throw new TypeError("Private accessor was defined without a getter");
12520
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12521
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
12522
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12523
- };
12524
- var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_lastOnChangeReceived, _KupPlanner_rootPlanner, _KupPlanner_phases, _KupPlanner_showSecondaryDatesLocal, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_handleOnContextMenuOnTask, _KupPlanner_handleOnContextMenuOnPhase, _KupPlanner_handleOnContextMenuOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter, _KupPlanner_getIconUrl, _KupPlanner_getIconColor;
12525
- const KupPlanner = class {
12526
- constructor(hostRef) {
12527
- index.registerInstance(this, hostRef);
12528
- this.kupClick = index.createEvent(this, "kup-planner-click", 6);
12529
- this.kupDateChange = index.createEvent(this, "kup-planner-datechange", 6);
12530
- this.kupReady = index.createEvent(this, "kup-planner-ready", 6);
12531
- this.kupContextMenu = index.createEvent(this, "kup-planner-contextmenu", 6);
12532
- _KupPlanner_instances.add(this);
12533
- /*-------------------------------------------------*/
12534
- /* I n t e r n a l V a r i a b l e s */
12535
- /*-------------------------------------------------*/
12536
- _KupPlanner_kupManager.set(this, kupManager$1.kupManagerInstance());
12537
- _KupPlanner_lastOnChangeReceived.set(this, void 0);
12538
- _KupPlanner_rootPlanner.set(this, void 0);
12539
- _KupPlanner_phases.set(this, {});
12540
- // no re-render
12541
- _KupPlanner_showSecondaryDatesLocal.set(this, false);
12542
- this.customStyle = '';
12543
- this.data = undefined;
12544
- this.detailData = undefined;
12545
- this.detailColorCol = undefined;
12546
- this.detailColumns = undefined;
12547
- this.detailDates = undefined;
12548
- this.detailHeight = undefined;
12549
- this.detailIconCol = undefined;
12550
- this.detailIdCol = undefined;
12551
- this.detailNameCol = undefined;
12552
- this.detailPrevDates = undefined;
12553
- this.listCellWidth = '300px';
12554
- this.maxWidth = '90vw';
12555
- this.phaseColorCol = undefined;
12556
- this.phaseColumns = undefined;
12557
- this.phaseColParDep = undefined;
12558
- this.phaseDates = undefined;
12559
- this.phaseIconCol = undefined;
12560
- this.phaseIdCol = undefined;
12561
- this.phaseNameCol = undefined;
12562
- this.phasePrevDates = undefined;
12563
- this.showSecondaryDates = false;
12564
- this.taskColumns = undefined;
12565
- this.taskDates = undefined;
12566
- this.taskHeight = undefined;
12567
- this.taskIconCol = undefined;
12568
- this.taskIdCol = undefined;
12569
- this.taskNameCol = undefined;
12570
- this.taskPrevDates = undefined;
12571
- this.titleMess = undefined;
12572
- this.plannerProps = undefined;
12573
- }
12574
- dataChanged() {
12575
- __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
12576
- }
12577
- showSecondaryDatesChanged() {
12578
- var _a;
12579
- __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12580
- if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12581
- this.plannerProps.mainGantt.showSecondaryDates =
12582
- this.showSecondaryDates;
12583
- }
12584
- }
12585
- /*-------------------------------------------------*/
12586
- /* P u b l i c M e t h o d s */
12587
- /*-------------------------------------------------*/
12588
- /**
12589
- * Used to retrieve component's props values.
12590
- * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
12591
- * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
12592
- */
12593
- async getProps(descriptions) {
12594
- return kupManager$1.getProps(this, KupPlannerProps, descriptions);
12595
- }
12596
- /**
12597
- * This method is used to trigger a new render of the component.
12598
- */
12599
- async refresh() {
12600
- index.forceUpdate(this);
12601
- }
12602
- /**
12603
- * Sets the props to the component.
12604
- * @param {GenericObject} props - Object containing props that will be set to the component.
12605
- */
12606
- async setProps(props) {
12607
- kupManager$1.setProps(this, KupPlannerProps, props);
12608
- }
12609
- /**
12610
- * Add a list of phases to the project
12611
- * @param taskId
12612
- * @param data - Matrix which contains project phases
12613
- */
12614
- async addPhases(taskId, data) {
12615
- var _a;
12616
- const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12617
- if (task) {
12618
- __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
12619
- task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]])).map((row) => {
12620
- const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
12621
- const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
12622
- ? '#START#'
12623
- : col == this.phaseDates[1]
12624
- ? '#END#'
12625
- : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12626
- let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12627
- let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
12628
- let phase = {
12629
- taskRow: task.taskRow,
12630
- phaseRow: row,
12631
- id: task.id + '_' + row.cells[this.phaseIdCol].value,
12632
- phaseRowId: row.id,
12633
- taskRowId: task.taskRowId,
12634
- name: row.cells[this.phaseNameCol].value,
12635
- startDate: datesSanitized.dateValues[0],
12636
- endDate: datesSanitized.dateValues[1],
12637
- secondaryStartDate: datesSanitized.secDateValues[0],
12638
- secondaryEndDate: datesSanitized.secDateValues[1],
12639
- type: 'task',
12640
- color: row.cells[this.phaseColorCol].value,
12641
- selectedColor: row.cells[this.phaseColorCol].value,
12642
- valuesToShow: valuesToShow,
12643
- rowType: KupPlannerGanttRowType.PHASE,
12644
- icon: iconUrl
12645
- ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12646
- : undefined,
12647
- };
12648
- return phase;
12649
- });
12650
- }
12651
- this.plannerProps = Object.assign({}, this.plannerProps);
12652
- }
12653
- //---- Lifecycle hooks ----
12654
- componentWillLoad() {
12655
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
12656
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
12657
- }
12658
- componentDidLoad() {
12659
- __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, this.showSecondaryDates, "f");
12660
- let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
12661
- if (details && details.length == 0) {
12662
- details = undefined;
12663
- }
12664
- const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
12665
- fTextFieldMdc.FTextFieldMDC(mainFilter);
12666
- const secondaryFilter = this.rootElement.shadowRoot.querySelector('#secondary-filter');
12667
- if (details) {
12668
- fTextFieldMdc.FTextFieldMDC(secondaryFilter);
12669
- }
12670
- this.plannerProps = {
12671
- mainGantt: {
12672
- title: this.titleMess,
12673
- items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
12674
- stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12675
- filter: mainFilter,
12676
- hideLabel: true,
12677
- ganttHeight: this.taskHeight,
12678
- showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_showSecondaryDatesLocal, "f"),
12679
- onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12680
- onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12681
- onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12682
- },
12683
- secondaryGantt: details
12684
- ? {
12685
- title: '',
12686
- items: details,
12687
- stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12688
- filter: secondaryFilter,
12689
- hideLabel: true,
12690
- ganttHeight: this.detailHeight,
12691
- onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12692
- onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12693
- onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12694
- }
12695
- : undefined,
12696
- onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
12697
- };
12698
- __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12699
- this.kupReady.emit({
12700
- comp: this,
12701
- id: this.rootElement.id,
12702
- value: undefined,
12703
- });
12704
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, true);
12705
- }
12706
- componentWillRender() {
12707
- __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12708
- }
12709
- componentDidRender() {
12710
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12711
- }
12712
- onKupClick(event, taskAction) {
12713
- this.kupClick.emit({
12714
- comp: this,
12715
- id: this.rootElement.id,
12716
- value: event,
12717
- taskAction: taskAction,
12718
- });
12719
- }
12720
- onKupContextMenu(event, ganttRow, taskAction) {
12721
- let row;
12722
- let cell;
12723
- let column;
12724
- switch (ganttRow.type) {
12725
- case 'project': {
12726
- row = ganttRow.taskRow;
12727
- cell = row.cells[this.taskIdCol];
12728
- column = this.data.columns[this.taskIdCol];
12729
- break;
12730
- }
12731
- case 'task': {
12732
- row = ganttRow.phaseRow;
12733
- cell = row.cells[this.phaseIdCol];
12734
- //column = this.data.columns[this.taskIdCol];
12735
- break;
12736
- }
12737
- case 'timeline': {
12738
- row = ganttRow.detailRow;
12739
- cell = row.cells[this.detailIdCol];
12740
- column = this.data.columns[this.detailIdCol];
12741
- break;
12742
- }
12743
- }
12744
- this.kupContextMenu.emit({
12745
- comp: this,
12746
- id: this.rootElement.id,
12747
- value: ganttRow,
12748
- taskAction: taskAction,
12749
- details: {
12750
- cell: cell,
12751
- column: column,
12752
- originalEvent: event,
12753
- row: row,
12754
- },
12755
- });
12756
- }
12757
- onKupDateChange(event, taskAction) {
12758
- this.kupDateChange.emit({
12759
- comp: this,
12760
- id: this.rootElement.id,
12761
- value: event,
12762
- taskAction: taskAction,
12763
- });
12764
- }
12765
- handleOnClick(nativeEvent) {
12766
- switch (nativeEvent.rowType) {
12767
- case KupPlannerGanttRowType.TASK:
12768
- const taskAction = nativeEvent.phases
12769
- ? KupPlannerTaskAction.onTaskClosing
12770
- : KupPlannerTaskAction.onTaskOpening;
12771
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12772
- this.onKupClick(nativeEvent, taskAction);
12773
- }
12774
- break;
12775
- case KupPlannerGanttRowType.PHASE:
12776
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12777
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12778
- }
12779
- break;
12780
- case KupPlannerGanttRowType.DETAIL:
12781
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12782
- this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12783
- }
12784
- break;
12785
- }
12786
- }
12787
- handleOnContextMenu(event, row) {
12788
- switch (row.rowType) {
12789
- case KupPlannerGanttRowType.TASK:
12790
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12791
- this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12792
- }
12793
- break;
12794
- case KupPlannerGanttRowType.PHASE:
12795
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12796
- this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12797
- }
12798
- break;
12799
- case KupPlannerGanttRowType.DETAIL:
12800
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12801
- this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12802
- }
12803
- break;
12804
- }
12805
- }
12806
- handleOnSetDoubleView(checked) {
12807
- var _a;
12808
- __classPrivateFieldSet(this, _KupPlanner_showSecondaryDatesLocal, checked, "f");
12809
- if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12810
- this.plannerProps.mainGantt.showSecondaryDates = checked;
12811
- }
12812
- }
12813
- handleOnDateChange(nativeEvent) {
12814
- if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12815
- if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12816
- this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12817
- }
12818
- }
12819
- }
12820
- render() {
12821
- var _a;
12822
- return (index.h(index.Host, null, index.h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId, style: { maxWidth: this.maxWidth } }), index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12823
- if (e.key === 'Enter') {
12824
- __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
12825
- }
12826
- }, wrapperClass: "filter" }), ((_a = this.detailData) === null || _a === void 0 ? void 0 : _a.rows) && this.detailData.rows.length > 0 ? (index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "secondary-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12827
- if (e.key === 'Enter') {
12828
- __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e, true);
12829
- }
12830
- }, wrapperClass: "filter" })) : null));
12831
- }
12832
- disconnectedCallback() {
12833
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12834
- }
12835
- get rootElement() { return index.getElement(this); }
12836
- static get watchers() { return {
12837
- "data": ["dataChanged"],
12838
- "showSecondaryDates": ["showSecondaryDatesChanged"]
12839
- }; }
12840
- };
12841
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_phases = new WeakMap(), _KupPlanner_showSecondaryDatesLocal = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12842
- var _a;
12843
- (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12844
- const componentWrapperElement = this.rootElement.shadowRoot.getElementById(GenericVariables.componentWrapperId);
12845
- if (componentWrapperElement) {
12846
- __classPrivateFieldSet(this, _KupPlanner_rootPlanner, client.createRoot(componentWrapperElement), "f");
12847
- __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f").render(react.createElement(Planner, this.plannerProps));
12848
- }
12849
- }, _KupPlanner_toTasks = function _KupPlanner_toTasks(data) {
12850
- var _a;
12851
- let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]])).map((row) => {
12852
- const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12853
- const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12854
- ? '#START#'
12855
- : col == this.taskDates[1]
12856
- ? '#END#'
12857
- : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12858
- let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
12859
- let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
12860
- let task = {
12861
- taskRow: row,
12862
- taskRowId: row.id,
12863
- id: row.cells[this.taskIdCol].value,
12864
- name: row.cells[this.taskNameCol].value,
12865
- startDate: datesSanitized.dateValues[0],
12866
- endDate: datesSanitized.dateValues[1],
12867
- secondaryStartDate: datesSanitized.secDateValues[0],
12868
- secondaryEndDate: datesSanitized.secDateValues[1],
12869
- type: 'project',
12870
- valuesToShow: valuesToShow,
12871
- rowType: KupPlannerGanttRowType.TASK,
12872
- icon: iconUrl
12873
- ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12874
- : undefined,
12875
- };
12876
- return task;
12877
- });
12878
- return tasks;
12879
- }, _KupPlanner_toDetails = function _KupPlanner_toDetails(data) {
12880
- let details = [];
12881
- if (!data || !data.rows) {
12882
- return details;
12883
- }
12884
- data.rows
12885
- .filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
12886
- .forEach((row) => {
12887
- var _a, _b;
12888
- const detailId = row.cells[this.detailIdCol].value;
12889
- const detailNameId = row.cells[this.detailNameCol].value;
12890
- const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
12891
- const valuesToShow = getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns);
12892
- let detail = details.find((det) => det.id == detailId);
12893
- if (!detail) {
12894
- detail = {
12895
- id: detailId,
12896
- name: detailNameId,
12897
- detailRow: row,
12898
- type: 'timeline',
12899
- valuesToShow: valuesToShow,
12900
- rowType: KupPlannerGanttRowType.DETAIL,
12901
- schedule: [],
12902
- };
12903
- details.push(detail);
12904
- }
12905
- let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
12906
- let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
12907
- detail.schedule.push({
12908
- startDate: datesSanitized.dateValues[0],
12909
- endDate: datesSanitized.dateValues[1],
12910
- color: this.detailColorCol
12911
- ? (_a = row.cells[this.detailColorCol].value) !== null && _a !== void 0 ? _a : '#D9D9D8'
12912
- : '#D9D9D8',
12913
- selectedColor: this.detailColorCol
12914
- ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
12915
- : '#D9D9D8',
12916
- icon: iconUrl
12917
- ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12918
- : undefined,
12919
- });
12920
- });
12921
- return details;
12922
- }, _KupPlanner_getTask = function _KupPlanner_getTask(taskId) {
12923
- return this.plannerProps.mainGantt.items.find((task) => task.id == taskId);
12924
- }, _KupPlanner_removePhases = function _KupPlanner_removePhases(taskId) {
12925
- const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12926
- if (task)
12927
- task.phases = undefined;
12928
- this.plannerProps = Object.assign({}, this.plannerProps);
12929
- }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
12930
- const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
12931
- if (task === null || task === void 0 ? void 0 : task.phases) {
12932
- __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_removePhases).call(this, task.id);
12933
- }
12934
- return true;
12935
- }, _KupPlanner_handleOnClickOnPhase = function _KupPlanner_handleOnClickOnPhase() {
12936
- return true;
12937
- }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
12938
- return true;
12939
- }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
12940
- return true;
12941
- }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
12942
- return true;
12943
- }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
12944
- return true;
12945
- }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
12946
- let emitEvent = false;
12947
- if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
12948
- emitEvent = true;
12949
- __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
12950
- }
12951
- else if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f").isEquivalent(nativeEvent)) {
12952
- __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
12953
- emitEvent = true;
12954
- }
12955
- return emitEvent;
12956
- }, _KupPlanner_onFilter = function _KupPlanner_onFilter(e, isDetail) {
12957
- const tempData = {
12958
- columns: this.data.columns,
12959
- rows: [],
12960
- };
12961
- const value = e.target.value;
12962
- const data = isDetail ? this.detailData : this.data;
12963
- const tempRows = [];
12964
- for (let index = 0; index < data.rows.length; index++) {
12965
- const row = data.rows[index];
12966
- const cells = row.cells;
12967
- for (let index = 0; index < data.columns.length; index++) {
12968
- const column = data.columns[index];
12969
- const cell = cells[column.name];
12970
- if (cell) {
12971
- const dValue = kupManager$1.getCellValueForDisplay(data.columns[index], cell);
12972
- const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
12973
- if (found) {
12974
- tempRows.push({ row, weight: index });
12975
- break;
12976
- }
12977
- }
12978
- }
12979
- }
12980
- tempRows
12981
- .sort((a, b) => a.weight - b.weight)
12982
- .forEach((tempRow) => {
12983
- tempData.rows.push(tempRow.row);
12984
- });
12985
- const newGantt = isDetail
12986
- ? {
12987
- secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
12988
- }
12989
- : {
12990
- mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
12991
- };
12992
- this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
12993
- }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
12994
- var _a;
12995
- let iconUrl = undefined;
12996
- if (columnName) {
12997
- const iconCell = row.cells[columnName];
12998
- let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
12999
- if (!icon) {
13000
- icon = iconCell.value;
13001
- }
13002
- if (icon) {
13003
- iconUrl = index.getAssetPath('./assets/svg/' + icon + '.svg');
13004
- }
13005
- }
13006
- return iconUrl;
13007
- }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13008
- var _a;
13009
- let iconColor = undefined;
13010
- if (columnName) {
13011
- const iconCell = row.cells[columnName];
13012
- iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13013
- if (iconColor) {
13014
- iconColor =
13015
- __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13016
- }
13017
- }
13018
- return iconColor;
13019
- };
12438
+ const kupManager = kupManager$1.kupManagerInstance();
12439
+ function sanitizeAllDates(startDateCell, endDateCell, secStartDateCell, secEndDateCell) {
12440
+ const sanitizedDateValues = sanitizeDates(startDateCell, endDateCell);
12441
+ let sanitizedSecDateValues = [];
12442
+ if (secStartDateCell && secEndDateCell) {
12443
+ if (isAtLeastOneDateValid(secStartDateCell, secEndDateCell)) {
12444
+ sanitizedSecDateValues = sanitizeDates(secStartDateCell, secEndDateCell);
12445
+ }
12446
+ else {
12447
+ sanitizedSecDateValues = [...sanitizedDateValues];
12448
+ }
12449
+ }
12450
+ return {
12451
+ dateValues: sanitizedDateValues,
12452
+ secDateValues: sanitizedSecDateValues,
12453
+ };
12454
+ }
12455
+ function sanitizeDates(startDateCell, endDateCell) {
12456
+ let returnValues = [startDateCell.value, endDateCell.value];
12457
+ if (isDateValid(startDateCell) && isDateValid(endDateCell)) {
12458
+ return returnValues;
12459
+ }
12460
+ else if (isDateValid(startDateCell)) {
12461
+ return [startDateCell.value, startDateCell.value];
12462
+ }
12463
+ else if (isDateValid(endDateCell)) {
12464
+ return [endDateCell.value, endDateCell.value];
12465
+ }
12466
+ else {
12467
+ return returnValues;
12468
+ }
12469
+ }
12470
+ function isDateValid(dateCell) {
12471
+ return (kupManager.objects.isDate(dateCell.obj) &&
12472
+ kupManager.dates.isValid(dateCell.value, kupManager$1.KupDatesFormats.ISO_DATE));
12473
+ }
12474
+ function isAtLeastOneDateValid(startDateCell, endDateCell) {
12475
+ return isDateValid(startDateCell) || isDateValid(endDateCell);
12476
+ }
12477
+ function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValuesFunction) {
12478
+ let toValuesFunction = () => columns.map((col) => {
12479
+ return kupManager$1.getCellValueForDisplay(dataColumns.find((kCol) => kCol.name == col), row.cells[col]);
12480
+ });
12481
+ if (customToValuesFunction) {
12482
+ toValuesFunction = customToValuesFunction;
12483
+ }
12484
+ const valuesToShow = (columns === null || columns === void 0 ? void 0 : columns.length) >= 2
12485
+ ? toValuesFunction()
12486
+ : [row.cells[idCol].value, row.cells[nameCol].value];
12487
+ return valuesToShow;
12488
+ }
12489
+
12490
+ class KupPlannerState {
12491
+ constructor() {
12492
+ this.showSecondaryDates = false;
12493
+ this.detailFilter = "";
12494
+ this.detailInitialScrollX = 0;
12495
+ this.detailInitialScrollY = 0;
12496
+ this.taskFilter = "";
12497
+ this.taskInitialScrollX = 0;
12498
+ this.taskInitialScrollY = 0;
12499
+ this.viewMode = "day";
12500
+ }
12501
+ toDebugString() {
12502
+ // TODO
12503
+ return 'dt state';
12504
+ }
12505
+ }
12506
+
12507
+ 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%;padding-left:4px}._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%;padding-left:4px}._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}";
12508
+
12509
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12510
+ if (kind === "a" && !f)
12511
+ throw new TypeError("Private accessor was defined without a getter");
12512
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12513
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
12514
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12515
+ };
12516
+ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12517
+ if (kind === "m")
12518
+ throw new TypeError("Private method is not writable");
12519
+ if (kind === "a" && !f)
12520
+ throw new TypeError("Private accessor was defined without a setter");
12521
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
12522
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
12523
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12524
+ };
12525
+ var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_lastOnChangeReceived, _KupPlanner_rootPlanner, _KupPlanner_phases, _KupPlanner_storedSettings, _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_getFilteredRows, _KupPlanner_getIconUrl, _KupPlanner_getIconColor;
12526
+ const KupPlanner = class {
12527
+ constructor(hostRef) {
12528
+ index.registerInstance(this, hostRef);
12529
+ this.kupClick = index.createEvent(this, "kup-planner-click", 6);
12530
+ this.kupDateChange = index.createEvent(this, "kup-planner-datechange", 6);
12531
+ this.kupReady = index.createEvent(this, "kup-planner-ready", 6);
12532
+ this.kupContextMenu = index.createEvent(this, "kup-planner-contextmenu", 6);
12533
+ this.kupDidUnload = index.createEvent(this, "kup-planner-didunload", 6);
12534
+ _KupPlanner_instances.add(this);
12535
+ this.state = new KupPlannerState();
12536
+ /*-------------------------------------------------*/
12537
+ /* I n t e r n a l V a r i a b l e s */
12538
+ /*-------------------------------------------------*/
12539
+ _KupPlanner_kupManager.set(this, kupManager$1.kupManagerInstance());
12540
+ _KupPlanner_lastOnChangeReceived.set(this, void 0);
12541
+ _KupPlanner_rootPlanner.set(this, void 0);
12542
+ _KupPlanner_phases.set(this, {});
12543
+ // no re-render
12544
+ _KupPlanner_storedSettings.set(this, void 0);
12545
+ this.stateId = '';
12546
+ this.store = undefined;
12547
+ this.customStyle = '';
12548
+ this.data = undefined;
12549
+ this.detailData = undefined;
12550
+ this.detailColorCol = undefined;
12551
+ this.detailColumns = undefined;
12552
+ this.detailDates = undefined;
12553
+ this.detailFilter = undefined;
12554
+ this.detailHeight = undefined;
12555
+ this.detailIconCol = undefined;
12556
+ this.detailIdCol = undefined;
12557
+ this.detailNameCol = undefined;
12558
+ this.detailPrevDates = undefined;
12559
+ this.detailInitialScrollX = undefined;
12560
+ this.detailInitialScrollY = undefined;
12561
+ this.listCellWidth = '300px';
12562
+ this.maxWidth = '90vw';
12563
+ this.phaseColorCol = undefined;
12564
+ this.phaseColumns = undefined;
12565
+ this.phaseColParDep = undefined;
12566
+ this.phaseDates = undefined;
12567
+ this.phaseIconCol = undefined;
12568
+ this.phaseIdCol = undefined;
12569
+ this.phaseNameCol = undefined;
12570
+ this.phasePrevDates = undefined;
12571
+ this.readOnly = false;
12572
+ this.showSecondaryDates = false;
12573
+ this.taskColumns = undefined;
12574
+ this.taskDates = undefined;
12575
+ this.taskFilter = undefined;
12576
+ this.taskHeight = undefined;
12577
+ this.taskIconCol = undefined;
12578
+ this.taskIdCol = undefined;
12579
+ this.taskInitialScrollX = undefined;
12580
+ this.taskInitialScrollY = undefined;
12581
+ this.taskNameCol = undefined;
12582
+ this.taskPrevDates = undefined;
12583
+ this.titleMess = undefined;
12584
+ this.viewMode = 'month';
12585
+ this.plannerProps = undefined;
12586
+ }
12587
+ initWithPersistedState() {
12588
+ if (this.store && this.stateId) {
12589
+ const state = this.store.getState(this.stateId);
12590
+ if (state != null) {
12591
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logMessage(this, 'Initializing stateId ' + this.stateId);
12592
+ // *** PROPS ***
12593
+ this.detailFilter = state.detailFilter;
12594
+ this.showSecondaryDates = state.showSecondaryDates;
12595
+ this.detailInitialScrollX = state.detailInitialScrollX;
12596
+ this.detailInitialScrollY = state.detailInitialScrollY;
12597
+ this.taskFilter = state.taskFilter;
12598
+ this.taskInitialScrollX = state.taskInitialScrollX;
12599
+ this.taskInitialScrollY = state.taskInitialScrollY;
12600
+ this.viewMode = state.viewMode;
12601
+ }
12602
+ }
12603
+ }
12604
+ persistState() {
12605
+ if (this.store && this.stateId) {
12606
+ let somethingChanged = false;
12607
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.detailFilter, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailFilter)) {
12608
+ this.state.detailFilter = __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailFilter;
12609
+ somethingChanged = true;
12610
+ }
12611
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.showSecondaryDates, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").showSecondaryDates)) {
12612
+ this.state.showSecondaryDates =
12613
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").showSecondaryDates;
12614
+ somethingChanged = true;
12615
+ }
12616
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.detailInitialScrollX, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollX)) {
12617
+ this.state.detailInitialScrollX =
12618
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollX;
12619
+ somethingChanged = true;
12620
+ }
12621
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.detailInitialScrollY, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollY)) {
12622
+ this.state.detailInitialScrollY =
12623
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollY;
12624
+ somethingChanged = true;
12625
+ }
12626
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.taskFilter, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskFilter)) {
12627
+ this.state.taskFilter = __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskFilter;
12628
+ somethingChanged = true;
12629
+ }
12630
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.taskInitialScrollX, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollX)) {
12631
+ this.state.taskInitialScrollX =
12632
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollX;
12633
+ somethingChanged = true;
12634
+ }
12635
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.taskInitialScrollY, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollY)) {
12636
+ this.state.taskInitialScrollY =
12637
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollY;
12638
+ somethingChanged = true;
12639
+ }
12640
+ if (!__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").objects.deepEqual(this.state.viewMode, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").viewMode)) {
12641
+ this.state.viewMode = __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").viewMode;
12642
+ somethingChanged = true;
12643
+ }
12644
+ if (somethingChanged) {
12645
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logMessage(this, 'Persisting stateId ' + this.stateId);
12646
+ this.store.persistState(this.stateId, this.state);
12647
+ }
12648
+ }
12649
+ }
12650
+ dataChanged() {
12651
+ __classPrivateFieldSet(this, _KupPlanner_phases, {}, "f");
12652
+ }
12653
+ /*-------------------------------------------------*/
12654
+ /* P u b l i c M e t h o d s */
12655
+ /*-------------------------------------------------*/
12656
+ /**
12657
+ * Used to retrieve component's props values.
12658
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
12659
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
12660
+ */
12661
+ async getProps(descriptions) {
12662
+ return kupManager$1.getProps(this, KupPlannerProps, descriptions);
12663
+ }
12664
+ /**
12665
+ * This method is used to trigger a new render of the component.
12666
+ */
12667
+ async refresh() {
12668
+ index.forceUpdate(this);
12669
+ }
12670
+ /**
12671
+ * Sets the props to the component.
12672
+ * @param {GenericObject} props - Object containing props that will be set to the component.
12673
+ */
12674
+ async setProps(props) {
12675
+ kupManager$1.setProps(this, KupPlannerProps, props);
12676
+ }
12677
+ /**
12678
+ * Add a list of phases to the project
12679
+ * @param taskId
12680
+ * @param data - Matrix which contains project phases
12681
+ */
12682
+ async addPhases(taskId, data) {
12683
+ var _a;
12684
+ const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
12685
+ if (task) {
12686
+ __classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
12687
+ 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) => {
12688
+ const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
12689
+ const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
12690
+ ? '#START#'
12691
+ : col == this.phaseDates[1]
12692
+ ? '#END#'
12693
+ : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
12694
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
12695
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
12696
+ let phase = {
12697
+ taskRow: task.taskRow,
12698
+ phaseRow: row,
12699
+ id: task.id + '_' + row.cells[this.phaseIdCol].value,
12700
+ phaseRowId: row.id,
12701
+ taskRowId: task.taskRowId,
12702
+ name: row.cells[this.phaseNameCol].value,
12703
+ startDate: datesSanitized.dateValues[0],
12704
+ endDate: datesSanitized.dateValues[1],
12705
+ secondaryStartDate: datesSanitized.secDateValues[0],
12706
+ secondaryEndDate: datesSanitized.secDateValues[1],
12707
+ type: 'task',
12708
+ color: row.cells[this.phaseColorCol].value,
12709
+ selectedColor: row.cells[this.phaseColorCol].value,
12710
+ valuesToShow: valuesToShow,
12711
+ rowType: KupPlannerGanttRowType.PHASE,
12712
+ icon: iconUrl
12713
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
12714
+ : undefined,
12715
+ };
12716
+ return phase;
12717
+ });
12718
+ }
12719
+ this.plannerProps.mainGantt.initialScrollX =
12720
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollX;
12721
+ this.plannerProps.mainGantt.initialScrollY =
12722
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollY;
12723
+ if (this.plannerProps.secondaryGantt) {
12724
+ this.plannerProps.secondaryGantt.initialScrollX =
12725
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollX;
12726
+ this.plannerProps.secondaryGantt.initialScrollX =
12727
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollY;
12728
+ }
12729
+ this.plannerProps = Object.assign({}, this.plannerProps);
12730
+ }
12731
+ //---- Lifecycle hooks ----
12732
+ componentWillLoad() {
12733
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
12734
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
12735
+ // *** Store
12736
+ this.initWithPersistedState();
12737
+ __classPrivateFieldSet(this, _KupPlanner_storedSettings, {
12738
+ detailFilter: this.detailFilter,
12739
+ detailInitialScrollX: this.detailInitialScrollX,
12740
+ detailInitialScrollY: this.detailInitialScrollY,
12741
+ showSecondaryDates: this.showSecondaryDates,
12742
+ taskFilter: this.taskFilter,
12743
+ taskInitialScrollX: this.taskInitialScrollX,
12744
+ taskInitialScrollY: this.taskInitialScrollY,
12745
+ viewMode: this.viewMode,
12746
+ }, "f");
12747
+ }
12748
+ componentDidLoad() {
12749
+ let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getFilteredRows).call(this, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailFilter, true));
12750
+ const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
12751
+ fTextFieldMdc.FTextFieldMDC(mainFilter);
12752
+ const secondaryFilter = this.rootElement.shadowRoot.querySelector('#secondary-filter');
12753
+ if (details) {
12754
+ fTextFieldMdc.FTextFieldMDC(secondaryFilter);
12755
+ }
12756
+ // timeout for scroll events
12757
+ let scrollXTimeout;
12758
+ let taskScrollYTimeout;
12759
+ let detailScrollYTimeout;
12760
+ const scrollDelay = 500;
12761
+ this.plannerProps = {
12762
+ mainGantt: {
12763
+ title: this.titleMess,
12764
+ items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getFilteredRows).call(this, __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskFilter, false)),
12765
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12766
+ filter: mainFilter,
12767
+ hideLabel: true,
12768
+ ganttHeight: this.taskHeight,
12769
+ showSecondaryDates: __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").showSecondaryDates,
12770
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12771
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12772
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12773
+ initialScrollX: this.taskInitialScrollX,
12774
+ initialScrollY: this.taskInitialScrollY,
12775
+ readOnly: this.readOnly,
12776
+ onScrollY: (y) => {
12777
+ window.clearTimeout(taskScrollYTimeout);
12778
+ taskScrollYTimeout = window.setTimeout(() => this.handleTaskGanttScrollY(y), scrollDelay);
12779
+ },
12780
+ },
12781
+ secondaryGantt: details
12782
+ ? {
12783
+ title: '',
12784
+ items: details,
12785
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
12786
+ filter: secondaryFilter,
12787
+ hideLabel: true,
12788
+ ganttHeight: this.detailHeight,
12789
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
12790
+ onContextMenu: (event, row) => this.handleOnContextMenu(event, row),
12791
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
12792
+ initialScrollX: this.detailInitialScrollX,
12793
+ initialScrollY: this.detailInitialScrollY,
12794
+ readOnly: this.readOnly,
12795
+ onScrollY: (y) => {
12796
+ window.clearTimeout(detailScrollYTimeout);
12797
+ detailScrollYTimeout = window.setTimeout(() => this.handleDetailGanttScrollY(y), scrollDelay);
12798
+ },
12799
+ }
12800
+ : undefined,
12801
+ onSetDoubleView: (checked) => this.handleOnSetDoubleView(checked),
12802
+ onSetViewMode: (value) => this.handleOnSetViewMode(value),
12803
+ viewMode: this.viewMode,
12804
+ onScrollX: (x) => {
12805
+ window.clearTimeout(scrollXTimeout);
12806
+ scrollXTimeout = window.setTimeout(() => this.handleOnScrollX(x), scrollDelay);
12807
+ },
12808
+ };
12809
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12810
+ this.kupReady.emit({
12811
+ comp: this,
12812
+ id: this.rootElement.id,
12813
+ value: undefined,
12814
+ });
12815
+ if (this.taskFilter) {
12816
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, this.taskFilter);
12817
+ }
12818
+ if (this.detailFilter) {
12819
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, this.detailFilter, true);
12820
+ }
12821
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, true);
12822
+ }
12823
+ componentWillRender() {
12824
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
12825
+ }
12826
+ componentDidRender() {
12827
+ this.persistState();
12828
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
12829
+ }
12830
+ onKupClick(event, taskAction) {
12831
+ this.kupClick.emit({
12832
+ comp: this,
12833
+ id: this.rootElement.id,
12834
+ value: event,
12835
+ taskAction: taskAction,
12836
+ });
12837
+ }
12838
+ onKupContextMenu(event, ganttRow, taskAction) {
12839
+ let row;
12840
+ let cell;
12841
+ let column;
12842
+ switch (ganttRow.type) {
12843
+ case 'project': {
12844
+ row = ganttRow.taskRow;
12845
+ cell = row.cells[this.taskIdCol];
12846
+ column = this.data.columns[this.taskIdCol];
12847
+ break;
12848
+ }
12849
+ case 'task': {
12850
+ row = ganttRow.phaseRow;
12851
+ cell = row.cells[this.phaseIdCol];
12852
+ //column = this.data.columns[this.taskIdCol];
12853
+ break;
12854
+ }
12855
+ case 'timeline': {
12856
+ row = ganttRow.detailRow;
12857
+ cell = row.cells[this.detailIdCol];
12858
+ column = this.data.columns[this.detailIdCol];
12859
+ break;
12860
+ }
12861
+ }
12862
+ this.kupContextMenu.emit({
12863
+ comp: this,
12864
+ id: this.rootElement.id,
12865
+ value: ganttRow,
12866
+ taskAction: taskAction,
12867
+ details: {
12868
+ cell: cell,
12869
+ column: column,
12870
+ originalEvent: event,
12871
+ row: row,
12872
+ },
12873
+ });
12874
+ }
12875
+ onKupDateChange(event, taskAction) {
12876
+ this.kupDateChange.emit({
12877
+ comp: this,
12878
+ id: this.rootElement.id,
12879
+ value: event,
12880
+ taskAction: taskAction,
12881
+ });
12882
+ }
12883
+ handleOnClick(nativeEvent) {
12884
+ switch (nativeEvent.rowType) {
12885
+ case KupPlannerGanttRowType.TASK:
12886
+ const taskAction = nativeEvent.phases
12887
+ ? KupPlannerTaskAction.onTaskClosing
12888
+ : KupPlannerTaskAction.onTaskOpening;
12889
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
12890
+ this.onKupClick(nativeEvent, taskAction);
12891
+ }
12892
+ break;
12893
+ case KupPlannerGanttRowType.PHASE:
12894
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
12895
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12896
+ }
12897
+ break;
12898
+ case KupPlannerGanttRowType.DETAIL:
12899
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
12900
+ this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
12901
+ }
12902
+ break;
12903
+ }
12904
+ }
12905
+ handleOnContextMenu(event, row) {
12906
+ switch (row.rowType) {
12907
+ case KupPlannerGanttRowType.TASK:
12908
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnTask).call(this)) {
12909
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12910
+ }
12911
+ break;
12912
+ case KupPlannerGanttRowType.PHASE:
12913
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnPhase).call(this)) {
12914
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12915
+ }
12916
+ break;
12917
+ case KupPlannerGanttRowType.DETAIL:
12918
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnContextMenuOnDetail).call(this)) {
12919
+ this.onKupContextMenu(event, row, KupPlannerTaskAction.onRightClick);
12920
+ }
12921
+ break;
12922
+ }
12923
+ }
12924
+ handleOnSetDoubleView(checked) {
12925
+ var _a;
12926
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").showSecondaryDates = checked;
12927
+ if ((_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) {
12928
+ this.plannerProps.mainGantt.showSecondaryDates = checked;
12929
+ }
12930
+ this.persistState();
12931
+ }
12932
+ handleOnSetViewMode(value) {
12933
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").viewMode = value;
12934
+ this.plannerProps.viewMode = value;
12935
+ this.persistState();
12936
+ }
12937
+ handleOnScrollX(x) {
12938
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollX = x;
12939
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollX = x;
12940
+ this.persistState();
12941
+ }
12942
+ handleTaskGanttScrollY(y) {
12943
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollY = y;
12944
+ this.persistState();
12945
+ }
12946
+ handleDetailGanttScrollY(y) {
12947
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailInitialScrollY = y;
12948
+ this.persistState();
12949
+ }
12950
+ handleOnDateChange(nativeEvent) {
12951
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
12952
+ if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
12953
+ this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
12954
+ }
12955
+ }
12956
+ }
12957
+ render() {
12958
+ var _a;
12959
+ return (index.h(index.Host, null, index.h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId, style: { maxWidth: this.maxWidth } }), index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12960
+ if (e.key === 'Enter') {
12961
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e.target.value);
12962
+ }
12963
+ }, value: this.taskFilter, wrapperClass: "filter" }), ((_a = this.detailData) === null || _a === void 0 ? void 0 : _a.rows) && this.detailData.rows.length > 0 ? (index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "secondary-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
12964
+ if (e.key === 'Enter') {
12965
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e.target.value, true);
12966
+ }
12967
+ }, value: this.detailFilter, wrapperClass: "filter" })) : null));
12968
+ }
12969
+ disconnectedCallback() {
12970
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
12971
+ this.kupDidUnload.emit({
12972
+ comp: this,
12973
+ id: this.rootElement.id,
12974
+ storedSettings: __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f"),
12975
+ });
12976
+ }
12977
+ get rootElement() { return index.getElement(this); }
12978
+ static get watchers() { return {
12979
+ "data": ["dataChanged"]
12980
+ }; }
12981
+ };
12982
+ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_phases = new WeakMap(), _KupPlanner_storedSettings = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
12983
+ var _a;
12984
+ (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
12985
+ const componentWrapperElement = this.rootElement.shadowRoot.getElementById(GenericVariables.componentWrapperId);
12986
+ if (componentWrapperElement) {
12987
+ __classPrivateFieldSet(this, _KupPlanner_rootPlanner, client.createRoot(componentWrapperElement), "f");
12988
+ __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f").render(react.createElement(Planner, this.plannerProps));
12989
+ }
12990
+ }, _KupPlanner_toTasks = function _KupPlanner_toTasks(data) {
12991
+ var _a;
12992
+ if (!data || !data.rows) {
12993
+ return [];
12994
+ }
12995
+ 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) => {
12996
+ const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
12997
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns, () => this.taskColumns.map((col) => col == this.taskDates[0]
12998
+ ? '#START#'
12999
+ : col == this.taskDates[1]
13000
+ ? '#END#'
13001
+ : kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
13002
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.taskIconCol);
13003
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.taskIconCol);
13004
+ let task = {
13005
+ taskRow: row,
13006
+ taskRowId: row.id,
13007
+ id: row.cells[this.taskIdCol].value,
13008
+ name: row.cells[this.taskNameCol].value,
13009
+ startDate: datesSanitized.dateValues[0],
13010
+ endDate: datesSanitized.dateValues[1],
13011
+ secondaryStartDate: datesSanitized.secDateValues[0],
13012
+ secondaryEndDate: datesSanitized.secDateValues[1],
13013
+ type: 'project',
13014
+ valuesToShow: valuesToShow,
13015
+ rowType: KupPlannerGanttRowType.TASK,
13016
+ icon: iconUrl
13017
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
13018
+ : undefined,
13019
+ };
13020
+ return task;
13021
+ });
13022
+ return tasks;
13023
+ }, _KupPlanner_toDetails = function _KupPlanner_toDetails(data) {
13024
+ if (!data || !data.rows) {
13025
+ return undefined;
13026
+ }
13027
+ let details = [];
13028
+ data.rows
13029
+ .filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
13030
+ .forEach((row) => {
13031
+ var _a, _b;
13032
+ const detailId = row.cells[this.detailIdCol].value;
13033
+ const detailNameId = row.cells[this.detailNameCol].value;
13034
+ const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
13035
+ const valuesToShow = getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns);
13036
+ let detail = details.find((det) => det.id == detailId);
13037
+ if (!detail) {
13038
+ detail = {
13039
+ id: detailId,
13040
+ name: detailNameId,
13041
+ detailRow: row,
13042
+ type: 'timeline',
13043
+ valuesToShow: valuesToShow,
13044
+ rowType: KupPlannerGanttRowType.DETAIL,
13045
+ schedule: [],
13046
+ };
13047
+ details.push(detail);
13048
+ }
13049
+ let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.detailIconCol);
13050
+ let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.detailIconCol);
13051
+ detail.schedule.push({
13052
+ startDate: datesSanitized.dateValues[0],
13053
+ endDate: datesSanitized.dateValues[1],
13054
+ color: this.detailColorCol
13055
+ ? (_a = row.cells[this.detailColorCol].value) !== null && _a !== void 0 ? _a : '#D9D9D8'
13056
+ : '#D9D9D8',
13057
+ selectedColor: this.detailColorCol
13058
+ ? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
13059
+ : '#D9D9D8',
13060
+ icon: iconUrl
13061
+ ? { url: iconUrl, color: iconColor !== null && iconColor !== void 0 ? iconColor : '#595959' }
13062
+ : undefined,
13063
+ });
13064
+ });
13065
+ return details;
13066
+ }, _KupPlanner_getTask = function _KupPlanner_getTask(taskId) {
13067
+ return this.plannerProps.mainGantt.items.find((task) => task.id == taskId);
13068
+ }, _KupPlanner_removePhases = function _KupPlanner_removePhases(taskId) {
13069
+ const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
13070
+ if (task)
13071
+ task.phases = undefined;
13072
+ this.plannerProps = Object.assign({}, this.plannerProps);
13073
+ }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
13074
+ const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
13075
+ if (task === null || task === void 0 ? void 0 : task.phases) {
13076
+ __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_removePhases).call(this, task.id);
13077
+ }
13078
+ return true;
13079
+ }, _KupPlanner_handleOnClickOnPhase = function _KupPlanner_handleOnClickOnPhase() {
13080
+ return true;
13081
+ }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
13082
+ return true;
13083
+ }, _KupPlanner_handleOnContextMenuOnTask = function _KupPlanner_handleOnContextMenuOnTask() {
13084
+ return true;
13085
+ }, _KupPlanner_handleOnContextMenuOnPhase = function _KupPlanner_handleOnContextMenuOnPhase() {
13086
+ return true;
13087
+ }, _KupPlanner_handleOnContextMenuOnDetail = function _KupPlanner_handleOnContextMenuOnDetail() {
13088
+ return true;
13089
+ }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
13090
+ let emitEvent = false;
13091
+ if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
13092
+ emitEvent = true;
13093
+ __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
13094
+ }
13095
+ else if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f").isEquivalent(nativeEvent)) {
13096
+ __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
13097
+ emitEvent = true;
13098
+ }
13099
+ return emitEvent;
13100
+ }, _KupPlanner_onFilter = function _KupPlanner_onFilter(value, isDetail) {
13101
+ if (isDetail) {
13102
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").detailFilter = value;
13103
+ }
13104
+ else {
13105
+ __classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskFilter = value;
13106
+ }
13107
+ const newGantt = isDetail
13108
+ ? {
13109
+ secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getFilteredRows).call(this, value, isDetail)) }),
13110
+ }
13111
+ : {
13112
+ mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getFilteredRows).call(this, value, isDetail)) }),
13113
+ };
13114
+ this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
13115
+ this.persistState();
13116
+ }, _KupPlanner_getFilteredRows = function _KupPlanner_getFilteredRows(value, isDetail) {
13117
+ const data = isDetail ? this.detailData : this.data;
13118
+ if (!data || !data.rows || data.rows.length == 0) {
13119
+ return undefined;
13120
+ }
13121
+ if (!value) {
13122
+ return data;
13123
+ }
13124
+ const tempData = {
13125
+ columns: this.data.columns,
13126
+ rows: [],
13127
+ };
13128
+ const tempRows = [];
13129
+ for (let index = 0; index < data.rows.length; index++) {
13130
+ const row = data.rows[index];
13131
+ const cells = row.cells;
13132
+ for (let index = 0; index < data.columns.length; index++) {
13133
+ const column = data.columns[index];
13134
+ const cell = cells[column.name];
13135
+ if (cell) {
13136
+ const dValue = kupManager$1.getCellValueForDisplay(data.columns[index], cell);
13137
+ const found = !!(dValue.toLowerCase().indexOf(value.toLowerCase()) > -1);
13138
+ if (found) {
13139
+ tempRows.push({ row, weight: index });
13140
+ break;
13141
+ }
13142
+ }
13143
+ }
13144
+ }
13145
+ tempRows
13146
+ .sort((a, b) => a.weight - b.weight)
13147
+ .forEach((tempRow) => {
13148
+ tempData.rows.push(tempRow.row);
13149
+ });
13150
+ return tempData;
13151
+ }, _KupPlanner_getIconUrl = function _KupPlanner_getIconUrl(row, columnName) {
13152
+ var _a;
13153
+ let iconUrl = undefined;
13154
+ if (columnName) {
13155
+ const iconCell = row.cells[columnName];
13156
+ let icon = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.resource;
13157
+ if (!icon) {
13158
+ icon = iconCell.value;
13159
+ }
13160
+ if (icon) {
13161
+ iconUrl = index.getAssetPath('./assets/svg/' + icon + '.svg');
13162
+ }
13163
+ }
13164
+ return iconUrl;
13165
+ }, _KupPlanner_getIconColor = function _KupPlanner_getIconColor(row, columnName) {
13166
+ var _a;
13167
+ let iconColor = undefined;
13168
+ if (columnName) {
13169
+ const iconCell = row.cells[columnName];
13170
+ iconColor = (_a = iconCell === null || iconCell === void 0 ? void 0 : iconCell.data) === null || _a === void 0 ? void 0 : _a.color;
13171
+ if (iconColor) {
13172
+ iconColor =
13173
+ __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.colorCheck(iconColor).hexColor;
13174
+ }
13175
+ }
13176
+ return iconColor;
13177
+ };
13020
13178
  KupPlanner.style = kupPlannerCss;
13021
13179
 
13022
13180
  exports.kup_planner = KupPlanner;