From dfd7ba93795252a00c9fc65fcf264491f669eea0 Mon Sep 17 00:00:00 2001 From: provira Date: Wed, 8 Jan 2025 08:14:37 +0100 Subject: [PATCH 1/3] feat: refs #8258 added uppercase option to VnInput --- src/components/common/VnInput.vue | 13 ++++++++----- src/pages/Customer/CustomerList.vue | 3 +++ src/pages/Supplier/SupplierList.vue | 7 ++++++- src/pages/Worker/WorkerList.vue | 6 +++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 3cecf760a..44ce07248 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -42,6 +42,10 @@ const $props = defineProps({ type: Number, default: null, }, + uppercase: { + type: Boolean, + default: false, + }, }); const vnInputRef = ref(null); @@ -50,6 +54,9 @@ const value = computed({ return $props.modelValue; }, set(value) { + if ($props.uppercase && typeof value === 'string') { + value = value.toUpperCase(); + } if ($props.emptyToNull && value === '') value = null; emit('update:modelValue', value); }, @@ -169,6 +176,7 @@ const handleInsertMode = (e) => { + en: inputMin: Must be more than {value} @@ -179,8 +187,3 @@ const handleInsertMode = (e) => { maxLength: El valor excede los {value} carácteres inputMax: Debe ser menor a {value} - diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index fdfd7ff9c..037940ffa 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -50,6 +50,9 @@ const columns = computed(() => [ isTitle: true, create: true, columnClass: 'expand', + attrs: { + uppercase: true, + }, }, { align: 'left', diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index c0748af87..f9238e361 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -24,8 +24,13 @@ const columns = computed(() => [ label: t('globals.name'), name: 'socialName', create: true, + attrs: { + uppercase: true, + }, columnFilter: { - name: 'search', + name: 'search',attrs: { + uppercase: false, + }, }, isTitle: true, }, diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index 48393a8c7..0b784b993 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -138,7 +138,11 @@ function uppercaseStreetModel(data) { return { get: () => (data.street ? data.street.toUpperCase() : ''), set: (value) => { - data.street = value.toUpperCase(); + if (value) { + data.street = value.toUpperCase(); + } else { + data.street = null; + } }, }; } -- 2.40.1 From f834f3b7549e9c3ea726fa78a72b897d9b7aa50d Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 10 Jan 2025 07:52:22 +0100 Subject: [PATCH 2/3] feat: refs #8258 added button to pass to uppercase --- src/components/common/VnInput.vue | 28 ++++++++++++++++--- .../Customer/Card/CustomerFiscalData.vue | 1 + src/pages/Customer/CustomerList.vue | 5 ++++ .../Supplier/Card/SupplierFiscalData.vue | 1 + src/pages/Supplier/SupplierList.vue | 7 +++-- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index c45f7d073..e921d8e1f 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -49,15 +49,11 @@ const $props = defineProps({ }); const vnInputRef = ref(null); -const showPassword = ref(false); const value = computed({ get() { return $props.modelValue; }, set(value) { - if ($props.uppercase && typeof value === 'string') { - value = value.toUpperCase(); - } if ($props.emptyToNull && value === '') value = null; emit('update:modelValue', value); }, @@ -124,6 +120,10 @@ const handleInsertMode = (e) => { input.setSelectionRange(cursorPos + 1, cursorPos + 1); }); }; + +const handleUppercase = () => { + value.value = value.value?.toUpperCase() || ''; +}; + + + 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} + \ No newline at end of file diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue index aff7deda4..8f2c4efb0 100644 --- a/src/pages/Customer/Card/CustomerFiscalData.vue +++ b/src/pages/Customer/Card/CustomerFiscalData.vue @@ -44,6 +44,7 @@ function handleLocation(data, location) { :required="true" :rules="validate('client.socialName')" clearable + uppercase="true" v-model="data.socialName" > -- 2.40.1