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

@@ -68,13 +68,13 @@
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="{
content: param.hasOwnProperty('active')
:title="
param.hasOwnProperty('active')
? param.active
? $t('turn_off')
: $t('turn_on')
: $t('turn_off'),
}"
: $t('turn_off')
"
:icon="
param.hasOwnProperty('active')
? param.active

View File

@@ -9,7 +9,13 @@
<template #body>
<label for="requestType">{{ $t("choose_language") }}</label>
<span class="select-wrapper">
<tippy tabindex="-1" trigger="click" theme="popover" arrow>
<tippy
ref="options"
tabindex="-1"
trigger="click"
theme="popover"
arrow
>
<template #trigger>
<pre v-if="requestType">{{
codegens.find((x) => x.id === requestType).name
@@ -24,10 +30,15 @@
autofocus
/>
</template>
<div v-for="gen in codegens" :key="gen.id">
<ButtonSecondary @click.native="requestType = gen.id" />
{{ gen.name }}
</div>
<SmartItem
v-for="gen in codegens"
:key="gen.id"
:label="gen.name"
@click.native="
requestType = gen.id
$refs.options.tippy().hide()
"
/>
</tippy>
</span>
<div class="row-wrapper">

View File

@@ -63,13 +63,13 @@
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="{
content: header.hasOwnProperty('active')
:title="
header.hasOwnProperty('active')
? header.active
? $t('turn_off')
: $t('turn_on')
: $t('turn_off'),
}"
: $t('turn_off')
"
:icon="
param.hasOwnProperty('active')
? param.active

View File

@@ -82,13 +82,13 @@
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
title="{
content: param.hasOwnProperty('active')
:title="
param.hasOwnProperty('active')
? param.active
? $t('turn_off')
: $t('turn_on')
: $t('turn_off'),
}"
: $t('turn_off')
"
:icon="
param.hasOwnProperty('active')
? param.active