@sme.up/ketchup 7.4.0 → 7.4.2

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 (36) hide show
  1. package/dist/cjs/ketchup.cjs.js +2 -2
  2. package/dist/cjs/kup-planner.cjs.entry.js +1006 -549
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/collection/collection-manifest.json +1 -1
  5. package/dist/collection/components/kup-planner/kup-planner-declarations.js +60 -14
  6. package/dist/collection/components/kup-planner/kup-planner-helper.js +54 -0
  7. package/dist/collection/components/kup-planner/kup-planner.css +16 -18
  8. package/dist/collection/components/kup-planner/kup-planner.js +447 -68
  9. package/dist/components/kup-autocomplete2.js +1 -1
  10. package/dist/components/kup-planner.js +1006 -538
  11. package/dist/components/kup-progress-bar.js +1 -1
  12. package/dist/components/kup-radio.js +1 -1
  13. package/dist/components/kup-rating.js +1 -1
  14. package/dist/components/kup-spinner.js +1 -1
  15. package/dist/components/kup-switch.js +1 -1
  16. package/dist/components/kup-tab-bar.js +1 -1
  17. package/dist/components/kup-text-field.js +1 -1
  18. package/dist/components/kup-time-picker.js +1 -1
  19. package/dist/components/kup-tree.js +1 -1
  20. package/dist/esm/ketchup.js +2 -2
  21. package/dist/esm/kup-planner.entry.js +994 -537
  22. package/dist/esm/loader.js +2 -2
  23. package/dist/ketchup/ketchup.esm.js +1 -1
  24. package/dist/ketchup/p-02a26d59.entry.js +9 -0
  25. package/dist/ketchup/p-462475ac.entry.js +10 -0
  26. package/dist/ketchup/{p-c1137ffd.entry.js → p-4d039705.entry.js} +6 -6
  27. package/dist/ketchup/p-5292ef67.js +3 -3
  28. package/dist/ketchup/p-be61dd36.entry.js +39 -0
  29. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +66 -15
  30. package/dist/types/components/kup-planner/kup-planner-helper.d.ts +6 -0
  31. package/dist/types/components/kup-planner/kup-planner.d.ts +118 -3
  32. package/dist/types/components.d.ts +234 -2
  33. package/package.json +6 -4
  34. package/dist/ketchup/p-4fa7bffd.entry.js +0 -39
  35. package/dist/ketchup/p-8826f5d6.entry.js +0 -11
  36. package/dist/ketchup/p-d5200264.entry.js +0 -9
@@ -14,15 +14,17 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase;
17
+ var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_emitOnChangeEventsReceived;
18
18
  import { forceUpdate, h, Host, } from '@stencil/core';
19
19
  import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
20
- import { KupPlannerProps, KupPlannerTaskAction, } from './kup-planner-declarations';
20
+ import { defaultStylingOptions, KupPlannerLastOnChangeReceived, KupPlannerProps, KupPlannerTaskAction, KupPlannerGanttRowType, } from './kup-planner-declarations';
21
21
  import { getProps, setProps } from '../../utils/utils';
22
22
  import { componentWrapperId } from '../../variables/GenericVariables';
23
23
  import { createRoot } from 'react-dom/client';
24
24
  import React from 'react';
25
25
  import { Planner, } from '@sme.up/gantt-component';
