@ui5/webcomponents 0.31.19 → 0.31.23

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 (63) hide show
  1. package/CHANGELOG.md +77 -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 +1 -1
  6. package/dist/List.js +51 -7
  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 +7 -18
  11. package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
  12. package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
  13. package/dist/generated/i18n/i18n-defaults.js +2 -2
  14. package/dist/generated/templates/BusyIndicatorTemplate.lit.js +1 -1
  15. package/dist/generated/templates/CardTemplate.lit.js +1 -1
  16. package/dist/generated/templates/ListTemplate.lit.js +2 -2
  17. package/dist/generated/templates/TableTemplate.lit.js +1 -1
  18. package/dist/generated/themes/Badge.css.js +1 -1
  19. package/dist/generated/themes/Button.css.js +1 -1
  20. package/dist/generated/themes/Card.css.js +1 -1
  21. package/dist/generated/themes/CheckBox.css.js +1 -1
  22. package/dist/generated/themes/ComboBox.css.js +1 -1
  23. package/dist/generated/themes/DatePicker.css.js +1 -1
  24. package/dist/generated/themes/Dialog.css.js +1 -1
  25. package/dist/generated/themes/GroupHeaderListItem.css.js +1 -1
  26. package/dist/generated/themes/Input.css.js +1 -1
  27. package/dist/generated/themes/InvisibleTextStyles.css.js +1 -1
  28. package/dist/generated/themes/Link.css.js +1 -1
  29. package/dist/generated/themes/List.css.js +1 -1
  30. package/dist/generated/themes/ListItem.css.js +1 -1
  31. package/dist/generated/themes/MessageStrip.css.js +1 -1
  32. package/dist/generated/themes/MultiComboBox.css.js +1 -1
  33. package/dist/generated/themes/Panel.css.js +1 -1
  34. package/dist/generated/themes/RadioButton.css.js +1 -1
  35. package/dist/generated/themes/SegmentedButton.css.js +1 -1
  36. package/dist/generated/themes/Select.css.js +1 -1
  37. package/dist/generated/themes/SliderBase.css.js +1 -1
  38. package/dist/generated/themes/StepInput.css.js +1 -1
  39. package/dist/generated/themes/Switch.css.js +1 -1
  40. package/dist/generated/themes/TextArea.css.js +1 -1
  41. package/dist/generated/themes/Tokenizer.css.js +1 -1
  42. package/dist/generated/themes/Tree.css.js +1 -1
  43. package/dist/generated/themes/TreeListItem.css.js +1 -1
  44. package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
  45. package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
  46. package/dist/i18n/messagebundle.properties +9 -0
  47. package/dist/i18n/messagebundle_id.properties +218 -0
  48. package/package.json +8 -8
  49. package/src/BusyIndicator.hbs +1 -0
  50. package/src/Card.hbs +3 -5
  51. package/src/Card.js +44 -19
  52. package/src/Dialog.js +7 -7
  53. package/src/Icon.js +11 -1
  54. package/src/Input.js +1 -1
  55. package/src/List.hbs +3 -0
  56. package/src/List.js +51 -7
  57. package/src/Popover.js +1 -1
  58. package/src/Popup.js +5 -5
  59. package/src/Table.hbs +1 -0
  60. package/src/features/InputSuggestions.js +7 -18
  61. package/src/i18n/messagebundle.properties +9 -0
  62. package/src/i18n/messagebundle_id.properties +218 -0
  63. package/.port +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,83 @@
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.23](https://github.com/SAP/ui5-webcomponents/compare/v0.31.22...v0.31.23) (2021-11-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui5-input:** escape HTML before highlighting suggestions (XSS) ([#4296](https://github.com/SAP/ui5-webcomponents/issues/4296)) ([8120f6c](https://github.com/SAP/ui5-webcomponents/commit/8120f6c)), closes [#4245](https://github.com/SAP/ui5-webcomponents/issues/4245)
12
+ * **ui5-link:** add underlining in the regular state in hcb / hcw ([#3960](https://github.com/SAP/ui5-webcomponents/issues/3960)) ([e44dc97](https://github.com/SAP/ui5-webcomponents/commit/e44dc97))
13
+
14
+
15
+
16
+
17
+
18
+ ## [0.31.22](https://github.com/SAP/ui5-webcomponents/compare/v0.31.21...v0.31.22) (2021-10-26)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **ui5-card:** accessibleName now takes effect ([0769850](https://github.com/SAP/ui5-webcomponents/commit/0769850))
24
+ * **ui5-card:** fix a11y "unique landmark" issue ([32e1477](https://github.com/SAP/ui5-webcomponents/commit/32e1477))
25
+
26
+
27
+ ### Features
28
+
29
+ * **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))
30
+ * **ui5-card:** introduce accessible-name-ref to replace aria-labelledby ([3f7138c](https://github.com/SAP/ui5-webcomponents/commit/3f7138c))
31
+
32
+
33
+ ### Reverts
34
+
35
+ * feat(framework): allow using a custom i18n library ([debc848](https://github.com/SAP/ui5-webcomponents/commit/debc848))
36
+
37
+
38
+
39
+
40
+
41
+ ## [0.31.21](https://github.com/SAP/ui5-webcomponents/compare/v0.31.20...v0.31.21) (2021-10-16)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **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))
47
+ * **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)
48
+ * **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)
49
+
50
+
51
+ ### Features
52
+
53
+ * **ui5-card:** add "accessibleName" ([c6f75c7](https://github.com/SAP/ui5-webcomponents/commit/c6f75c7))
54
+
55
+
56
+
57
+
58
+
59
+ ## [0.31.20](https://github.com/SAP/ui5-webcomponents/compare/v0.31.19...v0.31.20) (2021-10-03)
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * **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)
65
+ * **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)
66
+
67
+
68
+ ### Features
69
+
70
+ * **ui5-popover:** add accessibleName proeprty ([4f8c70c](https://github.com/SAP/ui5-webcomponents/commit/4f8c70c))
71
+ * add "id" message bundle ([34399c1](https://github.com/SAP/ui5-webcomponents/commit/34399c1))
72
+ * **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)
73
+
74
+
75
+ ### BREAKING CHANGES
76
+
77
+ * **ui5-popover:** ariaLabel has been replaced by accessibleName
78
+
79
+
80
+
81
+
82
+
6
83
  ## [0.31.19](https://github.com/SAP/ui5-webcomponents/compare/v0.31.18...v0.31.19) (2021-09-24)
7
84
 
8
85
 
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
  }
package/dist/List.js CHANGED
@@ -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
  },
@@ -218,7 +222,7 @@ const metadata = {
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
  },
@@ -496,6 +500,10 @@ class List extends UI5Element {
496
500
  return `${this._id}-header`;
497
501
  }
498
502
 
503
+ get modeLabelID() {
504
+ return `${this._id}-modeLabel`;
505
+ }
506
+
499
507
  get listEndDOM() {
500
508
  return this.shadowRoot.querySelector(".ui5-list-end-marker");
501
509
  }
@@ -508,6 +516,19 @@ class List extends UI5Element {
508
516
  return !this.hasData && this.noDataText;
509
517
  }
510
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
+
511
532
  get isMultiSelect() {
512
533
  return this.mode === ListMode.MultiSelect;
513
534
  }
@@ -516,14 +537,37 @@ class List extends UI5Element {
516
537
  if (this.accessibleNameRef || this.accessibleName) {
517
538
  return undefined;
518
539
  }
519
-
520
- return this.shouldRenderH1 ? this.headerID : undefined;
540
+ const ids = [];
541
+
542
+ if (this.isMultiSelect || this.isSingleSelect || this.isDelete) {
543
+ ids.push(this.modeLabelID);
544
+ }
545
+
546
+ if (this.shouldRenderH1) {
547
+ ids.push(this.headerID);
548
+ }
549
+
550
+ return ids.length ? ids.join(" ") : undefined;
521
551
  }
522
552
 
523
553
  get ariaLabelТxt() {
524
554
  return this.getEffectiveAriaLabelText(this);
525
555
  }
526
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;
569
+ }
570
+
527
571
  get grows() {
528
572
  return this.growing !== ListGrowingMode.None;
529
573
  }
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() {