refactor(ui): popovers

This commit is contained in:
Liyas Thomas
2021-07-05 16:52:15 +00:00
committed by GitHub
parent fde5b0717d
commit 93d373c032
42 changed files with 828 additions and 827 deletions

View File

@@ -31,39 +31,46 @@
icon="topic"
@click.native="$emit('select-collection')"
/>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy
ref="options"
tabindex="-1"
trigger="click"
theme="popover"
arrow
>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', {
path: `${collectionIndex}`,
})
"
/>
</div>
<div>
<ButtonSecondary
icon="create"
label="$t('edit')"
@click.native="$emit('edit-collection')"
/>
</div>
<div>
<ButtonSecondary
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', {
path: `${collectionIndex}`,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="create"
:label="$t('edit')"
@click.native="
$emit('edit-collection')
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
</div>

View File

@@ -23,35 +23,38 @@
<i v-else class="material-icons">folder_open</i>
<span>{{ folder.name }}</span>
</div>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy ref="options" tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="$emit('add-folder', { folder, path: folderPath })"
/>
</div>
<div>
<ButtonSecondary
icon="edit"
:labeel="$t('edit')"
@click.native="$emit('edit-folder', { folder, folderPath })"
/>
</div>
<div>
<ButtonSecondary
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="edit"
:labeel="$t('edit')"
@click.native="
$emit('edit-folder', { folder, folderPath })
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<div v-show="showChildren || isFiltered">

View File

@@ -3,44 +3,51 @@
<template #header>
<h3 class="heading">{{ $t("import_export") }} {{ $t("collections") }}</h3>
<div>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy
ref="options"
tabindex="-1"
trigger="click"
theme="popover"
arrow
>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
icon="assignment_returned"
:label="$t('import_from_gist')"
@click.native="readCollectionGist"
/>
</div>
<div
<SmartItem
icon="assignment_returned"
:label="$t('import_from_gist')"
@click.native="
readCollectionGist
$refs.options.tippy().hide()
"
/>
<SmartItem
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,
}"
>
<ButtonSecondary
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
icon="assignment_turned_in"
:label="$t('create_secret_gist')"
@click.native="createCollectionGist"
/>
</div>
:title="
!currentUser
? $t('login_with_github_to') + $t('create_secret_gist')
: currentUser.provider !== 'github.com'
? $t('login_with_github_to') + $t('create_secret_gist')
: null
"
:disabled="
!currentUser
? true
: currentUser.provider !== 'github.com'
? true
: false
"
icon="assignment_turned_in"
:label="$t('create_secret_gist')"
@click.native="
createCollectionGist
$refs.options.tippy().hide()
"
/>
</tippy>
<ButtonSecondary icon="close" @click.native="hideModal" />
</div>

View File

@@ -18,34 +18,34 @@
@click.native="!doc ? selectRequest() : {}"
/>
</div>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy ref="options" tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-request', {
request,
requestIndex,
folderPath,
})
"
/>
</div>
<div>
<ButtonSecondary
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-request', {
request,
requestIndex,
folderPath,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<SmartConfirmModal