26
+ import { getCellValueForDisplay } from '../../utils/cell-utils';
27
+ import { getValuesToShow, isAtLeastOneDateValid, sanitizeAllDates, } from './kup-planner-helper';
26
28
  export class KupPlanner {
27
29
  constructor() {
28
30
  _KupPlanner_instances.add(this);
@@ -31,10 +33,20 @@ export class KupPlanner {
31
33
  /*-------------------------------------------------*/
32
34
  _KupPlanner_kupManager.set(this, kupManagerInstance());
33
35
  _KupPlanner_rootPlanner.set(this, void 0);
36
+ _KupPlanner_lastOnChangeReceived.set(this, void 0);
34
37
  this.plannerProps = undefined;
35
38
  this.customStyle = '';
36
39
  this.data = undefined;
37
- this.dataRaw = undefined;
40
+ this.detailData = undefined;
41
+ this.detailColorCol = undefined;
42
+ this.detailColumns = undefined;
43
+ this.detailDates = undefined;
44
+ this.detailHeight = undefined;
45
+ this.detailIdCol = undefined;
46
+ this.detailNameCol = undefined;
47
+ this.detailPrevDates = undefined;
48
+ this.listCellWidth = '300px';
49
+ this.maxWidth = '90vw';
38
50
  this.phaseColorCol = undefined;
39
51
  this.phaseColumns = undefined;
40
52
  this.phaseColParDep = undefined;
@@ -42,8 +54,10 @@ export class KupPlanner {
42
54
  this.phaseIdCol = undefined;
43
55
  this.phaseNameCol = undefined;
44
56
  this.phasePrevDates = undefined;
57
+ this.showSecondaryDates = false;
45
58
  this.taskColumns = undefined;
46
59
  this.taskDates = undefined;
60
+ this.taskHeight = undefined;
47
61
  this.taskIdCol = undefined;
48
62
  this.taskNameCol = undefined;
49
63
  this.taskPrevDates = undefined;
@@ -97,19 +111,29 @@ export class KupPlanner {
97
111
  var _a;
98
112
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
99
113
  if (task) {
100
- task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((row) => {
114
+ 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) => {
115
+ const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
116
+ const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
117
+ ? '#START#'
118
+ : col == this.phaseDates[1]
119
+ ? '#END#'
120
+ : getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
101
121
  let phase = {
102
- id: row.cells[this.phaseIdCol].value,
122
+ taskRow: task.taskRow,
123
+ phaseRow: row,
124
+ id: task.id + '_' + row.cells[this.phaseIdCol].value,
103
125
  phaseRowId: row.id,
104
126
  taskRowId: task.taskRowId,
105
127
  name: row.cells[this.phaseNameCol].value,
106
- startDate: row.cells[this.phaseDates[0]].value,
107
- endDate: row.cells[this.phaseDates[1]].value,
108
- secondaryStartDate: row.cells[this.phasePrevDates[0]].value,
109
- secondaryEndDate: row.cells[this.phasePrevDates[1]].value,
110
- type: 'phase',
128
+ startDate: datesSanitized.dateValues[0],
129
+ endDate: datesSanitized.dateValues[1],
130
+ secondaryStartDate: datesSanitized.secDateValues[0],
131
+ secondaryEndDate: datesSanitized.secDateValues[1],
132
+ type: 'task',
111
133
  color: row.cells[this.phaseColorCol].value,
112
- valuesToShow: this.phaseColumns.map((col) => row.cells[col].value),
134
+ selectedColor: row.cells[this.phaseColorCol].value,
135
+ valuesToShow: valuesToShow,
136
+ rowType: KupPlannerGanttRowType.PHASE,
113
137
  };
114
138
  return phase;
115
139
  });
@@ -118,8 +142,8 @@ export class KupPlanner {
118
142
  }
119
143
  handleOnClick(nativeEvent) {
120
144
  console.log('handleOnClick', nativeEvent);
121
- switch (nativeEvent.type) {
122
- case 'task':
145
+ switch (nativeEvent.rowType) {
146
+ case KupPlannerGanttRowType.TASK:
123
147
  const taskAction = nativeEvent.phases
124
148
  ? KupPlannerTaskAction.onClosing
125
149
  : KupPlannerTaskAction.onOpening;
@@ -127,28 +151,57 @@ export class KupPlanner {
127
151
  this.onKupClick(nativeEvent, taskAction);
128
152
  }
129
153
  break;
130
- case 'phase':
154
+ case KupPlannerGanttRowType.PHASE:
131
155
  if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
132
156
  this.onKupClick(nativeEvent);
133
157
  }
134
158
  break;
159
+ case KupPlannerGanttRowType.DETAIL:
160
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
161
+ this.onKupClick(nativeEvent);
162
+ }
163
+ break;
135
164
  }
136
165
  }
137
166
  handleOnDateChange(nativeEvent) {
138
- console.log('handleOnDateChange', nativeEvent);
139
- this.onKupDateChange(nativeEvent);
167
+ if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
168
+ console.log('handleOnDateChange', nativeEvent);
169
+ this.onKupDateChange(nativeEvent);
170
+ }
140
171
  }
141
172
  componentWillLoad() {
142
173
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logLoad(this, false);
143
174
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
144
175
  }
145
176
  componentDidLoad() {
177
+ let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
178
+ if (details && details.length == 0) {
179
+ details = undefined;
180
+ }
146
181
  this.plannerProps = {
147
- title: this.titleMess,
148
- items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
149
- onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
150
- onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
182
+ mainGantt: {
183
+ title: this.titleMess,
184
+ items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
185
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
186
+ hideLabel: true,
187
+ ganttHeight: this.taskHeight,
188
+ showSecondaryDates: this.showSecondaryDates,
189
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
190
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
191
+ },
192
+ secondaryGantt: details
193
+ ? {
194
+ title: '',
195
+ items: details,
196
+ stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
197
+ hideLabel: true,
198
+ ganttHeight: this.detailHeight,
199
+ onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
200
+ onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
201
+ }
202
+ : undefined,
151
203
  };
204
+ console.log('kup-planner.tsx componentDidLoad plannerProps', this.plannerProps);
152
205
  __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
153
206
  this.kupReady.emit({
154
207
  comp: this,
@@ -164,7 +217,8 @@ export class KupPlanner {
164
217
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
165
218
  }
166
219
  render() {
167
- return (h(Host, null, h("div", { id: componentWrapperId })));
220
+ //console.log('kup-planner.tsx render');
221
+ return (h(Host, null, h("div", { id: componentWrapperId, style: { maxWidth: this.maxWidth } })));
168
222
  }
169
223
  disconnectedCallback() {
170
224
  __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
@@ -223,27 +277,212 @@ export class KupPlanner {
223
277
  "required": false,
224
278
  "optional": false,
225
279
  "docs": {
226
- "tags": [],
227
- "text": ""
280
+ "tags": [{
281
+ "name": "default",
282
+ "text": "null"
283
+ }],
284
+ "text": "Dataset containg the tasks list"
228
285
  }
229
286
  },
230
- "dataRaw": {
231
- "type": "any",
287
+ "detailData": {
288
+ "type": "unknown",
289
+ "mutable": false,
290
+ "complexType": {
291
+ "original": "KupDataDataset",
292
+ "resolved": "KupDataDataset",
293
+ "references": {
294
+ "KupDataDataset": {
295
+ "location": "import",
296
+ "path": "../../managers/kup-data/kup-data-declarations"
297
+ }
298
+ }
299
+ },
300
+ "required": false,
301
+ "optional": false,
302
+ "docs": {
303
+ "tags": [{
304
+ "name": "default",
305
+ "text": "null"
306
+ }],
307
+ "text": "Dataset containg the details list"
308
+ }
309
+ },
310
+ "detailColorCol": {
311
+ "type": "string",
232
312
  "mutable": false,
233
313
  "complexType": {
234
- "original": "any",
235
- "resolved": "any",
314
+ "original": "string",
315
+ "resolved": "string",
236
316
  "references": {}
237
317
  },
238
318
  "required": false,
239
319
  "optional": false,
240
320
  "docs": {
241
- "tags": [],
242
- "text": ""
321
+ "tags": [{
322
+ "name": "default",
323
+ "text": "null"
324
+ }],
325
+ "text": "Column containing the detail color, in hex format"
243
326
  },
244
- "attribute": "data-raw",
327
+ "attribute": "detail-color-col",
245
328
  "reflect": false
246
329
  },
330
+ "detailColumns": {
331
+ "type": "unknown",
332
+ "mutable": false,
333
+ "complexType": {
334
+ "original": "string[]",
335
+ "resolved": "string[]",
336
+ "references": {}
337
+ },
338
+ "required": false,
339
+ "optional": false,
340
+ "docs": {
341
+ "tags": [{
342
+ "name": "default",
343
+ "text": "null"
344
+ }],
345
+ "text": "Columns containing informations displayed in the left box, near the gantt of details"
346
+ }
347
+ },
348
+ "detailDates": {
349
+ "type": "unknown",
350
+ "mutable": false,
351
+ "complexType": {
352
+ "original": "string[]",
353
+ "resolved": "string[]",
354
+ "references": {}
355
+ },
356
+ "required": false,
357
+ "optional": false,
358
+ "docs": {
359
+ "tags": [{
360
+ "name": "default",
361
+ "text": "null"
362
+ }],
363
+ "text": "Columns containing detail duration, from (firstDate) to (secondDate)"
364
+ }
365
+ },
366
+ "detailHeight": {
367
+ "type": "number",
368
+ "mutable": false,
369
+ "complexType": {
370
+ "original": "number",
371
+ "resolved": "number",
372
+ "references": {}
373
+ },
374
+ "required": false,
375
+ "optional": false,
376
+ "docs": {
377
+ "tags": [{
378
+ "name": "default",
379
+ "text": "null"
380
+ }],
381
+ "text": "Height for detail gantt"
382
+ },
383
+ "attribute": "detail-height",
384
+ "reflect": false
385
+ },
386
+ "detailIdCol": {
387
+ "type": "string",
388
+ "mutable": false,
389
+ "complexType": {
390
+ "original": "string",
391
+ "resolved": "string",
392
+ "references": {}
393
+ },
394
+ "required": false,
395
+ "optional": false,
396
+ "docs": {
397
+ "tags": [{
398
+ "name": "default",
399
+ "text": "null"
400
+ }],
401
+ "text": "Column containing unique detail identifier"
402
+ },
403
+ "attribute": "detail-id-col",
404
+ "reflect": false
405
+ },
406
+ "detailNameCol": {
407
+ "type": "string",
408
+ "mutable": false,
409
+ "complexType": {
410
+ "original": "string",
411
+ "resolved": "string",
412
+ "references": {}
413
+ },
414
+ "required": false,
415
+ "optional": false,
416
+ "docs": {
417
+ "tags": [{
418
+ "name": "default",
419
+ "text": "null"
420
+ }],
421
+ "text": "Column containing detail name displayed"
422
+ },
423
+ "attribute": "detail-name-col",
424
+ "reflect": false
425
+ },
426
+ "detailPrevDates": {
427
+ "type": "unknown",
428
+ "mutable": false,
429
+ "complexType": {
430
+ "original": "string[]",
431
+ "resolved": "string[]",
432
+ "references": {}
433
+ },
434
+ "required": false,
435
+ "optional": false,
436
+ "docs": {
437
+ "tags": [{
438
+ "name": "default",
439
+ "text": "null"
440
+ }],
441
+ "text": "Columns containing fForecast detail duration, from (firstDate) to (secondDate)"
442
+ }
443
+ },
444
+ "listCellWidth": {
445
+ "type": "string",
446
+ "mutable": false,
447
+ "complexType": {
448
+ "original": "string",
449
+ "resolved": "string",
450
+ "references": {}
451
+ },
452
+ "required": false,
453
+ "optional": false,
454
+ "docs": {
455
+ "tags": [{
456
+ "name": "default",
457
+ "text": "'300px'"
458
+ }],
459
+ "text": "Total size of the cells inside to the left box, near the gantt"
460
+ },
461
+ "attribute": "list-cell-width",
462
+ "reflect": false,
463
+ "defaultValue": "'300px'"
464
+ },
465
+ "maxWidth": {
466
+ "type": "string",
467
+ "mutable": false,
468
+ "complexType": {
469
+ "original": "string",
470
+ "resolved": "string",
471
+ "references": {}
472
+ },
473
+ "required": false,
474
+ "optional": false,
475
+ "docs": {
476
+ "tags": [{
477
+ "name": "default",
478
+ "text": "'90vw'"
479
+ }],
480
+ "text": "Max width for component"
481
+ },
482
+ "attribute": "max-width",
483
+ "reflect": false,
484
+ "defaultValue": "'90vw'"
485
+ },
247
486
  "phaseColorCol": {
248
487
  "type": "string",
249
488
  "mutable": false,
@@ -255,8 +494,11 @@ export class KupPlanner {
255
494
  "required": false,
256
495
  "optional": false,
257
496
  "docs": {
258
- "tags": [],
259
- "text": ""
497
+ "tags": [{
498
+ "name": "default",
499
+ "text": "null"
500
+ }],
501
+ "text": "Column containing the phase color in hex format"
260
502
  },
261
503
  "attribute": "phase-color-col",
262
504
  "reflect": false
@@ -272,8 +514,11 @@ export class KupPlanner {
272
514
  "required": false,
273
515
  "optional": false,
274
516
  "docs": {
275
- "tags": [],
276
- "text": ""
517
+ "tags": [{
518
+ "name": "default",
519
+ "text": "null"
520
+ }],
521
+ "text": "Columns containing informations displayed in the left box ,near the gantt of phases"
277
522
  }
278
523
  },
279
524
  "phaseColParDep": {
@@ -287,8 +532,11 @@ export class KupPlanner {
287
532
  "required": false,
288
533
  "optional": false,
289
534
  "docs": {
290
- "tags": [],
291
- "text": ""
535
+ "tags": [{
536
+ "name": "default",
537
+ "text": "null"
538
+ }],
539
+ "text": "Column containing the name of the parent phases"
292
540
  },
293
541
  "attribute": "phase-col-par-dep",
294
542
  "reflect": false
@@ -304,8 +552,11 @@ export class KupPlanner {
304
552
  "required": false,
305
553
  "optional": false,
306
554
  "docs": {
307
- "tags": [],
308
- "text": ""
555
+ "tags": [{
556
+ "name": "default",
557
+ "text": "null"
558
+ }],
559
+ "text": "Columns containing phase duration, from (firstDate) to (secondDate)"
309
560
  }
310
561
  },
311
562
  "phaseIdCol": {
@@ -319,8 +570,11 @@ export class KupPlanner {
319
570
  "required": false,
320
571
  "optional": false,
321
572
  "docs": {
322
- "tags": [],
323
- "text": ""
573
+ "tags": [{
574
+ "name": "default",
575
+ "text": "null"
576
+ }],
577
+ "text": "Column containing unique phase identifier"
324
578
  },
325
579
  "attribute": "phase-id-col",
326
580
  "reflect": false
@@ -336,8 +590,11 @@ export class KupPlanner {
336
590
  "required": false,
337
591
  "optional": false,
338
592
  "docs": {
339
- "tags": [],
340
- "text": ""
593
+ "tags": [{
594
+ "name": "default",
595
+ "text": "null"
596
+ }],
597
+ "text": "Column containing phase name displayed"
341
598
  },
342
599
  "attribute": "phase-name-col",
343
600
  "reflect": false
@@ -353,10 +610,34 @@ export class KupPlanner {
353
610
  "required": false,
354
611
  "optional": false,
355
612
  "docs": {
356
- "tags": [],
357
- "text": ""
613
+ "tags": [{
614
+ "name": "default",
615
+ "text": "null"
616
+ }],
617
+ "text": "Columns containing forecast phase duration, from (firstDate) to (secondDate)"
358
618
  }
359
619
  },
620
+ "showSecondaryDates": {
621
+ "type": "boolean",
622
+ "mutable": false,
623
+ "complexType": {
624
+ "original": "boolean",
625
+ "resolved": "boolean",
626
+ "references": {}
627
+ },
628
+ "required": false,
629
+ "optional": false,
630
+ "docs": {
631
+ "tags": [{
632
+ "name": "default",
633
+ "text": "false"
634
+ }],
635
+ "text": "Enable/disable display of secondary dates"
636
+ },
637
+ "attribute": "show-secondary-dates",
638
+ "reflect": false,
639
+ "defaultValue": "false"
640
+ },
360
641
  "taskColumns": {
361
642
  "type": "unknown",
362
643
  "mutable": false,
@@ -368,8 +649,11 @@ export class KupPlanner {
368
649
  "required": false,
369
650
  "optional": false,
370
651
  "docs": {
371
- "tags": [],
372
- "text": ""
652
+ "tags": [{
653
+ "name": "default",
654
+ "text": "null"
655
+ }],
656
+ "text": "Columns containing informations displayed in the left box, near the gantt"
373
657
  }
374
658
  },
375
659
  "taskDates": {
@@ -383,10 +667,33 @@ export class KupPlanner {
383
667
  "required": false,
384
668
  "optional": false,
385
669
  "docs": {
386
- "tags": [],
387
- "text": ""
670
+ "tags": [{
671
+ "name": "default",
672
+ "text": "null"
673
+ }],
674
+ "text": "Columns containing task duration, from (firstDate) to (secondDate)"
388
675
  }
389
676
  },
677
+ "taskHeight": {
678
+ "type": "number",
679
+ "mutable": false,
680
+ "complexType": {
681
+ "original": "number",
682
+ "resolved": "number",
683
+ "references": {}
684
+ },
685
+ "required": false,
686
+ "optional": false,
687
+ "docs": {
688
+ "tags": [{
689
+ "name": "default",
690
+ "text": "null"
691
+ }],
692
+ "text": "Height for main gantt"
693
+ },
694
+ "attribute": "task-height",
695
+ "reflect": false
696
+ },
390
697
  "taskIdCol": {
391
698
  "type": "string",
392
699
  "mutable": false,
@@ -398,8 +705,11 @@ export class KupPlanner {
398
705
  "required": false,
399
706
  "optional": false,
400
707
  "docs": {
401
- "tags": [],
402
- "text": ""
708
+ "tags": [{
709
+ "name": "default",
710
+ "text": "null"
711
+ }],
712
+ "text": "Column containing unique task identifier"
403
713
  },
404
714
  "attribute": "task-id-col",
405
715
  "reflect": false
@@ -415,8 +725,11 @@ export class KupPlanner {
415
725
  "required": false,
416
726
  "optional": false,
417
727
  "docs": {
418
- "tags": [],
419
- "text": ""
728
+ "tags": [{
729
+ "name": "default",
730
+ "text": "null"
731
+ }],
732
+ "text": "Column containing task name displayed"
420
733
  },
421
734
  "attribute": "task-name-col",
422
735
  "reflect": false
@@ -432,8 +745,11 @@ export class KupPlanner {
432
745
  "required": false,
433
746
  "optional": false,
434
747
  "docs": {
435
- "tags": [],
436
- "text": ""
748
+ "tags": [{
749
+ "name": "default",
750
+ "text": "null"
751
+ }],
752
+ "text": "Columns containing forecast task duration, from (firstDate) to (secondDate)"
437
753
  }
438
754
  },
439
755
  "titleMess": {
@@ -447,8 +763,11 @@ export class KupPlanner {
447
763
  "required": false,
448
764
  "optional": false,
449
765
  "docs": {
450
- "tags": [],
451
- "text": ""
766
+ "tags": [{
767
+ "name": "default",
768
+ "text": "null"
769
+ }],
770
+ "text": "Message displayed on top"
452
771
  },
453
772
  "attribute": "title-mess",
454
773
  "reflect": false
@@ -629,6 +948,10 @@ export class KupPlanner {
629
948
  "KupPlannerPhase": {
630
949
  "location": "import",
631
950
  "path": "./kup-planner-declarations"
951
+ },
952
+ "TaskType": {
953
+ "location": "import",
954
+ "path": "@sme.up/gantt-component/dist/types/public-types"
632
955
  }
633
956
  },
634
957
  "return": "Promise<void>"
@@ -648,7 +971,7 @@ export class KupPlanner {
648
971
  }
649
972
  static get elementRef() { return "rootElement"; }
650
973
  }
651
- _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
974
+ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(), _KupPlanner_lastOnChangeReceived = new WeakMap(), _KupPlanner_instances = new WeakSet(), _KupPlanner_renderReactPlannerElement = function _KupPlanner_renderReactPlannerElement() {
652
975
  var _a;
653
976
  (_a = __classPrivateFieldGet(this, _KupPlanner_rootPlanner, "f")) === null || _a === void 0 ? void 0 : _a.unmount();
654
977
  const componentWrapperElement = this.rootElement.shadowRoot.getElementById(componentWrapperId);
@@ -658,27 +981,70 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
658
981
  }
659
982
  }, _KupPlanner_toTasks = function _KupPlanner_toTasks(data) {
660
983
  var _a;
661
- let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((value) => {
984
+ 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) => {
985
+ const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
986
+ const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
662
987
  let task = {
663
- taskRowId: value.id,
664
- id: value.cells[this.taskIdCol].value,
665
- name: value.cells[this.taskNameCol].value,
666
- startDate: value.cells[this.taskDates[0]].value,
667
- endDate: value.cells[this.taskDates[1]].value,
668
- secondaryStartDate: value.cells[this.taskPrevDates[0]].value,
669
- secondaryEndDate: value.cells[this.taskPrevDates[1]].value,
670
- type: 'task',
671
- valuesToShow: this.taskColumns.map((col) => value.cells[col].value),
988
+ taskRow: row,
989
+ taskRowId: row.id,
990
+ id: row.cells[this.taskIdCol].value,
991
+ name: row.cells[this.taskNameCol].value,
992
+ startDate: datesSanitized.dateValues[0],
993
+ endDate: datesSanitized.dateValues[1],
994
+ secondaryStartDate: datesSanitized.secDateValues[0],
995
+ secondaryEndDate: datesSanitized.secDateValues[1],
996
+ type: 'project',
997
+ valuesToShow: valuesToShow,
998
+ rowType: KupPlannerGanttRowType.TASK,
672
999
  };
673
1000
  return task;
674
1001
  });
675
1002
  return tasks;
1003
+ }, _KupPlanner_toDetails = function _KupPlanner_toDetails(data) {
1004
+ let details = [];
1005
+ if (!data || !data.rows) {
1006
+ return details;
1007
+ }
1008
+ data.rows
1009
+ .filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
1010
+ .forEach((row) => {
1011
+ const detailId = row.cells[this.detailIdCol].value;
1012
+ const detailNameId = row.cells[this.detailNameCol].value;
1013
+ const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
1014
+ const valuesToShow = getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns);
1015
+ let detail = details.find((det) => det.id == detailId);
1016
+ if (!detail) {
1017
+ detail = {
1018
+ id: detailId,
1019
+ name: detailNameId,
1020
+ type: 'timeline',
1021
+ valuesToShow: valuesToShow,
1022
+ rowType: KupPlannerGanttRowType.DETAIL,
1023
+ schedule: [],
1024
+ };
1025
+ details.push(detail);
1026
+ }
1027
+ detail.schedule.push({
1028
+ startDate: datesSanitized.dateValues[0],
1029
+ endDate: datesSanitized.dateValues[1],
1030
+ color: this.detailColorCol
1031
+ ? row.cells[this.detailColorCol].value
1032
+ : '#D9D9D8',
1033
+ selectedColor: this.detailColorCol
1034
+ ? row.cells[this.detailColorCol].value
1035
+ : '#D9D9D8',
1036
+ });
1037
+ });
1038
+ return details;
676
1039
  }, _KupPlanner_getTask = function _KupPlanner_getTask(taskId) {
677
- return this.plannerProps.items.find((task) => task.id == taskId);
1040
+ return this.plannerProps.mainGantt.items.find((task) => task.id == taskId);
678
1041
  }, _KupPlanner_removePhases = function _KupPlanner_removePhases(taskId) {
679
1042
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
680
1043
  if (task)
681
1044
  task.phases = undefined;
1045
+ // this.plannerProps.mainGantt = JSON.parse(
1046
+ // JSON.stringify(this.plannerProps.mainGantt)
1047
+ // );
682
1048
  this.plannerProps = Object.assign({}, this.plannerProps);
683
1049
  }, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
684
1050
  const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
@@ -688,4 +1054,17 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
688
1054
  return true;
689
1055
  }, _KupPlanner_handleOnClickOnPhase = function _KupPlanner_handleOnClickOnPhase() {
690
1056
  return true;
1057
+ }, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
1058
+ return true;
1059
+ }, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
1060
+ let emitEvent = false;
1061
+ if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
1062
+ emitEvent = true;
1063
+ __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
1064
+ }
1065
+ else if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f").isEquivalent(nativeEvent)) {
1066
+ __classPrivateFieldSet(this, _KupPlanner_lastOnChangeReceived, new KupPlannerLastOnChangeReceived(nativeEvent), "f");
1067
+ emitEvent = true;
1068
+ }
1069
+ return emitEvent;
691
1070
  };