@openui5/sap.ui.webc.common 1.111.0 → 1.112.0

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 (154) hide show
  1. package/package.json +2 -2
  2. package/src/sap/ui/webc/common/.library +2 -2
  3. package/src/sap/ui/webc/common/Configuration.js +6 -0
  4. package/src/sap/ui/webc/common/Icons.js +6 -0
  5. package/src/sap/ui/webc/common/WebComponent.js +1 -1
  6. package/src/sap/ui/webc/common/WebComponentMetadata.js +1 -1
  7. package/src/sap/ui/webc/common/library.js +3 -3
  8. package/src/sap/ui/webc/common/thirdparty/base/Boot.js +2 -11
  9. package/src/sap/ui/webc/common/thirdparty/base/CSP.js +3 -14
  10. package/src/sap/ui/webc/common/thirdparty/base/CustomElementsRegistry.js +0 -21
  11. package/src/sap/ui/webc/common/thirdparty/base/CustomElementsScopeUtils.js +5 -22
  12. package/src/sap/ui/webc/common/thirdparty/base/DOMObserver.js +5 -18
  13. package/src/sap/ui/webc/common/thirdparty/base/Device.js +2 -35
  14. package/src/sap/ui/webc/common/thirdparty/base/EventProvider.js +2 -21
  15. package/src/sap/ui/webc/common/thirdparty/base/FeaturesRegistry.js +0 -4
  16. package/src/sap/ui/webc/common/thirdparty/base/FontFace.js +4 -8
  17. package/src/sap/ui/webc/common/thirdparty/base/InitialConfiguration.js +13 -42
  18. package/src/sap/ui/webc/common/thirdparty/base/Keys.js +3 -138
  19. package/src/sap/ui/webc/common/thirdparty/base/ManagedStyles.js +0 -19
  20. package/src/sap/ui/webc/common/thirdparty/base/MediaRange.js +4 -8
  21. package/src/sap/ui/webc/common/thirdparty/base/PropertiesFileFormat.js +2 -16
  22. package/src/sap/ui/webc/common/thirdparty/base/Render.js +14 -35
  23. package/src/sap/ui/webc/common/thirdparty/base/RenderQueue.js +1 -16
  24. package/src/sap/ui/webc/common/thirdparty/base/RenderScheduler.js +2 -10
  25. package/src/sap/ui/webc/common/thirdparty/base/Runtimes.js +18 -34
  26. package/src/sap/ui/webc/common/thirdparty/base/StaticAreaItem.js +4 -25
  27. package/src/sap/ui/webc/common/thirdparty/base/SystemCSSVars.js +0 -3
  28. package/src/sap/ui/webc/common/thirdparty/base/UI5Element.js +104 -246
  29. package/src/sap/ui/webc/common/thirdparty/base/UI5ElementMetadata.js +39 -84
  30. package/src/sap/ui/webc/common/thirdparty/base/animations/AnimationQueue.js +0 -11
  31. package/src/sap/ui/webc/common/thirdparty/base/animations/animate.js +0 -8
  32. package/src/sap/ui/webc/common/thirdparty/base/animations/scroll.js +0 -4
  33. package/src/sap/ui/webc/common/thirdparty/base/animations/slideDown.js +9 -10
  34. package/src/sap/ui/webc/common/thirdparty/base/animations/slideUp.js +4 -7
  35. package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Icons.js +9 -34
  36. package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Illustrations.js +0 -8
  37. package/src/sap/ui/webc/common/thirdparty/base/asset-registries/LocaleData.js +36 -57
  38. package/src/sap/ui/webc/common/thirdparty/base/asset-registries/Themes.js +4 -27
  39. package/src/sap/ui/webc/common/thirdparty/base/asset-registries/i18n.js +12 -37
  40. package/src/sap/ui/webc/common/thirdparty/base/assets-meta/IconCollectionsAlias.js +0 -1
  41. package/src/sap/ui/webc/common/thirdparty/base/config/AnimationMode.js +0 -7
  42. package/src/sap/ui/webc/common/thirdparty/base/config/CalendarType.js +2 -7
  43. package/src/sap/ui/webc/common/thirdparty/base/config/FormatSettings.js +2 -4
  44. package/src/sap/ui/webc/common/thirdparty/base/config/Icons.js +3 -11
  45. package/src/sap/ui/webc/common/thirdparty/base/config/Language.js +4 -14
  46. package/src/sap/ui/webc/common/thirdparty/base/config/NoConflict.js +4 -14
  47. package/src/sap/ui/webc/common/thirdparty/base/config/RTL.js +2 -8
  48. package/src/sap/ui/webc/common/thirdparty/base/config/Theme.js +4 -15
  49. package/src/sap/ui/webc/common/thirdparty/base/delegate/ItemNavigation.js +8 -72
  50. package/src/sap/ui/webc/common/thirdparty/base/delegate/ResizeHandler.js +8 -23
  51. package/src/sap/ui/webc/common/thirdparty/base/delegate/ScrollEnablement.js +9 -34
  52. package/src/sap/ui/webc/common/thirdparty/base/features/F6Navigation.js +1 -20
  53. package/src/sap/ui/webc/common/thirdparty/base/features/OpenUI5Enablement.js +0 -17
  54. package/src/sap/ui/webc/common/thirdparty/base/features/OpenUI5Support.js +0 -32
  55. package/src/sap/ui/webc/common/thirdparty/base/generated/VersionInfo.js +1 -1
  56. package/src/sap/ui/webc/common/thirdparty/base/getSharedResource.js +1 -9
  57. package/src/sap/ui/webc/common/thirdparty/base/i18nBundle.js +4 -18
  58. package/src/sap/ui/webc/common/thirdparty/base/locale/Locale.js +0 -25
  59. package/src/sap/ui/webc/common/thirdparty/base/locale/RTLAwareRegistry.js +0 -4
  60. package/src/sap/ui/webc/common/thirdparty/base/locale/applyDirection.js +0 -2
  61. package/src/sap/ui/webc/common/thirdparty/base/locale/directionChange.js +2 -9
  62. package/src/sap/ui/webc/common/thirdparty/base/locale/getEffectiveDir.js +4 -9
  63. package/src/sap/ui/webc/common/thirdparty/base/locale/getLocale.js +3 -11
  64. package/src/sap/ui/webc/common/thirdparty/base/locale/languageChange.js +0 -8
  65. package/src/sap/ui/webc/common/thirdparty/base/locale/nextFallbackLocale.js +4 -8
  66. package/src/sap/ui/webc/common/thirdparty/base/locale/normalizeLocale.js +8 -14
  67. package/src/sap/ui/webc/common/thirdparty/base/renderer/LitRenderer.js +0 -11
  68. package/src/sap/ui/webc/common/thirdparty/base/renderer/directives/style-map.js +7 -21
  69. package/src/sap/ui/webc/common/thirdparty/base/renderer/executeTemplate.js +1 -6
  70. package/src/sap/ui/webc/common/thirdparty/base/theming/CustomStyle.js +2 -16
  71. package/src/sap/ui/webc/common/thirdparty/base/theming/ThemeLoaded.js +0 -8
  72. package/src/sap/ui/webc/common/thirdparty/base/theming/applyTheme.js +6 -21
  73. package/src/sap/ui/webc/common/thirdparty/base/theming/getConstructableStyle.js +1 -6
  74. package/src/sap/ui/webc/common/thirdparty/base/theming/getEffectiveLinksHrefs.js +0 -7
  75. package/src/sap/ui/webc/common/thirdparty/base/theming/getEffectiveStyle.js +0 -8
  76. package/src/sap/ui/webc/common/thirdparty/base/theming/getStylesString.js +0 -4
  77. package/src/sap/ui/webc/common/thirdparty/base/theming/getThemeDesignerTheme.js +4 -22
  78. package/src/sap/ui/webc/common/thirdparty/base/theming/preloadLinks.js +0 -5
  79. package/src/sap/ui/webc/common/thirdparty/base/thirdparty/_merge.js +10 -20
  80. package/src/sap/ui/webc/common/thirdparty/base/thirdparty/isPlainObject.js +0 -6
  81. package/src/sap/ui/webc/common/thirdparty/base/thirdparty/merge.js +0 -3
  82. package/src/sap/ui/webc/common/thirdparty/base/types/CSSColor.js +0 -4
  83. package/src/sap/ui/webc/common/thirdparty/base/types/CSSSize.js +0 -4
  84. package/src/sap/ui/webc/common/thirdparty/base/types/CalendarType.js +0 -5
  85. package/src/sap/ui/webc/common/thirdparty/base/types/DataType.js +0 -8
  86. package/src/sap/ui/webc/common/thirdparty/base/types/Float.js +0 -5
  87. package/src/sap/ui/webc/common/thirdparty/base/types/Integer.js +0 -5
  88. package/src/sap/ui/webc/common/thirdparty/base/types/InvisibleMessageMode.js +0 -6
  89. package/src/sap/ui/webc/common/thirdparty/base/types/ItemNavigationBehavior.js +0 -2
  90. package/src/sap/ui/webc/common/thirdparty/base/types/PopupState.js +0 -8
  91. package/src/sap/ui/webc/common/thirdparty/base/types/ValueState.js +0 -5
  92. package/src/sap/ui/webc/common/thirdparty/base/updateShadowRoot.js +0 -5
  93. package/src/sap/ui/webc/common/thirdparty/base/util/AriaLabelHelper.js +1 -9
  94. package/src/sap/ui/webc/common/thirdparty/base/util/Caret.js +0 -6
  95. package/src/sap/ui/webc/common/thirdparty/base/util/ColorConversion.js +29 -46
  96. package/src/sap/ui/webc/common/thirdparty/base/util/FetchHelper.js +0 -10
  97. package/src/sap/ui/webc/common/thirdparty/base/util/FocusableElements.js +2 -19
  98. package/src/sap/ui/webc/common/thirdparty/base/util/InvisibleMessage.js +3 -9
  99. package/src/sap/ui/webc/common/thirdparty/base/util/PopupUtils.js +0 -28
  100. package/src/sap/ui/webc/common/thirdparty/base/util/SlotsHelper.js +4 -15
  101. package/src/sap/ui/webc/common/thirdparty/base/util/StringHelper.js +0 -7
  102. package/src/sap/ui/webc/common/thirdparty/base/util/TabbableElements.js +0 -12
  103. package/src/sap/ui/webc/common/thirdparty/base/util/arraysAreEqual.js +0 -4
  104. package/src/sap/ui/webc/common/thirdparty/base/util/clamp.js +0 -2
  105. package/src/sap/ui/webc/common/thirdparty/base/util/createLinkInHead.js +0 -2
  106. package/src/sap/ui/webc/common/thirdparty/base/util/createStyleInHead.js +0 -2
  107. package/src/sap/ui/webc/common/thirdparty/base/util/debounce.js +1 -3
  108. package/src/sap/ui/webc/common/thirdparty/base/util/detectNavigatorLanguage.js +0 -4
  109. package/src/sap/ui/webc/common/thirdparty/base/util/escapeRegex.js +0 -2
  110. package/src/sap/ui/webc/common/thirdparty/base/util/findNodeOwner.js +0 -6
  111. package/src/sap/ui/webc/common/thirdparty/base/util/formatMessage.js +2 -7
  112. package/src/sap/ui/webc/common/thirdparty/base/util/generateHighlightedMarkup.js +9 -17
  113. package/src/sap/ui/webc/common/thirdparty/base/util/getActiveElement.js +0 -4
  114. package/src/sap/ui/webc/common/thirdparty/base/util/getClassCopy.js +0 -3
  115. package/src/sap/ui/webc/common/thirdparty/base/util/getDesigntimePropertyAsArray.js +0 -2
  116. package/src/sap/ui/webc/common/thirdparty/base/util/getEffectiveContentDensity.js +0 -2
  117. package/src/sap/ui/webc/common/thirdparty/base/util/getFileExtension.js +0 -4
  118. package/src/sap/ui/webc/common/thirdparty/base/util/getNormalizedTarget.js +0 -4
  119. package/src/sap/ui/webc/common/thirdparty/base/util/getSingletonElementInstance.js +0 -4
  120. package/src/sap/ui/webc/common/thirdparty/base/util/isDefaultSlotProvided.js +0 -2
  121. package/src/sap/ui/webc/common/thirdparty/base/util/isDescendantOf.js +0 -6
  122. package/src/sap/ui/webc/common/thirdparty/base/util/isElementInView.js +0 -2
  123. package/src/sap/ui/webc/common/thirdparty/base/util/isNodeClickable.js +0 -5
  124. package/src/sap/ui/webc/common/thirdparty/base/util/isNodeHidden.js +0 -3
  125. package/src/sap/ui/webc/common/thirdparty/base/util/isNodeTabbable.js +0 -9
  126. package/src/sap/ui/webc/common/thirdparty/base/util/isValidPropertyName.js +1 -3
  127. package/src/sap/ui/webc/common/thirdparty/base/util/setToArray.js +0 -2
  128. package/src/sap/ui/webc/common/thirdparty/base/util/whenDOMReady.js +0 -2
  129. package/src/sap/ui/webc/common/thirdparty/icons/generated/json-imports/i18n.js +0 -52
  130. package/src/sap/ui/webc/common/thirdparty/icons/json-imports/Icons.js +0 -5
  131. package/src/sap/ui/webc/common/thirdparty/icons-business-suite/json-imports/Icons.js +0 -3
  132. package/src/sap/ui/webc/common/thirdparty/icons-tnt/json-imports/Icons.js +0 -3
  133. package/src/sap/ui/webc/common/thirdparty/lit-html/directive-helpers.js +62 -70
  134. package/src/sap/ui/webc/common/thirdparty/lit-html/directive.js +11 -20
  135. package/src/sap/ui/webc/common/thirdparty/lit-html/directives/class-map.js +0 -10
  136. package/src/sap/ui/webc/common/thirdparty/lit-html/directives/if-defined.js +0 -2
  137. package/src/sap/ui/webc/common/thirdparty/lit-html/directives/repeat.js +55 -71
  138. package/src/sap/ui/webc/common/thirdparty/lit-html/directives/unsafe-html.js +0 -4
  139. package/src/sap/ui/webc/common/thirdparty/lit-html/lit-html.js +96 -171
  140. package/src/sap/ui/webc/common/thirdparty/lit-html/static.js +34 -40
  141. package/src/sap/ui/webc/common/thirdparty/localization/DateFormat.js +0 -2
  142. package/src/sap/ui/webc/common/thirdparty/localization/LocaleData.js +0 -2
  143. package/src/sap/ui/webc/common/thirdparty/localization/dates/CalendarDate.js +13 -56
  144. package/src/sap/ui/webc/common/thirdparty/localization/dates/ExtremeDates.js +0 -11
  145. package/src/sap/ui/webc/common/thirdparty/localization/dates/calculateWeekNumber.js +5 -8
  146. package/src/sap/ui/webc/common/thirdparty/localization/dates/getRoundedTimestamp.js +0 -3
  147. package/src/sap/ui/webc/common/thirdparty/localization/dates/getTodayUTCTimestamp.js +0 -3
  148. package/src/sap/ui/webc/common/thirdparty/localization/dates/modifyDateBy.js +0 -9
  149. package/src/sap/ui/webc/common/thirdparty/localization/getCachedLocaleDataInstance.js +0 -5
  150. package/src/sap/ui/webc/common/thirdparty/localization/locale/getLocaleData.js +1 -6
  151. package/src/sap/ui/webc/common/thirdparty/theming/generated/json-imports/Themes.js +0 -16
  152. package/ui5.yaml +7 -7
  153. package/src/sap/ui/webc/common/thirdparty/icons-business-suite/main-milestone.js +0 -25
  154. package/src/sap/ui/webc/common/thirdparty/icons-business-suite/main-sequence.js +0 -25
