-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree-node.component.html
More file actions
63 lines (63 loc) · 2.37 KB
/
tree-node.component.html
File metadata and controls
63 lines (63 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@let hasChildren = node().children.length > 0;
<div
class="tree-node d-flex flex-column"
[class.terminal-node]="!hasChildren"
>
@if (hasChildren) {
<div class="d-flex">
@for (childRow of node().children; track $index) {
<la-tree-node class="w-100" [node]="childRow" [treeType]="treeType()" />
}
</div>
}
<div
class="node-content d-flex flex-column align-items-center px-2 py-1 gap-1"
>
@switch (node().type) {
@case ('leaf') {
<div class="d-flex flex-column align-items-center gap-1">
<div class="fw-bold mb-0">
<strong>{{ node().leaf?.lem }}</strong>
</div>
<div class="text-secondary">
<small>{{ node().leaf?.tok }}</small>
<br />
<small>{{ node().leaf?.pos }}</small>
<br />
<small>{{ node().leaf?.ner }}</small>
</div>
@if (node().content; as nodeContent) {
<div [innerHTML]="nodeContent | subscript" class="text-nowrap"></div>
}
</div>
} @case ('var') {
<div class="d-flex flex-column gap-1">
<strong class="h5 fw-bold mb-0">
{{ node().content }}
@if (node().rule) {
<span class="badge rounded-pill text-bg-secondary mt-2">
{{ node().rule }}
</span>
}
</strong>
<br />
<span>{{ node().var?.typeInfo }}</span>
</div>
} @case ('node') {
<p class="my-0">
@if (node().rule; as nodeRule) {
<span class="badge rounded-pill text-bg-secondary me-2">
{{ nodeRule }}
</span>
}
@if (node().content; as nodeContent) {
<span
class="mb-0 text-nowrap"
[innerHTML]="nodeContent | selectiveUpperCase: treeType() | subscript"
></span>
}
</p>
}
}
</div>
</div>