File tree 2 files changed +42
-2
lines changed
2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 1
1
<div
2
2
class =" ui5-select-root"
3
- tabindex =" {{ tabIndex }} "
4
3
dir =" {{ dir }} "
4
+ tabindex =" {{ tabIndex }} "
5
+ id =" {{ _id }} -select"
6
+ role =" button"
7
+ aria-haspopup =" listbox"
8
+ aria-labelledby =" {{ _id }} -label"
9
+ aria-describedby =" {{ valueStateTextId }} "
10
+ aria-disabled =" {{ isDisabled }} "
5
11
@keydown =" {{ _onkeydown }} "
6
12
@keyup =" {{ _onkeyup }} "
7
13
@focusin =" {{ _onfocusin }} "
8
14
@focusout =" {{ _onfocusout }} "
9
15
@click =" {{ _toggleRespPopover }} "
10
16
>
11
17
<div class =" ui5-select-label-root" >
12
- <ui5-label >{{ _text }} </ui5-label >
18
+ <ui5-label id = " {{ _id }} -label " for = " {{ _id }} -select " >{{ _text }} </ui5-label >
13
19
</div >
14
20
15
21
<ui5-icon
19
25
dir =" {{ dir }} "
20
26
></ui5-icon >
21
27
28
+ {{ #if hasValueState }}
29
+ <span id =" {{ _id }} -valueStateDesc" class =" ui5-hidden-text" >{{ valueStateText }} </span >
30
+ {{ /if }}
22
31
<slot name =" formSupport" ></slot >
23
32
</div >
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ import "@ui5/webcomponents-icons/dist/icons/slim-arrow-down.js";
15
15
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
16
16
import "@ui5/webcomponents-icons/dist/icons/decline.js" ;
17
17
import {
18
+ VALUE_STATE_SUCCESS ,
19
+ VALUE_STATE_INFORMATION ,
20
+ VALUE_STATE_ERROR ,
21
+ VALUE_STATE_WARNING ,
18
22
INPUT_SUGGESTIONS_TITLE ,
19
23
} from "./generated/i18n/i18n-defaults.js" ;
20
24
import Label from "./Label.js" ;
@@ -424,6 +428,33 @@ class Select extends UI5Element {
424
428
}
425
429
}
426
430
431
+ get valueStateTextMappings ( ) {
432
+ const i18nBundle = this . i18nBundle ;
433
+
434
+ return {
435
+ "Success" : i18nBundle . getText ( VALUE_STATE_SUCCESS ) ,
436
+ "Information" : i18nBundle . getText ( VALUE_STATE_INFORMATION ) ,
437
+ "Error" : i18nBundle . getText ( VALUE_STATE_ERROR ) ,
438
+ "Warning" : i18nBundle . getText ( VALUE_STATE_WARNING ) ,
439
+ } ;
440
+ }
441
+
442
+ get valueStateText ( ) {
443
+ return this . valueStateTextMappings [ this . valueState ] ;
444
+ }
445
+
446
+ get hasValueState ( ) {
447
+ return this . valueState !== ValueState . None ;
448
+ }
449
+
450
+ get valueStateTextId ( ) {
451
+ return this . hasValueState ? `${ this . _id } -valueStateDesc` : undefined ;
452
+ }
453
+
454
+ get isDisabled ( ) {
455
+ return this . disabled || undefined ;
456
+ }
457
+
427
458
get _headerTitleText ( ) {
428
459
return this . i18nBundle . getText ( INPUT_SUGGESTIONS_TITLE ) ;
429
460
}
You can’t perform that action at this time.
0 commit comments