feat: refactor buttons

This commit is contained in:
Liyas Thomas
2021-07-03 13:14:58 +00:00
committed by GitHub
parent 04b0cd2d3b
commit 1ee2fecbc2
103 changed files with 2150 additions and 2496 deletions

View File

@@ -1,85 +1,74 @@
<template>
<div>
<div class="transition duration-150 ease-in-out row-wrapper">
<button class="icon button" @click="toggleShowChildren">
<i v-show="!showChildren && !isFiltered" class="material-icons"
>arrow_right</i
>
<i v-show="showChildren || isFiltered" class="material-icons"
>arrow_drop_down</i
>
<div class="ease-in-out row-wrapper">
<ButtonSecondary @click.native="toggleShowChildren" />
<i v-show="!showChildren && !isFiltered" class="material-icons"
>arrow_right</i
>
<i v-show="showChildren || isFiltered" class="material-icons"
>arrow_drop_down</i
>
<i v-if="isSelected" class="text-green-400 material-icons"
>check_circle</i
>
<i v-if="isSelected" class="text-green-400 material-icons"
>check_circle</i
>
<i v-else class="material-icons">folder</i>
<span>{{ collection.title }}</span>
<i v-else class="material-icons">folder</i>
<span>{{ collection.title }}</span>
</button>
<div>
<button
<ButtonSecondary
v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }"
:title="$t('import')"
class="icon button"
@click="$emit('select-collection')"
>
<i class="material-icons">check_box_outline_blank</i>
</button>
<button
@click.native="$emit('select-collection')"
/>
<i class="material-icons">check_box_outline_blank</i>
<ButtonSecondary
v-if="doc && selected"
v-tippy="{ theme: 'tooltip' }"
:title="$t('delete')"
class="icon button"
@click="$emit('unselect-collection')"
>
<i class="material-icons">check_box</i>
</button>
<tippy trigger="click" theme="popover" arrow>
@click.native="$emit('unselect-collection')"
/>
<i class="material-icons">check_box</i>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
/>
<i class="material-icons">more_vert</i>
</template>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="
@click.native="
$emit('add-folder', {
folder: collection,
path: `${collectionIndex}`,
})
"
>
<i class="material-icons">create_new_folder</i>
<span>{{ $t("new_folder") }}</span>
</button>
/>
<i class="material-icons">create_new_folder</i>
<span>{{ $t("new_folder") }}</span>
</div>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="$emit('edit-collection')"
>
<i class="material-icons">create</i>
<span>{{ $t("edit") }}</span>
</button>
@click.native="$emit('edit-collection')"
/>
<i class="material-icons">create</i>
<span>{{ $t("edit") }}</span>
</div>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="confirmRemove = true"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
@click.native="confirmRemove = true"
/>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</div>
</tippy>
</div>

View File

@@ -1,49 +1,43 @@
<template>
<div>
<div class="transition duration-150 ease-in-out row-wrapper">
<div class="ease-in-out row-wrapper">
<div>
<button class="icon button" @click="toggleShowChildren">
<i v-show="!showChildren && !isFiltered" class="material-icons"
>arrow_right</i
>
<i v-show="showChildren || isFiltered" class="material-icons"
>arrow_drop_down</i
>
<ButtonSecondary @click.native="toggleShowChildren" />
<i v-show="!showChildren && !isFiltered" class="material-icons"
>arrow_right</i
>
<i v-show="showChildren || isFiltered" class="material-icons"
>arrow_drop_down</i
>
<i v-if="isSelected" class="text-green-400 material-icons"
>check_circle</i
>
<i v-if="isSelected" class="text-green-400 material-icons"
>check_circle</i
>
<i v-else class="material-icons">folder_open</i>
<span>{{ folder.name ? folder.name : folder.title }}</span>
</button>
<i v-else class="material-icons">folder_open</i>
<span>{{ folder.name ? folder.name : folder.title }}</span>
</div>
<tippy trigger="click" theme="popover" arrow>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
/>
<i class="material-icons">more_vert</i>
</template>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="$emit('add-folder', { folder, path: folderPath })"
>
<i class="material-icons">create_new_folder</i>
<span>{{ $t("new_folder") }}</span>
</button>
@click.native="$emit('add-folder', { folder, path: folderPath })"
/>
<i class="material-icons">create_new_folder</i>
<span>{{ $t("new_folder") }}</span>
</div>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="
@click.native="
$emit('edit-folder', {
folder,
folderIndex,
@@ -51,20 +45,17 @@
folderPath: '',
})
"
>
<i class="material-icons">edit</i>
<span>{{ $t("edit") }}</span>
</button>
/>
<i class="material-icons">edit</i>
<span>{{ $t("edit") }}</span>
</div>
<div>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
class="icon button"
@click="confirmRemove = true"
>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
@click.native="confirmRemove = true"
/>
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</div>
</tippy>
</div>

View File

@@ -1,38 +1,33 @@
<template>
<div>
<div class="transition duration-150 ease-in-out row-wrapper">
<div class="ease-in-out row-wrapper">
<div>
<button
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="!doc ? $t('use_request') : ''"
class="icon button"
@click="!doc ? selectRequest() : {}"
@click.native="!doc ? selectRequest() : {}"
/>
<i v-if="isSelected" class="mx-3 text-green-400 material-icons"
>check_circle</i
>
<i v-if="isSelected" class="mx-3 text-green-400 material-icons"
>check_circle</i
>
<span v-else :class="getRequestLabelColor(request.method)">{{
request.method
}}</span>
<span>{{ request.name }}</span>
</button>
<span v-else :class="getRequestLabelColor(request.method)">{{
request.method
}}</span>
<span>{{ request.name }}</span>
</div>
<tippy trigger="click" theme="popover" arrow>
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<template #trigger>
<button
<ButtonSecondary
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
v-tippy="{ theme: 'tooltip' }"
:title="$t('more')"
class="tooltip-target icon button"
>
<i class="material-icons">more_vert</i>
</button>
/>
<i class="material-icons">more_vert</i>
</template>
<div>
<button
class="icon button"
@click="
<ButtonSecondary
@click.native="
$emit('edit-request', {
collectionIndex,
folderIndex,
@@ -41,16 +36,14 @@
requestIndex,
})
"
>
<i class="material-icons">edit</i>
<span>{{ $t("edit") }}</span>
</button>
/>
<i class="material-icons">edit</i>
<span>{{ $t("edit") }}</span>
</div>
<div>
<button class="icon button" @click="confirmRemove = true">
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</button>
<ButtonSecondary @click.native="confirmRemove = true" />
<i class="material-icons">delete</i>
<span>{{ $t("delete") }}</span>
</div>
</tippy>
</div>