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.
51 lines
999 B
51 lines
999 B
<template>
|
|
<div class="field">
|
|
<div class="p-float-label">
|
|
<InputText
|
|
:id="id"
|
|
:model-value="modelValue"
|
|
:class="{ 'p-invalid': isInvalid }"
|
|
:aria-label="label"
|
|
type="text"
|
|
@update:model-value="$emit('update:modelValue', $event)"
|
|
/>
|
|
<label v-t="label" :class="{ 'p-error': isInvalid }" :for="id" />
|
|
</div>
|
|
<slot name="errors">
|
|
<small v-if="isInvalid" v-t="errorText" class="p-error" />
|
|
</slot>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import InputText from "primevue/inputtext";
|
|
|
|
const props = defineProps({
|
|
id: {
|
|
type: String,
|
|
require: true,
|
|
default: "",
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
default: "",
|
|
},
|
|
modelValue: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
errorText: {
|
|
type: String,
|
|
required: false,
|
|
default: null,
|
|
},
|
|
isInvalid: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
defineEmits(["update:modelValue"])
|
|
</script>
|
|
|