aria-labelledby and aria-label props added

pull/2809/head
Tuğçe Küçükoğlu 2022-07-27 11:47:12 +03:00
parent ae30c8ffa8
commit 96f6fc9d82
13 changed files with 107 additions and 25 deletions

View File

@ -52,18 +52,6 @@ const ChipsProps = [
type: "any", type: "any",
default: "null", default: "null",
description: "Inline style of the input field." description: "Inline style of the input field."
},
{
name: "'aria-labelledby'",
type: "string",
default: "null",
description: "Establishes relationships between the component and label(s) where its value should be one or more element IDs."
},
{
name: "'aria-label'",
type: "string",
default: "null",
description: "Establishes a string value that labels the component."
} }
]; ];

View File

@ -263,13 +263,18 @@ export interface CalendarProps {
* *
*/ */
inputProps?: object | undefined; inputProps?: object | undefined;
/**
* Unique identifier of the element.
*/
/** /**
* *
*/ */
panelProps?: object | undefined; panelProps?: object | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface CalendarSlots { export interface CalendarSlots {

View File

@ -1,7 +1,7 @@
<template> <template>
<span ref="container" :id="id" :class="containerClass"> <span ref="container" :id="id" :class="containerClass">
<input :ref="inputRef" v-if="!inline" type="text" role="combobox" :id="inputId" :class="['p-inputtext p-component', inputClass]" :style="inputStyle" <input :ref="inputRef" v-if="!inline" type="text" role="combobox" :id="inputId" :class="['p-inputtext p-component', inputClass]" :style="inputStyle"
aria-autocomplete="none" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId" inputmode="none" aria-autocomplete="none" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" inputmode="none"
@input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :readonly="!manualInput" v-bind="inputProps"> @input="onInput" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :readonly="!manualInput" v-bind="inputProps">
<CalendarButton v-if="showIcon" :icon="icon" class="p-datepicker-trigger" :disabled="disabled" @click="onButtonClick" type="button" :aria-label="$primevue.config.locale.chooseDate" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId"/> <CalendarButton v-if="showIcon" :icon="icon" class="p-datepicker-trigger" :disabled="disabled" @click="onButtonClick" type="button" :aria-label="$primevue.config.locale.chooseDate" aria-haspopup="dialog" :aria-expanded="overlayVisible" :aria-controls="panelId"/>
<Portal :appendTo="appendTo" :disabled="inline"> <Portal :appendTo="appendTo" :disabled="inline">
@ -325,6 +325,14 @@ export default {
readonly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
},
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
} }
}, },
navigationState: null, navigationState: null,

View File

