2023-10-26 00:43:44 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { useDocumentStore } from '@/stores/documents'
|
2023-10-28 10:13:01 +01:00
|
|
|
import LoginModal from '@/components/LoginModal.vue'
|
2023-10-26 00:43:44 +01:00
|
|
|
import UploadButton from '@/components/UploadButton.vue'
|
2023-11-03 16:15:37 +00:00
|
|
|
import { ref } from 'vue';
|
2023-10-26 00:43:44 +01:00
|
|
|
|
|
|
|
const documentStore = useDocumentStore()
|
2023-10-27 16:32:21 +01:00
|
|
|
const searchQuery = ref<string>('')
|
|
|
|
const showSearchInput = ref<boolean>(false)
|
|
|
|
|
|
|
|
const toggleSearchInput = () => {
|
|
|
|
showSearchInput.value = !showSearchInput.value;
|
|
|
|
if (!showSearchInput.value) {
|
2023-11-01 23:00:59 +00:00
|
|
|
searchQuery.value = ''
|
2023-10-27 16:32:21 +01:00
|
|
|
}
|
2023-11-01 23:00:59 +00:00
|
|
|
}
|
2023-10-27 16:32:21 +01:00
|
|
|
|
2023-11-01 23:00:59 +00:00
|
|
|
const executeSearch = (ev: InputEvent) => {
|
|
|
|
// FIXME: Make reactive instead of this update handler
|
|
|
|
const query = (ev.target as HTMLInputElement).value
|
|
|
|
console.log("Searching", query)
|
|
|
|
documentStore.setFilter(query)
|
|
|
|
console.log("Filtered")
|
|
|
|
}
|
2023-10-26 00:43:44 +01:00
|
|
|
|
|
|
|
function createFileHandler() {
|
|
|
|
console.log("Creating file")
|
|
|
|
}
|
|
|
|
|
|
|
|
function uploadFolderHandler() {
|
|
|
|
console.log("Uploading Folder")
|
|
|
|
}
|
|
|
|
function createFolderHandler() {
|
|
|
|
console.log("Uploading Folder")
|
|
|
|
}
|
|
|
|
function newViewHandler() {
|
|
|
|
console.log("Creating new view ...")
|
|
|
|
}
|
|
|
|
function preferencesHandler() {
|
|
|
|
console.log("Preferences ...")
|
|
|
|
}
|
|
|
|
function about() {
|
|
|
|
console.log("About ...")
|
|
|
|
}
|
|
|
|
function deleteHandler(){
|
2023-11-02 21:51:16 +00:00
|
|
|
console.log("Delete ...")
|
2023-10-26 00:43:44 +01:00
|
|
|
}
|
|
|
|
function share(){
|
|
|
|
console.log("Share ...")
|
|
|
|
}
|
|
|
|
function download(){
|
|
|
|
console.log("Download ...")
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="actions-container">
|
|
|
|
<div class="actions-list">
|
|
|
|
<UploadButton />
|
2023-11-02 22:33:21 +00:00
|
|
|
<!--
|
|
|
|
|
2023-10-26 00:43:44 +01:00
|
|
|
<a-tooltip title="Upload folder from disk">
|
|
|
|
<a-button @click="uploadFolderHandler" type="text" class="action-button" :icon="h(FolderAddFilled)" />
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip title="Create file">
|
|
|
|
<a-button @click="createFileHandler" type="text" class="action-button" :icon="h(FileFilled)" />
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip title="Create folder">
|
|
|
|
<a-button @click="createFolderHandler" type="text" class="action-button" :icon="h(FolderFilled)" />
|
|
|
|
</a-tooltip>
|
2023-11-02 22:33:21 +00:00
|
|
|
|
2023-11-02 21:51:16 +00:00
|
|
|
<template v-if="documentStore.selected.size > 0">
|
2023-10-26 00:43:44 +01:00
|
|
|
<a-tooltip title="Share">
|
|
|
|
<a-button type="text" @click="share" class="action-button" :icon="h(LinkOutlined)" />
|
|
|
|
</a-tooltip>
|
|
|
|
<a-tooltip title="Download Zip">
|
|
|
|
<a-button type="text" @click="download" class="action-button" :icon="h(DownloadOutlined)" />
|
|
|
|
</a-tooltip>
|
|
|
|
<a-tooltip title="Delete">
|
|
|
|
<a-button type="text" @click="deleteHandler" class="action-button" :icon="h(DeleteOutlined)" />
|
|
|
|
</a-tooltip>
|
|
|
|
</template>
|
2023-11-02 22:33:21 +00:00
|
|
|
-->
|
2023-10-26 00:43:44 +01:00
|
|
|
</div>
|
|
|
|
<div class="actions-list">
|
2023-10-28 10:13:01 +01:00
|
|
|
<LoginModal></LoginModal>
|
2023-10-27 16:32:21 +01:00
|
|
|
<template v-if="showSearchInput">
|
2023-11-02 22:33:21 +00:00
|
|
|
<input type="search" v-model="searchQuery" class="margin-input">
|
2023-10-27 16:32:21 +01:00
|
|
|
</template>
|
2023-11-02 22:33:21 +00:00
|
|
|
<!--
|
|
|
|
|
2023-10-26 00:43:44 +01:00
|
|
|
<a-tooltip title="Search">
|
2023-10-27 16:32:21 +01:00
|
|
|
<a-button @click="toggleSearchInput" type="text" class="action-button" :icon="h(SearchOutlined)" />
|
2023-10-26 00:43:44 +01:00
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip title="Create new view">
|
|
|
|
<a-button @click="newViewHandler" type="text" class="action-button" :icon="h(PlusSquareOutlined)" />
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip title="Preferences">
|
|
|
|
<a-button @click="preferencesHandler" type="text" class="action-button" :icon="h(SettingOutlined)" />
|
|
|
|
</a-tooltip>
|
|
|
|
|
|
|
|
<a-tooltip title="About">
|
|
|
|
<a-button @click="about" type="text" class="action-button" :icon="h(InfoCircleOutlined)" />
|
|
|
|
</a-tooltip>
|
2023-11-02 22:33:21 +00:00
|
|
|
-->
|
|
|
|
|
2023-10-26 00:43:44 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.actions-container,
|
|
|
|
.actions-list {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
gap: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actions-container {
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-button {
|
|
|
|
padding: 0;
|
|
|
|
font-size: 1.5em;
|
|
|
|
color: var(--secondary-color);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--blue-color) !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media only screen and (max-width: 600px) {
|
|
|
|
|
|
|
|
.actions-container,
|
|
|
|
.actions-list {
|
|
|
|
gap: 6px;
|
|
|
|
}
|
|
|
|
}
|
2023-10-27 16:32:21 +01:00
|
|
|
.margin-input{
|
|
|
|
margin-top: 5px;
|
|
|
|
}
|
2023-11-03 16:15:37 +00:00
|
|
|
|
|
|
|
.path {
|
|
|
|
box-shadow: 0 0 0.5em rgba(0,0,0,.15);
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
width: 100%;
|
|
|
|
z-index: 1;
|
|
|
|
flex: 0 0 1.5rem;
|
|
|
|
order: 1;
|
|
|
|
font-size: .9rem;
|
|
|
|
position: relative;
|
|
|
|
}
|
2023-10-26 00:43:44 +01:00
|
|
|
</style>
|