From 730d16d2606d4153f4cc94ad8473a4b7675dc153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 4 Apr 2023 15:41:34 +0300 Subject: [PATCH] Refactor #3832 Refactor #3833 - For Password --- api-generator/components/password.js | 18 +++++++++++++----- components/lib/password/Password.d.ts | 10 ++++++++-- components/lib/password/Password.vue | 20 +++++++++++++------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/api-generator/components/password.js b/api-generator/components/password.js index 665ea48a1..2c9492670 100644 --- a/api-generator/components/password.js +++ b/api-generator/components/password.js @@ -68,13 +68,13 @@ const PasswordProps = [ { name: 'hideIcon', type: 'string', - default: 'pi pi-eye-slash', + default: 'null', description: 'Icon to hide displaying the password as plain text.' }, { name: 'showIcon', type: 'string', - default: 'pi pi-eye', + default: 'null', description: 'Icon to show displaying the password as plain text.' }, { @@ -142,15 +142,23 @@ const PasswordProps = [ const PasswordSlots = [ { name: 'header', - description: "Custom content for the component's header" + description: "Custom content for the component's header." }, { name: 'content', - description: 'Custom content for the component' + description: 'Custom content for the component.' }, { name: 'footer', - description: "Custom content for the component's footer" + description: "Custom content for the component's footer." + }, + { + name: 'hideicon', + description: 'Custom content for the hide icon.' + }, + { + name: 'showicon', + description: 'Custom content for the show icon.' } ]; diff --git a/components/lib/password/Password.d.ts b/components/lib/password/Password.d.ts index 330f5b686..5e7045a17 100755 --- a/components/lib/password/Password.d.ts +++ b/components/lib/password/Password.d.ts @@ -61,12 +61,10 @@ export interface PasswordProps extends InputHTMLAttributes { toggleMask?: boolean | undefined; /** * Icon to hide displaying the password as plain text. - * @defaultValue pi pi-eye-slash */ hideIcon?: string | undefined; /** * Icon to show displaying the password as plain text. - * @defaultValue pi pi-eye */ showIcon?: string | undefined; /** @@ -141,6 +139,14 @@ export interface PasswordSlots { * Custom content template. */ content(): VNode[]; + /** + * Custom hide icon template. + */ + hideicon(): VNode[]; + /** + * Custom show icon template. + */ + showicon(): VNode[]; } /** diff --git a/components/lib/password/Password.vue b/components/lib/password/Password.vue index 28651658b..c7be8a1bc 100755 --- a/components/lib/password/Password.vue +++ b/components/lib/password/Password.vue @@ -21,7 +21,12 @@ @invalid="onInvalid" v-bind="inputProps" /> - + + + + + + {{ infoText }} @@ -43,6 +48,8 @@