|
1 | 1 | <template>
|
2 | 2 | <v-navigation-drawer v-model="store.state.showFileExplorer" :width="240">
|
3 |
| - <v-list-item height="43px"> |
| 3 | + <v-list-item class="px-2"> |
4 | 4 | <template v-slot:prepend>
|
5 | 5 | <v-btn
|
6 |
| - class="px-0 rounded-md" |
7 | 6 | variant="flat"
|
8 | 7 | size="small"
|
9 |
| - min-width="30px" |
| 8 | + :icon="`svg:${mdiDockLeft}`" |
10 | 9 | @click="store.state.showFileExplorer = false"
|
11 |
| - > |
12 |
| - <IconPanelLeftClose /> |
13 |
| - </v-btn> |
| 10 | + ></v-btn> |
14 | 11 | </template>
|
| 12 | + |
15 | 13 | <template v-slot:append>
|
16 | 14 | <v-btn
|
17 |
| - class="px-0 rounded-md" |
18 |
| - variant="flat" |
| 15 | + variant="text" |
19 | 16 | size="small"
|
20 |
| - min-width="30px" |
| 17 | + :append-icon="`svg:${mdiFilePlusOutline}`" |
| 18 | + text="Add File" |
| 19 | + border |
| 20 | + slim |
21 | 21 | @click="startAddFile"
|
22 |
| - > |
23 |
| - <v-icon :size="24" :icon="`svg:${mdiFilePlusOutline}`" /> |
24 |
| - </v-btn> |
| 22 | + ></v-btn> |
25 | 23 | </template>
|
26 | 24 | </v-list-item>
|
27 | 25 |
|
28 | 26 | <v-divider />
|
29 | 27 |
|
30 | 28 | <v-list
|
31 | 29 | :selected="[activeFile]"
|
32 |
| - class="py-1 px-1 overflow-y-scroll file-list" |
| 30 | + class="py-1 px-1 overflow-y-auto d-flex flex-column ga-1" |
33 | 31 | density="compact"
|
34 |
| - :style="{ 'max-height': 'calc(100% - 44px)' }" |
| 32 | + max-height="calc(100% - 44px)" |
35 | 33 | >
|
36 | 34 | <v-list-item
|
37 | 35 | v-for="file in files"
|
38 | 36 | :key="file"
|
39 | 37 | :value="file"
|
40 | 38 | rounded
|
| 39 | + :title="stripSrcPrefix(file)" |
41 | 40 | slim
|
42 | 41 | @click="activeFile = file"
|
43 | 42 | >
|
|
48 | 47 | size="small"
|
49 | 48 | />
|
50 | 49 | </template>
|
51 |
| - <v-list-item-title :title="stripSrcPrefix(file)" class="file-name"> |
52 |
| - {{ stripSrcPrefix(file) }} |
53 |
| - </v-list-item-title> |
| 50 | + |
54 | 51 | <template v-slot:append>
|
55 | 52 | <v-icon-btn
|
56 | 53 | icon="$close"
|
57 |
| - size="26px" |
58 |
| - icon-size="20px" |
59 |
| - variant="text" |
| 54 | + size="26" |
| 55 | + icon-size="14" |
| 56 | + variant="plain" |
60 | 57 | @click.stop="store.deleteFile(file)"
|
61 | 58 | />
|
62 | 59 | </template>
|
63 | 60 | </v-list-item>
|
64 | 61 |
|
65 |
| - <v-list-item |
| 62 | + <v-text-field |
66 | 63 | v-if="pending"
|
67 |
| - :prepend-icon="`svg:${getFileIcon(pendingFilename)}`" |
68 |
| - slim |
69 |
| - > |
70 |
| - <v-list-item-title> |
71 |
| - <v-text-field |
72 |
| - v-model="pendingFilename" |
73 |
| - density="compact" |
74 |
| - hide-details |
75 |
| - autofocus |
76 |
| - single-line |
77 |
| - base-color="primary" |
78 |
| - color="primary" |
79 |
| - @blur="doneNameFile" |
80 |
| - @keyup.enter="doneNameFile" |
81 |
| - @keyup.esc="cancelNameFile" |
82 |
| - /> |
83 |
| - </v-list-item-title> |
84 |
| - </v-list-item> |
| 64 | + v-model="pendingFilename" |
| 65 | + density="compact" |
| 66 | + hide-details |
| 67 | + autofocus |
| 68 | + single-line |
| 69 | + :prepend-inner-icon="`svg:${getFileIcon(pendingFilename)}`" |
| 70 | + base-color="primary" |
| 71 | + color="primary" |
| 72 | + variant="outlined" |
| 73 | + @blur="doneNameFile" |
| 74 | + @keyup.enter="doneNameFile" |
| 75 | + @keyup.esc="cancelNameFile" |
| 76 | + /> |
85 | 77 | </v-list>
|
86 | 78 |
|
87 | 79 | <template v-slot:append>
|
88 | 80 | <v-divider />
|
| 81 | + |
89 | 82 | <v-list
|
90 | 83 | :selected="[activeFile]"
|
91 | 84 | @update:selected="activeFile = $event[0] ?? activeFile"
|
@@ -127,12 +120,12 @@ import type { Store } from 'src/store'
|
127 | 120 | import { inject } from 'vue'
|
128 | 121 | import { useFileSelector } from '../composables/useFileSelector'
|
129 | 122 | import { VIconBtn } from 'vuetify/labs/components'
|
130 |
| -import IconPanelLeftClose from '../icons/IconPanelLeftClose.vue' |
131 | 123 | import {
|
132 | 124 | mdiFilePlusOutline,
|
133 | 125 | mdiLanguageTypescript,
|
134 | 126 | mdiMap,
|
135 | 127 | mdiLink,
|
| 128 | + mdiDockLeft, |
136 | 129 | } from '@mdi/js'
|
137 | 130 |
|
138 | 131 | const store = inject('store') as Store
|
|
0 commit comments