Line data Source code
1 16 : <script setup lang="ts">
2 : import { computed } from 'vue'
3 :
4 : import type { SimplifiedWidget } from '@/types/simplifiedWidget'
5 : import { useHideLayoutField } from '@/types/widgetTypes'
6 :
7 : const { widget, inputId } = defineProps<{
8 : widget: Pick<SimplifiedWidget, 'name' | 'label' | 'displayLabel'>
9 : inputId?: string
10 : }>()
11 :
12 13609 : const hideLayoutField = useHideLayoutField()
13 13609 : const label = computed(() =>
14 : widget.name ? (widget.displayLabel ?? (widget.label || widget.name)) : ''
15 : )
16 : </script>
17 :
18 : <template>
19 : <label
20 : v-if="!hideLayoutField"
21 : :for="inputId"
22 : :title="label"
23 : class="max-w-fit min-w-0 flex-1 cursor-[inherit] content-center-safe truncate text-node-foreground select-none"
24 : >
25 : <span data-testid="widget-layout-field-label" class="block truncate">
26 : {{ label }}
27 : </span>
28 : </label>
29 : </template>
|