feat: tooltip and popover components

This commit is contained in:
Liyas Thomas
2021-07-02 16:30:08 +00:00
committed by GitHub
parent eaf0da3d00
commit 0e443b3a43
63 changed files with 1172 additions and 1461 deletions

View File

@@ -14,7 +14,8 @@
/>
</li>
<button
v-tooltip="{
v-tippy="{ theme: 'tooltip' }"
title="{
content: !entry.star ? $t('add_star') : $t('remove_star'),
}"
data-testid="star_button"
@@ -27,7 +28,8 @@
</i>
</button>
<button
v-tooltip="{
v-tippy="{ theme: 'tooltip' }"
title="{
content: expand ? $t('hide_more') : $t('show_more'),
}"
data-testid="query_expand"
@@ -38,41 +40,40 @@
{{ expand ? "unfold_less" : "unfold_more" }}
</i>
</button>
<v-popover>
<button
v-tooltip="$t('options')"
data-testid="options"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
<template #popover>
<div>
<button
v-close-popover
data-testid="restore_history_entry"
class="icon button"
:aria-label="$t('restore')"
@click="$emit('use-entry')"
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
</div>
<div>
<button
v-close-popover
data-testid="delete_history_entry"
class="icon button"
:aria-label="$t('delete')"
@click="$emit('delete-entry')"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
</div>
<tippy trigger="click" theme="popover" arrow>
<template #trigger>
<button
v-tippy="{ theme: 'tooltip' }"
:title="$t('options')"
data-testid="options"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
</template>
</v-popover>
<div>
<button
data-testid="restore_history_entry"
class="icon button"
:aria-label="$t('restore')"
@click="$emit('use-entry')"
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
</div>
<div>
<button
data-testid="delete_history_entry"
class="icon button"
:aria-label="$t('delete')"
@click="$emit('delete-entry')"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
</div>
</tippy>
</div>
<div class="show-on-large-screen">
<li data-testid="'query'">
@@ -91,7 +92,8 @@
<div v-if="showMore" class="show-on-large-screen">
<li>
<input
v-tooltip="entry.date"
v-tippy="{ theme: 'tooltip' }"
title="entry.date"
:aria-label="$t('time')"
type="text"
readonly

View File

@@ -54,7 +54,8 @@
<span>{{ $t("clear_all") }}</span>
</button>
<button
v-tooltip="{ content: !showMore ? $t('show_more') : $t('hide_more') }"
v-tippy="{ theme: 'tooltip' }"
title="{ content: !showMore ? $t('show_more') : $t('hide_more') }"
class="icon button"
@click="toggleCollapse()"
>
@@ -69,7 +70,8 @@
</p>
<div>
<button
v-tooltip="$t('yes')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('yes')"
data-testid="confirm_clear_history"
class="icon button"
@click="clearHistory"
@@ -77,7 +79,8 @@
<i class="material-icons">done</i>
</button>
<button
v-tooltip="$t('no')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('no')"
data-testid="reject_clear_history"
class="icon button"
@click="disableHistoryClearing"

View File

@@ -22,7 +22,8 @@
</li>
<span>
<button
v-tooltip="{
v-tippy="{ theme: 'tooltip' }"
title="{
content: !entry.star ? $t('add_star') : $t('remove_star'),
}"
data-testid="star_button"
@@ -38,7 +39,7 @@
<!-- <li>
<button
class="icon button"
v-tooltip="{
v-tippy="{ theme: 'tooltip' }" title="{
content: !entry.usesScripts
? 'No pre-request script'
: 'Used pre-request script'
@@ -49,37 +50,39 @@
</i>
</button>
</li> -->
<v-popover>
<button v-tooltip="$t('options')" class="tooltip-target icon button">
<i class="material-icons">more_vert</i>
</button>
<template #popover>
<div>
<button
v-close-popover
data-testid="restore_history_entry"
class="icon button"
:aria-label="$t('edit')"
@click="$emit('use-entry')"
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
</div>
<div>
<button
v-close-popover
data-testid="delete_history_entry"
class="icon button"
:aria-label="$t('delete')"
@click="$emit('delete-entry')"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
</div>
<tippy trigger="click" theme="popover" arrow>
<template #trigger>
<button
v-tippy="{ theme: 'tooltip' }"
:title="$t('options')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
</template>
</v-popover>
<div>
<button
data-testid="restore_history_entry"
class="icon button"
:aria-label="$t('edit')"
@click="$emit('use-entry')"
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
</div>
<div>
<button
data-testid="delete_history_entry"
class="icon button"
:aria-label="$t('delete')"
@click="$emit('delete-entry')"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
</div>
</tippy>
</div>
<div class="show-on-large-screen">
<li>
@@ -97,7 +100,8 @@
<div v-if="showMore" class="show-on-large-screen">
<li>
<input
v-tooltip="entry.date"
v-tippy="{ theme: 'tooltip' }"
title="entry.date"
:aria-label="$t('time')"
type="text"
readonly