diff --git a/src/components/common/VnChangePassword.vue b/src/components/common/VnChangePassword.vue
index 9026df85c..4077359ff 100644
--- a/src/components/common/VnChangePassword.vue
+++ b/src/components/common/VnChangePassword.vue
@@ -76,48 +76,42 @@ defineExpose({ show: () => changePassDialog.value.show() });
v-if="props.askOldPass"
:label="t('Old password')"
v-model="passwords.oldPassword"
- :type="showPwd ? 'password' : 'text'"
+ type="password"
:required="true"
autofocus
- >
-
-
-
-
+ :clearable="true"
+ :show-pwd="showPwd"
+ @update:show-pwd="showPwd = $event"
+ />
-
+
-
+ type="password"
+ :toggle-visibility="true"
+ />
+
diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue
index 57a495ac3..31a3cd411 100644
--- a/src/components/common/VnInput.vue
+++ b/src/components/common/VnInput.vue
@@ -42,9 +42,15 @@ const $props = defineProps({
type: Number,
default: null,
},
+ toggleVisibility: {
+ // Nueva propiedad
+ type: Boolean,
+ default: false,
+ },
});
const vnInputRef = ref(null);
+const showPassword = ref(false); // Estado para la visibilidad de contraseña
const value = computed({
get() {
return $props.modelValue;
@@ -124,7 +130,7 @@ const handleInsertMode = (e) => {
ref="vnInputRef"
v-model="value"
v-bind="{ ...$attrs, ...styleAttrs }"
- :type="$attrs.type"
+ :type="toggleVisibility ? (showPassword ? 'text' : 'password') : $attrs.type"
:class="{ required: isRequired }"
@keyup.enter="emit('keyup.enter')"
@keydown="handleKeydown"
@@ -134,10 +140,18 @@ const handleInsertMode = (e) => {
hide-bottom-space
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
>
-
+
+
+
+
{
emit('remove');
}
"
- >
+ />
@@ -166,18 +180,3 @@ const handleInsertMode = (e) => {
-
- 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}
-
-