@sapudex/web-components 0.226.0 → 0.226.2

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 (141) hide show
  1. package/dist/Breadcrumbs.js +3 -2
  2. package/dist/Breadcrumbs.js.map +1 -1
  3. package/dist/Button.d.ts +7 -0
  4. package/dist/Button.js +5 -0
  5. package/dist/Button.js.map +1 -1
  6. package/dist/ListItem.d.ts +3 -2
  7. package/dist/ListItem.js +2 -2
  8. package/dist/ListItem.js.map +1 -1
  9. package/dist/MastheadItem.js +1 -1
  10. package/dist/MastheadItem.js.map +1 -1
  11. package/dist/Pagination.d.ts +2 -2
  12. package/dist/Pagination.js +10 -8
  13. package/dist/Pagination.js.map +1 -1
  14. package/dist/PhoneNumberField.d.ts +1 -0
  15. package/dist/PhoneNumberField.js +15 -1
  16. package/dist/PhoneNumberField.js.map +1 -1
  17. package/dist/Search.js +1 -2
  18. package/dist/Search.js.map +1 -1
  19. package/dist/SecondaryNavigation.d.ts +4 -1
  20. package/dist/SecondaryNavigation.js +37 -10
  21. package/dist/SecondaryNavigation.js.map +1 -1
  22. package/dist/SecondaryNavigationItem.d.ts +10 -0
  23. package/dist/SecondaryNavigationItem.js +19 -0
  24. package/dist/SecondaryNavigationItem.js.map +1 -1
  25. package/dist/SecondaryNavigationItemBase.d.ts +1 -0
  26. package/dist/SecondaryNavigationItemBase.js +3 -0
  27. package/dist/SecondaryNavigationItemBase.js.map +1 -1
  28. package/dist/SecondaryNavigationSubItem.d.ts +0 -1
  29. package/dist/SecondaryNavigationSubItem.js +0 -3
  30. package/dist/SecondaryNavigationSubItem.js.map +1 -1
  31. package/dist/assets/{bundle-7a4a3e16.css → bundle-4420b745.css} +1 -1
  32. package/dist/assets/{bundle.esm-740278cc.js → bundle.esm-8390abc2.js} +189 -189
  33. package/dist/css/themes/Breadcrumbs.css +1 -1
  34. package/dist/css/themes/Button.css +1 -1
  35. package/dist/css/themes/Checkbox.css +1 -1
  36. package/dist/css/themes/ListItem.css +1 -1
  37. package/dist/css/themes/MastheadShell.css +1 -1
  38. package/dist/css/themes/Modal.css +1 -1
  39. package/dist/css/themes/Pagination.css +1 -1
  40. package/dist/css/themes/RadioButton.css +1 -1
  41. package/dist/css/themes/RatingIndicator.css +1 -1
  42. package/dist/css/themes/Search.css +1 -1
  43. package/dist/css/themes/Slider.css +1 -1
  44. package/dist/css/themes/Tooltip.css +1 -1
  45. package/dist/css/themes/WizardTab.css +1 -1
  46. package/dist/custom-elements-internal.json +100 -66
  47. package/dist/custom-elements.json +83 -64
  48. package/dist/generated/templates/BreadcrumbsTemplate.lit.js +1 -1
  49. package/dist/generated/templates/BreadcrumbsTemplate.lit.js.map +1 -1
  50. package/dist/generated/templates/ButtonTemplate.lit.d.ts +4 -0
  51. package/dist/generated/templates/ButtonTemplate.lit.js +7 -0
  52. package/dist/generated/templates/ButtonTemplate.lit.js.map +1 -0
  53. package/dist/generated/templates/FilterMenuTemplate.lit.js +1 -1
  54. package/dist/generated/templates/FilterMenuTemplate.lit.js.map +1 -1
  55. package/dist/generated/templates/PaginationTemplate.lit.js +3 -3
  56. package/dist/generated/templates/PaginationTemplate.lit.js.map +1 -1
  57. package/dist/generated/templates/SearchTemplate.lit.js +3 -3
  58. package/dist/generated/templates/SearchTemplate.lit.js.map +1 -1
  59. package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js +2 -2
  60. package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js.map +1 -1
  61. package/dist/generated/templates/SecondaryNavigationTemplate.lit.js +1 -1
  62. package/dist/generated/templates/SecondaryNavigationTemplate.lit.js.map +1 -1
  63. package/dist/generated/themes/Breadcrumbs.css.js +1 -1
  64. package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
  65. package/dist/generated/themes/Button.css.js +1 -1
  66. package/dist/generated/themes/Button.css.js.map +1 -1
  67. package/dist/generated/themes/Checkbox.css.js +1 -1
  68. package/dist/generated/themes/Checkbox.css.js.map +1 -1
  69. package/dist/generated/themes/ListItem.css.js +1 -1
  70. package/dist/generated/themes/ListItem.css.js.map +1 -1
  71. package/dist/generated/themes/MastheadShell.css.js +1 -1
  72. package/dist/generated/themes/MastheadShell.css.js.map +1 -1
  73. package/dist/generated/themes/Modal.css.js +1 -1
  74. package/dist/generated/themes/Modal.css.js.map +1 -1
  75. package/dist/generated/themes/Pagination.css.js +1 -1
  76. package/dist/generated/themes/Pagination.css.js.map +1 -1
  77. package/dist/generated/themes/RadioButton.css.js +1 -1
  78. package/dist/generated/themes/RadioButton.css.js.map +1 -1
  79. package/dist/generated/themes/RatingIndicator.css.js +1 -1
  80. package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
  81. package/dist/generated/themes/Search.css.js +1 -1
  82. package/dist/generated/themes/Search.css.js.map +1 -1
  83. package/dist/generated/themes/Slider.css.js +1 -1
  84. package/dist/generated/themes/Slider.css.js.map +1 -1
  85. package/dist/generated/themes/Tooltip.css.js +1 -1
  86. package/dist/generated/themes/Tooltip.css.js.map +1 -1
  87. package/dist/generated/themes/WizardTab.css.js +1 -1
  88. package/dist/generated/themes/WizardTab.css.js.map +1 -1
  89. package/dist/vscode.html-custom-data.json +5 -0
  90. package/dist/web-types.json +11 -1
  91. package/package.json +1 -1
  92. package/src/Breadcrumbs.hbs +10 -12
  93. package/src/Breadcrumbs.ts +3 -2
  94. package/src/Button.hbs +50 -0
  95. package/src/Button.ts +11 -0
  96. package/src/FilterMenu.hbs +1 -0
  97. package/src/ListItem.ts +4 -4
  98. package/src/MastheadItem.ts +1 -1
  99. package/src/Pagination.hbs +4 -4
  100. package/src/Pagination.ts +14 -8
  101. package/src/PhoneNumberField.ts +20 -1
  102. package/src/Search.hbs +3 -2
  103. package/src/Search.ts +1 -2
  104. package/src/SecondaryNavigation.hbs +1 -0
  105. package/src/SecondaryNavigation.ts +41 -12
  106. package/src/SecondaryNavigationItem.hbs +2 -1
  107. package/src/SecondaryNavigationItem.ts +31 -0
  108. package/src/SecondaryNavigationItemBase.ts +3 -0
  109. package/src/SecondaryNavigationSubItem.ts +0 -3
  110. package/src/generated/templates/BreadcrumbsTemplate.lit.ts +1 -1
  111. package/src/generated/templates/ButtonTemplate.lit.ts +12 -0
  112. package/src/generated/templates/FilterMenuTemplate.lit.ts +1 -1
  113. package/src/generated/templates/PaginationTemplate.lit.ts +3 -3
  114. package/src/generated/templates/SearchTemplate.lit.ts +3 -3
  115. package/src/generated/templates/SecondaryNavigationItemTemplate.lit.ts +2 -2
  116. package/src/generated/templates/SecondaryNavigationTemplate.lit.ts +1 -1
  117. package/src/generated/themes/Breadcrumbs.css.ts +1 -1
  118. package/src/generated/themes/Button.css.ts +1 -1
  119. package/src/generated/themes/Checkbox.css.ts +1 -1
  120. package/src/generated/themes/ListItem.css.ts +1 -1
  121. package/src/generated/themes/MastheadShell.css.ts +1 -1
  122. package/src/generated/themes/Modal.css.ts +1 -1
  123. package/src/generated/themes/Pagination.css.ts +1 -1
  124. package/src/generated/themes/RadioButton.css.ts +1 -1
  125. package/src/generated/themes/RatingIndicator.css.ts +1 -1
  126. package/src/generated/themes/Search.css.ts +1 -1
  127. package/src/generated/themes/Slider.css.ts +1 -1
  128. package/src/generated/themes/Tooltip.css.ts +1 -1
  129. package/src/generated/themes/WizardTab.css.ts +1 -1
  130. package/src/themes/Breadcrumbs.css +3 -0
  131. package/src/themes/Button.css +197 -66
  132. package/src/themes/Checkbox.css +2 -0
  133. package/src/themes/ListItem.css +5 -1
  134. package/src/themes/MastheadShell.css +2 -1
  135. package/src/themes/Modal.css +2 -1
  136. package/src/themes/Pagination.css +5 -0
  137. package/src/themes/RadioButton.css +5 -0
  138. package/src/themes/Search.css +9 -1
  139. package/src/themes/Tooltip.css +1 -1
  140. package/src/themes/WizardTab.css +5 -0
  141. package/cypress/screenshots/AccordionItem.cy.tsx/AccordionItem -- can be clicked via keyboard using Space (failed).png +0 -0
