@sme.up/ketchup 10.1.2 → 10.1.5
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.
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +195 -22
- package/dist/cjs/kup-gantt_10.cjs.entry.js +19 -17
- package/dist/cjs/{kup-planner-declarations-7291d01c.js → kup-planner-declarations-959110da.js} +1 -1
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +3 -3
- package/dist/cjs/kup-planner.cjs.entry.js +112 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/planner-example-7.js +370 -0
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +1 -1
- package/dist/collection/components/kup-planner/kup-planner.js +153 -3
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +30 -12
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +31 -7
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +181 -4
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +2 -2
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +4 -4
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.css +1 -0
- package/dist/components/kup-custom-task-list-table.js +1 -1
- package/dist/components/kup-gantt.js +1 -1
- package/dist/components/kup-grid-renderer.js +1 -1
- package/dist/components/kup-planner-renderer.js +1 -1
- package/dist/components/kup-planner.js +122 -12
- package/dist/components/kup-task-gantt.js +1 -1
- package/dist/components/kup-task-list-header.js +1 -1
- package/dist/components/kup-task-list-table.js +1 -1
- package/dist/components/kup-task-list.js +1 -1
- package/dist/components/{p-76c4c708.js → p-26d3e5b2.js} +1 -1
- package/dist/components/{p-2fff7268.js → p-45cdd2a4.js} +10 -10
- package/dist/components/{p-a0eeacbd.js → p-4edc1bd0.js} +1 -1
- package/dist/components/{p-9da8cd93.js → p-5cbf86c3.js} +13 -10
- package/dist/components/{p-53e38c4a.js → p-90c212d2.js} +1 -1
- package/dist/components/{p-0e6c0355.js → p-9c8c4e2e.js} +30 -12
- package/dist/components/{p-5517e8e8.js → p-c2b9b4ba.js} +4 -4
- package/dist/components/{p-4efa19a7.js → p-c8302548.js} +3 -3
- package/dist/components/{p-c43d08ab.js → p-d72814f5.js} +161 -5
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-custom-task-list-header_4.entry.js +191 -18
- package/dist/esm/kup-gantt_10.entry.js +14 -12
- package/dist/esm/{kup-planner-declarations-0704bc6c.js → kup-planner-declarations-5981474b.js} +1 -1
- package/dist/esm/kup-planner-renderer.entry.js +3 -3
- package/dist/esm/kup-planner.entry.js +112 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-088e2f23.entry.js +1 -0
- package/dist/ketchup/p-58bc7c00.entry.js +1 -0
- package/dist/ketchup/{p-54ebe3bd.entry.js → p-6aec24be.entry.js} +1 -1
- package/dist/ketchup/p-78c0ff1b.js +1 -0
- package/dist/ketchup/p-ca9ec047.entry.js +16 -0
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +19 -0
- package/dist/types/components/kup-planner/kup-planner.d.ts +12 -1
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +2 -1
- package/dist/types/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.d.ts +7 -0
- package/dist/types/components.d.ts +24 -2
- package/package.json +1 -1
- package/dist/ketchup/p-008bdcdc.js +0 -1
- package/dist/ketchup/p-792e9244.entry.js +0 -1
- package/dist/ketchup/p-e8823224.entry.js +0 -1
- package/dist/ketchup/p-f38c2d0e.entry.js +0 -16
- package/dist/cjs/{bar.helpers-c481a535.js → other.helpers-8782a839.js} +46 -46
- package/dist/esm/{bar.helpers-23a51579.js → other.helpers-83e3225b.js} +46 -46
- /package/dist/ketchup/{p-cd3a7d53.js → p-17c9ef50.js} +0 -0
|
@@ -27,17 +27,25 @@ export class KupCustomTaskListTable {
|
|
|
27
27
|
}
|
|
28
28
|
updateTaskListScroll() {
|
|
29
29
|
this.projectWrapperRef &&
|
|
30
|
-
(this.projectWrapperRef.parentElement.scrollLeft =
|
|
30
|
+
(this.projectWrapperRef.parentElement.scrollLeft =
|
|
31
|
+
this.taskListScrollX);
|
|
31
32
|
}
|
|
32
33
|
render() {
|
|
34
|
+
var _a;
|
|
33
35
|
const kupDates = new KupDates();
|
|
34
36
|
const scrollableStyle = {};
|
|
35
37
|
if (this.scrollableTaskList) {
|
|
36
38
|
scrollableStyle['width'] = this.rowWidth;
|
|
37
39
|
}
|
|
38
|
-
const spansToShow = this.tasks.
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
const spansToShow = this.tasks && this.tasks.length > 0
|
|
41
|
+
? ((_a = this.tasks.reduce((prev, curr) => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
return ((_a = prev.valuesToShow) === null || _a === void 0 ? void 0 : _a.length) >
|
|
44
|
+
((_b = curr.valuesToShow) === null || _b === void 0 ? void 0 : _b.length)
|
|
45
|
+
? prev
|
|
46
|
+
: curr;
|
|
47
|
+
}).valuesToShow) === null || _a === void 0 ? void 0 : _a.length) + 1 || 1
|
|
48
|
+
: 1;
|
|
41
49
|
return (h("div", { class: `container ${this.scrollableTaskList ? 'scrollable' : ''}`, style: scrollableStyle }, h("div", { class: "project-wrapper", ref: (el) => (this.projectWrapperRef = el) }, this.tasks.map((task) => {
|
|
42
50
|
var _a, _b, _c, _d;
|
|
43
51
|
return (h(Fragment, null, task.type === 'project' ? (h("div", { class: "project", style: {
|
|
@@ -61,10 +69,14 @@ export class KupCustomTaskListTable {
|
|
|
61
69
|
? kupDates.formatToLocaleSimple(task.start)
|
|
62
70
|
: v === '#END#'
|
|
63
71
|
? kupDates.formatToLocaleSimple(task.end)
|
|
64
|
-
: v))), this.scrollableTaskList &&
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
: v))), this.scrollableTaskList &&
|
|
73
|
+
spansToShow >
|
|
74
|
+
task.valuesToShow.length &&
|
|
75
|
+
(() => {
|
|
76
|
+
const spansToIterate = createArrayFromNum(spansToShow -
|
|
77
|
+
task.valuesToShow.length);
|
|
78
|
+
return spansToIterate.map((element) => (h("span", { key: element })));
|
|
79
|
+
})())) : task.type === 'task' ? (h("div", { class: "subrow", style: {
|
|
68
80
|
height: `${this.rowHeight}px`,
|
|
69
81
|
width: this.rowWidth,
|
|
70
82
|
fontFamily: this.fontFamily,
|
|
@@ -96,10 +108,16 @@ export class KupCustomTaskListTable {
|
|
|
96
108
|
? kupDates.formatToLocaleSimple(task.start)
|
|
97
109
|
: v === '#END#'
|
|
98
110
|
? kupDates.formatToLocaleSimple(task.end)
|
|
99
|
-
: v))), this.scrollableTaskList &&
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
: v))), this.scrollableTaskList &&
|
|
112
|
+
spansToShow >
|
|
113
|
+
task.valuesToShow.length &&
|
|
114
|
+
(() => {
|
|
115
|
+
const spansToIterate = createArrayFromNum(spansToShow -
|
|
116
|
+
task.valuesToShow
|
|
117
|
+
.length -
|
|
118
|
+
1);
|
|
119
|
+
return spansToIterate.map((element) => (h("span", { key: element })));
|
|
120
|
+
})())) : ((() => {
|
|
103
121
|
var _a;
|
|
104
122
|
let str = '';
|
|
105
123
|
for (let i = 0; i < task.valuesToShow.length; i++) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ganttDateRangeFromTask, seedDates, } from "../kup-planner-renderer-helper";
|
|
3
|
-
import { removeHiddenTasks, sortTasks } from "../helpers/other.helpers";
|
|
1
|
+
import { forceUpdate, h, } from "@stencil/core";
|
|
4
2
|
import { calculateCurrentDateCalculator, calculateProjection, convertToBarTasks, } from "../helpers/bar.helpers";
|
|
3
|
+
import { removeHiddenTasks, sortTasks } from "../helpers/other.helpers";
|
|
4
|
+
import { ganttDateRangeFromTask, seedDates, } from "../kup-planner-renderer-helper";
|
|
5
5
|
export class KupGantt {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.taskListTrueRef = null;
|
|
@@ -45,6 +45,7 @@ export class KupGantt {
|
|
|
45
45
|
this.hideLabel = false;
|
|
46
46
|
this.showSecondaryDates = false;
|
|
47
47
|
this.hideDependencies = false;
|
|
48
|
+
this.dependencies = [];
|
|
48
49
|
this.projection = undefined;
|
|
49
50
|
this.displayedStartDate = undefined;
|
|
50
51
|
this.displayedEndDate = undefined;
|
|
@@ -532,6 +533,7 @@ export class KupGantt {
|
|
|
532
533
|
currentDateIndicator: this.currentDateIndicatorContent,
|
|
533
534
|
projection: this.projectionContent,
|
|
534
535
|
readOnly: this.readOnly,
|
|
536
|
+
dependencies: this.dependencies,
|
|
535
537
|
setGanttEvent: this.setGanttEvent.bind(this),
|
|
536
538
|
setFailedTask: this.setFailedTask.bind(this),
|
|
537
539
|
setSelectedTask: this.handleSelectedTask.bind(this),
|
|
@@ -542,7 +544,7 @@ export class KupGantt {
|
|
|
542
544
|
barDblClick: this.barDblClick,
|
|
543
545
|
barContextMenu: this.barContextMenu,
|
|
544
546
|
delete: this.delete,
|
|
545
|
-
phaseDrop: this.phaseDrop
|
|
547
|
+
phaseDrop: this.phaseDrop,
|
|
546
548
|
};
|
|
547
549
|
const tableProps = {
|
|
548
550
|
rowHeight: this.rowHeight,
|
|
@@ -561,11 +563,11 @@ export class KupGantt {
|
|
|
561
563
|
setSelectedTask: this.handleSelectedTask.bind(this),
|
|
562
564
|
expanderClick: this.handleExpanderClick.bind(this),
|
|
563
565
|
TaskListHeader: this.TaskListHeader,
|
|
564
|
-
TaskListTable: this.TaskListTable
|
|
566
|
+
TaskListTable: this.TaskListTable,
|
|
565
567
|
};
|
|
566
|
-
return (h("div", { key: '
|
|
568
|
+
return (h("div", { key: '121b1b2857d26033d74411289b05d0090556801b', class: "gannt-wrapper-main" }, h("div", { key: '7b775dcf04e33e317ff526186c2bc4905fcb4812', class: "wrapper", onKeyDown: this.handleKeyDown.bind(this), tabIndex: 0, ref: (el) => (this.wrapperRef = el) }, this.listCellWidth && (h("kup-task-list", Object.assign({ key: '898db18e0d258874ce7651c2925af28f35b04823', currentTasks: this.currentTasks, handleClick: this.handleClick, handleDblClick: this.handleDblClick, handleContextMenu: this.handleContextMenu, ganttOnClick: this.ganttOnClick, ganttOnDblClick: this.ganttOnDblClick, ganttonOnContextMenu: this.ganttonOnContextMenu, label: this.label, doubleView: this.doubleView, setDoubleView: this.setDoubleView }, tableProps, { class: "tasks", scrollableTaskList: this.scrollableTaskList, updateTaskListScrollX: this.ignoreScrollEvent, ontaskListScrollWidth: (width) => {
|
|
567
569
|
this.taskListScrollWidth = width;
|
|
568
|
-
}, taskListScrollX: this.taskListScrollX, ref: (el) => (this.taskListTrueRef = el) }))), h("kup-task-gantt", { key: '
|
|
570
|
+
}, taskListScrollX: this.taskListScrollX, ref: (el) => (this.taskListTrueRef = el) }))), h("kup-task-gantt", { key: '80670fd1bca1243258feab7fcda294ddb6b9e972', gridProps: gridProps, calendarProps: calendarProps, barProps: barProps, ganttHeight: this.ganttHeight, taskGanttRef: this.taskGanttRef, scrollY: this.scrollY, scrollX: this.scrollX, phaseDragScroll: this.handlePhaseDragScroll.bind(this), class: "ganttContainer" }), this.ganttEvent.changedTask && (h("kup-tooltip", { key: 'b81a3b3c980124ebdd668ead2bb81ba30fd1bedb', arrowIndent: this.arrowIndent, rowHeight: this.rowHeight, svgContainerHeight: this.svgContainerHeight, svgContainerWidth: this.svgContainerWidth, fontFamily: this.fontFamily, fontSize: this.fontSize, scrollX: this.scrollX, scrollY: this.scrollY, task: this.ganttEvent.changedTask, headerHeight: this.headerHeight, taskListWidth: this.taskListWidth, TooltipContent: this.TooltipContent, rtl: this.rtl, svgWidth: this.svgWidth })), h("kup-vertical-scroll", { key: '646408c0efc5eb955686c9ad4b45c12d61eb1db6', ganttFullHeight: this.ganttFullHeight, ganttHeight: this.ganttHeight, headerHeight: this.headerHeight, scrollNumber: this.scrollY, verticalScroll: this.handleScrollY.bind(this), rtl: this.rtl })), this.taskGanttRef && (h("kup-horizontal-scroll", { key: 'd8eb8d2ea2a7d3b9cbfa9c79aa608dfdac4786f7', svgWidth: this.svgWidth, taskListTrueRef: this.taskListTrueRef, taskListWidth: this.taskListWidth, scrollNumber: this.scrollX, rtl: this.rtl, horizontalScroll: this.handleScrollX.bind(this), horizontalTaskListScroll: this.handleTaskListScrollX.bind(this), listCellWidth: this.listCellWidth, scrollableTaskList: this.scrollableTaskList, taskListScrollWidth: this.taskListScrollWidth, taskListScrollNumber: this.taskListScrollX }))));
|
|
569
571
|
}
|
|
570
572
|
static get is() { return "kup-gantt"; }
|
|
571
573
|
static get originalStyleUrls() {
|
|
@@ -1521,6 +1523,28 @@ export class KupGantt {
|
|
|
1521
1523
|
"reflect": false,
|
|
1522
1524
|
"defaultValue": "false"
|
|
1523
1525
|
},
|
|
1526
|
+
"dependencies": {
|
|
1527
|
+
"type": "unknown",
|
|
1528
|
+
"mutable": false,
|
|
1529
|
+
"complexType": {
|
|
1530
|
+
"original": "KupPlannerDependency[]",
|
|
1531
|
+
"resolved": "KupPlannerDependency[]",
|
|
1532
|
+
"references": {
|
|
1533
|
+
"KupPlannerDependency": {
|
|
1534
|
+
"location": "import",
|
|
1535
|
+
"path": "../../kup-planner-declarations",
|
|
1536
|
+
"id": "src/components/kup-planner/kup-planner-declarations.ts::KupPlannerDependency"
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
"required": false,
|
|
1541
|
+
"optional": false,
|
|
1542
|
+
"docs": {
|
|
1543
|
+
"tags": [],
|
|
1544
|
+
"text": ""
|
|
1545
|
+
},
|
|
1546
|
+
"defaultValue": "[]"
|
|
1547
|
+
},
|
|
1524
1548
|
"projection": {
|
|
1525
1549
|
"type": "unknown",
|
|
1526
1550
|
"mutable": false,
|
|
@@ -23,6 +23,7 @@ export class KupGridRenderer {
|
|
|
23
23
|
this.currentDateIndicator = undefined;
|
|
24
24
|
this.projection = undefined;
|
|
25
25
|
this.readOnly = false;
|
|
26
|
+
this.dependencies = [];
|
|
26
27
|
this.gridProps = undefined;
|
|
27
28
|
this.dateChange = undefined;
|
|
28
29
|
this.progressChange = undefined;
|
|
@@ -419,6 +420,159 @@ export class KupGridRenderer {
|
|
|
419
420
|
: this.drownPathAndTriangle(task, this.tasks[child.index], this.rowHeight, this.taskHeight, this.arrowIndent);
|
|
420
421
|
return (h("g", { class: "arrow" }, h("path", { "stroke-width": "1.5", d: path, fill: "none" }), h("polygon", { points: trianglePoints })));
|
|
421
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* Render dependencies passed as structured data. Supports multiple dependencies
|
|
425
|
+
* between the same pair by offsetting paths.
|
|
426
|
+
*/
|
|
427
|
+
renderDependencies() {
|
|
428
|
+
var _a, _b, _c;
|
|
429
|
+
if (!this.dependencies || this.dependencies.length === 0)
|
|
430
|
+
return null;
|
|
431
|
+
// Build a map of task id -> KupPlannerBarTask for quick lookup
|
|
432
|
+
const taskById = new Map();
|
|
433
|
+
for (const t of this.tasks)
|
|
434
|
+
taskById.set(t.id, t);
|
|
435
|
+
// Group dependencies by pair key (source__target)
|
|
436
|
+
const groups = new Map();
|
|
437
|
+
for (const dep of this.dependencies) {
|
|
438
|
+
const key = `${dep.sourceId}__${dep.targetId}`;
|
|
439
|
+
const arr = (_a = groups.get(key)) !== null && _a !== void 0 ? _a : [];
|
|
440
|
+
arr.push(dep);
|
|
441
|
+
groups.set(key, arr);
|
|
442
|
+
}
|
|
443
|
+
// Also group by target to handle multiple different sources pointing to the same target.
|
|
444
|
+
const byTarget = new Map(); // targetId -> array of pair keys
|
|
445
|
+
for (const key of groups.keys()) {
|
|
446
|
+
const [, targetId] = key.split('__');
|
|
447
|
+
const arr = (_b = byTarget.get(targetId)) !== null && _b !== void 0 ? _b : [];
|
|
448
|
+
arr.push(key);
|
|
449
|
+
byTarget.set(targetId, arr);
|
|
450
|
+
}
|
|
451
|
+
const rendered = [];
|
|
452
|
+
const OFFSET_STEP = 8; // px
|
|
453
|
+
// For each target that has multiple source groups, compute a per-group vertical offset
|
|
454
|
+
// so the groups themselves are arranged and then individual deps inside each group are
|
|
455
|
+
// offset relative to their group's offset.
|
|
456
|
+
const groupOffsets = new Map(); // pairKey -> base offset
|
|
457
|
+
for (const [targetId, pairKeys] of byTarget.entries()) {
|
|
458
|
+
if (pairKeys.length === 1)
|
|
459
|
+
continue;
|
|
460
|
+
// center the groups around 0
|
|
461
|
+
const totalGroups = pairKeys.length;
|
|
462
|
+
for (let i = 0; i < pairKeys.length; i++) {
|
|
463
|
+
const pk = pairKeys[i];
|
|
464
|
+
const baseOffset = (i - (totalGroups - 1) / 2) * (OFFSET_STEP * 3);
|
|
465
|
+
groupOffsets.set(pk, baseOffset);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
for (const [key, deps] of groups.entries()) {
|
|
469
|
+
const [sourceId, targetId] = key.split('__');
|
|
470
|
+
// tolerate different id formats: exact, trimmed, and taskId_phaseId (with padded phase ids)
|
|
471
|
+
let sourceTask = taskById.get(sourceId) ||
|
|
472
|
+
this.tasks.find((t) => t.id && t.id.trim() === (sourceId + '').trim());
|
|
473
|
+
// try exact match first
|
|
474
|
+
let targetTask = taskById.get(targetId) ||
|
|
475
|
+
this.tasks.find((t) => t.id && t.id.trim() === (targetId + '').trim());
|
|
476
|
+
// if not found, try combined formats like <taskId>_<phaseId> (with possible padding)
|
|
477
|
+
if (!targetTask && sourceTask) {
|
|
478
|
+
const candidate1 = `${sourceTask.id}_${targetId}`;
|
|
479
|
+
const candidate2 = `${sourceTask.id}_${(targetId + '').trim()}`;
|
|
480
|
+
targetTask =
|
|
481
|
+
taskById.get(candidate1) ||
|
|
482
|
+
taskById.get(candidate2) ||
|
|
483
|
+
this.tasks.find((t) => t.id &&
|
|
484
|
+
(t.id === candidate1 ||
|
|
485
|
+
t.id === candidate2 ||
|
|
486
|
+
t.id.trim() === candidate2.trim()));
|
|
487
|
+
}
|
|
488
|
+
// as a last resort try matching by trimming both sides against all tasks
|
|
489
|
+
if (!sourceTask || !targetTask) {
|
|
490
|
+
const trimmedSource = (sourceId + '').trim();
|
|
491
|
+
const trimmedTarget = (targetId + '').trim();
|
|
492
|
+
if (!sourceTask) {
|
|
493
|
+
sourceTask = this.tasks.find((t) => t.id && t.id.trim() === trimmedSource);
|
|
494
|
+
}
|
|
495
|
+
if (!targetTask) {
|
|
496
|
+
targetTask = this.tasks.find((t) => t.id && t.id.trim() === trimmedTarget);
|
|
497
|
+
}
|
|
498
|
+
// Extra fallback: some dependency definitions use the original row id
|
|
499
|
+
// (taskRowId) or row-based ids like '1_P410'. Try to resolve those to
|
|
500
|
+
// the runtime task objects using taskRowId / phaseRowId mappings.
|
|
501
|
+
try {
|
|
502
|
+
// If source is still not found, try to match by taskRowId or taskRow.id
|
|
503
|
+
if (!sourceTask) {
|
|
504
|
+
sourceTask = this.tasks.find((t) => {
|
|
505
|
+
var _a;
|
|
506
|
+
return t.taskRowId == sourceId ||
|
|
507
|
+
((_a = t.taskRow) === null || _a === void 0 ? void 0 : _a.id) == sourceId ||
|
|
508
|
+
t.phaseRowId == sourceId;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
// If target is not found, handle cases like '1_P410' where the left
|
|
512
|
+
// part is the taskRowId and the right part is the phase code. We'll
|
|
513
|
+
// try to find a phase whose taskRowId matches the left part and
|
|
514
|
+
// whose id ends with the phase suffix.
|
|
515
|
+
if (!targetTask) {
|
|
516
|
+
const parts = trimmedTarget.split('_');
|
|
517
|
+
if (parts.length > 1) {
|
|
518
|
+
const left = parts[0];
|
|
519
|
+
const right = parts.slice(1).join('_');
|
|
520
|
+
targetTask = this.tasks.find((t) => {
|
|
521
|
+
var _a;
|
|
522
|
+
return (t.taskRowId == left &&
|
|
523
|
+
t.id &&
|
|
524
|
+
t.id.endsWith('_' + right)) ||
|
|
525
|
+
(((_a = t.taskRow) === null || _a === void 0 ? void 0 : _a.id) == left &&
|
|
526
|
+
t.id &&
|
|
527
|
+
t.id.endsWith('_' + right));
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
// also try matching target by row id directly
|
|
531
|
+
if (!targetTask) {
|
|
532
|
+
targetTask = this.tasks.find((t) => {
|
|
533
|
+
var _a;
|
|
534
|
+
return t.taskRowId == targetId ||
|
|
535
|
+
((_a = t.taskRow) === null || _a === void 0 ? void 0 : _a.id) == targetId ||
|
|
536
|
+
t.phaseRowId == targetId;
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
catch (e) {
|
|
542
|
+
// ignore matching errors
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (!sourceTask || !targetTask) {
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
const total = deps.length;
|
|
549
|
+
// base offset for this pair (if groups were arranged around the target)
|
|
550
|
+
const base = (_c = groupOffsets.get(key)) !== null && _c !== void 0 ? _c : 0;
|
|
551
|
+
deps.forEach((dep, idx) => {
|
|
552
|
+
// compute offset: center the stack around 0 and add group base offset
|
|
553
|
+
const intraOffset = (idx - (total - 1) / 2) * OFFSET_STEP;
|
|
554
|
+
const offset = base + intraOffset;
|
|
555
|
+
// we will re-use drownPathAndTriangle but need temporary synthetic tasks shifted by offset
|
|
556
|
+
const shiftedFrom = Object.assign({}, sourceTask);
|
|
557
|
+
const shiftedTo = Object.assign({}, targetTask);
|
|
558
|
+
// shift vertically
|
|
559
|
+
shiftedFrom.y = sourceTask.y + offset;
|
|
560
|
+
shiftedTo.y = targetTask.y + offset;
|
|
561
|
+
const [path, trianglePoints] = this.rtl
|
|
562
|
+
? this.drownPathAndTriangleRTL(shiftedFrom, shiftedTo, this.rowHeight, this.taskHeight, this.arrowIndent)
|
|
563
|
+
: this.drownPathAndTriangle(shiftedFrom, shiftedTo, this.rowHeight, this.taskHeight, this.arrowIndent);
|
|
564
|
+
// pick a color for the connector: prefer the source task's color,
|
|
565
|
+
// then component arrowColor prop, and finally a neutral grey
|
|
566
|
+
const sourceColor = (sourceTask &&
|
|
567
|
+
sourceTask.styles &&
|
|
568
|
+
sourceTask.styles.backgroundColor) ||
|
|
569
|
+
this.arrowColor ||
|
|
570
|
+
'#9e9e9e';
|
|
571
|
+
rendered.push(h("g", { class: "arrow dependency", "data-dep-id": dep.id }, h("path", { stroke: sourceColor, "stroke-width": "2", d: path, fill: "none" }), h("polygon", { points: trianglePoints, fill: sourceColor, stroke: sourceColor })));
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
return rendered;
|
|
575
|
+
}
|
|
422
576
|
drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
|
|
423
577
|
const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
|
|
424
578
|
const taskToEndPosition = taskTo.y + taskHeight / 2;
|
|
@@ -509,13 +663,14 @@ export class KupGridRenderer {
|
|
|
509
663
|
// }
|
|
510
664
|
tickX += this.columnWidth;
|
|
511
665
|
}
|
|
512
|
-
return (h("svg", { key: '
|
|
666
|
+
return (h("svg", { key: '22b83f3b4155e51f56ff19c43e1e935e5b17bf46', xmlns: "http://www.w3.org/2000/svg", width: this.gridProps.svgWidth, height: `${this.rowHeight * this.tasks.length}px`, "font-family": this.fontFamily, ref: (el) => (this.svg = el) }, h("g", { key: '0dc7cb819de38e2defa4e676a3bdf0d9272d681e', class: "grid" }, h("g", { key: 'ec2bcc141732416498c70f20ab7f0ddba112ceeb', class: "rows" }, gridRows), h("g", { key: 'b73233f161cb1fe8289a37e5ab3354d7c8b4e1b3', class: "rowLines" }, rowLines), h("g", { key: '03770a3bebf0d3ba72e4a03b78765a2270cb6b00', class: "ticks" }, ticks)), h("g", { key: '49cc1fec67c34cef6c35ffb78b0485d7a28b021d', class: "content" }, this.currentDateIndicator && (h("rect", { key: '7fc33e726bf3e02336148501d70909093f596946', fill: this.currentDateIndicator.color, x: this.currentDateIndicator.x + 1.5, y: "0", width: "2", height: "100%" })), this.projection && (h("rect", { key: 'c4cb014710c018b196829c84963d10f4e1456dde', fill: this.projection.color, x: this.projection.x0, y: "0", width: this.projection.xf - this.projection.x0, height: "100%", "fill-opacity": "0.35" })), h("g", { key: '5afa927eb4fb8442c95651d0945ae10249ad962e', class: "arrows", fill: this.arrowColor, stroke: this.arrowColor }, this.renderDependencies(), this.tasks.map((task) => {
|
|
513
667
|
return task.barChildren.map((child) => {
|
|
514
668
|
if (task.type !== 'timeline') {
|
|
515
|
-
this.renderKupArrow(task, child);
|
|
669
|
+
return this.renderKupArrow(task, child);
|
|
516
670
|
}
|
|
671
|
+
return null;
|
|
517
672
|
});
|
|
518
|
-
})), h("g", { key: '
|
|
673
|
+
})), h("g", { key: '44f3505a327201ebd848dad424b36f9f2efabcde', class: "bar", "font-family": this.fontFamily, "font-size": this.fontSize }, this.tasks.map((task) => {
|
|
519
674
|
const forbidResize = task.type === 'project';
|
|
520
675
|
return (h("g", { onKeyDown: (e) => {
|
|
521
676
|
switch (e.key) {
|
|
@@ -575,7 +730,7 @@ export class KupGridRenderer {
|
|
|
575
730
|
return this.renderKupBar(task, props.isSelected, isDateResizable, isProgressChangeable);
|
|
576
731
|
}
|
|
577
732
|
})()));
|
|
578
|
-
}), this.currentTarget && this.ganttEvent.changedTask && (h("g", { key: '
|
|
733
|
+
}), this.currentTarget && this.ganttEvent.changedTask && (h("g", { key: '91675894e3ba24a00fa9ef59e8c3af0dc03b3e4c', class: "task-wrapper" }, this.renderKupBar(this.ganttEvent.changedTask, false, false, false)))))));
|
|
579
734
|
}
|
|
580
735
|
static get is() { return "kup-grid-renderer"; }
|
|
581
736
|
static get originalStyleUrls() {
|
|
@@ -1004,6 +1159,28 @@ export class KupGridRenderer {
|
|
|
1004
1159
|
"reflect": false,
|
|
1005
1160
|
"defaultValue": "false"
|
|
1006
1161
|
},
|
|
1162
|
+
"dependencies": {
|
|
1163
|
+
"type": "unknown",
|
|
1164
|
+
"mutable": false,
|
|
1165
|
+
"complexType": {
|
|
1166
|
+
"original": "KupPlannerDependency[]",
|
|
1167
|
+
"resolved": "KupPlannerDependency[]",
|
|
1168
|
+
"references": {
|
|
1169
|
+
"KupPlannerDependency": {
|
|
1170
|
+
"location": "import",
|
|
1171
|
+
"path": "../../kup-planner-declarations",
|
|
1172
|
+
"id": "src/components/kup-planner/kup-planner-declarations.ts::KupPlannerDependency"
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
"required": false,
|
|
1177
|
+
"optional": false,
|
|
1178
|
+
"docs": {
|
|
1179
|
+
"tags": [],
|
|
1180
|
+
"text": ""
|
|
1181
|
+
},
|
|
1182
|
+
"defaultValue": "[]"
|
|
1183
|
+
},
|
|
1007
1184
|
"gridProps": {
|
|
1008
1185
|
"type": "unknown",
|
|
1009
1186
|
"mutable": false,
|
|
@@ -229,7 +229,7 @@ export class KupPlannerRenderer {
|
|
|
229
229
|
} }), this.props && (h("div", { key: 'a07185cd6be444510aef8c07eef0a9afe72d9fd6', style: {
|
|
230
230
|
display: 'flex',
|
|
231
231
|
flexDirection: 'column',
|
|
232
|
-
} }, h("kup-gantt", Object.assign({ ref: (el) => (this.mainGantt = el), ganttId: KUP_PLANNER_MAIN_GANTT_ID, key: KUP_PLANNER_MAIN_GANTT_ID, filter: this.props.mainGantt.filter, hideLabel: this.props.mainGantt.hideLabel, showSecondaryDates: this.mainGanttDoubleView, hideDependencies: this.props.mainGantt.hideDependencies, ganttHeight: this.props.mainGantt.ganttHeight, displayedStartDate: this.displayedDates.displayedStartDate, displayedEndDate: this.displayedDates.displayedEndDate, viewDate: this.viewDate, tasks: this.tasks, columnWidth: columnWidthForTimeUnit(this.timeUnit), viewMode: this.timeUnit }, this.props.mainGantt.stylingOptions, { TaskListHeader: this.props.mainGantt.taskListHeaderProject, TaskListTable: this.props.mainGantt.taskListTableProject, TooltipContent: (_a = this.props.mainGantt.tooltipContent) !== null && _a !== void 0 ? _a : CustomTooltipHOC(), barClick: (task) => {
|
|
232
|
+
} }, h("kup-gantt", Object.assign({ ref: (el) => (this.mainGantt = el), ganttId: KUP_PLANNER_MAIN_GANTT_ID, key: KUP_PLANNER_MAIN_GANTT_ID, filter: this.props.mainGantt.filter, hideLabel: this.props.mainGantt.hideLabel, showSecondaryDates: this.mainGanttDoubleView, hideDependencies: this.props.mainGantt.hideDependencies, ganttHeight: this.props.mainGantt.ganttHeight, displayedStartDate: this.displayedDates.displayedStartDate, displayedEndDate: this.displayedDates.displayedEndDate, viewDate: this.viewDate, tasks: this.tasks, columnWidth: columnWidthForTimeUnit(this.timeUnit), viewMode: this.timeUnit, dependencies: this.props.mainGantt.dependencies }, this.props.mainGantt.stylingOptions, { TaskListHeader: this.props.mainGantt.taskListHeaderProject, TaskListTable: this.props.mainGantt.taskListTableProject, TooltipContent: (_a = this.props.mainGantt.tooltipContent) !== null && _a !== void 0 ? _a : CustomTooltipHOC(), barClick: (task) => {
|
|
233
233
|
let row = getProjectById(task.id, this.currentTasks);
|
|
234
234
|
if (!row) {
|
|
235
235
|
row = getPhaseById(task.id, this.currentTasks);
|
|
@@ -261,7 +261,7 @@ export class KupPlannerRenderer {
|
|
|
261
261
|
this.handlePhaseDrop(originalPhase,
|
|
262
262
|
// originalTask,
|
|
263
263
|
finalPhaseData, destinationTask, this.props.mainGantt.onPhaseDrop);
|
|
264
|
-
} })), this.props.secondaryGantt && (h("kup-gantt", Object.assign({ ref: (el) => (this.secondaryGantt = el), ganttId: KUP_PLANNER_SECONDARY_GANTT_ID, key: KUP_PLANNER_SECONDARY_GANTT_ID, filter: this.props.secondaryGantt.filter, hideLabel: this.props.secondaryGantt.hideLabel, showSecondaryDates: this.mainGanttDoubleView, hideDependencies: this.props.secondaryGantt.hideDependencies, ganttHeight: this.props.secondaryGantt.ganttHeight, displayedStartDate: this.displayedDates.displayedStartDate, displayedEndDate: this.displayedDates.displayedEndDate, viewDate: this.viewDate, tasks: this.details, columnWidth: columnWidthForTimeUnit(this.timeUnit), viewMode: this.timeUnit }, this.props.secondaryGantt.stylingOptions, { TaskListHeader: this.props.secondaryGantt
|
|
264
|
+
} })), this.props.secondaryGantt && (h("kup-gantt", Object.assign({ ref: (el) => (this.secondaryGantt = el), ganttId: KUP_PLANNER_SECONDARY_GANTT_ID, key: KUP_PLANNER_SECONDARY_GANTT_ID, filter: this.props.secondaryGantt.filter, hideLabel: this.props.secondaryGantt.hideLabel, showSecondaryDates: this.mainGanttDoubleView, hideDependencies: this.props.secondaryGantt.hideDependencies, ganttHeight: this.props.secondaryGantt.ganttHeight, displayedStartDate: this.displayedDates.displayedStartDate, displayedEndDate: this.displayedDates.displayedEndDate, viewDate: this.viewDate, tasks: this.details, columnWidth: columnWidthForTimeUnit(this.timeUnit), viewMode: this.timeUnit, dependencies: this.props.secondaryGantt.dependencies }, this.props.secondaryGantt.stylingOptions, { TaskListHeader: this.props.secondaryGantt
|
|
265
265
|
.taskListHeaderProject, TaskListTable: this.props.secondaryGantt
|
|
266
266
|
.taskListTableProject, TooltipContent: (_c = this.props.secondaryGantt.tooltipContent) !== null && _c !== void 0 ? _c : CustomTooltipHOC(), projection: this.projection, barClick: (task) => {
|
|
267
267
|
if (this.props.secondaryGantt) {
|
|
@@ -33,13 +33,13 @@ export class TaskGantt {
|
|
|
33
33
|
}, 75);
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
const newBarProps = Object.assign(Object.assign({}, this.barProps), { gridProps: this.gridProps, phaseDragScroll: this.phaseDragScroll });
|
|
37
|
-
return (h("div", { key: '
|
|
36
|
+
const newBarProps = Object.assign(Object.assign({}, this.barProps), { gridProps: this.gridProps, phaseDragScroll: this.phaseDragScroll, dependencies: this.barProps.dependencies || [] });
|
|
37
|
+
return (h("div", { key: 'f171a1dc93bb1bee342dc2384c5eda5a0a1670a5', class: "ganttVerticalContainer", ref: (el) => (this.verticalGanttContainerRef = el), dir: "ltr" }, h("kup-gantt-calendar", { key: '8df97b74146bc84af4a20d704efeb5d17202bfee', dateSetup: this.calendarProps.dateSetup, locale: this.calendarProps.locale, rtl: this.calendarProps.rtl, headerHeight: this.calendarProps.headerHeight, columnWidth: this.calendarProps.columnWidth, fontFamily: this.calendarProps.fontFamily, fontSize: this.calendarProps.fontSize, dateTimeFormatters: this.calendarProps.dateTimeFormatters, singleLineHeader: this.calendarProps.singleLineHeader, currentDateIndicator: this.calendarProps.currentDateIndicator, svgWidth: this.gridProps.svgWidth }), h("div", { key: '1295b8511846e0de6f45d13f765124ec750ededb', ref: (el) => (this.horizontalContainerRef = el), class: "horizontalContainer", style: this.ganttHeight
|
|
38
38
|
? {
|
|
39
39
|
height: `${this.ganttHeight}px`,
|
|
40
40
|
width: `${this.gridProps.svgWidth}px`,
|
|
41
41
|
}
|
|
42
|
-
: { width: `${this.gridProps.svgWidth}px` } }, h("kup-grid-renderer", Object.assign({ key: '
|
|
42
|
+
: { width: `${this.gridProps.svgWidth}px` } }, h("kup-grid-renderer", Object.assign({ key: '7a35e55a9dff2cef220055a55d71eccf6a1e0801' }, newBarProps)))));
|
|
43
43
|
}
|
|
44
44
|
static get is() { return "kup-task-gantt"; }
|
|
45
45
|
static get properties() {
|
|
@@ -91,7 +91,7 @@ export class TaskGantt {
|
|
|
91
91
|
"mutable": false,
|
|
92
92
|
"complexType": {
|
|
93
93
|
"original": "KupPlannerTaskGanttProps['barProps']",
|
|
94
|
-
"resolved": "{ tasks: KupPlannerBarTask[]; dates: Date[]; ganttEvent: KupPlannerGanttEvent; selectedTask: KupPlannerBarTask; rowHeight: number; columnWidth: number; timeStep: number; svg?: SVGSVGElement; svgWidth: number; taskHeight: number; arrowColor: string; arrowIndent: number; fontSize: string; fontFamily: string; rtl: boolean; ganttHeight: number; hideLabel?: boolean; showSecondaryDates?: boolean; currentDateIndicator?: KupPlannerCurrentDateIndicator; projection?: { x0: number; xf: number; color: string; }; readOnly: boolean; setGanttEvent: (value: KupPlannerGanttEvent) => void; setFailedTask: (value: KupPlannerBarTask) => void; setSelectedTask: (taskId: string) => void; } & KupPlannerEventOption",
|
|
94
|
+
"resolved": "{ dependencies: KupPlannerDependency[]; tasks: KupPlannerBarTask[]; dates: Date[]; ganttEvent: KupPlannerGanttEvent; selectedTask: KupPlannerBarTask; rowHeight: number; columnWidth: number; timeStep: number; svg?: SVGSVGElement; svgWidth: number; taskHeight: number; arrowColor: string; arrowIndent: number; fontSize: string; fontFamily: string; rtl: boolean; ganttHeight: number; hideLabel?: boolean; showSecondaryDates?: boolean; currentDateIndicator?: KupPlannerCurrentDateIndicator; projection?: { x0: number; xf: number; color: string; }; readOnly: boolean; setGanttEvent: (value: KupPlannerGanttEvent) => void; setFailedTask: (value: KupPlannerBarTask) => void; setSelectedTask: (taskId: string) => void; } & KupPlannerEventOption",
|
|
95
95
|
"references": {
|
|
96
96
|
"KupPlannerTaskGanttProps": {
|
|
97
97
|
"location": "import",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as KupCustomTaskListTable$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { K as KupCustomTaskListTable$1, d as defineCustomElement$1 } from './p-9c8c4e2e.js';
|
|
2
2
|
|
|
3
3
|
const KupCustomTaskListTable = KupCustomTaskListTable$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as KupGridRenderer$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { K as KupGridRenderer$1, d as defineCustomElement$1 } from './p-d72814f5.js';
|
|
2
2
|
|
|
3
3
|
const KupGridRenderer = KupGridRenderer$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as KupPlannerRenderer$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { K as KupPlannerRenderer$1, d as defineCustomElement$1 } from './p-45cdd2a4.js';
|
|
2
2
|
|
|
3
3
|
const KupPlannerRenderer = KupPlannerRenderer$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|