@@ -6,21 +6,16 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
6
6
  });
7
7
  _exports.default = void 0;
8
8
  _DataType = _interopRequireDefault(_DataType);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  class Float extends _DataType.default {
13
11
  static isValid(value) {
14
12
  // Assuming that integers are floats as well!
15
13
  return Number(value) === value;
16
14
  }
17
-
18
15
  static attributeToProperty(attributeValue) {
19
16
  return parseFloat(attributeValue);
20
17
  }
21
-
22
18
  }
23
-
24
19
  var _default = Float;
25
20
  _exports.default = _default;
26
21
  });
@@ -6,20 +6,15 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
6
6
  });
7
7
  _exports.default = void 0;
8
8
  _DataType = _interopRequireDefault(_DataType);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  class Integer extends _DataType.default {
13
11
  static isValid(value) {
14
12
  return Number.isInteger(value);
15
13
  }
16
-
17
14
  static attributeToProperty(attributeValue) {
18
15
  return parseInt(attributeValue);
19
16
  }
20
-
21
17
  }
22
-
23
18
  var _default = Integer;
24
19
  _exports.default = _default;
25
20
  });
@@ -6,9 +6,7 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
6
6
  });
7
7
  _exports.default = void 0;
8
8
  _DataType = _interopRequireDefault(_DataType);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  /**
13
11
  * Enumeration for different mode behaviors of the <code>InvisibleMessage</code>.
14
12
  * @private
@@ -19,20 +17,16 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
19
17
  * such as at the end of reading the current sentence, or when the user pauses typing.
20
18
  */
