#8448 - devToTest #1254

Merged
alexm merged 365 commits from 8448-devToTest into test 2025-01-21 10:44:46 +00:00
2 changed files with 18 additions and 30 deletions
Showing only changes of commit 0d9ba62d37 - Show all commits

View File

@ -19,8 +19,6 @@ const changePassDialog = ref();
const passwords = ref({ newPassword: null, repeatPassword: null }); const passwords = ref({ newPassword: null, repeatPassword: null });
const requirements = ref([]); const requirements = ref([]);
const isLoading = ref(false); const isLoading = ref(false);
const showPwd = ref(true);
const showRpPwd = ref(true);
const validate = async () => { const validate = async () => {
const { newPassword, repeatPassword, oldPassword } = passwords.value; const { newPassword, repeatPassword, oldPassword } = passwords.value;
@ -79,39 +77,32 @@ defineExpose({ show: () => changePassDialog.value.show() });
type="password" type="password"
:required="true" :required="true"
autofocus autofocus
:clearable="true" :toggle-visibility="true"
:show-pwd="showPwd"
@update:show-pwd="showPwd = $event"
/> />
<VnInput <VnInput
:required="true" :label="t('New password')"
autofocus
v-model="passwords.newPassword" v-model="passwords.newPassword"
:label="$t('New password')" type="password"
:show-pwd="showPwd" :required="true"
@update:show-pwd="showPwd = $event" :toggle-visibility="true"
> :info="
<!-- <template #append> t('passwordRequirements', {
<QIcon length: requirements.length,
:name="showPwd ? 'visibility_off' : 'visibility'" nAlpha: requirements.nAlpha,
class="cursor-pointer" nUpper: requirements.nUpper,
@click="showPwd = !showPwd" nDigits: requirements.nDigits,
nPunct: requirements.nPunct,
})
"
autofocus
/> />
</template> -->
</VnInput>
<VnInput <VnInput
:label="t('Repeat password')" :label="t('Repeat password')"
v-model="passwords.repeatPassword" v-model="passwords.repeatPassword"
type="password" type="password"
:toggle-visibility="true" :toggle-visibility="true"
/> />
<!-- <template #append>
<QIcon
:name="showRpPwd ? 'visibility_off' : 'visibility'"
class="cursor-pointer"
@click="showRpPwd = !showRpPwd"
/>
</template> -->
</QCardSection> </QCardSection>
</QForm> </QForm>
<QCardActions> <QCardActions>

View File

@ -43,14 +43,13 @@ const $props = defineProps({
default: null, default: null,
}, },
toggleVisibility: { toggleVisibility: {
// Nueva propiedad
type: Boolean, type: Boolean,
default: false, default: false,
}, },
}); });
const vnInputRef = ref(null); const vnInputRef = ref(null);
const showPassword = ref(false); // Estado para la visibilidad de contraseña const showPassword = ref(false);
const value = computed({ const value = computed({
get() { get() {
return $props.modelValue; return $props.modelValue;
@ -144,14 +143,12 @@ const handleInsertMode = (e) => {
<slot name="prepend" /> <slot name="prepend" />
</template> </template>
<template #append> <template #append>
<!-- Icono para mostrar/ocultar contraseña -->
<QIcon <QIcon
v-if="toggleVisibility" v-if="toggleVisibility"
:name="showPassword ? 'visibility_off' : 'visibility'" :name="showPassword ? 'visibility_off' : 'visibility'"
class="cursor-pointer" class="cursor-pointer"
@click="showPassword = !showPassword" @click="showPassword = !showPassword"
/> />
<!-- Ícono para borrar el valor -->
<QIcon <QIcon
name="close" name="close"
size="xs" size="xs"