Search Bar UI update

This commit is contained in:
Andy-Ruda 2023-10-27 15:32:21 +00:00
parent 8cc3ed1a04
commit 2b72508206
3 changed files with 48 additions and 4 deletions

View File

@ -15,6 +15,7 @@ declare module 'vue' {
AFormItem: typeof import('ant-design-vue/es')['FormItem'] AFormItem: typeof import('ant-design-vue/es')['FormItem']
AImage: typeof import('ant-design-vue/es')['Image'] AImage: typeof import('ant-design-vue/es')['Image']
AInput: typeof import('ant-design-vue/es')['Input'] AInput: typeof import('ant-design-vue/es')['Input']
AInputSearch: typeof import('ant-design-vue/es')['InputSearch']
APageHeader: typeof import('ant-design-vue/es')['PageHeader'] APageHeader: typeof import('ant-design-vue/es')['PageHeader']
APopover: typeof import('ant-design-vue/es')['Popover'] APopover: typeof import('ant-design-vue/es')['Popover']
AppNavigation: typeof import('./src/components/AppNavigation.vue')['default'] AppNavigation: typeof import('./src/components/AppNavigation.vue')['default']

View File

@ -48,7 +48,18 @@ body {
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
.ant-input-group >.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary):hover{
color : var(--blue-color) !important
}
.ant-input-search .ant-input:hover,
.ant-input-search .ant-input:focus {
border-color: var(--blue-color);
}
.ant-input{
background-color:var(--table-background);
border-color: var(--table-background);
color: var(--font-color)
}
.ant-table-wrapper .ant-table-thead>tr>th { .ant-table-wrapper .ant-table-thead>tr>th {
background-color: var(--table-background); background-color: var(--table-background);
} }

View File

@ -2,10 +2,30 @@
import { useDocumentStore } from '@/stores/documents' import { useDocumentStore } from '@/stores/documents'
import UploadButton from '@/components/UploadButton.vue' import UploadButton from '@/components/UploadButton.vue'
import { InfoCircleOutlined, SettingOutlined, PlusSquareOutlined, SearchOutlined, DeleteOutlined, DownloadOutlined, FileAddFilled, LinkOutlined, FolderAddFilled, FileFilled, FolderFilled } from '@ant-design/icons-vue' import { InfoCircleOutlined, SettingOutlined, PlusSquareOutlined, SearchOutlined, DeleteOutlined, DownloadOutlined, FileAddFilled, LinkOutlined, FolderAddFilled, FileFilled, FolderFilled } from '@ant-design/icons-vue'
import { h } from 'vue'; import { h, ref, defineProps } from 'vue';
import Keyframe from 'ant-design-vue/es/_util/cssinjs/Keyframes';
const documentStore = useDocumentStore() const documentStore = useDocumentStore()
const searchQuery = ref<string>('')
const showSearchInput = ref<boolean>(false)
const isLoading = ref<boolean>(false)
const toggleSearchInput = () => {
showSearchInput.value = !showSearchInput.value;
if (!showSearchInput.value) {
searchQuery.value = '';
}
};
const executeSearch = () => {
isLoading.value = true;
console.log(
documentStore.mainDocument
)
setTimeout(() => {
isLoading.value = false;
// Perform your search logic here
}, 2000);
};
function createFileHandler() { function createFileHandler() {
console.log("Creating file") console.log("Creating file")
@ -76,8 +96,17 @@ function download(){
</div> </div>
<div class="actions-list"> <div class="actions-list">
<template v-if="showSearchInput">
<a-input-search
v-model="searchQuery"
class="margin-input"
v-on:keyup.enter="executeSearch"
@search="executeSearch"
:loading="isLoading"
/>
</template>
<a-tooltip title="Search"> <a-tooltip title="Search">
<a-button @click="searchHandler" type="text" class="action-button" :icon="h(SearchOutlined)" /> <a-button @click="toggleSearchInput" type="text" class="action-button" :icon="h(SearchOutlined)" />
</a-tooltip> </a-tooltip>
<a-tooltip title="Create new view"> <a-tooltip title="Create new view">
@ -124,4 +153,7 @@ function download(){
gap: 6px; gap: 6px;
} }
} }
.margin-input{
margin-top: 5px;
}
</style> </style>