| 1 |
<template> |
| 2 |
<div class="field-width-indicator"> |
| 3 |
{{ formattedWidth }} |
| 4 |
</div> |
| 5 |
</template> |
| 6 |
|
| 7 |
<script setup lang="ts"> |
| 8 |
import { computed } from 'vue' |
| 9 |
|
| 10 |
interface Props { |
| 11 |
width: number |
| 12 |
} |
| 13 |
|
| 14 |
const props = defineProps<Props>() |
| 15 |
|
| 16 |
const formattedWidth = computed(() => { |
| 17 |
// Show exact numbers without decimals |
| 18 |
return `${Math.round(props.width)}%` |
| 19 |
}) |
| 20 |
</script> |
| 21 |
|
| 22 |
<style scoped lang="scss"> |
| 23 |
.field-width-indicator { |
| 24 |
position: absolute; |
| 25 |
top: -28px; |
| 26 |
left: 50%; |
| 27 |
transform: translateX(-50%); |
| 28 |
background: var(--map-ground-level-2-foreground); |
| 29 |
color: var(--map-base-text-0); |
| 30 |
padding: 4px 12px; |
| 31 |
border-radius: 4px; |
| 32 |
font-size: 12px; |
| 33 |
font-weight: 600; |
| 34 |
line-height: 16px; |
| 35 |
white-space: nowrap; |
| 36 |
z-index: 200; |
| 37 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| 38 |
pointer-events: none; |
| 39 |
user-select: none; |
| 40 |
} |
| 41 |
</style> |
| 42 |
|