@@ -13,6 +13,8 @@ import CalendarDate from "@ui5/webcomponents-base/dist/dates/CalendarDate.js";
13
13
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js" ;
14
14
import { isShow } from "@ui5/webcomponents-base/dist/events/PseudoEvents.js" ;
15
15
import "./icons/appointment-2.js" ;
16
+ import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
17
+ import { DATEPICKER_OPEN_ICON_TITLE , DATEPICKER_DATE_ACC_TEXT } from "./generated/i18n/i18n-defaults.js" ;
16
18
import Icon from "./Icon.js" ;
17
19
import Popover from "./Popover.js" ;
18
20
import Calendar from "./Calendar.js" ;
@@ -285,6 +287,8 @@ class DatePicker extends UI5Element {
285
287
onSelectedDatesChange : this . _handleCalendarSelectedDatesChange . bind ( this ) ,
286
288
selectedDates : [ ] ,
287
289
} ;
290
+
291
+ this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
288
292
}
289
293
290
294
onBeforeRendering ( ) {
@@ -397,6 +401,26 @@ class DatePicker extends UI5Element {
397
401
return this . _oDateFormat ;
398
402
}
399
403
404
+ get accInfo ( ) {
405
+ return {
406
+ "ariaDescribedBy" : `${ this . _id } -date` ,
407
+ "ariaHasPopup" : "true" ,
408
+ "ariaAutoComplete" : "none" ,
409
+ "role" : "combobox" ,
410
+ "ariaOwns" : `${ this . _id } -popover` ,
411
+ "ariaExpanded" : this . isOpen ( ) ,
412
+ "ariaDescription" : this . dateAriaDescription ,
413
+ } ;
414
+ }
415
+
416
+ get openIconTitle ( ) {
417
+ return this . i18nBundle . getText ( DATEPICKER_OPEN_ICON_TITLE ) ;
418
+ }
419
+
420
+ get dateAriaDescription ( ) {
421
+ return this . i18nBundle . getText ( DATEPICKER_DATE_ACC_TEXT ) ;
422
+ }
423
+
400
424
_getPopover ( ) {
401
425
return this . shadowRoot . querySelector ( "ui5-popover" ) ;
402
426
}
@@ -544,6 +568,7 @@ class DatePicker extends UI5Element {
544
568
Popover . define ( ) ,
545
569
Calendar . define ( ) ,
546
570
Input . define ( ) ,
571
+ fetchI18nBundle ( "@ui5/webcomponents" ) ,
547
572
] ) ;
548
573
549
574
super . define ( ...params ) ;
0 commit comments