Line data Source code
1 : <template>
2 218 : <Transition
3 : enter-active-class="transition-all duration-300 ease-in-out"
4 : enter-from-class="max-w-0 opacity-0 ml-0"
5 : enter-to-class="max-w-10 opacity-100 ml-2"
6 : leave-active-class="transition-all duration-300 ease-in-out"
7 : leave-from-class="max-w-10 opacity-100 ml-2"
8 : leave-to-class="max-w-0 opacity-0 ml-0"
9 : >
10 : <div v-if="show" class="ml-2 flex items-center overflow-hidden">
11 : <Button
12 : :tooltip="label"
13 : tooltip-side="bottom"
14 : :aria-label="label"
15 : variant="muted-textonly"
16 : size="icon-sm"
17 : class="size-8 shrink-0 hover:text-foreground"
18 : @click="isAllCollapsed = !isAllCollapsed"
19 : >
20 : <i
21 : :class="
22 : isAllCollapsed
23 : ? 'icon-[lucide--list-tree]'
24 : : 'icon-[lucide--list-collapse]'
25 : "
26 : />
27 : </Button>
28 : </div>
29 : </Transition>
30 : </template>
31 :
32 : <script setup lang="ts">
33 : import { computed } from 'vue'
34 :
35 : import Button from '@comfyorg/design-system/button/Button'
36 :
37 214 : const isAllCollapsed = defineModel<boolean>({ required: true })
38 :
39 : const { show, expandLabel, collapseLabel } = defineProps<{
40 : show: boolean
41 : expandLabel: string
42 : collapseLabel: string
43 : }>()
44 :
45 214 : const label = computed(() =>
46 : isAllCollapsed.value ? expandLabel : collapseLabel
47 : )
48 : </script>
|