21
19
  Polite: "Polite",
22
-
23
20
  /**
24
21
  * Indicates that updates to the region have the highest priority and should be presented to the user immediately.
25
22
  */
26
23
  Assertive: "Assertive"
27
24
  };
28
-
29
25
  class InvisibleMessageMode extends _DataType.default {
30
26
  static isValid(value) {
31
27
  return !!InvisibleMessageModes[value];
32
28
  }
33
-
34
29
  }
35
-
36
30
  InvisibleMessageMode.generateTypeAccessors(InvisibleMessageModes);
37
31
  var _default = InvisibleMessageModes;
38
32
  _exports.default = _default;
@@ -5,7 +5,6 @@ sap.ui.define(["exports"], function (_exports) {
5
5
  value: true
6
6
  });
7
7
  _exports.default = void 0;
8
-
9
8
  /**
10
9
  * @private
11
10
  * Different behavior for ItemNavigation.
@@ -15,7 +14,6 @@ sap.ui.define(["exports"], function (_exports) {
15
14
  * Static behavior: navigations stops at the first or last item.
16
15
  */
17
16
  Static: "Static",
18
-
19
17
  /**
20
18
  * Cycling behavior: navigating past the last item continues with the first and vice versa.
21
19
  */
@@ -6,42 +6,34 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
6
6
  });