@@ -2,19 +2,17 @@
2
2
  class="udex-breadcrumbs ui5-breadcrumbs-root"
3
3
  aria-label="{{_accessibleNameText}}">
4
4
  <ol @focusin="{{_onfocusin}}">
5
- <li class="udex-breadcrumbs__arrow-wrapper ui5-breadcrumbs-dropdown-arrow-link-wrapper">
6
- <button
7
- @click="{{_toggleDropdown}}"
5
+ <li class="ui5-breadcrumbs-dropdown-arrow-link-wrapper">
6
+ <udex-link
7
+ @ui5-click="{{_toggleDropdown}}"
8
8
  class="udex-breadcrumbs__trigger {{_triggerClass}}"
9
- accessible-role="button"
10
- aria-label="{{_dropdownArrowAccessibleNameText}}"
11
- aria-haspopup="true">
12
- <ui5-icon
13
- name="slim-arrow-down"
14
- title="{{_dropdownArrowAccessibleNameText}}">
15
- </ui5-icon>
16
- </button>
17
- </li>
9
+ accessible-role="button"
10
+ aria-label="{{_dropdownArrowAccessibleNameText}}"
11
+ icon="slim-arrow-down"
12
+ icon-placement="Start"
13
+ aria-haspopup="true">
14
+ </udex-link>
15
+ </li>
18
16
  {{#each _linksData}}
19
17
  <li
20
18
  class="udex-breadcrumbs__link-wrapper ui5-breadcrumbs-link-wrapper"
@@ -162,6 +162,7 @@ class UDExBreadcrumbs extends UI5Element {
162
162
 
163
163
  onAfterRendering(): void {
164
164
  this._initItemNavigation();
165
+ this._dropdownArrowLink.forcedTabIndex = "0";
165
166
  }
166
167
 
167
168
  _preprocessItems(): void {
@@ -289,7 +290,7 @@ class UDExBreadcrumbs extends UI5Element {
289
290
  }
290
291
 
291
292
  _focusFirstVisibleItem(): void {
292
- Array.from(this.shadowRoot!.querySelectorAll<UDExLink>("[udex-link]"))[0].focus();
293
+ Array.from(this.shadowRoot!.querySelectorAll<UDExLink>(".udex-breadcrumbs__link-wrapper [udex-link]"))[0].focus();
293
294
  this._shouldFocusFirstVisibleItem = false;
294
295
  }
295
296
 
@@ -305,7 +306,7 @@ class UDExBreadcrumbs extends UI5Element {
305
306
  * Getter for the list of links corresponding to the abstract breadcrumb items
306
307
  */
307
308
  get _links(): Array<UDExLink> {
308
- return Array.from(this.shadowRoot!.querySelectorAll<UDExLink>(".udex-breadcrumbs__link-wrapper [ui5-link]"));
309
+ return Array.from(this.shadowRoot!.querySelectorAll<UDExLink>(".ui5-breadcrumbs-link-wrapper [udex-link]"));
309
310
  }
310
311
 
311
312
  /**
package/src/Button.hbs ADDED
@@ -0,0 +1,50 @@
1
+ <button
2
+ type="button"
3
+ class="ui5-button-root"
4
+ ?disabled="{{disabled}}"
5
+ aria-disabled="{{_ariaDisabled}}"
6
+ data-sap-focus-ref
7
+ {{> ariaPressed}}
8
+ @focusout={{_onfocusout}}
9
+ @focusin={{_onfocusin}}
10
+ @click={{_onclick}}
11
+ @mousedown={{_onmousedown}}
12
+ @mouseup={{_onmouseup}}
13
+ @keydown={{_onkeydown}}
14
+ @keyup={{_onkeyup}}
15
+ @touchstart="{{_ontouchstart}}"
16
+ @touchend="{{_ontouchend}}"
17
+ tabindex={{tabIndexValue}}
18
+ aria-expanded="{{accessibilityAttributes.expanded}}"
19
+ aria-controls="{{accessibilityAttributes.controls}}"
20
+ aria-haspopup="{{_hasPopup}}"
21
+ aria-label="{{ariaLabelText}}"
22
+ aria-describedby="{{ariaDescribedbyText}}"
23
+ title="{{buttonTitle}}"
24
+ part="button"
25
+ role="{{buttonAccessibleRole}}"
26
+ >
27
+ <div class="udex-button-content">
28
+ {{#if icon}}
29
+ <ui5-icon
30
+ class="ui5-button-icon"
31
+ name="{{icon}}"
32
+ accessible-role="{{iconRole}}"
33
+ part="icon"
34
+ ?show-tooltip={{showIconTooltip}}
35
+ ></ui5-icon>
36
+ {{/if}}
37
+
38
+ <span id="{{_id}}-content" class="ui5-button-text">
39
+ <bdi>
40
+ <slot></slot>
41
+ </bdi>
42
+ </span>
43
+
44
+ {{#if hasButtonType}}
45
+ <span id="ui5-button-hiddenText-type" aria-hidden="true" class="ui5-hidden-text">{{buttonTypeText}}</span>
46
+ {{/if}}
47
+ </div>
48
+ </button>
49
+
50
+ {{#*inline "ariaPressed"}}{{/inline}}
package/src/Button.ts CHANGED
@@ -7,6 +7,7 @@ import I18nBundle, { I18nText, getI18nBundle } from "@ui5/webcomponents-base/dis
7
7
  import {
8
8
  BUTTON_ARIA_ATTENTION, BUTTON_ARIA_DEFAULT, BUTTON_ARIA_EMPHASIZED, BUTTON_ARIA_TRANSPARENT, BUTTON_ARIA_TYPE_NEGATIVE, BUTTON_ARIA_TYPE_POSITIVE, BUTTON_ARIA_TYPE_PRIMARY, BUTTON_ARIA_TYPE_SECONDARY, BUTTON_ARIA_TYPE_TERTIARY, BUTTON_ARIA_TYPE_WARNING, TOGGLED,
9
9
  } from "./generated/i18n/i18n-defaults.js";
10
+ import ButtonTemplate from "./generated/templates/ButtonTemplate.lit.js";
10
11
 
11
12
  // Styles
12
13
  import ButtonCss from "./generated/themes/Button.css";
@@ -38,6 +39,7 @@ export enum UDExButtonDesign {
38
39
  tag: "udex-button",
39
40
  renderer: litRender,
40
41
  styles: [Button.styles, ButtonCss],
42
+ template: ButtonTemplate,
41
43
  })
42
44
  class UDExButton extends Button {
43
45
  /**
@@ -60,6 +62,15 @@ class UDExButton extends Button {
60
62
  @property({ type: Boolean })
61
63
  toggled!: boolean;
62
64
 
65
+ /**
66
+ * Defines if button has pseudo aria-disabled state
67
+ *
68
+ * @default false
69
+ * @public
70
+ */
71
+ @property({ type: Boolean })
72
+ _ariaDisabled!: boolean;
73
+
63
74
  /**
64
75
  * Defines the component design.
65
76
  * @default "Primary"
@@ -36,6 +36,7 @@
36
36
  <ui5-popover
37
37
  id="{{this._id}}_udex-filter-menu-dropdown"
38
38
  hide-arrow
39
+ accessible-role="{{accessibleRole}}"
39
40
  ?allow-target-overlap="{{disableAllowTargetOverlap}}"
40
41
  placement-type="{{placementType}}"
41
42
  horizontal-align="{{horizontalAlign}}"
package/src/ListItem.ts CHANGED
@@ -230,16 +230,16 @@ class UDExListItem extends UDExListItemBase {
230
230
  * @slot
231
231
  * @public
232
232
  */
233
- @slot()
234
- firstIcon!: Array<HTMLElement>;
233
+ @slot({ type: UDExButton })
234
+ firstIcon!: Array<UDExButton>;
235
235
  /**
236
236
  * Slot for second icon.
237
237
  *
238
238
  * @slot
239
239
  * @public
240
240
  */
241
- @slot()
242
- secondIcon!: Array<HTMLElement>;
241
+ @slot({ type: UDExButton })
242
+ secondIcon!: Array<UDExButton>;
243
243
 
244
244
  /**
245
245
  * Defines the role attribute of component
@@ -564,7 +564,7 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
564
564
  }
565
565
 
566
566
  get isMobile(): boolean {
567
- return BreakpointUtils.isBelow("M") || this.mastheadShell?._isMobileMode;
567
+ return BreakpointUtils.isAtMost("M") || this.mastheadShell?._isMobileMode;
568
568
  }
569
569
 
570
570
  get isTargetBlank(): boolean {
@@ -4,7 +4,7 @@
4
4
  {{#if absoluteNavigation}}
5
5
  <li class="udex-pagination__item--first udex-pagination__item">
6
6
  <udex-button
7
- ?disabled="{{prevButtonDisbled}}"
7
+ ?_aria-disabled="{{prevButtonDisabled}}"
8
8
  accessible-name="{{firstPageAccessibleName}}"
9
9
  size="Large"
10
10
  icon="close-command-field"
@@ -15,7 +15,7 @@
15
15
  {{/if}}
16
16
  <li class="udex-pagination__item--prev udex-pagination__item">
17
17
  <udex-button
18
- ?disabled="{{prevButtonDisbled}}"
18
+ ?_aria-disabled="{{prevButtonDisabled}}"
19
19
  accessible-name="{{previousPageAccessibleName}}"
20
20
  tooltip="{{previousBtnTooltip}}"
21
21
  size="Large"
@@ -47,7 +47,7 @@
47
47
  {{/if}}
48
48
  <li class="udex-pagination__item--next udex-pagination__item">
49
49
  <udex-button
50
- ?disabled="{{nextButtonDisbled}}"
50
+ ?_aria-disabled="{{nextButtonDisabled}}"
51
51
  tooltip="{{nextBtnTooltip}}"
52
52
  accessible-name="{{nextPageAccessibleName}}"
53
53
  size="Large"
@@ -59,7 +59,7 @@
59
59
  {{#if absoluteNavigation}}
60
60
  <li class="udex-pagination__item--last udex-pagination__item">
61
61
  <udex-button
62
- ?disabled="{{nextButtonDisbled}}"
62
+ ?_aria-disabled="{{nextButtonDisabled}}"
63
63
  accessible-name="{{lastPageAccessibleName}}"
64
64
  size="Large"
65
65
  icon="open-command-field"
package/src/Pagination.ts CHANGED
@@ -163,11 +163,11 @@ class UDExPagination extends UI5Element {
163
163
  this.setupPages(this.pages);
164
164
  }
165
165
 
166
- get nextButtonDisbled(): boolean {
166
+ get nextButtonDisabled(): boolean {
167
167
  return this.currentPageIndex + 1 === this.pages;
168
168
  }
169
169
 
170
- get prevButtonDisbled(): boolean {
170
+ get prevButtonDisabled(): boolean {
171
171
  return this.currentPageIndex === 0;
172
172
  }
173
173
 
@@ -234,21 +234,27 @@ class UDExPagination extends UI5Element {
234
234
  }
235
235
 
236
236
  get previousPageAccessibleName(): string {
237
- if (this.currentPageIndex === 0) { return UDExPagination.i18nBundle.getText(PREVIOUS_PAGE); }
238
- return `${UDExPagination.i18nBundle.getText(CURRENT_PAGE)} ${this.currentPageIndex + 1}. ${UDExPagination.i18nBundle.getText(PREVIOUS_PAGE)}. ${this.activatePageAccessibleText} ${this.currentPageIndex}`;
237
+ const currentPageText = `${UDExPagination.i18nBundle.getText(CURRENT_PAGE)} ${this.currentPageIndex + 1}.`;
238
+ if (this.currentPageIndex === 0) {
239
+ return `${currentPageText} ${UDExPagination.i18nBundle.getText(PREVIOUS_PAGE)}`;
240
+ }
241
+ return `${currentPageText}. ${UDExPagination.i18nBundle.getText(PREVIOUS_PAGE)}. ${this.activatePageAccessibleText} ${this.currentPageIndex}`;
239
242
  }
240
243
 
241
244
  get previousBtnTooltip(): string {
242
- return !this.prevButtonDisbled ? `${UDExPagination.i18nBundle.getText(PREVIOUS_PAGE)}` : "";
245
+ return !this.prevButtonDisabled ? `${UDExPagination.i18nBundle.getText(PREVIOUS_PAGE)}` : "";
243
246
  }
244
247
 
245
248
  get nextPageAccessibleName(): string {
246
- if (this.pages && this.currentPageIndex === (this.pages - 1)) { return UDExPagination.i18nBundle.getText(NEXT_PAGE); }
247
- return `${UDExPagination.i18nBundle.getText(CURRENT_PAGE)} ${this.currentPageIndex + 1}. ${UDExPagination.i18nBundle.getText(NEXT_PAGE)}. ${this.activatePageAccessibleText} ${this.currentPageIndex + 2}`;
249
+ const currentPageText = `${UDExPagination.i18nBundle.getText(CURRENT_PAGE)} ${this.currentPageIndex + 1}.`;
250
+ if (this.pages && this.currentPageIndex === (this.pages - 1)) {
251
+ return `${currentPageText} ${UDExPagination.i18nBundle.getText(NEXT_PAGE)}`;
252
+ }
253
+ return `${currentPageText} ${UDExPagination.i18nBundle.getText(NEXT_PAGE)}. ${this.activatePageAccessibleText} ${this.currentPageIndex + 2}`;
248
254
  }
249
255
 
250
256
  get nextBtnTooltip(): string {
251
- return !this.nextButtonDisbled ? `${UDExPagination.i18nBundle.getText(NEXT_PAGE)}` : "";
257
+ return !this.nextButtonDisabled ? `${UDExPagination.i18nBundle.getText(NEXT_PAGE)}` : "";
252
258
  }
253
259
 
254
260
  get pagination(): Page[] {
@@ -43,6 +43,10 @@ export enum FieldState {
43
43
  }
44
44
 
45
45
  const initialPlaceholder: string = "+X XXX-XXX-XXXX";
46
+ /**
47
+ * Maximum number of possible digits based on international standard https://en.wikipedia.org/wiki/E.164
48
+ */
49
+ const digitsLimit: number = 15;
46
50
 
47
51
  /**
48
52
  * @class
@@ -441,6 +445,15 @@ class UDExPhoneNumberField extends UI5Element {
441
445
  this._dropdownExpanded = false;
442
446
  }
443
447
 
448
+ calculateMaxLength(prefix: string, mask: string): number {
449
+ const prefixNonDigitCount = prefix.replace(/[\d]/g, "").length;
450
+ const maskNonDigitCount = mask.replace(/X/g, "").length;
451
+
452
+ const maxLength = digitsLimit + prefixNonDigitCount + maskNonDigitCount;
453
+
454
+ return maxLength;
455
+ }
456
+
444
457
  autoSelectCountry(value: string) {
445
458
  const countryToSelect = this.updatedCountriesList.find(country => {
446
459
  const valuePhonePrefix = value.substring(0, country.phonePrefix.length);
@@ -453,7 +466,7 @@ class UDExPhoneNumberField extends UI5Element {
453
466
  }
454
467
 
455
468
  if (this.selectedPhonePrefix && this.selectedPlaceholder) {
456
- this.maxlength = this.selectedPhonePrefix.length + this.selectedPlaceholder.length;
469
+ this.maxlength = this.calculateMaxLength(this.selectedPhonePrefix, this.selectedPlaceholder);
457
470
  }
458
471
  }
459
472
 
@@ -469,6 +482,8 @@ class UDExPhoneNumberField extends UI5Element {
469
482
  return;
470
483
  }
471
484
 
485
+ const maskLength = this.selectedPhonePrefix.length + this.selectedPlaceholder.length;
486
+
472
487
  const mask = this.selectedPhonePrefix + this.selectedPlaceholder;
473
488
  const maskSymbols = [" ", "-", "(", ")"];
474
489
 
@@ -485,6 +500,10 @@ class UDExPhoneNumberField extends UI5Element {
485
500
  return char;
486
501
  }).join("");
487
502
 
503
+ if (this.value.length >= maskLength) {
504
+ return;
505
+ }
506
+
488
507
  this.value = valueWithMask;
489
508
 
490
509
  if (this.value.length > this.maxlength) {
package/src/Search.hbs CHANGED
@@ -73,8 +73,8 @@
73
73
  @click="{{handleInputClick}}"
74
74
  />
75
75
  {{/if}}
76
- {{#if accInfo.ariaDescription}}
77
- <span role="status" id="search-description" class="hidden" aria-hidden="true">{{accInfo.ariaDescription}}</span>
76
+ {{#if open}}
77
+ <span aria-live="polite" aria-atomic="true" id="search-description" class="hidden" aria-hidden="true">{{suggestionsDescription}}</span>
78
78
  {{/if}}
79
79
  <div class="udex-search__icons">
80
80
  {{#if isShowHomeResetButton}}
@@ -121,6 +121,7 @@
121
121
  class="udex-search__icon"
122
122
  aria-hidden="true"
123
123
  accessible-name="{{accInfo.accessibleNameSearchIcon}}"
124
+ show-tooltip
124
125
  name="search">
125
126
  </ui5-icon>
126
127
  {{/if}}
package/src/Search.ts CHANGED
@@ -697,7 +697,6 @@ class UDExSearch extends UI5Element {
697
697
 
698
698
  getTextWithSuggestion(text: string): string {
699
699
  const escapedValue = this.escapeRegExp(this.value);
700
- console.warn(escapedValue);
701
700
  const search = new RegExp(escapedValue, "i");
702
701
  return text.replace(search, "<b>$&</b>");
703
702
  }
@@ -1278,7 +1277,7 @@ class UDExSearch extends UI5Element {
1278
1277
  }
1279
1278
 
1280
1279
  get suggestionsDescription(): string {
1281
- return this.hasPopoverContent ? `${this.suggestedList.length} ${this._suggestionLabel}, ${this.recommendedList.length} ${this._recommendLabel}` : `${this.noResultText}`;
1280
+ return !this.showNoResultMessage ? `${this.suggestedList.length} ${this._suggestionLabel}, ${this.recommendedList.length} ${this._recommendLabel}` : `${this.noResultMessage}`;
1282
1281
  }
1283
1282
 
1284
1283
  get tooltipInfo() {
@@ -66,6 +66,7 @@
66
66
  label="{{title}}"
67
67
  mobile-link-title="{{title}}"
68
68
  @ui5-sub-item-click="{{handleSubItemClick}}"
69
+ _is-mobile-menu-opener
69
70
  .subItems="{{this.parsedItems}}">
70
71
  {{#if hasMobileButtonsSlot}}
71
72
  {{>buttons}}
@@ -151,7 +151,8 @@ class UDExSecondaryNavigation extends UI5Element {
151
151
  _mobileBtnExpanded = false;
152
152
 
153
153
  _navItems!: Array<NavItem>;
154
- _showMoreButton: boolean;
154
+ _showMoreButton!: boolean;
155
+ _shouldFocusFirstItem: boolean = true;
155
156
  _rootHolder!: HTMLElement | null | undefined;
156
157
  _clickedNavItem!: UDExSecondaryNavigationItem;
157
158
  _boundReflowItems: () => void;
@@ -164,7 +165,6 @@ class UDExSecondaryNavigation extends UI5Element {
164
165
 
165
166
  constructor() {
166
167
  super();
167
- this._showMoreButton = true;
168
168
  this._boundReflowItems = this._handleResize.bind(this);
169
169
  }
170
170
 
@@ -180,13 +180,6 @@ class UDExSecondaryNavigation extends UI5Element {
180
180
  ResizeHandler.deregister(this, this._boundReflowItems);
181
181
  }
182
182
 
183
- _handleResize() {
184
- this.reflowItems();
185
- if (this._clickedNavItem && this.isDesktopScreen) {
186
- this._clickedNavItem.closeDropdown();
187
- }
188
- }
189
-
190
183
  onInvalidation(changeInfo: ChangeInfo): void {
191
184
  if (changeInfo.name === "navItems") {
192
185
  this.reflowItems();
@@ -195,6 +188,12 @@ class UDExSecondaryNavigation extends UI5Element {
195
188
 
196
189
  onAfterRendering(): void {
197
190
  this._rootHolder = this.rootHolder;
191
+ if (!this._overflowItems.length) {
192
+ this._showMoreButton = true;
193
+ }
194
+ if (this._shouldFocusFirstItem && this.isDesktopScreen) {
195
+ this.domNavItems[0]._tabIndex = "0";
196
+ }
198
197
  this.handleOutsideClick();
199
198
  }
200
199
 
@@ -202,6 +201,16 @@ class UDExSecondaryNavigation extends UI5Element {
202
201
  this._requestRender = !this._requestRender;
203
202
  }
204
203
 
204
+ _handleResize() {
205
+ this.reflowItems();
206
+ if (this.isDesktopScreen) {
207
+ this.resetTabIndex();
208
+ }
209
+ if (this._clickedNavItem && this.isDesktopScreen) {
210
+ this._clickedNavItem.closeDropdown();
211
+ }
212
+ }
213
+
205
214
  reflowItems(): void {
206
215
  const availableWidth = this.rootHolder.offsetWidth - (this.heading?.offsetWidth || 0) - (this.optionalButtons?.offsetWidth || 0);
207
216
  const moreButtonWidth = this.getMoreButtonWidth();
@@ -252,9 +261,12 @@ class UDExSecondaryNavigation extends UI5Element {
252
261
  const item = e.target as UDExSecondaryNavigationItem;
253
262
  const currentSelectedIndex = this.getCurrentIndex(item);
254
263
  const previousSelectIndex = currentSelectedIndex - 1;
264
+ const previousItem = this.domNavItems[previousSelectIndex];
255
265
  if (currentSelectedIndex > 0) {
256
266
  e.preventDefault();
257
- this.domNavItems[previousSelectIndex]?.focus();
267
+ this.domNavItems[currentSelectedIndex]._tabIndex = "-1";
268
+ previousItem._tabIndex = "0";
269
+ previousItem?.focus();
258
270
  }
259
271
  }
260
272
 
@@ -263,9 +275,12 @@ class UDExSecondaryNavigation extends UI5Element {
263
275
  const currentSelectedIndex = this.getCurrentIndex(item);
264
276
  const lastItemIndex = this.domNavItems.length - 1;
265
277
  const nextSelectIndex = currentSelectedIndex + 1;
278
+ const nextItem = this.domNavItems[nextSelectIndex];
266
279
  if (nextSelectIndex < lastItemIndex) {
267
280
  e.preventDefault();
268
- this.domNavItems[nextSelectIndex].focus();
281
+ this.domNavItems[currentSelectedIndex]._tabIndex = "-1";
282
+ nextItem._tabIndex = "0";
283
+ nextItem.focus();
269
284
  }
270
285
  }
271
286
 
@@ -314,6 +329,8 @@ class UDExSecondaryNavigation extends UI5Element {
314
329
  }
315
330
 
316
331
  this._clickedNavItem = clickedItem;
332
+ this._shouldFocusFirstItem = false;
333
+ this.setTabIndexById(_id);
317
334
  this.closePrevDropdown(_id);
318
335
 
319
336
  if (!subItems.length) {
@@ -410,7 +427,7 @@ class UDExSecondaryNavigation extends UI5Element {
410
427
 
411
428
  closePrevDropdown(clickedItemId: string): void {
412
429
  this.domNavItems.forEach(item => {
413
- if (clickedItemId !== item._id) {
430
+ if (item.isOpen && item._id !== clickedItemId) {
414
431
  item.closeDropdown();
415
432
  }
416
433
  });
@@ -420,6 +437,18 @@ class UDExSecondaryNavigation extends UI5Element {
420
437
  return string ? JSON.parse(string) as T[] : [];
421
438
  }
422
439
 
440
+ resetTabIndex(): void {
441
+ this.domNavItems.forEach((item, index) => {
442
+ item._tabIndex = index === 0 ? "0" : "-1";
443
+ });
444
+ }
445
+
446
+ setTabIndexById(id: string): void {
447
+ this.domNavItems.forEach(item => {
448
+ item._tabIndex = id === item._id ? "0" : "-1";
449
+ });
450
+ }
451
+
423
452
  get domNavItems(): Array<UDExSecondaryNavigationItem> {
424
453
  const items = this.shadowRoot?.querySelectorAll<UDExSecondaryNavigationItem>("[udex-secondary-navigation-item]");
425
454
  return items ? Array.from(items) : [];
@@ -5,6 +5,7 @@
5
5
  ?active="{{isActive}}"
6
6
  href="{{path}}"
7
7
  target="{{target}}"
8
+ tabindex="{{_tabIndex}}"
8
9
  aria-current="{{ariaCurrent}}"
9
10
  @keydown="{{handleItemLinkKeyDown}}"
10
11
  @click="{{fireNavItemClickEvent}}">
@@ -14,8 +15,8 @@
14
15
  <button
15
16
  class="udex-secondary-navigation__item"
16
17
  role="{{itemRole}}"
17
- tabindex="0"
18
18
  ?active="{{isActive}}"
19
+ tabindex="{{menuOpenerTabIndex}}"
19
20
  aria-haspopup="{{hasNestedItems}}"
20
21
  aria-expanded="{{isOpen}}"
21
22
  aria-label="{{ariaLabel}}"
@@ -150,9 +150,20 @@ class UDExSecondaryNavigationItem extends UDExSecondaryNavigationItemBase {
150
150
  @property({ type: Object })
151
151
  _processedItems: Array<NavItem> = [];
152
152
 
153
+ /**
154
+ * Defines if item is mobile menu opener.
155
+ *
156
+ * @private
157
+ * @default false
158
+ */
159
+ @property({ type: Boolean })
160
+ _isMobileMenuOpener!: boolean;
161
+
153
162
  _dropdownHistory: Array<Array<NavItem>> = [];
154
163
  _shouldFocusFirstSubItem!: boolean;
155
164
  _subTitle!: string | undefined;
165
+ _shouldResetTabIndex!: boolean;
166
+ _shouldSetTabIndex!: boolean;
156
167
 
157
168
  onAfterRendering(): void {
158
169
  if (this.isLastItem && this.isOpen && !this._isMobileView) {
@@ -167,6 +178,16 @@ class UDExSecondaryNavigationItem extends UDExSecondaryNavigationItemBase {
167
178
  if (this._isMobileView && this.isOpen) {
168
179
  this.setDropdownHeight();
169
180
  }
181
+
182
+ if (this._shouldSetTabIndex) {
183
+ this._tabIndex = "0";
184
+ this._shouldSetTabIndex = false;
185
+ }
186
+
187
+ if (this._shouldResetTabIndex) {
188
+ this._tabIndex = "-1";
189
+ this._shouldResetTabIndex = false;
190
+ }
170
191
  }
171
192
 
172
193
  onBeforeRendering() : void {
@@ -195,6 +216,7 @@ class UDExSecondaryNavigationItem extends UDExSecondaryNavigationItemBase {
195
216
  if (this.hasNestedItems) {
196
217
  this.setDropdownItems();
197
218
  this.isOpen = !this.isOpen;
219
+ this._shouldResetTabIndex = true;
198
220
  this.onShouldFocusFirstSubItem();
199
221
  }
200
222
 
@@ -203,6 +225,7 @@ class UDExSecondaryNavigationItem extends UDExSecondaryNavigationItemBase {
203
225
 
204
226
  closeDropdown(): void {
205
227
  this.isOpen = false;
228
+ this._shouldSetTabIndex = true;
206
229
  }
207
230
 
208
231
  handleItemLinkKeyDown(e: KeyboardEvent): void {
@@ -418,6 +441,14 @@ class UDExSecondaryNavigationItem extends UDExSecondaryNavigationItemBase {
418
441
  return this.shadowRoot!.querySelector<HTMLElement>(".udex-secondary-navigation__dropdown")!;
419
442
  }
420
443
 
444
+ get menuOpenerTabIndex(): string {
445
+ if (this._isMobileMenuOpener) {
446
+ return "0";
447
+ }
448
+
449
+ return this._tabIndex;
450
+ }
451
+
421
452
  get isLastItem(): boolean {
422
453
  return this._navItemsLength === this.index;
423
454
  }
@@ -94,6 +94,9 @@ class UDExSecondaryNavigationItemBase extends UI5Element {
94
94
  @property({ type: Boolean })
95
95
  _isMobileView!: boolean;
96
96
 
97
+ @property({ type: String, defaultValue: "-1" })
98
+ _tabIndex!: string;
99
+
97
100
  _handleResizeBound: ResizeObserverCallback;
98
101
 
99
102
  constructor() {
@@ -79,9 +79,6 @@ class UDExSecondaryNavigationSubItem extends UDExSecondaryNavigationItemBase {
79
79
  @property({ type: Object, multiple: true })
80
80
  nestedItems!: Array<NavItem>;
81
81
 
82
- @property({ type: String, defaultValue: "-1" })
83
- _tabIndex!: string;
84
-
85
82
  static i18nBundle: any;
86
83
 
87
84
  static async onDefine(): Promise<void> {
@@ -4,7 +4,7 @@ import type UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
4
4
  import type Breadcrumbs from "../../Breadcrumbs.js";
5
5
  import type { ClassMapValue } from "@ui5/webcomponents-base/dist/types.js";
6
6
 
7
- function block0 (this: Breadcrumbs, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<nav class="udex-breadcrumbs ui5-breadcrumbs-root" aria-label="${ifDefined(this._accessibleNameText)}"><ol @focusin="${this._onfocusin}"><li class="udex-breadcrumbs__arrow-wrapper ui5-breadcrumbs-dropdown-arrow-link-wrapper"><button @click="${this._toggleDropdown}" class="udex-breadcrumbs__trigger ${ifDefined(this._triggerClass)}" accessible-role="button" aria-label="${ifDefined(this._dropdownArrowAccessibleNameText)}" aria-haspopup="true"><${scopeTag("ui5-icon", tags, suffix)} name="slim-arrow-down" title="${ifDefined(this._dropdownArrowAccessibleNameText)}"></${scopeTag("ui5-icon", tags, suffix)}></button></li>${ repeat(this._linksData, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block1.call(this, context, tags, suffix, item, index)) }</ol></nav>` : html`<nav class="udex-breadcrumbs ui5-breadcrumbs-root" aria-label="${ifDefined(this._accessibleNameText)}"><ol @focusin="${this._onfocusin}"><li class="udex-breadcrumbs__arrow-wrapper ui5-breadcrumbs-dropdown-arrow-link-wrapper"><button @click="${this._toggleDropdown}" class="udex-breadcrumbs__trigger ${ifDefined(this._triggerClass)}" accessible-role="button" aria-label="${ifDefined(this._dropdownArrowAccessibleNameText)}" aria-haspopup="true"><ui5-icon name="slim-arrow-down" title="${ifDefined(this._dropdownArrowAccessibleNameText)}"></ui5-icon></button></li>${ repeat(this._linksData, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block1.call(this, context, tags, suffix, item, index)) }</ol></nav>`;}
7
+ function block0 (this: Breadcrumbs, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<nav class="udex-breadcrumbs ui5-breadcrumbs-root" aria-label="${ifDefined(this._accessibleNameText)}"><ol @focusin="${this._onfocusin}"><li class="ui5-breadcrumbs-dropdown-arrow-link-wrapper"><${scopeTag("udex-link", tags, suffix)} @ui5-click="${ifDefined(this._toggleDropdown)}" class="udex-breadcrumbs__trigger ${ifDefined(this._triggerClass)}" accessible-role="button" aria-label="${ifDefined(this._dropdownArrowAccessibleNameText)}" icon="slim-arrow-down" icon-placement="Start" aria-haspopup="true"></${scopeTag("udex-link", tags, suffix)}></li>${ repeat(this._linksData, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block1.call(this, context, tags, suffix, item, index)) }</ol></nav>` : html`<nav class="udex-breadcrumbs ui5-breadcrumbs-root" aria-label="${ifDefined(this._accessibleNameText)}"><ol @focusin="${this._onfocusin}"><li class="ui5-breadcrumbs-dropdown-arrow-link-wrapper"><udex-link @ui5-click="${ifDefined(this._toggleDropdown)}" class="udex-breadcrumbs__trigger ${ifDefined(this._triggerClass)}" accessible-role="button" aria-label="${ifDefined(this._dropdownArrowAccessibleNameText)}" icon="slim-arrow-down" icon-placement="Start" aria-haspopup="true"></udex-link></li>${ repeat(this._linksData, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block1.call(this, context, tags, suffix, item, index)) }</ol></nav>`;}
8
8
  function block1 (this: Breadcrumbs, context: UI5Element, tags: string[], suffix: string | undefined, item: any, index: number) { return html`<li class="udex-breadcrumbs__link-wrapper ui5-breadcrumbs-link-wrapper" id="${ifDefined(item._id)}-link-wrapper">${ !item._isCurrentPageItem ? block2.call(this, context, tags, suffix, item, index) : undefined }</li>`;}
9
9
  function block2 (this: Breadcrumbs, context: UI5Element, tags: string[], suffix: string | undefined, item: any, index: number) { return suffix ? html`<span class="udex-breadcrumbs__separator" aria-hidden="true"></span><${scopeTag("udex-link", tags, suffix)} @ui5-click="${ifDefined(this._onLinkPress)}" class="udex-breadcrumbs__item" href="${ifDefined(item.href)}" target="${ifDefined(item.target)}" id="${ifDefined(item._id)}-link" accessible-name="${ifDefined(item._accessibleNameText)}" data-ui5-stable="${ifDefined(item.stableDomRef)}">${ifDefined(item.innerText)}</${scopeTag("udex-link", tags, suffix)}>` : html`<span class="udex-breadcrumbs__separator" aria-hidden="true"></span><udex-link @ui5-click="${ifDefined(this._onLinkPress)}" class="udex-breadcrumbs__item" href="${ifDefined(item.href)}" target="${ifDefined(item.target)}" id="${ifDefined(item._id)}-link" accessible-name="${ifDefined(item._accessibleNameText)}" data-ui5-stable="${ifDefined(item.stableDomRef)}">${ifDefined(item.innerText)}</udex-link>`;}
10
10
 
@@ -0,0 +1,12 @@
1
+ /* eslint no-unused-vars: 0 */
2
+ import { html, svg, repeat, classMap, styleMap, ifDefined, unsafeHTML, scopeTag } from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
+ import type UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
4
+ import type Button from "../../Button.js";
5
+ import type { ClassMapValue } from "@ui5/webcomponents-base/dist/types.js";
6
+
7
+ function block0 (this: Button, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<button type="button" class="ui5-button-root" ?disabled="${this.disabled}" aria-disabled="${ifDefined(this._ariaDisabled)}" data-sap-focus-ref @focusout=${this._onfocusout} @focusin=${this._onfocusin} @click=${this._onclick} @mousedown=${this._onmousedown} @mouseup=${this._onmouseup} @keydown=${this._onkeydown} @keyup=${this._onkeyup} @touchstart="${this._ontouchstart}" @touchend="${this._ontouchend}" tabindex=${ifDefined(this.tabIndexValue)} aria-expanded="${ifDefined(this.accessibilityAttributes.expanded)}" aria-controls="${ifDefined(this.accessibilityAttributes.controls)}" aria-haspopup="${ifDefined(this._hasPopup)}" aria-label="${ifDefined(this.ariaLabelText)}" aria-describedby="${ifDefined(this.ariaDescribedbyText)}" title="${ifDefined(this.buttonTitle)}" part="button" role="${ifDefined(this.buttonAccessibleRole)}"><div class="udex-button-content">${ this.icon ? block1.call(this, context, tags, suffix) : undefined }<span id="${ifDefined(this._id)}-content" class="ui5-button-text"><bdi><slot></slot></bdi></span>${ this.hasButtonType ? block2.call(this, context, tags, suffix) : undefined }</div></button>`;}
8
+ function block1 (this: Button, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag("ui5-icon", tags, suffix)} class="ui5-button-icon" name="${ifDefined(this.icon)}" accessible-role="${ifDefined(this.iconRole)}" part="icon" ?show-tooltip=${this.showIconTooltip}></${scopeTag("ui5-icon", tags, suffix)}>` : html`<ui5-icon class="ui5-button-icon" name="${ifDefined(this.icon)}" accessible-role="${ifDefined(this.iconRole)}" part="icon" ?show-tooltip=${this.showIconTooltip}></ui5-icon>`;}
9
+ function block2 (this: Button, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<span id="ui5-button-hiddenText-type" aria-hidden="true" class="ui5-hidden-text">${ifDefined(this.buttonTypeText)}</span>`;}
10
+
11
+
12
+ export default block0;