1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

Fix: Search table error #29

This commit is contained in:
lana-k
2020-12-22 16:09:03 +01:00
parent 94bb793b23
commit 9fca9b29dc
4 changed files with 47 additions and 36 deletions

View File

@@ -5,20 +5,7 @@
</div>
<div id="db">
<div @click="schemaVisible = !schemaVisible" class="db-name">
<svg
:style="{ transform: schemaVisible ? 'rotate(90deg)' : 'rotate(0)' }"
class="chevron-icon"
width="9"
height="9"
viewBox="0 0 8 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
:fill="schemaVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
/>
</svg>
<tree-chevron :expanded="schemaVisible"/>
{{ dbName }}
</div>
<div class="db-edit">
@@ -43,13 +30,15 @@
import TableDescription from '@/components/TableDescription'
import TextField from '@/components/TextField'
import ChangeDbIcon from '@/components/svg/changeDb'
import TreeChevron from '@/components/svg/treeChevron'
export default {
name: 'Schema',
components: {
TableDescription,
TextField,
ChangeDbIcon
ChangeDbIcon,
TreeChevron
},
data () {
return {
@@ -66,7 +55,7 @@ export default {
return !this.filter
? this.$store.state.schema
: this.$store.state.schema.filter(
table => table[0].toUpperCase().indexOf(this.filter.toUpperCase()) !== -1
table => table.name.toUpperCase().indexOf(this.filter.toUpperCase()) !== -1
)
},
dbName () {
@@ -120,12 +109,9 @@ export default {
.db-name {
cursor: pointer;
}
>>> .chevron-icon {
-webkit-transition: transform .15s ease-in-out;
transition: transform .15s ease-in-out;
}
.db-name:hover .chevron-icon path,
>>> .table-name:hover .chevron-icon path {
fill: #506784;
fill: var(--color-gray-dark);
}
</style>

View File

@@ -1,20 +1,7 @@
<template>
<div>
<div @click="colVisible = !colVisible" class="table-name">
<svg
:style="{transform: colVisible ? 'rotate(90deg)' : 'rotate(0)'}"
class="chevron-icon"
width="9"
height="9"
viewBox="0 0 8 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
:fill="colVisible ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
/>
</svg>
<tree-chevron :expanded="colVisible"/>
{{ name }}
</div>
<div v-show="colVisible" class="columns">
@@ -27,9 +14,11 @@
</template>
<script>
import TreeChevron from '@/components/svg/treeChevron'
export default {
name: 'TableDescription',
components: { TreeChevron },
props: ['name', 'columns'],
data () {
return {

View File

@@ -0,0 +1,36 @@
<template>
<svg
:style="{ transform: expanded ? 'rotate(90deg)' : 'rotate(0)' }"
class="chevron-icon"
width="9"
height="9"
viewBox="0 0 8 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z"
:fill="expanded ? '#506784' : 'rgba(80, 103, 132, 0.5)'"
/>
</svg>
</template>
<script>
export default {
name: 'treeChevron',
props: {
expanded: {
type: Boolean,
required: true
}
}
}
</script>
<style scoped>
.chevron-icon {
-webkit-transition: transform .15s ease-in-out;
transition: transform .15s ease-in-out;
}
</style>