From 092396ca9c75256fefa35192fb62bb640e999d1c Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Tue, 18 May 2021 12:57:22 +0300 Subject: [PATCH] Fixed #1066 - hideIcon and showIcon for Password --- api-generator/components/password.js | 12 ++++++++++++ src/components/accordion/Accordion.d.ts | 1 + src/components/password/Password.d.ts | 2 ++ src/components/password/Password.vue | 10 +++++++++- src/components/tabview/TabView.d.ts | 1 + src/views/password/PasswordDoc.vue | 12 ++++++++++++ 6 files changed, 37 insertions(+), 1 deletion(-) diff --git a/api-generator/components/password.js b/api-generator/components/password.js index 8f5a8d3d2..51e766171 100644 --- a/api-generator/components/password.js +++ b/api-generator/components/password.js @@ -70,6 +70,18 @@ const PasswordProps = [ type: "string", default: "null", description: "Style class of the input field." + }, + { + name: "hideIcon", + type: "string", + default: "pi pi-eye-slash", + description: "Icon to hide displaying the password as plain text." + }, + { + name: "showIcon", + type: "string", + default: "pi pi-eye", + description: "Icon to show displaying the password as plain text." } ]; diff --git a/src/components/accordion/Accordion.d.ts b/src/components/accordion/Accordion.d.ts index fe5dded04..219e87afa 100755 --- a/src/components/accordion/Accordion.d.ts +++ b/src/components/accordion/Accordion.d.ts @@ -3,6 +3,7 @@ import { VNode } from 'vue'; interface AccordionProps { multiple?: boolean; activeIndex?: Number|[Number]; + lazy?: boolean; } declare class Accordion { diff --git a/src/components/password/Password.d.ts b/src/components/password/Password.d.ts index 4a3a84222..7905bed11 100755 --- a/src/components/password/Password.d.ts +++ b/src/components/password/Password.d.ts @@ -12,6 +12,8 @@ interface PasswordProps { inputStyle?: any; inputClass?: string; panelClass?: string; + hideIcon?: string; + showIcon?: string; } declare class Password { diff --git a/src/components/password/Password.vue b/src/components/password/Password.vue index c125f366c..69231145d 100755 --- a/src/components/password/Password.vue +++ b/src/components/password/Password.vue @@ -66,6 +66,14 @@ export default { type: Boolean, default: false }, + hideIcon: { + type: String, + default: 'pi pi-eye-slash' + }, + showIcon: { + type: String, + default: 'pi pi-eye' + }, inputClass: String, inputStyle: null, style: null, @@ -264,7 +272,7 @@ export default { }]; }, toggleIconClass() { - return this.unmasked ? 'pi pi-eye-slash' : 'pi pi-eye'; + return this.unmasked ? this.hideIcon : this.showIcon; }, strengthClass() { return `p-password-strength ${this.meter ? this.meter.strength : ''}`; diff --git a/src/components/tabview/TabView.d.ts b/src/components/tabview/TabView.d.ts index 643f83c2b..2548e4182 100755 --- a/src/components/tabview/TabView.d.ts +++ b/src/components/tabview/TabView.d.ts @@ -2,6 +2,7 @@ import { VNode } from 'vue'; interface TabViewProps { activeIndex?: number; + lazy?: boolean; } declare class TabView { diff --git a/src/views/password/PasswordDoc.vue b/src/views/password/PasswordDoc.vue index 49c0855dc..f9835245d 100755 --- a/src/views/password/PasswordDoc.vue +++ b/src/views/password/PasswordDoc.vue @@ -141,6 +141,18 @@ import Password from 'primevue/password'; string null Style class of the input field. + + + hideIcon + string + pi pi-eye-slash + Icon to hide displaying the password as plain text. + + + showIcon + string + pi pi-eye + Icon to show displaying the password as plain text.