Skip to content

Commit

Permalink
Fixed #3287 - OverlayPanel: deprecate ariaCloseLabel prop
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 17, 2022
1 parent acb4a42 commit 16e922d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
6 changes: 0 additions & 6 deletions api-generator/components/overlaypanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ const OverlayPanelProps = [
default: 'true',
description: 'Whether to automatically manage layering.'
},
{
name: 'ariaCloseLabel',
type: 'string',
default: 'close',
description: 'Aria label of the close icon.'
},
{
name: 'breakpoints',
type: 'object',
Expand Down
5 changes: 0 additions & 5 deletions src/components/overlaypanel/OverlayPanel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ export interface OverlayPanelProps {
* Default value is true.
*/
autoZIndex?: boolean;
/**
* Aria label of the close icon.
* Default value is 'close'.
*/
ariaCloseLabel?: string;
/**
* Object literal to define widths per screen size.
* @see OverlayPanelBreakpoints
Expand Down
4 changes: 1 addition & 3 deletions src/components/overlaypanel/OverlayPanel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ describe('OverlayPanel.vue', () => {
}
},
props: {
showCloseIcon: true,
ariaCloseLabel: 'exit'
showCloseIcon: true
},
slots: {
default: 'PrimeVue'
Expand All @@ -30,6 +29,5 @@ describe('OverlayPanel.vue', () => {
expect(wrapper.find('.p-overlaypanel-content').exists()).toBe(true);
expect(wrapper.find('.p-overlaypanel-content').text()).toBe('PrimeVue');
expect(wrapper.find('.p-overlaypanel-close').exists()).toBe(true);
expect(wrapper.find('.p-overlaypanel-close').attributes()['aria-label']).toBe('exit');
});
});
9 changes: 4 additions & 5 deletions src/components/overlaypanel/OverlayPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="p-overlaypanel-content" @click="onContentClick" @mousedown="onContentClick" @keydown="onContentKeydown">
<slot></slot>
</div>
<button v-if="showCloseIcon" v-ripple class="p-overlaypanel-close p-link" :aria-label="ariaCloseLabel" type="button" autofocus @click="hide" @keydown="onButtonKeydown">
<button v-if="showCloseIcon" v-ripple class="p-overlaypanel-close p-link" :aria-label="closeAriaLabel" type="button" autofocus @click="hide" @keydown="onButtonKeydown">
<span class="p-overlaypanel-close-icon pi pi-times"></span>
</button>
</div>
Expand Down Expand Up @@ -45,10 +45,6 @@ export default {
type: Boolean,
default: true
},
ariaCloseLabel: {
type: String,
default: 'close'
},
breakpoints: {
type: Object,
default: null
Expand Down Expand Up @@ -309,6 +305,9 @@ export default {
},
attributeSelector() {
return UniqueComponentId();
},
closeAriaLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
}
},
directives: {
Expand Down
16 changes: 10 additions & 6 deletions src/views/overlaypanel/OverlayPanelDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,22 @@ toggle(event) {
<td>true</td>
<td>Whether to automatically manage layering.</td>
</tr>
<tr>
<td>ariaCloseLabel</td>
<td>string</td>
<td>close</td>
<td>Aria label of the close icon.</td>
</tr>
<tr>
<td>breakpoints</td>
<td>object</td>
<td>null</td>
<td>Object literal to define widths per screen size.</td>
</tr>
<tr>
<td style="text-decoration: line-through">ariaCloseLabel</td>
<td>string</td>
<td>close</td>
<td>
Aria label of the close icon.
<br />
<b> Deprecated: </b> <i>aria.close</i> can be used in defaults to PrimeVue <router-link to="/locale">Locale</router-link> configuration.
</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 16e922d

Please sign in to comment.