@ -109,6 +109,15 @@ export interface CascadeSelectProps {
* *
*/ */
panelProps?: object | undefined; panelProps?: object | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface CascadeSelectSlots { export interface CascadeSelectSlots {

View File

@ -1,8 +1,8 @@
<template> <template>
<div ref="container" :class="containerClass" @click="onClick($event)"> <div ref="container" :class="containerClass" @click="onClick($event)">
<div class="p-hidden-accessible"> <div class="p-hidden-accessible">
<input ref="focusInput" role="combobox" type="text" :id="inputId" :class="inputClass" :style="inputStyle" readonly :disabled="disabled" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :tabindex="tabindex" <input ref="focusInput" role="combobox" type="text" :id="inputId" :class="inputClass" :style="inputStyle" readonly :disabled="disabled" :tabindex="tabindex" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
aria-haspopup="listbox" :aria-expanded="overlayVisible" :aria-controls="listId" v-bind="inputProps" /> aria-haspopup="listbox" :aria-expanded="overlayVisible" :aria-controls="listId" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" v-bind="inputProps" />
</div> </div>
<span :class="labelClass"> <span :class="labelClass">
<slot name="value" :value="modelValue" :placeholder="placeholder"> <slot name="value" :value="modelValue" :placeholder="placeholder">
@ -75,6 +75,14 @@ export default {
inputProps: null, inputProps: null,
panelClass: null, panelClass: null,
panelProps: null, panelProps: null,
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
}, },
outsideClickListener: null, outsideClickListener: null,
scrollHandler: null, scrollHandler: null,

View File

@ -153,6 +153,14 @@ export interface InputNumberProps {
* *
*/ */
inputProps?: object | undefined; inputProps?: object | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface InputNumberSlots { export interface InputNumberSlots {

View File

@ -1,6 +1,6 @@
<template> <template>
<span :class="containerClass"> <span :class="containerClass">
<INInputText ref="input" class="p-inputnumber-input" role="spinbutton" :id="inputId" :class="inputClass" :style="inputStyle" :value="formattedValue" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :readonly="readonly" <INInputText ref="input" class="p-inputnumber-input" role="spinbutton" :id="inputId" :class="inputClass" :style="inputStyle" :value="formattedValue" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :readonly="readonly" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
@input="onUserInput" @keydown="onInputKeyDown" @keypress="onInputKeyPress" @paste="onPaste" @click="onInputClick" @focus="onInputFocus" @blur="onInputBlur" v-bind="inputProps"/> @input="onUserInput" @keydown="onInputKeyDown" @keypress="onInputKeyPress" @paste="onPaste" @click="onInputClick" @focus="onInputFocus" @blur="onInputBlur" v-bind="inputProps"/>
<span class="p-inputnumber-button-group" v-if="showButtons && buttonLayout === 'stacked'"> <span class="p-inputnumber-button-group" v-if="showButtons && buttonLayout === 'stacked'">
<INButton :class="upButtonClass" :icon="incrementButtonIcon" v-on="upButtonListeners" :disabled="disabled" v-bind="incrementButtonProps" /> <INButton :class="upButtonClass" :icon="incrementButtonIcon" v-on="upButtonListeners" :disabled="disabled" v-bind="incrementButtonProps" />
@ -120,7 +120,15 @@ export default {
inputStyle: null, inputStyle: null,
inputProps: null, inputProps: null,
incrementButtonProps: null, incrementButtonProps: null,
decrementButtonProps: null decrementButtonProps: null,
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
}, },
numberFormat: null, numberFormat: null,
_numeral: null, _numeral: null,

View File

@ -29,6 +29,14 @@ export interface InputSwitchProps {
* *
*/ */
inputProps?: object | undefined; inputProps?: object | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface InputSwitchSlots { export interface InputSwitchSlots {

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="containerClass" @click="onClick($event)"> <div :class="containerClass" @click="onClick($event)">
<div class="p-hidden-accessible"> <div class="p-hidden-accessible">
<input :id="inputId" ref="input" type="checkbox" role="switch" :class="inputClass" :style="inputStyle" :checked="checked" :disabled="disabled" <input :id="inputId" ref="input" type="checkbox" role="switch" :class="inputClass" :style="inputStyle" :checked="checked" :disabled="disabled" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
@focus="onFocus($event)" @blur="onBlur($event)" v-bind="inputProps"> @focus="onFocus($event)" @blur="onBlur($event)" v-bind="inputProps">
</div> </div>
<span class="p-inputswitch-slider"></span> <span class="p-inputswitch-slider"></span>
@ -32,7 +32,15 @@ export default {
inputId: null, inputId: null,
inputClass: null, inputClass: null,
inputStyle: null, inputStyle: null,
inputProps: null inputProps: null,
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
}, },
data() { data() {
return { return {

View File

@ -75,6 +75,14 @@ export interface PasswordProps extends InputHTMLAttributes {
* Style class of the overlay panel. * Style class of the overlay panel.
*/ */
panelClass?: any | undefined; panelClass?: any | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface PasswordSlots { export interface PasswordSlots {

View File

@ -1,6 +1,6 @@
<template> <template>
<div :class="containerClass"> <div :class="containerClass">
<PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" @input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" /> <PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" @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" />
<span class="p-hidden-accessible" aria-live="polite"> <span class="p-hidden-accessible" aria-live="polite">
{{infoText}} {{infoText}}
@ -88,7 +88,15 @@ export default {
}, },
inputClass: null, inputClass: null,
inputStyle: null, inputStyle: null,
inputProps: null inputProps: null,
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
}, },
data() { data() {
return { return {

View File

@ -17,6 +17,14 @@ export interface RadioButtonProps {
* Inline style of the component. * Inline style of the component.
*/ */
style?: any; style?: any;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
} }
export interface RadioButtonSlots { export interface RadioButtonSlots {

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="containerClass" @click="onClick($event)"> <div :class="containerClass" @click="onClick($event)">
<div class="p-hidden-accessible"> <div class="p-hidden-accessible">
<input ref="input" type="radio" :id="inputId" :name="name" :checked="checked" :disabled="disabled" :value="value" @focus="onFocus" @blur="onBlur" v-bind="inputProps"> <input ref="input" type="radio" :id="inputId" :name="name" :checked="checked" :disabled="disabled" :value="value" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" @focus="onFocus" @blur="onBlur" v-bind="inputProps">
</div> </div>
<div ref="box" :class="['p-radiobutton-box', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]"> <div ref="box" :class="['p-radiobutton-box', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]">
<div class="p-radiobutton-icon"></div> <div class="p-radiobutton-icon"></div>
@ -34,6 +34,14 @@ export default {
type: String, type: String,
default: null default: null
}, },
'aria-labelledby': {
type: String,
default: null
},
'aria-label': {
type: String,
default: null
}
}, },
data() { data() {
return { return {