7
7
  _exports.default = void 0;
8
8
  _DataType = _interopRequireDefault(_DataType);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  const PopupStates = {
13
11
  /**
14
12
  * Open and currently not changing states.
15
13
  * @public
16
14
  */
17
15
  OPEN: "OPEN",
18
-
19
16
  /**
20
17
  * Closed and currently not changing states.
21
18
  * @public
22
19
  */
23
20
  CLOSED: "CLOSED",
24
-
25
21
  /**
26
22
  * Already left the CLOSED state, is not OPEN yet, but in the process of getting OPEN.
27
23
  * @public
28
24
  */
29
25
  OPENING: "OPENING",
30
-
31
26
  /**
32
27
  * Still open, but in the process of going to the CLOSED state.
33
28
  * @public
34
29
  */
35
30
  CLOSING: "CLOSING"
36
31
  };
37
-
38
32
  class PopupState extends _DataType.default {
39
33
  static isValid(value) {
40
34
  return !!PopupStates[value];
41
35
  }
42
-
43
36
  }
44
-
45
37
  PopupState.generateTypeAccessors(PopupStates);
46
38
  var _default = PopupState;
47
39
  _exports.default = _default;
@@ -6,9 +6,7 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
6
6
  });
7
7
  _exports.default = void 0;
8
8
  _DataType = _interopRequireDefault(_DataType);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  /**
13
11
  * Different states.
14
12
  */
