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

@ -133,7 +133,8 @@ const maxSubscriptionsDisabled = computed(() => 0 === subscriptionVisibilitySele
id="max_subscription" id="max_subscription"
v-model="model.maxAttendees" v-model="model.maxAttendees"
:disabled="maxSubscriptionsDisabled" :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" min="0"
step="1" step="1"
/> />

Loading…
Cancel
Save