@sme.up/ketchup 10.1.2 → 10.1.6
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/{f-cell-66dc3984.js → f-cell-bb8c444f.js} +4 -4
- package/dist/cjs/{f-chip-90155c76.js → f-chip-9f5dec8e.js} +1 -1
- package/dist/cjs/{f-object-field-902b9d05.js → f-object-field-e0b190d0.js} +2 -2
- package/dist/cjs/{f-paginator-utils-7df7d997.js → f-paginator-utils-c8b5df40.js} +1 -1
- package/dist/cjs/{f-text-field-80716a60.js → f-text-field-12f1629b.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +30 -28
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +5 -5
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +195 -22
- package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
- package/dist/cjs/{kup-data-table-helper-02d1e529.js → kup-data-table-helper-a462cb5c.js} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-gantt_10.cjs.entry.js +19 -17
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
- package/dist/cjs/kup-input-panel.cjs.entry.js +5 -5
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-d67049ad.js → kup-manager-1cbd6e69.js} +4 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- 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 +114 -6
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/kup-txt.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- 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-data-table/kup-data-table.css +3 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +15 -14
- 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/collection/components/kup-tree/kup-tree.css +3 -0
- package/dist/collection/components/kup-tree/kup-tree.js +10 -9
- package/dist/collection/utils/cell-utils.js +3 -0
- package/dist/components/index.js +1 -1
- package/dist/components/kup-accordion.js +2 -2
- package/dist/components/kup-activity-timeline.js +2 -2
- package/dist/components/kup-autocomplete.js +1 -1
- package/dist/components/kup-badge.js +1 -1
- package/dist/components/kup-box.js +1 -1
- package/dist/components/kup-button-list.js +1 -1
- package/dist/components/kup-button.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-card-list.js +3 -3
- package/dist/components/kup-card.js +1 -1
- package/dist/components/kup-cell.js +2 -2
- package/dist/components/kup-chart.js +1 -1
- package/dist/components/kup-checkbox.js +1 -1
- package/dist/components/kup-chip.js +1 -1
- package/dist/components/kup-color-picker.js +1 -1
- package/dist/components/kup-combobox.js +1 -1
- package/dist/components/kup-custom-task-list-table.js +1 -1
- package/dist/components/kup-dashboard.js +2 -2
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-drawer.js +2 -2
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-family-tree.js +3 -3
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gantt.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid-renderer.js +1 -1
- package/dist/components/kup-grid.js +1 -1
- package/dist/components/kup-htm.js +2 -2
- package/dist/components/kup-iframe.js +2 -2
- package/dist/components/kup-image-list.js +2 -2
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-input-panel.js +3 -3
- package/dist/components/kup-lazy.js +2 -2
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-nav-bar.js +2 -2
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-object-field.js +2 -2
- package/dist/components/kup-pdf.js +2 -2
- package/dist/components/kup-planner-renderer.js +1 -1
- package/dist/components/kup-planner.js +124 -14
- package/dist/components/kup-probe.js +2 -2
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-qlik.js +2 -2
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +2 -2
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- 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/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-toolbar.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/components/kup-txt.js +2 -2
- package/dist/components/kup-typography-list.js +2 -2
- package/dist/components/kup-typography.js +2 -2
- package/dist/components/{p-72305403.js → p-129d0530.js} +2 -2
- package/dist/components/{p-8b050302.js → p-2008b474.js} +2 -2
- package/dist/components/{p-05429a55.js → p-26524510.js} +2 -2
- 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-0c219ec5.js → p-4fa4c0b0.js} +24 -22
- 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-7b052cb9.js → p-9beefaa0.js} +2 -2
- package/dist/components/{p-0e6c0355.js → p-9c8c4e2e.js} +30 -12
- package/dist/components/{p-ab7c8404.js → p-a2d1b249.js} +4 -1
- 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/{f-cell-50d54fdf.js → f-cell-d5bf23a5.js} +4 -4
- package/dist/esm/{f-chip-c31b2c02.js → f-chip-8616784b.js} +1 -1
- package/dist/esm/{f-object-field-80e6eb02.js → f-object-field-40918207.js} +2 -2
- package/dist/esm/{f-paginator-utils-a835dde6.js → f-paginator-utils-1d1355b6.js} +1 -1
- package/dist/esm/{f-text-field-6b05bfbc.js → f-text-field-11399ccd.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_28.entry.js +30 -28
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +5 -5
- package/dist/esm/kup-custom-task-list-header_4.entry.js +191 -18
- package/dist/esm/kup-dashboard.entry.js +2 -2
- package/dist/esm/{kup-data-table-helper-1b2c70b8.js → kup-data-table-helper-7dd17e75.js} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-gantt_10.entry.js +14 -12
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +5 -5
- package/dist/esm/kup-input-panel.entry.js +5 -5
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-5fbf0037.js → kup-manager-12e22168.js} +4 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-object-field.entry.js +3 -3
- package/dist/esm/kup-pdf.entry.js +1 -1
- 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 +114 -6
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +1 -1
- package/dist/esm/kup-txt.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-4608b0e6.entry.js → p-108ab614.entry.js} +1 -1
- package/dist/ketchup/{p-17279bd4.entry.js → p-11943104.entry.js} +1 -1
- package/dist/ketchup/{p-05aea063.entry.js → p-1b2b024b.entry.js} +1 -1
- package/dist/ketchup/p-2ad73dae.entry.js +1 -0
- package/dist/ketchup/p-2e61c63a.entry.js +9 -0
- package/dist/ketchup/{p-268af1b3.entry.js → p-3e01cf38.entry.js} +1 -1
- package/dist/ketchup/{p-487909b5.entry.js → p-4e11b101.entry.js} +1 -1
- package/dist/ketchup/{p-7fc0ee16.entry.js → p-4e215095.entry.js} +1 -1
- package/dist/ketchup/{p-08691abd.entry.js → p-56da5184.entry.js} +1 -1
- package/dist/ketchup/p-58bc7c00.entry.js +1 -0
- package/dist/ketchup/{p-b16c12ab.entry.js → p-58eb7154.entry.js} +1 -1
- package/dist/ketchup/{p-9278528b.entry.js → p-5a3f9cae.entry.js} +1 -1
- package/dist/ketchup/{p-b1a73691.entry.js → p-5b827300.entry.js} +1 -1
- package/dist/ketchup/{p-ab911e2d.js → p-5df8c471.js} +1 -1
- package/dist/ketchup/{p-febf0250.entry.js → p-604a37aa.entry.js} +1 -1
- package/dist/ketchup/{p-54ebe3bd.entry.js → p-6aec24be.entry.js} +1 -1
- package/dist/ketchup/{p-1374d2f7.entry.js → p-6dffddfb.entry.js} +1 -1
- package/dist/ketchup/{p-f705d641.entry.js → p-70ea904c.entry.js} +1 -1
- package/dist/ketchup/{p-d08d30c0.entry.js → p-74a24fc4.entry.js} +1 -1
- package/dist/ketchup/p-78c0ff1b.js +1 -0
- package/dist/ketchup/{p-1aa03e7f.entry.js → p-7a00fb82.entry.js} +1 -1
- package/dist/ketchup/{p-1e53c21d.entry.js → p-8b5cac62.entry.js} +1 -1
- package/dist/ketchup/{p-e736bf6f.js → p-8bf3e14d.js} +1 -1
- package/dist/ketchup/p-91d97cb5.js +1 -0
- package/dist/ketchup/{p-cf2bf043.entry.js → p-971895c3.entry.js} +1 -1
- package/dist/ketchup/{p-a9fa88cc.entry.js → p-97e801ec.entry.js} +1 -1
- package/dist/ketchup/{p-e0fec6c7.entry.js → p-a166e7fa.entry.js} +1 -1
- package/dist/ketchup/{p-90a0de6c.js → p-a1a2bff0.js} +3 -3
- package/dist/ketchup/{p-84ca2ebd.entry.js → p-b0d97424.entry.js} +1 -1
- package/dist/ketchup/p-b2ab2f43.js +1 -0
- package/dist/ketchup/{p-27e9313b.entry.js → p-c50655e3.entry.js} +1 -1
- package/dist/ketchup/p-ca9ec047.entry.js +16 -0
- package/dist/ketchup/{p-a6cf4320.js → p-cbc30674.js} +1 -1
- package/dist/ketchup/{p-34f29123.entry.js → p-d5e4dfa9.entry.js} +1 -1
- package/dist/ketchup/{p-816de1ef.js → p-da019165.js} +1 -1
- package/dist/ketchup/{p-82badc23.entry.js → p-e077e6e6.entry.js} +1 -1
- package/dist/ketchup/{p-5f20e6ce.entry.js → p-e39f5545.entry.js} +1 -1
- package/dist/ketchup/{p-7966fa12.entry.js → p-e3a5f31b.entry.js} +1 -1
- package/dist/ketchup/{p-5635bfbf.entry.js → p-e84e22ff.entry.js} +1 -1
- package/dist/ketchup/{p-bdbcb755.entry.js → p-f0ebb903.entry.js} +1 -1
- package/dist/ketchup/{p-b2ab5bdc.entry.js → p-f20de742.entry.js} +1 -1
- 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/dist/types/utils/cell-utils.d.ts +1 -0
- 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-7b5a2535.entry.js +0 -9
- package/dist/ketchup/p-9106b93f.js +0 -1
- package/dist/ketchup/p-e8823224.entry.js +0 -1
- package/dist/ketchup/p-ee85055c.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
|
@@ -65,6 +65,7 @@ export class KupPlanner {
|
|
|
65
65
|
this.listCellWidth = '300px';
|
|
66
66
|
this.maxWidth = '90vw';
|
|
67
67
|
this.phaseColorCol = undefined;
|
|
68
|
+
this.dependencyCol = undefined;
|
|
68
69
|
this.phaseColumns = undefined;
|
|
69
70
|
this.phaseColParDep = undefined;
|
|
70
71
|
this.phaseDates = undefined;
|
|
@@ -74,6 +75,7 @@ export class KupPlanner {
|
|
|
74
75
|
this.phaseNameCol = undefined;
|
|
75
76
|
this.phasePrevHours = [];
|
|
76
77
|
this.phasePrevDates = undefined;
|
|
78
|
+
this.dependencies = [];
|
|
77
79
|
this.readOnly = false;
|
|
78
80
|
this.showSecondaryDates = false;
|
|
79
81
|
this.taskColumns = undefined;
|
|
@@ -192,11 +194,12 @@ export class KupPlanner {
|
|
|
192
194
|
* @param data - Matrix which contains project phases
|
|
193
195
|
*/
|
|
194
196
|
async addPhases(taskId, data) {
|
|
195
|
-
var _a;
|
|
197
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
196
198
|
const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
|
|
197
199
|
if (task) {
|
|
198
200
|
__classPrivateFieldGet(this, _KupPlanner_phases, "f")[taskId] = data;
|
|
199
201
|
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) => {
|
|
202
|
+
var _a, _b;
|
|
200
203
|
const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]], row.cells[this.phaseHours[0]], row.cells[this.phaseHours[1]], row.cells[this.phasePrevHours[0]], row.cells[this.phasePrevHours[1]]);
|
|
201
204
|
const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
|
|
202
205
|
? '#START#'
|
|
@@ -205,10 +208,12 @@ export class KupPlanner {
|
|
|
205
208
|
: getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
|
|
206
209
|
let iconUrl = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconUrl).call(this, row, this.phaseIconCol);
|
|
207
210
|
let iconColor = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getIconColor).call(this, row, this.phaseIconCol);
|
|
211
|
+
const _phaseIdRaw = ((_b = (_a = row.cells[this.phaseIdCol]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '') + '';
|
|
208
212
|
let phase = {
|
|
209
213
|
taskRow: task.taskRow,
|
|
210
214
|
phaseRow: row,
|
|
211
|
-
|
|
215
|
+
// trim the phase id value to avoid padded/trailing spaces
|
|
216
|
+
id: `${task.id}_${_phaseIdRaw.trim()}`,
|
|
212
217
|
phaseRowId: row.id,
|
|
213
218
|
taskRowId: task.taskRowId,
|
|
214
219
|
name: row.cells[this.phaseNameCol].value,
|
|
@@ -231,6 +236,92 @@ export class KupPlanner {
|
|
|
231
236
|
};
|
|
232
237
|
return phase;
|
|
233
238
|
});
|
|
239
|
+
// Diagnostic: log created phase ids for the task
|
|
240
|
+
try {
|
|
241
|
+
// eslint-disable-next-line no-console
|
|
242
|
+
console.log('kup-planner: addPhases created phases for', taskId, task.phases ? task.phases.map((p) => p.id) : []);
|
|
243
|
+
}
|
|
244
|
+
catch (e) {
|
|
245
|
+
/* ignore */
|
|
246
|
+
}
|
|
247
|
+
// If the phases dataset includes a dependency column, parse it and
|
|
248
|
+
// create structured dependencies. The column may contain a single
|
|
249
|
+
// dependency id or multiple comma-separated ids. The values can be
|
|
250
|
+
// either phase codes (e.g. 'P410') or full runtime ids
|
|
251
|
+
// ('G418_P410'). We'll normalize to runtime ids using the current
|
|
252
|
+
// task id when necessary.
|
|
253
|
+
try {
|
|
254
|
+
if (this.dependencyCol &&
|
|
255
|
+
data.columns.find((c) => c.name == this.dependencyCol)) {
|
|
256
|
+
const parsedDeps = [];
|
|
257
|
+
for (const row of data.rows || []) {
|
|
258
|
+
const raw = ((_d = (_c = (_b = row.cells) === null || _b === void 0 ? void 0 : _b[this.dependencyCol]) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : '') + '';
|
|
259
|
+
if (!raw)
|
|
260
|
+
continue;
|
|
261
|
+
const parts = raw
|
|
262
|
+
.split(',')
|
|
263
|
+
.map((s) => s.trim())
|
|
264
|
+
.filter(Boolean);
|
|
265
|
+
// compute current phase runtime id (target of dependencies)
|
|
266
|
+
const phaseCode = ((_g = (_f = (_e = row.cells) === null || _e === void 0 ? void 0 : _e[this.phaseIdCol]) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : '') + '';
|
|
267
|
+
const currentPhaseId = `${task.id}_${phaseCode.trim()}`;
|
|
268
|
+
for (const part of parts) {
|
|
269
|
+
// normalize referenced (source) phase id
|
|
270
|
+
let sourcePhaseId = part;
|
|
271
|
+
if (!sourcePhaseId.includes('_')) {
|
|
272
|
+
// assume phase code in the same task -> make runtime id
|
|
273
|
+
sourcePhaseId = `${task.id}_${sourcePhaseId}`;
|
|
274
|
+
}
|
|
275
|
+
// dependency goes from the referenced phase (source) to the current phase (target)
|
|
276
|
+
const depId = `${sourcePhaseId}__${currentPhaseId}`;
|
|
277
|
+
parsedDeps.push({
|
|
278
|
+
id: depId,
|
|
279
|
+
sourceId: sourcePhaseId,
|
|
280
|
+
targetId: currentPhaseId,
|
|
281
|
+
type: 'FS',
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (parsedDeps.length) {
|
|
286
|
+
// ensure plannerProps.mainGantt.dependencies exists
|
|
287
|
+
try {
|
|
288
|
+
if (!this.plannerProps.mainGantt.dependencies) {
|
|
289
|
+
this.plannerProps.mainGantt.dependencies = [];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
// ensure plannerProps in general exists
|
|
294
|
+
if (!this.plannerProps)
|
|
295
|
+
this.plannerProps = {};
|
|
296
|
+
if (!this.plannerProps.mainGantt)
|
|
297
|
+
this.plannerProps.mainGantt = {};
|
|
298
|
+
this.plannerProps.mainGantt.dependencies = [];
|
|
299
|
+
}
|
|
300
|
+
// merge while avoiding duplicates by id
|
|
301
|
+
const existing = new Map((this.plannerProps.mainGantt.dependencies || []).map((d) => [d.id, d]));
|
|
302
|
+
for (const pd of parsedDeps) {
|
|
303
|
+
if (!existing.has(pd.id)) {
|
|
304
|
+
existing.set(pd.id, pd);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
this.plannerProps.mainGantt.dependencies = Array.from(existing.values());
|
|
308
|
+
// also forward to secondary if present
|
|
309
|
+
if (this.plannerProps.secondaryGantt) {
|
|
310
|
+
this.plannerProps.secondaryGantt.dependencies =
|
|
311
|
+
this.plannerProps.mainGantt.dependencies;
|
|
312
|
+
}
|
|
313
|
+
// Diagnostic
|
|
314
|
+
try {
|
|
315
|
+
// eslint-disable-next-line no-console
|
|
316
|
+
console.log('kup-planner: addPhases - injected dependencies', parsedDeps);
|
|
317
|
+
}
|
|
318
|
+
catch (e) { }
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch (e) {
|
|
323
|
+
// ignore parsing errors
|
|
324
|
+
}
|
|
234
325
|
}
|
|
235
326
|
this.plannerProps.mainGantt.initialScrollX =
|
|
236
327
|
__classPrivateFieldGet(this, _KupPlanner_storedSettings, "f").taskInitialScrollX;
|
|
@@ -263,6 +354,7 @@ export class KupPlanner {
|
|
|
263
354
|
}, "f");
|
|
264
355
|
}
|
|
265
356
|
componentDidLoad() {
|
|
357
|
+
var _a, _b;
|
|
266
358
|
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));
|
|
267
359
|
const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
|
|
268
360
|
FTextFieldMDC(mainFilter);
|
|
@@ -296,6 +388,8 @@ export class KupPlanner {
|
|
|
296
388
|
taskScrollYTimeout = window.setTimeout(() => this.handleTaskGanttScrollY(y), scrollDelay);
|
|
297
389
|
},
|
|
298
390
|
onPhaseDrop: (nativeEvent) => this.handleOnPhaseDrop(nativeEvent),
|
|
391
|
+
// forward structured dependencies provided at planner level
|
|
392
|
+
dependencies: this.dependencies,
|
|
299
393
|
},
|
|
300
394
|
secondaryGantt: details
|
|
301
395
|
? {
|
|
@@ -311,6 +405,8 @@ export class KupPlanner {
|
|
|
311
405
|
initialScrollX: this.detailInitialScrollX,
|
|
312
406
|
initialScrollY: this.detailInitialScrollY,
|
|
313
407
|
readOnly: this.readOnly,
|
|
408
|
+
// forward structured dependencies to secondary gantt as well
|
|
409
|
+
dependencies: this.dependencies,
|
|
314
410
|
onScrollY: (y) => {
|
|
315
411
|
window.clearTimeout(detailScrollYTimeout);
|
|
316
412
|
detailScrollYTimeout = window.setTimeout(() => this.handleDetailGanttScrollY(y), scrollDelay);
|
|
@@ -326,6 +422,12 @@ export class KupPlanner {
|
|
|
326
422
|
scrollXTimeout = window.setTimeout(() => this.handleOnScrollX(x), scrollDelay);
|
|
327
423
|
},
|
|
328
424
|
};
|
|
425
|
+
// Diagnostic: log what was forwarded into plannerProps.mainGantt.dependencies
|
|
426
|
+
try {
|
|
427
|
+
// eslint-disable-next-line no-console
|
|
428
|
+
console.log('kup-planner: componentDidLoad - plannerProps.mainGantt.dependencies', (_b = (_a = this.plannerProps) === null || _a === void 0 ? void 0 : _a.mainGantt) === null || _b === void 0 ? void 0 : _b.dependencies);
|
|
429
|
+
}
|
|
430
|
+
catch (e) { }
|
|
329
431
|
this.kupReady.emit({
|
|
330
432
|
comp: this,
|
|
331
433
|
id: this.rootElement.id,
|
|
@@ -523,7 +625,7 @@ export class KupPlanner {
|
|
|
523
625
|
if ((_b = this.plannerProps) === null || _b === void 0 ? void 0 : _b.secondaryGantt) {
|
|
524
626
|
plannerProps.secondaryGantt = Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { onScrollY: this.handleDetailGanttScrollY.bind(this) });
|
|
525
627
|
}
|
|
526
|
-
return (h(Host, { key: '
|
|
628
|
+
return (h(Host, { key: '2be4622d126df65c075552acb7af8c953cef9712' }, h("style", { key: '6ec8c1df4bd0429bfac86ca5cfba8b8eabf012e3' }, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: '1b242d8489b6f0a95d86fb2e088839557cf9ef0d', id: componentWrapperId, style: { maxWidth: this.maxWidth } }, this.plannerProps && (h("kup-planner-renderer", { key: '31f5594e6f34012eabb69ee578ba6a71c3ac3415', props: plannerProps, ref: (el) => (this.plannerRenderer = el) }))), h("div", { key: '83cc5a397427da1a09a662936f03f14d5f0eecbf', style: { display: this.plannerProps ? 'none' : '' } }, h(FTextField, { key: '39c000f13fb6614f1a4196a57a6bbc36581af4a9', icon: KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), onKeyDown: (e) => {
|
|
527
629
|
if (e.key === 'Enter') {
|
|
528
630
|
__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e.target.value);
|
|
529
631
|
}
|
|
@@ -981,6 +1083,26 @@ export class KupPlanner {
|
|
|
981
1083
|
"attribute": "phase-color-col",
|
|
982
1084
|
"reflect": false
|
|
983
1085
|
},
|
|
1086
|
+
"dependencyCol": {
|
|
1087
|
+
"type": "string",
|
|
1088
|
+
"mutable": false,
|
|
1089
|
+
"complexType": {
|
|
1090
|
+
"original": "string",
|
|
1091
|
+
"resolved": "string",
|
|
1092
|
+
"references": {}
|
|
1093
|
+
},
|
|
1094
|
+
"required": false,
|
|
1095
|
+
"optional": false,
|
|
1096
|
+
"docs": {
|
|
1097
|
+
"tags": [{
|
|
1098
|
+
"name": "default",
|
|
1099
|
+
"text": "undefined"
|
|
1100
|
+
}],
|
|
1101
|
+
"text": "Optional column name inside the phases dataset containing a reference\r\nto a dependent phase (for example: 'OPEDIP'). When set, `addPhases`\r\nwill read that column and create structured dependencies (FS) from the\r\nreferenced phase to the current phase (source -> target).\r\nMultiple references can be separated by commas in the cell."
|
|
1102
|
+
},
|
|
1103
|
+
"attribute": "dependency-col",
|
|
1104
|
+
"reflect": false
|
|
1105
|
+
},
|
|
984
1106
|
"phaseColumns": {
|
|
985
1107
|
"type": "unknown",
|
|
986
1108
|
"mutable": false,
|
|
@@ -1153,6 +1275,28 @@ export class KupPlanner {
|
|
|
1153
1275
|
"text": "Columns containing forecast phase duration, from (firstDate) to (secondDate)"
|
|
1154
1276
|
}
|
|
1155
1277
|
},
|
|
1278
|
+
"dependencies": {
|
|
1279
|
+
"type": "unknown",
|
|
1280
|
+
"mutable": false,
|
|
1281
|
+
"complexType": {
|
|
1282
|
+
"original": "KupPlannerDependency[]",
|
|
1283
|
+
"resolved": "KupPlannerDependency[]",
|
|
1284
|
+
"references": {
|
|
1285
|
+
"KupPlannerDependency": {
|
|
1286
|
+
"location": "import",
|
|
1287
|
+
"path": "./kup-planner-declarations",
|
|
1288
|
+
"id": "src/components/kup-planner/kup-planner-declarations.ts::KupPlannerDependency"
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
"required": false,
|
|
1293
|
+
"optional": false,
|
|
1294
|
+
"docs": {
|
|
1295
|
+
"tags": [],
|
|
1296
|
+
"text": "Structured dependencies to render as arrows"
|
|
1297
|
+
},
|
|
1298
|
+
"defaultValue": "[]"
|
|
1299
|
+
},
|
|
1156
1300
|
"readOnly": {
|
|
1157
1301
|
"type": "boolean",
|
|
1158
1302
|
"mutable": false,
|
|
@@ -1970,6 +2114,12 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_lastOnChangeReceived = new W
|
|
|
1970
2114
|
: {
|
|
1971
2115
|
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)) }),
|
|
1972
2116
|
};
|
|
2117
|
+
// Diagnostic: inspect whether planner-level `dependencies` prop is set
|
|
2118
|
+
try {
|
|
2119
|
+
// eslint-disable-next-line no-console
|
|
2120
|
+
console.log('kup-planner: componentDidLoad - this.dependencies', this.dependencies);
|
|
2121
|
+
}
|
|
2122
|
+
catch (e) { }
|
|
1973
2123
|
this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
|
|
1974
2124
|
this.persistState();
|
|
1975
2125
|
}, _KupPlanner_getFilteredRows = function _KupPlanner_getFilteredRows(value, isDetail) {
|
|
@@ -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,
|