Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename aria-label to accessible-name #3449

Merged
merged 7 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/base/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jh82i3fpuuAQEHSWZLSJ9IF817M=
FybN/lEhYLReway6H/ghxYHRVLA=
4 changes: 2 additions & 2 deletions packages/base/src/util/AriaLabelHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import findNodeOwner from "./findNodeOwner.js";

const getEffectiveAriaLabelText = el => {
if (!el.ariaLabelledby) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this line needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is. Based on this check, getAriaLabelledByTexts(line 12) is called.

if (el.ariaLabel) {
return el.ariaLabel;
if (el.accessibleName) {
return el.accessibleName;
}

return undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/src/Timeline.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ui5-timeline-root" @focusin={{_onfocusin}}>
<ul class="ui5-timeline-list" role="listbox" aria-live="polite" aria-label="{{ariaLabel}}">
<ul class="ui5-timeline-list" role="listbox" aria-live="polite" aria-label="{{accessibleName}}">
{{#each items}}
<li class="ui5-timeline-list-item" style="list-style-type: none;">
<slot name="{{this._individualSlot}}"></slot>
Expand Down
9 changes: 5 additions & 4 deletions packages/fiori/src/Wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ const metadata = {
managedSlots: true,
properties: /** @lends sap.ui.webcomponents.fiori.Wizard.prototype */ {
/**
* Defines the aria-label text of the <code>ui5-wizard</code>.
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue undefined
* @private
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down Expand Up @@ -805,7 +806,7 @@ class Wizard extends UI5Element {
}

get ariaLabelText() {
return this.ariaLabel || this.i18nBundle.getText(WIZARD_NAV_ARIA_ROLE_DESCRIPTION);
return this.accessibleName || this.i18nBundle.getText(WIZARD_NAV_ARIA_ROLE_DESCRIPTION);
}

get effectiveStepSwitchThreshold() {
Expand Down
8 changes: 5 additions & 3 deletions packages/fiori/src/WizardStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ const metadata = {
},

/**
* Defines the aria-label of the step.
* Sets the accessible aria name of the component.
*
* @type {boolean}
* @defaultvalue ""
* @private
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/test/pages/FCL.html
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
<ui5-title level="H5">Rating:</ui5-title>
<ui5-rating-indicator
id="productRating"
aria-label="Hello World"
accessible-name="Hello World"
value="3.5"
></ui5-rating-indicator>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h3>FlexibleColumnLayout - One Initial Column</h3>
<ui5-title level="H5">Rating:</ui5-title>
<ui5-rating-indicator
id="productRating"
aria-label="Hello World"
accessible-name="Hello World"
value="3.5"
></ui5-rating-indicator>
</div>
Expand Down
9 changes: 5 additions & 4 deletions packages/main/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the button
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue: ""
* @private
* @since 1.0.0-rc.7
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the component
* Sets the accessible aria name of the component.
*
* @type {String}
* @since 1.0.0-rc.9
* @private
* @public
* @since 1.0.0-rc.15
* @defaultvalue ""
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
9 changes: 5 additions & 4 deletions packages/main/src/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@ const metadata = {
},

/**
* Determines the <code>aria-label</code>, set on the component root tag.
* Sets the accessible aria name of the component.
*
* @type {string}
* @defaultvalue undefined
* @private
* @since 1.0.0-rc.8
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down
9 changes: 5 additions & 4 deletions packages/main/src/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the combo box
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue: ""
* @private
* @since 1.0.0-rc.8
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down
7 changes: 3 additions & 4 deletions packages/main/src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ const metadata = {
* Defines the aria-label attribute for the component.
*
* @type {String}
* @since 1.0.0-rc.9
* @private
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
10 changes: 4 additions & 6 deletions packages/main/src/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ const metadata = {
},

/**
* Defines the accessible name of the dialog when <code>header</code> slot is provided.
* <br><br>
* Sets the accessible aria name of the component.
*
* <b>Note:</b> If <code>aria-label</code> is provided, <code>accessibleName</code> will be ignored.

* @type {string}
* @defaultvalue ""
* @public
Expand Down Expand Up @@ -227,7 +224,7 @@ class Dialog extends Popup {
get _ariaLabelledBy() { // Required by Popup.js
let ariaLabelledById;

if (this.headerText !== "" && !this.ariaLabel) {
if (this.headerText !== "" && !this.accessibleName) {
ariaLabelledById = "ui5-popup-header-text";
}

Expand All @@ -240,7 +237,8 @@ class Dialog extends Popup {
if (this.header.length > 0 && !!this.accessibleName) {
ariaLabel = this.accessibleName;
}
return this.ariaLabel ? this.ariaLabel : ariaLabel;

return this.accessibleName ? this.accessibleName : ariaLabel;
}

get _ariaModal() { // Required by Popup.js
Expand Down
9 changes: 4 additions & 5 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,13 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the input
* Sets the accessible aria name of the component.
*
* @type {String}
* @since 1.0.0-rc.8
* @private
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
9 changes: 4 additions & 5 deletions packages/main/src/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the link.
* Sets the accessible aria name of the component.
*
* @type {String}
* @since 1.0.0-rc.10
* @private
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
10 changes: 6 additions & 4 deletions packages/main/src/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ const metadata = {
},

/**
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue ""
* @private
* @since 1.0.0-rc.8
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down Expand Up @@ -520,7 +522,7 @@ class List extends UI5Element {
}

get ariaLabelledBy() {
if (this.ariaLabelledby || this.ariaLabel) {
if (this.ariaLabelledby || this.accessibleName) {
return undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
icon="slim-arrow-right"
@click="{{_toggleButtonClick}}"
._buttonAccInfo="{{accInfo.button}}"
aria-label="{{accInfo.button.ariaLabelButton}}"
accessible-name="{{accInfo.button.ariaLabelButton}}"
></ui5-button>
{{else}}
<ui5-icon
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ const metadata = {

/**
* Sets the accessible aria name of the component.
*
* @type {string}
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
accessibleName: {
type: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ class Popover extends Popup {
}

get _ariaLabelledBy() { // Required by Popup.js
return this.ariaLabel ? undefined : "ui5-popup-header";
return this.accessibleName ? undefined : "ui5-popup-header";
}

get _ariaModal() { // Required by Popup.js
Expand Down
10 changes: 5 additions & 5 deletions packages/main/src/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the popup
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue ""
* @private
* @since 1.0.0-rc.8
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down Expand Up @@ -510,7 +510,7 @@ class Popup extends UI5Element {
* @protected
*/
get _ariaLabel() {
return this.ariaLabel || undefined;
return this.accessibleName || undefined;
}

get _root() {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/RatingIndicator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@click="{{_onclick}}"
@keydown="{{_onkeydown}}"
title="{{tooltip}}"
aria-label="{{ariaLabel}}"
aria-label="{{accessibleName}}"
>
<div
class="ui5-rating-indicator-stars-wrapper"
Expand Down
9 changes: 5 additions & 4 deletions packages/main/src/RatingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the rating indicator.
* Sets the accessible aria name of the component.
*
* @type {String}
* @defaultvalue: undefined
* @private
* @since 1.0.0-rc.8
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
defaultValue: undefined,
},
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the select.
* Sets the accessible aria name of the component.
*
* @type {String}
* @since 1.0.0-rc.9
* @private
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/StepInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ const metadata = {
},

/**
* Defines the aria-label attribute for the component.
* Sets the accessible aria name of the component.
*
* @type {String}
* @private
* @defaultvalue ""
* @public
* @since 1.0.0-rc.15
*/
ariaLabel: {
accessibleName: {
type: String,
},

Expand Down
Loading