Skip to content

Commit 8550365

Browse files
tsanislavgatevilhan007
authored andcommitted
feat(ui5-tabcontainer): update ACC of header and content (#756)
1 parent d6668bc commit 8550365

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

packages/main/src/TabContainer.hbs

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
dir="{{rtl}}"
44
>
55
<div class="{{classes.header}}" id="{{_id}}-header">
6-
<ui5-icon @click="{{_onHeaderBackArrowClick}}" class="{{classes.headerBackArrow}}" src="sap-icon://slim-arrow-left" tabindex="-1"></ui5-icon>
6+
<ui5-icon @click="{{_onHeaderBackArrowClick}}" class="{{classes.headerBackArrow}}" src="sap-icon://slim-arrow-left" tabindex="-1" accessible-name="{{previousIconACCName}}" show-tooltip></ui5-icon>
77

88
<!-- tab items -->
99
<div class="{{classes.headerScrollContainer}}" id="{{_id}}-headerScrollContainer">
@@ -45,7 +45,7 @@
4545
</ul>
4646
</div>
4747

48-
<ui5-icon @click="{{_onHeaderForwardArrowClick}}" class="{{classes.headerForwardArrow}}" src="sap-icon://slim-arrow-right" tabindex="-1"></ui5-icon>
48+
<ui5-icon @click="{{_onHeaderForwardArrowClick}}" class="{{classes.headerForwardArrow}}" src="sap-icon://slim-arrow-right" tabindex="-1" accessible-name="{{nextIconACCName}}" show-tooltip></ui5-icon>
4949

5050
<!-- overflow button -->
5151
{{#if showOverflow}}
@@ -54,6 +54,7 @@
5454
class="{{classes.overflowButton}}"
5555
icon="sap-icon://slim-arrow-down"
5656
type="Transparent"
57+
title="{{overflowMenuTitle}}"
5758
></ui5-button>
5859
{{/if}}
5960
</div>
@@ -62,7 +63,7 @@
6263
<div class="{{classes.content}}">
6364
{{#each renderItems}}
6465
{{#unless this.isSeparator}}
65-
<div class="{{this.contentItemClasses}}" id="ui5-tc-contentItem-{{this.position}}" ?hidden="{{this.hidden}}">
66+
<div class="{{this.contentItemClasses}}" id="ui5-tc-contentItem-{{this.position}}" ?hidden="{{this.hidden}}" role="tabpanel" aria-labelledby="{{item._id}}">
6667
<slot name="{{this.item._individualSlot}}"></slot>
6768
</div>
6869
{{/unless}}

packages/main/src/TabContainer.js

+17
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import ScrollEnablement from "@ui5/webcomponents-base/dist/delegate/ScrollEnable
55
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
66
import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/events/PseudoEvents.js";
77
import { getRTL } from "@ui5/webcomponents-base/dist/config/RTL.js";
8+
import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
9+
import { TABCONTAINER_PREVIOUS_ICON_ACC_NAME, TABCONTAINER_NEXT_ICON_ACC_NAME, TABCONTAINER_OVERFLOW_MENU_TITLE } from "./generated/i18n/i18n-defaults.js";
810
import TabContainerTemplate from "./generated/templates/TabContainerTemplate.lit.js";
911
import Button from "./Button.js";
1012
import CustomListItem from "./CustomListItem.js";
@@ -176,6 +178,8 @@ class TabContainer extends UI5Element {
176178

177179
// Init ItemNavigation
178180
this._initItemNavigation();
181+
182+
this.i18nBundle = getI18nBundle("@ui5/webcomponents");
179183
}
180184

181185
onBeforeRendering() {
@@ -391,6 +395,18 @@ class TabContainer extends UI5Element {
391395
return this.items.some(item => item.icon) && this.items.some(item => item.text);
392396
}
393397

398+
get previousIconACCName() {
399+
return this.i18nBundle.getText(TABCONTAINER_PREVIOUS_ICON_ACC_NAME);
400+
}
401+
402+
get nextIconACCName() {
403+
return this.i18nBundle.getText(TABCONTAINER_NEXT_ICON_ACC_NAME);
404+
}
405+
406+
get overflowMenuTitle() {
407+
return this.i18nBundle.getText(TABCONTAINER_OVERFLOW_MENU_TITLE);
408+
}
409+
394410
get rtl() {
395411
return getRTL() ? "rtl" : undefined;
396412
}
@@ -402,6 +418,7 @@ class TabContainer extends UI5Element {
402418
Icon.define(),
403419
List.define(),
404420
Popover.define(),
421+
fetchI18nBundle("@ui5/webcomponents"),
405422
]);
406423

407424
super.define(...params);

packages/main/src/i18n/messagebundle.properties

+9
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ SWITCH_ON=On
229229
#XACT: ARIA announcement for the switch off
230230
SWITCH_OFF=Off
231231

232+
#XACT: ACC next icon name in tab container
233+
TABCONTAINER_NEXT_ICON_ACC_NAME=Next
234+
235+
#XACT: ACC previous icon name in tab container
236+
TABCONTAINER_PREVIOUS_ICON_ACC_NAME=Previous
237+
238+
#XACT: ACC overflow menu title in tab container
239+
TABCONTAINER_OVERFLOW_MENU_TITLE=Overflow Menu
240+
232241
#XTXT: Text for characters left
233242
TEXTAREA_CHARACTERS_LEFT={0} characters remaining
234243

0 commit comments

Comments
 (0)