feat: refs #8258 added button to pass to uppercase
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
PAU ROVIRA ROSALENY 2025-01-10 07:52:22 +01:00
parent 3148461dc1
commit f834f3b754
5 changed files with 35 additions and 7 deletions

View File

@ -49,15 +49,11 @@ const $props = defineProps({
}); });
const vnInputRef = ref(null); const vnInputRef = ref(null);
const showPassword = ref(false);
const value = computed({ const value = computed({
get() { get() {
return $props.modelValue; return $props.modelValue;
}, },
set(value) { set(value) {
if ($props.uppercase && typeof value === 'string') {
value = value.toUpperCase();
}
if ($props.emptyToNull && value === '') value = null; if ($props.emptyToNull && value === '') value = null;
emit('update:modelValue', value); emit('update:modelValue', value);
}, },
@ -124,6 +120,10 @@ const handleInsertMode = (e) => {
input.setSelectionRange(cursorPos + 1, cursorPos + 1); input.setSelectionRange(cursorPos + 1, cursorPos + 1);
}); });
}; };
const handleUppercase = () => {
value.value = value.value?.toUpperCase() || '';
};
</script> </script>
<template> <template>
@ -166,7 +166,16 @@ const handleInsertMode = (e) => {
emit('remove'); emit('remove');
} }
" "
></QIcon>
<QIcon
name="match_case"
size="xs"
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
@click="handleUppercase"
class="uppercase-icon"
/> />
<slot name="append" v-if="$slots.append && !$attrs.disabled" /> <slot name="append" v-if="$slots.append && !$attrs.disabled" />
<QIcon v-if="info" name="info"> <QIcon v-if="info" name="info">
<QTooltip max-width="350px"> <QTooltip max-width="350px">
@ -177,3 +186,14 @@ const handleInsertMode = (e) => {
</QInput> </QInput>
</div> </div>
</template> </template>
<i18n>
en:
inputMin: Must be more than {value}
maxLength: The value exceeds {value} characters
inputMax: Must be less than {value}
es:
inputMin: Debe ser mayor a {value}
maxLength: El valor excede los {value} carácteres
inputMax: Debe ser menor a {value}
</i18n>

View File

@ -44,6 +44,7 @@ function handleLocation(data, location) {
:required="true" :required="true"
:rules="validate('client.socialName')" :rules="validate('client.socialName')"
clearable clearable
uppercase="true"
v-model="data.socialName" v-model="data.socialName"
> >
<template #append> <template #append>

View File

@ -53,6 +53,11 @@ const columns = computed(() => [
attrs: { attrs: {
uppercase: true, uppercase: true,
}, },
columnFilter: {
attrs: {
uppercase: false,
},
},
}, },
{ {
align: 'left', align: 'left',

View File

@ -92,6 +92,7 @@ function handleLocation(data, location) {
<VnInput <VnInput
v-model="data.name" v-model="data.name"
:label="t('supplier.fiscalData.name')" :label="t('supplier.fiscalData.name')"
uppercase="true"
clearable clearable
/> />
<VnInput <VnInput

View File

@ -28,7 +28,8 @@ const columns = computed(() => [
uppercase: true, uppercase: true,
}, },
columnFilter: { columnFilter: {
name: 'search',attrs: { name: 'search',
attrs: {
uppercase: false, uppercase: false,
}, },
}, },