@tectra-ng/charts 0.4.2 → 0.4.3
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/bar-list/README.md +1 -1
- package/boxplot/README.md +1 -1
- package/bullet/README.md +1 -1
- package/candlestick/README.md +1 -1
- package/column/README.md +3 -3
- package/combo/README.md +1 -1
- package/core/README.md +8 -6
- package/fesm2022/tectra-ng-charts-candlestick.mjs +23 -7
- package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-column.mjs +1 -1
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-core.mjs +81 -18
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-funnel.mjs +29 -7
- package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-gantt.mjs +487 -27
- package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-gauge.mjs +79 -34
- package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-org-chart.mjs +36 -8
- package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-pie.mjs +27 -9
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-radial-bar.mjs +5 -4
- package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-range-area.mjs +113 -58
- package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-rank-line.mjs +79 -31
- package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-sankey.mjs +99 -18
- package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs +53 -7
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-sunburst.mjs +31 -3
- package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-waterfall.mjs +57 -20
- package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts.mjs +1 -1
- package/funnel/README.md +2 -2
- package/gantt/README.md +12 -8
- package/gauge/README.md +3 -3
- package/line/README.md +1 -1
- package/org-chart/README.md +1 -0
- package/package.json +5 -5
- package/pie/README.md +5 -4
- package/radar/README.md +1 -1
- package/radial-bar/README.md +2 -2
- package/range-area/README.md +2 -1
- package/rank-line/README.md +3 -2
- package/sankey/README.md +1 -1
- package/segmented-bar/README.md +2 -1
- package/treemap/README.md +1 -1
- package/types/tectra-ng-charts-bar-list.d.ts +1 -1
- package/types/tectra-ng-charts-boxplot.d.ts +1 -1
- package/types/tectra-ng-charts-bullet.d.ts +1 -1
- package/types/tectra-ng-charts-candlestick.d.ts +7 -3
- package/types/tectra-ng-charts-candlestick.d.ts.map +1 -1
- package/types/tectra-ng-charts-column.d.ts +3 -3
- package/types/tectra-ng-charts-combo.d.ts +1 -1
- package/types/tectra-ng-charts-core.d.ts +45 -10
- package/types/tectra-ng-charts-core.d.ts.map +1 -1
- package/types/tectra-ng-charts-funnel.d.ts +8 -2
- package/types/tectra-ng-charts-funnel.d.ts.map +1 -1
- package/types/tectra-ng-charts-gantt.d.ts +166 -10
- package/types/tectra-ng-charts-gantt.d.ts.map +1 -1
- package/types/tectra-ng-charts-gauge.d.ts +21 -6
- package/types/tectra-ng-charts-gauge.d.ts.map +1 -1
- package/types/tectra-ng-charts-line.d.ts +1 -1
- package/types/tectra-ng-charts-org-chart.d.ts +13 -2
- package/types/tectra-ng-charts-org-chart.d.ts.map +1 -1
- package/types/tectra-ng-charts-pie.d.ts +13 -4
- package/types/tectra-ng-charts-pie.d.ts.map +1 -1
- package/types/tectra-ng-charts-radar.d.ts +1 -1
- package/types/tectra-ng-charts-radial-bar.d.ts +3 -2
- package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -1
- package/types/tectra-ng-charts-range-area.d.ts +12 -3
- package/types/tectra-ng-charts-range-area.d.ts.map +1 -1
- package/types/tectra-ng-charts-rank-line.d.ts +28 -10
- package/types/tectra-ng-charts-rank-line.d.ts.map +1 -1
- package/types/tectra-ng-charts-sankey.d.ts +36 -9
- package/types/tectra-ng-charts-sankey.d.ts.map +1 -1
- package/types/tectra-ng-charts-segmented-bar.d.ts +11 -2
- package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -1
- package/types/tectra-ng-charts-sunburst.d.ts +10 -0
- package/types/tectra-ng-charts-sunburst.d.ts.map +1 -1
- package/types/tectra-ng-charts-treemap.d.ts +1 -1
- package/types/tectra-ng-charts-waterfall.d.ts +25 -6
- package/types/tectra-ng-charts-waterfall.d.ts.map +1 -1
- package/types/tectra-ng-charts.d.ts +1 -1
- package/waterfall/README.md +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dateFormat, seriesColor, toTime, toggleKey } from "@tectra-ng/charts/core";
|
|
1
|
+
import { dateFormat, seriesColor, textWidth, toTime, toggleKey } from "@tectra-ng/charts/core";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { ChangeDetectionStrategy, Component, Injector, afterNextRender, booleanAttribute, computed, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Injector, afterNextRender, booleanAttribute, computed, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
4
4
|
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
5
5
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
6
|
import { TxLocaleService, formatMessage, injectTranslations } from "@tectra-ng/core/i18n";
|
|
@@ -18,7 +18,28 @@ const TX_GANTT_DAY_WIDTH = {
|
|
|
18
18
|
month: 5,
|
|
19
19
|
quarter: 2
|
|
20
20
|
};
|
|
21
|
+
const TX_GANTT_LINK_STUB = 8;
|
|
21
22
|
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
23
|
+
const LABEL_ROOM = 8;
|
|
24
|
+
const MILESTONE_HALF = 7;
|
|
25
|
+
const MILESTONE_EDGE = 8;
|
|
26
|
+
const BAR_HALF = .3;
|
|
27
|
+
const LABEL_HALF = .25;
|
|
28
|
+
const LABEL_GAP = 6;
|
|
29
|
+
const LINK_STUB_IN = 12;
|
|
30
|
+
const LINK_STUB_MIN = 10;
|
|
31
|
+
const LINK_CLEAR = 4;
|
|
32
|
+
const LINK_RADIUS_X = 4;
|
|
33
|
+
const LINK_RADIUS_Y = .12;
|
|
34
|
+
const LINK_HEAD = 6;
|
|
35
|
+
const LINK_HEAD_HALF = .11;
|
|
36
|
+
const LINK_TYPES = /* @__PURE__ */ new Set([
|
|
37
|
+
"finish-to-start",
|
|
38
|
+
"start-to-start",
|
|
39
|
+
"finish-to-finish",
|
|
40
|
+
"start-to-finish"
|
|
41
|
+
]);
|
|
42
|
+
const EPSILON = 1e-6;
|
|
22
43
|
function startOfDay(time) {
|
|
23
44
|
const date = new Date(time);
|
|
24
45
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
@@ -49,19 +70,37 @@ function ganttRange(tasks, padding, from, to) {
|
|
|
49
70
|
const lastDay = startOfDay(max) === max ? max : addDays(startOfDay(max), 1);
|
|
50
71
|
return [addDays(startOfDay(min), -padding), addDays(lastDay, padding)];
|
|
51
72
|
}
|
|
73
|
+
function ganttCellEnd(end, zoom) {
|
|
74
|
+
const date = new Date(end);
|
|
75
|
+
const midnight = startOfDay(end) === end;
|
|
76
|
+
if (zoom === "day") return midnight ? end : addDays(startOfDay(end), 1);
|
|
77
|
+
if (zoom === "week") {
|
|
78
|
+
const day = midnight ? end : addDays(startOfDay(end), 1);
|
|
79
|
+
return addDays(day, (8 - (new Date(day).getDay() || 7)) % 7);
|
|
80
|
+
}
|
|
81
|
+
const months = zoom === "month" ? 1 : 3;
|
|
82
|
+
return new Date(date.getFullYear(), Math.floor(date.getMonth() / months) * months, 1).getTime() === end ? end : new Date(date.getFullYear(), Math.floor(date.getMonth() / months) * months + months, 1).getTime();
|
|
83
|
+
}
|
|
84
|
+
function ganttFitRange(range, zoom, minWidth) {
|
|
85
|
+
const days = Math.ceil(Math.max(0, minWidth) / TX_GANTT_DAY_WIDTH[zoom]);
|
|
86
|
+
return [range[0], ganttCellEnd(Math.max(range[1], addDays(range[0], days)), zoom)];
|
|
87
|
+
}
|
|
52
88
|
function ganttX(time, rangeStart, dayWidth) {
|
|
53
89
|
return daysBetween(rangeStart, time) * dayWidth;
|
|
54
90
|
}
|
|
55
|
-
function ganttTicks(range, zoom, intl) {
|
|
91
|
+
function ganttTicks(range, zoom, intl, fontSize = 12) {
|
|
56
92
|
const width = TX_GANTT_DAY_WIDTH[zoom];
|
|
57
93
|
const [start, end] = range;
|
|
58
|
-
const cell = (from, to, label, key, weekend) =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
94
|
+
const cell = (from, to, label, key, weekend) => {
|
|
95
|
+
const size = ganttX(Math.min(to, end), start, width) - ganttX(from, start, width);
|
|
96
|
+
return {
|
|
97
|
+
key,
|
|
98
|
+
label: textWidth(label, fontSize) + LABEL_ROOM <= size ? label : "",
|
|
99
|
+
x: ganttX(from, start, width),
|
|
100
|
+
width: size,
|
|
101
|
+
...weekend === void 0 ? {} : { weekend }
|
|
102
|
+
};
|
|
103
|
+
};
|
|
65
104
|
const months = (format) => {
|
|
66
105
|
const cells = [];
|
|
67
106
|
let cursor = new Date(new Date(start).getFullYear(), new Date(start).getMonth(), 1).getTime();
|
|
@@ -136,6 +175,27 @@ function ganttTicks(range, zoom, intl) {
|
|
|
136
175
|
bottom
|
|
137
176
|
};
|
|
138
177
|
}
|
|
178
|
+
function ganttPack(spans) {
|
|
179
|
+
const from = (span) => span.task.milestone ? span.x - MILESTONE_HALF : span.x;
|
|
180
|
+
const to = (span) => span.task.milestone ? span.x + MILESTONE_HALF : span.x + span.width;
|
|
181
|
+
const order = spans.map((_, index) => index).sort((a, b) => from(spans[a]) - from(spans[b]) || spans[a].index - spans[b].index);
|
|
182
|
+
const ends = [];
|
|
183
|
+
const lanes = [];
|
|
184
|
+
for (const index of order) {
|
|
185
|
+
const span = spans[index];
|
|
186
|
+
const free = ends.findIndex((end) => end <= from(span) + .5);
|
|
187
|
+
const lane = free < 0 ? ends.length : free;
|
|
188
|
+
ends[lane] = to(span);
|
|
189
|
+
lanes[index] = lane;
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
spans: spans.map((span, index) => ({
|
|
193
|
+
...span,
|
|
194
|
+
lane: lanes[index]
|
|
195
|
+
})),
|
|
196
|
+
lanes: Math.max(1, ends.length)
|
|
197
|
+
};
|
|
198
|
+
}
|
|
139
199
|
function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
140
200
|
const groups = [];
|
|
141
201
|
tasks.forEach((task) => {
|
|
@@ -154,7 +214,8 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
154
214
|
end: range[1],
|
|
155
215
|
x,
|
|
156
216
|
width,
|
|
157
|
-
color: seriesColor(task.color, Math.max(0, groupIndex))
|
|
217
|
+
color: seriesColor(task.color, Math.max(0, groupIndex)),
|
|
218
|
+
lane: 0
|
|
158
219
|
};
|
|
159
220
|
};
|
|
160
221
|
const spans = tasks.map(spanOf);
|
|
@@ -171,15 +232,17 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
171
232
|
if (layout === "timeline") {
|
|
172
233
|
for (const group of groups) {
|
|
173
234
|
const items = tasks.flatMap((task, index) => task.group === group && spans[index] ? [spans[index]] : []);
|
|
235
|
+
const packed = ganttPack(items);
|
|
174
236
|
rows.push({
|
|
175
237
|
key: `lane:${group}`,
|
|
176
238
|
kind: "task",
|
|
177
239
|
label: group,
|
|
178
240
|
group,
|
|
179
|
-
spans:
|
|
241
|
+
spans: packed.spans,
|
|
180
242
|
summary: null,
|
|
181
243
|
collapsed: false,
|
|
182
|
-
count: items.length
|
|
244
|
+
count: items.length,
|
|
245
|
+
lanes: packed.lanes
|
|
183
246
|
});
|
|
184
247
|
}
|
|
185
248
|
ungrouped.forEach((span) => rows.push({
|
|
@@ -190,7 +253,8 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
190
253
|
spans: [span],
|
|
191
254
|
summary: null,
|
|
192
255
|
collapsed: false,
|
|
193
|
-
count: 1
|
|
256
|
+
count: 1,
|
|
257
|
+
lanes: 1
|
|
194
258
|
}));
|
|
195
259
|
return rows;
|
|
196
260
|
}
|
|
@@ -202,7 +266,8 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
202
266
|
spans: [span],
|
|
203
267
|
summary: null,
|
|
204
268
|
collapsed: false,
|
|
205
|
-
count: 1
|
|
269
|
+
count: 1,
|
|
270
|
+
lanes: 1
|
|
206
271
|
}));
|
|
207
272
|
for (const group of groups) {
|
|
208
273
|
const items = tasks.flatMap((task, index) => task.group === group && spans[index] ? [spans[index]] : []);
|
|
@@ -215,7 +280,8 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
215
280
|
spans: [],
|
|
216
281
|
summary: summary(items),
|
|
217
282
|
collapsed: closed,
|
|
218
|
-
count: items.length
|
|
283
|
+
count: items.length,
|
|
284
|
+
lanes: 1
|
|
219
285
|
});
|
|
220
286
|
items.forEach((span) => rows.push({
|
|
221
287
|
key: `task:${span.task.id}`,
|
|
@@ -225,7 +291,8 @@ function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
|
225
291
|
spans: [span],
|
|
226
292
|
summary: null,
|
|
227
293
|
collapsed: closed,
|
|
228
|
-
count: 1
|
|
294
|
+
count: 1,
|
|
295
|
+
lanes: 1
|
|
229
296
|
}));
|
|
230
297
|
}
|
|
231
298
|
return rows;
|
|
@@ -253,6 +320,263 @@ function ganttFolds(rows) {
|
|
|
253
320
|
function ganttDays(start, end) {
|
|
254
321
|
return Math.max(0, Math.round(daysBetween(start, end)));
|
|
255
322
|
}
|
|
323
|
+
function ganttLinks(tasks) {
|
|
324
|
+
const ids = new Set(tasks.map((task) => task.id));
|
|
325
|
+
const pairs = /* @__PURE__ */ new Set();
|
|
326
|
+
const links = [];
|
|
327
|
+
for (const task of tasks) for (const item of task.dependsOn ?? []) {
|
|
328
|
+
const from = typeof item === "string" ? item : item?.id;
|
|
329
|
+
const given = typeof item === "string" ? void 0 : item?.type;
|
|
330
|
+
if (!from || from === task.id || !ids.has(from)) continue;
|
|
331
|
+
const pair = JSON.stringify([from, task.id]);
|
|
332
|
+
if (pairs.has(pair)) continue;
|
|
333
|
+
pairs.add(pair);
|
|
334
|
+
links.push({
|
|
335
|
+
from,
|
|
336
|
+
to: task.id,
|
|
337
|
+
type: given && LINK_TYPES.has(given) ? given : "finish-to-start"
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
const outgoing = /* @__PURE__ */ new Map();
|
|
341
|
+
links.forEach((link, index) => outgoing.set(link.from, [...outgoing.get(link.from) ?? [], index]));
|
|
342
|
+
const state = /* @__PURE__ */ new Map();
|
|
343
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
344
|
+
for (const task of tasks) {
|
|
345
|
+
if (state.has(task.id)) continue;
|
|
346
|
+
state.set(task.id, "open");
|
|
347
|
+
const stack = [{
|
|
348
|
+
id: task.id,
|
|
349
|
+
next: 0
|
|
350
|
+
}];
|
|
351
|
+
while (stack.length) {
|
|
352
|
+
const top = stack[stack.length - 1];
|
|
353
|
+
const edges = outgoing.get(top.id) ?? [];
|
|
354
|
+
if (top.next >= edges.length) {
|
|
355
|
+
state.set(top.id, "done");
|
|
356
|
+
stack.pop();
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
const index = edges[top.next++];
|
|
360
|
+
const target = links[index].to;
|
|
361
|
+
const mark = state.get(target);
|
|
362
|
+
if (mark === "open") dropped.add(index);
|
|
363
|
+
else if (!mark) {
|
|
364
|
+
state.set(target, "open");
|
|
365
|
+
stack.push({
|
|
366
|
+
id: target,
|
|
367
|
+
next: 0
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return links.filter((_, index) => !dropped.has(index));
|
|
373
|
+
}
|
|
374
|
+
function ganttChain(links, id) {
|
|
375
|
+
const tasks = /* @__PURE__ */ new Set([id]);
|
|
376
|
+
const used = /* @__PURE__ */ new Set();
|
|
377
|
+
for (const forward of [true, false]) {
|
|
378
|
+
const queue = [id];
|
|
379
|
+
const seen = /* @__PURE__ */ new Set([id]);
|
|
380
|
+
for (let at = 0; at < queue.length; at++) links.forEach((link, index) => {
|
|
381
|
+
if ((forward ? link.from : link.to) !== queue[at]) return;
|
|
382
|
+
const next = forward ? link.to : link.from;
|
|
383
|
+
used.add(index);
|
|
384
|
+
tasks.add(next);
|
|
385
|
+
if (seen.has(next)) return;
|
|
386
|
+
seen.add(next);
|
|
387
|
+
queue.push(next);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
tasks,
|
|
392
|
+
links: used
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function crossings(points, boxes) {
|
|
396
|
+
let count = 0;
|
|
397
|
+
for (let index = 1; index < points.length; index++) {
|
|
398
|
+
const [ax, ay] = points[index - 1];
|
|
399
|
+
const [bx, by] = points[index];
|
|
400
|
+
const [x1, x2, y1, y2] = [
|
|
401
|
+
Math.min(ax, bx),
|
|
402
|
+
Math.max(ax, bx),
|
|
403
|
+
Math.min(ay, by),
|
|
404
|
+
Math.max(ay, by)
|
|
405
|
+
];
|
|
406
|
+
for (const box of boxes) if (x1 < box.x2 && x2 > box.x1 && y1 < box.y2 && y2 > box.y1) count++;
|
|
407
|
+
}
|
|
408
|
+
return count;
|
|
409
|
+
}
|
|
410
|
+
function simplify(points) {
|
|
411
|
+
const same = (a, b) => Math.abs(a - b) < EPSILON;
|
|
412
|
+
const distinct = points.filter((point, index) => index === 0 || !same(point[0], points[index - 1][0]) || !same(point[1], points[index - 1][1]));
|
|
413
|
+
return distinct.filter((point, index) => {
|
|
414
|
+
if (index === 0 || index === distinct.length - 1) return true;
|
|
415
|
+
const [prev, next] = [distinct[index - 1], distinct[index + 1]];
|
|
416
|
+
return !(same(prev[0], point[0]) && same(point[0], next[0]) || same(prev[1], point[1]) && same(point[1], next[1]));
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function ganttRoute(from, to, boxes = []) {
|
|
420
|
+
const out = from.side === "finish" ? 1 : -1;
|
|
421
|
+
const back = to.side === "finish" ? 1 : -1;
|
|
422
|
+
const a = from.x + out * 8;
|
|
423
|
+
const b = to.x + back * LINK_STUB_IN;
|
|
424
|
+
const far = to.x + back * LINK_STUB_MIN;
|
|
425
|
+
const lo = Math.max(out > 0 ? a : -Infinity, back > 0 ? far : -Infinity);
|
|
426
|
+
const hi = Math.min(out < 0 ? a : Infinity, back < 0 ? far : Infinity);
|
|
427
|
+
const direct = (v) => [
|
|
428
|
+
[from.x, from.y],
|
|
429
|
+
[v, from.y],
|
|
430
|
+
[v, to.y],
|
|
431
|
+
[to.x, to.y]
|
|
432
|
+
];
|
|
433
|
+
const around = (gap) => [
|
|
434
|
+
[from.x, from.y],
|
|
435
|
+
[a, from.y],
|
|
436
|
+
[a, gap],
|
|
437
|
+
[b, gap],
|
|
438
|
+
[b, to.y],
|
|
439
|
+
[to.x, to.y]
|
|
440
|
+
];
|
|
441
|
+
const routes = [];
|
|
442
|
+
if (lo <= hi) {
|
|
443
|
+
const clamp = (v) => Math.min(hi, Math.max(lo, v));
|
|
444
|
+
const first = direct(clamp(a));
|
|
445
|
+
const edges = boxes.filter((box) => crossings(first, [box])).flatMap((box) => [box.x1 - LINK_CLEAR, box.x2 + LINK_CLEAR]);
|
|
446
|
+
for (const v of [
|
|
447
|
+
clamp(a),
|
|
448
|
+
clamp(b),
|
|
449
|
+
...edges.filter((edge) => edge >= lo && edge <= hi)
|
|
450
|
+
]) routes.push(direct(v));
|
|
451
|
+
}
|
|
452
|
+
const step = to.y > from.y ? .5 : -.5;
|
|
453
|
+
const gaps = Math.abs(to.y - from.y) < EPSILON ? [from.y + .5, from.y - .5] : [from.y + step, to.y - step];
|
|
454
|
+
for (const gap of gaps) routes.push(around(gap));
|
|
455
|
+
let best = [];
|
|
456
|
+
let score = Infinity;
|
|
457
|
+
for (const route of routes) {
|
|
458
|
+
const points = simplify(route);
|
|
459
|
+
const value = crossings(points, boxes) * 100 + points.length;
|
|
460
|
+
if (value < score) {
|
|
461
|
+
score = value;
|
|
462
|
+
best = points;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return best;
|
|
466
|
+
}
|
|
467
|
+
const num = (value) => String(Math.round(value * 1e3) / 1e3);
|
|
468
|
+
function ganttLinkPath(points, rx = LINK_RADIUS_X, ry = LINK_RADIUS_Y) {
|
|
469
|
+
const clean = simplify(points);
|
|
470
|
+
if (!clean.length) return "";
|
|
471
|
+
const toward = (corner, other) => Math.abs(corner[1] - other[1]) < EPSILON ? [corner[0] + Math.sign(other[0] - corner[0]) * Math.min(rx, Math.abs(other[0] - corner[0]) / 2), corner[1]] : [corner[0], corner[1] + Math.sign(other[1] - corner[1]) * Math.min(ry, Math.abs(other[1] - corner[1]) / 2)];
|
|
472
|
+
const parts = [`M${num(clean[0][0])} ${num(clean[0][1])}`];
|
|
473
|
+
for (let index = 1; index < clean.length - 1; index++) {
|
|
474
|
+
const corner = clean[index];
|
|
475
|
+
const before = toward(corner, clean[index - 1]);
|
|
476
|
+
const after = toward(corner, clean[index + 1]);
|
|
477
|
+
parts.push(`L${num(before[0])} ${num(before[1])}`, `Q${num(corner[0])} ${num(corner[1])} ${num(after[0])} ${num(after[1])}`);
|
|
478
|
+
}
|
|
479
|
+
const last = clean[clean.length - 1];
|
|
480
|
+
if (clean.length > 1) parts.push(`L${num(last[0])} ${num(last[1])}`);
|
|
481
|
+
return parts.join(" ");
|
|
482
|
+
}
|
|
483
|
+
function ganttArrowHead(points, length = LINK_HEAD, half = LINK_HEAD_HALF) {
|
|
484
|
+
const clean = simplify(points);
|
|
485
|
+
if (clean.length < 2) return "";
|
|
486
|
+
const [x, y] = clean[clean.length - 1];
|
|
487
|
+
const [px] = clean[clean.length - 2];
|
|
488
|
+
const base = x - (Math.sign(x - px) || 1) * length;
|
|
489
|
+
return `M${num(x)} ${num(y)} L${num(base)} ${num(y - half)} L${num(base)} ${num(y + half)} Z`;
|
|
490
|
+
}
|
|
491
|
+
function ganttFinishLinked(links) {
|
|
492
|
+
return new Set(links.flatMap((link) => [...link.type.startsWith("finish") ? [link.from] : [], ...link.type.endsWith("finish") ? [link.to] : []]));
|
|
493
|
+
}
|
|
494
|
+
function ganttLinkPaths(links, folds, labelWidth) {
|
|
495
|
+
const shifted = ganttFinishLinked(links);
|
|
496
|
+
const anchors = /* @__PURE__ */ new Map();
|
|
497
|
+
const boxes = [];
|
|
498
|
+
let y = 0;
|
|
499
|
+
for (const fold of folds) {
|
|
500
|
+
const summary = fold.head?.summary;
|
|
501
|
+
const group = fold.head && summary ? {
|
|
502
|
+
key: fold.head.key,
|
|
503
|
+
x1: summary.x,
|
|
504
|
+
x2: summary.x + summary.width,
|
|
505
|
+
y: y + .5
|
|
506
|
+
} : null;
|
|
507
|
+
if (fold.head) y += 1;
|
|
508
|
+
for (const row of fold.rows) {
|
|
509
|
+
for (const span of row.spans) {
|
|
510
|
+
if (fold.collapsed && group) {
|
|
511
|
+
anchors.set(span.task.id, group);
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
const half = span.task.milestone ? MILESTONE_EDGE : 0;
|
|
515
|
+
const anchor = {
|
|
516
|
+
key: `task:${span.task.id}`,
|
|
517
|
+
x1: span.x - half,
|
|
518
|
+
x2: span.x + span.width + half,
|
|
519
|
+
y: y + span.lane + .5
|
|
520
|
+
};
|
|
521
|
+
anchors.set(span.task.id, anchor);
|
|
522
|
+
boxes.push({
|
|
523
|
+
key: anchor.key,
|
|
524
|
+
x1: anchor.x1,
|
|
525
|
+
x2: anchor.x2,
|
|
526
|
+
y1: anchor.y - BAR_HALF,
|
|
527
|
+
y2: anchor.y + BAR_HALF
|
|
528
|
+
});
|
|
529
|
+
const label = labelWidth?.(span.task) ?? 0;
|
|
530
|
+
const left = anchor.x2 + LABEL_GAP + (shifted.has(span.task.id) ? 8 : 0);
|
|
531
|
+
if (label > 0) boxes.push({
|
|
532
|
+
key: `label:${span.task.id}`,
|
|
533
|
+
x1: left,
|
|
534
|
+
x2: left + label,
|
|
535
|
+
y1: anchor.y - LABEL_HALF,
|
|
536
|
+
y2: anchor.y + LABEL_HALF
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
if (!fold.collapsed) y += row.lanes;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const paths = /* @__PURE__ */ new Map();
|
|
543
|
+
links.forEach((link, index) => {
|
|
544
|
+
const from = anchors.get(link.from);
|
|
545
|
+
const to = anchors.get(link.to);
|
|
546
|
+
if (!from || !to || from.key === to.key) return;
|
|
547
|
+
const key = JSON.stringify([
|
|
548
|
+
from.key,
|
|
549
|
+
to.key,
|
|
550
|
+
link.type
|
|
551
|
+
]);
|
|
552
|
+
const known = paths.get(key);
|
|
553
|
+
if (known) {
|
|
554
|
+
known.links.push(index);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const fromSide = link.type.startsWith("start") ? "start" : "finish";
|
|
558
|
+
const toSide = link.type.endsWith("start") ? "start" : "finish";
|
|
559
|
+
const points = ganttRoute({
|
|
560
|
+
x: fromSide === "start" ? from.x1 : from.x2,
|
|
561
|
+
y: from.y,
|
|
562
|
+
side: fromSide
|
|
563
|
+
}, {
|
|
564
|
+
x: toSide === "start" ? to.x1 : to.x2,
|
|
565
|
+
y: to.y,
|
|
566
|
+
side: toSide
|
|
567
|
+
}, boxes.filter((box) => box.key !== from.key && box.key !== to.key));
|
|
568
|
+
paths.set(key, {
|
|
569
|
+
key,
|
|
570
|
+
links: [index],
|
|
571
|
+
path: ganttLinkPath(points),
|
|
572
|
+
head: ganttArrowHead(points)
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
return {
|
|
576
|
+
paths: [...paths.values()],
|
|
577
|
+
height: y
|
|
578
|
+
};
|
|
579
|
+
}
|
|
256
580
|
const GANTT_ICON_DEFAULTS = {
|
|
257
581
|
calendar: txIconCalendar,
|
|
258
582
|
"chevron-down": txIconChevronDown,
|
|
@@ -269,10 +593,12 @@ const MIN_BAR = 6;
|
|
|
269
593
|
const SKELETON_ROWS = 5;
|
|
270
594
|
const TODAY_AT = .3;
|
|
271
595
|
const REVEAL_FROM = .8;
|
|
596
|
+
const LABEL_FONT = 12.25;
|
|
272
597
|
var TxGanttChart = class TxGanttChart {
|
|
273
598
|
ganttTheme = injectTokens(GANTT_THEME);
|
|
274
599
|
locale = inject(TxLocaleService);
|
|
275
600
|
injector = inject(Injector);
|
|
601
|
+
destroyRef = inject(DestroyRef);
|
|
276
602
|
translations = injectTranslations();
|
|
277
603
|
tasks = input([], ...ngDevMode ? [{ debugName: "tasks" }] : /* istanbul ignore next */ []);
|
|
278
604
|
layout = input("tasks", ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
@@ -292,6 +618,14 @@ var TxGanttChart = class TxGanttChart {
|
|
|
292
618
|
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
293
619
|
transform: booleanAttribute
|
|
294
620
|
});
|
|
621
|
+
showDependencies = input(true, {
|
|
622
|
+
...ngDevMode ? { debugName: "showDependencies" } : /* istanbul ignore next */ {},
|
|
623
|
+
transform: booleanAttribute
|
|
624
|
+
});
|
|
625
|
+
dependencyHighlight = input(true, {
|
|
626
|
+
...ngDevMode ? { debugName: "dependencyHighlight" } : /* istanbul ignore next */ {},
|
|
627
|
+
transform: booleanAttribute
|
|
628
|
+
});
|
|
295
629
|
ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
296
630
|
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
297
631
|
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
@@ -313,13 +647,17 @@ var TxGanttChart = class TxGanttChart {
|
|
|
313
647
|
zooms = ZOOMS;
|
|
314
648
|
collapsed = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
|
|
315
649
|
focused = signal(null, ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
650
|
+
hovered = signal(null, ...ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []);
|
|
651
|
+
active = signal(null, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
316
652
|
now = Date.now();
|
|
317
653
|
skeletonRows = Array.from({ length: SKELETON_ROWS }, (_, index) => index);
|
|
318
654
|
intl = computed(() => this.locale.locale().intl, ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
|
|
319
655
|
list = computed(() => this.tasks() ?? [], ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
|
|
320
656
|
isEmpty = computed(() => !this.list().some((task) => ganttTime(task.start) !== null), ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
321
657
|
dayWidth = computed(() => TX_GANTT_DAY_WIDTH[this.zoom()], ...ngDevMode ? [{ debugName: "dayWidth" }] : /* istanbul ignore next */ []);
|
|
322
|
-
|
|
658
|
+
viewport = signal(0, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
659
|
+
dataRange = computed(() => ganttRange(this.list(), Math.max(0, this.padding()), this.start(), this.end()), ...ngDevMode ? [{ debugName: "dataRange" }] : /* istanbul ignore next */ []);
|
|
660
|
+
range = computed(() => ganttFitRange(this.dataRange(), this.zoom(), this.viewport()), ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
|
|
323
661
|
width = computed(() => Math.ceil(ganttX(this.range()[1], this.range()[0], this.dayWidth())), ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
324
662
|
ticks = computed(() => ganttTicks(this.range(), this.zoom(), this.intl()), ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
|
|
325
663
|
rows = computed(() => ganttRows(this.list(), this.layout(), this.collapsed(), this.range()[0], this.dayWidth(), MIN_BAR), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
@@ -327,6 +665,32 @@ var TxGanttChart = class TxGanttChart {
|
|
|
327
665
|
spans = computed(() => this.rows().flatMap((row) => row.spans), ...ngDevMode ? [{ debugName: "spans" }] : /* istanbul ignore next */ []);
|
|
328
666
|
openRows = computed(() => this.rows().filter((row) => row.spans.length && !row.collapsed), ...ngDevMode ? [{ debugName: "openRows" }] : /* istanbul ignore next */ []);
|
|
329
667
|
openSpans = computed(() => this.openRows().flatMap((row) => row.spans), ...ngDevMode ? [{ debugName: "openSpans" }] : /* istanbul ignore next */ []);
|
|
668
|
+
links = computed(() => ganttLinks(this.list()), ...ngDevMode ? [{ debugName: "links" }] : /* istanbul ignore next */ []);
|
|
669
|
+
linkLayout = computed(() => this.showDependencies() ? ganttLinkPaths(this.links(), this.folds(), this.labelsOutside() ? (task) => textWidth(task.label, LABEL_FONT) : void 0) : {
|
|
670
|
+
paths: [],
|
|
671
|
+
height: 0
|
|
672
|
+
}, ...ngDevMode ? [{ debugName: "linkLayout" }] : /* istanbul ignore next */ []);
|
|
673
|
+
finishLinked = computed(() => this.showDependencies() ? ganttFinishLinked(this.links()) : /* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "finishLinked" }] : /* istanbul ignore next */ []);
|
|
674
|
+
chain = computed(() => {
|
|
675
|
+
const id = this.hovered() ?? this.active();
|
|
676
|
+
if (!id || !this.showDependencies() || !this.dependencyHighlight()) return null;
|
|
677
|
+
const chain = ganttChain(this.links(), id);
|
|
678
|
+
return chain.links.size ? chain : null;
|
|
679
|
+
}, ...ngDevMode ? [{ debugName: "chain" }] : /* istanbul ignore next */ []);
|
|
680
|
+
linkPaths = computed(() => {
|
|
681
|
+
const chain = this.chain();
|
|
682
|
+
const paths = this.linkLayout().paths.map((path) => ({
|
|
683
|
+
...path,
|
|
684
|
+
state: !chain ? null : path.links.some((index) => chain.links.has(index)) ? "active" : "dimmed"
|
|
685
|
+
}));
|
|
686
|
+
return [...paths.filter((path) => path.state !== "active"), ...paths.filter((path) => path.state === "active")];
|
|
687
|
+
}, ...ngDevMode ? [{ debugName: "linkPaths" }] : /* istanbul ignore next */ []);
|
|
688
|
+
dimmedGroups = computed(() => {
|
|
689
|
+
const chain = this.chain();
|
|
690
|
+
if (!chain) return /* @__PURE__ */ new Set();
|
|
691
|
+
const lit = new Set(this.list().flatMap((task) => task.group && chain.tasks.has(task.id) ? [task.group] : []));
|
|
692
|
+
return new Set(this.list().flatMap((task) => task.group && !lit.has(task.group) ? [task.group] : []));
|
|
693
|
+
}, ...ngDevMode ? [{ debugName: "dimmedGroups" }] : /* istanbul ignore next */ []);
|
|
330
694
|
labelsInside = computed(() => this.barLabels() === "inside" || this.barLabels() === "auto" && this.layout() === "timeline", ...ngDevMode ? [{ debugName: "labelsInside" }] : /* istanbul ignore next */ []);
|
|
331
695
|
labelsOutside = computed(() => this.barLabels() === "outside" || this.barLabels() === "auto" && this.layout() === "tasks", ...ngDevMode ? [{ debugName: "labelsOutside" }] : /* istanbul ignore next */ []);
|
|
332
696
|
tabStop = computed(() => {
|
|
@@ -357,27 +721,58 @@ var TxGanttChart = class TxGanttChart {
|
|
|
357
721
|
month: "short",
|
|
358
722
|
year: "numeric"
|
|
359
723
|
}), ...ngDevMode ? [{ debugName: "dayFormat" }] : /* istanbul ignore next */ []);
|
|
724
|
+
dependencyText = computed(() => {
|
|
725
|
+
const t = this.translations();
|
|
726
|
+
const types = {
|
|
727
|
+
"finish-to-start": "",
|
|
728
|
+
"start-to-start": t.chartStartToStart,
|
|
729
|
+
"finish-to-finish": t.chartFinishToFinish,
|
|
730
|
+
"start-to-finish": t.chartStartToFinish
|
|
731
|
+
};
|
|
732
|
+
const names = new Map(this.list().map((task) => [task.id, task.label]));
|
|
733
|
+
const name = (id, link) => types[link.type] ? `${names.get(id)} (${types[link.type]})` : `${names.get(id)}`;
|
|
734
|
+
const lines = /* @__PURE__ */ new Map();
|
|
735
|
+
const entry = (id) => {
|
|
736
|
+
const known = lines.get(id);
|
|
737
|
+
if (known) return known;
|
|
738
|
+
const created = {
|
|
739
|
+
before: [],
|
|
740
|
+
after: []
|
|
741
|
+
};
|
|
742
|
+
lines.set(id, created);
|
|
743
|
+
return created;
|
|
744
|
+
};
|
|
745
|
+
for (const link of this.links()) {
|
|
746
|
+
entry(link.to).before.push(name(link.from, link));
|
|
747
|
+
entry(link.from).after.push(name(link.to, link));
|
|
748
|
+
}
|
|
749
|
+
return new Map([...lines].map(([id, { before, after }]) => [id, [...before.length ? [`${t.chartDependsOn}: ${before.join(", ")}`] : [], ...after.length ? [`${t.chartRequiredBy}: ${after.join(", ")}`] : []]]));
|
|
750
|
+
}, ...ngDevMode ? [{ debugName: "dependencyText" }] : /* istanbul ignore next */ []);
|
|
360
751
|
text = computed(() => {
|
|
361
752
|
const t = this.translations();
|
|
362
753
|
const format = this.dayFormat();
|
|
754
|
+
const dependencies = this.dependencyText();
|
|
363
755
|
return new Map(this.spans().map((span) => {
|
|
364
756
|
const lines = span.task.milestone ? [span.task.label, `${t.chartMilestone}: ${format.format(span.start)}`] : [
|
|
365
757
|
span.task.label,
|
|
366
758
|
`${format.format(span.start)} – ${format.format(span.end - 1)} · ${formatMessage(t.chartDays, { count: ganttDays(span.start, span.end) }, this.intl())}`,
|
|
367
759
|
...span.task.progress !== null && span.task.progress !== void 0 ? [`${t.chartProgress}: ${Math.round(span.task.progress)}%`] : []
|
|
368
760
|
];
|
|
369
|
-
return [span.task.id, lines];
|
|
761
|
+
return [span.task.id, [...lines, ...dependencies.get(span.task.id) ?? []]];
|
|
370
762
|
}));
|
|
371
763
|
}, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
372
764
|
summary = computed(() => {
|
|
373
765
|
const t = this.translations();
|
|
374
|
-
const [from, to] = this.
|
|
766
|
+
const [from, to] = this.dataRange();
|
|
375
767
|
const format = this.dayFormat();
|
|
376
768
|
const text = `${t.chartGantt}, ${formatMessage(t.chartSummaryTasks, { count: this.spans().length }, this.intl())}, ${format.format(from)} – ${format.format(to - TX_GANTT_DAY)}`;
|
|
377
769
|
return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;
|
|
378
770
|
}, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
|
|
379
771
|
constructor() {
|
|
380
|
-
afterNextRender(() =>
|
|
772
|
+
afterNextRender(() => {
|
|
773
|
+
this.observeViewport();
|
|
774
|
+
this.revealToday();
|
|
775
|
+
});
|
|
381
776
|
}
|
|
382
777
|
tooltipFor(span) {
|
|
383
778
|
return (this.text().get(span.task.id) ?? [span.task.label]).join("\n");
|
|
@@ -385,6 +780,22 @@ var TxGanttChart = class TxGanttChart {
|
|
|
385
780
|
ariaFor(span) {
|
|
386
781
|
return (this.text().get(span.task.id) ?? [span.task.label]).join(", ");
|
|
387
782
|
}
|
|
783
|
+
labelShift(span) {
|
|
784
|
+
return this.finishLinked().has(span.task.id) ? 8 : 0;
|
|
785
|
+
}
|
|
786
|
+
isDimmed(id) {
|
|
787
|
+
const chain = this.chain();
|
|
788
|
+
return !!chain && !chain.tasks.has(id);
|
|
789
|
+
}
|
|
790
|
+
isGroupDimmed(group) {
|
|
791
|
+
return group !== null && this.dimmedGroups().has(group);
|
|
792
|
+
}
|
|
793
|
+
onBarHover(span) {
|
|
794
|
+
this.hovered.set(span ? span.task.id : null);
|
|
795
|
+
}
|
|
796
|
+
onBarBlur() {
|
|
797
|
+
this.active.set(null);
|
|
798
|
+
}
|
|
388
799
|
progressOf(span) {
|
|
389
800
|
const progress = span.task.progress;
|
|
390
801
|
return progress === null || progress === void 0 || !Number.isFinite(progress) ? null : Math.max(0, Math.min(100, progress));
|
|
@@ -442,6 +853,7 @@ var TxGanttChart = class TxGanttChart {
|
|
|
442
853
|
}
|
|
443
854
|
onBarFocus(span, element) {
|
|
444
855
|
this.focused.set(span.task.id);
|
|
856
|
+
this.active.set(span.task.id);
|
|
445
857
|
this.reveal(element);
|
|
446
858
|
}
|
|
447
859
|
onBarKeydown(event, span) {
|
|
@@ -490,6 +902,16 @@ var TxGanttChart = class TxGanttChart {
|
|
|
490
902
|
behavior
|
|
491
903
|
});
|
|
492
904
|
}
|
|
905
|
+
observeViewport() {
|
|
906
|
+
const element = this.scroller()?.nativeElement;
|
|
907
|
+
const view = element?.ownerDocument.defaultView;
|
|
908
|
+
if (!element || !view || typeof view.ResizeObserver !== "function") return;
|
|
909
|
+
const measure = () => this.viewport.set(Math.max(0, element.clientWidth - this.labelWidth(element)));
|
|
910
|
+
measure();
|
|
911
|
+
const observer = new view.ResizeObserver(measure);
|
|
912
|
+
observer.observe(element);
|
|
913
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
914
|
+
}
|
|
493
915
|
revealToday() {
|
|
494
916
|
const element = this.scroller()?.nativeElement;
|
|
495
917
|
const x = this.todayX();
|
|
@@ -610,6 +1032,20 @@ var TxGanttChart = class TxGanttChart {
|
|
|
610
1032
|
isRequired: false,
|
|
611
1033
|
transformFunction: null
|
|
612
1034
|
},
|
|
1035
|
+
showDependencies: {
|
|
1036
|
+
classPropertyName: "showDependencies",
|
|
1037
|
+
publicName: "showDependencies",
|
|
1038
|
+
isSignal: true,
|
|
1039
|
+
isRequired: false,
|
|
1040
|
+
transformFunction: null
|
|
1041
|
+
},
|
|
1042
|
+
dependencyHighlight: {
|
|
1043
|
+
classPropertyName: "dependencyHighlight",
|
|
1044
|
+
publicName: "dependencyHighlight",
|
|
1045
|
+
isSignal: true,
|
|
1046
|
+
isRequired: false,
|
|
1047
|
+
transformFunction: null
|
|
1048
|
+
},
|
|
613
1049
|
ariaLabel: {
|
|
614
1050
|
classPropertyName: "ariaLabel",
|
|
615
1051
|
publicName: "ariaLabel",
|
|
@@ -670,8 +1106,8 @@ var TxGanttChart = class TxGanttChart {
|
|
|
670
1106
|
isSignal: true
|
|
671
1107
|
}],
|
|
672
1108
|
ngImport: i0,
|
|
673
|
-
template: "@let parts = passThrough();\n@let t = translations();\n@if (toolbar()) {\n <div class=\"tx-gantt-chart__toolbar\" [class]=\"parts.toolbar?.class\" [style]=\"parts.toolbar?.style\">\n <tx-button-group role=\"group\" [attr.aria-label]=\"t.zoomIn + ' / ' + t.zoomOut\">\n @for (level of zooms; track level) {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n [variant]=\"zoom() === level ? undefined : 'outlined'\"\n [severity]=\"zoom() === level ? 'primary' : 'secondary'\"\n [label]=\"zoomLabels()[level]\"\n [attr.aria-pressed]=\"zoom() === level\"\n (click)=\"setZoom(level)\"\n ></button>\n }\n </tx-button-group>\n @if (todayX() !== null) {\n <button txButton type=\"button\" size=\"small\" variant=\"text\" severity=\"secondary\" icon=\"calendar\" [label]=\"t.today\" (click)=\"scrollToToday()\"></button>\n }\n </div>\n}\n<div\n #scroller\n class=\"tx-gantt-chart__scroll\"\n [class]=\"parts.scroll?.class\"\n [style]=\"parts.scroll?.style\"\n [style.max-height]=\"maxHeight() || null\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"summary()\"\n [attr.aria-describedby]=\"uid + '-hint'\"\n (wheel)=\"onWheel($event)\"\n>\n <div class=\"tx-gantt-chart__grid\" [style.--tx-gantt-chart-width.px]=\"width()\">\n <div class=\"tx-gantt-chart__head\" [class]=\"parts.head?.class\" [style]=\"parts.head?.style\">\n <div class=\"tx-gantt-chart__corner\" [class]=\"parts.corner?.class\" [style]=\"parts.corner?.style\">{{ labelHeader() || (layout() === 'timeline' ? t.chartTimeline : t.chartTask) }}</div>\n <div class=\"tx-gantt-chart__scale\" [class]=\"parts.scale?.class\" [style]=\"parts.scale?.style\" aria-hidden=\"true\">\n <div class=\"tx-gantt-chart__tier tx-gantt-chart__tier--top\">\n @for (tick of ticks().top; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"><span class=\"tx-gantt-chart__tick-text\">{{ tick.label }}</span></span>\n }\n </div>\n <div class=\"tx-gantt-chart__tier\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [class.tx-gantt-chart__tick--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\">{{ tick.label }}</span>\n }\n </div>\n </div>\n </div>\n\n @if (loading()) {\n @for (row of skeletonRows; track row) {\n <div class=\"tx-gantt-chart__row\">\n <div class=\"tx-gantt-chart__label\"><tx-skeleton width=\"70%\" height=\"0.75rem\" /></div>\n <div class=\"tx-gantt-chart__lane\"><tx-skeleton class=\"tx-gantt-chart__skeleton\" [style.margin-left.%]=\"row * 12\" width=\"30%\" height=\"0.9rem\" /></div>\n </div>\n }\n } @else if (isEmpty()) {\n <div class=\"tx-gantt-chart__empty\" role=\"status\" [class]=\"parts.empty?.class\" [style]=\"parts.empty?.style\">\n <tx-icon name=\"calendar\" aria-hidden=\"true\" />\n <span>{{ t.chartNoData }}</span>\n </div>\n } @else {\n <div class=\"tx-gantt-chart__body\">\n <div class=\"tx-gantt-chart__backdrop\" aria-hidden=\"true\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__column\" [class.tx-gantt-chart__column--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"></span>\n }\n </div>\n @for (fold of folds(); track fold.key; let foldIndex = $index) {\n @if (fold.head; as head) {\n <div class=\"tx-gantt-chart__row tx-gantt-chart__row--group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <button\n type=\"button\"\n class=\"tx-gantt-chart__toggle\"\n [attr.aria-expanded]=\"!head.collapsed\"\n [attr.aria-controls]=\"uid + '-fold-' + foldIndex\"\n (click)=\"onToggle(head.group ?? head.label)\"\n >\n <tx-icon class=\"tx-gantt-chart__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n <span class=\"tx-gantt-chart__label-text\">{{ head.label }}</span>\n <span class=\"tx-gantt-chart__count\">{{ head.count }}</span>\n </button>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @if (head.summary; as summary) {\n <span class=\"tx-gantt-chart__summary\" aria-hidden=\"true\" [style.left.px]=\"summary.x\" [style.width.px]=\"summary.width\"></span>\n }\n </div>\n </div>\n }\n <div\n class=\"tx-gantt-chart__fold\"\n [class.tx-gantt-chart__fold--collapsed]=\"fold.collapsed\"\n [attr.id]=\"fold.head ? uid + '-fold-' + foldIndex : null\"\n [attr.inert]=\"fold.collapsed ? '' : null\"\n >\n <div class=\"tx-gantt-chart__fold-content\">\n @for (row of fold.rows; track row.key) {\n <div class=\"tx-gantt-chart__row\" [class]=\"parts.row?.class\" [style]=\"parts.row?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <span class=\"tx-gantt-chart__label-text\" [attr.title]=\"row.label\">{{ row.label }}</span>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @for (span of row.spans; track span.task.id) {\n @if (span.task.milestone) {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__milestone\"\n [class]=\"parts.milestone?.class\"\n [style]=\"parts.milestone?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.--tx-gantt-chart-color]=\"span.task.color ?? null\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n <span class=\"tx-gantt-chart__diamond\" aria-hidden=\"true\"></span>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\">{{ span.task.label }}</span>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__bar\"\n [class.tx-gantt-chart__bar--inside]=\"labelsInside()\"\n [class]=\"parts.bar?.class\"\n [style]=\"parts.bar?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.width.px]=\"span.width\"\n [style.--tx-gantt-chart-color]=\"span.color\"\n [style.--tx-gantt-chart-progress]=\"progressOf(span) === null ? null : progressOf(span) + '%'\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n @if (progressOf(span) !== null) {\n <span class=\"tx-gantt-chart__progress\" aria-hidden=\"true\"></span>\n }\n @if (labelsInside()) {\n <span class=\"tx-gantt-chart__bar-label\">{{ span.task.label }}</span>\n }\n </button>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\" aria-hidden=\"true\" [style.left.px]=\"span.x + span.width\">{{ span.task.label }}</span>\n }\n }\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @let todayAt = todayX();\n @if (todayAt !== null) {\n <span class=\"tx-gantt-chart__today\" [class]=\"parts.today?.class\" [style]=\"parts.today?.style\" aria-hidden=\"true\" [style.left]=\"'calc(var(--tx-gantt-chart-label-width) + ' + todayAt + 'px)'\"></span>\n }\n </div>\n }\n </div>\n</div>\n<span class=\"cdk-visually-hidden\" [id]=\"uid + '-hint'\">{{ t.chartGanttHint }}</span>\n",
|
|
674
|
-
styles: [":host{--tx-gantt-chart-label-width: min(220px, 40cqi);--tx-gantt-chart-row-height: 36px;--tx-gantt-chart-head-height: 28px;display:flex;flex-direction:column;min-width:0;container-type:inline-size}.tx-gantt-chart__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.tx-gantt-chart__scroll{position:relative;overflow:auto;overscroll-behavior-x:contain}.tx-gantt-chart__grid{position:relative;width:calc(var(--tx-gantt-chart-label-width) + var(--tx-gantt-chart-width));min-width:100%}.tx-gantt-chart__head,.tx-gantt-chart__row{display:flex}.tx-gantt-chart__head{position:sticky;top:0;z-index:3}.tx-gantt-chart__corner,.tx-gantt-chart__label{position:sticky;left:0;z-index:2;display:flex;flex:0 0 var(--tx-gantt-chart-label-width);align-items:center;min-width:0;box-sizing:border-box}.tx-gantt-chart__corner{z-index:4}.tx-gantt-chart__scale,.tx-gantt-chart__lane{position:relative;flex:0 0 var(--tx-gantt-chart-width)}.tx-gantt-chart__tier{position:relative;height:var(--tx-gantt-chart-head-height)}.tx-gantt-chart__tick{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:hidden;box-sizing:border-box;white-space:nowrap}.tx-gantt-chart__tier--top .tx-gantt-chart__tick{justify-content:flex-start;overflow:visible;clip-path:inset(0)}.tx-gantt-chart__tick-text{position:sticky;left:var(--tx-gantt-chart-label-width);padding-inline:8px}.tx-gantt-chart__row{height:var(--tx-gantt-chart-row-height)}.tx-gantt-chart__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__toggle{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__toggle[aria-expanded=false] .tx-gantt-chart__chevron{transform:rotate(-90deg)}.tx-gantt-chart__body{position:relative}.tx-gantt-chart__fold{display:grid;grid-template-rows:1fr;overflow:visible clip}.tx-gantt-chart__fold--collapsed{grid-template-rows:0fr}.tx-gantt-chart__fold-content{min-height:0}.tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{visibility:hidden}.tx-gantt-chart__backdrop{position:absolute;inset:0 0 0 var(--tx-gantt-chart-label-width);pointer-events:none}.tx-gantt-chart__column{position:absolute;top:0;bottom:0;box-sizing:border-box}.tx-gantt-chart__bar,.tx-gantt-chart__milestone,.tx-gantt-chart__summary,.tx-gantt-chart__bar-label--outside{position:absolute;top:50%;transform:translateY(-50%)}.tx-gantt-chart__bar{display:flex;align-items:center;height:60%;min-width:6px;margin:0;padding:0;overflow:hidden;border:0;box-sizing:border-box;background:var(--tx-gantt-chart-color);color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__progress{position:absolute;inset:0 auto 0 0;width:var(--tx-gantt-chart-progress, 0%)}.tx-gantt-chart__bar-label{position:relative;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline:6px}.tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:absolute;padding-inline-start:6px;pointer-events:none}.tx-gantt-chart__milestone{display:flex;align-items:center;height:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;translate:-7px 0}.tx-gantt-chart__milestone .tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:static;transform:none}.tx-gantt-chart__diamond{display:block;flex:0 0 auto;width:14px;height:14px;transform:rotate(45deg) scale(.8);background:var(--tx-gantt-chart-color, currentColor)}.tx-gantt-chart__summary{height:6px;background:currentColor;opacity:.4}.tx-gantt-chart__today{position:absolute;top:0;bottom:0;z-index:1;width:2px;margin-left:-1px;background:currentColor;pointer-events:none}.tx-gantt-chart__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:160px;position:sticky;left:0}:host([data-styled]){--tx-gantt-chart-label-width: min(var(--tx-chart-gantt-label-width), 40cqi);--tx-gantt-chart-row-height: calc(var(--tx-chart-gantt-row-height) * 1px);--tx-gantt-chart-head-height: var(--tx-chart-gantt-header-row-height);font-size:var(--tx-chart-gantt-font-size);color:var(--tx-chart-gantt-label-color)}:host([data-styled]) .tx-gantt-chart__toolbar{gap:var(--tx-chart-gantt-toolbar-gap);margin-bottom:var(--tx-chart-gantt-toolbar-gap)}:host([data-styled]) .tx-gantt-chart__scroll{max-height:var(--tx-chart-gantt-max-height);border:1px solid var(--tx-chart-gantt-border-color);border-radius:var(--tx-chart-gantt-radius);background:var(--tx-chart-gantt-background)}:host([data-styled]) .tx-gantt-chart__head{background:var(--tx-chart-gantt-header-background);box-shadow:inset 0 -1px 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__corner,:host([data-styled]) .tx-gantt-chart__label{padding-inline:var(--tx-chart-gantt-label-padding-x);background:var(--tx-chart-gantt-background);box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__label{box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color),inset 0 0 0 var(--tx-gantt-chart-row-height) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__corner{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);background:var(--tx-chart-gantt-header-background)}:host([data-styled]) .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__tier--top .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-top-color);font-weight:var(--tx-chart-gantt-header-top-font-weight)}:host([data-styled]) .tx-gantt-chart__tick--weekend,:host([data-styled]) .tx-gantt-chart__column--weekend{background:var(--tx-chart-gantt-weekend-background)}:host([data-styled]) .tx-gantt-chart__column{box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__row{--tx-gantt-chart-tint: transparent;box-shadow:inset 0 0 0 var(--tx-gantt-chart-row-height) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__row:hover{--tx-gantt-chart-tint: var(--tx-chart-gantt-row-hover-background)}:host([data-styled]) .tx-gantt-chart__fold{transition:grid-template-rows var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:visibility 0s linear var(--tx-chart-gantt-fold-duration)}:host([data-styled]) .tx-gantt-chart__row--group{background:var(--tx-chart-gantt-group-background);color:var(--tx-chart-gantt-group-color);font-weight:var(--tx-chart-gantt-group-font-weight)}:host([data-styled]) .tx-gantt-chart__row--group .tx-gantt-chart__label{background:var(--tx-chart-gantt-group-background)}:host([data-styled]) .tx-gantt-chart__toggle{border-radius:var(--tx-radius-sm)}:host([data-styled]) .tx-gantt-chart__toggle:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__chevron{transition:transform var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__count{color:var(--tx-chart-gantt-header-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-gantt-chart__bar{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-chart-gantt-bar-height));border-radius:var(--tx-chart-gantt-bar-radius);background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-track-strength),var(--tx-chart-gantt-track-base));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),filter var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:not(:has(.tx-gantt-chart__progress)){background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar:hover{filter:brightness(1.06)}:host([data-styled]) .tx-gantt-chart__progress{background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar.tx-gantt-chart__bar--inside{background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-inside-strength),var(--tx-chart-gantt-track-base));box-shadow:inset var(--tx-chart-gantt-inside-accent-width) 0 0 var(--tx-gantt-chart-color),inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent)}:host([data-styled]) .tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline-start:calc(var(--tx-chart-gantt-inside-accent-width) + 6px);color:var(--tx-chart-gantt-inside-label-color);font-weight:var(--tx-font-weight-medium)}:host([data-styled]) .tx-gantt-chart__scroll:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__bar-label--outside{padding-inline-start:var(--tx-chart-gantt-bar-label-gap);color:var(--tx-chart-gantt-bar-label-color);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__bar:focus-visible,:host([data-styled]) .tx-gantt-chart__milestone:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__milestone{translate:calc(var(--tx-chart-gantt-milestone-size) / -2) 0;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__diamond{width:var(--tx-chart-gantt-milestone-size);height:var(--tx-chart-gantt-milestone-size);border-radius:var(--tx-chart-gantt-milestone-radius);background:var(--tx-gantt-chart-color, var(--tx-chart-gantt-milestone-color))}:host([data-styled]) .tx-gantt-chart__summary{height:var(--tx-chart-gantt-summary-height);border-radius:var(--tx-radius-full);background:var(--tx-chart-gantt-summary-color);opacity:1;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__today{width:var(--tx-chart-gantt-today-width);margin-left:calc(var(--tx-chart-gantt-today-width) / -2);background:var(--tx-chart-gantt-today-color)}:host([data-styled]) .tx-gantt-chart__empty{color:var(--tx-chart-gantt-header-color)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-gantt-chart__bar,:host([data-styled]) .tx-gantt-chart__milestone,:host([data-styled]) .tx-gantt-chart__summary,:host([data-styled]) .tx-gantt-chart__bar-label--outside,:host([data-styled]) .tx-gantt-chart__chevron,:host([data-styled]) .tx-gantt-chart__row,:host([data-styled]) .tx-gantt-chart__label,:host([data-styled]) .tx-gantt-chart__fold,:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:none}}\n"],
|
|
1109
|
+
template: "@let parts = passThrough();\n@let t = translations();\n@if (toolbar()) {\n <div class=\"tx-gantt-chart__toolbar\" [class]=\"parts.toolbar?.class\" [style]=\"parts.toolbar?.style\">\n <tx-button-group role=\"group\" [attr.aria-label]=\"t.zoomIn + ' / ' + t.zoomOut\">\n @for (level of zooms; track level) {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n [variant]=\"zoom() === level ? undefined : 'outlined'\"\n [severity]=\"zoom() === level ? 'primary' : 'secondary'\"\n [label]=\"zoomLabels()[level]\"\n [attr.aria-pressed]=\"zoom() === level\"\n (click)=\"setZoom(level)\"\n ></button>\n }\n </tx-button-group>\n @if (todayX() !== null) {\n <button txButton type=\"button\" size=\"small\" variant=\"text\" severity=\"secondary\" icon=\"calendar\" [label]=\"t.today\" (click)=\"scrollToToday()\"></button>\n }\n </div>\n}\n<div\n #scroller\n class=\"tx-gantt-chart__scroll\"\n [class]=\"parts.scroll?.class\"\n [style]=\"parts.scroll?.style\"\n [style.max-height]=\"maxHeight() || null\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"summary()\"\n [attr.aria-describedby]=\"uid + '-hint'\"\n (wheel)=\"onWheel($event)\"\n>\n <div class=\"tx-gantt-chart__grid\" [style.--tx-gantt-chart-width.px]=\"width()\">\n <div class=\"tx-gantt-chart__head\" [class]=\"parts.head?.class\" [style]=\"parts.head?.style\">\n <div class=\"tx-gantt-chart__corner\" [class]=\"parts.corner?.class\" [style]=\"parts.corner?.style\">{{ labelHeader() || (layout() === 'timeline' ? t.chartTimeline : t.chartTask) }}</div>\n <div class=\"tx-gantt-chart__scale\" [class]=\"parts.scale?.class\" [style]=\"parts.scale?.style\" aria-hidden=\"true\">\n <div class=\"tx-gantt-chart__tier tx-gantt-chart__tier--top\">\n @for (tick of ticks().top; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"><span class=\"tx-gantt-chart__tick-text\">{{ tick.label }}</span></span>\n }\n </div>\n <div class=\"tx-gantt-chart__tier\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [class.tx-gantt-chart__tick--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\">{{ tick.label }}</span>\n }\n </div>\n </div>\n </div>\n\n @if (loading()) {\n @for (row of skeletonRows; track row) {\n <div class=\"tx-gantt-chart__row\">\n <div class=\"tx-gantt-chart__label\"><tx-skeleton width=\"70%\" height=\"0.75rem\" /></div>\n <div class=\"tx-gantt-chart__lane\"><tx-skeleton class=\"tx-gantt-chart__skeleton\" [style.margin-left.%]=\"row * 12\" width=\"30%\" height=\"0.9rem\" /></div>\n </div>\n }\n } @else if (isEmpty()) {\n <div class=\"tx-gantt-chart__empty\" role=\"status\" [class]=\"parts.empty?.class\" [style]=\"parts.empty?.style\">\n <tx-icon name=\"calendar\" aria-hidden=\"true\" />\n <span>{{ t.chartNoData }}</span>\n </div>\n } @else {\n <div class=\"tx-gantt-chart__body\">\n <div class=\"tx-gantt-chart__backdrop\" aria-hidden=\"true\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__column\" [class.tx-gantt-chart__column--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"></span>\n }\n </div>\n @let links = linkLayout();\n @if (links.paths.length) {\n <svg\n class=\"tx-gantt-chart__dependencies\"\n aria-hidden=\"true\"\n focusable=\"false\"\n preserveAspectRatio=\"none\"\n [attr.viewBox]=\"'0 0 ' + width() + ' ' + links.height\"\n [style.height]=\"'calc(var(--tx-gantt-chart-row-height) * ' + links.height + ')'\"\n >\n @for (link of linkPaths(); track link.key) {\n <g\n class=\"tx-gantt-chart__dependency\"\n [class]=\"parts.dependency?.class\"\n [style]=\"parts.dependency?.style\"\n [class.tx-gantt-chart__dependency--active]=\"link.state === 'active'\"\n [class.tx-gantt-chart__dependency--dimmed]=\"link.state === 'dimmed'\"\n >\n <path class=\"tx-gantt-chart__dependency-line\" vector-effect=\"non-scaling-stroke\" [attr.d]=\"link.path\" />\n <path class=\"tx-gantt-chart__dependency-head\" [attr.d]=\"link.head\" />\n </g>\n }\n </svg>\n }\n @for (fold of folds(); track fold.key; let foldIndex = $index) {\n @if (fold.head; as head) {\n <div class=\"tx-gantt-chart__row tx-gantt-chart__row--group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <button\n type=\"button\"\n class=\"tx-gantt-chart__toggle\"\n [attr.aria-expanded]=\"!head.collapsed\"\n [attr.aria-controls]=\"uid + '-fold-' + foldIndex\"\n (click)=\"onToggle(head.group ?? head.label)\"\n >\n <tx-icon class=\"tx-gantt-chart__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n <span class=\"tx-gantt-chart__label-text\">{{ head.label }}</span>\n <span class=\"tx-gantt-chart__count\">{{ head.count }}</span>\n </button>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @if (head.summary; as summary) {\n <span\n class=\"tx-gantt-chart__summary\"\n aria-hidden=\"true\"\n [class.tx-gantt-chart__summary--dimmed]=\"isGroupDimmed(head.group)\"\n [style.left.px]=\"summary.x\"\n [style.width.px]=\"summary.width\"\n ></span>\n }\n </div>\n </div>\n }\n <div\n class=\"tx-gantt-chart__fold\"\n [class.tx-gantt-chart__fold--collapsed]=\"fold.collapsed\"\n [attr.id]=\"fold.head ? uid + '-fold-' + foldIndex : null\"\n [attr.inert]=\"fold.collapsed ? '' : null\"\n >\n <div class=\"tx-gantt-chart__fold-content\">\n @for (row of fold.rows; track row.key) {\n <div class=\"tx-gantt-chart__row\" [class]=\"parts.row?.class\" [style]=\"parts.row?.style\" [style.--tx-gantt-chart-lanes]=\"row.lanes > 1 ? row.lanes : null\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <span class=\"tx-gantt-chart__label-text\" [attr.title]=\"row.label\">{{ row.label }}</span>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @for (span of row.spans; track span.task.id) {\n @if (span.task.milestone) {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__milestone\"\n [class]=\"parts.milestone?.class\"\n [style]=\"parts.milestone?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n [style.--tx-gantt-chart-color]=\"span.task.color ?? null\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (blur)=\"onBarBlur()\"\n (mouseenter)=\"onBarHover(span)\"\n (mouseleave)=\"onBarHover(null)\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n <span class=\"tx-gantt-chart__diamond\" aria-hidden=\"true\"></span>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\" [style.margin-inline-start.px]=\"labelShift(span) || null\">{{ span.task.label }}</span>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__bar\"\n [class.tx-gantt-chart__bar--inside]=\"labelsInside()\"\n [class]=\"parts.bar?.class\"\n [style]=\"parts.bar?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.width.px]=\"span.width\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n [style.--tx-gantt-chart-color]=\"span.color\"\n [style.--tx-gantt-chart-progress]=\"progressOf(span) === null ? null : progressOf(span) + '%'\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (blur)=\"onBarBlur()\"\n (mouseenter)=\"onBarHover(span)\"\n (mouseleave)=\"onBarHover(null)\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n @if (progressOf(span) !== null) {\n <span class=\"tx-gantt-chart__progress\" aria-hidden=\"true\"></span>\n }\n @if (labelsInside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--inside\">{{ span.task.label }}</span>\n }\n </button>\n @if (labelsOutside()) {\n <span\n class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\"\n aria-hidden=\"true\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [style.left.px]=\"span.x + span.width + labelShift(span)\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n >\n <span class=\"tx-gantt-chart__bar-label-text\">{{ span.task.label }}</span>\n </span>\n }\n }\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @let todayAt = todayX();\n @if (todayAt !== null) {\n <span class=\"tx-gantt-chart__today\" [class]=\"parts.today?.class\" [style]=\"parts.today?.style\" aria-hidden=\"true\" [style.left]=\"'calc(var(--tx-gantt-chart-label-width) + ' + todayAt + 'px)'\"></span>\n }\n </div>\n }\n </div>\n</div>\n<span class=\"cdk-visually-hidden\" [id]=\"uid + '-hint'\">{{ t.chartGanttHint }}</span>\n",
|
|
1110
|
+
styles: [":host{--tx-gantt-chart-label-width: min(220px, 40cqi);--tx-gantt-chart-row-height: 36px;--tx-gantt-chart-head-height: 28px;display:flex;flex-direction:column;min-width:0;container-type:inline-size}.tx-gantt-chart__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.tx-gantt-chart__scroll{position:relative;overflow:auto;overscroll-behavior-x:contain}.tx-gantt-chart__grid{position:relative;width:calc(var(--tx-gantt-chart-label-width) + var(--tx-gantt-chart-width));min-width:100%}.tx-gantt-chart__head,.tx-gantt-chart__row{display:flex}.tx-gantt-chart__head{position:sticky;top:0;z-index:3}.tx-gantt-chart__corner,.tx-gantt-chart__label{position:sticky;left:0;z-index:2;display:flex;flex:0 0 var(--tx-gantt-chart-label-width);align-items:center;min-width:0;box-sizing:border-box}.tx-gantt-chart__corner{z-index:4}.tx-gantt-chart__scale,.tx-gantt-chart__lane{position:relative;flex:0 0 var(--tx-gantt-chart-width)}.tx-gantt-chart__tier{position:relative;height:var(--tx-gantt-chart-head-height)}.tx-gantt-chart__tick{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:hidden;box-sizing:border-box;white-space:nowrap}.tx-gantt-chart__tier--top .tx-gantt-chart__tick{justify-content:flex-start;overflow:visible;clip-path:inset(0)}.tx-gantt-chart__tick-text{position:sticky;left:var(--tx-gantt-chart-label-width);padding-inline:8px}.tx-gantt-chart__row{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1))}.tx-gantt-chart__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__toggle{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__toggle[aria-expanded=false] .tx-gantt-chart__chevron{transform:rotate(-90deg)}.tx-gantt-chart__body{position:relative}.tx-gantt-chart__fold{display:grid;grid-template-rows:1fr;overflow:visible clip}.tx-gantt-chart__fold--collapsed{grid-template-rows:0fr}.tx-gantt-chart__fold-content{min-height:0}.tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{visibility:hidden}.tx-gantt-chart__backdrop{position:absolute;inset:0 0 0 var(--tx-gantt-chart-label-width);pointer-events:none}.tx-gantt-chart__column{position:absolute;top:0;bottom:0;box-sizing:border-box}.tx-gantt-chart__bar,.tx-gantt-chart__milestone,.tx-gantt-chart__summary,.tx-gantt-chart__bar-label--outside{position:absolute;top:calc(var(--tx-gantt-chart-row-height) * (var(--tx-gantt-chart-lane, 0) + .5));transform:translateY(-50%)}.tx-gantt-chart__bar{display:flex;align-items:center;height:calc(var(--tx-gantt-chart-row-height) * .6);min-width:6px;margin:0;padding:0;overflow:clip;border:0;box-sizing:border-box;background:var(--tx-gantt-chart-color);color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__progress{position:absolute;inset:0 auto 0 0;width:var(--tx-gantt-chart-progress, 0%)}.tx-gantt-chart__bar-label{position:relative;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline:6px}.tx-gantt-chart__bar-label--inside{position:sticky;left:var(--tx-gantt-chart-label-width)}.tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:absolute;right:0;display:flex;overflow:clip;padding-inline-start:6px;pointer-events:none}.tx-gantt-chart__bar-label-text{position:sticky;left:var(--tx-gantt-chart-label-width);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__milestone{display:flex;align-items:center;height:var(--tx-gantt-chart-row-height);margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;translate:-7px 0}.tx-gantt-chart__milestone .tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:static;right:auto;display:block;overflow:hidden;transform:none}.tx-gantt-chart__diamond{display:block;flex:0 0 auto;width:14px;height:14px;transform:rotate(45deg) scale(.8);background:var(--tx-gantt-chart-color, currentColor)}.tx-gantt-chart__summary{height:6px;background:currentColor;opacity:.4}.tx-gantt-chart__dependencies{position:absolute;top:0;left:var(--tx-gantt-chart-label-width);width:var(--tx-gantt-chart-width);overflow:visible;pointer-events:none}.tx-gantt-chart__dependency-line{fill:none;stroke:currentColor;stroke-width:1.5px}.tx-gantt-chart__dependency-head{fill:currentColor}.tx-gantt-chart__today{position:absolute;top:0;bottom:0;z-index:1;width:2px;margin-left:-1px;background:currentColor;pointer-events:none}.tx-gantt-chart__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:160px;position:sticky;left:0}:host([data-styled]){--tx-gantt-chart-label-width: min(var(--tx-chart-gantt-label-width), 40cqi);--tx-gantt-chart-row-height: calc(var(--tx-chart-gantt-row-height) * 1px);--tx-gantt-chart-head-height: var(--tx-chart-gantt-header-row-height);font-size:var(--tx-chart-gantt-font-size);color:var(--tx-chart-gantt-label-color)}:host([data-styled]) .tx-gantt-chart__toolbar{gap:var(--tx-chart-gantt-toolbar-gap);margin-bottom:var(--tx-chart-gantt-toolbar-gap)}:host([data-styled]) .tx-gantt-chart__scroll{max-height:var(--tx-chart-gantt-max-height);border:1px solid var(--tx-chart-gantt-border-color);border-radius:var(--tx-chart-gantt-radius);background:var(--tx-chart-gantt-background)}:host([data-styled]) .tx-gantt-chart__head{background:var(--tx-chart-gantt-header-background);box-shadow:inset 0 -1px 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__corner,:host([data-styled]) .tx-gantt-chart__label{padding-inline:var(--tx-chart-gantt-label-padding-x);background:var(--tx-chart-gantt-background);box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__label{box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color),inset 0 0 0 calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1)) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__corner{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);background:var(--tx-chart-gantt-header-background)}:host([data-styled]) .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__tier--top .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-top-color);font-weight:var(--tx-chart-gantt-header-top-font-weight)}:host([data-styled]) .tx-gantt-chart__tick--weekend,:host([data-styled]) .tx-gantt-chart__column--weekend{background:var(--tx-chart-gantt-weekend-background)}:host([data-styled]) .tx-gantt-chart__column{box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__row{--tx-gantt-chart-tint: transparent;box-shadow:inset 0 0 0 calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1)) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__row:hover{--tx-gantt-chart-tint: var(--tx-chart-gantt-row-hover-background)}:host([data-styled]) .tx-gantt-chart__fold{transition:grid-template-rows var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:visibility 0s linear var(--tx-chart-gantt-fold-duration)}:host([data-styled]) .tx-gantt-chart__row--group{background:var(--tx-chart-gantt-group-background);color:var(--tx-chart-gantt-group-color);font-weight:var(--tx-chart-gantt-group-font-weight)}:host([data-styled]) .tx-gantt-chart__row--group .tx-gantt-chart__label{background:var(--tx-chart-gantt-group-background)}:host([data-styled]) .tx-gantt-chart__toggle{border-radius:var(--tx-radius-sm)}:host([data-styled]) .tx-gantt-chart__toggle:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__chevron{transition:transform var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__count{color:var(--tx-chart-gantt-header-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-gantt-chart__bar{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-chart-gantt-bar-height));border-radius:var(--tx-chart-gantt-bar-radius);background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-track-strength),var(--tx-chart-gantt-track-base));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),filter var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:not(:has(.tx-gantt-chart__progress)){background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar:hover{filter:brightness(1.06)}:host([data-styled]) .tx-gantt-chart__progress{background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar.tx-gantt-chart__bar--inside{background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-inside-strength),var(--tx-chart-gantt-track-base));box-shadow:inset var(--tx-chart-gantt-inside-accent-width) 0 0 var(--tx-gantt-chart-color),inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent)}:host([data-styled]) .tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline-start:calc(var(--tx-chart-gantt-inside-accent-width) + 6px);color:var(--tx-chart-gantt-inside-label-color);font-weight:var(--tx-font-weight-medium)}:host([data-styled]) .tx-gantt-chart__scroll:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__bar-label--outside{padding-inline-start:var(--tx-chart-gantt-bar-label-gap);color:var(--tx-chart-gantt-bar-label-color);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:focus-visible,:host([data-styled]) .tx-gantt-chart__milestone:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__milestone{translate:calc(var(--tx-chart-gantt-milestone-size) / -2) 0;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__diamond{width:var(--tx-chart-gantt-milestone-size);height:var(--tx-chart-gantt-milestone-size);border-radius:var(--tx-chart-gantt-milestone-radius);background:var(--tx-gantt-chart-color, var(--tx-chart-gantt-milestone-color))}:host([data-styled]) .tx-gantt-chart__summary{height:var(--tx-chart-gantt-summary-height);border-radius:var(--tx-radius-full);background:var(--tx-chart-gantt-summary-color);opacity:1;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__dependency{color:var(--tx-chart-gantt-dependency-color);transition:opacity var(--tx-chart-motion-hover-duration) ease,color var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__dependency-line{stroke-width:var(--tx-chart-gantt-dependency-width)}:host([data-styled]) .tx-gantt-chart__dependency--active{color:var(--tx-chart-gantt-dependency-active-color)}:host([data-styled]) .tx-gantt-chart__dependency--active .tx-gantt-chart__dependency-line{stroke-width:var(--tx-chart-gantt-dependency-active-width)}:host([data-styled]) .tx-gantt-chart__dependency--dimmed,:host([data-styled]) .tx-gantt-chart__task--dimmed,:host([data-styled]) .tx-gantt-chart__summary--dimmed{opacity:var(--tx-chart-gantt-dimmed-opacity)}:host([data-styled]) .tx-gantt-chart__today{width:var(--tx-chart-gantt-today-width);margin-left:calc(var(--tx-chart-gantt-today-width) / -2);background:var(--tx-chart-gantt-today-color)}:host([data-styled]) .tx-gantt-chart__empty{color:var(--tx-chart-gantt-header-color)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-gantt-chart__bar,:host([data-styled]) .tx-gantt-chart__milestone,:host([data-styled]) .tx-gantt-chart__summary,:host([data-styled]) .tx-gantt-chart__dependency,:host([data-styled]) .tx-gantt-chart__bar-label--outside,:host([data-styled]) .tx-gantt-chart__chevron,:host([data-styled]) .tx-gantt-chart__row,:host([data-styled]) .tx-gantt-chart__label,:host([data-styled]) .tx-gantt-chart__fold,:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:none}}\n"],
|
|
675
1111
|
dependencies: [
|
|
676
1112
|
{
|
|
677
1113
|
kind: "component",
|
|
@@ -707,7 +1143,15 @@ var TxGanttChart = class TxGanttChart {
|
|
|
707
1143
|
{
|
|
708
1144
|
kind: "component",
|
|
709
1145
|
type: TxButtonGroup,
|
|
710
|
-
selector: "tx-button-group"
|
|
1146
|
+
selector: "tx-button-group",
|
|
1147
|
+
inputs: [
|
|
1148
|
+
"orientation",
|
|
1149
|
+
"fluid",
|
|
1150
|
+
"dt",
|
|
1151
|
+
"pt",
|
|
1152
|
+
"ptOptions",
|
|
1153
|
+
"unstyled"
|
|
1154
|
+
]
|
|
711
1155
|
},
|
|
712
1156
|
{
|
|
713
1157
|
kind: "directive",
|
|
@@ -792,8 +1236,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
792
1236
|
"[attr.aria-busy]": "loading() || null"
|
|
793
1237
|
},
|
|
794
1238
|
viewProviders: [provideTxIconDefaults(GANTT_ICON_DEFAULTS)],
|
|
795
|
-
template: "@let parts = passThrough();\n@let t = translations();\n@if (toolbar()) {\n <div class=\"tx-gantt-chart__toolbar\" [class]=\"parts.toolbar?.class\" [style]=\"parts.toolbar?.style\">\n <tx-button-group role=\"group\" [attr.aria-label]=\"t.zoomIn + ' / ' + t.zoomOut\">\n @for (level of zooms; track level) {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n [variant]=\"zoom() === level ? undefined : 'outlined'\"\n [severity]=\"zoom() === level ? 'primary' : 'secondary'\"\n [label]=\"zoomLabels()[level]\"\n [attr.aria-pressed]=\"zoom() === level\"\n (click)=\"setZoom(level)\"\n ></button>\n }\n </tx-button-group>\n @if (todayX() !== null) {\n <button txButton type=\"button\" size=\"small\" variant=\"text\" severity=\"secondary\" icon=\"calendar\" [label]=\"t.today\" (click)=\"scrollToToday()\"></button>\n }\n </div>\n}\n<div\n #scroller\n class=\"tx-gantt-chart__scroll\"\n [class]=\"parts.scroll?.class\"\n [style]=\"parts.scroll?.style\"\n [style.max-height]=\"maxHeight() || null\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"summary()\"\n [attr.aria-describedby]=\"uid + '-hint'\"\n (wheel)=\"onWheel($event)\"\n>\n <div class=\"tx-gantt-chart__grid\" [style.--tx-gantt-chart-width.px]=\"width()\">\n <div class=\"tx-gantt-chart__head\" [class]=\"parts.head?.class\" [style]=\"parts.head?.style\">\n <div class=\"tx-gantt-chart__corner\" [class]=\"parts.corner?.class\" [style]=\"parts.corner?.style\">{{ labelHeader() || (layout() === 'timeline' ? t.chartTimeline : t.chartTask) }}</div>\n <div class=\"tx-gantt-chart__scale\" [class]=\"parts.scale?.class\" [style]=\"parts.scale?.style\" aria-hidden=\"true\">\n <div class=\"tx-gantt-chart__tier tx-gantt-chart__tier--top\">\n @for (tick of ticks().top; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"><span class=\"tx-gantt-chart__tick-text\">{{ tick.label }}</span></span>\n }\n </div>\n <div class=\"tx-gantt-chart__tier\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [class.tx-gantt-chart__tick--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\">{{ tick.label }}</span>\n }\n </div>\n </div>\n </div>\n\n @if (loading()) {\n @for (row of skeletonRows; track row) {\n <div class=\"tx-gantt-chart__row\">\n <div class=\"tx-gantt-chart__label\"><tx-skeleton width=\"70%\" height=\"0.75rem\" /></div>\n <div class=\"tx-gantt-chart__lane\"><tx-skeleton class=\"tx-gantt-chart__skeleton\" [style.margin-left.%]=\"row * 12\" width=\"30%\" height=\"0.9rem\" /></div>\n </div>\n }\n } @else if (isEmpty()) {\n <div class=\"tx-gantt-chart__empty\" role=\"status\" [class]=\"parts.empty?.class\" [style]=\"parts.empty?.style\">\n <tx-icon name=\"calendar\" aria-hidden=\"true\" />\n <span>{{ t.chartNoData }}</span>\n </div>\n } @else {\n <div class=\"tx-gantt-chart__body\">\n <div class=\"tx-gantt-chart__backdrop\" aria-hidden=\"true\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__column\" [class.tx-gantt-chart__column--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"></span>\n }\n </div>\n @for (fold of folds(); track fold.key; let foldIndex = $index) {\n @if (fold.head; as head) {\n <div class=\"tx-gantt-chart__row tx-gantt-chart__row--group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <button\n type=\"button\"\n class=\"tx-gantt-chart__toggle\"\n [attr.aria-expanded]=\"!head.collapsed\"\n [attr.aria-controls]=\"uid + '-fold-' + foldIndex\"\n (click)=\"onToggle(head.group ?? head.label)\"\n >\n <tx-icon class=\"tx-gantt-chart__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n <span class=\"tx-gantt-chart__label-text\">{{ head.label }}</span>\n <span class=\"tx-gantt-chart__count\">{{ head.count }}</span>\n </button>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @if (head.summary; as summary) {\n <span class=\"tx-gantt-chart__summary\" aria-hidden=\"true\" [style.left.px]=\"summary.x\" [style.width.px]=\"summary.width\"></span>\n }\n </div>\n </div>\n }\n <div\n class=\"tx-gantt-chart__fold\"\n [class.tx-gantt-chart__fold--collapsed]=\"fold.collapsed\"\n [attr.id]=\"fold.head ? uid + '-fold-' + foldIndex : null\"\n [attr.inert]=\"fold.collapsed ? '' : null\"\n >\n <div class=\"tx-gantt-chart__fold-content\">\n @for (row of fold.rows; track row.key) {\n <div class=\"tx-gantt-chart__row\" [class]=\"parts.row?.class\" [style]=\"parts.row?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <span class=\"tx-gantt-chart__label-text\" [attr.title]=\"row.label\">{{ row.label }}</span>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @for (span of row.spans; track span.task.id) {\n @if (span.task.milestone) {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__milestone\"\n [class]=\"parts.milestone?.class\"\n [style]=\"parts.milestone?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.--tx-gantt-chart-color]=\"span.task.color ?? null\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n <span class=\"tx-gantt-chart__diamond\" aria-hidden=\"true\"></span>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\">{{ span.task.label }}</span>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__bar\"\n [class.tx-gantt-chart__bar--inside]=\"labelsInside()\"\n [class]=\"parts.bar?.class\"\n [style]=\"parts.bar?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.width.px]=\"span.width\"\n [style.--tx-gantt-chart-color]=\"span.color\"\n [style.--tx-gantt-chart-progress]=\"progressOf(span) === null ? null : progressOf(span) + '%'\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n @if (progressOf(span) !== null) {\n <span class=\"tx-gantt-chart__progress\" aria-hidden=\"true\"></span>\n }\n @if (labelsInside()) {\n <span class=\"tx-gantt-chart__bar-label\">{{ span.task.label }}</span>\n }\n </button>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\" aria-hidden=\"true\" [style.left.px]=\"span.x + span.width\">{{ span.task.label }}</span>\n }\n }\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @let todayAt = todayX();\n @if (todayAt !== null) {\n <span class=\"tx-gantt-chart__today\" [class]=\"parts.today?.class\" [style]=\"parts.today?.style\" aria-hidden=\"true\" [style.left]=\"'calc(var(--tx-gantt-chart-label-width) + ' + todayAt + 'px)'\"></span>\n }\n </div>\n }\n </div>\n</div>\n<span class=\"cdk-visually-hidden\" [id]=\"uid + '-hint'\">{{ t.chartGanttHint }}</span>\n",
|
|
796
|
-
styles: [":host{--tx-gantt-chart-label-width: min(220px, 40cqi);--tx-gantt-chart-row-height: 36px;--tx-gantt-chart-head-height: 28px;display:flex;flex-direction:column;min-width:0;container-type:inline-size}.tx-gantt-chart__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.tx-gantt-chart__scroll{position:relative;overflow:auto;overscroll-behavior-x:contain}.tx-gantt-chart__grid{position:relative;width:calc(var(--tx-gantt-chart-label-width) + var(--tx-gantt-chart-width));min-width:100%}.tx-gantt-chart__head,.tx-gantt-chart__row{display:flex}.tx-gantt-chart__head{position:sticky;top:0;z-index:3}.tx-gantt-chart__corner,.tx-gantt-chart__label{position:sticky;left:0;z-index:2;display:flex;flex:0 0 var(--tx-gantt-chart-label-width);align-items:center;min-width:0;box-sizing:border-box}.tx-gantt-chart__corner{z-index:4}.tx-gantt-chart__scale,.tx-gantt-chart__lane{position:relative;flex:0 0 var(--tx-gantt-chart-width)}.tx-gantt-chart__tier{position:relative;height:var(--tx-gantt-chart-head-height)}.tx-gantt-chart__tick{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:hidden;box-sizing:border-box;white-space:nowrap}.tx-gantt-chart__tier--top .tx-gantt-chart__tick{justify-content:flex-start;overflow:visible;clip-path:inset(0)}.tx-gantt-chart__tick-text{position:sticky;left:var(--tx-gantt-chart-label-width);padding-inline:8px}.tx-gantt-chart__row{height:var(--tx-gantt-chart-row-height)}.tx-gantt-chart__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__toggle{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__toggle[aria-expanded=false] .tx-gantt-chart__chevron{transform:rotate(-90deg)}.tx-gantt-chart__body{position:relative}.tx-gantt-chart__fold{display:grid;grid-template-rows:1fr;overflow:visible clip}.tx-gantt-chart__fold--collapsed{grid-template-rows:0fr}.tx-gantt-chart__fold-content{min-height:0}.tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{visibility:hidden}.tx-gantt-chart__backdrop{position:absolute;inset:0 0 0 var(--tx-gantt-chart-label-width);pointer-events:none}.tx-gantt-chart__column{position:absolute;top:0;bottom:0;box-sizing:border-box}.tx-gantt-chart__bar,.tx-gantt-chart__milestone,.tx-gantt-chart__summary,.tx-gantt-chart__bar-label--outside{position:absolute;top:50%;transform:translateY(-50%)}.tx-gantt-chart__bar{display:flex;align-items:center;height:60%;min-width:6px;margin:0;padding:0;overflow:hidden;border:0;box-sizing:border-box;background:var(--tx-gantt-chart-color);color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__progress{position:absolute;inset:0 auto 0 0;width:var(--tx-gantt-chart-progress, 0%)}.tx-gantt-chart__bar-label{position:relative;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline:6px}.tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:absolute;padding-inline-start:6px;pointer-events:none}.tx-gantt-chart__milestone{display:flex;align-items:center;height:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;translate:-7px 0}.tx-gantt-chart__milestone .tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:static;transform:none}.tx-gantt-chart__diamond{display:block;flex:0 0 auto;width:14px;height:14px;transform:rotate(45deg) scale(.8);background:var(--tx-gantt-chart-color, currentColor)}.tx-gantt-chart__summary{height:6px;background:currentColor;opacity:.4}.tx-gantt-chart__today{position:absolute;top:0;bottom:0;z-index:1;width:2px;margin-left:-1px;background:currentColor;pointer-events:none}.tx-gantt-chart__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:160px;position:sticky;left:0}:host([data-styled]){--tx-gantt-chart-label-width: min(var(--tx-chart-gantt-label-width), 40cqi);--tx-gantt-chart-row-height: calc(var(--tx-chart-gantt-row-height) * 1px);--tx-gantt-chart-head-height: var(--tx-chart-gantt-header-row-height);font-size:var(--tx-chart-gantt-font-size);color:var(--tx-chart-gantt-label-color)}:host([data-styled]) .tx-gantt-chart__toolbar{gap:var(--tx-chart-gantt-toolbar-gap);margin-bottom:var(--tx-chart-gantt-toolbar-gap)}:host([data-styled]) .tx-gantt-chart__scroll{max-height:var(--tx-chart-gantt-max-height);border:1px solid var(--tx-chart-gantt-border-color);border-radius:var(--tx-chart-gantt-radius);background:var(--tx-chart-gantt-background)}:host([data-styled]) .tx-gantt-chart__head{background:var(--tx-chart-gantt-header-background);box-shadow:inset 0 -1px 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__corner,:host([data-styled]) .tx-gantt-chart__label{padding-inline:var(--tx-chart-gantt-label-padding-x);background:var(--tx-chart-gantt-background);box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__label{box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color),inset 0 0 0 var(--tx-gantt-chart-row-height) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__corner{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);background:var(--tx-chart-gantt-header-background)}:host([data-styled]) .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__tier--top .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-top-color);font-weight:var(--tx-chart-gantt-header-top-font-weight)}:host([data-styled]) .tx-gantt-chart__tick--weekend,:host([data-styled]) .tx-gantt-chart__column--weekend{background:var(--tx-chart-gantt-weekend-background)}:host([data-styled]) .tx-gantt-chart__column{box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__row{--tx-gantt-chart-tint: transparent;box-shadow:inset 0 0 0 var(--tx-gantt-chart-row-height) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__row:hover{--tx-gantt-chart-tint: var(--tx-chart-gantt-row-hover-background)}:host([data-styled]) .tx-gantt-chart__fold{transition:grid-template-rows var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:visibility 0s linear var(--tx-chart-gantt-fold-duration)}:host([data-styled]) .tx-gantt-chart__row--group{background:var(--tx-chart-gantt-group-background);color:var(--tx-chart-gantt-group-color);font-weight:var(--tx-chart-gantt-group-font-weight)}:host([data-styled]) .tx-gantt-chart__row--group .tx-gantt-chart__label{background:var(--tx-chart-gantt-group-background)}:host([data-styled]) .tx-gantt-chart__toggle{border-radius:var(--tx-radius-sm)}:host([data-styled]) .tx-gantt-chart__toggle:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__chevron{transition:transform var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__count{color:var(--tx-chart-gantt-header-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-gantt-chart__bar{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-chart-gantt-bar-height));border-radius:var(--tx-chart-gantt-bar-radius);background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-track-strength),var(--tx-chart-gantt-track-base));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),filter var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:not(:has(.tx-gantt-chart__progress)){background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar:hover{filter:brightness(1.06)}:host([data-styled]) .tx-gantt-chart__progress{background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar.tx-gantt-chart__bar--inside{background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-inside-strength),var(--tx-chart-gantt-track-base));box-shadow:inset var(--tx-chart-gantt-inside-accent-width) 0 0 var(--tx-gantt-chart-color),inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent)}:host([data-styled]) .tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline-start:calc(var(--tx-chart-gantt-inside-accent-width) + 6px);color:var(--tx-chart-gantt-inside-label-color);font-weight:var(--tx-font-weight-medium)}:host([data-styled]) .tx-gantt-chart__scroll:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__bar-label--outside{padding-inline-start:var(--tx-chart-gantt-bar-label-gap);color:var(--tx-chart-gantt-bar-label-color);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__bar:focus-visible,:host([data-styled]) .tx-gantt-chart__milestone:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__milestone{translate:calc(var(--tx-chart-gantt-milestone-size) / -2) 0;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__diamond{width:var(--tx-chart-gantt-milestone-size);height:var(--tx-chart-gantt-milestone-size);border-radius:var(--tx-chart-gantt-milestone-radius);background:var(--tx-gantt-chart-color, var(--tx-chart-gantt-milestone-color))}:host([data-styled]) .tx-gantt-chart__summary{height:var(--tx-chart-gantt-summary-height);border-radius:var(--tx-radius-full);background:var(--tx-chart-gantt-summary-color);opacity:1;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled]) .tx-gantt-chart__today{width:var(--tx-chart-gantt-today-width);margin-left:calc(var(--tx-chart-gantt-today-width) / -2);background:var(--tx-chart-gantt-today-color)}:host([data-styled]) .tx-gantt-chart__empty{color:var(--tx-chart-gantt-header-color)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-gantt-chart__bar,:host([data-styled]) .tx-gantt-chart__milestone,:host([data-styled]) .tx-gantt-chart__summary,:host([data-styled]) .tx-gantt-chart__bar-label--outside,:host([data-styled]) .tx-gantt-chart__chevron,:host([data-styled]) .tx-gantt-chart__row,:host([data-styled]) .tx-gantt-chart__label,:host([data-styled]) .tx-gantt-chart__fold,:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:none}}\n"]
|
|
1239
|
+
template: "@let parts = passThrough();\n@let t = translations();\n@if (toolbar()) {\n <div class=\"tx-gantt-chart__toolbar\" [class]=\"parts.toolbar?.class\" [style]=\"parts.toolbar?.style\">\n <tx-button-group role=\"group\" [attr.aria-label]=\"t.zoomIn + ' / ' + t.zoomOut\">\n @for (level of zooms; track level) {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n [variant]=\"zoom() === level ? undefined : 'outlined'\"\n [severity]=\"zoom() === level ? 'primary' : 'secondary'\"\n [label]=\"zoomLabels()[level]\"\n [attr.aria-pressed]=\"zoom() === level\"\n (click)=\"setZoom(level)\"\n ></button>\n }\n </tx-button-group>\n @if (todayX() !== null) {\n <button txButton type=\"button\" size=\"small\" variant=\"text\" severity=\"secondary\" icon=\"calendar\" [label]=\"t.today\" (click)=\"scrollToToday()\"></button>\n }\n </div>\n}\n<div\n #scroller\n class=\"tx-gantt-chart__scroll\"\n [class]=\"parts.scroll?.class\"\n [style]=\"parts.scroll?.style\"\n [style.max-height]=\"maxHeight() || null\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"summary()\"\n [attr.aria-describedby]=\"uid + '-hint'\"\n (wheel)=\"onWheel($event)\"\n>\n <div class=\"tx-gantt-chart__grid\" [style.--tx-gantt-chart-width.px]=\"width()\">\n <div class=\"tx-gantt-chart__head\" [class]=\"parts.head?.class\" [style]=\"parts.head?.style\">\n <div class=\"tx-gantt-chart__corner\" [class]=\"parts.corner?.class\" [style]=\"parts.corner?.style\">{{ labelHeader() || (layout() === 'timeline' ? t.chartTimeline : t.chartTask) }}</div>\n <div class=\"tx-gantt-chart__scale\" [class]=\"parts.scale?.class\" [style]=\"parts.scale?.style\" aria-hidden=\"true\">\n <div class=\"tx-gantt-chart__tier tx-gantt-chart__tier--top\">\n @for (tick of ticks().top; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"><span class=\"tx-gantt-chart__tick-text\">{{ tick.label }}</span></span>\n }\n </div>\n <div class=\"tx-gantt-chart__tier\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__tick\" [class.tx-gantt-chart__tick--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\">{{ tick.label }}</span>\n }\n </div>\n </div>\n </div>\n\n @if (loading()) {\n @for (row of skeletonRows; track row) {\n <div class=\"tx-gantt-chart__row\">\n <div class=\"tx-gantt-chart__label\"><tx-skeleton width=\"70%\" height=\"0.75rem\" /></div>\n <div class=\"tx-gantt-chart__lane\"><tx-skeleton class=\"tx-gantt-chart__skeleton\" [style.margin-left.%]=\"row * 12\" width=\"30%\" height=\"0.9rem\" /></div>\n </div>\n }\n } @else if (isEmpty()) {\n <div class=\"tx-gantt-chart__empty\" role=\"status\" [class]=\"parts.empty?.class\" [style]=\"parts.empty?.style\">\n <tx-icon name=\"calendar\" aria-hidden=\"true\" />\n <span>{{ t.chartNoData }}</span>\n </div>\n } @else {\n <div class=\"tx-gantt-chart__body\">\n <div class=\"tx-gantt-chart__backdrop\" aria-hidden=\"true\">\n @for (tick of ticks().bottom; track tick.key) {\n <span class=\"tx-gantt-chart__column\" [class.tx-gantt-chart__column--weekend]=\"tick.weekend\" [style.left.px]=\"tick.x\" [style.width.px]=\"tick.width\"></span>\n }\n </div>\n @let links = linkLayout();\n @if (links.paths.length) {\n <svg\n class=\"tx-gantt-chart__dependencies\"\n aria-hidden=\"true\"\n focusable=\"false\"\n preserveAspectRatio=\"none\"\n [attr.viewBox]=\"'0 0 ' + width() + ' ' + links.height\"\n [style.height]=\"'calc(var(--tx-gantt-chart-row-height) * ' + links.height + ')'\"\n >\n @for (link of linkPaths(); track link.key) {\n <g\n class=\"tx-gantt-chart__dependency\"\n [class]=\"parts.dependency?.class\"\n [style]=\"parts.dependency?.style\"\n [class.tx-gantt-chart__dependency--active]=\"link.state === 'active'\"\n [class.tx-gantt-chart__dependency--dimmed]=\"link.state === 'dimmed'\"\n >\n <path class=\"tx-gantt-chart__dependency-line\" vector-effect=\"non-scaling-stroke\" [attr.d]=\"link.path\" />\n <path class=\"tx-gantt-chart__dependency-head\" [attr.d]=\"link.head\" />\n </g>\n }\n </svg>\n }\n @for (fold of folds(); track fold.key; let foldIndex = $index) {\n @if (fold.head; as head) {\n <div class=\"tx-gantt-chart__row tx-gantt-chart__row--group\" [class]=\"parts.group?.class\" [style]=\"parts.group?.style\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <button\n type=\"button\"\n class=\"tx-gantt-chart__toggle\"\n [attr.aria-expanded]=\"!head.collapsed\"\n [attr.aria-controls]=\"uid + '-fold-' + foldIndex\"\n (click)=\"onToggle(head.group ?? head.label)\"\n >\n <tx-icon class=\"tx-gantt-chart__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n <span class=\"tx-gantt-chart__label-text\">{{ head.label }}</span>\n <span class=\"tx-gantt-chart__count\">{{ head.count }}</span>\n </button>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @if (head.summary; as summary) {\n <span\n class=\"tx-gantt-chart__summary\"\n aria-hidden=\"true\"\n [class.tx-gantt-chart__summary--dimmed]=\"isGroupDimmed(head.group)\"\n [style.left.px]=\"summary.x\"\n [style.width.px]=\"summary.width\"\n ></span>\n }\n </div>\n </div>\n }\n <div\n class=\"tx-gantt-chart__fold\"\n [class.tx-gantt-chart__fold--collapsed]=\"fold.collapsed\"\n [attr.id]=\"fold.head ? uid + '-fold-' + foldIndex : null\"\n [attr.inert]=\"fold.collapsed ? '' : null\"\n >\n <div class=\"tx-gantt-chart__fold-content\">\n @for (row of fold.rows; track row.key) {\n <div class=\"tx-gantt-chart__row\" [class]=\"parts.row?.class\" [style]=\"parts.row?.style\" [style.--tx-gantt-chart-lanes]=\"row.lanes > 1 ? row.lanes : null\">\n <div class=\"tx-gantt-chart__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">\n <span class=\"tx-gantt-chart__label-text\" [attr.title]=\"row.label\">{{ row.label }}</span>\n </div>\n <div class=\"tx-gantt-chart__lane\" [class]=\"parts.lane?.class\" [style]=\"parts.lane?.style\">\n @for (span of row.spans; track span.task.id) {\n @if (span.task.milestone) {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__milestone\"\n [class]=\"parts.milestone?.class\"\n [style]=\"parts.milestone?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n [style.--tx-gantt-chart-color]=\"span.task.color ?? null\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (blur)=\"onBarBlur()\"\n (mouseenter)=\"onBarHover(span)\"\n (mouseleave)=\"onBarHover(null)\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n <span class=\"tx-gantt-chart__diamond\" aria-hidden=\"true\"></span>\n @if (labelsOutside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\" [style.margin-inline-start.px]=\"labelShift(span) || null\">{{ span.task.label }}</span>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"tx-gantt-chart__bar\"\n [class.tx-gantt-chart__bar--inside]=\"labelsInside()\"\n [class]=\"parts.bar?.class\"\n [style]=\"parts.bar?.style\"\n [attr.data-task]=\"span.task.id\"\n [style.left.px]=\"span.x\"\n [style.width.px]=\"span.width\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n [style.--tx-gantt-chart-color]=\"span.color\"\n [style.--tx-gantt-chart-progress]=\"progressOf(span) === null ? null : progressOf(span) + '%'\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [tabindex]=\"tabStop() === span.task.id ? 0 : -1\"\n [attr.aria-label]=\"ariaFor(span)\"\n [txTooltip]=\"tooltipFor(span)\"\n (click)=\"onBarClick(span)\"\n (focus)=\"onBarFocus(span, $any($event.target))\"\n (blur)=\"onBarBlur()\"\n (mouseenter)=\"onBarHover(span)\"\n (mouseleave)=\"onBarHover(null)\"\n (keydown)=\"onBarKeydown($event, span)\"\n >\n @if (progressOf(span) !== null) {\n <span class=\"tx-gantt-chart__progress\" aria-hidden=\"true\"></span>\n }\n @if (labelsInside()) {\n <span class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--inside\">{{ span.task.label }}</span>\n }\n </button>\n @if (labelsOutside()) {\n <span\n class=\"tx-gantt-chart__bar-label tx-gantt-chart__bar-label--outside\"\n aria-hidden=\"true\"\n [class.tx-gantt-chart__task--dimmed]=\"isDimmed(span.task.id)\"\n [style.left.px]=\"span.x + span.width + labelShift(span)\"\n [style.--tx-gantt-chart-lane]=\"span.lane || null\"\n >\n <span class=\"tx-gantt-chart__bar-label-text\">{{ span.task.label }}</span>\n </span>\n }\n }\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @let todayAt = todayX();\n @if (todayAt !== null) {\n <span class=\"tx-gantt-chart__today\" [class]=\"parts.today?.class\" [style]=\"parts.today?.style\" aria-hidden=\"true\" [style.left]=\"'calc(var(--tx-gantt-chart-label-width) + ' + todayAt + 'px)'\"></span>\n }\n </div>\n }\n </div>\n</div>\n<span class=\"cdk-visually-hidden\" [id]=\"uid + '-hint'\">{{ t.chartGanttHint }}</span>\n",
|
|
1240
|
+
styles: [":host{--tx-gantt-chart-label-width: min(220px, 40cqi);--tx-gantt-chart-row-height: 36px;--tx-gantt-chart-head-height: 28px;display:flex;flex-direction:column;min-width:0;container-type:inline-size}.tx-gantt-chart__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.tx-gantt-chart__scroll{position:relative;overflow:auto;overscroll-behavior-x:contain}.tx-gantt-chart__grid{position:relative;width:calc(var(--tx-gantt-chart-label-width) + var(--tx-gantt-chart-width));min-width:100%}.tx-gantt-chart__head,.tx-gantt-chart__row{display:flex}.tx-gantt-chart__head{position:sticky;top:0;z-index:3}.tx-gantt-chart__corner,.tx-gantt-chart__label{position:sticky;left:0;z-index:2;display:flex;flex:0 0 var(--tx-gantt-chart-label-width);align-items:center;min-width:0;box-sizing:border-box}.tx-gantt-chart__corner{z-index:4}.tx-gantt-chart__scale,.tx-gantt-chart__lane{position:relative;flex:0 0 var(--tx-gantt-chart-width)}.tx-gantt-chart__tier{position:relative;height:var(--tx-gantt-chart-head-height)}.tx-gantt-chart__tick{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:hidden;box-sizing:border-box;white-space:nowrap}.tx-gantt-chart__tier--top .tx-gantt-chart__tick{justify-content:flex-start;overflow:visible;clip-path:inset(0)}.tx-gantt-chart__tick-text{position:sticky;left:var(--tx-gantt-chart-label-width);padding-inline:8px}.tx-gantt-chart__row{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1))}.tx-gantt-chart__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__toggle{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__toggle[aria-expanded=false] .tx-gantt-chart__chevron{transform:rotate(-90deg)}.tx-gantt-chart__body{position:relative}.tx-gantt-chart__fold{display:grid;grid-template-rows:1fr;overflow:visible clip}.tx-gantt-chart__fold--collapsed{grid-template-rows:0fr}.tx-gantt-chart__fold-content{min-height:0}.tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{visibility:hidden}.tx-gantt-chart__backdrop{position:absolute;inset:0 0 0 var(--tx-gantt-chart-label-width);pointer-events:none}.tx-gantt-chart__column{position:absolute;top:0;bottom:0;box-sizing:border-box}.tx-gantt-chart__bar,.tx-gantt-chart__milestone,.tx-gantt-chart__summary,.tx-gantt-chart__bar-label--outside{position:absolute;top:calc(var(--tx-gantt-chart-row-height) * (var(--tx-gantt-chart-lane, 0) + .5));transform:translateY(-50%)}.tx-gantt-chart__bar{display:flex;align-items:center;height:calc(var(--tx-gantt-chart-row-height) * .6);min-width:6px;margin:0;padding:0;overflow:clip;border:0;box-sizing:border-box;background:var(--tx-gantt-chart-color);color:inherit;font:inherit;cursor:pointer}.tx-gantt-chart__progress{position:absolute;inset:0 auto 0 0;width:var(--tx-gantt-chart-progress, 0%)}.tx-gantt-chart__bar-label{position:relative;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline:6px}.tx-gantt-chart__bar-label--inside{position:sticky;left:var(--tx-gantt-chart-label-width)}.tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:absolute;right:0;display:flex;overflow:clip;padding-inline-start:6px;pointer-events:none}.tx-gantt-chart__bar-label-text{position:sticky;left:var(--tx-gantt-chart-label-width);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-gantt-chart__milestone{display:flex;align-items:center;height:var(--tx-gantt-chart-row-height);margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;translate:-7px 0}.tx-gantt-chart__milestone .tx-gantt-chart__bar-label.tx-gantt-chart__bar-label--outside{position:static;right:auto;display:block;overflow:hidden;transform:none}.tx-gantt-chart__diamond{display:block;flex:0 0 auto;width:14px;height:14px;transform:rotate(45deg) scale(.8);background:var(--tx-gantt-chart-color, currentColor)}.tx-gantt-chart__summary{height:6px;background:currentColor;opacity:.4}.tx-gantt-chart__dependencies{position:absolute;top:0;left:var(--tx-gantt-chart-label-width);width:var(--tx-gantt-chart-width);overflow:visible;pointer-events:none}.tx-gantt-chart__dependency-line{fill:none;stroke:currentColor;stroke-width:1.5px}.tx-gantt-chart__dependency-head{fill:currentColor}.tx-gantt-chart__today{position:absolute;top:0;bottom:0;z-index:1;width:2px;margin-left:-1px;background:currentColor;pointer-events:none}.tx-gantt-chart__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:160px;position:sticky;left:0}:host([data-styled]){--tx-gantt-chart-label-width: min(var(--tx-chart-gantt-label-width), 40cqi);--tx-gantt-chart-row-height: calc(var(--tx-chart-gantt-row-height) * 1px);--tx-gantt-chart-head-height: var(--tx-chart-gantt-header-row-height);font-size:var(--tx-chart-gantt-font-size);color:var(--tx-chart-gantt-label-color)}:host([data-styled]) .tx-gantt-chart__toolbar{gap:var(--tx-chart-gantt-toolbar-gap);margin-bottom:var(--tx-chart-gantt-toolbar-gap)}:host([data-styled]) .tx-gantt-chart__scroll{max-height:var(--tx-chart-gantt-max-height);border:1px solid var(--tx-chart-gantt-border-color);border-radius:var(--tx-chart-gantt-radius);background:var(--tx-chart-gantt-background)}:host([data-styled]) .tx-gantt-chart__head{background:var(--tx-chart-gantt-header-background);box-shadow:inset 0 -1px 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__corner,:host([data-styled]) .tx-gantt-chart__label{padding-inline:var(--tx-chart-gantt-label-padding-x);background:var(--tx-chart-gantt-background);box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color)}:host([data-styled]) .tx-gantt-chart__label{box-shadow:inset -1px 0 0 var(--tx-chart-gantt-border-color),inset 0 0 0 calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1)) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__corner{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);background:var(--tx-chart-gantt-header-background)}:host([data-styled]) .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-color);font-size:var(--tx-chart-gantt-header-font-size);box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__tier--top .tx-gantt-chart__tick{color:var(--tx-chart-gantt-header-top-color);font-weight:var(--tx-chart-gantt-header-top-font-weight)}:host([data-styled]) .tx-gantt-chart__tick--weekend,:host([data-styled]) .tx-gantt-chart__column--weekend{background:var(--tx-chart-gantt-weekend-background)}:host([data-styled]) .tx-gantt-chart__column{box-shadow:inset 1px 0 0 var(--tx-chart-grid-color)}:host([data-styled]) .tx-gantt-chart__row{--tx-gantt-chart-tint: transparent;box-shadow:inset 0 0 0 calc(var(--tx-gantt-chart-row-height) * var(--tx-gantt-chart-lanes, 1)) var(--tx-gantt-chart-tint);transition:box-shadow var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__row:hover{--tx-gantt-chart-tint: var(--tx-chart-gantt-row-hover-background)}:host([data-styled]) .tx-gantt-chart__fold{transition:grid-template-rows var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:visibility 0s linear var(--tx-chart-gantt-fold-duration)}:host([data-styled]) .tx-gantt-chart__row--group{background:var(--tx-chart-gantt-group-background);color:var(--tx-chart-gantt-group-color);font-weight:var(--tx-chart-gantt-group-font-weight)}:host([data-styled]) .tx-gantt-chart__row--group .tx-gantt-chart__label{background:var(--tx-chart-gantt-group-background)}:host([data-styled]) .tx-gantt-chart__toggle{border-radius:var(--tx-radius-sm)}:host([data-styled]) .tx-gantt-chart__toggle:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__chevron{transition:transform var(--tx-chart-gantt-fold-duration) var(--tx-chart-gantt-fold-easing)}:host([data-styled]) .tx-gantt-chart__count{color:var(--tx-chart-gantt-header-color);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-gantt-chart__bar{height:calc(var(--tx-gantt-chart-row-height) * var(--tx-chart-gantt-bar-height));border-radius:var(--tx-chart-gantt-bar-radius);background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-track-strength),var(--tx-chart-gantt-track-base));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),filter var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:not(:has(.tx-gantt-chart__progress)){background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar:hover{filter:brightness(1.06)}:host([data-styled]) .tx-gantt-chart__progress{background:var(--tx-gantt-chart-color)}:host([data-styled]) .tx-gantt-chart__bar.tx-gantt-chart__bar--inside{background:color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-inside-strength),var(--tx-chart-gantt-track-base));box-shadow:inset var(--tx-chart-gantt-inside-accent-width) 0 0 var(--tx-gantt-chart-color),inset 0 0 0 1px color-mix(in srgb,var(--tx-gantt-chart-color) var(--tx-chart-gantt-bar-border-strength),transparent)}:host([data-styled]) .tx-gantt-chart__bar--inside .tx-gantt-chart__bar-label{padding-inline-start:calc(var(--tx-chart-gantt-inside-accent-width) + 6px);color:var(--tx-chart-gantt-inside-label-color);font-weight:var(--tx-font-weight-medium)}:host([data-styled]) .tx-gantt-chart__scroll:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__bar-label--outside{padding-inline-start:var(--tx-chart-gantt-bar-label-gap);color:var(--tx-chart-gantt-bar-label-color);transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__bar:focus-visible,:host([data-styled]) .tx-gantt-chart__milestone:focus-visible{outline:var(--tx-chart-focus-ring-width) solid var(--tx-chart-focus-ring-color);outline-offset:var(--tx-chart-focus-ring-offset)}:host([data-styled]) .tx-gantt-chart__milestone{translate:calc(var(--tx-chart-gantt-milestone-size) / -2) 0;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__diamond{width:var(--tx-chart-gantt-milestone-size);height:var(--tx-chart-gantt-milestone-size);border-radius:var(--tx-chart-gantt-milestone-radius);background:var(--tx-gantt-chart-color, var(--tx-chart-gantt-milestone-color))}:host([data-styled]) .tx-gantt-chart__summary{height:var(--tx-chart-gantt-summary-height);border-radius:var(--tx-radius-full);background:var(--tx-chart-gantt-summary-color);opacity:1;transition:left var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__dependency{color:var(--tx-chart-gantt-dependency-color);transition:opacity var(--tx-chart-motion-hover-duration) ease,color var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-gantt-chart__dependency-line{stroke-width:var(--tx-chart-gantt-dependency-width)}:host([data-styled]) .tx-gantt-chart__dependency--active{color:var(--tx-chart-gantt-dependency-active-color)}:host([data-styled]) .tx-gantt-chart__dependency--active .tx-gantt-chart__dependency-line{stroke-width:var(--tx-chart-gantt-dependency-active-width)}:host([data-styled]) .tx-gantt-chart__dependency--dimmed,:host([data-styled]) .tx-gantt-chart__task--dimmed,:host([data-styled]) .tx-gantt-chart__summary--dimmed{opacity:var(--tx-chart-gantt-dimmed-opacity)}:host([data-styled]) .tx-gantt-chart__today{width:var(--tx-chart-gantt-today-width);margin-left:calc(var(--tx-chart-gantt-today-width) / -2);background:var(--tx-chart-gantt-today-color)}:host([data-styled]) .tx-gantt-chart__empty{color:var(--tx-chart-gantt-header-color)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-gantt-chart__bar,:host([data-styled]) .tx-gantt-chart__milestone,:host([data-styled]) .tx-gantt-chart__summary,:host([data-styled]) .tx-gantt-chart__dependency,:host([data-styled]) .tx-gantt-chart__bar-label--outside,:host([data-styled]) .tx-gantt-chart__chevron,:host([data-styled]) .tx-gantt-chart__row,:host([data-styled]) .tx-gantt-chart__label,:host([data-styled]) .tx-gantt-chart__fold,:host([data-styled]) .tx-gantt-chart__fold--collapsed>.tx-gantt-chart__fold-content{transition:none}}\n"]
|
|
797
1241
|
}]
|
|
798
1242
|
}],
|
|
799
1243
|
ctorParameters: () => [],
|
|
@@ -897,6 +1341,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
897
1341
|
required: false
|
|
898
1342
|
}]
|
|
899
1343
|
}],
|
|
1344
|
+
showDependencies: [{
|
|
1345
|
+
type: i0.Input,
|
|
1346
|
+
args: [{
|
|
1347
|
+
isSignal: true,
|
|
1348
|
+
alias: "showDependencies",
|
|
1349
|
+
required: false
|
|
1350
|
+
}]
|
|
1351
|
+
}],
|
|
1352
|
+
dependencyHighlight: [{
|
|
1353
|
+
type: i0.Input,
|
|
1354
|
+
args: [{
|
|
1355
|
+
isSignal: true,
|
|
1356
|
+
alias: "dependencyHighlight",
|
|
1357
|
+
required: false
|
|
1358
|
+
}]
|
|
1359
|
+
}],
|
|
900
1360
|
ariaLabel: [{
|
|
901
1361
|
type: i0.Input,
|
|
902
1362
|
args: [{
|
|
@@ -951,6 +1411,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
951
1411
|
}]
|
|
952
1412
|
}
|
|
953
1413
|
});
|
|
954
|
-
export { TX_GANTT_DAY, TX_GANTT_DAY_WIDTH, TxGanttChart, ganttDays, ganttFolds, ganttRange, ganttRows, ganttTaskRange, ganttTicks, ganttTime, ganttX, startOfDay };
|
|
1414
|
+
export { TX_GANTT_DAY, TX_GANTT_DAY_WIDTH, TX_GANTT_LINK_STUB, TxGanttChart, ganttArrowHead, ganttCellEnd, ganttChain, ganttDays, ganttFinishLinked, ganttFitRange, ganttFolds, ganttLinkPath, ganttLinkPaths, ganttLinks, ganttPack, ganttRange, ganttRoute, ganttRows, ganttTaskRange, ganttTicks, ganttTime, ganttX, startOfDay };
|
|
955
1415
|
|
|
956
1416
|
//# sourceMappingURL=tectra-ng-charts-gantt.mjs.map
|