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

@@ -22,7 +22,8 @@
<label for="variableList">{{ $t("env_variable_list") }}</label>
<div>
<button
v-tooltip.bottom="$t('clear')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('clear')"
class="icon button"
@click="clearContent($event)"
>
@@ -63,7 +64,8 @@
<li>
<button
id="variable"
v-tooltip.bottom="$t('delete')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')"
class="icon button"
@click="removeEnvironmentVariable(index)"
>

View File

@@ -7,33 +7,29 @@
<span>{{ environment.name }}</span>
</button>
</div>
<v-popover>
<button v-tooltip.left="$t('more')" class="tooltip-target icon button">
<i class="material-icons">more_vert</i>
</button>
<template #popover>
<div>
<button
v-close-popover
class="icon button"
@click="$emit('edit-environment')"
>
<i class="material-icons">create</i>
<span>{{ $t("edit") }}</span>
</button>
</div>
<div>
<button
v-close-popover
class="icon button"
@click="confirmRemove = true"
>
<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('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
</template>
</v-popover>
<div>
<button class="icon button" @click="$emit('edit-environment')">
<i class="material-icons">create</i>
<span>{{ $t("edit") }}</span>
</button>
</div>
<div>
<button class="icon button" @click="confirmRemove = true">
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
</div>
</tippy>
</div>
<SmartConfirmModal
:show="confirmRemove"

View File

@@ -5,51 +5,48 @@
{{ $t("import_export") }} {{ $t("environments") }}
</h3>
<div>
<v-popover>
<button
v-tooltip.left="$t('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
<template #popover>
<div>
<button
v-close-popover
class="icon button"
@click="readEnvironmentGist"
>
<i class="material-icons">assignment_returned</i>
<span>{{ $t("import_from_gist") }}</span>
</button>
</div>
<div
v-tooltip.bottom="{
<tippy trigger="click" theme="popover" arrow>
<template #trigger>
<button
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
</template>
<div>
<button class="icon button" @click="readEnvironmentGist">
<i class="material-icons">assignment_returned</i>
<span>{{ $t("import_from_gist") }}</span>
</button>
</div>
<div
v-tippy="{ theme: 'tooltip' }"
title="{
content: !currentUser
? $t('login_with_github_to') + $t('create_secret_gist')
: currentUser.provider !== 'github.com'
? $t('login_with_github_to') + $t('create_secret_gist')
: null,
}"
>
<button
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
class="icon button"
@click="createEnvironmentGist"
>
<button
v-close-popover
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
class="icon button"
@click="createEnvironmentGist"
>
<i class="material-icons">assignment_turned_in</i>
<span>{{ $t("create_secret_gist") }}</span>
</button>
</div>
</template>
</v-popover>
<i class="material-icons">assignment_turned_in</i>
<span>{{ $t("create_secret_gist") }}</span>
</button>
</div>
</tippy>
<button class="icon button" @click="hideModal">
<i class="material-icons">close</i>
</button>
@@ -58,7 +55,8 @@
<template #body>
<div class="flex flex-col items-start p-2">
<button
v-tooltip="$t('replace_current')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('replace_current')"
class="icon button"
@click="openDialogChooseFileToReplaceWith"
>
@@ -74,7 +72,8 @@
/>
</button>
<button
v-tooltip="$t('preserve_current')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('preserve_current')"
class="icon button"
@click="openDialogChooseFileToImportFrom"
>
@@ -90,7 +89,8 @@
/>
</button>
<button
v-tooltip="$t('download_file')"
v-tippy="{ theme: 'tooltip' }"
:title="$t('download_file')"
class="icon button"
@click="exportJSON"
>