2023-05-15 03:32:16 +03:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { CompressedFile } from 'libarchive.js/src/compressed-file';
|
2023-06-13 01:58:19 +03:00
|
|
|
import type { iFile } from '~/composables/worker/7zip-manager';
|
2023-05-15 03:32:16 +03:00
|
|
|
|
|
|
|
interface Props {
|
2023-06-13 01:58:19 +03:00
|
|
|
filesList: iFile[],
|
2023-05-15 03:32:16 +03:00
|
|
|
nav: boolean
|
|
|
|
}
|
|
|
|
|
2023-06-03 06:59:17 +03:00
|
|
|
let { filesList, nav } = defineProps<Props>()
|
2023-06-03 06:53:03 +03:00
|
|
|
let selectedPath = useSelectedPath();
|
2023-05-15 03:32:16 +03:00
|
|
|
|
|
|
|
</script>
|
|
|
|
<template>
|
2023-06-03 06:53:03 +03:00
|
|
|
<v-list :selected="[selectedPath]" density="compact" :nav="nav">
|
2023-05-15 03:32:16 +03:00
|
|
|
<template v-for="file in filesList" :key="file.path">
|
2024-01-18 03:49:12 +03:00
|
|
|
<v-list-item active-color="light-blue-darken-4" :active="selectedPath == file.path" :title="file.name"
|
|
|
|
:subtitle="file.path" :value="file.path" @click="() => {
|
2023-06-03 06:53:03 +03:00
|
|
|
selectedPath = file.path;
|
2023-05-15 03:32:16 +03:00
|
|
|
file.toggle = !file.toggle;
|
|
|
|
}">
|
2023-06-03 06:59:17 +03:00
|
|
|
<template v-slot:prepend>
|
2024-01-18 03:49:12 +03:00
|
|
|
<file-logo :file="file" :key="file.path" />
|
2023-06-03 06:59:17 +03:00
|
|
|
</template>
|
|
|
|
<template v-if="file.isFolder" v-slot:append>
|
|
|
|
<v-icon>{{ `mdi-chevron-${file.toggle ? 'up' : 'down'}` }}</v-icon>
|
2023-05-15 03:32:16 +03:00
|
|
|
</template>
|
2023-06-03 06:59:17 +03:00
|
|
|
</v-list-item>
|
2023-06-13 01:58:19 +03:00
|
|
|
<div v-if="file.isFolder && file.toggle && file.content"
|
2023-06-03 06:59:17 +03:00
|
|
|
:style="`background-color: rgba(0,0,0,0.05);${nav ? `border-radius: 4px;` : ''}`">
|
|
|
|
<TreeView :files-list="file.content" :nav="false"></TreeView>
|
2023-05-15 03:32:16 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</v-list>
|
|
|
|
</template>
|