@ui5/webcomponents 0.31.18 → 0.31.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/dist/Card.js +44 -19
  3. package/dist/Dialog.js +7 -7
  4. package/dist/Icon.js +11 -1
  5. package/dist/Input.js +9 -5
  6. package/dist/List.js +93 -20
  7. package/dist/Popover.js +1 -1
  8. package/dist/Popup.js +5 -5
  9. package/dist/api.json +1 -1
  10. package/dist/features/InputSuggestions.js +1 -3
  11. package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
  12. package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
  13. package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
  14. package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
  15. package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
  16. package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
  17. package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
  18. package/dist/generated/i18n/i18n-defaults.js +2 -2
  19. package/dist/generated/templates/BusyIndicatorTemplate.lit.js +1 -1
  20. package/dist/generated/templates/CardTemplate.lit.js +1 -1
  21. package/dist/generated/templates/ListTemplate.lit.js +2 -2
  22. package/dist/generated/templates/TableTemplate.lit.js +1 -1
  23. package/dist/generated/themes/Badge.css.js +1 -1
  24. package/dist/generated/themes/Button.css.js +1 -1
  25. package/dist/generated/themes/Card.css.js +1 -1
  26. package/dist/generated/themes/CheckBox.css.js +1 -1
  27. package/dist/generated/themes/ComboBox.css.js +1 -1
  28. package/dist/generated/themes/DatePicker.css.js +1 -1
  29. package/dist/generated/themes/GroupHeaderListItem.css.js +1 -1
  30. package/dist/generated/themes/Input.css.js +1 -1
  31. package/dist/generated/themes/InvisibleTextStyles.css.js +1 -1
  32. package/dist/generated/themes/Label.css.js +1 -1
  33. package/dist/generated/themes/Link.css.js +1 -1
  34. package/dist/generated/themes/List.css.js +1 -1
  35. package/dist/generated/themes/ListItem.css.js +1 -1
  36. package/dist/generated/themes/MessageStrip.css.js +1 -1
  37. package/dist/generated/themes/MultiComboBox.css.js +1 -1
  38. package/dist/generated/themes/Panel.css.js +1 -1
  39. package/dist/generated/themes/RadioButton.css.js +1 -1
  40. package/dist/generated/themes/SegmentedButton.css.js +1 -1
  41. package/dist/generated/themes/Select.css.js +1 -1
  42. package/dist/generated/themes/SliderBase.css.js +1 -1
  43. package/dist/generated/themes/StepInput.css.js +1 -1
  44. package/dist/generated/themes/Switch.css.js +1 -1
  45. package/dist/generated/themes/TextArea.css.js +1 -1
  46. package/dist/generated/themes/Tokenizer.css.js +1 -1
  47. package/dist/generated/themes/Tree.css.js +1 -1
  48. package/dist/generated/themes/TreeListItem.css.js +1 -1
  49. package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
  50. package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
  51. package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
  52. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
  53. package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
  54. package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
  55. package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
  56. package/dist/i18n/messagebundle.properties +9 -0
  57. package/dist/i18n/messagebundle_id.properties +218 -0
  58. package/package.json +7 -7
  59. package/src/BusyIndicator.hbs +1 -0
  60. package/src/Card.hbs +3 -5
  61. package/src/Card.js +44 -19
  62. package/src/Dialog.js +7 -7
  63. package/src/Icon.js +11 -1
  64. package/src/Input.js +9 -5
  65. package/src/List.hbs +3 -0
  66. package/src/List.js +93 -20
  67. package/src/Popover.js +1 -1
  68. package/src/Popup.js +5 -5
  69. package/src/Table.hbs +1 -0
  70. package/src/features/InputSuggestions.js +1 -3
  71. package/src/i18n/messagebundle.properties +9 -0
  72. package/src/i18n/messagebundle_id.properties +218 -0
  73. package/.port +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,119 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.31.22](https://github.com/SAP/ui5-webcomponents/compare/v0.31.21...v0.31.22) (2021-10-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui5-card:** accessibleName now takes effect ([0769850](https://github.com/SAP/ui5-webcomponents/commit/0769850))
12
+ * **ui5-card:** fix a11y "unique landmark" issue ([32e1477](https://github.com/SAP/ui5-webcomponents/commit/32e1477))
13
+
14
+
15
+ ### Features
16
+
17
+ * **framework:** allow using a custom i18n library ([#4119](https://github.com/SAP/ui5-webcomponents/issues/4119)) ([947889a](https://github.com/SAP/ui5-webcomponents/commit/947889a))
18
+ * **ui5-card:** introduce accessible-name-ref to replace aria-labelledby ([3f7138c](https://github.com/SAP/ui5-webcomponents/commit/3f7138c))
19
+
20
+
21
+ ### Reverts
22
+
23
+ * feat(framework): allow using a custom i18n library ([debc848](https://github.com/SAP/ui5-webcomponents/commit/debc848))
24
+
25
+
26
+
27
+
28
+
29
+ ## [0.31.21](https://github.com/SAP/ui5-webcomponents/compare/v0.31.20...v0.31.21) (2021-10-16)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **ui5-input:** Behaviour on mobile device enhanced ([#4025](https://github.com/SAP/ui5-webcomponents/issues/4025)) ([ebd2065](https://github.com/SAP/ui5-webcomponents/commit/ebd2065))
35
+ * **ui5-list:** remove unnecessary scrollbar in RTL for Multiselect mode ([#4085](https://github.com/SAP/ui5-webcomponents/issues/4085)) ([023081e](https://github.com/SAP/ui5-webcomponents/commit/023081e)), closes [#3947](https://github.com/SAP/ui5-webcomponents/issues/3947)
36
+ * **ui5-list, ui5-table, ui5-notification, ui5-busy-indicator:** getFocusDomRef returns the correct element when the state is busy ([#3951](https://github.com/SAP/ui5-webcomponents/issues/3951)) ([feaa63f](https://github.com/SAP/ui5-webcomponents/commit/feaa63f)), closes [#3922](https://github.com/SAP/ui5-webcomponents/issues/3922)
37
+
38
+
39
+ ### Features
40
+
41
+ * **ui5-card:** add "accessibleName" ([c6f75c7](https://github.com/SAP/ui5-webcomponents/commit/c6f75c7))
42
+
43
+
44
+
45
+
46
+
47
+ ## [0.31.20](https://github.com/SAP/ui5-webcomponents/compare/v0.31.19...v0.31.20) (2021-10-03)
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * **ui5-dialog:** Fixed "aria-label" text screen reading ([#3936](https://github.com/SAP/ui5-webcomponents/issues/3936)) ([622344d](https://github.com/SAP/ui5-webcomponents/commit/622344d)), closes [#3778](https://github.com/SAP/ui5-webcomponents/issues/3778)
53
+ * **ui5-icon:** decorative icons now have aria-hidden=true ([#3983](https://github.com/SAP/ui5-webcomponents/issues/3983)) ([e558159](https://github.com/SAP/ui5-webcomponents/commit/e558159)), closes [#3954](https://github.com/SAP/ui5-webcomponents/issues/3954)
54
+
55
+
56
+ ### Features
57
+
58
+ * **ui5-popover:** add accessibleName proeprty ([4f8c70c](https://github.com/SAP/ui5-webcomponents/commit/4f8c70c))
59
+ * add "id" message bundle ([34399c1](https://github.com/SAP/ui5-webcomponents/commit/34399c1))
60
+ * **ui5-list:** announce the selection mode of the list on entry ([#4018](https://github.com/SAP/ui5-webcomponents/issues/4018)) ([58c36b1](https://github.com/SAP/ui5-webcomponents/commit/58c36b1)), closes [#3806](https://github.com/SAP/ui5-webcomponents/issues/3806)
61
+
62
+
63
+ ### BREAKING CHANGES
64
+
65
+ * **ui5-popover:** ariaLabel has been replaced by accessibleName
66
+
67
+
68
+
69
+
70
+
71
+ ## [0.31.19](https://github.com/SAP/ui5-webcomponents/compare/v0.31.18...v0.31.19) (2021-09-24)
72
+
73
+
74
+ ### Bug Fixes
75
+
76
+ * **ui5-input:** inner input padding is correctly updated ([#3015](https://github.com/SAP/ui5-webcomponents/issues/3015)) ([06f7088](https://github.com/SAP/ui5-webcomponents/commit/06f7088)), closes [#2940](https://github.com/SAP/ui5-webcomponents/issues/2940)
77
+ * **ui5-label:** fix truncation ([#3995](https://github.com/SAP/ui5-webcomponents/issues/3995)) ([0a8d511](https://github.com/SAP/ui5-webcomponents/commit/0a8d511)), closes [#3897](https://github.com/SAP/ui5-webcomponents/issues/3897) [#3980](https://github.com/SAP/ui5-webcomponents/issues/3980)
78
+ * **ui5-timeline:** align indicator in compact mode ([#3902](https://github.com/SAP/ui5-webcomponents/issues/3902)) ([2baf34a](https://github.com/SAP/ui5-webcomponents/commit/2baf34a))
79
+
80
+
81
+ ### Features
82
+
83
+ * **ui5-list:** introduce accessibleName, accessibleNameRef, accessibleRole ([e84a3fa](https://github.com/SAP/ui5-webcomponents/commit/e84a3fa))
84
+
85
+
86
+ ### BREAKING CHANGES
87
+
88
+ * **ui5-list:** ariaLabel and ariaLabelledby are removed in favor of accessibleName and accessibleNameRef
89
+
90
+
91
+
92
+
93
+
94
+ ## [0.31.18](https://github.com/SAP/ui5-webcomponents/compare/v0.31.17...v0.31.18) (2021-09-20)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * **ui5-badge:** update accent colors ([#3926](https://github.com/SAP/ui5-webcomponents/issues/3926)) ([0304014](https://github.com/SAP/ui5-webcomponents/commit/0304014)), closes [#3923](https://github.com/SAP/ui5-webcomponents/issues/3923) [#3923](https://github.com/SAP/ui5-webcomponents/issues/3923)
100
+ * **ui5-combobox:** announce selected item ([#3358](https://github.com/SAP/ui5-webcomponents/issues/3358)) ([e05826e](https://github.com/SAP/ui5-webcomponents/commit/e05826e))
101
+ * **ui5-file-uploader:** Button is activated with Enter/Space key with screen reader virtual cursor ([#3944](https://github.com/SAP/ui5-webcomponents/issues/3944)) ([af808d4](https://github.com/SAP/ui5-webcomponents/commit/af808d4)), closes [#3767](https://github.com/SAP/ui5-webcomponents/issues/3767) [#3767](https://github.com/SAP/ui5-webcomponents/issues/3767)
102
+ * **ui5-input:** adjust value state paddings according to specifications ([#3833](https://github.com/SAP/ui5-webcomponents/issues/3833)) ([48bd6fe](https://github.com/SAP/ui5-webcomponents/commit/48bd6fe)), closes [#3611](https://github.com/SAP/ui5-webcomponents/issues/3611) [#3611](https://github.com/SAP/ui5-webcomponents/issues/3611)
103
+ * **ui5-label:** adjust colon margins ([#3897](https://github.com/SAP/ui5-webcomponents/issues/3897)) ([556516e](https://github.com/SAP/ui5-webcomponents/commit/556516e))
104
+ * **ui5-link:** the anchor element inherits its text-decoration ([#3911](https://github.com/SAP/ui5-webcomponents/issues/3911)) ([276b142](https://github.com/SAP/ui5-webcomponents/commit/276b142)), closes [#3837](https://github.com/SAP/ui5-webcomponents/issues/3837) [#3837](https://github.com/SAP/ui5-webcomponents/issues/3837)
105
+ * **ui5-list:** change role mappings so no interactive elements are ne… ([#3952](https://github.com/SAP/ui5-webcomponents/issues/3952)) ([82be1de](https://github.com/SAP/ui5-webcomponents/commit/82be1de)), closes [#3927](https://github.com/SAP/ui5-webcomponents/issues/3927)
106
+ * **ui5-toast:** Content is announced when ui5-toast is shown ([#3939](https://github.com/SAP/ui5-webcomponents/issues/3939)) ([cce6ca8](https://github.com/SAP/ui5-webcomponents/commit/cce6ca8))
107
+ * **ui5-tree, ui5-table, ui5-side-navigation:** unnecessary scrollbar in RTL is removed ([#3948](https://github.com/SAP/ui5-webcomponents/issues/3948)) ([bab650a](https://github.com/SAP/ui5-webcomponents/commit/bab650a))
108
+
109
+
110
+ ### Features
111
+
112
+ * **invisibleMessage:** introduce invisibleMessage util ([#3192](https://github.com/SAP/ui5-webcomponents/issues/3192)) ([021619b](https://github.com/SAP/ui5-webcomponents/commit/021619b))
113
+ * **ui5-card:** implement ariaLevel property ([5eca9d5](https://github.com/SAP/ui5-webcomponents/commit/5eca9d5))
114
+
115
+
116
+
117
+
118
+
6
119
  ## [0.31.17](https://github.com/SAP/ui5-webcomponents/compare/v0.31.16...v0.31.17) (2021-09-13)
7
120
 
8
121
 
package/dist/Card.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
2
  import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
3
  import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
4
- import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
5
4
  import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
6
5
  import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
7
6
  import CardTemplate from "./generated/templates/CardTemplate.lit.js";
@@ -114,28 +113,28 @@ const metadata = {
114
113
  },
115
114
 
116
115
  /**
117
- * Defines the aria-label attribute for the <code>ui5-card</code>
116
+ * Defines the accessible name of the component, which is used as the name of the card region and should be unique per card.
117
+ * <b>Note:</b> <code>accessibleName</code> should be always set.
118
118
  *
119
119
  * @type {String}
120
- * @since 1.0.0-rc.9
121
- * @private
122
120
  * @defaultvalue ""
121
+ * @public
122
+ * @since 1.0.0-rc.16
123
123
  */
124
- ariaLabel: {
124
+ accessibleName: {
125
125
  type: String,
126
126
  },
127
127
 
128
128
  /**
129
- * Receives id(or many ids) of the elements that label the <code>ui5-card</code>
129
+ * Defines the IDs of the elements that label the component.
130
130
  *
131
131
  * @type {String}
132
132
  * @defaultvalue ""
133
- * @private
134
- * @since 1.0.0-rc.9
133
+ * @public
134
+ * @since 1.0.0-rc.16
135
135
  */
136
- ariaLabelledby: {
136
+ accessibleNameRef: {
137
137
  type: String,
138
- defaultValue: "",
139
138
  },
140
139
 
141
140
  /**
@@ -255,12 +254,42 @@ class Card extends UI5Element {
255
254
  return !!(this.heading || this.subheading || this.status || this.hasAction || this.avatar);
256
255
  }
257
256
 
258
- get ariaLabelText() {
259
- return getEffectiveAriaLabelText(this);
260
- }
257
+ // As in 0.31 we don't have all the accessibleNameRef, accessibleName related changes downported,
258
+ // we manually add getEffectiveAriaLabelText and getAriaLabelledByTexts methods and change them,
259
+ // so they work with accessibleName and accessibleNameRef, isntead of ariaLabel and ariaLabelledby
260
+ getEffectiveAriaLabelText(el) {
261
+ if (!el.accessibleNameRef) {
262
+ if (el.accessibleName) {
263
+ return el.accessibleName;
264
+ }
265
+
266
+ return undefined;
267
+ }
268
+
269
+ return this.getAriaLabelledByTexts(el);
270
+ };
271
+
272
+ getAriaLabelledByTexts(el, ownerDocument, readyIds = "") {
273
+ const ids = (readyIds && readyIds.split(" ")) || el.accessibleNameRef.split(" ");
274
+ const owner = ownerDocument || findNodeOwner(el);
275
+ let result = "";
276
+
277
+ ids.forEach((elementId, index) => {
278
+ const element = owner.querySelector(`[id='${elementId}']`);
279
+ result += `${element ? element.textContent : ""}`;
280
+
281
+ if (index < ids.length - 1) {
282
+ result += " ";
283
+ }
284
+ });
285
+
286
+ return result;
287
+ };
261
288
 
262
- get ariaCardRoleDescription() {
263
- return this.i18nBundle.getText(ARIA_ROLEDESCRIPTION_CARD);
289
+ get ariaLabelText() {
290
+ const effectiveAriaLabelText = this.getEffectiveAriaLabelText(this),
291
+ effectiveAriaLabel = effectiveAriaLabelText ? ` ${effectiveAriaLabelText}` : "";
292
+ return this.i18nBundle.getText(ARIA_ROLEDESCRIPTION_CARD) + effectiveAriaLabel;
264
293
  }
265
294
 
266
295
  get ariaCardHeaderRoleDescription() {
@@ -293,10 +322,6 @@ class Card extends UI5Element {
293
322
  return labels.length !== 0 ? labels.join(" ") : undefined;
294
323
  }
295
324
 
296
- get ariaLabelledByCard() {
297
- return this.heading ? `${this._id}-heading ${this._id}-desc` : `${this._id}-desc`;
298
- }
299
-
300
325
  get hasAvatar() {
301
326
  return !!this.avatar.length;
302
327
  }
package/dist/Dialog.js CHANGED
@@ -211,20 +211,20 @@ class Dialog extends Popup {
211
211
  get _ariaLabelledBy() { // Required by Popup.js
212
212
  let ariaLabelledById;
213
213
 
214
- if (this.headerText !== "" && !this.ariaLabel) {
214
+ if (this.headerText !== "" && !this.accessibleName) {
215
215
  ariaLabelledById = "ui5-popup-header-text";
216
216
  }
217
217
 
218
218
  return ariaLabelledById;
219
219
  }
220
220
 
221
+ /**
222
+ * Ensures ariaLabel is never null or empty string
223
+ * @returns {String|undefined}
224
+ * @protected
225
+ */
221
226
  get _ariaLabel() {
222
- let ariaLabel;
223
-
224
- if (this.header.length > 0 && !!this.accessibleName) {
225
- ariaLabel = this.accessibleName;
226
- }
227
- return this.ariaLabel ? this.ariaLabel : ariaLabel;
227
+ return this.accessibleName || undefined;
228
228
  }
229
229
 
230
230
  get _ariaModal() { // Required by Popup.js
package/dist/Icon.js CHANGED
@@ -12,6 +12,7 @@ import IconTemplate from "./generated/templates/IconTemplate.lit.js";
12
12
  import iconCss from "./generated/themes/Icon.css.js";
13
13
 
14
14
  const ICON_NOT_FOUND = "ICON_NOT_FOUND";
15
+ const PRESENTATION_ROLE = "presentation";
15
16
 
16
17
  /**
17
18
  * @public
@@ -97,6 +98,7 @@ const metadata = {
97
98
 
98
99
  /**
99
100
  * Defines the aria hidden state of the component.
101
+ * Note: If the role is presentation the default value of aria-hidden will be true.
100
102
  * @private
101
103
  * @since 1.0.0-rc.15
102
104
  */
@@ -257,6 +259,10 @@ class Icon extends UI5Element {
257
259
 
258
260
  get effectiveAriaHidden() {
259
261
  if (this.ariaHidden === "") {
262
+ if (this.isDecorative) {
263
+ return true;
264
+ }
265
+
260
266
  return;
261
267
  }
262
268
 
@@ -267,6 +273,10 @@ class Icon extends UI5Element {
267
273
  return this.interactive ? "0" : "-1";
268
274
  }
269
275
 
276
+ get isDecorative() {
277
+ return this.effectiveAccessibleRole === PRESENTATION_ROLE;
278
+ }
279
+
270
280
  get effectiveAccessibleRole() {
271
281
  if (this.role) {
272
282
  return this.role;
@@ -276,7 +286,7 @@ class Icon extends UI5Element {
276
286
  return "button";
277
287
  }
278
288
 
279
- return this.effectiveAccessibleName ? "img" : "presentation";
289
+ return this.effectiveAccessibleName ? "img" : PRESENTATION_ROLE;
280
290
  }
281
291
 
282
292
  static createGlobalStyle() {
package/dist/Input.js CHANGED
@@ -998,7 +998,7 @@ class Input extends UI5Element {
998
998
  }
999
999
 
1000
1000
  async getInputDOMRef() {
1001
- if (isPhone() && this.Suggestions && this.suggestionItems.length) {
1001
+ if (isPhone() && this.Suggestions) {
1002
1002
  await this.Suggestions._respPopover();
1003
1003
  return this.Suggestions && this.Suggestions.responsivePopover.querySelector(".ui5-input-inner-phone");
1004
1004
  }
@@ -1187,7 +1187,7 @@ class Input extends UI5Element {
1187
1187
  }
1188
1188
 
1189
1189
  get styles() {
1190
- return {
1190
+ const stylesObject = {
1191
1191
  popoverHeader: {
1192
1192
  "max-width": `${this._inputWidth}px`,
1193
1193
  },
@@ -1198,10 +1198,14 @@ class Input extends UI5Element {
1198
1198
  suggestionsPopover: {
1199
1199
  "max-width": `${this._inputWidth}px`,
1200
1200
  },
1201
- innerInput: {
1202
- padding: this.nativeInputWidth < 48 ? "0" : undefined,
1203
- },
1201
+ innerInput: {},
1204
1202
  };
1203
+
1204
+ if (this.nativeInputWidth < 48) {
1205
+ stylesObject.innerInput.padding = "0";
1206
+ }
1207
+
1208
+ return stylesObject;
1205
1209
  }
1206
1210
 
1207
1211
  get suggestionSeparators() {
package/dist/List.js CHANGED
@@ -6,7 +6,7 @@ import { isIE } from "@ui5/webcomponents-base/dist/Device.js";
6
6
  import { getLastTabbableElement } from "@ui5/webcomponents-base/dist/util/TabbableElements.js";
7
7
  import { isTabNext, isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
8
8
  import NavigationMode from "@ui5/webcomponents-base/dist/types/NavigationMode.js";
9
- import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
9
+ import findNodeOwner from "@ui5/webcomponents-base/dist/util/findNodeOwner.js";
10
10
  import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
11
11
  import debounce from "@ui5/webcomponents-base/dist/util/debounce.js";
12
12
  import isElementInView from "@ui5/webcomponents-base/dist/util/isElementInView.js";
@@ -22,7 +22,11 @@ import ListTemplate from "./generated/templates/ListTemplate.lit.js";
22
22
  import listCss from "./generated/themes/List.css.js";
23
23
 
24
24
  // Texts
25
- import { LOAD_MORE_TEXT } from "./generated/i18n/i18n-defaults.js";
25
+ import {
26
+ LOAD_MORE_TEXT, ARIA_LABEL_LIST_SELECTABLE,
27
+ ARIA_LABEL_LIST_MULTISELECTABLE,
28
+ ARIA_LABEL_LIST_DELETABLE,
29
+ } from "./generated/i18n/i18n-defaults.js";
26
30
 
27
31
  const INFINITE_SCROLL_DEBOUNCE_RATE = 250; // ms
28
32
 
@@ -167,7 +171,7 @@ const metadata = {
167
171
  * @since 1.0.0-rc.13
168
172
  * @public
169
173
  */
170
- growing: {
174
+ growing: {
171
175
  type: ListGrowingMode,
172
176
  defaultValue: ListGrowingMode.None,
173
177
  },
@@ -185,12 +189,14 @@ const metadata = {
185
189
  },
186
190
 
187
191
  /**
192
+ * Sets the accessible aria name of the component.
193
+ *
188
194
  * @type {String}
189
195
  * @defaultvalue ""
190
- * @private
191
- * @since 1.0.0-rc.8
196
+ * @public
197
+ * @since 1.0.0-rc.15
192
198
  */
193
- ariaLabel: {
199
+ accessibleName: {
194
200
  type: String,
195
201
  },
196
202
 
@@ -199,10 +205,10 @@ const metadata = {
199
205
  *
200
206
  * @type {String}
201
207
  * @defaultvalue ""
202
- * @private
203
- * @since 1.0.0-rc.8
208
+ * @public
209
+ * @since 1.0.0-rc.15
204
210
  */
205
- ariaLabelledby: {
211
+ accessibleNameRef: {
206
212
  type: String,
207
213
  defaultValue: "",
208
214
  },
@@ -210,15 +216,13 @@ const metadata = {
210
216
  /**
211
217
  * Defines the accessible role of the component.
212
218
  * <br><br>
213
- * <b>Note:</b> If you use notification list items,
214
- * it's recommended to set <code>accessible-role="list"</code> for better accessibility.
215
219
  *
216
- * @private
220
+ * @public
217
221
  * @type {String}
218
222
  * @defaultvalue "list"
219
223
  * @since 1.0.0-rc.15
220
224
  */
221
- accessibleRole: {
225
+ accessibleRole: {
222
226
  type: String,
223
227
  defaultValue: "list",
224
228
  },
@@ -227,7 +231,7 @@ const metadata = {
227
231
  * Defines if the entire list is in view port.
228
232
  * @private
229
233
  */
230
- _inViewport: {
234
+ _inViewport: {
231
235
  type: Boolean,
232
236
  },
233
237
 
@@ -235,7 +239,7 @@ const metadata = {
235
239
  * Defines the active state of the <code>More</code> button.
236
240
  * @private
237
241
  */
238
- _loadMoreActive: {
242
+ _loadMoreActive: {
239
243
  type: Boolean,
240
244
  },
241
245
  },
@@ -459,6 +463,35 @@ class List extends UI5Element {
459
463
  }
460
464
  }
461
465
 
466
+ getEffectiveAriaLabelText(el) {
467
+ if (!el.accessibleNameRef) {
468
+ if (el.accessibleName) {
469
+ return el.accessibleName;
470
+ }
471
+
472
+ return undefined;
473
+ }
474
+
475
+ return this.getAriaLabelledByTexts(el);
476
+ };
477
+
478
+ getAriaLabelledByTexts(el, ownerDocument, readyIds = "") {
479
+ const ids = (readyIds && readyIds.split(" ")) || el.accessibleNameRef.split(" ");
480
+ const owner = ownerDocument || findNodeOwner(el);
481
+ let result = "";
482
+
483
+ ids.forEach((elementId, index) => {
484
+ const element = owner.querySelector(`[id='${elementId}']`);
485
+ result += `${element ? element.textContent : ""}`;
486
+
487
+ if (index < ids.length - 1) {
488
+ result += " ";
489
+ }
490
+ });
491
+
492
+ return result;
493
+ };
494
+
462
495
  get shouldRenderH1() {
463
496
  return !this.header.length && this.headerText;
464
497
  }
@@ -467,6 +500,10 @@ class List extends UI5Element {
467
500
  return `${this._id}-header`;
468
501
  }
469
502
 
503
+ get modeLabelID() {
504
+ return `${this._id}-modeLabel`;
505
+ }
506
+
470
507
  get listEndDOM() {
471
508
  return this.shadowRoot.querySelector(".ui5-list-end-marker");
472
509
  }
@@ -479,20 +516,56 @@ class List extends UI5Element {
479
516
  return !this.hasData && this.noDataText;
480
517
  }
481
518
 
519
+ get isDelete() {
520
+ return this.mode === ListMode.Delete;
521
+ }
522
+
523
+ get isSingleSelect() {
524
+ return [
525
+ ListMode.SingleSelect,
526
+ ListMode.SingleSelectBegin,
527
+ ListMode.SingleSelectEnd,
528
+ ListMode.SingleSelectAuto,
529
+ ].includes(this.mode);
530
+ }
531
+
482
532
  get isMultiSelect() {
483
533
  return this.mode === ListMode.MultiSelect;
484
534
  }
485
-
535
+
486
536
  get ariaLabelledBy() {
487
- if (this.ariaLabelledby || this.ariaLabel) {
537
+ if (this.accessibleNameRef || this.accessibleName) {
488
538
  return undefined;
489
539
  }
540
+ const ids = [];
490
541
 
491
- return this.shouldRenderH1 ? this.headerID : undefined;
492
- }
542
+ if (this.isMultiSelect || this.isSingleSelect || this.isDelete) {
543
+ ids.push(this.modeLabelID);
544
+ }
493
545
 
546
+ if (this.shouldRenderH1) {
547
+ ids.push(this.headerID);
548
+ }
549
+
550
+ return ids.length ? ids.join(" ") : undefined;
551
+ }
552
+
494
553
  get ariaLabelТxt() {
495
- return getEffectiveAriaLabelText(this);
554
+ return this.getEffectiveAriaLabelText(this);
555
+ }
556
+
557
+ get ariaLabelModeText() {
558
+ if (this.isMultiSelect) {
559
+ return this.i18nBundle.getText(ARIA_LABEL_LIST_MULTISELECTABLE);
560
+ }
561
+ if (this.isSingleSelect) {
562
+ return this.i18nBundle.getText(ARIA_LABEL_LIST_SELECTABLE);
563
+ }
564
+ if (this.isDelete) {
565
+ return this.i18nBundle.getText(ARIA_LABEL_LIST_DELETABLE);
566
+ }
567
+
568
+ return undefined;
496
569
  }
497
570
 
498
571
  get grows() {
package/dist/Popover.js CHANGED
@@ -666,7 +666,7 @@ class Popover extends Popup {
666
666
  }
667
667
 
668
668
  get _ariaLabelledBy() { // Required by Popup.js
669
- return this.ariaLabel ? undefined : "ui5-popup-header";
669
+ return this.accessibleName ? undefined : "ui5-popup-header";
670
670
  }
671
671
 
672
672
  get _ariaModal() { // Required by Popup.js
package/dist/Popup.js CHANGED
@@ -67,14 +67,14 @@ const metadata = {
67
67
  },
68
68
 
69
69
  /**
70
- * Defines the aria-label attribute for the popup
70
+ * Sets the accessible aria name of the component.
71
71
  *
72
72
  * @type {String}
73
73
  * @defaultvalue ""
74
- * @private
75
- * @since 1.0.0-rc.8
74
+ * @public
75
+ * @since 1.0.0-rc.15
76
76
  */
77
- ariaLabel: {
77
+ accessibleName: {
78
78
  type: String,
79
79
  defaultValue: undefined,
80
80
  },
@@ -535,7 +535,7 @@ class Popup extends UI5Element {
535
535
  * @protected
536
536
  */
537
537
  get _ariaLabel() {
538
- return this.ariaLabel || undefined;
538
+ return this.accessibleName || undefined;
539
539
  }
540
540
 
541
541
  get _root() {