Add tooltip for help text
This commit is contained in:
parent
e525e0d3de
commit
0fd1e928ae
|
|
@ -0,0 +1,67 @@
|
||||||
|
<template>
|
||||||
|
<div class="helpful-tooltip">
|
||||||
|
<info-icon class="helpful-tooltip__icon"></info-icon>
|
||||||
|
<div class="helpful-tooltip__text">
|
||||||
|
{{text}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import InfoIcon from '@/components/icons/InfoIcon';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['text'],
|
||||||
|
|
||||||
|
components: {
|
||||||
|
InfoIcon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "@/styles/_variables.scss";
|
||||||
|
@import "@/styles/_mixins.scss";
|
||||||
|
|
||||||
|
.helpful-tooltip {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
fill: $color-grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__text {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 30px;
|
||||||
|
top: 0px;
|
||||||
|
white-space: nowrap;
|
||||||
|
background-color: $color-white;
|
||||||
|
border: 1px solid $color-grey;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: $small-spacing;
|
||||||
|
@include small-text;
|
||||||
|
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 16px;
|
||||||
|
margin-left: -2px;
|
||||||
|
border-left: 1px solid $color-grey;
|
||||||
|
border-top: 1px solid $color-grey;
|
||||||
|
background-color: $color-white;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
transform: rotate(-45deg) translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover &__text {
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="text-form-with-help-text">
|
<div class="text-form-with-help-text">
|
||||||
<h3 class="text-form-with-help-text__heading"><span class="text-form-with-help-text__title">{{title}}</span>
|
<h3 class="text-form-with-help-text__heading"><span class="text-form-with-help-text__title">{{title}}</span>
|
||||||
<info-icon class="text-form-with-help-text__icon"></info-icon>
|
<helpful-tooltip :text="helpText"></helpful-tooltip>
|
||||||
</h3>
|
</h3>
|
||||||
<text-form @text-change-value="$emit('change', $event)" :value="v"></text-form>
|
<text-form @text-change-value="$emit('change', $event)" :value="v"></text-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TextForm from '@/components/content-forms/TextForm';
|
import TextForm from '@/components/content-forms/TextForm';
|
||||||
import InfoIcon from '@/components/icons/InfoIcon';
|
import HelpfulTooltip from '@/components/HelpfulTooltip';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['title', 'value'],
|
props: ['title', 'value', 'helpText'],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
TextForm,
|
TextForm,
|
||||||
InfoIcon
|
HelpfulTooltip
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
|
|
@ -47,11 +48,5 @@
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__icon {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
fill: $color-grey;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<modal :hide-header="true">
|
<modal :hide-header="true">
|
||||||
<div class="project-entry-modal">
|
<div class="project-entry-modal">
|
||||||
<text-form-with-help-text title="Tätigkeit" :value="activity" @change="activity = $event">
|
<text-form-with-help-text title="Tätigkeit" :value="activity" @change="activity = $event" help-text="Hilfetext für Tätigkeit">
|
||||||
</text-form-with-help-text>
|
</text-form-with-help-text>
|
||||||
<text-form-with-help-text title="Reflexion" :value="reflection" @change="reflection = $event">
|
<text-form-with-help-text title="Reflexion" :value="reflection" @change="reflection = $event" help-text="Hilfetext für Reflexion">
|
||||||
</text-form-with-help-text>
|
</text-form-with-help-text>
|
||||||
<text-form-with-help-text title="Nächste Schritte" :value="nextSteps" @change="nextSteps = $event">
|
<text-form-with-help-text title="Nächste Schritte" :value="nextSteps" @change="nextSteps = $event" help-text="Hilfetext für Nächste Schritte">
|
||||||
</text-form-with-help-text>
|
</text-form-with-help-text>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
manual: true,
|
manual: true,
|
||||||
|
// todo: do we really need manual here? update should do the trick too
|
||||||
result({data, loading, networkStatus}) {
|
result({data, loading, networkStatus}) {
|
||||||
if (!loading) {
|
if (!loading) {
|
||||||
this.room = Object.assign({}, this.$getRidOfEdges(data).room);
|
this.room = Object.assign({}, this.$getRidOfEdges(data).room);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue