@tectra-ng/charts 0.1.9 → 0.2.1
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/README.md +21 -1
- package/bar-list/README.md +30 -0
- package/boxplot/README.md +62 -0
- package/bullet/README.md +53 -0
- package/candlestick/README.md +57 -0
- package/column/README.md +4 -2
- package/combo/README.md +83 -0
- package/core/README.md +3 -1
- package/fesm2022/tectra-ng-charts-bar-list.mjs +299 -0
- package/fesm2022/tectra-ng-charts-bar-list.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs +887 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs +666 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs +778 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-column.mjs +149 -66
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-combo.mjs +1218 -0
- package/fesm2022/tectra-ng-charts-combo.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-core.mjs +1334 -49
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-funnel.mjs +694 -0
- package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs +947 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs +693 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs +935 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-line.mjs +527 -67
- package/fesm2022/tectra-ng-charts-line.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-org-chart.mjs +2341 -0
- package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-pie.mjs +47 -86
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-radar.mjs +924 -0
- package/fesm2022/tectra-ng-charts-radar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs +802 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs +933 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs +660 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs +837 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs +1174 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs +328 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs +733 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs +674 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs +809 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -0
- package/funnel/README.md +53 -0
- package/gantt/README.md +53 -0
- package/gauge/README.md +41 -0
- package/heatmap/README.md +47 -0
- package/line/README.md +13 -2
- package/org-chart/README.md +57 -0
- package/package.json +114 -6
- package/pie/README.md +1 -0
- package/radar/README.md +64 -0
- package/radial-bar/README.md +62 -0
- package/range-area/README.md +66 -0
- package/rank-line/README.md +51 -0
- package/sankey/README.md +52 -0
- package/scatter/README.md +71 -0
- package/segmented-bar/README.md +35 -0
- package/sunburst/README.md +55 -0
- package/treemap/README.md +47 -0
- package/types/tectra-ng-charts-bar-list.d.ts +724 -0
- package/types/tectra-ng-charts-bar-list.d.ts.map +1 -0
- package/types/tectra-ng-charts-boxplot.d.ts +882 -0
- package/types/tectra-ng-charts-boxplot.d.ts.map +1 -0
- package/types/tectra-ng-charts-bullet.d.ts +833 -0
- package/types/tectra-ng-charts-bullet.d.ts.map +1 -0
- package/types/tectra-ng-charts-candlestick.d.ts +854 -0
- package/types/tectra-ng-charts-candlestick.d.ts.map +1 -0
- package/types/tectra-ng-charts-column.d.ts +486 -3
- package/types/tectra-ng-charts-column.d.ts.map +1 -1
- package/types/tectra-ng-charts-combo.d.ts +987 -0
- package/types/tectra-ng-charts-combo.d.ts.map +1 -0
- package/types/tectra-ng-charts-core.d.ts +266 -5
- package/types/tectra-ng-charts-core.d.ts.map +1 -1
- package/types/tectra-ng-charts-funnel.d.ts +857 -0
- package/types/tectra-ng-charts-funnel.d.ts.map +1 -0
- package/types/tectra-ng-charts-gantt.d.ts +884 -0
- package/types/tectra-ng-charts-gantt.d.ts.map +1 -0
- package/types/tectra-ng-charts-gauge.d.ts +859 -0
- package/types/tectra-ng-charts-gauge.d.ts.map +1 -0
- package/types/tectra-ng-charts-heatmap.d.ts +914 -0
- package/types/tectra-ng-charts-heatmap.d.ts.map +1 -0
- package/types/tectra-ng-charts-line.d.ts +556 -2
- package/types/tectra-ng-charts-line.d.ts.map +1 -1
- package/types/tectra-ng-charts-org-chart.d.ts +1017 -0
- package/types/tectra-ng-charts-org-chart.d.ts.map +1 -0
- package/types/tectra-ng-charts-pie.d.ts +477 -14
- package/types/tectra-ng-charts-pie.d.ts.map +1 -1
- package/types/tectra-ng-charts-radar.d.ts +903 -0
- package/types/tectra-ng-charts-radar.d.ts.map +1 -0
- package/types/tectra-ng-charts-radial-bar.d.ts +886 -0
- package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-range-area.d.ts +897 -0
- package/types/tectra-ng-charts-range-area.d.ts.map +1 -0
- package/types/tectra-ng-charts-rank-line.d.ts +839 -0
- package/types/tectra-ng-charts-rank-line.d.ts.map +1 -0
- package/types/tectra-ng-charts-sankey.d.ts +866 -0
- package/types/tectra-ng-charts-sankey.d.ts.map +1 -0
- package/types/tectra-ng-charts-scatter.d.ts +987 -0
- package/types/tectra-ng-charts-scatter.d.ts.map +1 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts +751 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-sunburst.d.ts +864 -0
- package/types/tectra-ng-charts-sunburst.d.ts.map +1 -0
- package/types/tectra-ng-charts-treemap.d.ts +847 -0
- package/types/tectra-ng-charts-treemap.d.ts.map +1 -0
- package/types/tectra-ng-charts-waterfall.d.ts +869 -0
- package/types/tectra-ng-charts-waterfall.d.ts.map +1 -0
- package/waterfall/README.md +60 -0
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
import { dateFormat, seriesColor, toTime, toggleKey } from "@tectra-ng/charts/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, Injector, afterNextRender, booleanAttribute, computed, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
4
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
5
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
|
+
import { TxLocaleService, formatMessage, injectTranslations } from "@tectra-ng/core/i18n";
|
|
7
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
8
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
9
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
import { TxButton } from "@tectra-ng/ui/button";
|
|
11
|
+
import { TxButtonGroup } from "@tectra-ng/ui/button-group";
|
|
12
|
+
import { TxSkeleton } from "@tectra-ng/ui/skeleton";
|
|
13
|
+
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
14
|
+
const TX_GANTT_DAY = 864e5;
|
|
15
|
+
const TX_GANTT_DAY_WIDTH = {
|
|
16
|
+
day: 40,
|
|
17
|
+
week: 16,
|
|
18
|
+
month: 5,
|
|
19
|
+
quarter: 2
|
|
20
|
+
};
|
|
21
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
22
|
+
function startOfDay(time) {
|
|
23
|
+
const date = new Date(time);
|
|
24
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
25
|
+
}
|
|
26
|
+
function addDays(time, days) {
|
|
27
|
+
const date = new Date(time);
|
|
28
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days).getTime();
|
|
29
|
+
}
|
|
30
|
+
function daysBetween(from, to) {
|
|
31
|
+
return Math.round((startOfDay(to) - startOfDay(from)) / TX_GANTT_DAY) + (to - startOfDay(to) - (from - startOfDay(from))) / TX_GANTT_DAY;
|
|
32
|
+
}
|
|
33
|
+
function ganttTime(value, inclusiveEnd = false) {
|
|
34
|
+
const time = toTime(value ?? null);
|
|
35
|
+
if (time === null) return null;
|
|
36
|
+
return inclusiveEnd && typeof value === "string" && DATE_ONLY.test(value) ? addDays(time, 1) : time;
|
|
37
|
+
}
|
|
38
|
+
function ganttTaskRange(task) {
|
|
39
|
+
const start = ganttTime(task.start);
|
|
40
|
+
if (start === null) return null;
|
|
41
|
+
if (task.milestone) return [start, start];
|
|
42
|
+
const end = ganttTime(task.end ?? null, true) ?? addDays(startOfDay(start), 1);
|
|
43
|
+
return [start, Math.max(start, end)];
|
|
44
|
+
}
|
|
45
|
+
function ganttRange(tasks, padding, from, to) {
|
|
46
|
+
const ranges = tasks.map(ganttTaskRange).filter((range) => range !== null);
|
|
47
|
+
const min = ganttTime(from ?? null) ?? (ranges.length ? Math.min(...ranges.map((range) => range[0])) : startOfDay(Date.now()));
|
|
48
|
+
const max = ganttTime(to ?? null, true) ?? (ranges.length ? Math.max(...ranges.map((range) => range[1])) : addDays(min, 30));
|
|
49
|
+
const lastDay = startOfDay(max) === max ? max : addDays(startOfDay(max), 1);
|
|
50
|
+
return [addDays(startOfDay(min), -padding), addDays(lastDay, padding)];
|
|
51
|
+
}
|
|
52
|
+
function ganttX(time, rangeStart, dayWidth) {
|
|
53
|
+
return daysBetween(rangeStart, time) * dayWidth;
|
|
54
|
+
}
|
|
55
|
+
function ganttTicks(range, zoom, intl) {
|
|
56
|
+
const width = TX_GANTT_DAY_WIDTH[zoom];
|
|
57
|
+
const [start, end] = range;
|
|
58
|
+
const cell = (from, to, label, key, weekend) => ({
|
|
59
|
+
key,
|
|
60
|
+
label,
|
|
61
|
+
x: ganttX(from, start, width),
|
|
62
|
+
width: ganttX(Math.min(to, end), start, width) - ganttX(from, start, width),
|
|
63
|
+
...weekend === void 0 ? {} : { weekend }
|
|
64
|
+
});
|
|
65
|
+
const months = (format) => {
|
|
66
|
+
const cells = [];
|
|
67
|
+
let cursor = new Date(new Date(start).getFullYear(), new Date(start).getMonth(), 1).getTime();
|
|
68
|
+
while (cursor < end) {
|
|
69
|
+
const date = new Date(cursor);
|
|
70
|
+
const next = new Date(date.getFullYear(), date.getMonth() + 1, 1).getTime();
|
|
71
|
+
cells.push(cell(Math.max(cursor, start), next, format.format(date), `m${cursor}`));
|
|
72
|
+
cursor = next;
|
|
73
|
+
}
|
|
74
|
+
return cells;
|
|
75
|
+
};
|
|
76
|
+
const years = () => {
|
|
77
|
+
const cells = [];
|
|
78
|
+
let cursor = new Date(new Date(start).getFullYear(), 0, 1).getTime();
|
|
79
|
+
while (cursor < end) {
|
|
80
|
+
const next = new Date(new Date(cursor).getFullYear() + 1, 0, 1).getTime();
|
|
81
|
+
cells.push(cell(Math.max(cursor, start), next, String(new Date(cursor).getFullYear()), `y${cursor}`));
|
|
82
|
+
cursor = next;
|
|
83
|
+
}
|
|
84
|
+
return cells;
|
|
85
|
+
};
|
|
86
|
+
if (zoom === "day") {
|
|
87
|
+
const day = dateFormat(intl, { day: "numeric" });
|
|
88
|
+
const bottom = [];
|
|
89
|
+
for (let cursor = start; cursor < end; cursor = addDays(cursor, 1)) {
|
|
90
|
+
const weekday = new Date(cursor).getDay();
|
|
91
|
+
bottom.push(cell(cursor, addDays(cursor, 1), day.format(cursor), `d${cursor}`, weekday === 0 || weekday === 6));
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
top: months(dateFormat(intl, {
|
|
95
|
+
month: "long",
|
|
96
|
+
year: "numeric"
|
|
97
|
+
})),
|
|
98
|
+
bottom
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (zoom === "week") {
|
|
102
|
+
const day = dateFormat(intl, {
|
|
103
|
+
day: "numeric",
|
|
104
|
+
month: "short"
|
|
105
|
+
});
|
|
106
|
+
const bottom = [];
|
|
107
|
+
let cursor = start;
|
|
108
|
+
const toMonday = (8 - (new Date(start).getDay() || 7)) % 7;
|
|
109
|
+
if (toMonday) {
|
|
110
|
+
bottom.push(cell(cursor, addDays(cursor, toMonday), "", `w${cursor}`));
|
|
111
|
+
cursor = addDays(cursor, toMonday);
|
|
112
|
+
}
|
|
113
|
+
for (; cursor < end; cursor = addDays(cursor, 7)) bottom.push(cell(cursor, addDays(cursor, 7), day.format(cursor), `w${cursor}`));
|
|
114
|
+
return {
|
|
115
|
+
top: months(dateFormat(intl, {
|
|
116
|
+
month: "long",
|
|
117
|
+
year: "numeric"
|
|
118
|
+
})),
|
|
119
|
+
bottom
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (zoom === "month") return {
|
|
123
|
+
top: years(),
|
|
124
|
+
bottom: months(dateFormat(intl, { month: "short" }))
|
|
125
|
+
};
|
|
126
|
+
const bottom = [];
|
|
127
|
+
let cursor = new Date(new Date(start).getFullYear(), Math.floor(new Date(start).getMonth() / 3) * 3, 1).getTime();
|
|
128
|
+
while (cursor < end) {
|
|
129
|
+
const date = new Date(cursor);
|
|
130
|
+
const next = new Date(date.getFullYear(), date.getMonth() + 3, 1).getTime();
|
|
131
|
+
bottom.push(cell(Math.max(cursor, start), next, `Q${Math.floor(date.getMonth() / 3) + 1}`, `q${cursor}`));
|
|
132
|
+
cursor = next;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
top: years(),
|
|
136
|
+
bottom
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function ganttRows(tasks, layout, collapsed, rangeStart, dayWidth, minWidth) {
|
|
140
|
+
const groups = [];
|
|
141
|
+
tasks.forEach((task) => {
|
|
142
|
+
if (task.group && !groups.includes(task.group)) groups.push(task.group);
|
|
143
|
+
});
|
|
144
|
+
const spanOf = (task, index) => {
|
|
145
|
+
const range = ganttTaskRange(task);
|
|
146
|
+
if (!range) return null;
|
|
147
|
+
const x = ganttX(range[0], rangeStart, dayWidth);
|
|
148
|
+
const width = task.milestone ? 0 : Math.max(minWidth, ganttX(range[1], rangeStart, dayWidth) - x);
|
|
149
|
+
const groupIndex = task.group ? groups.indexOf(task.group) : 0;
|
|
150
|
+
return {
|
|
151
|
+
task,
|
|
152
|
+
index,
|
|
153
|
+
start: range[0],
|
|
154
|
+
end: range[1],
|
|
155
|
+
x,
|
|
156
|
+
width,
|
|
157
|
+
color: seriesColor(task.color, Math.max(0, groupIndex))
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
const spans = tasks.map(spanOf);
|
|
161
|
+
const summary = (items) => {
|
|
162
|
+
if (!items.length) return null;
|
|
163
|
+
const x = Math.min(...items.map((item) => item.x));
|
|
164
|
+
return {
|
|
165
|
+
x,
|
|
166
|
+
width: Math.max(...items.map((item) => item.x + item.width)) - x
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
const rows = [];
|
|
170
|
+
const ungrouped = tasks.flatMap((task, index) => !task.group && spans[index] ? [spans[index]] : []);
|
|
171
|
+
if (layout === "timeline") {
|
|
172
|
+
for (const group of groups) {
|
|
173
|
+
const items = tasks.flatMap((task, index) => task.group === group && spans[index] ? [spans[index]] : []);
|
|
174
|
+
rows.push({
|
|
175
|
+
key: `lane:${group}`,
|
|
176
|
+
kind: "task",
|
|
177
|
+
label: group,
|
|
178
|
+
group,
|
|
179
|
+
spans: items,
|
|
180
|
+
summary: null,
|
|
181
|
+
collapsed: false,
|
|
182
|
+
count: items.length
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
ungrouped.forEach((span) => rows.push({
|
|
186
|
+
key: `task:${span.task.id}`,
|
|
187
|
+
kind: "task",
|
|
188
|
+
label: span.task.label,
|
|
189
|
+
group: null,
|
|
190
|
+
spans: [span],
|
|
191
|
+
summary: null,
|
|
192
|
+
collapsed: false,
|
|
193
|
+
count: 1
|
|
194
|
+
}));
|
|
195
|
+
return rows;
|
|
196
|
+
}
|
|
197
|
+
ungrouped.forEach((span) => rows.push({
|
|
198
|
+
key: `task:${span.task.id}`,
|
|
199
|
+
kind: "task",
|
|
200
|
+
label: span.task.label,
|
|
201
|
+
group: null,
|
|
202
|
+
spans: [span],
|
|
203
|
+
summary: null,
|
|
204
|
+
collapsed: false,
|
|
205
|
+
count: 1
|
|
206
|
+
}));
|
|
207
|
+
for (const group of groups) {
|
|
208
|
+
const items = tasks.flatMap((task, index) => task.group === group && spans[index] ? [spans[index]] : []);
|
|
209
|
+
const closed = collapsed.has(group);
|
|
210
|
+
rows.push({
|
|
211
|
+
key: `group:${group}`,
|
|
212
|
+
kind: "group",
|
|
213
|
+
label: group,
|
|
214
|
+
group,
|
|
215
|
+
spans: [],
|
|
216
|
+
summary: summary(items),
|
|
217
|
+
collapsed: closed,
|
|
218
|
+
count: items.length
|
|
219
|
+
});
|
|
220
|
+
items.forEach((span) => rows.push({
|
|
221
|
+
key: `task:${span.task.id}`,
|
|
222
|
+
kind: "task",
|
|
223
|
+
label: span.task.label,
|
|
224
|
+
group,
|
|
225
|
+
spans: [span],
|
|
226
|
+
summary: null,
|
|
227
|
+
collapsed: closed,
|
|
228
|
+
count: 1
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
return rows;
|
|
232
|
+
}
|
|
233
|
+
function ganttFolds(rows) {
|
|
234
|
+
const folds = [];
|
|
235
|
+
for (const row of rows) {
|
|
236
|
+
const last = folds[folds.length - 1];
|
|
237
|
+
if (row.kind === "group") folds.push({
|
|
238
|
+
key: row.key,
|
|
239
|
+
head: row,
|
|
240
|
+
rows: [],
|
|
241
|
+
collapsed: row.collapsed
|
|
242
|
+
});
|
|
243
|
+
else if (last && (last.head ? last.head.group === row.group : true)) last.rows.push(row);
|
|
244
|
+
else folds.push({
|
|
245
|
+
key: `rows:${row.key}`,
|
|
246
|
+
head: null,
|
|
247
|
+
rows: [row],
|
|
248
|
+
collapsed: false
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return folds;
|
|
252
|
+
}
|
|
253
|
+
function ganttDays(start, end) {
|
|
254
|
+
return Math.max(0, Math.round(daysBetween(start, end)));
|
|
255
|
+
}
|
|
256
|
+
const ZOOMS = [
|
|
257
|
+
"quarter",
|
|
258
|
+
"month",
|
|
259
|
+
"week",
|
|
260
|
+
"day"
|
|
261
|
+
];
|
|
262
|
+
const MIN_BAR = 6;
|
|
263
|
+
const SKELETON_ROWS = 5;
|
|
264
|
+
const TODAY_AT = .3;
|
|
265
|
+
const REVEAL_FROM = .8;
|
|
266
|
+
var TxGanttChart = class TxGanttChart {
|
|
267
|
+
locale = inject(TxLocaleService);
|
|
268
|
+
injector = inject(Injector);
|
|
269
|
+
translations = injectTranslations();
|
|
270
|
+
tasks = input([], ...ngDevMode ? [{ debugName: "tasks" }] : /* istanbul ignore next */ []);
|
|
271
|
+
layout = input("tasks", ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
272
|
+
zoom = model("week", ...ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []);
|
|
273
|
+
start = input(void 0, ...ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []);
|
|
274
|
+
end = input(void 0, ...ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []);
|
|
275
|
+
padding = input(3, ...ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []);
|
|
276
|
+
today = input(void 0, ...ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []);
|
|
277
|
+
barLabels = input("auto", ...ngDevMode ? [{ debugName: "barLabels" }] : /* istanbul ignore next */ []);
|
|
278
|
+
toolbar = input(true, {
|
|
279
|
+
...ngDevMode ? { debugName: "toolbar" } : /* istanbul ignore next */ {},
|
|
280
|
+
transform: booleanAttribute
|
|
281
|
+
});
|
|
282
|
+
maxHeight = input("", ...ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
283
|
+
labelHeader = input("", ...ngDevMode ? [{ debugName: "labelHeader" }] : /* istanbul ignore next */ []);
|
|
284
|
+
loading = input(false, {
|
|
285
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
286
|
+
transform: booleanAttribute
|
|
287
|
+
});
|
|
288
|
+
ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
289
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
290
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
291
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
292
|
+
unstyled = input(void 0, {
|
|
293
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
294
|
+
transform: optionalBoolean
|
|
295
|
+
});
|
|
296
|
+
taskClick = output();
|
|
297
|
+
groupToggle = output();
|
|
298
|
+
scroller = viewChild("scroller", ...ngDevMode ? [{ debugName: "scroller" }] : /* istanbul ignore next */ []);
|
|
299
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
300
|
+
passThrough = injectPassThrough("ganttChart", this, this.pt, this.ptOptions);
|
|
301
|
+
hostStyle = computed(() => ({
|
|
302
|
+
...toStyleObject(this.dt(), "--tx-chart"),
|
|
303
|
+
...this.passThrough().root?.style
|
|
304
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
305
|
+
uid = uniqueId("tx-gantt");
|
|
306
|
+
zooms = ZOOMS;
|
|
307
|
+
collapsed = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
|
|
308
|
+
focused = signal(null, ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
309
|
+
now = Date.now();
|
|
310
|
+
skeletonRows = Array.from({ length: SKELETON_ROWS }, (_, index) => index);
|
|
311
|
+
intl = computed(() => this.locale.locale().intl, ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
|
|
312
|
+
list = computed(() => this.tasks() ?? [], ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
|
|
313
|
+
isEmpty = computed(() => !this.list().some((task) => ganttTime(task.start) !== null), ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
314
|
+
dayWidth = computed(() => TX_GANTT_DAY_WIDTH[this.zoom()], ...ngDevMode ? [{ debugName: "dayWidth" }] : /* istanbul ignore next */ []);
|
|
315
|
+
range = computed(() => ganttRange(this.list(), Math.max(0, this.padding()), this.start(), this.end()), ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
|
|
316
|
+
width = computed(() => Math.ceil(ganttX(this.range()[1], this.range()[0], this.dayWidth())), ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
317
|
+
ticks = computed(() => ganttTicks(this.range(), this.zoom(), this.intl()), ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
|
|
318
|
+
rows = computed(() => ganttRows(this.list(), this.layout(), this.collapsed(), this.range()[0], this.dayWidth(), MIN_BAR), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
319
|
+
folds = computed(() => ganttFolds(this.rows()), ...ngDevMode ? [{ debugName: "folds" }] : /* istanbul ignore next */ []);
|
|
320
|
+
spans = computed(() => this.rows().flatMap((row) => row.spans), ...ngDevMode ? [{ debugName: "spans" }] : /* istanbul ignore next */ []);
|
|
321
|
+
openRows = computed(() => this.rows().filter((row) => row.spans.length && !row.collapsed), ...ngDevMode ? [{ debugName: "openRows" }] : /* istanbul ignore next */ []);
|
|
322
|
+
openSpans = computed(() => this.openRows().flatMap((row) => row.spans), ...ngDevMode ? [{ debugName: "openSpans" }] : /* istanbul ignore next */ []);
|
|
323
|
+
labelsInside = computed(() => this.barLabels() === "inside" || this.barLabels() === "auto" && this.layout() === "timeline", ...ngDevMode ? [{ debugName: "labelsInside" }] : /* istanbul ignore next */ []);
|
|
324
|
+
labelsOutside = computed(() => this.barLabels() === "outside" || this.barLabels() === "auto" && this.layout() === "tasks", ...ngDevMode ? [{ debugName: "labelsOutside" }] : /* istanbul ignore next */ []);
|
|
325
|
+
tabStop = computed(() => {
|
|
326
|
+
const spans = this.openSpans();
|
|
327
|
+
const focused = this.focused();
|
|
328
|
+
return spans.some((span) => span.task.id === focused) ? focused : spans[0]?.task.id ?? null;
|
|
329
|
+
}, ...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
|
|
330
|
+
todayTime = computed(() => {
|
|
331
|
+
const today = this.today();
|
|
332
|
+
return today === null ? null : today === void 0 ? this.now : ganttTime(today);
|
|
333
|
+
}, ...ngDevMode ? [{ debugName: "todayTime" }] : /* istanbul ignore next */ []);
|
|
334
|
+
todayX = computed(() => {
|
|
335
|
+
const time = this.todayTime();
|
|
336
|
+
const [from, to] = this.range();
|
|
337
|
+
return time === null || time < from || time > to ? null : ganttX(time, from, this.dayWidth());
|
|
338
|
+
}, ...ngDevMode ? [{ debugName: "todayX" }] : /* istanbul ignore next */ []);
|
|
339
|
+
zoomLabels = computed(() => {
|
|
340
|
+
const t = this.translations();
|
|
341
|
+
return {
|
|
342
|
+
day: t.chartZoomDay,
|
|
343
|
+
week: t.chartZoomWeek,
|
|
344
|
+
month: t.chartZoomMonth,
|
|
345
|
+
quarter: t.chartZoomQuarter
|
|
346
|
+
};
|
|
347
|
+
}, ...ngDevMode ? [{ debugName: "zoomLabels" }] : /* istanbul ignore next */ []);
|
|
348
|
+
dayFormat = computed(() => dateFormat(this.intl(), {
|
|
349
|
+
day: "numeric",
|
|
350
|
+
month: "short",
|
|
351
|
+
year: "numeric"
|
|
352
|
+
}), ...ngDevMode ? [{ debugName: "dayFormat" }] : /* istanbul ignore next */ []);
|
|
353
|
+
text = computed(() => {
|
|
354
|
+
const t = this.translations();
|
|
355
|
+
const format = this.dayFormat();
|
|
356
|
+
return new Map(this.spans().map((span) => {
|
|
357
|
+
const lines = span.task.milestone ? [span.task.label, `${t.chartMilestone}: ${format.format(span.start)}`] : [
|
|
358
|
+
span.task.label,
|
|
359
|
+
`${format.format(span.start)} – ${format.format(span.end - 1)} · ${formatMessage(t.chartDays, { count: ganttDays(span.start, span.end) }, this.intl())}`,
|
|
360
|
+
...span.task.progress !== null && span.task.progress !== void 0 ? [`${t.chartProgress}: ${Math.round(span.task.progress)}%`] : []
|
|
361
|
+
];
|
|
362
|
+
return [span.task.id, lines];
|
|
363
|
+
}));
|
|
364
|
+
}, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
365
|
+
summary = computed(() => {
|
|
366
|
+
const t = this.translations();
|
|
367
|
+
const [from, to] = this.range();
|
|
368
|
+
const format = this.dayFormat();
|
|
369
|
+
const text = `${t.chartGantt}, ${formatMessage(t.chartSummaryTasks, { count: this.spans().length }, this.intl())}, ${format.format(from)} – ${format.format(to - TX_GANTT_DAY)}`;
|
|
370
|
+
return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;
|
|
371
|
+
}, ...ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []);
|
|
372
|
+
constructor() {
|
|
373
|
+
afterNextRender(() => this.revealToday());
|
|
374
|
+
}
|
|
375
|
+
tooltipFor(span) {
|
|
376
|
+
return (this.text().get(span.task.id) ?? [span.task.label]).join("\n");
|
|
377
|
+
}
|
|
378
|
+
ariaFor(span) {
|
|
379
|
+
return (this.text().get(span.task.id) ?? [span.task.label]).join(", ");
|
|
380
|
+
}
|
|
381
|
+
progressOf(span) {
|
|
382
|
+
const progress = span.task.progress;
|
|
383
|
+
return progress === null || progress === void 0 || !Number.isFinite(progress) ? null : Math.max(0, Math.min(100, progress));
|
|
384
|
+
}
|
|
385
|
+
setZoom(zoom, anchor) {
|
|
386
|
+
if (zoom === this.zoom()) return;
|
|
387
|
+
const element = this.scroller()?.nativeElement;
|
|
388
|
+
const keep = anchor ?? (element ? this.centerAnchor(element) : void 0);
|
|
389
|
+
this.zoom.set(zoom);
|
|
390
|
+
if (!keep || !element) return;
|
|
391
|
+
afterNextRender(() => {
|
|
392
|
+
element.scrollLeft = Math.max(0, this.labelWidth(element) + ganttX(keep.time, this.range()[0], this.dayWidth()) - keep.offset);
|
|
393
|
+
}, { injector: this.injector });
|
|
394
|
+
}
|
|
395
|
+
stepZoom(step, anchor) {
|
|
396
|
+
const index = Math.max(0, Math.min(ZOOMS.length - 1, ZOOMS.indexOf(this.zoom()) + step));
|
|
397
|
+
this.setZoom(ZOOMS[index], anchor);
|
|
398
|
+
}
|
|
399
|
+
onWheel(event) {
|
|
400
|
+
if (!(event.ctrlKey || event.metaKey) || !event.deltaY) return;
|
|
401
|
+
event.preventDefault();
|
|
402
|
+
const element = this.scroller()?.nativeElement;
|
|
403
|
+
if (!element) return;
|
|
404
|
+
const offset = event.clientX - element.getBoundingClientRect().left;
|
|
405
|
+
const x = element.scrollLeft + offset - this.labelWidth(element);
|
|
406
|
+
this.stepZoom(event.deltaY < 0 ? 1 : -1, {
|
|
407
|
+
time: this.range()[0] + x / this.dayWidth() * TX_GANTT_DAY,
|
|
408
|
+
offset
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
scrollToToday() {
|
|
412
|
+
const element = this.scroller()?.nativeElement;
|
|
413
|
+
const x = this.todayX();
|
|
414
|
+
if (!element || x === null) return;
|
|
415
|
+
const view = element.clientWidth - this.labelWidth(element);
|
|
416
|
+
element.scrollTo({
|
|
417
|
+
left: Math.max(0, x - view * TODAY_AT),
|
|
418
|
+
behavior: this.reducedMotion() ? "auto" : "smooth"
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
onToggle(group) {
|
|
422
|
+
this.collapsed.update((groups) => toggleKey(groups, group));
|
|
423
|
+
this.groupToggle.emit({
|
|
424
|
+
group,
|
|
425
|
+
collapsed: this.collapsed().has(group)
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
onBarClick(span) {
|
|
429
|
+
this.focused.set(span.task.id);
|
|
430
|
+
this.taskClick.emit({
|
|
431
|
+
task: span.task,
|
|
432
|
+
start: new Date(span.start),
|
|
433
|
+
end: new Date(span.end)
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
onBarFocus(span, element) {
|
|
437
|
+
this.focused.set(span.task.id);
|
|
438
|
+
this.reveal(element);
|
|
439
|
+
}
|
|
440
|
+
onBarKeydown(event, span) {
|
|
441
|
+
if (event.key === "+" || event.key === "=") {
|
|
442
|
+
event.preventDefault();
|
|
443
|
+
this.stepZoom(1);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
if (event.key === "-" || event.key === "_") {
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
this.stepZoom(-1);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const spans = this.openSpans();
|
|
452
|
+
const index = spans.indexOf(span);
|
|
453
|
+
const rows = this.openRows();
|
|
454
|
+
const row = rows.find((item) => item.spans.includes(span));
|
|
455
|
+
let next = -1;
|
|
456
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
457
|
+
const at = rows.indexOf(row) + (event.key === "ArrowDown" ? 1 : -1);
|
|
458
|
+
const target = rows[Math.max(0, Math.min(rows.length - 1, at))];
|
|
459
|
+
next = target ? spans.indexOf(target.spans.reduce((best, item) => Math.abs(item.x - span.x) < Math.abs(best.x - span.x) ? item : best)) : -1;
|
|
460
|
+
} else if (event.key === "ArrowRight" || event.key === "ArrowLeft") next = Math.max(0, Math.min(spans.length - 1, index + (event.key === "ArrowRight" ? 1 : -1)));
|
|
461
|
+
else if (event.key === "Home") next = 0;
|
|
462
|
+
else if (event.key === "End") next = spans.length - 1;
|
|
463
|
+
else return;
|
|
464
|
+
event.preventDefault();
|
|
465
|
+
const target = spans[next];
|
|
466
|
+
if (!target) return;
|
|
467
|
+
this.focused.set(target.task.id);
|
|
468
|
+
afterNextRender(() => this.scroller()?.nativeElement.querySelector(`[data-task="${CSS.escape(target.task.id)}"]`)?.focus(), { injector: this.injector });
|
|
469
|
+
}
|
|
470
|
+
reveal(element) {
|
|
471
|
+
const scroller = this.scroller()?.nativeElement;
|
|
472
|
+
if (!scroller) return;
|
|
473
|
+
const box = scroller.getBoundingClientRect();
|
|
474
|
+
const rect = element.getBoundingClientRect();
|
|
475
|
+
const left = box.left + this.labelWidth(scroller);
|
|
476
|
+
const behavior = this.reducedMotion() ? "auto" : "smooth";
|
|
477
|
+
if (rect.left < left) scroller.scrollBy({
|
|
478
|
+
left: rect.left - left - 16,
|
|
479
|
+
behavior
|
|
480
|
+
});
|
|
481
|
+
else if (rect.right > box.right) scroller.scrollBy({
|
|
482
|
+
left: Math.min(rect.right - box.right + 16, rect.left - left - 16),
|
|
483
|
+
behavior
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
revealToday() {
|
|
487
|
+
const element = this.scroller()?.nativeElement;
|
|
488
|
+
const x = this.todayX();
|
|
489
|
+
if (!element || x === null) return;
|
|
490
|
+
const view = element.clientWidth - this.labelWidth(element);
|
|
491
|
+
if (x > view * REVEAL_FROM) element.scrollLeft = Math.max(0, x - view * TODAY_AT);
|
|
492
|
+
}
|
|
493
|
+
centerAnchor(element) {
|
|
494
|
+
const label = this.labelWidth(element);
|
|
495
|
+
const offset = label + (element.clientWidth - label) / 2;
|
|
496
|
+
return {
|
|
497
|
+
time: this.range()[0] + (element.scrollLeft + offset - label) / this.dayWidth() * TX_GANTT_DAY,
|
|
498
|
+
offset
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
labelWidth(element) {
|
|
502
|
+
return element.querySelector(".tx-gantt-chart__corner")?.offsetWidth ?? 0;
|
|
503
|
+
}
|
|
504
|
+
reducedMotion() {
|
|
505
|
+
return this.scroller()?.nativeElement.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
506
|
+
}
|
|
507
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
508
|
+
minVersion: "12.0.0",
|
|
509
|
+
version: "22.2.3",
|
|
510
|
+
ngImport: i0,
|
|
511
|
+
type: TxGanttChart,
|
|
512
|
+
deps: [],
|
|
513
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
514
|
+
});
|
|
515
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
516
|
+
minVersion: "17.0.0",
|
|
517
|
+
version: "22.2.3",
|
|
518
|
+
type: TxGanttChart,
|
|
519
|
+
isStandalone: true,
|
|
520
|
+
selector: "tx-gantt-chart",
|
|
521
|
+
inputs: {
|
|
522
|
+
tasks: {
|
|
523
|
+
classPropertyName: "tasks",
|
|
524
|
+
publicName: "tasks",
|
|
525
|
+
isSignal: true,
|
|
526
|
+
isRequired: false,
|
|
527
|
+
transformFunction: null
|
|
528
|
+
},
|
|
529
|
+
layout: {
|
|
530
|
+
classPropertyName: "layout",
|
|
531
|
+
publicName: "layout",
|
|
532
|
+
isSignal: true,
|
|
533
|
+
isRequired: false,
|
|
534
|
+
transformFunction: null
|
|
535
|
+
},
|
|
536
|
+
zoom: {
|
|
537
|
+
classPropertyName: "zoom",
|
|
538
|
+
publicName: "zoom",
|
|
539
|
+
isSignal: true,
|
|
540
|
+
isRequired: false,
|
|
541
|
+
transformFunction: null
|
|
542
|
+
},
|
|
543
|
+
start: {
|
|
544
|
+
classPropertyName: "start",
|
|
545
|
+
publicName: "start",
|
|
546
|
+
isSignal: true,
|
|
547
|
+
isRequired: false,
|
|
548
|
+
transformFunction: null
|
|
549
|
+
},
|
|
550
|
+
end: {
|
|
551
|
+
classPropertyName: "end",
|
|
552
|
+
publicName: "end",
|
|
553
|
+
isSignal: true,
|
|
554
|
+
isRequired: false,
|
|
555
|
+
transformFunction: null
|
|
556
|
+
},
|
|
557
|
+
padding: {
|
|
558
|
+
classPropertyName: "padding",
|
|
559
|
+
publicName: "padding",
|
|
560
|
+
isSignal: true,
|
|
561
|
+
isRequired: false,
|
|
562
|
+
transformFunction: null
|
|
563
|
+
},
|
|
564
|
+
today: {
|
|
565
|
+
classPropertyName: "today",
|
|
566
|
+
publicName: "today",
|
|
567
|
+
isSignal: true,
|
|
568
|
+
isRequired: false,
|
|
569
|
+
transformFunction: null
|
|
570
|
+
},
|
|
571
|
+
barLabels: {
|
|
572
|
+
classPropertyName: "barLabels",
|
|
573
|
+
publicName: "barLabels",
|
|
574
|
+
isSignal: true,
|
|
575
|
+
isRequired: false,
|
|
576
|
+
transformFunction: null
|
|
577
|
+
},
|
|
578
|
+
toolbar: {
|
|
579
|
+
classPropertyName: "toolbar",
|
|
580
|
+
publicName: "toolbar",
|
|
581
|
+
isSignal: true,
|
|
582
|
+
isRequired: false,
|
|
583
|
+
transformFunction: null
|
|
584
|
+
},
|
|
585
|
+
maxHeight: {
|
|
586
|
+
classPropertyName: "maxHeight",
|
|
587
|
+
publicName: "maxHeight",
|
|
588
|
+
isSignal: true,
|
|
589
|
+
isRequired: false,
|
|
590
|
+
transformFunction: null
|
|
591
|
+
},
|
|
592
|
+
labelHeader: {
|
|
593
|
+
classPropertyName: "labelHeader",
|
|
594
|
+
publicName: "labelHeader",
|
|
595
|
+
isSignal: true,
|
|
596
|
+
isRequired: false,
|
|
597
|
+
transformFunction: null
|
|
598
|
+
},
|
|
599
|
+
loading: {
|
|
600
|
+
classPropertyName: "loading",
|
|
601
|
+
publicName: "loading",
|
|
602
|
+
isSignal: true,
|
|
603
|
+
isRequired: false,
|
|
604
|
+
transformFunction: null
|
|
605
|
+
},
|
|
606
|
+
ariaLabel: {
|
|
607
|
+
classPropertyName: "ariaLabel",
|
|
608
|
+
publicName: "ariaLabel",
|
|
609
|
+
isSignal: true,
|
|
610
|
+
isRequired: false,
|
|
611
|
+
transformFunction: null
|
|
612
|
+
},
|
|
613
|
+
dt: {
|
|
614
|
+
classPropertyName: "dt",
|
|
615
|
+
publicName: "dt",
|
|
616
|
+
isSignal: true,
|
|
617
|
+
isRequired: false,
|
|
618
|
+
transformFunction: null
|
|
619
|
+
},
|
|
620
|
+
pt: {
|
|
621
|
+
classPropertyName: "pt",
|
|
622
|
+
publicName: "pt",
|
|
623
|
+
isSignal: true,
|
|
624
|
+
isRequired: false,
|
|
625
|
+
transformFunction: null
|
|
626
|
+
},
|
|
627
|
+
ptOptions: {
|
|
628
|
+
classPropertyName: "ptOptions",
|
|
629
|
+
publicName: "ptOptions",
|
|
630
|
+
isSignal: true,
|
|
631
|
+
isRequired: false,
|
|
632
|
+
transformFunction: null
|
|
633
|
+
},
|
|
634
|
+
unstyled: {
|
|
635
|
+
classPropertyName: "unstyled",
|
|
636
|
+
publicName: "unstyled",
|
|
637
|
+
isSignal: true,
|
|
638
|
+
isRequired: false,
|
|
639
|
+
transformFunction: null
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
outputs: {
|
|
643
|
+
zoom: "zoomChange",
|
|
644
|
+
taskClick: "taskClick",
|
|
645
|
+
groupToggle: "groupToggle"
|
|
646
|
+
},
|
|
647
|
+
host: {
|
|
648
|
+
properties: {
|
|
649
|
+
"class": "passThrough().root?.class",
|
|
650
|
+
"style": "hostStyle()",
|
|
651
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
652
|
+
"attr.data-zoom": "zoom()",
|
|
653
|
+
"attr.data-layout": "layout()",
|
|
654
|
+
"attr.aria-busy": "loading() || null"
|
|
655
|
+
},
|
|
656
|
+
classAttribute: "tx-gantt-chart"
|
|
657
|
+
},
|
|
658
|
+
viewQueries: [{
|
|
659
|
+
propertyName: "scroller",
|
|
660
|
+
first: true,
|
|
661
|
+
predicate: ["scroller"],
|
|
662
|
+
descendants: true,
|
|
663
|
+
isSignal: true
|
|
664
|
+
}],
|
|
665
|
+
ngImport: i0,
|
|
666
|
+
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",
|
|
667
|
+
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"],
|
|
668
|
+
dependencies: [
|
|
669
|
+
{
|
|
670
|
+
kind: "component",
|
|
671
|
+
type: TxButton,
|
|
672
|
+
selector: "button[txButton], a[txButton]",
|
|
673
|
+
inputs: [
|
|
674
|
+
"label",
|
|
675
|
+
"severity",
|
|
676
|
+
"size",
|
|
677
|
+
"variant",
|
|
678
|
+
"outlined",
|
|
679
|
+
"text",
|
|
680
|
+
"link",
|
|
681
|
+
"rounded",
|
|
682
|
+
"raised",
|
|
683
|
+
"plain",
|
|
684
|
+
"fluid",
|
|
685
|
+
"disabled",
|
|
686
|
+
"tabindex",
|
|
687
|
+
"icon",
|
|
688
|
+
"iconPos",
|
|
689
|
+
"iconOnly",
|
|
690
|
+
"loading",
|
|
691
|
+
"loadingIcon",
|
|
692
|
+
"badge",
|
|
693
|
+
"badgeSeverity",
|
|
694
|
+
"dt",
|
|
695
|
+
"pt",
|
|
696
|
+
"ptOptions",
|
|
697
|
+
"unstyled"
|
|
698
|
+
]
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
kind: "component",
|
|
702
|
+
type: TxButtonGroup,
|
|
703
|
+
selector: "tx-button-group"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
kind: "directive",
|
|
707
|
+
type: TxTooltip,
|
|
708
|
+
selector: "[txTooltip]",
|
|
709
|
+
inputs: [
|
|
710
|
+
"txTooltip",
|
|
711
|
+
"tooltipPlacement",
|
|
712
|
+
"tooltipEvent",
|
|
713
|
+
"tooltipShowDelay",
|
|
714
|
+
"tooltipHideDelay",
|
|
715
|
+
"tooltipLife",
|
|
716
|
+
"tooltipOffset",
|
|
717
|
+
"tooltipArrow",
|
|
718
|
+
"tooltipInteractive",
|
|
719
|
+
"tooltipDisabled",
|
|
720
|
+
"tooltipOverflowOnly",
|
|
721
|
+
"tooltipMultiline",
|
|
722
|
+
"tooltipContext",
|
|
723
|
+
"tooltipClass",
|
|
724
|
+
"tooltipDt",
|
|
725
|
+
"tooltipPt",
|
|
726
|
+
"tooltipPtOptions",
|
|
727
|
+
"tooltipUnstyled"
|
|
728
|
+
],
|
|
729
|
+
outputs: ["tooltipShown", "tooltipHidden"],
|
|
730
|
+
exportAs: ["txTooltip"]
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
kind: "component",
|
|
734
|
+
type: TxIcon,
|
|
735
|
+
selector: "tx-icon",
|
|
736
|
+
inputs: ["name"]
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
kind: "component",
|
|
740
|
+
type: TxSkeleton,
|
|
741
|
+
selector: "tx-skeleton",
|
|
742
|
+
inputs: [
|
|
743
|
+
"shape",
|
|
744
|
+
"size",
|
|
745
|
+
"width",
|
|
746
|
+
"height",
|
|
747
|
+
"borderRadius",
|
|
748
|
+
"lines",
|
|
749
|
+
"animation",
|
|
750
|
+
"dt",
|
|
751
|
+
"pt",
|
|
752
|
+
"ptOptions",
|
|
753
|
+
"unstyled"
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
761
|
+
minVersion: "12.0.0",
|
|
762
|
+
version: "22.2.3",
|
|
763
|
+
ngImport: i0,
|
|
764
|
+
type: TxGanttChart,
|
|
765
|
+
decorators: [{
|
|
766
|
+
type: Component,
|
|
767
|
+
args: [{
|
|
768
|
+
selector: "tx-gantt-chart",
|
|
769
|
+
imports: [
|
|
770
|
+
TxButton,
|
|
771
|
+
TxButtonGroup,
|
|
772
|
+
TxTooltip,
|
|
773
|
+
TxIcon,
|
|
774
|
+
TxSkeleton
|
|
775
|
+
],
|
|
776
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
777
|
+
host: {
|
|
778
|
+
class: "tx-gantt-chart",
|
|
779
|
+
"[class]": "passThrough().root?.class",
|
|
780
|
+
"[style]": "hostStyle()",
|
|
781
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
782
|
+
"[attr.data-zoom]": "zoom()",
|
|
783
|
+
"[attr.data-layout]": "layout()",
|
|
784
|
+
"[attr.aria-busy]": "loading() || null"
|
|
785
|
+
},
|
|
786
|
+
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",
|
|
787
|
+
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"]
|
|
788
|
+
}]
|
|
789
|
+
}],
|
|
790
|
+
ctorParameters: () => [],
|
|
791
|
+
propDecorators: {
|
|
792
|
+
tasks: [{
|
|
793
|
+
type: i0.Input,
|
|
794
|
+
args: [{
|
|
795
|
+
isSignal: true,
|
|
796
|
+
alias: "tasks",
|
|
797
|
+
required: false
|
|
798
|
+
}]
|
|
799
|
+
}],
|
|
800
|
+
layout: [{
|
|
801
|
+
type: i0.Input,
|
|
802
|
+
args: [{
|
|
803
|
+
isSignal: true,
|
|
804
|
+
alias: "layout",
|
|
805
|
+
required: false
|
|
806
|
+
}]
|
|
807
|
+
}],
|
|
808
|
+
zoom: [{
|
|
809
|
+
type: i0.Input,
|
|
810
|
+
args: [{
|
|
811
|
+
isSignal: true,
|
|
812
|
+
alias: "zoom",
|
|
813
|
+
required: false
|
|
814
|
+
}]
|
|
815
|
+
}, {
|
|
816
|
+
type: i0.Output,
|
|
817
|
+
args: ["zoomChange"]
|
|
818
|
+
}],
|
|
819
|
+
start: [{
|
|
820
|
+
type: i0.Input,
|
|
821
|
+
args: [{
|
|
822
|
+
isSignal: true,
|
|
823
|
+
alias: "start",
|
|
824
|
+
required: false
|
|
825
|
+
}]
|
|
826
|
+
}],
|
|
827
|
+
end: [{
|
|
828
|
+
type: i0.Input,
|
|
829
|
+
args: [{
|
|
830
|
+
isSignal: true,
|
|
831
|
+
alias: "end",
|
|
832
|
+
required: false
|
|
833
|
+
}]
|
|
834
|
+
}],
|
|
835
|
+
padding: [{
|
|
836
|
+
type: i0.Input,
|
|
837
|
+
args: [{
|
|
838
|
+
isSignal: true,
|
|
839
|
+
alias: "padding",
|
|
840
|
+
required: false
|
|
841
|
+
}]
|
|
842
|
+
}],
|
|
843
|
+
today: [{
|
|
844
|
+
type: i0.Input,
|
|
845
|
+
args: [{
|
|
846
|
+
isSignal: true,
|
|
847
|
+
alias: "today",
|
|
848
|
+
required: false
|
|
849
|
+
}]
|
|
850
|
+
}],
|
|
851
|
+
barLabels: [{
|
|
852
|
+
type: i0.Input,
|
|
853
|
+
args: [{
|
|
854
|
+
isSignal: true,
|
|
855
|
+
alias: "barLabels",
|
|
856
|
+
required: false
|
|
857
|
+
}]
|
|
858
|
+
}],
|
|
859
|
+
toolbar: [{
|
|
860
|
+
type: i0.Input,
|
|
861
|
+
args: [{
|
|
862
|
+
isSignal: true,
|
|
863
|
+
alias: "toolbar",
|
|
864
|
+
required: false
|
|
865
|
+
}]
|
|
866
|
+
}],
|
|
867
|
+
maxHeight: [{
|
|
868
|
+
type: i0.Input,
|
|
869
|
+
args: [{
|
|
870
|
+
isSignal: true,
|
|
871
|
+
alias: "maxHeight",
|
|
872
|
+
required: false
|
|
873
|
+
}]
|
|
874
|
+
}],
|
|
875
|
+
labelHeader: [{
|
|
876
|
+
type: i0.Input,
|
|
877
|
+
args: [{
|
|
878
|
+
isSignal: true,
|
|
879
|
+
alias: "labelHeader",
|
|
880
|
+
required: false
|
|
881
|
+
}]
|
|
882
|
+
}],
|
|
883
|
+
loading: [{
|
|
884
|
+
type: i0.Input,
|
|
885
|
+
args: [{
|
|
886
|
+
isSignal: true,
|
|
887
|
+
alias: "loading",
|
|
888
|
+
required: false
|
|
889
|
+
}]
|
|
890
|
+
}],
|
|
891
|
+
ariaLabel: [{
|
|
892
|
+
type: i0.Input,
|
|
893
|
+
args: [{
|
|
894
|
+
isSignal: true,
|
|
895
|
+
alias: "ariaLabel",
|
|
896
|
+
required: false
|
|
897
|
+
}]
|
|
898
|
+
}],
|
|
899
|
+
dt: [{
|
|
900
|
+
type: i0.Input,
|
|
901
|
+
args: [{
|
|
902
|
+
isSignal: true,
|
|
903
|
+
alias: "dt",
|
|
904
|
+
required: false
|
|
905
|
+
}]
|
|
906
|
+
}],
|
|
907
|
+
pt: [{
|
|
908
|
+
type: i0.Input,
|
|
909
|
+
args: [{
|
|
910
|
+
isSignal: true,
|
|
911
|
+
alias: "pt",
|
|
912
|
+
required: false
|
|
913
|
+
}]
|
|
914
|
+
}],
|
|
915
|
+
ptOptions: [{
|
|
916
|
+
type: i0.Input,
|
|
917
|
+
args: [{
|
|
918
|
+
isSignal: true,
|
|
919
|
+
alias: "ptOptions",
|
|
920
|
+
required: false
|
|
921
|
+
}]
|
|
922
|
+
}],
|
|
923
|
+
unstyled: [{
|
|
924
|
+
type: i0.Input,
|
|
925
|
+
args: [{
|
|
926
|
+
isSignal: true,
|
|
927
|
+
alias: "unstyled",
|
|
928
|
+
required: false
|
|
929
|
+
}]
|
|
930
|
+
}],
|
|
931
|
+
taskClick: [{
|
|
932
|
+
type: i0.Output,
|
|
933
|
+
args: ["taskClick"]
|
|
934
|
+
}],
|
|
935
|
+
groupToggle: [{
|
|
936
|
+
type: i0.Output,
|
|
937
|
+
args: ["groupToggle"]
|
|
938
|
+
}],
|
|
939
|
+
scroller: [{
|
|
940
|
+
type: i0.ViewChild,
|
|
941
|
+
args: ["scroller", { isSignal: true }]
|
|
942
|
+
}]
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
export { TX_GANTT_DAY, TX_GANTT_DAY_WIDTH, TxGanttChart, ganttDays, ganttFolds, ganttRange, ganttRows, ganttTaskRange, ganttTicks, ganttTime, ganttX, startOfDay };
|
|
946
|
+
|
|
947
|
+
//# sourceMappingURL=tectra-ng-charts-gantt.mjs.map
|