Line data Source code
1 : <template>
2 31 : <div class="relative mx-2">
3 : <div
4 : data-testid="assets-selection-bar"
5 : class="absolute bottom-6 left-1/2 z-40 flex w-full max-w-78 -translate-x-1/2 items-center gap-2 rounded-lg bg-foreground p-2 text-background shadow-md"
6 : >
7 : <Button
8 : :tooltip="$t('mediaAsset.selection.deselectAll')"
9 : variant="inverted"
10 : size="icon-lg"
11 : type="button"
12 : data-testid="assets-deselect-selected"
13 : :aria-label="$t('mediaAsset.selection.deselectAll')"
14 : class="hover:bg-background/10"
15 : @click="emit('deselect')"
16 : >
17 : <i class="icon-[lucide--x]" />
18 : </Button>
19 : <span class="pr-6 text-sm font-bold whitespace-nowrap tabular-nums">
20 : {{ $t('mediaAsset.selection.selectedCount', { count }) }}
21 : </span>
22 : <div class="ml-auto flex shrink-0 items-center gap-1">
23 : <Button
24 : :tooltip="$t('mediaAsset.selection.downloadSelected')"
25 : variant="inverted"
26 : size="icon-lg"
27 : type="button"
28 : data-testid="assets-download-selected"
29 : :aria-label="$t('mediaAsset.selection.downloadSelected')"
30 : class="hover:bg-background/10"
31 : @click="emit('download')"
32 : >
33 : <i class="icon-[lucide--download]" />
34 : </Button>
35 : <template v-if="showDelete">
36 : <span class="h-6 w-px bg-background/20" aria-hidden="true" />
37 : <Button
38 : :tooltip="$t('mediaAsset.selection.deleteSelected')"
39 : variant="inverted"
40 : size="icon-lg"
41 : type="button"
42 : data-testid="assets-delete-selected"
43 : :aria-label="$t('mediaAsset.selection.deleteSelected')"
44 : class="hover:bg-background/10"
45 : @click="emit('delete')"
46 : >
47 : <i class="icon-[lucide--trash-2]" />
48 : </Button>
49 : </template>
50 : </div>
51 : </div>
52 : </div>
53 : </template>
54 :
55 : <script setup lang="ts">
56 : import Button from '@comfyorg/design-system/button/Button'
57 :
58 : const { count, showDelete = true } = defineProps<{
59 : count: number
60 : showDelete?: boolean
61 : }>()
62 :
63 22 : const emit = defineEmits<{
64 : deselect: []
65 : download: []
66 : delete: []
67 : }>()
68 : </script>
|