refactor(ui): popovers

This commit is contained in:
Liyas Thomas
2021-07-05 16:52:15 +00:00
committed by GitHub
parent 256d4b3e07
commit ed91486d53
42 changed files with 828 additions and 866 deletions

View File

@@ -17,48 +17,50 @@
v-if="
mode == 'import_export' && collectionsType.type == 'my-collections'
"
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

@@ -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

View File

@@ -38,40 +38,47 @@
icon="check_box"
@click.native="$emit('unselect-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', {
folder: collection,
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', {
folder: collection,
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

@@ -25,42 +25,43 @@
>
<i v-else class="material-icons">folder_open</i>
</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"
:label="$t('edit')"
@click.native="
$emit('edit-folder', {
folder,
folderIndex,
collectionIndex,
folderPath,
})
"
/>
</div>
<div>
<ButtonSecondary
icon="delete"
:labl="$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"
:label="$t('edit')"
@click.native="
$emit('edit-folder', {
folder,
folderIndex,
collectionIndex,
folderPath,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:labl="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<div v-show="showChildren || isFiltered">

View File

@@ -21,37 +21,37 @@
@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', {
collectionIndex,
folderIndex,
folderName,
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', {
collectionIndex,
folderIndex,
folderName,
request,
requestIndex,
folderPath,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<SmartConfirmModal

View File

@@ -30,44 +30,51 @@
icon="check_box"
@click.native="$emit('unselect-collection')"
/>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy
ref="options"
tabindex="-1"
trigger="click"
theme="popover"
arrow
>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', {
folder: collection,
path: `${collectionIndex}`,
})
"
/>
</div>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create"
:label="$t('edit')"
@click.native="$emit('edit-collection')"
/>
</div>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', {
folder: collection,
path: `${collectionIndex}`,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create"
:label="$t('edit')"
@click.native="
$emit('edit-collection')
$refs.options.tippy().hide()
"
/>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
</div>

View File

@@ -17,46 +17,47 @@
>
<i v-else class="material-icons">folder_open</i>
</div>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy ref="options" tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<ButtonSecondary
<TabPrimary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="$emit('add-folder', { folder, path: folderPath })"
/>
</div>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-folder', {
folder,
folderIndex,
collectionIndex,
folderPath: '',
})
"
/>
</div>
<div>
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
@click.native="
$emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
"
/>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-folder', {
folder,
folderIndex,
collectionIndex,
folderPath: '',
})
$refs.options.tippy().hide()
"
/>
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<div v-show="showChildren || isFiltered">

View File

@@ -15,37 +15,37 @@
request.method
}}</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-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
icon="more_vert"
/>
</template>
<div>
<ButtonSecondary
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-request', {
collectionIndex,
folderIndex,
folderName,
request,
requestIndex,
})
"
/>
</div>
<div>
<ButtonSecondary
icon="delete"
:label="$t('delete')"
@click.native="confirmRemove = true"
/>
</div>
<SmartItem
icon="edit"
:label="$t('edit')"
@click.native="
$emit('edit-request', {
collectionIndex,
folderIndex,
folderName,
request,
requestIndex,
})
$refs.options.tippy().hide()
"
/>
<SmartItem
icon="delete"
:label="$t('delete')"
@click.native="
confirmRemove = true
$refs.options.tippy().hide()
"
/>
</tippy>
</div>
<SmartConfirmModal