Line data Source code
1 11 : <template>
2 : <div class="flex items-center gap-2">
3 : <span class="h-px flex-1 bg-border" />
4 : <span>{{ widget.label }}</span>
5 : <Button
6 : variant="textonly"
7 : size="icon"
8 : class="size-6"
9 : :disabled="widget.options?.disabled"
10 : :aria-label="t('dynamicGroup.remove', { row: widget.label })"
11 : @click="removeRow"
12 : >
13 : <i class="icon-[lucide--x]" />
14 : </Button>
15 : </div>
16 : </template>
17 :
18 : <script setup lang="ts">
19 : import { useI18n } from 'vue-i18n'
20 :
21 : import Button from '@comfyorg/design-system/button/Button'
22 : import type { SimplifiedWidget } from '@/types/simplifiedWidget'
23 :
24 : const { widget } = defineProps<{ widget: SimplifiedWidget }>()
25 68 : const { t } = useI18n()
26 68 : const emit = defineEmits<{ removed: [name: string] }>()
27 :
28 6 : function removeRow() {
29 6 : const name = widget.name
30 6 : widget.callback?.(undefined)
31 6 : emit('removed', name)
32 : }
33 : </script>
|