File tree 4 files changed +16
-2
lines changed
4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
<div class =" ui5-timeline-root" >
2
- <ul class =" ui5-timeline-list" >
2
+ <ul class =" ui5-timeline-list" role = " listbox " aria-live = " polite " aria-label = " {{ ariaLabel }} " >
3
3
{{ #each items }}
4
4
<li class =" ui5-timeline-list-item" >
5
5
<slot name =" {{ this._individualSlot }} " ></slot >
Original file line number Diff line number Diff line change 1
1
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2
+ import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
2
3
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
3
4
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js" ;
4
5
import TimelineTemplate from "./generated/templates/TimelineTemplate.lit.js" ;
6
+ import { TIMELINE_ARIA_LABEL } from "./generated/i18n/i18n-defaults.js" ;
5
7
6
8
// Styles
7
9
import styles from "./generated/themes/Timeline.css.js" ;
@@ -69,12 +71,21 @@ class Timeline extends UI5Element {
69
71
super ( ) ;
70
72
71
73
this . initItemNavigation ( ) ;
74
+ this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
75
+ }
76
+
77
+ static async onDefine ( ) {
78
+ await fetchI18nBundle ( "@ui5/webcomponents" ) ;
72
79
}
73
80
74
81
initItemNavigation ( ) {
75
82
this . _itemNavigation = new ItemNavigation ( this ) ;
76
83
this . _itemNavigation . getItemsCallback = ( ) => this . items ;
77
84
}
85
+
86
+ get ariaLabel ( ) {
87
+ return this . i18nBundle . getText ( TIMELINE_ARIA_LABEL ) ;
88
+ }
78
89
}
79
90
80
91
Timeline . define ( ) ;
Original file line number Diff line number Diff line change 9
9
</div >
10
10
{{ /if }}
11
11
</div >
12
- <div class =" ui5-tli-bubble" tabindex =" {{ _tabIndex }} " data-sap-focus-ref>
12
+ <div class =" ui5-tli-bubble" tabindex =" {{ _tabIndex }} " role = " option " data-sap-focus-ref>
13
13
<div class =" ui5-tli-title" >
14
14
{{ #if itemName }}
15
15
{{> itemName }}
Original file line number Diff line number Diff line change @@ -268,6 +268,9 @@ TEXTAREA_CHARACTERS_LEFT={0} characters remaining
268
268
# XTXT: Text for characters over
269
269
TEXTAREA_CHARACTERS_EXCEEDED ={0} characters over limit
270
270
271
+ # XACT: ARIA announcement for timeline label
272
+ TIMELINE_ARIA_LABEL =Timeline
273
+
271
274
# XFLD: Timepicker slider header
272
275
TIMEPICKER_HOURS_LABEL =Hours
273
276
You can’t perform that action at this time.
0 commit comments