File tree Expand file tree Collapse file tree 11 files changed +76
-4
lines changed Expand file tree Collapse file tree 11 files changed +76
-4
lines changed Original file line number Diff line number Diff line change 3
3
class =" ui5-ghli-root {{ classes.main }} "
4
4
@focusin =" {{ _onfocusin }} "
5
5
@focusout =" {{ _onfocusout }} "
6
+ role =" option"
6
7
>
8
+ <span class =" ui5-hidden-text" >{{ groupHeaderText }} </span >
9
+
7
10
<div id =" {{ _id }} -content" class =" ui5-li-content" >
8
11
<span class =" ui5-ghli-title" ><slot ></slot ></span >
9
12
</div >
Original file line number Diff line number Diff line change 1
1
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
2
+ import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
2
3
import ListItemBase from "./ListItemBase.js" ;
3
4
5
+ import { GROUP_HEADER_TEXT } from "./generated/i18n/i18n-defaults.js" ;
6
+
4
7
// Template
5
8
import GroupHeaderListItemTemplate from "./generated/templates/GroupHeaderListItemTemplate.lit.js" ;
6
9
@@ -60,9 +63,25 @@ class GroupHeaderListItem extends ListItemBase {
60
63
return [ ListItemBase . styles , groupheaderListItemCss ] ;
61
64
}
62
65
66
+ constructor ( ) {
67
+ super ( ) ;
68
+
69
+ this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
70
+ }
71
+
63
72
get group ( ) {
64
73
return true ;
65
74
}
75
+
76
+ get groupHeaderText ( ) {
77
+ return this . i18nBundle . getText ( GROUP_HEADER_TEXT ) ;
78
+ }
79
+
80
+ static async onDefine ( ) {
81
+ await Promise . all ( [
82
+ fetchI18nBundle ( "@ui5/webcomponents" ) ,
83
+ ] ) ;
84
+ }
66
85
}
67
86
68
87
GroupHeaderListItem . define ( ) ;
Original file line number Diff line number Diff line change 9
9
<slot name =" header" />
10
10
{{ /if }}
11
11
{{ #if shouldRenderH1 }}
12
- <header id =" {{ _id }} -header " class =" ui5-list-header" >
12
+ <header id =" {{ headerID }} " class =" ui5-list-header" >
13
13
{{ headerText }}
14
14
</header >
15
15
{{ /if }}
16
16
17
17
<div id =" {{ _id }} -before" tabindex =" 0" class =" ui5-list-focusarea" ></div >
18
18
19
- <ul id =" {{ _id }} -listUl" class =" ui5-list-ul" >
19
+ <ul id =" {{ _id }} -listUl" class =" ui5-list-ul" aria-multiselectable = " {{ isMultiSelect }} " aria-labelledby = " {{ ariaLabelledBy }} " role = " listbox " >
20
20
<slot ></slot >
21
21
22
22
{{ #if showNoDataText }}
Original file line number Diff line number Diff line change @@ -303,6 +303,10 @@ class List extends UI5Element {
303
303
return ! this . header . length && this . headerText ;
304
304
}
305
305
306
+ get headerID ( ) {
307
+ return `${ this . _id } -header` ;
308
+ }
309
+
306
310
get showNoDataText ( ) {
307
311
return this . items . length === 0 && this . noDataText ;
308
312
}
@@ -311,6 +315,14 @@ class List extends UI5Element {
311
315
return this . busy || this . infiniteScroll ;
312
316
}
313
317
318
+ get isMultiSelect ( ) {
319
+ return this . mode === ListMode . MultiSelect ;
320
+ }
321
+
322
+ get ariaLabelledBy ( ) {
323
+ return this . shouldRenderH1 ? this . headerID : undefined ;
324
+ }
325
+
314
326
onBeforeRendering ( ) {
315
327
this . prepareListItems ( ) ;
316
328
}
Original file line number Diff line number Diff line change 11
11
@touchstart =" {{ _ontouchstart }} "
12
12
@touchend =" {{ _ontouchend }} "
13
13
@click =" {{ _onclick }} "
14
+ aria-selected =" {{ ariaSelected }} "
15
+ role =" option"
14
16
>
15
17
{{ #if placeSelectionElementBefore }}
16
18
{{> selectionElement }}
74
76
design =" Transparent"
75
77
icon =" decline"
76
78
@click =" {{ onDelete }} "
79
+ title =" {{ deleteText }} "
77
80
></ui5-button >
78
81
</div >
79
82
{{ /if }}
Original file line number Diff line number Diff line change 1
1
import { isSpace , isEnter } from "@ui5/webcomponents-base/dist/Keys.js" ;
2
2
import "@ui5/webcomponents-icons/dist/icons/decline.js" ;
3
3
import "@ui5/webcomponents-icons/dist/icons/edit.js" ;
4
+ import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
4
5
import ListItemType from "./types/ListItemType.js" ;
5
6
import ListMode from "./types/ListMode.js" ;
6
7
import ListItemBase from "./ListItemBase.js" ;
7
8
import "./RadioButton.js" ;
8
9
import "./CheckBox.js" ;
9
10
import "./Button.js" ;
11
+ import { DELETE } from "./generated/i18n/i18n-defaults.js" ;
10
12
11
13
// Styles
12
14
import styles from "./generated/themes/ListItem.css.js" ;
@@ -107,6 +109,8 @@ class ListItem extends ListItemBase {
107
109
this . active = false ;
108
110
}
109
111
} ;
112
+
113
+ this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
110
114
}
111
115
112
116
onBeforeRendering ( ...params ) {
@@ -262,6 +266,24 @@ class ListItem extends ListItemBase {
262
266
get typeDetail ( ) {
263
267
return this . type === ListItemType . Detail ;
264
268
}
269
+
270
+ get ariaSelected ( ) {
271
+ if ( this . modeMultiSelect ) {
272
+ return this . selected ;
273
+ }
274
+
275
+ return undefined ;
276
+ }
277
+
278
+ get deleteText ( ) {
279
+ return this . i18nBundle . getText ( DELETE ) ;
280
+ }
281
+
282
+ static async onDefine ( ) {
283
+ await Promise . all ( [
284
+ fetchI18nBundle ( "@ui5/webcomponents" ) ,
285
+ ] ) ;
286
+ }
265
287
}
266
288
267
289
export default ListItem ;
Original file line number Diff line number Diff line change 8
8
{{ #if description }}
9
9
<span part =" description" class =" ui5-li-desc" >{{ description }} </span >
10
10
{{ /if }}
11
+ <span class =" ui5-hidden-text" >{{ type }} </span >
11
12
</div >
12
13
{{ #if info }}
13
14
<span part =" info" class =" ui5-li-info" >{{ info }} </span >
Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ CAROUSEL_OF_TEXT=of
40
40
# XACT: DatePicker 'Open Picker' icon title
41
41
DATEPICKER_OPEN_ICON_TITLE =Open Picker
42
42
43
+ DELETE =Delete
44
+
43
45
FILEUPLOAD_BROWSE =Browse...
44
46
47
+ GROUP_HEADER_TEXT =Group Header
48
+
45
49
# XTXT
46
50
ICON_ACTION_SETTINGS =Settings
47
51
Original file line number Diff line number Diff line change
1
+ @import "./InvisibleTextStyles.css" ;
2
+
1
3
: host {
2
4
background: var(--ui5-group-header-listitem-background-color );
3
5
bor der- botto m: 1px solid var(- - sapLis t_TableGroupHeaderBor derColor );
Original file line number Diff line number Diff line change
1
+ @import "./InvisibleTextStyles.css" ;
2
+
1
3
/* actionable (type="Active" + desktop) */
2
4
: host ([actionable ]) {
3
5
cursor : pointer;
You can’t perform that action at this time.
0 commit comments