@@ -19,14 +17,11 @@ sap.ui.define(["exports", "./DataType"], function (_exports, _DataType) {
19
17
  Error: "Error",
20
18
  Information: "Information"
21
19
  };
22
-
23
20
  class ValueState extends _DataType.default {
24
21
  static isValid(value) {
25
22
  return !!ValueStates[value];
26
23
  }
27
-
28
24
  }
29
-
30
25
  ValueState.generateTypeAccessors(ValueStates);
31
26
  var _default = ValueState;
32
27
  _exports.default = _default;
@@ -9,9 +9,7 @@ sap.ui.define(["exports", "./renderer/executeTemplate", "./theming/getConstructa
9
9
  _getConstructableStyle = _interopRequireDefault(_getConstructableStyle);
10
10
  _getEffectiveStyle = _interopRequireDefault(_getEffectiveStyle);
11
11
  _getEffectiveLinksHrefs = _interopRequireDefault(_getEffectiveLinksHrefs);
12
-
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
13
  /**
16
14
  * Updates the shadow root of a UI5Element or its static area item
17
15
  * @param element
@@ -22,7 +20,6 @@ sap.ui.define(["exports", "./renderer/executeTemplate", "./theming/getConstructa
22
20
  const template = forStaticArea ? "staticAreaTemplate" : "template";
23
21
  const shadowRoot = forStaticArea ? element.staticAreaItem.shadowRoot : element.shadowRoot;
24
22
  const renderResult = (0, _executeTemplate.default)(element.constructor[template], element);
25
-
26
23
  if ((0, _CSP.shouldUseLinks)()) {
27
24
  styleStrOrHrefsArr = (0, _getEffectiveLinksHrefs.default)(element.constructor, forStaticArea);
28
25
  } else if (document.adoptedStyleSheets) {
@@ -32,12 +29,10 @@ sap.ui.define(["exports", "./renderer/executeTemplate", "./theming/getConstructa
32
29
  // FF, Safari
33
30
  styleStrOrHrefsArr = (0, _getEffectiveStyle.default)(element.constructor, forStaticArea);
34
31
  }
35
-
36
32
  element.constructor.render(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, {
37
33
  host: element
38
34
  });
39
35
  };
40
-
41
36
  var _default = updateShadowRoot;
42
37
  _exports.default = _default;
43
38
  });
@@ -6,30 +6,24 @@ sap.ui.define(["exports", "./findNodeOwner"], function (_exports, _findNodeOwner
6
6
  });
7
7
  _exports.getEffectiveAriaLabelText = _exports.getAriaLabelledByTexts = void 0;
8
8
  _findNodeOwner = _interopRequireDefault(_findNodeOwner);
9
-
10
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
10
  const getEffectiveAriaLabelText = el => {
13
11
  if (!el.accessibleNameRef) {
14
12
  if (el.accessibleName) {
15
13
  return el.accessibleName;
16
14
  }
17
-
18
15
  return undefined;
19
16
  }
20
-
21
17
  return getAriaLabelledByTexts(el);
22
18
  };
19
+
23
20
  /**
24
21
  *
25
22
  * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts
26
23
  * @param {HTMLElement} ownerDocument (Optional) Defines the HTMLElement(might document or custom element) where the you want to search for the texts.
27
24
  * @param {String} readyIds (Optional) Defines a string of elements ids. The text of these elements will be returned. If used you should provide either el or ownerDocument
28
25
  */
29
-
30
-
31
26
  _exports.getEffectiveAriaLabelText = getEffectiveAriaLabelText;
32
-
33
27
  const getAriaLabelledByTexts = (el, ownerDocument, readyIds = "") => {
34
28
  const ids = readyIds && readyIds.split(" ") || el.accessibleNameRef.split(" ");
35
29
  const owner = ownerDocument || (0, _findNodeOwner.default)(el);
@@ -37,13 +31,11 @@ sap.ui.define(["exports", "./findNodeOwner"], function (_exports, _findNodeOwner
37
31
  ids.forEach((elementId, index) => {
38
32
  const element = owner.querySelector(`[id='${elementId}']`);
39
33
  result += `${element ? element.textContent : ""}`;
40
-
41
34
  if (index < ids.length - 1) {
42
35
  result += " ";
43
36
  }
44
37
  });
45
38
  return result;
46
39
  };
47
-
48
40
  _exports.getAriaLabelledByTexts = getAriaLabelledByTexts;
49
41
  });
@@ -5,7 +5,6 @@ sap.ui.define(["exports"], function (_exports) {
5
5
  value: true
6
6
  });
7
7
  _exports.setCaretPosition = _exports.getCaretPosition = void 0;
8
-
9
8
  /**
10
9
  * Returns the caret (cursor) position of the specified text field (field).
11
10
  * Return value range is 0-field.value.length.
@@ -13,17 +12,13 @@ sap.ui.define(["exports"], function (_exports) {
13
12
  const getCaretPosition = field => {
14
13
  // Initialize
15
14
  let caretPos = 0;
16
-
17
15
  if (field.selectionStart || field.selectionStart === "0") {
18
16
  // Firefox support
19
17
  caretPos = field.selectionDirection === "backward" ? field.selectionStart : field.selectionEnd;
20
18
  }
21
-
22
19
  return caretPos;
23
20
  };
24
-
25
21
  _exports.getCaretPosition = getCaretPosition;
26
-
27
22
  const setCaretPosition = (field, caretPos) => {
28
23
  if (field.createTextRange) {
29
24
  const range = field.createTextRange();
@@ -36,6 +31,5 @@ sap.ui.define(["exports"], function (_exports) {
36
31
  field.focus();
37
32
  }
38
33
  };
39
-
40
34
  _exports.setCaretPosition = setCaretPosition;
41
35
  });
@@ -5,7 +5,6 @@ sap.ui.define(["exports"], function (_exports) {
5
5
  value: true
6
6
  });
7
7
  _exports.getRGBColor = _exports.RGBToHSL = _exports.HSLToRGB = _exports.HEXToRGB = void 0;
8
-
9
8
  /**
10
9
  *
11
10
  * @param {String} color Color in one of the following formats: RGBA or HEX
@@ -164,17 +163,15 @@ sap.ui.define(["exports"], function (_exports) {
164
163
  yellowgreen: "9acd32",
165
164
  transparent: "00000000"
166
165
  };
167
-
168
166
  const getRGBColor = color => {
169
167
  if (color.startsWith("rgba")) {
170
168
  return RGBAToRGB(color);
171
169
  }
172
-
173
170
  if (color.startsWith("rgb")) {
174
171
  return RGBToRGB(color);
175
- } // HEX
176
-
172
+ }
177
173
 
174
+ // HEX
178
175
  if (color.indexOf("#") === 0) {
179
176
  // Shorthand Syntax
180
177
  if (color.length === 4) {
@@ -182,63 +179,54 @@ sap.ui.define(["exports"], function (_exports) {
182
179
  } else {
183
180
  color = color.slice(1, color.length);
184
181
  }
185
- } // Css Color
186
-
182
+ }
187
183
 
184
+ // Css Color
188
185
  if (Object.keys(CSSColors).includes(color)) {
189
186
  color = CSSColors[color];
190
187
  }
191
-
192
188
  return HEXToRGB(color);
193
189
  };
190
+
194
191
  /**
195
192
  * Return an object with the properties for each of the main colors(red, green, blue)
196
193
  * @param {String} color Receives a color in the following format: "rgba(0, 0, 0, 1)
197
194
  */
198
-
199
-
200
195
  _exports.getRGBColor = getRGBColor;
201
-
202
196
  const RGBAToRGB = color => {
203
197
  const openingBracketIndex = color.indexOf("("),
204
- commasIndexes = [];
205
-
198
+ commasIndexes = [];
206
199
  for (let i = 0; i < color.length; i++) {
207
200
  if (color[i] === ",") {
208
201
  commasIndexes.push(i);
209
202
  }
210
203
  }
211
-
212
204
  return {
213
205
  r: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),
214
206
  g: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),
215
207
  b: parseInt(color.slice(commasIndexes[1] + 1, commasIndexes[2]).trim())
216
208
  };
217
209
  };
210
+
218
211
  /**
219
212
  * Return an object with the properties for each of the main colors(red, green, blue)
220
213
  * @param {String} color Receives a color in the following format: "rgb(0, 0, 0)
221
214
  */
222
-
223
-
224
215
  const RGBToRGB = color => {
225
216
  const openingBracketIndex = color.indexOf("("),
226
- closingBraketIndex = color.indexOf(")"),
227
- commasIndexes = [];
228
-
217
+ closingBraketIndex = color.indexOf(")"),
218
+ commasIndexes = [];
229
219
  for (let i = 0; i < color.length; i++) {
230
220
  if (color[i] === ",") {
231
221
  commasIndexes.push(i);
232
222
  }
233
223
  }
234
-
235
224
  return {
236
225
  r: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),
237
226
  g: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),
238
227
  b: parseInt(color.slice(commasIndexes[1] + 1, closingBraketIndex).trim())
239
228
  };
