Newer
Older
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<VueTooltipster :showClosebutton="false">
<h1>{{header_text}}</h1><span class="word-classification">{{group_list}}</span>
<div slot="content" class="tooltip">
<div v-for="lemma in lemmas">
<h4>{{lemma.word}}</h4>
<table v-for="grp in lemma.inflection_groups">
<tr>
<th rowspan="2">{{grp.group_designation}}</th>
<th v-for="form in grp.forms">{{form}}</th>
</tr>
<tr>
<td v-for="inflection in grp.inflections">{{inflection}}</td>
</tr>
</table>
</div>
</div>
</VueTooltipster>
</template>
<script>
import VueTooltipster from './vue-tooltipster.vue';
import jQuery from 'jquery';
window.jQuery = jQuery;
export default {
name: 'Header',
props: {
lemmas: Array
},
computed: {
header_text: function() {
return this.lemmas.map(
function(item){
return item.word
}
).join(', ')
},
group_list: function() {
var grp_collection = new Set()
this.lemmas.forEach(function(lemma){
lemma.inflection_groups.forEach(function(grp){
grp_collection.add(grp.group_designation)
})
})
return Array.from(grp_collection).join(';')
}
},
components: {
VueTooltipster
}
}
</script>
<style>
.word-classification {
text-decoration: underline dashed;
}
h1 {
display: inline;
}
.tooltip {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
.tooltip table {
border-collapse: collapse;
margin: 10px;
}
.tooltip td, .tooltip th {
border: solid;
border-width: 1px;
margin: 0px 0px 0px 0px;
padding: 3px;
}
</style>