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.
85 lines
1.4 KiB
85 lines
1.4 KiB
<template>
|
|
<div class="field">
|
|
<div class="p-float-label">
|
|
<InputText
|
|
:id="id"
|
|
:aria-label="label"
|
|
:class="{ 'p-invalid': isInvalid, [inputClass]: true }"
|
|
:disabled="disabled"
|
|
:model-value="modelValue"
|
|
type="text"
|
|
@update:model-value="updateValue"
|
|
/>
|
|
<label :for="id">
|
|
{{ label }}
|
|
</label>
|
|
</div>
|
|
<small
|
|
v-if="formSubmitted && isInvalid"
|
|
class="p-error"
|
|
>
|
|
{{ errorText }}
|
|
</small>
|
|
<small
|
|
v-if="helpText"
|
|
class="form-text text-muted"
|
|
>
|
|
{{ helpText }}
|
|
</small>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import InputText from "primevue/inputtext"
|
|
|
|
defineProps({
|
|
id: {
|
|
type: String,
|
|
require: true,
|
|
default: "",
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
default: "",
|
|
},
|
|
modelValue: {
|
|
type: [String, null],
|
|
required: true,
|
|
},
|
|
errorText: {
|
|
type: String,
|
|
required: false,
|
|
default: "",
|
|
},
|
|
isInvalid: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
required: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
helpText: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
formSubmitted: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
inputClass: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
})
|
|
|
|
const emits = defineEmits(["update:modelValue"])
|
|
const updateValue = (value) => {
|
|
emits("update:modelValue", value)
|
|
}
|
|
</script>
|
|
|