Accessibility for Password
parent
96177cbc60
commit
3a2dd2f159
|
@ -5,12 +5,6 @@ const PasswordProps = [
|
||||||
default: "null",
|
default: "null",
|
||||||
description: "Value of the component."
|
description: "Value of the component."
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "id",
|
|
||||||
type: "string",
|
|
||||||
default: "null",
|
|
||||||
description: "Unique identifier of the element."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "inputId",
|
name: "inputId",
|
||||||
type: "string",
|
type: "string",
|
||||||
|
|
|
@ -8,10 +8,6 @@ export interface PasswordProps extends InputHTMLAttributes {
|
||||||
* Value of the component.
|
* Value of the component.
|
||||||
*/
|
*/
|
||||||
modelValue?: Nullable<string>;
|
modelValue?: Nullable<string>;
|
||||||
/**
|
|
||||||
* Unique identifier of the element.
|
|
||||||
*/
|
|
||||||
id?: string | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the underlying input element.
|
* Identifier of the underlying input element.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="containerClass" v-bind="passwordProps">
|
<div :class="containerClass">
|
||||||
<PInputText ref="input" :type="inputType" :value="modelValue" @input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" />
|
<PInputText ref="input" :id="inputId" :type="inputType" :value="modelValue" @input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" />
|
||||||
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
|
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">
|
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">
|
||||||
|
@ -30,6 +30,10 @@ export default {
|
||||||
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
emits: ['update:modelValue', 'change', 'focus', 'blur'],
|
||||||
props: {
|
props: {
|
||||||
modelValue: String,
|
modelValue: String,
|
||||||
|
inputId: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
promptLabel: {
|
promptLabel: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
@ -79,7 +83,6 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
passwordProps: null,
|
|
||||||
inputProps: null
|
inputProps: null
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -82,12 +82,6 @@ import Password from 'primevue/password';
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Value of the component.</td>
|
<td>Value of the component.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>id</td>
|
|
||||||
<td>string</td>
|
|
||||||
<td>null</td>
|
|
||||||
<td>Unique identifier of the element.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>inputId</td>
|
<td>inputId</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
|
@ -259,7 +253,7 @@ import Password from 'primevue/password';
|
||||||
|
|
||||||
<pre v-code><code>
|
<pre v-code><code>
|
||||||
<label for="pwd1">Password</label>
|
<label for="pwd1">Password</label>
|
||||||
<Password id="pwd1" />
|
<Password inputId="pwd1" />
|
||||||
|
|
||||||
<span id="pwd2">Password</span>
|
<span id="pwd2">Password</span>
|
||||||
<Password aria-labelledby="pwd2" />
|
<Password aria-labelledby="pwd2" />
|
||||||
|
|
Loading…
Reference in New Issue