240
229
  };
241
-
242
230
  const HSLToRGB = (color = {
243
231
  h: undefined,
244
232
  s: undefined,
@@ -246,10 +234,9 @@ sap.ui.define(["exports"], function (_exports) {
246
234
  }) => {
247
235
  // Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html
248
236
  const C = (1 - Math.abs(2 * color.l - 1)) * color.s,
249
- X = C * (1 - Math.abs(color.h / 60 % 2 - 1)),
250
- m = color.l - C / 2;
237
+ X = C * (1 - Math.abs(color.h / 60 % 2 - 1)),
238
+ m = color.l - C / 2;
251
239
  let tempColor = {};
252
-
253
240
  switch (Math.round(color.h / 60)) {
254
241
  // 0 ≤ H < 60
255
242
  case 0:
@@ -259,8 +246,8 @@ sap.ui.define(["exports"], function (_exports) {
259
246
  b: 0
260
247
  };
261
248
  break;
262
- // 60 ≤ H < 120
263
249
 
250
+ // 60 ≤ H < 120
264
251
  case 1:
265
252
  tempColor = {
266
253
  r: X,
@@ -268,8 +255,8 @@ sap.ui.define(["exports"], function (_exports) {
268
255
  b: 0
269
256
  };
270
257
  break;
271
- // 120 ≤ H < 180
272
258
 
259
+ // 120 ≤ H < 180
273
260
  case 2:
274
261
  tempColor = {
275
262
  r: 0,
@@ -277,8 +264,8 @@ sap.ui.define(["exports"], function (_exports) {
277
264
  b: X
278
265
  };
279
266
  break;
280
- // 180 ≤ H < 240
281
267
 
268
+ // 180 ≤ H < 240
282
269
  case 3:
283
270
  tempColor = {
284
271
  r: 0,
@@ -286,8 +273,8 @@ sap.ui.define(["exports"], function (_exports) {
286
273
  b: C
287
274
  };
288
275
  break;
289
- // 240 ≤ H < 300
290
276
 
277
+ // 240 ≤ H < 300
291
278
  case 4:
292
279
  tempColor = {
293
280
  r: X,
@@ -295,8 +282,8 @@ sap.ui.define(["exports"], function (_exports) {
295
282
  b: C
296
283
  };
297
284
  break;
298
- // 300 ≤ H < 360
299
285
 
286
+ // 300 ≤ H < 360
300
287
  default:
301
288
  tempColor = {
302
289
  r: C,
@@ -304,19 +291,17 @@ sap.ui.define(["exports"], function (_exports) {
304
291
  b: X
305
292
  };
306
293
  }
307
-
308
294
  return {
309
295
  r: Math.floor((tempColor.r + m) * 255),
310
296
  g: Math.floor((tempColor.g + m) * 255),
311
297
  b: Math.floor((tempColor.b + m) * 255)
312
298
  };
313
299
  };
314
-
315
300
  _exports.HSLToRGB = HSLToRGB;
316
-
317
301
  const HEXToRGB = hex => {
318
302
  // Please make sure you pass a valid 6 digit hex color
319
303
  // In the implementation of this method we assume that the hex argument is a 6 digit valid hex color
304
+
320
305
  const rgbValues = {
321
306
  r: hex.substr(0, 2),
322
307
  g: hex.substr(2, 2),
@@ -328,22 +313,21 @@ sap.ui.define(["exports"], function (_exports) {
328
313
  });
329
314
  return rgbValues;
330
315
  };
331
-
332
316
  _exports.HEXToRGB = HEXToRGB;
333
-
334
317
  const RGBToHSL = (color = {
335
318
  r: undefined,
336
319
  g: undefined,
337
320
  b: undefined
338
321
  }) => {
339
322
  const R = color.r / 255,
340
- G = color.g / 255,
341
- B = color.b / 255,
342
- max = Math.max(R, G, B),
343
- min = Math.min(R, G, B),
344
- delta = max - min;
345
- let h, s; // Hue calculation
346
-
323
+ G = color.g / 255,
324
+ B = color.b / 255,
325
+ max = Math.max(R, G, B),
326
+ min = Math.min(R, G, B),
327
+ delta = max - min;
328
+ let h, s;
329
+
330
+ // Hue calculation
347
331
  if (delta === 0) {
348
332
  h = 0;
349
333
  } else if (max === R) {
@@ -352,23 +336,22 @@ sap.ui.define(["exports"], function (_exports) {
352
336
  h = 60 * ((B - R) / delta + 2);
353
337
  } else if (max === B) {
354
338
  h = 60 * ((R - G) / delta + 4);
355
- } // Lightness calculation
356
-
339
+ }
357
340
 
358
- const l = (max + min) / 2; // Saturation calculation
341
+ // Lightness calculation
342
+ const l = (max + min) / 2;
359
343
 
344
+ // Saturation calculation
360
345
  if (delta === 0) {
361
346
  s = 0;
362
347
  } else {
363
348
  s = delta / (1 - Math.abs(2 * l - 1));
364
349
  }
365
-
366
350
  return {
367
351
  h,
368
352
  s,
369
353
  l
370
354
  };
371
355
  };
372
-
373
356
  _exports.RGBToHSL = RGBToHSL;
374
357
  });
@@ -8,36 +8,26 @@ sap.ui.define(["exports"], function (_exports) {
8
8
  const fetchPromises = new Map();
9
9
  const jsonPromises = new Map();
10
10
  const textPromises = new Map();
11
-
12
11
  const fetchTextOnce = async url => {
13
12
  if (!fetchPromises.get(url)) {
14
13
  fetchPromises.set(url, fetch(url));
15
14
  }
16
-
17
15
  const response = await fetchPromises.get(url);
18
-
19
16
  if (!textPromises.get(url)) {
20
17
  textPromises.set(url, response.text());
21
18
  }
22
-
23
19
  return textPromises.get(url);
24
20
  };
25
-
26
21
  _exports.fetchTextOnce = fetchTextOnce;
27
-
28
22
  const fetchJsonOnce = async url => {
29
23
  if (!fetchPromises.get(url)) {
30
24
  fetchPromises.set(url, fetch(url));
31
25
  }
32
-
33
26
  const response = await fetchPromises.get(url);
34
-
35
27
  if (!jsonPromises.get(url)) {
36
28
  jsonPromises.set(url, response.json());
37
29
  }
38
-
39
30
  return jsonPromises.get(url);
40
31
  };
41
-
42
32
  _exports.fetchJsonOnce = fetchJsonOnce;
43
33
  });
@@ -7,40 +7,29 @@ sap.ui.define(["exports", "./isNodeHidden", "./isNodeClickable"], function (_exp
7
7
  _exports.getLastFocusableElement = _exports.getFirstFocusableElement = void 0;
8
8
  _isNodeHidden = _interopRequireDefault(_isNodeHidden);
9
9
  _isNodeClickable = _interopRequireDefault(_isNodeClickable);
10
-
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
11
  const isFocusTrap = el => {
14
12
  return el.hasAttribute("data-ui5-focus-trap");
15
13
  };
16
-
17
14
  const getFirstFocusableElement = async (container, startFromContainer) => {
18
15
  if (!container || (0, _isNodeHidden.default)(container)) {
19
16
  return null;
20
17
  }
21
-
22
18
  return findFocusableElement(container, true, startFromContainer);
23
19
  };
24
-
25
20
  _exports.getFirstFocusableElement = getFirstFocusableElement;
26
-
27
21
  const getLastFocusableElement = async (container, startFromContainer) => {
28
22
  if (!container || (0, _isNodeHidden.default)(container)) {
29
23
  return null;
30
24
  }
31
-
32
25
  return findFocusableElement(container, false, startFromContainer);
33
26
  };
34
-
35
27
  _exports.getLastFocusableElement = getLastFocusableElement;
36
-
37
28
  const isElemFocusable = el => {
38
29
  return el.hasAttribute("data-ui5-focus-redirect") || !(0, _isNodeHidden.default)(el);
39
30
  };
40
-
41
31
  const findFocusableElement = async (container, forward, startFromContainer) => {
42
32
  let child;
43
-
44
33
  if (container.shadowRoot) {
45
34
  child = forward ? container.shadowRoot.firstChild : container.shadowRoot.lastChild;
46
35
  } else if (container.assignedNodes && container.assignedNodes()) {
@@ -51,37 +40,31 @@ sap.ui.define(["exports", "./isNodeHidden", "./isNodeClickable"], function (_exp
51
40
  } else {
52
41
  child = forward ? container.firstElementChild : container.lastElementChild;
53
42
  }
54
-
55
43
  let focusableDescendant;
44
+
56
45
  /* eslint-disable no-await-in-loop */
57
46
 
58
47
  while (child) {
59
48
  const originalChild = child;
60
-
61
49
  if (child.isUI5Element) {
62
50
  child = await child.getFocusDomRefAsync();
63
51
  }
64
-
65
52
  if (!child) {
66
53
  return null;
67
54
  }
68
-
69
55
  if (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {
70
56
  if ((0, _isNodeClickable.default)(child)) {
71
57
  return child && typeof child.focus === "function" ? child : null;
72
58
  }
73
-
74
59
  focusableDescendant = await findFocusableElement(child, forward);
75
-
76
60
  if (focusableDescendant) {
77
61
  return focusableDescendant && typeof focusableDescendant.focus === "function" ? focusableDescendant : null;
78
62
  }
79
63
  }
80
-
81
64
  child = forward ? originalChild.nextSibling : originalChild.previousSibling;
82
65
  }
83
- /* eslint-enable no-await-in-loop */
84
66
 
67
+ /* eslint-enable no-await-in-loop */
85
68
 
86
69
  return null;
87
70
  };
@@ -7,12 +7,9 @@ sap.ui.define(["exports", "../types/InvisibleMessageMode", "./getSingletonElemen
7
7
  _exports.default = void 0;
8
8
  _InvisibleMessageMode = _interopRequireDefault(_InvisibleMessageMode);
9
9
  _getSingletonElementInstance = _interopRequireDefault(_getSingletonElementInstance);
10
-
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
11
  let politeSpan;
14
12
  let assertiveSpan;
15
-
16
13
  const setOutOfViewportStyles = el => {
17
14
  el.style.position = "absolute";
18
15
  el.style.clip = "rect(1px,1px,1px,1px)";
@@ -21,12 +18,10 @@ sap.ui.define(["exports", "../types/InvisibleMessageMode", "./getSingletonElemen
21
18
  el.style.top = "-1000px";
22
19
  el.style.pointerEvents = "none";
23
20
  };
24
-
25
21
  (0, _Boot.attachBoot)(() => {
26
22
  if (politeSpan && assertiveSpan) {
27
23
  return;
28
24
  }
29
-
30
25
  politeSpan = document.createElement("span");
31
26
  assertiveSpan = document.createElement("span");
32
27
  politeSpan.classList.add("ui5-invisiblemessage-polite");
@@ -40,25 +35,24 @@ sap.ui.define(["exports", "../types/InvisibleMessageMode", "./getSingletonElemen
40
35
  (0, _getSingletonElementInstance.default)("ui5-static-area").appendChild(politeSpan);
41
36
  (0, _getSingletonElementInstance.default)("ui5-static-area").appendChild(assertiveSpan);
42
37
  });
38
+
43
39
  /**
44
40
  * Inserts the string into the respective span, depending on the mode provided.
45
41
  *
46
42
  * @param {string} message String to be announced by the screen reader.
47
43
  * @param {sap.ui.core.InvisibleMessageMode} mode The mode to be inserted in the aria-live attribute.
48
44
  */
49
-
50
45
  const announce = (message, mode) => {
51
46
  // If no type is presented, fallback to polite announcement.
52
- const span = mode === _InvisibleMessageMode.default.Assertive ? assertiveSpan : politeSpan; // Set textContent to empty string in order to trigger screen reader's announcement.
47
+ const span = mode === _InvisibleMessageMode.default.Assertive ? assertiveSpan : politeSpan;
53
48
 
49
+ // Set textContent to empty string in order to trigger screen reader's announcement.
54
50
  span.textContent = "";
55
51
  span.textContent = message;
56
-
57
52
  if (mode !== _InvisibleMessageMode.default.Assertive && mode !== _InvisibleMessageMode.default.Polite) {
58
53
  console.warn(`You have entered an invalid mode. Valid values are: "Polite" and "Assertive". The framework will automatically set the mode to "Polite".`); // eslint-disable-line
59
54
  }
60
55
  };
61
-
62
56
  var _default = announce;
63
57
  _exports.default = _default;
64
58
  });