From bf047e36f3116c8f1e58f0ac1e636d91e40765cd Mon Sep 17 00:00:00 2001 From: "M. Bestami" Date: Mon, 6 Oct 2025 11:29:39 +0300 Subject: [PATCH] =?UTF-8?q?-=20Pasword=20alanlar=C4=B1=20i=C3=A7in=20?= =?UTF-8?q?=C5=9Fifreyi=20g=C3=B6r=C3=BCnt=C3=BCle-gizle=20=C3=B6zelli?= =?UTF-8?q?=C4=9Fi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/icons.svg | 10 +++++++ src/assets/style/default.css | 1 + src/components/global/FormInput.vue | 44 ++++++++++++++++++++++++++--- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/assets/images/icons.svg b/src/assets/images/icons.svg index 32f33a6..244d7d8 100644 --- a/src/assets/images/icons.svg +++ b/src/assets/images/icons.svg @@ -251,4 +251,14 @@ d="M14.3272 17.4867H5.66513C5.33609 17.4867 5.07048 17.7574 5.07048 18.0928C5.07048 18.4281 5.33609 18.6989 5.66513 18.6989H14.3232C14.6522 18.6989 14.9179 18.4281 14.9179 18.0928C14.9179 17.7574 14.6522 17.4867 14.3232 17.4867H14.3272Z" /> + + + + + + + \ No newline at end of file diff --git a/src/assets/style/default.css b/src/assets/style/default.css index 97506b0..f9006af 100644 --- a/src/assets/style/default.css +++ b/src/assets/style/default.css @@ -454,6 +454,7 @@ label { flex-wrap: wrap; width: 100%; padding: 2px; + position: relative; } label>span { diff --git a/src/components/global/FormInput.vue b/src/components/global/FormInput.vue index f941714..905a7b2 100644 --- a/src/components/global/FormInput.vue +++ b/src/components/global/FormInput.vue @@ -11,7 +11,7 @@ + + + + + @@ -82,9 +94,18 @@ 'keydown', 'keyup' ]) - const localValue = ref() + const isPasswordVisible = ref(false) const InvalidMessageText = reactive>({}) + const inputType = computed(() => { + if (props.type !== 'password') { + return props.type + } else { + if (isPasswordVisible.value) return 'text' + else return 'password' + } + }) + const InvalidMessages = computed(() => { let text = '' Object.keys(InvalidMessageText).forEach((k: string, i: number) => { @@ -138,7 +159,9 @@ emit('update:modelValue', (e.target as HTMLInputElement).value) emit('keyup', e) } - + const PasswordVisibleToggle = () => { + if (props.type === 'password') isPasswordVisible.value = !isPasswordVisible.value + } watch( () => props.invalidText, () => { @@ -151,3 +174,16 @@ } ) +