mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
720 B
38 lines
720 B
<template>
|
|
<div class="flex items-center">
|
|
<FormLabel :for="id">
|
|
{{ label }}
|
|
</FormLabel>
|
|
<BaseTooltip v-if="description" :text="description">
|
|
<IconsInfo class="size-4" />
|
|
</BaseTooltip>
|
|
</div>
|
|
<BaseInput
|
|
:id="id"
|
|
v-model.trim="data"
|
|
:name="id"
|
|
type="text"
|
|
:autocomplete="autocomplete"
|
|
:placeholder="placeholder"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
defineProps<{
|
|
id: string;
|
|
label: string;
|
|
description?: string;
|
|
autocomplete?: string;
|
|
placeholder?: string;
|
|
}>();
|
|
|
|
const data = defineModel<string | null>({
|
|
set(value) {
|
|
const temp = value?.trim() ?? null;
|
|
if (temp === '') {
|
|
return null;
|
|
}
|
|
return temp;
|
|
},
|
|
});
|
|
</script>
|
|
|