Password | placeholder prop

pull/2862/head
Tuğçe Küçükoğlu 2022-08-12 15:10:10 +03:00
parent c6d34c9b60
commit a1be1d24bc
4 changed files with 21 additions and 2 deletions

View File

@ -77,6 +77,12 @@ const PasswordProps = [
default: "pi pi-eye",
description: "Icon to show displaying the password as plain text."
},
{
name: "placeholder",
type: "string",
default: "null",
description: "Placeholder text for the input."
},
{
name: "inputId",
type: "string",

View File

@ -59,6 +59,10 @@ export interface PasswordProps extends InputHTMLAttributes {
* Default value is 'pi pi-eye'.
*/
showIcon?: string | undefined;
/**
* Placeholder text for the input.
*/
placeholder?: string | undefined;
/**
* Identifier of the underlying input element.
*/

View File

@ -1,7 +1,7 @@
<template>
<div :class="containerClass">
<PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
:aria-controls="(panelProps&&panelProps.id)||panelId||panelUniqueId" :aria-expanded="overlayVisible" :aria-haspopup="true"
:aria-controls="(panelProps&&panelProps.id)||panelId||panelUniqueId" :aria-expanded="overlayVisible" :aria-haspopup="true" :placeholder="placeholder"
@input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" />
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
<span class="p-hidden-accessible" aria-live="polite">
@ -83,7 +83,10 @@ export default {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: null
},
inputId: null,
inputClass: null,
inputStyle: null,

View File

@ -155,6 +155,12 @@ import Password from 'primevue/password';
<td>pi pi-eye</td>
<td>Icon to show displaying the password as plain text.</td>
</tr>
<tr>
<td>placeholder</td>
<td>string</td>
<td>null</td>
<td>Placeholder text for the input.</td>
</tr>
<tr>
<td>inputId</td>
<td>string</td>