@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,2341 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injector, TemplateRef, ViewEncapsulation, afterNextRender, booleanAttribute, computed, contentChild, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { TxLocaleService, formatMessage, injectTranslations } from "@tectra-ng/core/i18n";
|
|
5
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
7
|
+
import { TxAvatar } from "@tectra-ng/ui/avatar";
|
|
8
|
+
import { TxButton } from "@tectra-ng/ui/button";
|
|
9
|
+
import { TxPill } from "@tectra-ng/ui/pill";
|
|
10
|
+
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
11
|
+
import { TxSkeleton } from "@tectra-ng/ui/skeleton";
|
|
12
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
13
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
14
|
+
import { TxChartMenu } from "@tectra-ng/charts/core";
|
|
15
|
+
import { TxIconField, TxInputIcon } from "@tectra-ng/ui/icon-field";
|
|
16
|
+
import { TxInput } from "@tectra-ng/ui/input";
|
|
17
|
+
import { TxPopover, TxPopoverTrigger } from "@tectra-ng/ui/popover";
|
|
18
|
+
const TX_ORG_CHART_CONNECTOR_GAP = 24;
|
|
19
|
+
function orgChartChildren(node) {
|
|
20
|
+
const nodes = node.children ?? [];
|
|
21
|
+
const emptyText = node.childrenEmptyText ?? "";
|
|
22
|
+
if (node.collapsible && !node.expanded) return {
|
|
23
|
+
kind: "none",
|
|
24
|
+
nodes: [],
|
|
25
|
+
emptyText
|
|
26
|
+
};
|
|
27
|
+
if (node.loading) return {
|
|
28
|
+
kind: "loading",
|
|
29
|
+
nodes: [],
|
|
30
|
+
emptyText
|
|
31
|
+
};
|
|
32
|
+
if (nodes.length) return {
|
|
33
|
+
kind: "nodes",
|
|
34
|
+
nodes,
|
|
35
|
+
emptyText
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
kind: emptyText ? "empty" : "none",
|
|
39
|
+
nodes: [],
|
|
40
|
+
emptyText
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function collapsibleNodes(nodes) {
|
|
44
|
+
return nodes.flatMap((node) => [...node.collapsible ? [node] : [], ...collapsibleNodes(node.children ?? [])]);
|
|
45
|
+
}
|
|
46
|
+
function orgChartExpandState(nodes) {
|
|
47
|
+
const collapsible = collapsibleNodes(nodes);
|
|
48
|
+
const expanded = collapsible.filter((node) => node.expanded).length;
|
|
49
|
+
return {
|
|
50
|
+
hasCollapsible: collapsible.length > 0,
|
|
51
|
+
allExpanded: collapsible.length > 0 && expanded === collapsible.length,
|
|
52
|
+
noneExpanded: expanded === 0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function orgChartPathLine(rects, gap = 24, radius = 0, offset = 0, inset = 0) {
|
|
56
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
57
|
+
return rects.slice(1).map((child, index) => {
|
|
58
|
+
const parent = rects[index];
|
|
59
|
+
const fromX = round(parent.x + parent.width / 2 + offset);
|
|
60
|
+
const toX = round(child.x + child.width / 2 + offset);
|
|
61
|
+
const fromY = round(parent.y + parent.height + inset);
|
|
62
|
+
const toY = round(child.y - inset);
|
|
63
|
+
const turnY = round(child.y - gap + offset);
|
|
64
|
+
const dx = toX - fromX;
|
|
65
|
+
const r = Math.max(0, Math.min(radius, Math.abs(dx) / 2, (turnY - fromY) / 2, (toY - turnY) / 2));
|
|
66
|
+
if (!dx || !r) return `M ${fromX} ${fromY} V ${turnY} H ${toX} V ${toY}`;
|
|
67
|
+
const sign = Math.sign(dx);
|
|
68
|
+
const sweep = sign > 0 ? 0 : 1;
|
|
69
|
+
return [
|
|
70
|
+
`M ${fromX} ${fromY}`,
|
|
71
|
+
`V ${round(turnY - r)}`,
|
|
72
|
+
`A ${r} ${r} 0 0 ${sweep} ${round(fromX + sign * r)} ${turnY}`,
|
|
73
|
+
`H ${round(toX - sign * r)}`,
|
|
74
|
+
`A ${r} ${r} 0 0 ${1 - sweep} ${toX} ${round(turnY + r)}`,
|
|
75
|
+
`V ${toY}`
|
|
76
|
+
].join(" ");
|
|
77
|
+
}).join(" ");
|
|
78
|
+
}
|
|
79
|
+
function orgChartToggle(nodes, id, expanded) {
|
|
80
|
+
return nodes.map((node) => {
|
|
81
|
+
if (node.id === id) return {
|
|
82
|
+
...node,
|
|
83
|
+
expanded: expanded ?? !node.expanded
|
|
84
|
+
};
|
|
85
|
+
return node.children?.length ? {
|
|
86
|
+
...node,
|
|
87
|
+
children: orgChartToggle(node.children, id, expanded)
|
|
88
|
+
} : node;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function orgChartExpandAll(nodes, expanded) {
|
|
92
|
+
return nodes.map((node) => ({
|
|
93
|
+
...node,
|
|
94
|
+
...node.collapsible ? { expanded } : {},
|
|
95
|
+
...node.children?.length ? { children: orgChartExpandAll(node.children, expanded) } : {}
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
function orgChartSearch(nodes, query) {
|
|
99
|
+
const needle = query.trim().toLocaleLowerCase();
|
|
100
|
+
if (!needle) return [];
|
|
101
|
+
return nodes.flatMap((node) => [...[node.title, node.subtitle ?? ""].some((text) => text.toLocaleLowerCase().includes(needle)) ? [node.id] : [], ...orgChartSearch(node.children ?? [], query)]);
|
|
102
|
+
}
|
|
103
|
+
function orgChartPathTo(nodes, id) {
|
|
104
|
+
for (const node of nodes) {
|
|
105
|
+
if (node.id === id) return [node.id];
|
|
106
|
+
const inner = orgChartPathTo(node.children ?? [], id);
|
|
107
|
+
if (inner.length) return [node.id, ...inner];
|
|
108
|
+
}
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
function orgChartReveal(nodes, ids) {
|
|
112
|
+
const open = /* @__PURE__ */ new Set();
|
|
113
|
+
for (const id of ids) orgChartPathTo(nodes, id).slice(0, -1).forEach((ancestor) => open.add(ancestor));
|
|
114
|
+
const walk = (list) => list.map((node) => ({
|
|
115
|
+
...node,
|
|
116
|
+
...open.has(node.id) && node.collapsible ? { expanded: true } : {},
|
|
117
|
+
...node.children?.length ? { children: walk(node.children) } : {}
|
|
118
|
+
}));
|
|
119
|
+
return open.size ? walk(nodes) : [...nodes];
|
|
120
|
+
}
|
|
121
|
+
const TX_ORG_CHART_ZOOM = {
|
|
122
|
+
min: .2,
|
|
123
|
+
max: 2,
|
|
124
|
+
step: 1.2,
|
|
125
|
+
initial: 1
|
|
126
|
+
};
|
|
127
|
+
const TX_ORG_CHART_FOCUS_ZOOM = 1.25;
|
|
128
|
+
const TX_ORG_CHART_WHEEL_SPEED = .0015;
|
|
129
|
+
const TX_ORG_CHART_WHEEL_MAX_DELTA = 120;
|
|
130
|
+
const TX_ORG_CHART_PADDING = 40;
|
|
131
|
+
const TX_ORG_CHART_MINIMAP = {
|
|
132
|
+
width: 240,
|
|
133
|
+
height: 170,
|
|
134
|
+
minHeight: 56
|
|
135
|
+
};
|
|
136
|
+
const TX_ORG_CHART_MINIMAP_COMPACT = {
|
|
137
|
+
width: 140,
|
|
138
|
+
height: 100,
|
|
139
|
+
minHeight: 40
|
|
140
|
+
};
|
|
141
|
+
const TX_ORG_CHART_COMPACT_WIDTH = 480;
|
|
142
|
+
function clampZoom(zoom) {
|
|
143
|
+
return Math.min(TX_ORG_CHART_ZOOM.max, Math.max(TX_ORG_CHART_ZOOM.min, zoom));
|
|
144
|
+
}
|
|
145
|
+
function zoomAt(view, zoom, at) {
|
|
146
|
+
const next = clampZoom(zoom);
|
|
147
|
+
const ratio = next / view.zoom;
|
|
148
|
+
return {
|
|
149
|
+
zoom: next,
|
|
150
|
+
x: at.x - (at.x - view.x) * ratio,
|
|
151
|
+
y: at.y - (at.y - view.y) * ratio
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function centerOn(view, viewport, point, zoom = view.zoom) {
|
|
155
|
+
const next = clampZoom(zoom);
|
|
156
|
+
return {
|
|
157
|
+
zoom: next,
|
|
158
|
+
x: viewport.width / 2 - point.x * next,
|
|
159
|
+
y: viewport.height / 2 - point.y * next
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function fitView(viewport, stage, top = 0) {
|
|
163
|
+
if (!viewport.width || !stage.width || !stage.height) return null;
|
|
164
|
+
const zoom = Math.max(TX_ORG_CHART_ZOOM.min, Math.min(TX_ORG_CHART_ZOOM.initial, (viewport.width - 80) / stage.width, (viewport.height - top - 80) / stage.height));
|
|
165
|
+
return {
|
|
166
|
+
zoom,
|
|
167
|
+
x: (viewport.width - stage.width * zoom) / 2,
|
|
168
|
+
y: top + Math.max(0, (viewport.height - top - stage.height * zoom) / 2)
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function wheelIsMouse(event) {
|
|
172
|
+
return event.deltaMode !== 0 || event.deltaX === 0 && Number.isInteger(event.deltaY) && Math.abs(event.deltaY) >= 40;
|
|
173
|
+
}
|
|
174
|
+
function wheelZoom(zoom, deltaY, pinch) {
|
|
175
|
+
return zoom * Math.exp(-Math.max(-120, Math.min(120, deltaY)) * TX_ORG_CHART_WHEEL_SPEED * (pinch ? 4 : 1));
|
|
176
|
+
}
|
|
177
|
+
const TX_ORG_CHART_KEEP_VISIBLE = 64;
|
|
178
|
+
function boundView(view, viewport, stage, keep = 64) {
|
|
179
|
+
if (!viewport.width || !stage.width) return view;
|
|
180
|
+
const width = stage.width * view.zoom;
|
|
181
|
+
const height = stage.height * view.zoom;
|
|
182
|
+
const keepX = Math.min(keep, width, viewport.width);
|
|
183
|
+
const keepY = Math.min(keep, height, viewport.height);
|
|
184
|
+
return {
|
|
185
|
+
zoom: view.zoom,
|
|
186
|
+
x: Math.min(viewport.width - keepX, Math.max(keepX - width, view.x)),
|
|
187
|
+
y: Math.min(viewport.height - keepY, Math.max(keepY - height, view.y))
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
var TxOrgChartNodeTemplate = class TxOrgChartNodeTemplate {
|
|
191
|
+
template = inject(TemplateRef);
|
|
192
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
193
|
+
return !!context;
|
|
194
|
+
}
|
|
195
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
196
|
+
minVersion: "12.0.0",
|
|
197
|
+
version: "22.2.3",
|
|
198
|
+
ngImport: i0,
|
|
199
|
+
type: TxOrgChartNodeTemplate,
|
|
200
|
+
deps: [],
|
|
201
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
202
|
+
});
|
|
203
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
204
|
+
minVersion: "14.0.0",
|
|
205
|
+
version: "22.2.3",
|
|
206
|
+
type: TxOrgChartNodeTemplate,
|
|
207
|
+
isStandalone: true,
|
|
208
|
+
selector: "ng-template[txOrgChartNode]",
|
|
209
|
+
ngImport: i0
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
213
|
+
minVersion: "12.0.0",
|
|
214
|
+
version: "22.2.3",
|
|
215
|
+
ngImport: i0,
|
|
216
|
+
type: TxOrgChartNodeTemplate,
|
|
217
|
+
decorators: [{
|
|
218
|
+
type: Directive,
|
|
219
|
+
args: [{ selector: "ng-template[txOrgChartNode]" }]
|
|
220
|
+
}]
|
|
221
|
+
});
|
|
222
|
+
var TxOrgChartCard = class TxOrgChartCard {
|
|
223
|
+
translations = injectTranslations();
|
|
224
|
+
node = input.required(...ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []);
|
|
225
|
+
highlighted = input(false, {
|
|
226
|
+
...ngDevMode ? { debugName: "highlighted" } : /* istanbul ignore next */ {},
|
|
227
|
+
transform: booleanAttribute
|
|
228
|
+
});
|
|
229
|
+
inPath = input(false, {
|
|
230
|
+
...ngDevMode ? { debugName: "inPath" } : /* istanbul ignore next */ {},
|
|
231
|
+
transform: booleanAttribute
|
|
232
|
+
});
|
|
233
|
+
expandLabel = input(void 0, ...ngDevMode ? [{ debugName: "expandLabel" }] : /* istanbul ignore next */ []);
|
|
234
|
+
collapseLabel = input(void 0, ...ngDevMode ? [{ debugName: "collapseLabel" }] : /* istanbul ignore next */ []);
|
|
235
|
+
unstyled = input(void 0, {
|
|
236
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
237
|
+
transform: optionalBoolean
|
|
238
|
+
});
|
|
239
|
+
toggleNode = output();
|
|
240
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
241
|
+
toggleLabel = computed(() => this.node().expanded ? this.collapseLabel() ?? this.translations().orgChartCollapse : this.expandLabel() ?? this.translations().orgChartExpand, ...ngDevMode ? [{ debugName: "toggleLabel" }] : /* istanbul ignore next */ []);
|
|
242
|
+
onToggle(event) {
|
|
243
|
+
event.stopPropagation();
|
|
244
|
+
this.toggleNode.emit();
|
|
245
|
+
}
|
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
247
|
+
minVersion: "12.0.0",
|
|
248
|
+
version: "22.2.3",
|
|
249
|
+
ngImport: i0,
|
|
250
|
+
type: TxOrgChartCard,
|
|
251
|
+
deps: [],
|
|
252
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
253
|
+
});
|
|
254
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
255
|
+
minVersion: "17.0.0",
|
|
256
|
+
version: "22.2.3",
|
|
257
|
+
type: TxOrgChartCard,
|
|
258
|
+
isStandalone: true,
|
|
259
|
+
selector: "tx-org-chart-card",
|
|
260
|
+
inputs: {
|
|
261
|
+
node: {
|
|
262
|
+
classPropertyName: "node",
|
|
263
|
+
publicName: "node",
|
|
264
|
+
isSignal: true,
|
|
265
|
+
isRequired: true,
|
|
266
|
+
transformFunction: null
|
|
267
|
+
},
|
|
268
|
+
highlighted: {
|
|
269
|
+
classPropertyName: "highlighted",
|
|
270
|
+
publicName: "highlighted",
|
|
271
|
+
isSignal: true,
|
|
272
|
+
isRequired: false,
|
|
273
|
+
transformFunction: null
|
|
274
|
+
},
|
|
275
|
+
inPath: {
|
|
276
|
+
classPropertyName: "inPath",
|
|
277
|
+
publicName: "inPath",
|
|
278
|
+
isSignal: true,
|
|
279
|
+
isRequired: false,
|
|
280
|
+
transformFunction: null
|
|
281
|
+
},
|
|
282
|
+
expandLabel: {
|
|
283
|
+
classPropertyName: "expandLabel",
|
|
284
|
+
publicName: "expandLabel",
|
|
285
|
+
isSignal: true,
|
|
286
|
+
isRequired: false,
|
|
287
|
+
transformFunction: null
|
|
288
|
+
},
|
|
289
|
+
collapseLabel: {
|
|
290
|
+
classPropertyName: "collapseLabel",
|
|
291
|
+
publicName: "collapseLabel",
|
|
292
|
+
isSignal: true,
|
|
293
|
+
isRequired: false,
|
|
294
|
+
transformFunction: null
|
|
295
|
+
},
|
|
296
|
+
unstyled: {
|
|
297
|
+
classPropertyName: "unstyled",
|
|
298
|
+
publicName: "unstyled",
|
|
299
|
+
isSignal: true,
|
|
300
|
+
isRequired: false,
|
|
301
|
+
transformFunction: null
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
outputs: { toggleNode: "toggleNode" },
|
|
305
|
+
host: {
|
|
306
|
+
properties: { "attr.data-styled": "!isUnstyled() || null" },
|
|
307
|
+
classAttribute: "tx-org-chart-card"
|
|
308
|
+
},
|
|
309
|
+
ngImport: i0,
|
|
310
|
+
template: "@let current = node();\n<div\n class=\"tx-org-chart-card__box\"\n [class.tx-org-chart-card__box--match]=\"highlighted()\"\n [class.tx-org-chart-card__box--path]=\"inPath()\"\n [class.tx-org-chart-card__box--open]=\"current.collapsible && current.expanded\"\n [attr.title]=\"current.title\"\n>\n @if (current.avatar; as avatar) {\n <tx-avatar class=\"tx-org-chart-card__avatar\" [image]=\"avatar.src\" [name]=\"avatar.name ?? current.title\" shape=\"circle\" />\n } @else if (current.icon) {\n <span class=\"tx-org-chart-card__icon\" aria-hidden=\"true\"><tx-icon [name]=\"current.icon\" /></span>\n }\n <div class=\"tx-org-chart-card__heading\">\n <span class=\"tx-org-chart-card__title\">{{ current.title }}</span>\n @if (current.subtitle) {\n <span class=\"tx-org-chart-card__subtitle\">{{ current.subtitle }}</span>\n }\n @if (current.pills?.length) {\n <div class=\"tx-org-chart-card__pills\">\n @for (pill of current.pills; track $index) {\n <tx-pill [tone]=\"pill.tone ?? 'neutral'\" size=\"small\" [icon]=\"pill.icon\">{{ pill.label }}</tx-pill>\n }\n </div>\n }\n </div>\n @if (current.collapsible) {\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart-card__toggle\"\n size=\"small\"\n severity=\"secondary\"\n text\n [icon]=\"current.expanded ? 'chevron-up' : 'chevron-down'\"\n [loading]=\"!!current.loading\"\n [txTooltip]=\"toggleLabel()\"\n [attr.aria-label]=\"toggleLabel()\"\n [attr.aria-expanded]=\"!!current.expanded\"\n (click)=\"onToggle($event)\"\n ></button>\n }\n</div>\n",
|
|
311
|
+
styles: [":host{display:block}.tx-org-chart-card__box{display:flex;align-items:center}.tx-org-chart-card__heading{display:flex;flex:1;flex-direction:column;min-width:0}.tx-org-chart-card__title,.tx-org-chart-card__subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-org-chart-card__pills{display:flex;flex-wrap:wrap;align-items:center}.tx-org-chart-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center}.tx-org-chart-card__avatar{flex-shrink:0}:host([data-styled]) .tx-org-chart-card__box{gap:var(--tx-chart-org-chart-card-gap);box-sizing:border-box;width:var(--tx-chart-org-chart-card-width);padding:var(--tx-chart-org-chart-card-padding-y) var(--tx-chart-org-chart-card-padding-x);border-radius:var(--tx-chart-org-chart-card-radius);background:var(--tx-chart-org-chart-card-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-border-color);transition:box-shadow var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-org-chart-card__box--open{box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-open-border-color)}:host([data-styled]) .tx-org-chart-card__box--match{background:var(--tx-chart-org-chart-card-match-background);box-shadow:0 0 0 2px var(--tx-chart-org-chart-card-match-border-color)}:host([data-styled]) .tx-org-chart-card__box--path{box-shadow:0 0 0 var(--tx-chart-org-chart-path-width) var(--tx-chart-org-chart-path-color),0 6px 18px -8px color-mix(in srgb,var(--tx-chart-org-chart-path-color) var(--tx-chart-org-chart-card-path-glow),transparent)}:host([data-styled]) .tx-org-chart-card__icon{width:var(--tx-chart-org-chart-icon-size);height:var(--tx-chart-org-chart-icon-size);border-radius:var(--tx-chart-org-chart-icon-radius);color:var(--tx-chart-org-chart-icon-color);font-size:var(--tx-chart-org-chart-icon-font-size);background:var(--tx-chart-org-chart-icon-background)}:host([data-styled]) .tx-org-chart-card__avatar{--tx-avatar-size: var(--tx-chart-org-chart-avatar-size)}:host([data-styled]) .tx-org-chart-card__heading{gap:var(--tx-chart-org-chart-heading-gap)}:host([data-styled]) .tx-org-chart-card__title{color:var(--tx-chart-org-chart-title-color);font-size:var(--tx-chart-org-chart-title-font-size);font-weight:var(--tx-chart-org-chart-title-font-weight)}:host([data-styled]) .tx-org-chart-card__subtitle{color:var(--tx-chart-org-chart-subtitle-color);font-size:var(--tx-chart-org-chart-subtitle-font-size)}:host([data-styled]) .tx-org-chart-card__pills{gap:var(--tx-chart-org-chart-pills-gap);margin-top:var(--tx-chart-org-chart-pills-gap)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-org-chart-card__box{transition:none}}\n"],
|
|
312
|
+
dependencies: [
|
|
313
|
+
{
|
|
314
|
+
kind: "component",
|
|
315
|
+
type: TxAvatar,
|
|
316
|
+
selector: "tx-avatar",
|
|
317
|
+
inputs: [
|
|
318
|
+
"image",
|
|
319
|
+
"name",
|
|
320
|
+
"label",
|
|
321
|
+
"icon",
|
|
322
|
+
"size",
|
|
323
|
+
"shape",
|
|
324
|
+
"tone",
|
|
325
|
+
"ariaLabel",
|
|
326
|
+
"tooltip",
|
|
327
|
+
"dt",
|
|
328
|
+
"pt",
|
|
329
|
+
"ptOptions",
|
|
330
|
+
"unstyled"
|
|
331
|
+
],
|
|
332
|
+
outputs: ["imageError"]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
kind: "component",
|
|
336
|
+
type: TxButton,
|
|
337
|
+
selector: "button[txButton], a[txButton]",
|
|
338
|
+
inputs: [
|
|
339
|
+
"label",
|
|
340
|
+
"severity",
|
|
341
|
+
"size",
|
|
342
|
+
"variant",
|
|
343
|
+
"outlined",
|
|
344
|
+
"text",
|
|
345
|
+
"link",
|
|
346
|
+
"rounded",
|
|
347
|
+
"raised",
|
|
348
|
+
"plain",
|
|
349
|
+
"fluid",
|
|
350
|
+
"disabled",
|
|
351
|
+
"tabindex",
|
|
352
|
+
"icon",
|
|
353
|
+
"iconPos",
|
|
354
|
+
"iconOnly",
|
|
355
|
+
"loading",
|
|
356
|
+
"loadingIcon",
|
|
357
|
+
"badge",
|
|
358
|
+
"badgeSeverity",
|
|
359
|
+
"dt",
|
|
360
|
+
"pt",
|
|
361
|
+
"ptOptions",
|
|
362
|
+
"unstyled"
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
kind: "component",
|
|
367
|
+
type: TxIcon,
|
|
368
|
+
selector: "tx-icon",
|
|
369
|
+
inputs: ["name"]
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
kind: "component",
|
|
373
|
+
type: TxPill,
|
|
374
|
+
selector: "tx-pill",
|
|
375
|
+
inputs: [
|
|
376
|
+
"value",
|
|
377
|
+
"tone",
|
|
378
|
+
"variant",
|
|
379
|
+
"size",
|
|
380
|
+
"icon",
|
|
381
|
+
"dot",
|
|
382
|
+
"removable",
|
|
383
|
+
"removeLabel",
|
|
384
|
+
"dt",
|
|
385
|
+
"pt",
|
|
386
|
+
"ptOptions",
|
|
387
|
+
"unstyled"
|
|
388
|
+
],
|
|
389
|
+
outputs: ["removed"]
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
kind: "directive",
|
|
393
|
+
type: TxTooltip,
|
|
394
|
+
selector: "[txTooltip]",
|
|
395
|
+
inputs: [
|
|
396
|
+
"txTooltip",
|
|
397
|
+
"tooltipPlacement",
|
|
398
|
+
"tooltipEvent",
|
|
399
|
+
"tooltipShowDelay",
|
|
400
|
+
"tooltipHideDelay",
|
|
401
|
+
"tooltipLife",
|
|
402
|
+
"tooltipOffset",
|
|
403
|
+
"tooltipArrow",
|
|
404
|
+
"tooltipInteractive",
|
|
405
|
+
"tooltipDisabled",
|
|
406
|
+
"tooltipOverflowOnly",
|
|
407
|
+
"tooltipMultiline",
|
|
408
|
+
"tooltipContext",
|
|
409
|
+
"tooltipClass",
|
|
410
|
+
"tooltipDt",
|
|
411
|
+
"tooltipPt",
|
|
412
|
+
"tooltipPtOptions",
|
|
413
|
+
"tooltipUnstyled"
|
|
414
|
+
],
|
|
415
|
+
outputs: ["tooltipShown", "tooltipHidden"],
|
|
416
|
+
exportAs: ["txTooltip"]
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
423
|
+
minVersion: "12.0.0",
|
|
424
|
+
version: "22.2.3",
|
|
425
|
+
ngImport: i0,
|
|
426
|
+
type: TxOrgChartCard,
|
|
427
|
+
decorators: [{
|
|
428
|
+
type: Component,
|
|
429
|
+
args: [{
|
|
430
|
+
selector: "tx-org-chart-card",
|
|
431
|
+
imports: [
|
|
432
|
+
TxAvatar,
|
|
433
|
+
TxButton,
|
|
434
|
+
TxIcon,
|
|
435
|
+
TxPill,
|
|
436
|
+
TxTooltip
|
|
437
|
+
],
|
|
438
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
439
|
+
host: {
|
|
440
|
+
class: "tx-org-chart-card",
|
|
441
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
442
|
+
},
|
|
443
|
+
template: "@let current = node();\n<div\n class=\"tx-org-chart-card__box\"\n [class.tx-org-chart-card__box--match]=\"highlighted()\"\n [class.tx-org-chart-card__box--path]=\"inPath()\"\n [class.tx-org-chart-card__box--open]=\"current.collapsible && current.expanded\"\n [attr.title]=\"current.title\"\n>\n @if (current.avatar; as avatar) {\n <tx-avatar class=\"tx-org-chart-card__avatar\" [image]=\"avatar.src\" [name]=\"avatar.name ?? current.title\" shape=\"circle\" />\n } @else if (current.icon) {\n <span class=\"tx-org-chart-card__icon\" aria-hidden=\"true\"><tx-icon [name]=\"current.icon\" /></span>\n }\n <div class=\"tx-org-chart-card__heading\">\n <span class=\"tx-org-chart-card__title\">{{ current.title }}</span>\n @if (current.subtitle) {\n <span class=\"tx-org-chart-card__subtitle\">{{ current.subtitle }}</span>\n }\n @if (current.pills?.length) {\n <div class=\"tx-org-chart-card__pills\">\n @for (pill of current.pills; track $index) {\n <tx-pill [tone]=\"pill.tone ?? 'neutral'\" size=\"small\" [icon]=\"pill.icon\">{{ pill.label }}</tx-pill>\n }\n </div>\n }\n </div>\n @if (current.collapsible) {\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart-card__toggle\"\n size=\"small\"\n severity=\"secondary\"\n text\n [icon]=\"current.expanded ? 'chevron-up' : 'chevron-down'\"\n [loading]=\"!!current.loading\"\n [txTooltip]=\"toggleLabel()\"\n [attr.aria-label]=\"toggleLabel()\"\n [attr.aria-expanded]=\"!!current.expanded\"\n (click)=\"onToggle($event)\"\n ></button>\n }\n</div>\n",
|
|
444
|
+
styles: [":host{display:block}.tx-org-chart-card__box{display:flex;align-items:center}.tx-org-chart-card__heading{display:flex;flex:1;flex-direction:column;min-width:0}.tx-org-chart-card__title,.tx-org-chart-card__subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-org-chart-card__pills{display:flex;flex-wrap:wrap;align-items:center}.tx-org-chart-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center}.tx-org-chart-card__avatar{flex-shrink:0}:host([data-styled]) .tx-org-chart-card__box{gap:var(--tx-chart-org-chart-card-gap);box-sizing:border-box;width:var(--tx-chart-org-chart-card-width);padding:var(--tx-chart-org-chart-card-padding-y) var(--tx-chart-org-chart-card-padding-x);border-radius:var(--tx-chart-org-chart-card-radius);background:var(--tx-chart-org-chart-card-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-border-color);transition:box-shadow var(--tx-chart-motion-hover-duration) ease,background-color var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-org-chart-card__box--open{box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-open-border-color)}:host([data-styled]) .tx-org-chart-card__box--match{background:var(--tx-chart-org-chart-card-match-background);box-shadow:0 0 0 2px var(--tx-chart-org-chart-card-match-border-color)}:host([data-styled]) .tx-org-chart-card__box--path{box-shadow:0 0 0 var(--tx-chart-org-chart-path-width) var(--tx-chart-org-chart-path-color),0 6px 18px -8px color-mix(in srgb,var(--tx-chart-org-chart-path-color) var(--tx-chart-org-chart-card-path-glow),transparent)}:host([data-styled]) .tx-org-chart-card__icon{width:var(--tx-chart-org-chart-icon-size);height:var(--tx-chart-org-chart-icon-size);border-radius:var(--tx-chart-org-chart-icon-radius);color:var(--tx-chart-org-chart-icon-color);font-size:var(--tx-chart-org-chart-icon-font-size);background:var(--tx-chart-org-chart-icon-background)}:host([data-styled]) .tx-org-chart-card__avatar{--tx-avatar-size: var(--tx-chart-org-chart-avatar-size)}:host([data-styled]) .tx-org-chart-card__heading{gap:var(--tx-chart-org-chart-heading-gap)}:host([data-styled]) .tx-org-chart-card__title{color:var(--tx-chart-org-chart-title-color);font-size:var(--tx-chart-org-chart-title-font-size);font-weight:var(--tx-chart-org-chart-title-font-weight)}:host([data-styled]) .tx-org-chart-card__subtitle{color:var(--tx-chart-org-chart-subtitle-color);font-size:var(--tx-chart-org-chart-subtitle-font-size)}:host([data-styled]) .tx-org-chart-card__pills{gap:var(--tx-chart-org-chart-pills-gap);margin-top:var(--tx-chart-org-chart-pills-gap)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-org-chart-card__box{transition:none}}\n"]
|
|
445
|
+
}]
|
|
446
|
+
}],
|
|
447
|
+
propDecorators: {
|
|
448
|
+
node: [{
|
|
449
|
+
type: i0.Input,
|
|
450
|
+
args: [{
|
|
451
|
+
isSignal: true,
|
|
452
|
+
alias: "node",
|
|
453
|
+
required: true
|
|
454
|
+
}]
|
|
455
|
+
}],
|
|
456
|
+
highlighted: [{
|
|
457
|
+
type: i0.Input,
|
|
458
|
+
args: [{
|
|
459
|
+
isSignal: true,
|
|
460
|
+
alias: "highlighted",
|
|
461
|
+
required: false
|
|
462
|
+
}]
|
|
463
|
+
}],
|
|
464
|
+
inPath: [{
|
|
465
|
+
type: i0.Input,
|
|
466
|
+
args: [{
|
|
467
|
+
isSignal: true,
|
|
468
|
+
alias: "inPath",
|
|
469
|
+
required: false
|
|
470
|
+
}]
|
|
471
|
+
}],
|
|
472
|
+
expandLabel: [{
|
|
473
|
+
type: i0.Input,
|
|
474
|
+
args: [{
|
|
475
|
+
isSignal: true,
|
|
476
|
+
alias: "expandLabel",
|
|
477
|
+
required: false
|
|
478
|
+
}]
|
|
479
|
+
}],
|
|
480
|
+
collapseLabel: [{
|
|
481
|
+
type: i0.Input,
|
|
482
|
+
args: [{
|
|
483
|
+
isSignal: true,
|
|
484
|
+
alias: "collapseLabel",
|
|
485
|
+
required: false
|
|
486
|
+
}]
|
|
487
|
+
}],
|
|
488
|
+
unstyled: [{
|
|
489
|
+
type: i0.Input,
|
|
490
|
+
args: [{
|
|
491
|
+
isSignal: true,
|
|
492
|
+
alias: "unstyled",
|
|
493
|
+
required: false
|
|
494
|
+
}]
|
|
495
|
+
}],
|
|
496
|
+
toggleNode: [{
|
|
497
|
+
type: i0.Output,
|
|
498
|
+
args: ["toggleNode"]
|
|
499
|
+
}]
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
var TxOrgChartNodeSkeleton = class TxOrgChartNodeSkeleton {
|
|
503
|
+
unstyled = input(void 0, {
|
|
504
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
505
|
+
transform: optionalBoolean
|
|
506
|
+
});
|
|
507
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
509
|
+
minVersion: "12.0.0",
|
|
510
|
+
version: "22.2.3",
|
|
511
|
+
ngImport: i0,
|
|
512
|
+
type: TxOrgChartNodeSkeleton,
|
|
513
|
+
deps: [],
|
|
514
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
515
|
+
});
|
|
516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
517
|
+
minVersion: "17.1.0",
|
|
518
|
+
version: "22.2.3",
|
|
519
|
+
type: TxOrgChartNodeSkeleton,
|
|
520
|
+
isStandalone: true,
|
|
521
|
+
selector: "tx-org-chart-node-skeleton",
|
|
522
|
+
inputs: { unstyled: {
|
|
523
|
+
classPropertyName: "unstyled",
|
|
524
|
+
publicName: "unstyled",
|
|
525
|
+
isSignal: true,
|
|
526
|
+
isRequired: false,
|
|
527
|
+
transformFunction: null
|
|
528
|
+
} },
|
|
529
|
+
host: {
|
|
530
|
+
properties: { "attr.data-styled": "!isUnstyled() || null" },
|
|
531
|
+
classAttribute: "tx-org-chart-node-skeleton"
|
|
532
|
+
},
|
|
533
|
+
ngImport: i0,
|
|
534
|
+
template: `
|
|
535
|
+
<div class="tx-org-chart-node-skeleton__box" aria-hidden="true">
|
|
536
|
+
<tx-skeleton shape="circle" size="var(--tx-chart-org-chart-avatar-size)" />
|
|
537
|
+
<div class="tx-org-chart-node-skeleton__lines">
|
|
538
|
+
<tx-skeleton width="98px" height="10.5px" borderRadius="999px" />
|
|
539
|
+
<tx-skeleton width="70px" height="8.75px" borderRadius="999px" />
|
|
540
|
+
</div>
|
|
541
|
+
</div>
|
|
542
|
+
`,
|
|
543
|
+
isInline: true,
|
|
544
|
+
styles: [".tx-org-chart-node-skeleton__box{display:flex;align-items:center}.tx-org-chart-node-skeleton__lines{display:flex;flex:1;flex-direction:column}:host([data-styled]) .tx-org-chart-node-skeleton__box{gap:var(--tx-chart-org-chart-card-gap);box-sizing:border-box;width:var(--tx-chart-org-chart-card-width);padding:var(--tx-chart-org-chart-card-padding-y);border-radius:var(--tx-chart-org-chart-card-radius);background:var(--tx-chart-org-chart-card-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-border-color)}:host([data-styled]) .tx-org-chart-node-skeleton__lines{gap:var(--tx-chart-org-chart-toolbar-gap)}\n"],
|
|
545
|
+
dependencies: [{
|
|
546
|
+
kind: "component",
|
|
547
|
+
type: TxSkeleton,
|
|
548
|
+
selector: "tx-skeleton",
|
|
549
|
+
inputs: [
|
|
550
|
+
"shape",
|
|
551
|
+
"size",
|
|
552
|
+
"width",
|
|
553
|
+
"height",
|
|
554
|
+
"borderRadius",
|
|
555
|
+
"lines",
|
|
556
|
+
"animation",
|
|
557
|
+
"dt",
|
|
558
|
+
"pt",
|
|
559
|
+
"ptOptions",
|
|
560
|
+
"unstyled"
|
|
561
|
+
]
|
|
562
|
+
}],
|
|
563
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
567
|
+
minVersion: "12.0.0",
|
|
568
|
+
version: "22.2.3",
|
|
569
|
+
ngImport: i0,
|
|
570
|
+
type: TxOrgChartNodeSkeleton,
|
|
571
|
+
decorators: [{
|
|
572
|
+
type: Component,
|
|
573
|
+
args: [{
|
|
574
|
+
selector: "tx-org-chart-node-skeleton",
|
|
575
|
+
imports: [TxSkeleton],
|
|
576
|
+
template: `
|
|
577
|
+
<div class="tx-org-chart-node-skeleton__box" aria-hidden="true">
|
|
578
|
+
<tx-skeleton shape="circle" size="var(--tx-chart-org-chart-avatar-size)" />
|
|
579
|
+
<div class="tx-org-chart-node-skeleton__lines">
|
|
580
|
+
<tx-skeleton width="98px" height="10.5px" borderRadius="999px" />
|
|
581
|
+
<tx-skeleton width="70px" height="8.75px" borderRadius="999px" />
|
|
582
|
+
</div>
|
|
583
|
+
</div>
|
|
584
|
+
`,
|
|
585
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
586
|
+
host: {
|
|
587
|
+
class: "tx-org-chart-node-skeleton",
|
|
588
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
589
|
+
},
|
|
590
|
+
styles: [".tx-org-chart-node-skeleton__box{display:flex;align-items:center}.tx-org-chart-node-skeleton__lines{display:flex;flex:1;flex-direction:column}:host([data-styled]) .tx-org-chart-node-skeleton__box{gap:var(--tx-chart-org-chart-card-gap);box-sizing:border-box;width:var(--tx-chart-org-chart-card-width);padding:var(--tx-chart-org-chart-card-padding-y);border-radius:var(--tx-chart-org-chart-card-radius);background:var(--tx-chart-org-chart-card-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-card-border-color)}:host([data-styled]) .tx-org-chart-node-skeleton__lines{gap:var(--tx-chart-org-chart-toolbar-gap)}\n"]
|
|
591
|
+
}]
|
|
592
|
+
}],
|
|
593
|
+
propDecorators: { unstyled: [{
|
|
594
|
+
type: i0.Input,
|
|
595
|
+
args: [{
|
|
596
|
+
isSignal: true,
|
|
597
|
+
alias: "unstyled",
|
|
598
|
+
required: false
|
|
599
|
+
}]
|
|
600
|
+
}] }
|
|
601
|
+
});
|
|
602
|
+
var TxOrgChartMinimap = class TxOrgChartMinimap {
|
|
603
|
+
layout = input.required(...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
604
|
+
viewport = input.required(...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
605
|
+
view = input.required(...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
606
|
+
navigate = output();
|
|
607
|
+
pointerId = null;
|
|
608
|
+
box = computed(() => this.viewport().width && this.viewport().width < 480 ? TX_ORG_CHART_MINIMAP_COMPACT : TX_ORG_CHART_MINIMAP, ...ngDevMode ? [{ debugName: "box" }] : /* istanbul ignore next */ []);
|
|
609
|
+
scale = computed(() => {
|
|
610
|
+
const layout = this.layout();
|
|
611
|
+
if (!layout.width || !layout.height) return 0;
|
|
612
|
+
return Math.min(this.box().width / layout.width, this.box().height / layout.height);
|
|
613
|
+
}, ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
|
|
614
|
+
mapWidth = computed(() => this.layout().width * this.scale(), ...ngDevMode ? [{ debugName: "mapWidth" }] : /* istanbul ignore next */ []);
|
|
615
|
+
mapHeight = computed(() => Math.max(this.box().minHeight, this.layout().height * this.scale()), ...ngDevMode ? [{ debugName: "mapHeight" }] : /* istanbul ignore next */ []);
|
|
616
|
+
offsetY = computed(() => (this.mapHeight() - this.layout().height * this.scale()) / 2, ...ngDevMode ? [{ debugName: "offsetY" }] : /* istanbul ignore next */ []);
|
|
617
|
+
viewportRect = computed(() => {
|
|
618
|
+
const scale = this.scale();
|
|
619
|
+
const { x, y, zoom } = this.view();
|
|
620
|
+
const viewport = this.viewport();
|
|
621
|
+
const left = -x / zoom * scale;
|
|
622
|
+
const top = -y / zoom * scale + this.offsetY();
|
|
623
|
+
const right = left + viewport.width / zoom * scale;
|
|
624
|
+
const bottom = top + viewport.height / zoom * scale;
|
|
625
|
+
const clampX = (value) => Math.min(this.mapWidth(), Math.max(0, value));
|
|
626
|
+
const clampY = (value) => Math.min(this.mapHeight(), Math.max(0, value));
|
|
627
|
+
return {
|
|
628
|
+
x: clampX(left),
|
|
629
|
+
y: clampY(top),
|
|
630
|
+
width: Math.max(0, clampX(right) - clampX(left)),
|
|
631
|
+
height: Math.max(0, clampY(bottom) - clampY(top))
|
|
632
|
+
};
|
|
633
|
+
}, ...ngDevMode ? [{ debugName: "viewportRect" }] : /* istanbul ignore next */ []);
|
|
634
|
+
onPointerDown(event) {
|
|
635
|
+
this.pointerId = event.pointerId;
|
|
636
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
637
|
+
this.emitPoint(event);
|
|
638
|
+
}
|
|
639
|
+
onPointerMove(event) {
|
|
640
|
+
if (this.pointerId === event.pointerId) this.emitPoint(event);
|
|
641
|
+
}
|
|
642
|
+
onPointerUp(event) {
|
|
643
|
+
if (this.pointerId !== event.pointerId) return;
|
|
644
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
645
|
+
this.pointerId = null;
|
|
646
|
+
}
|
|
647
|
+
emitPoint(event) {
|
|
648
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
649
|
+
const scale = this.scale();
|
|
650
|
+
this.navigate.emit({
|
|
651
|
+
x: (event.clientX - rect.left) / scale,
|
|
652
|
+
y: (event.clientY - rect.top - this.offsetY()) / scale
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
656
|
+
minVersion: "12.0.0",
|
|
657
|
+
version: "22.2.3",
|
|
658
|
+
ngImport: i0,
|
|
659
|
+
type: TxOrgChartMinimap,
|
|
660
|
+
deps: [],
|
|
661
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
662
|
+
});
|
|
663
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
664
|
+
minVersion: "17.0.0",
|
|
665
|
+
version: "22.2.3",
|
|
666
|
+
type: TxOrgChartMinimap,
|
|
667
|
+
isStandalone: true,
|
|
668
|
+
selector: "tx-org-chart-minimap",
|
|
669
|
+
inputs: {
|
|
670
|
+
layout: {
|
|
671
|
+
classPropertyName: "layout",
|
|
672
|
+
publicName: "layout",
|
|
673
|
+
isSignal: true,
|
|
674
|
+
isRequired: true,
|
|
675
|
+
transformFunction: null
|
|
676
|
+
},
|
|
677
|
+
viewport: {
|
|
678
|
+
classPropertyName: "viewport",
|
|
679
|
+
publicName: "viewport",
|
|
680
|
+
isSignal: true,
|
|
681
|
+
isRequired: true,
|
|
682
|
+
transformFunction: null
|
|
683
|
+
},
|
|
684
|
+
view: {
|
|
685
|
+
classPropertyName: "view",
|
|
686
|
+
publicName: "view",
|
|
687
|
+
isSignal: true,
|
|
688
|
+
isRequired: true,
|
|
689
|
+
transformFunction: null
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
outputs: { navigate: "navigate" },
|
|
693
|
+
host: {
|
|
694
|
+
attributes: {
|
|
695
|
+
"data-drag-ignore": "",
|
|
696
|
+
"aria-hidden": "true"
|
|
697
|
+
},
|
|
698
|
+
classAttribute: "tx-org-chart-minimap"
|
|
699
|
+
},
|
|
700
|
+
ngImport: i0,
|
|
701
|
+
template: `
|
|
702
|
+
@if (scale()) {
|
|
703
|
+
<div
|
|
704
|
+
class="tx-org-chart__map"
|
|
705
|
+
[style.width.px]="mapWidth()"
|
|
706
|
+
[style.height.px]="mapHeight()"
|
|
707
|
+
(pointerdown)="onPointerDown($event)"
|
|
708
|
+
(pointermove)="onPointerMove($event)"
|
|
709
|
+
(pointerup)="onPointerUp($event)"
|
|
710
|
+
(pointercancel)="onPointerUp($event)"
|
|
711
|
+
>
|
|
712
|
+
@for (item of layout().items; track $index) {
|
|
713
|
+
<span
|
|
714
|
+
class="tx-org-chart__map-item"
|
|
715
|
+
[attr.data-tone]="item.tone"
|
|
716
|
+
[style.left.px]="item.x * scale()"
|
|
717
|
+
[style.top.px]="item.y * scale() + offsetY()"
|
|
718
|
+
[style.width.px]="item.width * scale()"
|
|
719
|
+
[style.height.px]="item.height * scale()"
|
|
720
|
+
></span>
|
|
721
|
+
}
|
|
722
|
+
@let rect = viewportRect();
|
|
723
|
+
@if (rect.width >= 4 && rect.height >= 4) {
|
|
724
|
+
<span
|
|
725
|
+
class="tx-org-chart__map-viewport"
|
|
726
|
+
[style.left.px]="rect.x"
|
|
727
|
+
[style.top.px]="rect.y"
|
|
728
|
+
[style.width.px]="rect.width"
|
|
729
|
+
[style.height.px]="rect.height"
|
|
730
|
+
></span>
|
|
731
|
+
}
|
|
732
|
+
</div>
|
|
733
|
+
}
|
|
734
|
+
`,
|
|
735
|
+
isInline: true,
|
|
736
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
737
|
+
});
|
|
738
|
+
};
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
740
|
+
minVersion: "12.0.0",
|
|
741
|
+
version: "22.2.3",
|
|
742
|
+
ngImport: i0,
|
|
743
|
+
type: TxOrgChartMinimap,
|
|
744
|
+
decorators: [{
|
|
745
|
+
type: Component,
|
|
746
|
+
args: [{
|
|
747
|
+
selector: "tx-org-chart-minimap",
|
|
748
|
+
template: `
|
|
749
|
+
@if (scale()) {
|
|
750
|
+
<div
|
|
751
|
+
class="tx-org-chart__map"
|
|
752
|
+
[style.width.px]="mapWidth()"
|
|
753
|
+
[style.height.px]="mapHeight()"
|
|
754
|
+
(pointerdown)="onPointerDown($event)"
|
|
755
|
+
(pointermove)="onPointerMove($event)"
|
|
756
|
+
(pointerup)="onPointerUp($event)"
|
|
757
|
+
(pointercancel)="onPointerUp($event)"
|
|
758
|
+
>
|
|
759
|
+
@for (item of layout().items; track $index) {
|
|
760
|
+
<span
|
|
761
|
+
class="tx-org-chart__map-item"
|
|
762
|
+
[attr.data-tone]="item.tone"
|
|
763
|
+
[style.left.px]="item.x * scale()"
|
|
764
|
+
[style.top.px]="item.y * scale() + offsetY()"
|
|
765
|
+
[style.width.px]="item.width * scale()"
|
|
766
|
+
[style.height.px]="item.height * scale()"
|
|
767
|
+
></span>
|
|
768
|
+
}
|
|
769
|
+
@let rect = viewportRect();
|
|
770
|
+
@if (rect.width >= 4 && rect.height >= 4) {
|
|
771
|
+
<span
|
|
772
|
+
class="tx-org-chart__map-viewport"
|
|
773
|
+
[style.left.px]="rect.x"
|
|
774
|
+
[style.top.px]="rect.y"
|
|
775
|
+
[style.width.px]="rect.width"
|
|
776
|
+
[style.height.px]="rect.height"
|
|
777
|
+
></span>
|
|
778
|
+
}
|
|
779
|
+
</div>
|
|
780
|
+
}
|
|
781
|
+
`,
|
|
782
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
783
|
+
host: {
|
|
784
|
+
class: "tx-org-chart-minimap",
|
|
785
|
+
"data-drag-ignore": "",
|
|
786
|
+
"aria-hidden": "true"
|
|
787
|
+
}
|
|
788
|
+
}]
|
|
789
|
+
}],
|
|
790
|
+
propDecorators: {
|
|
791
|
+
layout: [{
|
|
792
|
+
type: i0.Input,
|
|
793
|
+
args: [{
|
|
794
|
+
isSignal: true,
|
|
795
|
+
alias: "layout",
|
|
796
|
+
required: true
|
|
797
|
+
}]
|
|
798
|
+
}],
|
|
799
|
+
viewport: [{
|
|
800
|
+
type: i0.Input,
|
|
801
|
+
args: [{
|
|
802
|
+
isSignal: true,
|
|
803
|
+
alias: "viewport",
|
|
804
|
+
required: true
|
|
805
|
+
}]
|
|
806
|
+
}],
|
|
807
|
+
view: [{
|
|
808
|
+
type: i0.Input,
|
|
809
|
+
args: [{
|
|
810
|
+
isSignal: true,
|
|
811
|
+
alias: "view",
|
|
812
|
+
required: true
|
|
813
|
+
}]
|
|
814
|
+
}],
|
|
815
|
+
navigate: [{
|
|
816
|
+
type: i0.Output,
|
|
817
|
+
args: ["navigate"]
|
|
818
|
+
}]
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
var TxOrgChartNodeView = class TxOrgChartNodeView {
|
|
822
|
+
node = input.required(...ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []);
|
|
823
|
+
state = input.required(...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
824
|
+
template = input(null, ...ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []);
|
|
825
|
+
root = input(false, {
|
|
826
|
+
...ngDevMode ? { debugName: "root" } : /* istanbul ignore next */ {},
|
|
827
|
+
transform: booleanAttribute
|
|
828
|
+
});
|
|
829
|
+
path = input([], ...ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []);
|
|
830
|
+
toggleNode = output();
|
|
831
|
+
hoverPath = output();
|
|
832
|
+
nodeClick = output();
|
|
833
|
+
childPath = computed(() => [...this.path(), this.node().id], ...ngDevMode ? [{ debugName: "childPath" }] : /* istanbul ignore next */ []);
|
|
834
|
+
children = computed(() => orgChartChildren(this.node()), ...ngDevMode ? [{ debugName: "children" }] : /* istanbul ignore next */ []);
|
|
835
|
+
hasHoverPath = computed(() => {
|
|
836
|
+
const kinds = this.state().pathKinds;
|
|
837
|
+
return !kinds || kinds.includes(this.node().kind ?? "");
|
|
838
|
+
}, ...ngDevMode ? [{ debugName: "hasHoverPath" }] : /* istanbul ignore next */ []);
|
|
839
|
+
context = computed(() => {
|
|
840
|
+
const node = this.node();
|
|
841
|
+
const state = this.state();
|
|
842
|
+
return {
|
|
843
|
+
$implicit: node,
|
|
844
|
+
node,
|
|
845
|
+
highlighted: state.highlightIds.has(node.id),
|
|
846
|
+
inPath: state.pathIds.has(node.id),
|
|
847
|
+
toggle: () => this.toggleNode.emit(node.id)
|
|
848
|
+
};
|
|
849
|
+
}, ...ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []);
|
|
850
|
+
onKey(event) {
|
|
851
|
+
if (event.target !== event.currentTarget) return;
|
|
852
|
+
event.preventDefault();
|
|
853
|
+
this.nodeClick.emit(this.node());
|
|
854
|
+
}
|
|
855
|
+
onHover(entering) {
|
|
856
|
+
if (this.hasHoverPath()) this.hoverPath.emit(entering ? this.childPath() : null);
|
|
857
|
+
}
|
|
858
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
859
|
+
minVersion: "12.0.0",
|
|
860
|
+
version: "22.2.3",
|
|
861
|
+
ngImport: i0,
|
|
862
|
+
type: TxOrgChartNodeView,
|
|
863
|
+
deps: [],
|
|
864
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
865
|
+
});
|
|
866
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
867
|
+
minVersion: "17.0.0",
|
|
868
|
+
version: "22.2.3",
|
|
869
|
+
type: TxOrgChartNodeView,
|
|
870
|
+
isStandalone: true,
|
|
871
|
+
selector: "tx-org-chart-node",
|
|
872
|
+
inputs: {
|
|
873
|
+
node: {
|
|
874
|
+
classPropertyName: "node",
|
|
875
|
+
publicName: "node",
|
|
876
|
+
isSignal: true,
|
|
877
|
+
isRequired: true,
|
|
878
|
+
transformFunction: null
|
|
879
|
+
},
|
|
880
|
+
state: {
|
|
881
|
+
classPropertyName: "state",
|
|
882
|
+
publicName: "state",
|
|
883
|
+
isSignal: true,
|
|
884
|
+
isRequired: true,
|
|
885
|
+
transformFunction: null
|
|
886
|
+
},
|
|
887
|
+
template: {
|
|
888
|
+
classPropertyName: "template",
|
|
889
|
+
publicName: "template",
|
|
890
|
+
isSignal: true,
|
|
891
|
+
isRequired: false,
|
|
892
|
+
transformFunction: null
|
|
893
|
+
},
|
|
894
|
+
root: {
|
|
895
|
+
classPropertyName: "root",
|
|
896
|
+
publicName: "root",
|
|
897
|
+
isSignal: true,
|
|
898
|
+
isRequired: false,
|
|
899
|
+
transformFunction: null
|
|
900
|
+
},
|
|
901
|
+
path: {
|
|
902
|
+
classPropertyName: "path",
|
|
903
|
+
publicName: "path",
|
|
904
|
+
isSignal: true,
|
|
905
|
+
isRequired: false,
|
|
906
|
+
transformFunction: null
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
outputs: {
|
|
910
|
+
toggleNode: "toggleNode",
|
|
911
|
+
hoverPath: "hoverPath",
|
|
912
|
+
nodeClick: "nodeClick"
|
|
913
|
+
},
|
|
914
|
+
host: {
|
|
915
|
+
attributes: { "role": "listitem" },
|
|
916
|
+
properties: {
|
|
917
|
+
"attr.data-styled": "!state().unstyled || null",
|
|
918
|
+
"class.tx-org-chart-node--root": "root()"
|
|
919
|
+
},
|
|
920
|
+
classAttribute: "tx-org-chart-node"
|
|
921
|
+
},
|
|
922
|
+
ngImport: i0,
|
|
923
|
+
template: "@let current = node();\n@let tree = state();\n<div\n class=\"tx-org-chart-node__card\"\n [attr.data-org-id]=\"current.id\"\n [attr.data-org-tone]=\"current.minimapTone ?? 'default'\"\n tabindex=\"0\"\n (mouseenter)=\"onHover(true)\"\n (mouseleave)=\"onHover(false)\"\n (focusin)=\"onHover(true)\"\n (focusout)=\"onHover(false)\"\n (click)=\"nodeClick.emit(current)\"\n (keydown.enter)=\"onKey($event)\"\n (keydown.space)=\"onKey($event)\"\n>\n @if (template(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom\" [ngTemplateOutletContext]=\"context()\" />\n } @else {\n <tx-org-chart-card\n [node]=\"current\"\n [highlighted]=\"tree.highlightIds.has(current.id)\"\n [inPath]=\"tree.pathIds.has(current.id)\"\n [expandLabel]=\"tree.labels.expand\"\n [collapseLabel]=\"tree.labels.collapse\"\n [unstyled]=\"tree.unstyled\"\n (toggleNode)=\"toggleNode.emit(current.id)\"\n />\n }\n</div>\n@switch (children().kind) {\n @case ('nodes') {\n <div class=\"tx-org-chart-node__children\" role=\"list\">\n @for (child of children().nodes; track child.id) {\n <tx-org-chart-node\n [node]=\"child\"\n [state]=\"tree\"\n [template]=\"template()\"\n [path]=\"childPath()\"\n (toggleNode)=\"toggleNode.emit($event)\"\n (hoverPath)=\"hoverPath.emit($event)\"\n (nodeClick)=\"nodeClick.emit($event)\"\n />\n }\n </div>\n }\n @case ('loading') {\n <div class=\"tx-org-chart-node__children\">\n <tx-org-chart-node-skeleton [unstyled]=\"tree.unstyled\" />\n </div>\n }\n @case ('empty') {\n <div class=\"tx-org-chart-node__children\">\n <span class=\"tx-org-chart-node__empty\">{{ children().emptyText }}</span>\n </div>\n }\n}\n",
|
|
924
|
+
styles: [":host{position:relative;display:flex;flex-direction:column;align-items:center}.tx-org-chart-node__card{position:relative;z-index:1;display:flex;justify-content:center;outline:none}.tx-org-chart-node__children{position:relative;display:flex;justify-content:center}:host([data-styled]){padding:var(--tx-chart-org-chart-connector-height) var(--tx-chart-org-chart-node-padding-x) 0}:host([data-styled]):before,:host([data-styled]):after{content:\"\";position:absolute;top:0;box-sizing:border-box;width:50%;height:var(--tx-chart-org-chart-connector-height);border-top:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]):before{right:50%}:host([data-styled]):after{left:50%;border-left:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]) .tx-org-chart-node__children{padding-top:var(--tx-chart-org-chart-connector-height)}:host([data-styled]) .tx-org-chart-node__children:before{content:\"\";position:absolute;top:0;left:50%;height:var(--tx-chart-org-chart-connector-height);border-left:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]) .tx-org-chart-node__empty{padding:var(--tx-chart-org-chart-empty-padding);border:1px dashed var(--tx-chart-org-chart-connector-color);border-radius:var(--tx-chart-org-chart-connector-radius);color:var(--tx-chart-org-chart-empty-color);font-size:var(--tx-chart-org-chart-empty-font-size);background:var(--tx-chart-org-chart-empty-background)}:host([data-styled]:only-child){padding-top:0}:host([data-styled]:only-child):before,:host([data-styled]:only-child):after{display:none}:host([data-styled]:first-child):before,:host([data-styled]:last-child):after{border:0}:host([data-styled]:last-child):before{border-right:1px solid var(--tx-chart-org-chart-connector-color);border-top-right-radius:var(--tx-chart-org-chart-connector-radius)}:host([data-styled]:first-child):after{border-top-left-radius:var(--tx-chart-org-chart-connector-radius)}:host([data-styled].tx-org-chart-node--root){padding:0}:host([data-styled].tx-org-chart-node--root):before,:host([data-styled].tx-org-chart-node--root):after{display:none}:host([data-styled])>.tx-org-chart-node__card:focus-visible{border-radius:var(--tx-chart-org-chart-card-radius);box-shadow:0 0 0 var(--tx-chart-focus-ring-width) var(--tx-chart-focus-ring-color)}\n"],
|
|
925
|
+
dependencies: [
|
|
926
|
+
{
|
|
927
|
+
kind: "component",
|
|
928
|
+
type: TxOrgChartNodeView,
|
|
929
|
+
selector: "tx-org-chart-node",
|
|
930
|
+
inputs: [
|
|
931
|
+
"node",
|
|
932
|
+
"state",
|
|
933
|
+
"template",
|
|
934
|
+
"root",
|
|
935
|
+
"path"
|
|
936
|
+
],
|
|
937
|
+
outputs: [
|
|
938
|
+
"toggleNode",
|
|
939
|
+
"hoverPath",
|
|
940
|
+
"nodeClick"
|
|
941
|
+
]
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
kind: "directive",
|
|
945
|
+
type: NgTemplateOutlet,
|
|
946
|
+
selector: "[ngTemplateOutlet]",
|
|
947
|
+
inputs: [
|
|
948
|
+
"ngTemplateOutletContext",
|
|
949
|
+
"ngTemplateOutlet",
|
|
950
|
+
"ngTemplateOutletInjector"
|
|
951
|
+
]
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
kind: "component",
|
|
955
|
+
type: TxOrgChartCard,
|
|
956
|
+
selector: "tx-org-chart-card",
|
|
957
|
+
inputs: [
|
|
958
|
+
"node",
|
|
959
|
+
"highlighted",
|
|
960
|
+
"inPath",
|
|
961
|
+
"expandLabel",
|
|
962
|
+
"collapseLabel",
|
|
963
|
+
"unstyled"
|
|
964
|
+
],
|
|
965
|
+
outputs: ["toggleNode"]
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
kind: "component",
|
|
969
|
+
type: TxOrgChartNodeSkeleton,
|
|
970
|
+
selector: "tx-org-chart-node-skeleton",
|
|
971
|
+
inputs: ["unstyled"]
|
|
972
|
+
}
|
|
973
|
+
],
|
|
974
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
975
|
+
});
|
|
976
|
+
};
|
|
977
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
978
|
+
minVersion: "12.0.0",
|
|
979
|
+
version: "22.2.3",
|
|
980
|
+
ngImport: i0,
|
|
981
|
+
type: TxOrgChartNodeView,
|
|
982
|
+
decorators: [{
|
|
983
|
+
type: Component,
|
|
984
|
+
args: [{
|
|
985
|
+
selector: "tx-org-chart-node",
|
|
986
|
+
imports: [
|
|
987
|
+
NgTemplateOutlet,
|
|
988
|
+
TxOrgChartCard,
|
|
989
|
+
TxOrgChartNodeSkeleton
|
|
990
|
+
],
|
|
991
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
992
|
+
host: {
|
|
993
|
+
class: "tx-org-chart-node",
|
|
994
|
+
"[attr.data-styled]": "!state().unstyled || null",
|
|
995
|
+
"[class.tx-org-chart-node--root]": "root()",
|
|
996
|
+
role: "listitem"
|
|
997
|
+
},
|
|
998
|
+
template: "@let current = node();\n@let tree = state();\n<div\n class=\"tx-org-chart-node__card\"\n [attr.data-org-id]=\"current.id\"\n [attr.data-org-tone]=\"current.minimapTone ?? 'default'\"\n tabindex=\"0\"\n (mouseenter)=\"onHover(true)\"\n (mouseleave)=\"onHover(false)\"\n (focusin)=\"onHover(true)\"\n (focusout)=\"onHover(false)\"\n (click)=\"nodeClick.emit(current)\"\n (keydown.enter)=\"onKey($event)\"\n (keydown.space)=\"onKey($event)\"\n>\n @if (template(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom\" [ngTemplateOutletContext]=\"context()\" />\n } @else {\n <tx-org-chart-card\n [node]=\"current\"\n [highlighted]=\"tree.highlightIds.has(current.id)\"\n [inPath]=\"tree.pathIds.has(current.id)\"\n [expandLabel]=\"tree.labels.expand\"\n [collapseLabel]=\"tree.labels.collapse\"\n [unstyled]=\"tree.unstyled\"\n (toggleNode)=\"toggleNode.emit(current.id)\"\n />\n }\n</div>\n@switch (children().kind) {\n @case ('nodes') {\n <div class=\"tx-org-chart-node__children\" role=\"list\">\n @for (child of children().nodes; track child.id) {\n <tx-org-chart-node\n [node]=\"child\"\n [state]=\"tree\"\n [template]=\"template()\"\n [path]=\"childPath()\"\n (toggleNode)=\"toggleNode.emit($event)\"\n (hoverPath)=\"hoverPath.emit($event)\"\n (nodeClick)=\"nodeClick.emit($event)\"\n />\n }\n </div>\n }\n @case ('loading') {\n <div class=\"tx-org-chart-node__children\">\n <tx-org-chart-node-skeleton [unstyled]=\"tree.unstyled\" />\n </div>\n }\n @case ('empty') {\n <div class=\"tx-org-chart-node__children\">\n <span class=\"tx-org-chart-node__empty\">{{ children().emptyText }}</span>\n </div>\n }\n}\n",
|
|
999
|
+
styles: [":host{position:relative;display:flex;flex-direction:column;align-items:center}.tx-org-chart-node__card{position:relative;z-index:1;display:flex;justify-content:center;outline:none}.tx-org-chart-node__children{position:relative;display:flex;justify-content:center}:host([data-styled]){padding:var(--tx-chart-org-chart-connector-height) var(--tx-chart-org-chart-node-padding-x) 0}:host([data-styled]):before,:host([data-styled]):after{content:\"\";position:absolute;top:0;box-sizing:border-box;width:50%;height:var(--tx-chart-org-chart-connector-height);border-top:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]):before{right:50%}:host([data-styled]):after{left:50%;border-left:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]) .tx-org-chart-node__children{padding-top:var(--tx-chart-org-chart-connector-height)}:host([data-styled]) .tx-org-chart-node__children:before{content:\"\";position:absolute;top:0;left:50%;height:var(--tx-chart-org-chart-connector-height);border-left:1px solid var(--tx-chart-org-chart-connector-color)}:host([data-styled]) .tx-org-chart-node__empty{padding:var(--tx-chart-org-chart-empty-padding);border:1px dashed var(--tx-chart-org-chart-connector-color);border-radius:var(--tx-chart-org-chart-connector-radius);color:var(--tx-chart-org-chart-empty-color);font-size:var(--tx-chart-org-chart-empty-font-size);background:var(--tx-chart-org-chart-empty-background)}:host([data-styled]:only-child){padding-top:0}:host([data-styled]:only-child):before,:host([data-styled]:only-child):after{display:none}:host([data-styled]:first-child):before,:host([data-styled]:last-child):after{border:0}:host([data-styled]:last-child):before{border-right:1px solid var(--tx-chart-org-chart-connector-color);border-top-right-radius:var(--tx-chart-org-chart-connector-radius)}:host([data-styled]:first-child):after{border-top-left-radius:var(--tx-chart-org-chart-connector-radius)}:host([data-styled].tx-org-chart-node--root){padding:0}:host([data-styled].tx-org-chart-node--root):before,:host([data-styled].tx-org-chart-node--root):after{display:none}:host([data-styled])>.tx-org-chart-node__card:focus-visible{border-radius:var(--tx-chart-org-chart-card-radius);box-shadow:0 0 0 var(--tx-chart-focus-ring-width) var(--tx-chart-focus-ring-color)}\n"]
|
|
1000
|
+
}]
|
|
1001
|
+
}],
|
|
1002
|
+
propDecorators: {
|
|
1003
|
+
node: [{
|
|
1004
|
+
type: i0.Input,
|
|
1005
|
+
args: [{
|
|
1006
|
+
isSignal: true,
|
|
1007
|
+
alias: "node",
|
|
1008
|
+
required: true
|
|
1009
|
+
}]
|
|
1010
|
+
}],
|
|
1011
|
+
state: [{
|
|
1012
|
+
type: i0.Input,
|
|
1013
|
+
args: [{
|
|
1014
|
+
isSignal: true,
|
|
1015
|
+
alias: "state",
|
|
1016
|
+
required: true
|
|
1017
|
+
}]
|
|
1018
|
+
}],
|
|
1019
|
+
template: [{
|
|
1020
|
+
type: i0.Input,
|
|
1021
|
+
args: [{
|
|
1022
|
+
isSignal: true,
|
|
1023
|
+
alias: "template",
|
|
1024
|
+
required: false
|
|
1025
|
+
}]
|
|
1026
|
+
}],
|
|
1027
|
+
root: [{
|
|
1028
|
+
type: i0.Input,
|
|
1029
|
+
args: [{
|
|
1030
|
+
isSignal: true,
|
|
1031
|
+
alias: "root",
|
|
1032
|
+
required: false
|
|
1033
|
+
}]
|
|
1034
|
+
}],
|
|
1035
|
+
path: [{
|
|
1036
|
+
type: i0.Input,
|
|
1037
|
+
args: [{
|
|
1038
|
+
isSignal: true,
|
|
1039
|
+
alias: "path",
|
|
1040
|
+
required: false
|
|
1041
|
+
}]
|
|
1042
|
+
}],
|
|
1043
|
+
toggleNode: [{
|
|
1044
|
+
type: i0.Output,
|
|
1045
|
+
args: ["toggleNode"]
|
|
1046
|
+
}],
|
|
1047
|
+
hoverPath: [{
|
|
1048
|
+
type: i0.Output,
|
|
1049
|
+
args: ["hoverPath"]
|
|
1050
|
+
}],
|
|
1051
|
+
nodeClick: [{
|
|
1052
|
+
type: i0.Output,
|
|
1053
|
+
args: ["nodeClick"]
|
|
1054
|
+
}]
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
const SEARCH_DELAY = 400;
|
|
1058
|
+
const NARROW_REM = 30;
|
|
1059
|
+
var TxOrgChartToolbar = class TxOrgChartToolbar {
|
|
1060
|
+
state = input.required(...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
1061
|
+
labels = input.required(...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
1062
|
+
intl = input("en-US", ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
|
|
1063
|
+
query = input("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
1064
|
+
moreLabel = input("", ...ngDevMode ? [{ debugName: "moreLabel" }] : /* istanbul ignore next */ []);
|
|
1065
|
+
unstyled = input(false, {
|
|
1066
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
1067
|
+
transform: booleanAttribute
|
|
1068
|
+
});
|
|
1069
|
+
host = inject(ElementRef);
|
|
1070
|
+
document = inject(DOCUMENT);
|
|
1071
|
+
narrow = signal(false, ...ngDevMode ? [{ debugName: "narrow" }] : /* istanbul ignore next */ []);
|
|
1072
|
+
popoverTokens = { content: { padding: "0" } };
|
|
1073
|
+
menuItems = computed(() => {
|
|
1074
|
+
const state = this.state();
|
|
1075
|
+
const text = this.labels();
|
|
1076
|
+
return [
|
|
1077
|
+
{
|
|
1078
|
+
id: "expand",
|
|
1079
|
+
label: text.expandAll,
|
|
1080
|
+
icon: "angle-double-down",
|
|
1081
|
+
disabled: !state.hasContent || state.allExpanded
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
id: "collapse",
|
|
1085
|
+
label: text.collapseAll,
|
|
1086
|
+
icon: "angle-double-up",
|
|
1087
|
+
disabled: state.noneExpanded
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
id: "fullscreen",
|
|
1091
|
+
label: state.isFullscreen ? text.exitFullscreen : text.fullscreen,
|
|
1092
|
+
icon: state.isFullscreen ? "window-minimize" : "window-maximize"
|
|
1093
|
+
}
|
|
1094
|
+
];
|
|
1095
|
+
}, ...ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []);
|
|
1096
|
+
searchChange = output();
|
|
1097
|
+
zoomIn = output();
|
|
1098
|
+
zoomOut = output();
|
|
1099
|
+
resetZoom = output();
|
|
1100
|
+
fit = output();
|
|
1101
|
+
expandAll = output();
|
|
1102
|
+
collapseAll = output();
|
|
1103
|
+
fullscreen = output();
|
|
1104
|
+
timer;
|
|
1105
|
+
constructor() {
|
|
1106
|
+
inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));
|
|
1107
|
+
}
|
|
1108
|
+
measure() {
|
|
1109
|
+
const box = this.host.nativeElement.closest(".tx-org-chart__bar, .tx-org-chart__floating") ?? this.host.nativeElement;
|
|
1110
|
+
const root = this.document.defaultView?.getComputedStyle(this.document.documentElement);
|
|
1111
|
+
const rem = parseFloat(root?.fontSize ?? "") || 16;
|
|
1112
|
+
this.narrow.set(box.clientWidth < NARROW_REM * rem);
|
|
1113
|
+
}
|
|
1114
|
+
onMenu(id) {
|
|
1115
|
+
if (id === "expand") this.expandAll.emit();
|
|
1116
|
+
else if (id === "collapse") this.collapseAll.emit();
|
|
1117
|
+
else if (id === "fullscreen") this.fullscreen.emit();
|
|
1118
|
+
}
|
|
1119
|
+
matches(count) {
|
|
1120
|
+
return formatMessage(this.labels().matches, { count }, this.intl());
|
|
1121
|
+
}
|
|
1122
|
+
onInput(event) {
|
|
1123
|
+
const value = event.target.value;
|
|
1124
|
+
clearTimeout(this.timer);
|
|
1125
|
+
this.timer = setTimeout(() => this.searchChange.emit(value), SEARCH_DELAY);
|
|
1126
|
+
}
|
|
1127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1128
|
+
minVersion: "12.0.0",
|
|
1129
|
+
version: "22.2.3",
|
|
1130
|
+
ngImport: i0,
|
|
1131
|
+
type: TxOrgChartToolbar,
|
|
1132
|
+
deps: [],
|
|
1133
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1134
|
+
});
|
|
1135
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1136
|
+
minVersion: "17.0.0",
|
|
1137
|
+
version: "22.2.3",
|
|
1138
|
+
type: TxOrgChartToolbar,
|
|
1139
|
+
isStandalone: true,
|
|
1140
|
+
selector: "tx-org-chart-toolbar",
|
|
1141
|
+
inputs: {
|
|
1142
|
+
state: {
|
|
1143
|
+
classPropertyName: "state",
|
|
1144
|
+
publicName: "state",
|
|
1145
|
+
isSignal: true,
|
|
1146
|
+
isRequired: true,
|
|
1147
|
+
transformFunction: null
|
|
1148
|
+
},
|
|
1149
|
+
labels: {
|
|
1150
|
+
classPropertyName: "labels",
|
|
1151
|
+
publicName: "labels",
|
|
1152
|
+
isSignal: true,
|
|
1153
|
+
isRequired: true,
|
|
1154
|
+
transformFunction: null
|
|
1155
|
+
},
|
|
1156
|
+
intl: {
|
|
1157
|
+
classPropertyName: "intl",
|
|
1158
|
+
publicName: "intl",
|
|
1159
|
+
isSignal: true,
|
|
1160
|
+
isRequired: false,
|
|
1161
|
+
transformFunction: null
|
|
1162
|
+
},
|
|
1163
|
+
query: {
|
|
1164
|
+
classPropertyName: "query",
|
|
1165
|
+
publicName: "query",
|
|
1166
|
+
isSignal: true,
|
|
1167
|
+
isRequired: false,
|
|
1168
|
+
transformFunction: null
|
|
1169
|
+
},
|
|
1170
|
+
moreLabel: {
|
|
1171
|
+
classPropertyName: "moreLabel",
|
|
1172
|
+
publicName: "moreLabel",
|
|
1173
|
+
isSignal: true,
|
|
1174
|
+
isRequired: false,
|
|
1175
|
+
transformFunction: null
|
|
1176
|
+
},
|
|
1177
|
+
unstyled: {
|
|
1178
|
+
classPropertyName: "unstyled",
|
|
1179
|
+
publicName: "unstyled",
|
|
1180
|
+
isSignal: true,
|
|
1181
|
+
isRequired: false,
|
|
1182
|
+
transformFunction: null
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
outputs: {
|
|
1186
|
+
searchChange: "searchChange",
|
|
1187
|
+
zoomIn: "zoomIn",
|
|
1188
|
+
zoomOut: "zoomOut",
|
|
1189
|
+
resetZoom: "resetZoom",
|
|
1190
|
+
fit: "fit",
|
|
1191
|
+
expandAll: "expandAll",
|
|
1192
|
+
collapseAll: "collapseAll",
|
|
1193
|
+
fullscreen: "fullscreen"
|
|
1194
|
+
},
|
|
1195
|
+
host: {
|
|
1196
|
+
attributes: { "data-drag-ignore": "" },
|
|
1197
|
+
classAttribute: "tx-org-chart-toolbar"
|
|
1198
|
+
},
|
|
1199
|
+
ngImport: i0,
|
|
1200
|
+
template: "@let current = state();\n@let text = labels();\n<div class=\"tx-org-chart__actions\">\n <tx-icon-field class=\"tx-org-chart__search\">\n <tx-input-icon icon=\"search\" />\n <input txInput type=\"search\" [value]=\"query()\" [placeholder]=\"text.search\" [attr.aria-label]=\"text.search\" (input)=\"onInput($event)\" />\n </tx-icon-field>\n @if (current.hasQuery) {\n <tx-pill [tone]=\"current.matchCount ? 'primary' : 'warn'\" [icon]=\"current.matchCount ? 'check' : 'search'\" role=\"status\">\n {{ current.matchCount ? matches(current.matchCount) : text.noMatches }}\n </tx-pill>\n }\n <div class=\"tx-org-chart__group tx-org-chart__zoom-group\">\n <button\n txButton\n type=\"button\"\n icon=\"search-minus\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.zoomOut\"\n [attr.aria-label]=\"text.zoomOut\"\n [disabled]=\"!current.canZoomOut\"\n (click)=\"zoomOut.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__zoom\"\n [label]=\"current.zoomPercent + '%'\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.resetZoom\"\n [attr.aria-label]=\"text.resetZoom + ', ' + current.zoomPercent + '%'\"\n (click)=\"resetZoom.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"search-plus\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.zoomIn\"\n [attr.aria-label]=\"text.zoomIn\"\n [disabled]=\"!current.canZoomIn\"\n (click)=\"zoomIn.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"expand\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.fit\"\n [attr.aria-label]=\"text.fit\"\n [disabled]=\"!current.hasContent\"\n (click)=\"fit.emit()\"\n ></button>\n </div>\n <div class=\"tx-org-chart__group tx-org-chart__expand-group\">\n <button\n txButton\n type=\"button\"\n icon=\"angle-double-down\"\n [label]=\"text.expandAll\"\n [attr.aria-label]=\"text.expandAll\"\n severity=\"secondary\"\n outlined\n [disabled]=\"!current.hasContent || current.allExpanded\"\n (click)=\"expandAll.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"angle-double-up\"\n [label]=\"text.collapseAll\"\n [attr.aria-label]=\"text.collapseAll\"\n severity=\"secondary\"\n outlined\n [disabled]=\"current.noneExpanded\"\n (click)=\"collapseAll.emit()\"\n ></button>\n </div>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__fullscreen\"\n [icon]=\"current.isFullscreen ? 'window-minimize' : 'window-maximize'\"\n [label]=\"current.isFullscreen ? text.exitFullscreen : text.fullscreen\"\n [attr.aria-label]=\"current.isFullscreen ? text.exitFullscreen : text.fullscreen\"\n [severity]=\"current.isFullscreen ? 'primary' : 'secondary'\"\n [outlined]=\"!current.isFullscreen\"\n (click)=\"fullscreen.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__more\"\n icon=\"sliders-h\"\n severity=\"secondary\"\n outlined\n aria-haspopup=\"dialog\"\n [txTooltip]=\"moreLabel()\"\n [attr.aria-label]=\"moreLabel()\"\n [txPopoverTrigger]=\"more\"\n (pointerdown)=\"measure()\"\n (keydown.enter)=\"measure()\"\n (keydown.space)=\"measure()\"\n ></button>\n <tx-popover #more placement=\"bottom-end\" [dt]=\"popoverTokens\" [ariaLabel]=\"moreLabel()\" [unstyled]=\"unstyled()\">\n @if (narrow()) {\n <div class=\"tx-org-chart__menu-zoom\" [attr.data-styled]=\"!unstyled() || null\">\n <button\n txButton\n type=\"button\"\n icon=\"search-minus\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.zoomOut\"\n [disabled]=\"!current.canZoomOut\"\n (click)=\"zoomOut.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__menu-percent\"\n [label]=\"current.zoomPercent + '%'\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.resetZoom + ', ' + current.zoomPercent + '%'\"\n (click)=\"resetZoom.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"search-plus\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.zoomIn\"\n [disabled]=\"!current.canZoomIn\"\n (click)=\"zoomIn.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"expand\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.fit\"\n [disabled]=\"!current.hasContent\"\n (click)=\"fit.emit()\"\n ></button>\n </div>\n }\n <tx-chart-menu [items]=\"menuItems()\" [ariaLabel]=\"moreLabel()\" [unstyled]=\"unstyled()\" (selected)=\"more.hide(); onMenu($event)\" />\n </tx-popover>\n</div>\n",
|
|
1201
|
+
dependencies: [
|
|
1202
|
+
{
|
|
1203
|
+
kind: "component",
|
|
1204
|
+
type: TxButton,
|
|
1205
|
+
selector: "button[txButton], a[txButton]",
|
|
1206
|
+
inputs: [
|
|
1207
|
+
"label",
|
|
1208
|
+
"severity",
|
|
1209
|
+
"size",
|
|
1210
|
+
"variant",
|
|
1211
|
+
"outlined",
|
|
1212
|
+
"text",
|
|
1213
|
+
"link",
|
|
1214
|
+
"rounded",
|
|
1215
|
+
"raised",
|
|
1216
|
+
"plain",
|
|
1217
|
+
"fluid",
|
|
1218
|
+
"disabled",
|
|
1219
|
+
"tabindex",
|
|
1220
|
+
"icon",
|
|
1221
|
+
"iconPos",
|
|
1222
|
+
"iconOnly",
|
|
1223
|
+
"loading",
|
|
1224
|
+
"loadingIcon",
|
|
1225
|
+
"badge",
|
|
1226
|
+
"badgeSeverity",
|
|
1227
|
+
"dt",
|
|
1228
|
+
"pt",
|
|
1229
|
+
"ptOptions",
|
|
1230
|
+
"unstyled"
|
|
1231
|
+
]
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
kind: "component",
|
|
1235
|
+
type: TxChartMenu,
|
|
1236
|
+
selector: "tx-chart-menu",
|
|
1237
|
+
inputs: [
|
|
1238
|
+
"items",
|
|
1239
|
+
"ariaLabel",
|
|
1240
|
+
"unstyled"
|
|
1241
|
+
],
|
|
1242
|
+
outputs: ["selected"]
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
kind: "component",
|
|
1246
|
+
type: TxIconField,
|
|
1247
|
+
selector: "tx-icon-field",
|
|
1248
|
+
inputs: ["fluid"]
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
kind: "component",
|
|
1252
|
+
type: TxInputIcon,
|
|
1253
|
+
selector: "tx-input-icon",
|
|
1254
|
+
inputs: ["icon", "position"]
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
kind: "directive",
|
|
1258
|
+
type: TxInput,
|
|
1259
|
+
selector: "input[txInput], textarea[txInput]",
|
|
1260
|
+
inputs: [
|
|
1261
|
+
"invalid",
|
|
1262
|
+
"size",
|
|
1263
|
+
"variant",
|
|
1264
|
+
"fluid",
|
|
1265
|
+
"dt",
|
|
1266
|
+
"pt",
|
|
1267
|
+
"ptOptions",
|
|
1268
|
+
"unstyled"
|
|
1269
|
+
]
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
kind: "component",
|
|
1273
|
+
type: TxPill,
|
|
1274
|
+
selector: "tx-pill",
|
|
1275
|
+
inputs: [
|
|
1276
|
+
"value",
|
|
1277
|
+
"tone",
|
|
1278
|
+
"variant",
|
|
1279
|
+
"size",
|
|
1280
|
+
"icon",
|
|
1281
|
+
"dot",
|
|
1282
|
+
"removable",
|
|
1283
|
+
"removeLabel",
|
|
1284
|
+
"dt",
|
|
1285
|
+
"pt",
|
|
1286
|
+
"ptOptions",
|
|
1287
|
+
"unstyled"
|
|
1288
|
+
],
|
|
1289
|
+
outputs: ["removed"]
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
kind: "component",
|
|
1293
|
+
type: TxPopover,
|
|
1294
|
+
selector: "tx-popover",
|
|
1295
|
+
inputs: [
|
|
1296
|
+
"placement",
|
|
1297
|
+
"offset",
|
|
1298
|
+
"arrow",
|
|
1299
|
+
"header",
|
|
1300
|
+
"closeButton",
|
|
1301
|
+
"dismissable",
|
|
1302
|
+
"closeOnEscape",
|
|
1303
|
+
"autoFocus",
|
|
1304
|
+
"restoreFocus",
|
|
1305
|
+
"scroll",
|
|
1306
|
+
"ariaLabel",
|
|
1307
|
+
"ariaLabelledBy",
|
|
1308
|
+
"panelClass",
|
|
1309
|
+
"open",
|
|
1310
|
+
"dt",
|
|
1311
|
+
"pt",
|
|
1312
|
+
"ptOptions",
|
|
1313
|
+
"unstyled"
|
|
1314
|
+
],
|
|
1315
|
+
outputs: [
|
|
1316
|
+
"openChange",
|
|
1317
|
+
"opened",
|
|
1318
|
+
"closed"
|
|
1319
|
+
]
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
kind: "directive",
|
|
1323
|
+
type: TxPopoverTrigger,
|
|
1324
|
+
selector: "[txPopoverTrigger]",
|
|
1325
|
+
inputs: ["txPopoverTrigger"]
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
kind: "directive",
|
|
1329
|
+
type: TxTooltip,
|
|
1330
|
+
selector: "[txTooltip]",
|
|
1331
|
+
inputs: [
|
|
1332
|
+
"txTooltip",
|
|
1333
|
+
"tooltipPlacement",
|
|
1334
|
+
"tooltipEvent",
|
|
1335
|
+
"tooltipShowDelay",
|
|
1336
|
+
"tooltipHideDelay",
|
|
1337
|
+
"tooltipLife",
|
|
1338
|
+
"tooltipOffset",
|
|
1339
|
+
"tooltipArrow",
|
|
1340
|
+
"tooltipInteractive",
|
|
1341
|
+
"tooltipDisabled",
|
|
1342
|
+
"tooltipOverflowOnly",
|
|
1343
|
+
"tooltipMultiline",
|
|
1344
|
+
"tooltipContext",
|
|
1345
|
+
"tooltipClass",
|
|
1346
|
+
"tooltipDt",
|
|
1347
|
+
"tooltipPt",
|
|
1348
|
+
"tooltipPtOptions",
|
|
1349
|
+
"tooltipUnstyled"
|
|
1350
|
+
],
|
|
1351
|
+
outputs: ["tooltipShown", "tooltipHidden"],
|
|
1352
|
+
exportAs: ["txTooltip"]
|
|
1353
|
+
}
|
|
1354
|
+
],
|
|
1355
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1356
|
+
});
|
|
1357
|
+
};
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1359
|
+
minVersion: "12.0.0",
|
|
1360
|
+
version: "22.2.3",
|
|
1361
|
+
ngImport: i0,
|
|
1362
|
+
type: TxOrgChartToolbar,
|
|
1363
|
+
decorators: [{
|
|
1364
|
+
type: Component,
|
|
1365
|
+
args: [{
|
|
1366
|
+
selector: "tx-org-chart-toolbar",
|
|
1367
|
+
imports: [
|
|
1368
|
+
TxButton,
|
|
1369
|
+
TxChartMenu,
|
|
1370
|
+
TxIconField,
|
|
1371
|
+
TxInputIcon,
|
|
1372
|
+
TxInput,
|
|
1373
|
+
TxPill,
|
|
1374
|
+
TxPopover,
|
|
1375
|
+
TxPopoverTrigger,
|
|
1376
|
+
TxTooltip
|
|
1377
|
+
],
|
|
1378
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1379
|
+
host: {
|
|
1380
|
+
class: "tx-org-chart-toolbar",
|
|
1381
|
+
"data-drag-ignore": ""
|
|
1382
|
+
},
|
|
1383
|
+
template: "@let current = state();\n@let text = labels();\n<div class=\"tx-org-chart__actions\">\n <tx-icon-field class=\"tx-org-chart__search\">\n <tx-input-icon icon=\"search\" />\n <input txInput type=\"search\" [value]=\"query()\" [placeholder]=\"text.search\" [attr.aria-label]=\"text.search\" (input)=\"onInput($event)\" />\n </tx-icon-field>\n @if (current.hasQuery) {\n <tx-pill [tone]=\"current.matchCount ? 'primary' : 'warn'\" [icon]=\"current.matchCount ? 'check' : 'search'\" role=\"status\">\n {{ current.matchCount ? matches(current.matchCount) : text.noMatches }}\n </tx-pill>\n }\n <div class=\"tx-org-chart__group tx-org-chart__zoom-group\">\n <button\n txButton\n type=\"button\"\n icon=\"search-minus\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.zoomOut\"\n [attr.aria-label]=\"text.zoomOut\"\n [disabled]=\"!current.canZoomOut\"\n (click)=\"zoomOut.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__zoom\"\n [label]=\"current.zoomPercent + '%'\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.resetZoom\"\n [attr.aria-label]=\"text.resetZoom + ', ' + current.zoomPercent + '%'\"\n (click)=\"resetZoom.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"search-plus\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.zoomIn\"\n [attr.aria-label]=\"text.zoomIn\"\n [disabled]=\"!current.canZoomIn\"\n (click)=\"zoomIn.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"expand\"\n severity=\"secondary\"\n outlined\n [txTooltip]=\"text.fit\"\n [attr.aria-label]=\"text.fit\"\n [disabled]=\"!current.hasContent\"\n (click)=\"fit.emit()\"\n ></button>\n </div>\n <div class=\"tx-org-chart__group tx-org-chart__expand-group\">\n <button\n txButton\n type=\"button\"\n icon=\"angle-double-down\"\n [label]=\"text.expandAll\"\n [attr.aria-label]=\"text.expandAll\"\n severity=\"secondary\"\n outlined\n [disabled]=\"!current.hasContent || current.allExpanded\"\n (click)=\"expandAll.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"angle-double-up\"\n [label]=\"text.collapseAll\"\n [attr.aria-label]=\"text.collapseAll\"\n severity=\"secondary\"\n outlined\n [disabled]=\"current.noneExpanded\"\n (click)=\"collapseAll.emit()\"\n ></button>\n </div>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__fullscreen\"\n [icon]=\"current.isFullscreen ? 'window-minimize' : 'window-maximize'\"\n [label]=\"current.isFullscreen ? text.exitFullscreen : text.fullscreen\"\n [attr.aria-label]=\"current.isFullscreen ? text.exitFullscreen : text.fullscreen\"\n [severity]=\"current.isFullscreen ? 'primary' : 'secondary'\"\n [outlined]=\"!current.isFullscreen\"\n (click)=\"fullscreen.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__more\"\n icon=\"sliders-h\"\n severity=\"secondary\"\n outlined\n aria-haspopup=\"dialog\"\n [txTooltip]=\"moreLabel()\"\n [attr.aria-label]=\"moreLabel()\"\n [txPopoverTrigger]=\"more\"\n (pointerdown)=\"measure()\"\n (keydown.enter)=\"measure()\"\n (keydown.space)=\"measure()\"\n ></button>\n <tx-popover #more placement=\"bottom-end\" [dt]=\"popoverTokens\" [ariaLabel]=\"moreLabel()\" [unstyled]=\"unstyled()\">\n @if (narrow()) {\n <div class=\"tx-org-chart__menu-zoom\" [attr.data-styled]=\"!unstyled() || null\">\n <button\n txButton\n type=\"button\"\n icon=\"search-minus\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.zoomOut\"\n [disabled]=\"!current.canZoomOut\"\n (click)=\"zoomOut.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n class=\"tx-org-chart__menu-percent\"\n [label]=\"current.zoomPercent + '%'\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.resetZoom + ', ' + current.zoomPercent + '%'\"\n (click)=\"resetZoom.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"search-plus\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.zoomIn\"\n [disabled]=\"!current.canZoomIn\"\n (click)=\"zoomIn.emit()\"\n ></button>\n <button\n txButton\n type=\"button\"\n icon=\"expand\"\n severity=\"secondary\"\n outlined\n [attr.aria-label]=\"text.fit\"\n [disabled]=\"!current.hasContent\"\n (click)=\"fit.emit()\"\n ></button>\n </div>\n }\n <tx-chart-menu [items]=\"menuItems()\" [ariaLabel]=\"moreLabel()\" [unstyled]=\"unstyled()\" (selected)=\"more.hide(); onMenu($event)\" />\n </tx-popover>\n</div>\n"
|
|
1384
|
+
}]
|
|
1385
|
+
}],
|
|
1386
|
+
ctorParameters: () => [],
|
|
1387
|
+
propDecorators: {
|
|
1388
|
+
state: [{
|
|
1389
|
+
type: i0.Input,
|
|
1390
|
+
args: [{
|
|
1391
|
+
isSignal: true,
|
|
1392
|
+
alias: "state",
|
|
1393
|
+
required: true
|
|
1394
|
+
}]
|
|
1395
|
+
}],
|
|
1396
|
+
labels: [{
|
|
1397
|
+
type: i0.Input,
|
|
1398
|
+
args: [{
|
|
1399
|
+
isSignal: true,
|
|
1400
|
+
alias: "labels",
|
|
1401
|
+
required: true
|
|
1402
|
+
}]
|
|
1403
|
+
}],
|
|
1404
|
+
intl: [{
|
|
1405
|
+
type: i0.Input,
|
|
1406
|
+
args: [{
|
|
1407
|
+
isSignal: true,
|
|
1408
|
+
alias: "intl",
|
|
1409
|
+
required: false
|
|
1410
|
+
}]
|
|
1411
|
+
}],
|
|
1412
|
+
query: [{
|
|
1413
|
+
type: i0.Input,
|
|
1414
|
+
args: [{
|
|
1415
|
+
isSignal: true,
|
|
1416
|
+
alias: "query",
|
|
1417
|
+
required: false
|
|
1418
|
+
}]
|
|
1419
|
+
}],
|
|
1420
|
+
moreLabel: [{
|
|
1421
|
+
type: i0.Input,
|
|
1422
|
+
args: [{
|
|
1423
|
+
isSignal: true,
|
|
1424
|
+
alias: "moreLabel",
|
|
1425
|
+
required: false
|
|
1426
|
+
}]
|
|
1427
|
+
}],
|
|
1428
|
+
unstyled: [{
|
|
1429
|
+
type: i0.Input,
|
|
1430
|
+
args: [{
|
|
1431
|
+
isSignal: true,
|
|
1432
|
+
alias: "unstyled",
|
|
1433
|
+
required: false
|
|
1434
|
+
}]
|
|
1435
|
+
}],
|
|
1436
|
+
searchChange: [{
|
|
1437
|
+
type: i0.Output,
|
|
1438
|
+
args: ["searchChange"]
|
|
1439
|
+
}],
|
|
1440
|
+
zoomIn: [{
|
|
1441
|
+
type: i0.Output,
|
|
1442
|
+
args: ["zoomIn"]
|
|
1443
|
+
}],
|
|
1444
|
+
zoomOut: [{
|
|
1445
|
+
type: i0.Output,
|
|
1446
|
+
args: ["zoomOut"]
|
|
1447
|
+
}],
|
|
1448
|
+
resetZoom: [{
|
|
1449
|
+
type: i0.Output,
|
|
1450
|
+
args: ["resetZoom"]
|
|
1451
|
+
}],
|
|
1452
|
+
fit: [{
|
|
1453
|
+
type: i0.Output,
|
|
1454
|
+
args: ["fit"]
|
|
1455
|
+
}],
|
|
1456
|
+
expandAll: [{
|
|
1457
|
+
type: i0.Output,
|
|
1458
|
+
args: ["expandAll"]
|
|
1459
|
+
}],
|
|
1460
|
+
collapseAll: [{
|
|
1461
|
+
type: i0.Output,
|
|
1462
|
+
args: ["collapseAll"]
|
|
1463
|
+
}],
|
|
1464
|
+
fullscreen: [{
|
|
1465
|
+
type: i0.Output,
|
|
1466
|
+
args: ["fullscreen"]
|
|
1467
|
+
}]
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
const TYPING = [
|
|
1471
|
+
"INPUT",
|
|
1472
|
+
"TEXTAREA",
|
|
1473
|
+
"SELECT"
|
|
1474
|
+
];
|
|
1475
|
+
const DRAG_IGNORE = "[data-drag-ignore], button, a, input, textarea, select, [contenteditable=\"true\"]";
|
|
1476
|
+
const DRAG_THRESHOLD = 4;
|
|
1477
|
+
const KEY_PAN = 48;
|
|
1478
|
+
const DEFAULT_HEIGHT = "calc(100vh - 15rem)";
|
|
1479
|
+
var TxOrgChart = class TxOrgChart {
|
|
1480
|
+
document = inject(DOCUMENT);
|
|
1481
|
+
injector = inject(Injector);
|
|
1482
|
+
locale = inject(TxLocaleService);
|
|
1483
|
+
translations = injectTranslations();
|
|
1484
|
+
canvas = viewChild("canvas", ...ngDevMode ? [{ debugName: "canvas" }] : /* istanbul ignore next */ []);
|
|
1485
|
+
stage = viewChild("stage", ...ngDevMode ? [{ debugName: "stage" }] : /* istanbul ignore next */ []);
|
|
1486
|
+
nodes = input([], ...ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []);
|
|
1487
|
+
highlightIds = input([], ...ngDevMode ? [{ debugName: "highlightIds" }] : /* istanbul ignore next */ []);
|
|
1488
|
+
focusId = input(null, ...ngDevMode ? [{ debugName: "focusId" }] : /* istanbul ignore next */ []);
|
|
1489
|
+
labels = input({}, ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
1490
|
+
toolbar = input(true, {
|
|
1491
|
+
...ngDevMode ? { debugName: "toolbar" } : /* istanbul ignore next */ {},
|
|
1492
|
+
transform: booleanAttribute
|
|
1493
|
+
});
|
|
1494
|
+
minimap = input(true, {
|
|
1495
|
+
...ngDevMode ? { debugName: "minimap" } : /* istanbul ignore next */ {},
|
|
1496
|
+
transform: booleanAttribute
|
|
1497
|
+
});
|
|
1498
|
+
height = input(DEFAULT_HEIGHT, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
1499
|
+
busy = input(false, {
|
|
1500
|
+
...ngDevMode ? { debugName: "busy" } : /* istanbul ignore next */ {},
|
|
1501
|
+
transform: booleanAttribute
|
|
1502
|
+
});
|
|
1503
|
+
pathKinds = input(null, ...ngDevMode ? [{ debugName: "pathKinds" }] : /* istanbul ignore next */ []);
|
|
1504
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
1505
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
1506
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
1507
|
+
unstyled = input(void 0, {
|
|
1508
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
1509
|
+
transform: optionalBoolean
|
|
1510
|
+
});
|
|
1511
|
+
nodeToggle = output();
|
|
1512
|
+
nodeClick = output();
|
|
1513
|
+
searchChange = output();
|
|
1514
|
+
expandAll = output();
|
|
1515
|
+
collapseAll = output();
|
|
1516
|
+
nodeTemplate = contentChild(TxOrgChartNodeTemplate, ...ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []);
|
|
1517
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
1518
|
+
passThrough = injectPassThrough("orgChart", this, this.pt, this.ptOptions);
|
|
1519
|
+
tokenStyle = computed(() => toStyleObject(this.dt(), "--tx-chart"), ...ngDevMode ? [{ debugName: "tokenStyle" }] : /* istanbul ignore next */ []);
|
|
1520
|
+
hostStyle = computed(() => ({
|
|
1521
|
+
...this.tokenStyle(),
|
|
1522
|
+
...this.passThrough().root?.style
|
|
1523
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
1524
|
+
view = signal({
|
|
1525
|
+
x: 0,
|
|
1526
|
+
y: 0,
|
|
1527
|
+
zoom: TX_ORG_CHART_ZOOM.initial
|
|
1528
|
+
}, ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
1529
|
+
viewport = signal({
|
|
1530
|
+
width: 0,
|
|
1531
|
+
height: 0
|
|
1532
|
+
}, ...ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []);
|
|
1533
|
+
fullscreen = signal(false, ...ngDevMode ? [{ debugName: "fullscreen" }] : /* istanbul ignore next */ []);
|
|
1534
|
+
native = signal(false, ...ngDevMode ? [{ debugName: "native" }] : /* istanbul ignore next */ []);
|
|
1535
|
+
topLayer = signal(false, ...ngDevMode ? [{ debugName: "topLayer" }] : /* istanbul ignore next */ []);
|
|
1536
|
+
dragging = signal(false, ...ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []);
|
|
1537
|
+
settled = signal(false, ...ngDevMode ? [{ debugName: "settled" }] : /* istanbul ignore next */ []);
|
|
1538
|
+
query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
1539
|
+
pathIds = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "pathIds" }] : /* istanbul ignore next */ []);
|
|
1540
|
+
pathOrder = signal([], ...ngDevMode ? [{ debugName: "pathOrder" }] : /* istanbul ignore next */ []);
|
|
1541
|
+
pathLine = signal("", ...ngDevMode ? [{ debugName: "pathLine" }] : /* istanbul ignore next */ []);
|
|
1542
|
+
minimapLayout = signal({
|
|
1543
|
+
width: 0,
|
|
1544
|
+
height: 0,
|
|
1545
|
+
items: []
|
|
1546
|
+
}, ...ngDevMode ? [{ debugName: "minimapLayout" }] : /* istanbul ignore next */ []);
|
|
1547
|
+
intl = computed(() => this.locale.locale().intl, ...ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []);
|
|
1548
|
+
text = computed(() => {
|
|
1549
|
+
const t = this.translations();
|
|
1550
|
+
return {
|
|
1551
|
+
title: t.orgChartTitle,
|
|
1552
|
+
hint: t.orgChartHint,
|
|
1553
|
+
search: t.orgChartSearch,
|
|
1554
|
+
matches: t.orgChartMatches,
|
|
1555
|
+
noMatches: t.orgChartNoMatches,
|
|
1556
|
+
zoomIn: t.orgChartZoomIn,
|
|
1557
|
+
zoomOut: t.orgChartZoomOut,
|
|
1558
|
+
resetZoom: t.orgChartResetZoom,
|
|
1559
|
+
fit: t.orgChartFit,
|
|
1560
|
+
expandAll: t.orgChartExpandAll,
|
|
1561
|
+
collapseAll: t.orgChartCollapseAll,
|
|
1562
|
+
fullscreen: t.orgChartFullscreen,
|
|
1563
|
+
exitFullscreen: t.orgChartExitFullscreen,
|
|
1564
|
+
expand: t.orgChartExpand,
|
|
1565
|
+
collapse: t.orgChartCollapse,
|
|
1566
|
+
more: t.orgChartMore,
|
|
1567
|
+
...this.labels()
|
|
1568
|
+
};
|
|
1569
|
+
}, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
1570
|
+
list = computed(() => this.nodes() ?? [], ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
|
|
1571
|
+
highlightSet = computed(() => new Set(this.highlightIds() ?? []), ...ngDevMode ? [{ debugName: "highlightSet" }] : /* istanbul ignore next */ []);
|
|
1572
|
+
hasContent = computed(() => this.list().length > 0, ...ngDevMode ? [{ debugName: "hasContent" }] : /* istanbul ignore next */ []);
|
|
1573
|
+
stageTransform = computed(() => {
|
|
1574
|
+
const { x, y, zoom } = this.view();
|
|
1575
|
+
return `translate3d(${x}px, ${y}px, 0) scale(${zoom})`;
|
|
1576
|
+
}, ...ngDevMode ? [{ debugName: "stageTransform" }] : /* istanbul ignore next */ []);
|
|
1577
|
+
treeState = computed(() => ({
|
|
1578
|
+
highlightIds: this.highlightSet(),
|
|
1579
|
+
pathIds: this.pathIds(),
|
|
1580
|
+
pathKinds: this.pathKinds(),
|
|
1581
|
+
labels: this.text(),
|
|
1582
|
+
unstyled: this.isUnstyled()
|
|
1583
|
+
}), ...ngDevMode ? [{ debugName: "treeState" }] : /* istanbul ignore next */ []);
|
|
1584
|
+
toolbarState = computed(() => {
|
|
1585
|
+
const expand = orgChartExpandState(this.list());
|
|
1586
|
+
const zoom = this.view().zoom;
|
|
1587
|
+
return {
|
|
1588
|
+
zoomPercent: Math.round(zoom * 100),
|
|
1589
|
+
canZoomIn: zoom < TX_ORG_CHART_ZOOM.max,
|
|
1590
|
+
canZoomOut: zoom > TX_ORG_CHART_ZOOM.min,
|
|
1591
|
+
hasQuery: !!this.query().trim(),
|
|
1592
|
+
matchCount: this.highlightSet().size,
|
|
1593
|
+
isFullscreen: this.fullscreen(),
|
|
1594
|
+
hasContent: this.hasContent(),
|
|
1595
|
+
allExpanded: !expand.hasCollapsible || expand.allExpanded,
|
|
1596
|
+
noneExpanded: expand.noneExpanded
|
|
1597
|
+
};
|
|
1598
|
+
}, ...ngDevMode ? [{ debugName: "toolbarState" }] : /* istanbul ignore next */ []);
|
|
1599
|
+
observer = null;
|
|
1600
|
+
pointers = /* @__PURE__ */ new Map();
|
|
1601
|
+
pinchDistance = 0;
|
|
1602
|
+
moved = 0;
|
|
1603
|
+
suppressClick = false;
|
|
1604
|
+
lastFocusKey = "";
|
|
1605
|
+
pageOverflow = "";
|
|
1606
|
+
pageLocked = false;
|
|
1607
|
+
pageGutter = "";
|
|
1608
|
+
constructor() {
|
|
1609
|
+
afterNextRender(() => {
|
|
1610
|
+
const canvas = this.canvas()?.nativeElement;
|
|
1611
|
+
if (!canvas) return;
|
|
1612
|
+
this.observeViewport(canvas);
|
|
1613
|
+
this.measureMinimap();
|
|
1614
|
+
this.fitToScreen();
|
|
1615
|
+
setTimeout(() => this.settled.set(true));
|
|
1616
|
+
});
|
|
1617
|
+
effect(() => {
|
|
1618
|
+
this.list();
|
|
1619
|
+
afterNextRender(() => this.measureMinimap(), { injector: this.injector });
|
|
1620
|
+
});
|
|
1621
|
+
effect(() => {
|
|
1622
|
+
const ids = this.pathOrder();
|
|
1623
|
+
if (!ids.length) return;
|
|
1624
|
+
afterNextRender(() => this.drawPath(ids), { injector: this.injector });
|
|
1625
|
+
});
|
|
1626
|
+
effect(() => {
|
|
1627
|
+
const target = this.focusId();
|
|
1628
|
+
const query = this.query();
|
|
1629
|
+
this.list();
|
|
1630
|
+
if (!target) return;
|
|
1631
|
+
const key = `${query}|${target}`;
|
|
1632
|
+
if (key === this.lastFocusKey) return;
|
|
1633
|
+
afterNextRender(() => this.focusOn(key, target), { injector: this.injector });
|
|
1634
|
+
});
|
|
1635
|
+
}
|
|
1636
|
+
fitToScreen() {
|
|
1637
|
+
const stage = this.stage()?.nativeElement;
|
|
1638
|
+
if (!stage) return;
|
|
1639
|
+
const next = fitView(this.viewport(), {
|
|
1640
|
+
width: stage.offsetWidth,
|
|
1641
|
+
height: stage.offsetHeight
|
|
1642
|
+
}, this.fullscreen() ? 80 : 0);
|
|
1643
|
+
if (next) this.view.set(next);
|
|
1644
|
+
}
|
|
1645
|
+
zoomIn() {
|
|
1646
|
+
this.zoomAtCenter(this.view().zoom * TX_ORG_CHART_ZOOM.step);
|
|
1647
|
+
}
|
|
1648
|
+
zoomOut() {
|
|
1649
|
+
this.zoomAtCenter(this.view().zoom / TX_ORG_CHART_ZOOM.step);
|
|
1650
|
+
}
|
|
1651
|
+
resetZoom() {
|
|
1652
|
+
this.zoomAtCenter(TX_ORG_CHART_ZOOM.initial);
|
|
1653
|
+
}
|
|
1654
|
+
centerOn(point) {
|
|
1655
|
+
this.view.update((view) => centerOn(view, this.viewport(), point));
|
|
1656
|
+
}
|
|
1657
|
+
onSearch(query) {
|
|
1658
|
+
this.query.set(query);
|
|
1659
|
+
this.searchChange.emit(query);
|
|
1660
|
+
}
|
|
1661
|
+
onNodeClick(node) {
|
|
1662
|
+
if (!this.suppressClick) this.nodeClick.emit(node);
|
|
1663
|
+
}
|
|
1664
|
+
highlightPath(ids) {
|
|
1665
|
+
this.pathIds.set(new Set(ids ?? []));
|
|
1666
|
+
this.pathOrder.set(ids ?? []);
|
|
1667
|
+
if (!ids) this.pathLine.set("");
|
|
1668
|
+
}
|
|
1669
|
+
onWheel(event) {
|
|
1670
|
+
event.preventDefault();
|
|
1671
|
+
if (event.ctrlKey || event.metaKey || wheelIsMouse(event)) {
|
|
1672
|
+
const rect = this.canvasRect();
|
|
1673
|
+
this.view.update((view) => zoomAt(view, wheelZoom(view.zoom, event.deltaY, event.ctrlKey), {
|
|
1674
|
+
x: event.clientX - rect.left,
|
|
1675
|
+
y: event.clientY - rect.top
|
|
1676
|
+
}));
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
this.panBy(-event.deltaX, -event.deltaY);
|
|
1680
|
+
}
|
|
1681
|
+
onPointerDown(event) {
|
|
1682
|
+
if (event.button !== 0 && event.pointerType === "mouse" || event.target?.closest(DRAG_IGNORE)) return;
|
|
1683
|
+
this.pointers.set(event.pointerId, {
|
|
1684
|
+
x: event.clientX,
|
|
1685
|
+
y: event.clientY
|
|
1686
|
+
});
|
|
1687
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
1688
|
+
this.moved = 0;
|
|
1689
|
+
this.suppressClick = false;
|
|
1690
|
+
this.pinchDistance = this.pointers.size === 2 ? this.distance() : 0;
|
|
1691
|
+
}
|
|
1692
|
+
onPointerMove(event) {
|
|
1693
|
+
const last = this.pointers.get(event.pointerId);
|
|
1694
|
+
if (!last) return;
|
|
1695
|
+
const point = {
|
|
1696
|
+
x: event.clientX,
|
|
1697
|
+
y: event.clientY
|
|
1698
|
+
};
|
|
1699
|
+
if (this.pointers.size >= 2) {
|
|
1700
|
+
this.pointers.set(event.pointerId, point);
|
|
1701
|
+
const distance = this.distance();
|
|
1702
|
+
const [a, b] = [...this.pointers.values()];
|
|
1703
|
+
const rect = this.canvasRect();
|
|
1704
|
+
if (this.pinchDistance > 0) {
|
|
1705
|
+
const ratio = distance / this.pinchDistance;
|
|
1706
|
+
this.view.update((view) => zoomAt(view, view.zoom * ratio, {
|
|
1707
|
+
x: (a.x + b.x) / 2 - rect.left,
|
|
1708
|
+
y: (a.y + b.y) / 2 - rect.top
|
|
1709
|
+
}));
|
|
1710
|
+
}
|
|
1711
|
+
this.pinchDistance = distance;
|
|
1712
|
+
this.suppressClick = true;
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
const dx = point.x - last.x;
|
|
1716
|
+
const dy = point.y - last.y;
|
|
1717
|
+
this.pointers.set(event.pointerId, point);
|
|
1718
|
+
this.moved += Math.abs(dx) + Math.abs(dy);
|
|
1719
|
+
if (this.moved > DRAG_THRESHOLD) {
|
|
1720
|
+
this.dragging.set(true);
|
|
1721
|
+
this.suppressClick = true;
|
|
1722
|
+
}
|
|
1723
|
+
if (this.dragging()) this.panBy(dx, dy);
|
|
1724
|
+
}
|
|
1725
|
+
onPointerUp(event) {
|
|
1726
|
+
if (!this.pointers.delete(event.pointerId)) return;
|
|
1727
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
1728
|
+
this.pinchDistance = 0;
|
|
1729
|
+
if (!this.pointers.size) {
|
|
1730
|
+
this.dragging.set(false);
|
|
1731
|
+
setTimeout(() => this.suppressClick = false);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
onKeydown(event) {
|
|
1735
|
+
const target = event.target;
|
|
1736
|
+
if (!target || target.isContentEditable || TYPING.includes(target.tagName) || event.ctrlKey || event.metaKey || event.altKey || !this.hasContent()) return;
|
|
1737
|
+
const onCanvas = target === this.canvas()?.nativeElement;
|
|
1738
|
+
switch (event.key) {
|
|
1739
|
+
case "+":
|
|
1740
|
+
case "=":
|
|
1741
|
+
this.zoomIn();
|
|
1742
|
+
break;
|
|
1743
|
+
case "-":
|
|
1744
|
+
case "_":
|
|
1745
|
+
this.zoomOut();
|
|
1746
|
+
break;
|
|
1747
|
+
case "0":
|
|
1748
|
+
this.resetZoom();
|
|
1749
|
+
break;
|
|
1750
|
+
case "f":
|
|
1751
|
+
case "F":
|
|
1752
|
+
case "а":
|
|
1753
|
+
case "А":
|
|
1754
|
+
this.fitToScreen();
|
|
1755
|
+
break;
|
|
1756
|
+
case "/":
|
|
1757
|
+
this.focusSearch();
|
|
1758
|
+
break;
|
|
1759
|
+
case "ArrowLeft":
|
|
1760
|
+
case "ArrowRight":
|
|
1761
|
+
case "ArrowUp":
|
|
1762
|
+
case "ArrowDown":
|
|
1763
|
+
if (!onCanvas) return;
|
|
1764
|
+
this.panBy(event.key === "ArrowLeft" ? KEY_PAN : event.key === "ArrowRight" ? -48 : 0, event.key === "ArrowUp" ? KEY_PAN : event.key === "ArrowDown" ? -48 : 0);
|
|
1765
|
+
break;
|
|
1766
|
+
default: return;
|
|
1767
|
+
}
|
|
1768
|
+
event.preventDefault();
|
|
1769
|
+
event.stopPropagation();
|
|
1770
|
+
}
|
|
1771
|
+
toggleFullscreen() {
|
|
1772
|
+
const element = this.canvas()?.nativeElement;
|
|
1773
|
+
if (!element) return;
|
|
1774
|
+
if (this.nativeElement()) {
|
|
1775
|
+
this.exitNative();
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
if (this.fullscreen()) {
|
|
1779
|
+
this.leaveOverlay();
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
const request = element.requestFullscreen?.bind(element) ?? element.webkitRequestFullscreen?.bind(element);
|
|
1783
|
+
if (!request) {
|
|
1784
|
+
this.enterOverlay();
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
try {
|
|
1788
|
+
const result = request();
|
|
1789
|
+
if (result && typeof result.catch === "function") result.catch(() => this.enterOverlay());
|
|
1790
|
+
} catch {
|
|
1791
|
+
this.enterOverlay();
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
onFullscreenChange() {
|
|
1795
|
+
const native = this.nativeElement() === this.canvas()?.nativeElement;
|
|
1796
|
+
if (native) this.lockPage(true);
|
|
1797
|
+
else if (this.native()) this.unlockPage();
|
|
1798
|
+
this.native.set(native);
|
|
1799
|
+
if (native === this.fullscreen()) return;
|
|
1800
|
+
this.fullscreen.set(native);
|
|
1801
|
+
afterNextRender(() => this.fitToScreen(), { injector: this.injector });
|
|
1802
|
+
}
|
|
1803
|
+
exitOverlayFullscreen() {
|
|
1804
|
+
if (this.nativeElement() === this.canvas()?.nativeElement) {
|
|
1805
|
+
this.exitNative();
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
if (this.fullscreen() && !this.native()) this.leaveOverlay();
|
|
1809
|
+
}
|
|
1810
|
+
ngOnDestroy() {
|
|
1811
|
+
this.observer?.disconnect();
|
|
1812
|
+
if (this.nativeElement() === this.canvas()?.nativeElement) this.exitNative();
|
|
1813
|
+
this.unlockPage();
|
|
1814
|
+
}
|
|
1815
|
+
nativeElement() {
|
|
1816
|
+
const document = this.document;
|
|
1817
|
+
return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
|
|
1818
|
+
}
|
|
1819
|
+
exitNative() {
|
|
1820
|
+
const document = this.document;
|
|
1821
|
+
const result = (document.exitFullscreen?.bind(document) ?? document.webkitExitFullscreen?.bind(document))?.();
|
|
1822
|
+
if (result && typeof result.catch === "function") result.catch(() => void 0);
|
|
1823
|
+
}
|
|
1824
|
+
enterOverlay() {
|
|
1825
|
+
this.native.set(false);
|
|
1826
|
+
this.fullscreen.set(true);
|
|
1827
|
+
this.lockPage();
|
|
1828
|
+
afterNextRender(() => {
|
|
1829
|
+
const element = this.canvas()?.nativeElement;
|
|
1830
|
+
if (element?.showPopover && this.fullscreen()) {
|
|
1831
|
+
element.setAttribute("popover", "manual");
|
|
1832
|
+
try {
|
|
1833
|
+
element.showPopover();
|
|
1834
|
+
this.topLayer.set(true);
|
|
1835
|
+
} catch {
|
|
1836
|
+
element.removeAttribute("popover");
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
this.fitToScreen();
|
|
1840
|
+
}, { injector: this.injector });
|
|
1841
|
+
}
|
|
1842
|
+
leaveOverlay() {
|
|
1843
|
+
const element = this.canvas()?.nativeElement;
|
|
1844
|
+
if (this.topLayer() && element) {
|
|
1845
|
+
try {
|
|
1846
|
+
element.hidePopover?.();
|
|
1847
|
+
} catch {
|
|
1848
|
+
this.topLayer.set(false);
|
|
1849
|
+
}
|
|
1850
|
+
element.removeAttribute("popover");
|
|
1851
|
+
}
|
|
1852
|
+
this.topLayer.set(false);
|
|
1853
|
+
this.fullscreen.set(false);
|
|
1854
|
+
this.unlockPage();
|
|
1855
|
+
afterNextRender(() => this.fitToScreen(), { injector: this.injector });
|
|
1856
|
+
}
|
|
1857
|
+
lockPage(gutter = false) {
|
|
1858
|
+
if (this.pageLocked) return;
|
|
1859
|
+
const root = this.document.documentElement;
|
|
1860
|
+
this.pageOverflow = root.style.overflow;
|
|
1861
|
+
this.pageGutter = root.style.getPropertyValue("scrollbar-gutter");
|
|
1862
|
+
root.style.overflow = "hidden";
|
|
1863
|
+
if (gutter) root.style.setProperty("scrollbar-gutter", "auto");
|
|
1864
|
+
this.pageLocked = true;
|
|
1865
|
+
}
|
|
1866
|
+
unlockPage() {
|
|
1867
|
+
if (!this.pageLocked) return;
|
|
1868
|
+
const root = this.document.documentElement;
|
|
1869
|
+
root.style.overflow = this.pageOverflow;
|
|
1870
|
+
if (this.pageGutter) root.style.setProperty("scrollbar-gutter", this.pageGutter);
|
|
1871
|
+
else root.style.removeProperty("scrollbar-gutter");
|
|
1872
|
+
this.pageLocked = false;
|
|
1873
|
+
}
|
|
1874
|
+
panBy(dx, dy) {
|
|
1875
|
+
const { width, height } = this.minimapLayout();
|
|
1876
|
+
this.view.update((view) => boundView({
|
|
1877
|
+
...view,
|
|
1878
|
+
x: view.x + dx,
|
|
1879
|
+
y: view.y + dy
|
|
1880
|
+
}, this.viewport(), {
|
|
1881
|
+
width,
|
|
1882
|
+
height
|
|
1883
|
+
}));
|
|
1884
|
+
}
|
|
1885
|
+
zoomAtCenter(zoom) {
|
|
1886
|
+
const viewport = this.viewport();
|
|
1887
|
+
this.view.update((view) => zoomAt(view, clampZoom(zoom), {
|
|
1888
|
+
x: viewport.width / 2,
|
|
1889
|
+
y: viewport.height / 2
|
|
1890
|
+
}));
|
|
1891
|
+
}
|
|
1892
|
+
distance() {
|
|
1893
|
+
const [a, b] = [...this.pointers.values()];
|
|
1894
|
+
return a && b ? Math.hypot(a.x - b.x, a.y - b.y) : 0;
|
|
1895
|
+
}
|
|
1896
|
+
canvasRect() {
|
|
1897
|
+
return this.canvas()?.nativeElement.getBoundingClientRect() ?? new DOMRect();
|
|
1898
|
+
}
|
|
1899
|
+
focusSearch() {
|
|
1900
|
+
this.canvas()?.nativeElement.closest(".tx-org-chart")?.querySelector(this.fullscreen() ? ".tx-org-chart__floating input" : ".tx-org-chart__bar input")?.focus();
|
|
1901
|
+
}
|
|
1902
|
+
focusOn(key, id) {
|
|
1903
|
+
const stage = this.stage()?.nativeElement;
|
|
1904
|
+
const target = stage?.querySelector(`[data-org-id="${CSS.escape(id)}"]`);
|
|
1905
|
+
if (!stage || !target || !this.viewport().width) return;
|
|
1906
|
+
this.lastFocusKey = key;
|
|
1907
|
+
const rect = this.stageRect(target);
|
|
1908
|
+
this.view.update((view) => centerOn(view, this.viewport(), {
|
|
1909
|
+
x: rect.x + rect.width / 2,
|
|
1910
|
+
y: rect.y + rect.height / 2
|
|
1911
|
+
}, Math.max(view.zoom, TX_ORG_CHART_FOCUS_ZOOM)));
|
|
1912
|
+
}
|
|
1913
|
+
drawPath(ids) {
|
|
1914
|
+
const stage = this.stage()?.nativeElement;
|
|
1915
|
+
if (!stage) return;
|
|
1916
|
+
const rects = ids.map((id) => stage.querySelector(`.tx-org-chart-node__card[data-org-id="${CSS.escape(id)}"]`)).filter((element) => !!element).map((element) => this.stageRect(element));
|
|
1917
|
+
const style = this.document.defaultView?.getComputedStyle(stage);
|
|
1918
|
+
const gap = parseFloat(style?.getPropertyValue("--tx-chart-org-chart-connector-height") ?? "") || 24;
|
|
1919
|
+
const radius = parseFloat(style?.getPropertyValue("--tx-chart-org-chart-connector-radius") ?? "") || 0;
|
|
1920
|
+
this.pathLine.set(orgChartPathLine(rects, gap, this.isUnstyled() ? 0 : radius, .5));
|
|
1921
|
+
}
|
|
1922
|
+
stageRect(element) {
|
|
1923
|
+
const stage = this.stage()?.nativeElement;
|
|
1924
|
+
let x = 0;
|
|
1925
|
+
let y = 0;
|
|
1926
|
+
let current = element;
|
|
1927
|
+
while (current && current !== stage) {
|
|
1928
|
+
x += current.offsetLeft;
|
|
1929
|
+
y += current.offsetTop;
|
|
1930
|
+
current = current.offsetParent;
|
|
1931
|
+
}
|
|
1932
|
+
return {
|
|
1933
|
+
id: element.dataset["orgId"] ?? "",
|
|
1934
|
+
tone: element.dataset["orgTone"] ?? "default",
|
|
1935
|
+
x,
|
|
1936
|
+
y,
|
|
1937
|
+
width: element.offsetWidth,
|
|
1938
|
+
height: element.offsetHeight
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
measureMinimap() {
|
|
1942
|
+
const stage = this.stage()?.nativeElement;
|
|
1943
|
+
if (!stage) return;
|
|
1944
|
+
const items = [...stage.querySelectorAll(".tx-org-chart-node__card[data-org-id]")].map((element) => this.stageRect(element));
|
|
1945
|
+
this.minimapLayout.set({
|
|
1946
|
+
width: stage.offsetWidth,
|
|
1947
|
+
height: stage.offsetHeight,
|
|
1948
|
+
items
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
observeViewport(canvas) {
|
|
1952
|
+
const update = () => this.viewport.set({
|
|
1953
|
+
width: canvas.clientWidth,
|
|
1954
|
+
height: canvas.clientHeight
|
|
1955
|
+
});
|
|
1956
|
+
update();
|
|
1957
|
+
const view = this.document.defaultView;
|
|
1958
|
+
if (view && "ResizeObserver" in view) {
|
|
1959
|
+
this.observer = new view.ResizeObserver(update);
|
|
1960
|
+
this.observer.observe(canvas);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1964
|
+
minVersion: "12.0.0",
|
|
1965
|
+
version: "22.2.3",
|
|
1966
|
+
ngImport: i0,
|
|
1967
|
+
type: TxOrgChart,
|
|
1968
|
+
deps: [],
|
|
1969
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1970
|
+
});
|
|
1971
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1972
|
+
minVersion: "17.0.0",
|
|
1973
|
+
version: "22.2.3",
|
|
1974
|
+
type: TxOrgChart,
|
|
1975
|
+
isStandalone: true,
|
|
1976
|
+
selector: "tx-org-chart",
|
|
1977
|
+
inputs: {
|
|
1978
|
+
nodes: {
|
|
1979
|
+
classPropertyName: "nodes",
|
|
1980
|
+
publicName: "nodes",
|
|
1981
|
+
isSignal: true,
|
|
1982
|
+
isRequired: false,
|
|
1983
|
+
transformFunction: null
|
|
1984
|
+
},
|
|
1985
|
+
highlightIds: {
|
|
1986
|
+
classPropertyName: "highlightIds",
|
|
1987
|
+
publicName: "highlightIds",
|
|
1988
|
+
isSignal: true,
|
|
1989
|
+
isRequired: false,
|
|
1990
|
+
transformFunction: null
|
|
1991
|
+
},
|
|
1992
|
+
focusId: {
|
|
1993
|
+
classPropertyName: "focusId",
|
|
1994
|
+
publicName: "focusId",
|
|
1995
|
+
isSignal: true,
|
|
1996
|
+
isRequired: false,
|
|
1997
|
+
transformFunction: null
|
|
1998
|
+
},
|
|
1999
|
+
labels: {
|
|
2000
|
+
classPropertyName: "labels",
|
|
2001
|
+
publicName: "labels",
|
|
2002
|
+
isSignal: true,
|
|
2003
|
+
isRequired: false,
|
|
2004
|
+
transformFunction: null
|
|
2005
|
+
},
|
|
2006
|
+
toolbar: {
|
|
2007
|
+
classPropertyName: "toolbar",
|
|
2008
|
+
publicName: "toolbar",
|
|
2009
|
+
isSignal: true,
|
|
2010
|
+
isRequired: false,
|
|
2011
|
+
transformFunction: null
|
|
2012
|
+
},
|
|
2013
|
+
minimap: {
|
|
2014
|
+
classPropertyName: "minimap",
|
|
2015
|
+
publicName: "minimap",
|
|
2016
|
+
isSignal: true,
|
|
2017
|
+
isRequired: false,
|
|
2018
|
+
transformFunction: null
|
|
2019
|
+
},
|
|
2020
|
+
height: {
|
|
2021
|
+
classPropertyName: "height",
|
|
2022
|
+
publicName: "height",
|
|
2023
|
+
isSignal: true,
|
|
2024
|
+
isRequired: false,
|
|
2025
|
+
transformFunction: null
|
|
2026
|
+
},
|
|
2027
|
+
busy: {
|
|
2028
|
+
classPropertyName: "busy",
|
|
2029
|
+
publicName: "busy",
|
|
2030
|
+
isSignal: true,
|
|
2031
|
+
isRequired: false,
|
|
2032
|
+
transformFunction: null
|
|
2033
|
+
},
|
|
2034
|
+
pathKinds: {
|
|
2035
|
+
classPropertyName: "pathKinds",
|
|
2036
|
+
publicName: "pathKinds",
|
|
2037
|
+
isSignal: true,
|
|
2038
|
+
isRequired: false,
|
|
2039
|
+
transformFunction: null
|
|
2040
|
+
},
|
|
2041
|
+
dt: {
|
|
2042
|
+
classPropertyName: "dt",
|
|
2043
|
+
publicName: "dt",
|
|
2044
|
+
isSignal: true,
|
|
2045
|
+
isRequired: false,
|
|
2046
|
+
transformFunction: null
|
|
2047
|
+
},
|
|
2048
|
+
pt: {
|
|
2049
|
+
classPropertyName: "pt",
|
|
2050
|
+
publicName: "pt",
|
|
2051
|
+
isSignal: true,
|
|
2052
|
+
isRequired: false,
|
|
2053
|
+
transformFunction: null
|
|
2054
|
+
},
|
|
2055
|
+
ptOptions: {
|
|
2056
|
+
classPropertyName: "ptOptions",
|
|
2057
|
+
publicName: "ptOptions",
|
|
2058
|
+
isSignal: true,
|
|
2059
|
+
isRequired: false,
|
|
2060
|
+
transformFunction: null
|
|
2061
|
+
},
|
|
2062
|
+
unstyled: {
|
|
2063
|
+
classPropertyName: "unstyled",
|
|
2064
|
+
publicName: "unstyled",
|
|
2065
|
+
isSignal: true,
|
|
2066
|
+
isRequired: false,
|
|
2067
|
+
transformFunction: null
|
|
2068
|
+
}
|
|
2069
|
+
},
|
|
2070
|
+
outputs: {
|
|
2071
|
+
nodeToggle: "nodeToggle",
|
|
2072
|
+
nodeClick: "nodeClick",
|
|
2073
|
+
searchChange: "searchChange",
|
|
2074
|
+
expandAll: "expandAll",
|
|
2075
|
+
collapseAll: "collapseAll"
|
|
2076
|
+
},
|
|
2077
|
+
host: {
|
|
2078
|
+
listeners: {
|
|
2079
|
+
"document:fullscreenchange": "onFullscreenChange()",
|
|
2080
|
+
"document:webkitfullscreenchange": "onFullscreenChange()",
|
|
2081
|
+
"document:keydown.escape": "exitOverlayFullscreen()"
|
|
2082
|
+
},
|
|
2083
|
+
properties: {
|
|
2084
|
+
"class": "passThrough().root?.class",
|
|
2085
|
+
"style": "hostStyle()",
|
|
2086
|
+
"attr.data-styled": "!isUnstyled() || null"
|
|
2087
|
+
},
|
|
2088
|
+
classAttribute: "tx-org-chart"
|
|
2089
|
+
},
|
|
2090
|
+
queries: [{
|
|
2091
|
+
propertyName: "nodeTemplate",
|
|
2092
|
+
first: true,
|
|
2093
|
+
predicate: TxOrgChartNodeTemplate,
|
|
2094
|
+
descendants: true,
|
|
2095
|
+
isSignal: true
|
|
2096
|
+
}],
|
|
2097
|
+
viewQueries: [{
|
|
2098
|
+
propertyName: "canvas",
|
|
2099
|
+
first: true,
|
|
2100
|
+
predicate: ["canvas"],
|
|
2101
|
+
descendants: true,
|
|
2102
|
+
isSignal: true
|
|
2103
|
+
}, {
|
|
2104
|
+
propertyName: "stage",
|
|
2105
|
+
first: true,
|
|
2106
|
+
predicate: ["stage"],
|
|
2107
|
+
descendants: true,
|
|
2108
|
+
isSignal: true
|
|
2109
|
+
}],
|
|
2110
|
+
ngImport: i0,
|
|
2111
|
+
template: "@let label = text();\n@let parts = passThrough();\n<div class=\"tx-org-chart__bar\" [class]=\"parts.bar?.class\" [style]=\"parts.bar?.style\">\n <div class=\"tx-org-chart__heading\">\n <ng-content select=\"[txOrgChartHeader]\" />\n </div>\n @if (toolbar()) {\n <tx-org-chart-toolbar\n [class]=\"parts.toolbar?.class\"\n [style]=\"parts.toolbar?.style\"\n [state]=\"toolbarState()\"\n [labels]=\"label\"\n [intl]=\"intl()\"\n [query]=\"query()\"\n [moreLabel]=\"label.more\"\n [unstyled]=\"isUnstyled()\"\n (searchChange)=\"onSearch($event)\"\n (zoomIn)=\"zoomIn()\"\n (zoomOut)=\"zoomOut()\"\n (resetZoom)=\"resetZoom()\"\n (fit)=\"fitToScreen()\"\n (expandAll)=\"expandAll.emit()\"\n (collapseAll)=\"collapseAll.emit()\"\n (fullscreen)=\"toggleFullscreen()\"\n />\n }\n</div>\n\n@if (fullscreen() && !native() && !topLayer()) {\n <div class=\"tx-org-chart__backdrop\" aria-hidden=\"true\"></div>\n}\n<div\n #canvas\n class=\"tx-org-chart__canvas\"\n [class]=\"parts.canvas?.class\"\n [style]=\"parts.canvas?.style\"\n [style.height]=\"fullscreen() ? null : height()\"\n [class.tx-org-chart__canvas--busy]=\"busy()\"\n [class.tx-org-chart__canvas--fullscreen]=\"fullscreen()\"\n [class.tx-org-chart__canvas--native]=\"native()\"\n [class.tx-org-chart__canvas--top-layer]=\"topLayer()\"\n [class.tx-org-chart__canvas--dragging]=\"dragging()\"\n [class.tx-org-chart__canvas--settled]=\"settled()\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label.title\"\n [attr.aria-busy]=\"busy() || null\"\n (wheel)=\"onWheel($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n @if (fullscreen()) {\n <div class=\"tx-org-chart__floating\" data-drag-ignore>\n <span class=\"tx-org-chart__floating-title\">\n {{ label.title }}\n <span class=\"tx-org-chart__hint\">{{ label.hint }}</span>\n </span>\n @if (toolbar()) {\n <tx-org-chart-toolbar\n [state]=\"toolbarState()\"\n [labels]=\"label\"\n [intl]=\"intl()\"\n [query]=\"query()\"\n [moreLabel]=\"label.more\"\n [unstyled]=\"isUnstyled()\"\n (searchChange)=\"onSearch($event)\"\n (zoomIn)=\"zoomIn()\"\n (zoomOut)=\"zoomOut()\"\n (resetZoom)=\"resetZoom()\"\n (fit)=\"fitToScreen()\"\n (expandAll)=\"expandAll.emit()\"\n (collapseAll)=\"collapseAll.emit()\"\n (fullscreen)=\"toggleFullscreen()\"\n />\n }\n </div>\n }\n <div #stage class=\"tx-org-chart__stage\" [class]=\"parts.stage?.class\" [style]=\"parts.stage?.style\" [style.transform]=\"stageTransform()\">\n @if (pathLine()) {\n <svg class=\"tx-org-chart__path\" aria-hidden=\"true\" [attr.width]=\"minimapLayout().width\" [attr.height]=\"minimapLayout().height\">\n <path [attr.d]=\"pathLine()\"></path>\n </svg>\n }\n <div class=\"tx-org-chart__forest\" role=\"list\">\n @for (root of list(); track root.id) {\n <tx-org-chart-node\n [node]=\"root\"\n [state]=\"treeState()\"\n [template]=\"nodeTemplate()?.template ?? null\"\n root\n (toggleNode)=\"nodeToggle.emit($event)\"\n (hoverPath)=\"highlightPath($event)\"\n (nodeClick)=\"onNodeClick($event)\"\n />\n }\n </div>\n </div>\n @if (minimap()) {\n <tx-org-chart-minimap\n [class]=\"parts.minimap?.class\"\n [style]=\"parts.minimap?.style\"\n [layout]=\"minimapLayout()\"\n [viewport]=\"viewport()\"\n [view]=\"view()\"\n (navigate)=\"centerOn($event)\"\n />\n }\n</div>\n@if (!fullscreen() && label.hint) {\n <span class=\"tx-org-chart__hint\" [class]=\"parts.hint?.class\" [style]=\"parts.hint?.style\">{{ label.hint }}</span>\n}\n",
|
|
2112
|
+
styles: [".tx-org-chart{display:flex;flex-direction:column;min-width:0}.tx-org-chart__bar{container:tx-org-chart-bar/inline-size;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between}.tx-org-chart__heading{min-width:0}.tx-org-chart__heading:empty{display:none}.tx-org-chart__canvas{position:relative;overflow:hidden;touch-action:none;outline:none;user-select:none;-webkit-user-select:none}.tx-org-chart__stage{position:absolute;top:0;left:0;display:flex;width:max-content;transform-origin:0 0;will-change:transform}.tx-org-chart__forest{position:relative;display:flex;align-items:flex-start}.tx-org-chart__path{position:absolute;top:0;left:0;z-index:1;overflow:visible;pointer-events:none}.tx-org-chart__path path{fill:none;stroke-linejoin:round;stroke-linecap:butt}.tx-org-chart__floating{container:tx-org-chart-floating/inline-size;position:absolute;inset:0 0 auto;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;cursor:default}.tx-org-chart__floating-title{display:flex;flex-direction:column}.tx-org-chart__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end}.tx-org-chart__search{width:100%}.tx-org-chart__group{display:flex;align-items:center}.tx-org-chart-toolbar{flex:1 1 auto;min-width:0}.tx-org-chart__more{display:none!important}.tx-org-chart__menu-zoom{display:flex;align-items:center}@container tx-org-chart-bar (width < 56rem){.tx-org-chart__expand-group,.tx-org-chart__fullscreen{display:none!important}.tx-org-chart__more{display:inline-flex!important}.tx-org-chart__search{flex:1 1 12rem;width:auto}}@container tx-org-chart-bar (width < 30rem){.tx-org-chart__zoom-group{display:none!important}}@container tx-org-chart-floating (width < 40rem){.tx-org-chart__floating-title .tx-org-chart__hint{display:none}.tx-org-chart__search{flex:1 1 100%;width:auto}.tx-org-chart__actions{justify-content:flex-start}.tx-org-chart__expand-group .tx-button__label,.tx-org-chart__fullscreen .tx-button__label{position:absolute;overflow:hidden;width:1px;height:1px;clip-path:inset(50%);white-space:nowrap}}.tx-org-chart-minimap{position:absolute;z-index:10;display:block;overflow:hidden;cursor:default}.tx-org-chart__map{position:relative;overflow:hidden;cursor:pointer;touch-action:none}.tx-org-chart__map-item,.tx-org-chart__map-viewport{position:absolute;display:block}.tx-org-chart__map-viewport{box-sizing:border-box;pointer-events:none}.tx-org-chart[data-styled],.tx-org-chart[data-styled] .tx-org-chart__bar{gap:var(--tx-chart-org-chart-gap)}.tx-org-chart[data-styled] .tx-org-chart__canvas{min-height:var(--tx-chart-org-chart-canvas-min-height);border-radius:var(--tx-chart-org-chart-canvas-radius);background-color:var(--tx-chart-org-chart-canvas-background);background-image:radial-gradient(var(--tx-chart-org-chart-canvas-dot-color) 1px,transparent 1px);background-size:var(--tx-chart-org-chart-canvas-dot-gap) var(--tx-chart-org-chart-canvas-dot-gap);box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color);cursor:grab;transition:opacity var(--tx-chart-org-chart-stage-duration) ease}.tx-org-chart[data-styled] .tx-org-chart__canvas:focus-visible{box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color),0 0 0 calc(var(--tx-chart-focus-ring-width) + 1px) var(--tx-chart-focus-ring-color)}.tx-org-chart[data-styled] .tx-org-chart__canvas--dragging{cursor:grabbing}.tx-org-chart[data-styled] .tx-org-chart__canvas--busy{opacity:var(--tx-chart-org-chart-busy-opacity);pointer-events:none}.tx-org-chart[data-styled] .tx-org-chart__canvas--fullscreen{position:fixed;inset:var(--tx-chart-org-chart-fullscreen-inset);z-index:var(--tx-chart-org-chart-fullscreen-layer);height:auto;min-height:0;border-radius:var(--tx-chart-org-chart-fullscreen-radius);box-shadow:var(--tx-chart-org-chart-fullscreen-shadow)}.tx-org-chart[data-styled] .tx-org-chart__canvas--top-layer{margin:0;padding:0;width:auto;max-width:none;max-height:none;border:0;color:inherit;overflow:hidden}.tx-org-chart[data-styled] .tx-org-chart__canvas--top-layer::backdrop{background:var(--tx-chart-org-chart-backdrop);-webkit-backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur));backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur))}.tx-org-chart[data-styled] .tx-org-chart__canvas--native{inset:0;width:100%;height:100%;border-radius:0;box-shadow:none}.tx-org-chart[data-styled] .tx-org-chart__backdrop{position:fixed;inset:0;z-index:calc(var(--tx-chart-org-chart-fullscreen-layer) - 1);background:var(--tx-chart-org-chart-backdrop);-webkit-backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur));backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur))}.tx-org-chart[data-styled] .tx-org-chart__floating{gap:var(--tx-chart-org-chart-toolbar-gap);padding:var(--tx-chart-org-chart-floating-padding);border-bottom:1px solid var(--tx-chart-org-chart-canvas-border-color);background:var(--tx-chart-org-chart-floating-background);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.tx-org-chart[data-styled] .tx-org-chart__floating-title{color:var(--tx-chart-org-chart-title-color);font-size:var(--tx-chart-org-chart-floating-title-font-size);font-weight:var(--tx-chart-org-chart-floating-title-font-weight)}.tx-org-chart[data-styled] .tx-org-chart__hint{color:var(--tx-chart-org-chart-hint-color);font-size:var(--tx-chart-org-chart-hint-font-size);font-weight:var(--tx-font-weight-regular)}.tx-org-chart[data-styled] .tx-org-chart__stage{padding:var(--tx-chart-org-chart-stage-padding)}.tx-org-chart[data-styled] .tx-org-chart__canvas--settled:not(.tx-org-chart__canvas--dragging) .tx-org-chart__stage{transition:transform var(--tx-chart-org-chart-stage-duration) ease-out}.tx-org-chart[data-styled] .tx-org-chart__forest{gap:var(--tx-chart-org-chart-forest-gap)}.tx-org-chart[data-styled] .tx-org-chart__path path{stroke:var(--tx-chart-org-chart-path-color);stroke-width:var(--tx-chart-org-chart-path-width)}.tx-org-chart[data-styled] .tx-org-chart__actions{gap:var(--tx-chart-org-chart-toolbar-gap)}.tx-org-chart[data-styled] .tx-org-chart__group{gap:var(--tx-chart-org-chart-toolbar-group-gap)}.tx-org-chart[data-styled] .tx-org-chart-minimap{right:var(--tx-chart-org-chart-minimap-inset);bottom:var(--tx-chart-org-chart-minimap-inset);padding:var(--tx-chart-org-chart-minimap-padding);border-radius:var(--tx-chart-org-chart-minimap-radius);background:var(--tx-chart-org-chart-minimap-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color),var(--tx-chart-org-chart-minimap-shadow);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.tx-org-chart[data-styled] .tx-org-chart__map{border-radius:var(--tx-chart-org-chart-minimap-map-radius);background:var(--tx-chart-org-chart-minimap-map-background)}.tx-org-chart[data-styled] .tx-org-chart__map-item{border-radius:var(--tx-chart-org-chart-minimap-item-radius);background:var(--tx-chart-org-chart-minimap-item-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=primary]{background:var(--tx-chart-org-chart-minimap-primary-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=accent]{background:var(--tx-chart-org-chart-minimap-accent-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=muted]{background:var(--tx-chart-org-chart-minimap-muted-color)}.tx-org-chart[data-styled] .tx-org-chart__map-viewport{border:2px solid var(--tx-chart-org-chart-minimap-viewport-color);border-radius:var(--tx-chart-org-chart-minimap-map-radius);background:var(--tx-chart-org-chart-minimap-viewport-background)}@container tx-org-chart-bar (width >= 56rem){.tx-org-chart[data-styled] .tx-org-chart__search{width:var(--tx-chart-org-chart-search-width)}}.tx-org-chart__menu-zoom[data-styled]{gap:var(--tx-chart-org-chart-toolbar-group-gap);padding:var(--tx-actions-menu-list-padding);padding-bottom:var(--tx-chart-org-chart-toolbar-gap);border-bottom:1px solid var(--tx-chart-org-chart-canvas-border-color)}.tx-org-chart__menu-zoom[data-styled] .tx-org-chart__menu-percent{flex:1}@media(prefers-reduced-motion:reduce){.tx-org-chart[data-styled] .tx-org-chart__canvas,.tx-org-chart[data-styled] .tx-org-chart__canvas--settled .tx-org-chart__stage{transition:none}}.tx-org-chart__canvas:fullscreen{width:100%;height:100%}.tx-org-chart__canvas:-webkit-full-screen{width:100%;height:100%}\n"],
|
|
2113
|
+
dependencies: [
|
|
2114
|
+
{
|
|
2115
|
+
kind: "component",
|
|
2116
|
+
type: TxOrgChartNodeView,
|
|
2117
|
+
selector: "tx-org-chart-node",
|
|
2118
|
+
inputs: [
|
|
2119
|
+
"node",
|
|
2120
|
+
"state",
|
|
2121
|
+
"template",
|
|
2122
|
+
"root",
|
|
2123
|
+
"path"
|
|
2124
|
+
],
|
|
2125
|
+
outputs: [
|
|
2126
|
+
"toggleNode",
|
|
2127
|
+
"hoverPath",
|
|
2128
|
+
"nodeClick"
|
|
2129
|
+
]
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
kind: "component",
|
|
2133
|
+
type: TxOrgChartToolbar,
|
|
2134
|
+
selector: "tx-org-chart-toolbar",
|
|
2135
|
+
inputs: [
|
|
2136
|
+
"state",
|
|
2137
|
+
"labels",
|
|
2138
|
+
"intl",
|
|
2139
|
+
"query",
|
|
2140
|
+
"moreLabel",
|
|
2141
|
+
"unstyled"
|
|
2142
|
+
],
|
|
2143
|
+
outputs: [
|
|
2144
|
+
"searchChange",
|
|
2145
|
+
"zoomIn",
|
|
2146
|
+
"zoomOut",
|
|
2147
|
+
"resetZoom",
|
|
2148
|
+
"fit",
|
|
2149
|
+
"expandAll",
|
|
2150
|
+
"collapseAll",
|
|
2151
|
+
"fullscreen"
|
|
2152
|
+
]
|
|
2153
|
+
},
|
|
2154
|
+
{
|
|
2155
|
+
kind: "component",
|
|
2156
|
+
type: TxOrgChartMinimap,
|
|
2157
|
+
selector: "tx-org-chart-minimap",
|
|
2158
|
+
inputs: [
|
|
2159
|
+
"layout",
|
|
2160
|
+
"viewport",
|
|
2161
|
+
"view"
|
|
2162
|
+
],
|
|
2163
|
+
outputs: ["navigate"]
|
|
2164
|
+
}
|
|
2165
|
+
],
|
|
2166
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2167
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
2168
|
+
});
|
|
2169
|
+
};
|
|
2170
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2171
|
+
minVersion: "12.0.0",
|
|
2172
|
+
version: "22.2.3",
|
|
2173
|
+
ngImport: i0,
|
|
2174
|
+
type: TxOrgChart,
|
|
2175
|
+
decorators: [{
|
|
2176
|
+
type: Component,
|
|
2177
|
+
args: [{
|
|
2178
|
+
selector: "tx-org-chart",
|
|
2179
|
+
imports: [
|
|
2180
|
+
TxOrgChartNodeView,
|
|
2181
|
+
TxOrgChartToolbar,
|
|
2182
|
+
TxOrgChartMinimap
|
|
2183
|
+
],
|
|
2184
|
+
encapsulation: ViewEncapsulation.None,
|
|
2185
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2186
|
+
host: {
|
|
2187
|
+
class: "tx-org-chart",
|
|
2188
|
+
"[class]": "passThrough().root?.class",
|
|
2189
|
+
"[style]": "hostStyle()",
|
|
2190
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
2191
|
+
"(document:fullscreenchange)": "onFullscreenChange()",
|
|
2192
|
+
"(document:webkitfullscreenchange)": "onFullscreenChange()",
|
|
2193
|
+
"(document:keydown.escape)": "exitOverlayFullscreen()"
|
|
2194
|
+
},
|
|
2195
|
+
template: "@let label = text();\n@let parts = passThrough();\n<div class=\"tx-org-chart__bar\" [class]=\"parts.bar?.class\" [style]=\"parts.bar?.style\">\n <div class=\"tx-org-chart__heading\">\n <ng-content select=\"[txOrgChartHeader]\" />\n </div>\n @if (toolbar()) {\n <tx-org-chart-toolbar\n [class]=\"parts.toolbar?.class\"\n [style]=\"parts.toolbar?.style\"\n [state]=\"toolbarState()\"\n [labels]=\"label\"\n [intl]=\"intl()\"\n [query]=\"query()\"\n [moreLabel]=\"label.more\"\n [unstyled]=\"isUnstyled()\"\n (searchChange)=\"onSearch($event)\"\n (zoomIn)=\"zoomIn()\"\n (zoomOut)=\"zoomOut()\"\n (resetZoom)=\"resetZoom()\"\n (fit)=\"fitToScreen()\"\n (expandAll)=\"expandAll.emit()\"\n (collapseAll)=\"collapseAll.emit()\"\n (fullscreen)=\"toggleFullscreen()\"\n />\n }\n</div>\n\n@if (fullscreen() && !native() && !topLayer()) {\n <div class=\"tx-org-chart__backdrop\" aria-hidden=\"true\"></div>\n}\n<div\n #canvas\n class=\"tx-org-chart__canvas\"\n [class]=\"parts.canvas?.class\"\n [style]=\"parts.canvas?.style\"\n [style.height]=\"fullscreen() ? null : height()\"\n [class.tx-org-chart__canvas--busy]=\"busy()\"\n [class.tx-org-chart__canvas--fullscreen]=\"fullscreen()\"\n [class.tx-org-chart__canvas--native]=\"native()\"\n [class.tx-org-chart__canvas--top-layer]=\"topLayer()\"\n [class.tx-org-chart__canvas--dragging]=\"dragging()\"\n [class.tx-org-chart__canvas--settled]=\"settled()\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label.title\"\n [attr.aria-busy]=\"busy() || null\"\n (wheel)=\"onWheel($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n @if (fullscreen()) {\n <div class=\"tx-org-chart__floating\" data-drag-ignore>\n <span class=\"tx-org-chart__floating-title\">\n {{ label.title }}\n <span class=\"tx-org-chart__hint\">{{ label.hint }}</span>\n </span>\n @if (toolbar()) {\n <tx-org-chart-toolbar\n [state]=\"toolbarState()\"\n [labels]=\"label\"\n [intl]=\"intl()\"\n [query]=\"query()\"\n [moreLabel]=\"label.more\"\n [unstyled]=\"isUnstyled()\"\n (searchChange)=\"onSearch($event)\"\n (zoomIn)=\"zoomIn()\"\n (zoomOut)=\"zoomOut()\"\n (resetZoom)=\"resetZoom()\"\n (fit)=\"fitToScreen()\"\n (expandAll)=\"expandAll.emit()\"\n (collapseAll)=\"collapseAll.emit()\"\n (fullscreen)=\"toggleFullscreen()\"\n />\n }\n </div>\n }\n <div #stage class=\"tx-org-chart__stage\" [class]=\"parts.stage?.class\" [style]=\"parts.stage?.style\" [style.transform]=\"stageTransform()\">\n @if (pathLine()) {\n <svg class=\"tx-org-chart__path\" aria-hidden=\"true\" [attr.width]=\"minimapLayout().width\" [attr.height]=\"minimapLayout().height\">\n <path [attr.d]=\"pathLine()\"></path>\n </svg>\n }\n <div class=\"tx-org-chart__forest\" role=\"list\">\n @for (root of list(); track root.id) {\n <tx-org-chart-node\n [node]=\"root\"\n [state]=\"treeState()\"\n [template]=\"nodeTemplate()?.template ?? null\"\n root\n (toggleNode)=\"nodeToggle.emit($event)\"\n (hoverPath)=\"highlightPath($event)\"\n (nodeClick)=\"onNodeClick($event)\"\n />\n }\n </div>\n </div>\n @if (minimap()) {\n <tx-org-chart-minimap\n [class]=\"parts.minimap?.class\"\n [style]=\"parts.minimap?.style\"\n [layout]=\"minimapLayout()\"\n [viewport]=\"viewport()\"\n [view]=\"view()\"\n (navigate)=\"centerOn($event)\"\n />\n }\n</div>\n@if (!fullscreen() && label.hint) {\n <span class=\"tx-org-chart__hint\" [class]=\"parts.hint?.class\" [style]=\"parts.hint?.style\">{{ label.hint }}</span>\n}\n",
|
|
2196
|
+
styles: [".tx-org-chart{display:flex;flex-direction:column;min-width:0}.tx-org-chart__bar{container:tx-org-chart-bar/inline-size;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between}.tx-org-chart__heading{min-width:0}.tx-org-chart__heading:empty{display:none}.tx-org-chart__canvas{position:relative;overflow:hidden;touch-action:none;outline:none;user-select:none;-webkit-user-select:none}.tx-org-chart__stage{position:absolute;top:0;left:0;display:flex;width:max-content;transform-origin:0 0;will-change:transform}.tx-org-chart__forest{position:relative;display:flex;align-items:flex-start}.tx-org-chart__path{position:absolute;top:0;left:0;z-index:1;overflow:visible;pointer-events:none}.tx-org-chart__path path{fill:none;stroke-linejoin:round;stroke-linecap:butt}.tx-org-chart__floating{container:tx-org-chart-floating/inline-size;position:absolute;inset:0 0 auto;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;cursor:default}.tx-org-chart__floating-title{display:flex;flex-direction:column}.tx-org-chart__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end}.tx-org-chart__search{width:100%}.tx-org-chart__group{display:flex;align-items:center}.tx-org-chart-toolbar{flex:1 1 auto;min-width:0}.tx-org-chart__more{display:none!important}.tx-org-chart__menu-zoom{display:flex;align-items:center}@container tx-org-chart-bar (width < 56rem){.tx-org-chart__expand-group,.tx-org-chart__fullscreen{display:none!important}.tx-org-chart__more{display:inline-flex!important}.tx-org-chart__search{flex:1 1 12rem;width:auto}}@container tx-org-chart-bar (width < 30rem){.tx-org-chart__zoom-group{display:none!important}}@container tx-org-chart-floating (width < 40rem){.tx-org-chart__floating-title .tx-org-chart__hint{display:none}.tx-org-chart__search{flex:1 1 100%;width:auto}.tx-org-chart__actions{justify-content:flex-start}.tx-org-chart__expand-group .tx-button__label,.tx-org-chart__fullscreen .tx-button__label{position:absolute;overflow:hidden;width:1px;height:1px;clip-path:inset(50%);white-space:nowrap}}.tx-org-chart-minimap{position:absolute;z-index:10;display:block;overflow:hidden;cursor:default}.tx-org-chart__map{position:relative;overflow:hidden;cursor:pointer;touch-action:none}.tx-org-chart__map-item,.tx-org-chart__map-viewport{position:absolute;display:block}.tx-org-chart__map-viewport{box-sizing:border-box;pointer-events:none}.tx-org-chart[data-styled],.tx-org-chart[data-styled] .tx-org-chart__bar{gap:var(--tx-chart-org-chart-gap)}.tx-org-chart[data-styled] .tx-org-chart__canvas{min-height:var(--tx-chart-org-chart-canvas-min-height);border-radius:var(--tx-chart-org-chart-canvas-radius);background-color:var(--tx-chart-org-chart-canvas-background);background-image:radial-gradient(var(--tx-chart-org-chart-canvas-dot-color) 1px,transparent 1px);background-size:var(--tx-chart-org-chart-canvas-dot-gap) var(--tx-chart-org-chart-canvas-dot-gap);box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color);cursor:grab;transition:opacity var(--tx-chart-org-chart-stage-duration) ease}.tx-org-chart[data-styled] .tx-org-chart__canvas:focus-visible{box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color),0 0 0 calc(var(--tx-chart-focus-ring-width) + 1px) var(--tx-chart-focus-ring-color)}.tx-org-chart[data-styled] .tx-org-chart__canvas--dragging{cursor:grabbing}.tx-org-chart[data-styled] .tx-org-chart__canvas--busy{opacity:var(--tx-chart-org-chart-busy-opacity);pointer-events:none}.tx-org-chart[data-styled] .tx-org-chart__canvas--fullscreen{position:fixed;inset:var(--tx-chart-org-chart-fullscreen-inset);z-index:var(--tx-chart-org-chart-fullscreen-layer);height:auto;min-height:0;border-radius:var(--tx-chart-org-chart-fullscreen-radius);box-shadow:var(--tx-chart-org-chart-fullscreen-shadow)}.tx-org-chart[data-styled] .tx-org-chart__canvas--top-layer{margin:0;padding:0;width:auto;max-width:none;max-height:none;border:0;color:inherit;overflow:hidden}.tx-org-chart[data-styled] .tx-org-chart__canvas--top-layer::backdrop{background:var(--tx-chart-org-chart-backdrop);-webkit-backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur));backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur))}.tx-org-chart[data-styled] .tx-org-chart__canvas--native{inset:0;width:100%;height:100%;border-radius:0;box-shadow:none}.tx-org-chart[data-styled] .tx-org-chart__backdrop{position:fixed;inset:0;z-index:calc(var(--tx-chart-org-chart-fullscreen-layer) - 1);background:var(--tx-chart-org-chart-backdrop);-webkit-backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur));backdrop-filter:blur(var(--tx-chart-org-chart-backdrop-blur))}.tx-org-chart[data-styled] .tx-org-chart__floating{gap:var(--tx-chart-org-chart-toolbar-gap);padding:var(--tx-chart-org-chart-floating-padding);border-bottom:1px solid var(--tx-chart-org-chart-canvas-border-color);background:var(--tx-chart-org-chart-floating-background);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.tx-org-chart[data-styled] .tx-org-chart__floating-title{color:var(--tx-chart-org-chart-title-color);font-size:var(--tx-chart-org-chart-floating-title-font-size);font-weight:var(--tx-chart-org-chart-floating-title-font-weight)}.tx-org-chart[data-styled] .tx-org-chart__hint{color:var(--tx-chart-org-chart-hint-color);font-size:var(--tx-chart-org-chart-hint-font-size);font-weight:var(--tx-font-weight-regular)}.tx-org-chart[data-styled] .tx-org-chart__stage{padding:var(--tx-chart-org-chart-stage-padding)}.tx-org-chart[data-styled] .tx-org-chart__canvas--settled:not(.tx-org-chart__canvas--dragging) .tx-org-chart__stage{transition:transform var(--tx-chart-org-chart-stage-duration) ease-out}.tx-org-chart[data-styled] .tx-org-chart__forest{gap:var(--tx-chart-org-chart-forest-gap)}.tx-org-chart[data-styled] .tx-org-chart__path path{stroke:var(--tx-chart-org-chart-path-color);stroke-width:var(--tx-chart-org-chart-path-width)}.tx-org-chart[data-styled] .tx-org-chart__actions{gap:var(--tx-chart-org-chart-toolbar-gap)}.tx-org-chart[data-styled] .tx-org-chart__group{gap:var(--tx-chart-org-chart-toolbar-group-gap)}.tx-org-chart[data-styled] .tx-org-chart-minimap{right:var(--tx-chart-org-chart-minimap-inset);bottom:var(--tx-chart-org-chart-minimap-inset);padding:var(--tx-chart-org-chart-minimap-padding);border-radius:var(--tx-chart-org-chart-minimap-radius);background:var(--tx-chart-org-chart-minimap-background);box-shadow:0 0 0 1px var(--tx-chart-org-chart-canvas-border-color),var(--tx-chart-org-chart-minimap-shadow);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.tx-org-chart[data-styled] .tx-org-chart__map{border-radius:var(--tx-chart-org-chart-minimap-map-radius);background:var(--tx-chart-org-chart-minimap-map-background)}.tx-org-chart[data-styled] .tx-org-chart__map-item{border-radius:var(--tx-chart-org-chart-minimap-item-radius);background:var(--tx-chart-org-chart-minimap-item-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=primary]{background:var(--tx-chart-org-chart-minimap-primary-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=accent]{background:var(--tx-chart-org-chart-minimap-accent-color)}.tx-org-chart[data-styled] .tx-org-chart__map-item[data-tone=muted]{background:var(--tx-chart-org-chart-minimap-muted-color)}.tx-org-chart[data-styled] .tx-org-chart__map-viewport{border:2px solid var(--tx-chart-org-chart-minimap-viewport-color);border-radius:var(--tx-chart-org-chart-minimap-map-radius);background:var(--tx-chart-org-chart-minimap-viewport-background)}@container tx-org-chart-bar (width >= 56rem){.tx-org-chart[data-styled] .tx-org-chart__search{width:var(--tx-chart-org-chart-search-width)}}.tx-org-chart__menu-zoom[data-styled]{gap:var(--tx-chart-org-chart-toolbar-group-gap);padding:var(--tx-actions-menu-list-padding);padding-bottom:var(--tx-chart-org-chart-toolbar-gap);border-bottom:1px solid var(--tx-chart-org-chart-canvas-border-color)}.tx-org-chart__menu-zoom[data-styled] .tx-org-chart__menu-percent{flex:1}@media(prefers-reduced-motion:reduce){.tx-org-chart[data-styled] .tx-org-chart__canvas,.tx-org-chart[data-styled] .tx-org-chart__canvas--settled .tx-org-chart__stage{transition:none}}.tx-org-chart__canvas:fullscreen{width:100%;height:100%}.tx-org-chart__canvas:-webkit-full-screen{width:100%;height:100%}\n"]
|
|
2197
|
+
}]
|
|
2198
|
+
}],
|
|
2199
|
+
ctorParameters: () => [],
|
|
2200
|
+
propDecorators: {
|
|
2201
|
+
canvas: [{
|
|
2202
|
+
type: i0.ViewChild,
|
|
2203
|
+
args: ["canvas", { isSignal: true }]
|
|
2204
|
+
}],
|
|
2205
|
+
stage: [{
|
|
2206
|
+
type: i0.ViewChild,
|
|
2207
|
+
args: ["stage", { isSignal: true }]
|
|
2208
|
+
}],
|
|
2209
|
+
nodes: [{
|
|
2210
|
+
type: i0.Input,
|
|
2211
|
+
args: [{
|
|
2212
|
+
isSignal: true,
|
|
2213
|
+
alias: "nodes",
|
|
2214
|
+
required: false
|
|
2215
|
+
}]
|
|
2216
|
+
}],
|
|
2217
|
+
highlightIds: [{
|
|
2218
|
+
type: i0.Input,
|
|
2219
|
+
args: [{
|
|
2220
|
+
isSignal: true,
|
|
2221
|
+
alias: "highlightIds",
|
|
2222
|
+
required: false
|
|
2223
|
+
}]
|
|
2224
|
+
}],
|
|
2225
|
+
focusId: [{
|
|
2226
|
+
type: i0.Input,
|
|
2227
|
+
args: [{
|
|
2228
|
+
isSignal: true,
|
|
2229
|
+
alias: "focusId",
|
|
2230
|
+
required: false
|
|
2231
|
+
}]
|
|
2232
|
+
}],
|
|
2233
|
+
labels: [{
|
|
2234
|
+
type: i0.Input,
|
|
2235
|
+
args: [{
|
|
2236
|
+
isSignal: true,
|
|
2237
|
+
alias: "labels",
|
|
2238
|
+
required: false
|
|
2239
|
+
}]
|
|
2240
|
+
}],
|
|
2241
|
+
toolbar: [{
|
|
2242
|
+
type: i0.Input,
|
|
2243
|
+
args: [{
|
|
2244
|
+
isSignal: true,
|
|
2245
|
+
alias: "toolbar",
|
|
2246
|
+
required: false
|
|
2247
|
+
}]
|
|
2248
|
+
}],
|
|
2249
|
+
minimap: [{
|
|
2250
|
+
type: i0.Input,
|
|
2251
|
+
args: [{
|
|
2252
|
+
isSignal: true,
|
|
2253
|
+
alias: "minimap",
|
|
2254
|
+
required: false
|
|
2255
|
+
}]
|
|
2256
|
+
}],
|
|
2257
|
+
height: [{
|
|
2258
|
+
type: i0.Input,
|
|
2259
|
+
args: [{
|
|
2260
|
+
isSignal: true,
|
|
2261
|
+
alias: "height",
|
|
2262
|
+
required: false
|
|
2263
|
+
}]
|
|
2264
|
+
}],
|
|
2265
|
+
busy: [{
|
|
2266
|
+
type: i0.Input,
|
|
2267
|
+
args: [{
|
|
2268
|
+
isSignal: true,
|
|
2269
|
+
alias: "busy",
|
|
2270
|
+
required: false
|
|
2271
|
+
}]
|
|
2272
|
+
}],
|
|
2273
|
+
pathKinds: [{
|
|
2274
|
+
type: i0.Input,
|
|
2275
|
+
args: [{
|
|
2276
|
+
isSignal: true,
|
|
2277
|
+
alias: "pathKinds",
|
|
2278
|
+
required: false
|
|
2279
|
+
}]
|
|
2280
|
+
}],
|
|
2281
|
+
dt: [{
|
|
2282
|
+
type: i0.Input,
|
|
2283
|
+
args: [{
|
|
2284
|
+
isSignal: true,
|
|
2285
|
+
alias: "dt",
|
|
2286
|
+
required: false
|
|
2287
|
+
}]
|
|
2288
|
+
}],
|
|
2289
|
+
pt: [{
|
|
2290
|
+
type: i0.Input,
|
|
2291
|
+
args: [{
|
|
2292
|
+
isSignal: true,
|
|
2293
|
+
alias: "pt",
|
|
2294
|
+
required: false
|
|
2295
|
+
}]
|
|
2296
|
+
}],
|
|
2297
|
+
ptOptions: [{
|
|
2298
|
+
type: i0.Input,
|
|
2299
|
+
args: [{
|
|
2300
|
+
isSignal: true,
|
|
2301
|
+
alias: "ptOptions",
|
|
2302
|
+
required: false
|
|
2303
|
+
}]
|
|
2304
|
+
}],
|
|
2305
|
+
unstyled: [{
|
|
2306
|
+
type: i0.Input,
|
|
2307
|
+
args: [{
|
|
2308
|
+
isSignal: true,
|
|
2309
|
+
alias: "unstyled",
|
|
2310
|
+
required: false
|
|
2311
|
+
}]
|
|
2312
|
+
}],
|
|
2313
|
+
nodeToggle: [{
|
|
2314
|
+
type: i0.Output,
|
|
2315
|
+
args: ["nodeToggle"]
|
|
2316
|
+
}],
|
|
2317
|
+
nodeClick: [{
|
|
2318
|
+
type: i0.Output,
|
|
2319
|
+
args: ["nodeClick"]
|
|
2320
|
+
}],
|
|
2321
|
+
searchChange: [{
|
|
2322
|
+
type: i0.Output,
|
|
2323
|
+
args: ["searchChange"]
|
|
2324
|
+
}],
|
|
2325
|
+
expandAll: [{
|
|
2326
|
+
type: i0.Output,
|
|
2327
|
+
args: ["expandAll"]
|
|
2328
|
+
}],
|
|
2329
|
+
collapseAll: [{
|
|
2330
|
+
type: i0.Output,
|
|
2331
|
+
args: ["collapseAll"]
|
|
2332
|
+
}],
|
|
2333
|
+
nodeTemplate: [{
|
|
2334
|
+
type: i0.ContentChild,
|
|
2335
|
+
args: [i0.forwardRef(() => TxOrgChartNodeTemplate), { isSignal: true }]
|
|
2336
|
+
}]
|
|
2337
|
+
}
|
|
2338
|
+
});
|
|
2339
|
+
export { TX_ORG_CHART_COMPACT_WIDTH, TX_ORG_CHART_CONNECTOR_GAP, TX_ORG_CHART_FOCUS_ZOOM, TX_ORG_CHART_KEEP_VISIBLE, TX_ORG_CHART_MINIMAP, TX_ORG_CHART_MINIMAP_COMPACT, TX_ORG_CHART_PADDING, TX_ORG_CHART_WHEEL_MAX_DELTA, TX_ORG_CHART_WHEEL_SPEED, TX_ORG_CHART_ZOOM, TxOrgChart, TxOrgChartCard, TxOrgChartNodeSkeleton, TxOrgChartNodeTemplate, boundView, centerOn, clampZoom, fitView, orgChartChildren, orgChartExpandAll, orgChartExpandState, orgChartPathLine, orgChartPathTo, orgChartReveal, orgChartSearch, orgChartToggle, wheelIsMouse, wheelZoom, zoomAt };
|
|
2340
|
+
|
|
2341
|
+
//# sourceMappingURL=tectra-ng-charts-org-chart.mjs.map
|