Display: Allow assign a help text to the BaseInputNumber component

pull/5215/head
Angel Fernando Quiroz Campos 9 months ago
parent 50f8bf4e43
commit e9180a3fd2
  1. 20
      assets/vue/components/basecomponents/BaseInputNumber.vue
  2. 3
      assets/vue/components/ccalendarevent/CalendarInvitations.vue

@ -17,17 +17,18 @@
/>
</div>
<small
v-if="isInvalid"
v-if="smallText"
:class="{ 'p-error': isInvalid }"
v-text="errorText"
v-text="smallText"
/>
</div>
</template>
<script setup>
import InputNumber from "primevue/inputnumber"
import { computed } from "vue"
defineProps({
const props = defineProps({
modelValue: {
type: Number,
required: true,
@ -70,7 +71,20 @@ defineProps({
required: false,
default: false,
},
helpText: {
type: String,
required: false,
default: null,
},
})
defineEmits(["update:modelValue"])
const smallText = computed(() => {
if (props.errorText && props.isInvalid) {
return props.errorText
}
return props.helpText
})
</script>

@ -133,7 +133,8 @@ const maxSubscriptionsDisabled = computed(() => 0 === subscriptionVisibilitySele
id="max_subscription"
v-model="model.maxAttendees"
:disabled="maxSubscriptionsDisabled"
:label="t('Maximum number of subscriptions allowed. Leave at 0 to not limit it.')"
:help-text="t('Maximum number of subscriptions allowed. Leave at 0 to not limit it.')"
:label="t('Maximum number of subscriptions')"
min="0"
step="1"
/>

Loading…
Cancel
Save