@ui5/webcomponents-base 0.0.0-c41f1b293 → 0.0.0-c48b38fdc

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 (264) hide show
  1. package/.eslintignore +2 -0
  2. package/CHANGELOG.md +647 -0
  3. package/README.md +2 -1
  4. package/bundle.esm.js +1 -2
  5. package/dist/.tsbuildinfo +1 -0
  6. package/dist/AssetRegistry.d.ts +2 -2
  7. package/dist/AssetRegistry.js +2 -2
  8. package/dist/AssetRegistry.js.map +1 -1
  9. package/dist/Boot.d.ts +3 -2
  10. package/dist/Boot.js +7 -4
  11. package/dist/Boot.js.map +1 -1
  12. package/dist/CSP.d.ts +9 -6
  13. package/dist/CSP.js +9 -6
  14. package/dist/CSP.js.map +1 -1
  15. package/dist/CustomElementsScope.d.ts +4 -4
  16. package/dist/CustomElementsScope.js +2 -2
  17. package/dist/CustomElementsScope.js.map +1 -1
  18. package/dist/CustomElementsScopeUtils.d.ts +8 -1
  19. package/dist/CustomElementsScopeUtils.js +13 -1
  20. package/dist/CustomElementsScopeUtils.js.map +1 -1
  21. package/dist/Device.d.ts +2 -1
  22. package/dist/Device.js +10 -1
  23. package/dist/Device.js.map +1 -1
  24. package/dist/FontFace.js +1 -1
  25. package/dist/FontFace.js.map +1 -1
  26. package/dist/IgnoreCustomElements.d.ts +3 -5
  27. package/dist/IgnoreCustomElements.js +3 -5
  28. package/dist/IgnoreCustomElements.js.map +1 -1
  29. package/dist/InitialConfiguration.d.ts +2 -2
  30. package/dist/InitialConfiguration.js +7 -6
  31. package/dist/InitialConfiguration.js.map +1 -1
  32. package/dist/Keys.d.ts +5 -1
  33. package/dist/Keys.js +109 -106
  34. package/dist/Keys.js.map +1 -1
  35. package/dist/ManagedStyles.d.ts +5 -4
  36. package/dist/ManagedStyles.js +96 -23
  37. package/dist/ManagedStyles.js.map +1 -1
  38. package/dist/MediaRange.d.ts +6 -12
  39. package/dist/MediaRange.js +21 -31
  40. package/dist/MediaRange.js.map +1 -1
  41. package/dist/StaticAreaItem.d.ts +3 -4
  42. package/dist/StaticAreaItem.js +10 -12
  43. package/dist/StaticAreaItem.js.map +1 -1
  44. package/dist/UI5Element.d.ts +36 -27
  45. package/dist/UI5Element.js +98 -47
  46. package/dist/UI5Element.js.map +1 -1
  47. package/dist/UI5ElementMetadata.d.ts +6 -13
  48. package/dist/UI5ElementMetadata.js +17 -15
  49. package/dist/UI5ElementMetadata.js.map +1 -1
  50. package/dist/asset-registries/Icons.d.ts +4 -3
  51. package/dist/asset-registries/Icons.js +28 -17
  52. package/dist/asset-registries/Icons.js.map +1 -1
  53. package/dist/asset-registries/Illustrations.d.ts +2 -0
  54. package/dist/asset-registries/Illustrations.js +51 -20
  55. package/dist/asset-registries/Illustrations.js.map +1 -1
  56. package/dist/asset-registries/LocaleData.js +1 -1
  57. package/dist/asset-registries/LocaleData.js.map +1 -1
  58. package/dist/asset-registries/Themes.d.ts +4 -3
  59. package/dist/asset-registries/Themes.js +26 -10
  60. package/dist/asset-registries/Themes.js.map +1 -1
  61. package/dist/asset-registries/i18n.d.ts +2 -2
  62. package/dist/asset-registries/i18n.js +4 -3
  63. package/dist/asset-registries/i18n.js.map +1 -1
  64. package/dist/{assets-meta → asset-registries/util}/IconCollectionsAlias.d.ts +1 -2
  65. package/dist/{assets-meta → asset-registries/util}/IconCollectionsAlias.js +1 -2
  66. package/dist/asset-registries/util/IconCollectionsAlias.js.map +1 -0
  67. package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +20 -0
  68. package/dist/asset-registries/util/IconCollectionsByTheme.js +42 -0
  69. package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -0
  70. package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +13 -0
  71. package/dist/asset-registries/util/getIconCollectionByTheme.js +29 -0
  72. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -0
  73. package/dist/config/CalendarType.d.ts +8 -1
  74. package/dist/config/CalendarType.js +18 -2
  75. package/dist/config/CalendarType.js.map +1 -1
  76. package/dist/config/Icons.d.ts +9 -24
  77. package/dist/config/Icons.js +8 -67
  78. package/dist/config/Icons.js.map +1 -1
  79. package/dist/config/Language.d.ts +1 -1
  80. package/dist/config/Language.js +6 -3
  81. package/dist/config/Language.js.map +1 -1
  82. package/dist/config/Theme.d.ts +1 -1
  83. package/dist/config/Theme.js +7 -4
  84. package/dist/config/Theme.js.map +1 -1
  85. package/dist/config/ThemeRoot.d.ts +2 -4
  86. package/dist/config/ThemeRoot.js +2 -4
  87. package/dist/config/ThemeRoot.js.map +1 -1
  88. package/dist/config/Timezone.d.ts +1 -1
  89. package/dist/config/Timezone.js +1 -1
  90. package/dist/config/Timezone.js.map +1 -1
  91. package/dist/connectToComponent.d.ts +9 -0
  92. package/dist/connectToComponent.js +59 -0
  93. package/dist/connectToComponent.js.map +1 -0
  94. package/dist/css/FontFace.css +47 -17
  95. package/dist/css/SystemCSSVars.css +0 -8
  96. package/dist/custom-elements-internal.json +2863 -0
  97. package/dist/custom-elements.json +2593 -0
  98. package/dist/decorators/customElement.d.ts +1 -1
  99. package/dist/decorators/customElement.js +1 -1
  100. package/dist/decorators/customElement.js.map +1 -1
  101. package/dist/decorators/event.d.ts +5 -2
  102. package/dist/decorators/event.js.map +1 -1
  103. package/dist/decorators.d.ts +5 -0
  104. package/dist/decorators.js +6 -0
  105. package/dist/decorators.js.map +1 -0
  106. package/dist/delegate/ItemNavigation.d.ts +9 -8
  107. package/dist/delegate/ItemNavigation.js +13 -14
  108. package/dist/delegate/ItemNavigation.js.map +1 -1
  109. package/dist/delegate/ResizeHandler.d.ts +4 -6
  110. package/dist/delegate/ResizeHandler.js +4 -6
  111. package/dist/delegate/ResizeHandler.js.map +1 -1
  112. package/dist/delegate/ScrollEnablement.js +2 -2
  113. package/dist/delegate/ScrollEnablement.js.map +1 -1
  114. package/dist/features/OpenUI5Enablement.d.ts +1 -1
  115. package/dist/features/OpenUI5Support.d.ts +13 -3
  116. package/dist/features/OpenUI5Support.js +94 -33
  117. package/dist/features/OpenUI5Support.js.map +1 -1
  118. package/dist/features/patchPopup.d.ts +10 -0
  119. package/dist/features/patchPopup.js +15 -0
  120. package/dist/features/patchPopup.js.map +1 -0
  121. package/dist/generated/AssetParameters.d.ts +6 -0
  122. package/dist/generated/AssetParameters.js +3 -10
  123. package/dist/generated/AssetParameters.js.map +1 -0
  124. package/dist/generated/VersionInfo.d.ts +10 -0
  125. package/dist/generated/VersionInfo.js +9 -8
  126. package/dist/generated/VersionInfo.js.map +1 -0
  127. package/dist/generated/css/FontFace.css.js +1 -1
  128. package/dist/generated/css/FontFace.css.js.map +1 -1
  129. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  130. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  131. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +1 -1
  132. package/dist/i18nBundle.d.ts +2 -4
  133. package/dist/i18nBundle.js +1 -4
  134. package/dist/i18nBundle.js.map +1 -1
  135. package/dist/locale/applyDirection.d.ts +3 -2
  136. package/dist/locale/applyDirection.js +3 -2
  137. package/dist/locale/applyDirection.js.map +1 -1
  138. package/dist/locale/getEffectiveDir.d.ts +1 -1
  139. package/dist/locale/getEffectiveDir.js +3 -19
  140. package/dist/locale/getEffectiveDir.js.map +1 -1
  141. package/dist/renderer/LitRenderer.d.ts +2 -2
  142. package/dist/renderer/directives/style-map.d.ts +13 -0
  143. package/dist/renderer/directives/style-map.js +59 -59
  144. package/dist/renderer/directives/style-map.js.map +1 -0
  145. package/dist/sap/base/Log.js +698 -188
  146. package/dist/sap/base/assert.js +28 -1
  147. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  148. package/dist/sap/base/security/URLListValidator.js +253 -6
  149. package/dist/sap/base/security/encodeCSS.js +34 -8
  150. package/dist/sap/base/security/encodeXML.js +47 -17
  151. package/dist/sap/base/security/sanitizeHTML.js +35 -13
  152. package/dist/sap/base/strings/toHex.js +27 -2
  153. package/dist/sap/base/util/now.js +24 -3
  154. package/dist/sap/base/util/uid.js +27 -0
  155. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +112 -97
  156. package/dist/ssr-dom-shim.d.ts +1 -0
  157. package/dist/ssr-dom-shim.js +12 -0
  158. package/dist/ssr-dom-shim.js.map +1 -0
  159. package/dist/ssr-dom.d.ts +0 -0
  160. package/dist/ssr-dom.js +3 -0
  161. package/dist/ssr-dom.js.map +1 -0
  162. package/dist/theming/applyTheme.js +5 -5
  163. package/dist/theming/applyTheme.js.map +1 -1
  164. package/dist/types/AnimationMode.d.ts +0 -8
  165. package/dist/types/AnimationMode.js +0 -8
  166. package/dist/types/AnimationMode.js.map +1 -1
  167. package/dist/types/CSSColor.d.ts +0 -4
  168. package/dist/types/CSSColor.js +0 -4
  169. package/dist/types/CSSColor.js.map +1 -1
  170. package/dist/types/CSSSize.d.ts +11 -0
  171. package/dist/types/CSSSize.js +14 -0
  172. package/dist/types/CSSSize.js.map +1 -0
  173. package/dist/types/CalendarType.d.ts +0 -9
  174. package/dist/types/CalendarType.js +0 -9
  175. package/dist/types/CalendarType.js.map +1 -1
  176. package/dist/types/DOMReference.d.ts +1 -5
  177. package/dist/types/DOMReference.js +1 -5
  178. package/dist/types/DOMReference.js.map +1 -1
  179. package/dist/types/DataType.d.ts +1 -6
  180. package/dist/types/DataType.js +1 -6
  181. package/dist/types/DataType.js.map +1 -1
  182. package/dist/types/Float.d.ts +0 -3
  183. package/dist/types/Float.js +0 -3
  184. package/dist/types/Float.js.map +1 -1
  185. package/dist/types/Integer.d.ts +0 -3
  186. package/dist/types/Integer.js +0 -3
  187. package/dist/types/Integer.js.map +1 -1
  188. package/dist/types/InvisibleMessageMode.d.ts +5 -10
  189. package/dist/types/InvisibleMessageMode.js +4 -11
  190. package/dist/types/InvisibleMessageMode.js.map +1 -1
  191. package/dist/types/ItemNavigationBehavior.d.ts +0 -6
  192. package/dist/types/ItemNavigationBehavior.js +0 -6
  193. package/dist/types/ItemNavigationBehavior.js.map +1 -1
  194. package/dist/types/MovePlacement.d.ts +20 -0
  195. package/dist/types/MovePlacement.js +22 -0
  196. package/dist/types/MovePlacement.js.map +1 -0
  197. package/dist/types/NavigationMode.d.ts +0 -8
  198. package/dist/types/NavigationMode.js +0 -8
  199. package/dist/types/NavigationMode.js.map +1 -1
  200. package/dist/types/Orientation.d.ts +16 -0
  201. package/dist/types/Orientation.js +18 -0
  202. package/dist/types/Orientation.js.map +1 -0
  203. package/dist/types/ValueState.d.ts +0 -14
  204. package/dist/types/ValueState.js +0 -14
  205. package/dist/types/ValueState.js.map +1 -1
  206. package/dist/types.d.ts +11 -1
  207. package/dist/types.js.map +1 -1
  208. package/dist/updateShadowRoot.js +2 -1
  209. package/dist/updateShadowRoot.js.map +1 -1
  210. package/dist/util/ColorConversion.js +200 -195
  211. package/dist/util/ColorConversion.js.map +1 -1
  212. package/dist/util/InvisibleMessage.d.ts +1 -1
  213. package/dist/util/InvisibleMessage.js.map +1 -1
  214. package/dist/util/PopupUtils.js +1 -1
  215. package/dist/util/PopupUtils.js.map +1 -1
  216. package/dist/util/clamp.js +2 -1
  217. package/dist/util/clamp.js.map +1 -1
  218. package/dist/util/createLinkInHead.d.ts +1 -1
  219. package/dist/util/createLinkInHead.js +1 -1
  220. package/dist/util/createLinkInHead.js.map +1 -1
  221. package/dist/util/createStyleInHead.d.ts +1 -1
  222. package/dist/util/createStyleInHead.js +1 -1
  223. package/dist/util/createStyleInHead.js.map +1 -1
  224. package/dist/util/detectNavigatorLanguage.d.ts +2 -2
  225. package/dist/util/detectNavigatorLanguage.js +6 -1
  226. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  227. package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
  228. package/dist/util/dragAndDrop/DragRegistry.js +66 -0
  229. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
  230. package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
  231. package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
  232. package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
  233. package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
  234. package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
  235. package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
  236. package/dist/util/getClassCopy.d.ts +54 -34
  237. package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
  238. package/dist/util/getDesigntimePropertyAsArray.js +2 -1
  239. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  240. package/dist/util/getParentElement.d.ts +2 -0
  241. package/dist/util/getParentElement.js +5 -0
  242. package/dist/util/getParentElement.js.map +1 -0
  243. package/dist/util/isElementContainingBlock.d.ts +2 -0
  244. package/dist/util/isElementContainingBlock.js +11 -0
  245. package/dist/util/isElementContainingBlock.js.map +1 -0
  246. package/dist/vscode.html-custom-data.json +22 -0
  247. package/index.js +3 -5
  248. package/lib/generate-asset-parameters/index.js +2 -2
  249. package/lib/generate-version-info/index.js +2 -2
  250. package/package-scripts.cjs +14 -18
  251. package/package.json +14 -6
  252. package/src/css/FontFace.css +47 -17
  253. package/src/css/SystemCSSVars.css +0 -8
  254. package/tsconfig.json +6 -0
  255. package/used-modules.txt +4 -0
  256. package/dist/api.json +0 -1
  257. package/dist/assets/Boot.18e749cb.js +0 -9
  258. package/dist/assets/Boot.34b7cea0.css +0 -1
  259. package/dist/assets/bundle.esm.179dce7c.js +0 -50
  260. package/dist/assets-meta/IconCollectionsAlias.js.map +0 -1
  261. package/dist/config/RTL.d.ts +0 -7
  262. package/dist/config/RTL.js +0 -37
  263. package/dist/config/RTL.js.map +0 -1
  264. package/src/renderer/directives/style-map.js +0 -72
@@ -1,3 +1,5 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ import "@ui5/webcomponents-base/dist/ssr-dom.js";
1
3
  import merge from "./thirdparty/merge.js";
2
4
  import { boot } from "./Boot.js";
3
5
  import UI5ElementMetadata from "./UI5ElementMetadata.js";
@@ -18,7 +20,6 @@ import arraysAreEqual from "./util/arraysAreEqual.js";
18
20
  import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
19
21
  import preloadLinks from "./theming/preloadLinks.js";
20
22
  import executeTemplate from "./renderer/executeTemplate.js";
21
- import { getCurrentRuntimeIndex } from "./Runtimes.js";
22
23
  let autoId = 0;
23
24
  const elementTimeouts = new Map();
24
25
  const uniqueDependenciesCache = new Map();
@@ -37,15 +38,28 @@ function _invalidate(changeInfo) {
37
38
  this.onInvalidation(changeInfo);
38
39
  this._changedState.push(changeInfo);
39
40
  renderDeferred(this);
40
- this._eventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
41
+ this._invalidationEventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
41
42
  }
42
43
  /**
44
+ * looks up a property descsriptor including in the prototype chain
45
+ * @param proto the starting prototype
46
+ * @param name the property to look for
47
+ * @returns the property descriptor if found directly or in the prototype chaing, undefined if not found
48
+ */
49
+ function getPropertyDescriptor(proto, name) {
50
+ do {
51
+ const descriptor = Object.getOwnPropertyDescriptor(proto, name);
52
+ if (descriptor) {
53
+ return descriptor;
54
+ }
55
+ // go up the prototype chain
56
+ proto = Object.getPrototypeOf(proto);
57
+ } while (proto && proto !== HTMLElement.prototype);
58
+ }
59
+ /**
60
+ * @class
43
61
  * Base class for all UI5 Web Components
44
62
  *
45
- * @class
46
- * @constructor
47
- * @author SAP SE
48
- * @alias sap.ui.webc.base.UI5Element
49
63
  * @extends HTMLElement
50
64
  * @public
51
65
  */
@@ -59,7 +73,8 @@ class UI5Element extends HTMLElement {
59
73
  this._fullyConnected = false; // A flag telling whether the UI5Element's onEnterDOM hook was called (since it's possible to have the element removed from DOM before that)
60
74
  this._childChangeListeners = new Map(); // used to store lazy listeners per slot for the child change event of every child inside that slot
61
75
  this._slotChangeListeners = new Map(); // used to store lazy listeners per slot for the slotchange event of all slot children inside that slot
62
- this._eventProvider = new EventProvider(); // used by parent components for listening to changes to child components
76
+ this._invalidationEventProvider = new EventProvider(); // used by parent components for listening to changes to child components
77
+ this._componentStateFinalizedEventProvider = new EventProvider(); // used by friend classes for synchronization
63
78
  let deferredResolve;
64
79
  this._domRefReadyPromise = new Promise(resolve => {
65
80
  deferredResolve = resolve;
@@ -98,8 +113,6 @@ class UI5Element extends HTMLElement {
98
113
  */
99
114
  async connectedCallback() {
100
115
  const ctor = this.constructor;
101
- this.setAttribute(`_ui5rt${getCurrentRuntimeIndex()}`, "");
102
- this.setAttribute("_ui5host", "");
103
116
  this.setAttribute(ctor.getMetadata().getPureTag(), "");
104
117
  if (ctor.getMetadata().supportsF6FastNavigation()) {
105
118
  this.setAttribute("data-sap-ui-fastnavgroup", "true");
@@ -164,14 +177,16 @@ class UI5Element extends HTMLElement {
164
177
  */
165
178
  _startObservingDOMChildren() {
166
179
  const ctor = this.constructor;
167
- const shouldObserveChildren = ctor.getMetadata().hasSlots();
180
+ const metadata = ctor.getMetadata();
181
+ const shouldObserveChildren = metadata.hasSlots();
168
182
  if (!shouldObserveChildren) {
169
183
  return;
170
184
  }
171
- const canSlotText = ctor.getMetadata().canSlotText();
185
+ const canSlotText = metadata.canSlotText();
186
+ const hasClonedSlot = Object.keys(metadata.getSlots()).some(slotName => metadata.getSlots()[slotName].cloned);
172
187
  const mutationObserverOptions = {
173
188
  childList: true,
174
- subtree: canSlotText,
189
+ subtree: canSlotText || hasClonedSlot,
175
190
  characterData: canSlotText,
176
191
  };
177
192
  observeDOMNode(this, this._processChildren.bind(this), mutationObserverOptions);
@@ -234,9 +249,9 @@ class UI5Element extends HTMLElement {
234
249
  const localName = child.localName;
235
250
  const shouldWaitForCustomElement = localName.includes("-") && !shouldIgnoreCustomElement(localName);
236
251
  if (shouldWaitForCustomElement) {
237
- const isDefined = window.customElements.get(localName);
252
+ const isDefined = customElements.get(localName);
238
253
  if (!isDefined) {
239
- const whenDefinedPromise = window.customElements.whenDefined(localName); // Class registered, but instances not upgraded yet
254
+ const whenDefinedPromise = customElements.whenDefined(localName); // Class registered, but instances not upgraded yet
240
255
  let timeoutPromise = elementTimeouts.get(localName);
241
256
  if (!timeoutPromise) {
242
257
  timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
@@ -244,7 +259,7 @@ class UI5Element extends HTMLElement {
244
259
  }
245
260
  await Promise.race([whenDefinedPromise, timeoutPromise]);
246
261
  }
247
- window.customElements.upgrade(child);
262
+ customElements.upgrade(child);
248
263
  }
249
264
  }
250
265
  child = ctor.getMetadata().constructor.validateSlotValue(child, slotData);
@@ -319,26 +334,26 @@ class UI5Element extends HTMLElement {
319
334
  /**
320
335
  * Attach a callback that will be executed whenever the component is invalidated
321
336
  *
322
- * @param {InvalidationInfo} callback
337
+ * @param callback
323
338
  * @public
324
339
  */
325
340
  attachInvalidate(callback) {
326
- this._eventProvider.attachEvent("invalidate", callback);
341
+ this._invalidationEventProvider.attachEvent("invalidate", callback);
327
342
  }
328
343
  /**
329
344
  * Detach the callback that is executed whenever the component is invalidated
330
345
  *
331
- * @param {InvalidationInfo} callback
346
+ * @param callback
332
347
  * @public
333
348
  */
334
349
  detachInvalidate(callback) {
335
- this._eventProvider.detachEvent("invalidate", callback);
350
+ this._invalidationEventProvider.detachEvent("invalidate", callback);
336
351
  }
337
352
  /**
338
353
  * Callback that is executed whenever a monitored child changes its state
339
354
  *
340
- * @param {sting} slotName the slot in which a child was invalidated
341
- * @param { ChangeInfo } childChangeInfo the changeInfo object for the child in the given slot
355
+ * @param slotName the slot in which a child was invalidated
356
+ * @param childChangeInfo the changeInfo object for the child in the given slot
342
357
  * @private
343
358
  */
344
359
  _onChildChange(slotName, childChangeInfo) {
@@ -448,7 +463,6 @@ class UI5Element extends HTMLElement {
448
463
  * Returns a singleton event listener for the "change" event of a child in a given slot
449
464
  *
450
465
  * @param slotName the name of the slot, where the child is
451
- * @returns {ChildChangeListener}
452
466
  * @private
453
467
  */
454
468
  _getChildChangeListener(slotName) {
@@ -461,7 +475,6 @@ class UI5Element extends HTMLElement {
461
475
  * Returns a singleton slotchange event listener that invalidates the component due to changes in the given slot
462
476
  *
463
477
  * @param slotName the name of the slot, where the slot element (whose slotchange event we're listening to) is
464
- * @returns {SlotChangeListener}
465
478
  * @private
466
479
  */
467
480
  _getSlotChangeListener(slotName) {
@@ -537,9 +550,7 @@ class UI5Element extends HTMLElement {
537
550
  this._suppressInvalidation = true;
538
551
  this.onBeforeRendering();
539
552
  // Intended for framework usage only. Currently ItemNavigation updates tab indexes after the component has updated its state but before the template is rendered
540
- if (this._onComponentStateFinalized) {
541
- this._onComponentStateFinalized();
542
- }
553
+ this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized");
543
554
  // resume normal invalidation handling
544
555
  this._suppressInvalidation = false;
545
556
  // Update the shadow root with the render result
@@ -639,7 +650,7 @@ class UI5Element extends HTMLElement {
639
650
  }
640
651
  /**
641
652
  * Set the focus to the element, returned by "getFocusDomRef()" (marked by "data-sap-focus-ref")
642
- * @param {FocusOptions} focusOptions additional options for the focus
653
+ * @param focusOptions additional options for the focus
643
654
  * @public
644
655
  */
645
656
  async focus(focusOptions) {
@@ -656,13 +667,13 @@ class UI5Element extends HTMLElement {
656
667
  * @param data - additional data for the event
657
668
  * @param cancelable - true, if the user can call preventDefault on the event object
658
669
  * @param bubbles - true, if the event bubbles
659
- * @returns {boolean} false, if the event was cancelled (preventDefault called), true otherwise
670
+ * @returns false, if the event was cancelled (preventDefault called), true otherwise
660
671
  */
661
672
  fireEvent(name, data, cancelable = false, bubbles = true) {
662
673
  const eventResult = this._fireEvent(name, data, cancelable, bubbles);
663
674
  const camelCaseEventName = kebabToCamelCase(name);
664
675
  if (camelCaseEventName !== name) {
665
- return eventResult && this._fireEvent(camelCaseEventName, data, cancelable);
676
+ return eventResult && this._fireEvent(camelCaseEventName, data, cancelable, bubbles);
666
677
  }
667
678
  return eventResult;
668
679
  }
@@ -697,12 +708,30 @@ class UI5Element extends HTMLElement {
697
708
  getSlottedNodes(slotName) {
698
709
  return getSlottedNodesList(this[slotName]);
699
710
  }
711
+ /**
712
+ * Attach a callback that will be executed whenever the component's state is finalized
713
+ *
714
+ * @param callback
715
+ * @public
716
+ */
717
+ attachComponentStateFinalized(callback) {
718
+ this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized", callback);
719
+ }
720
+ /**
721
+ * Detach the callback that is executed whenever the component's state is finalized
722
+ *
723
+ * @param callback
724
+ * @public
725
+ */
726
+ detachComponentStateFinalized(callback) {
727
+ this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized", callback);
728
+ }
700
729
  /**
701
730
  * Determines whether the component should be rendered in RTL mode or not.
702
731
  * Returns: "rtl", "ltr" or undefined
703
732
  *
704
733
  * @public
705
- * @returns {String|undefined}
734
+ * @default undefined
706
735
  */
707
736
  get effectiveDir() {
708
737
  markAsRtlAware(this.constructor); // if a UI5 Element calls this method, it's considered to be rtl-aware
@@ -710,8 +739,8 @@ class UI5Element extends HTMLElement {
710
739
  }
711
740
  /**
712
741
  * Used to duck-type UI5 elements without using instanceof
713
- * @returns {boolean}
714
742
  * @public
743
+ * @default true
715
744
  */
716
745
  get isUI5Element() {
717
746
  return true;
@@ -719,6 +748,13 @@ class UI5Element extends HTMLElement {
719
748
  get classes() {
720
749
  return {};
721
750
  }
751
+ /**
752
+ * Returns the component accessibility info.
753
+ * @private
754
+ */
755
+ get accessibilityInfo() {
756
+ return {};
757
+ }
722
758
  /**
723
759
  * Do not override this method in derivatives of UI5Element, use metadata properties instead
724
760
  * @private
@@ -778,8 +814,25 @@ class UI5Element extends HTMLElement {
778
814
  if (propData.multiple && propData.defaultValue) {
779
815
  throw new Error(`Cannot set a default value for property "${prop}". All multiple properties are empty arrays by default.`);
780
816
  }
817
+ const descriptor = getPropertyDescriptor(proto, prop);
818
+ // if the decorator is on a setter, proxy the new setter to it
819
+ let origSet;
820
+ if (descriptor?.set) {
821
+ // eslint-disable-next-line @typescript-eslint/unbound-method
822
+ origSet = descriptor.set;
823
+ }
824
+ // if the decorator is on a setter, there will be a corresponding getter - proxy the new getter to it
825
+ let origGet;
826
+ if (descriptor?.get) {
827
+ // eslint-disable-next-line @typescript-eslint/unbound-method
828
+ origGet = descriptor.get;
829
+ }
781
830
  Object.defineProperty(proto, prop, {
782
831
  get() {
832
+ // proxy the getter to the original accessor if there was one
833
+ if (origGet) {
834
+ return origGet.call(this);
835
+ }
783
836
  if (this._state[prop] !== undefined) {
784
837
  return this._state[prop];
785
838
  }
@@ -804,7 +857,7 @@ class UI5Element extends HTMLElement {
804
857
  value = metadataCtor.validatePropertyValue(value, propData);
805
858
  const propertyType = propData.type;
806
859
  let propertyValidator = propData.validator;
807
- const oldState = this._state[prop];
860
+ const oldState = origGet ? origGet.call(this) : this._state[prop];
808
861
  if (propertyType && propertyType.isDataTypeClass) {
809
862
  propertyValidator = propertyType;
810
863
  }
@@ -818,7 +871,13 @@ class UI5Element extends HTMLElement {
818
871
  isDifferent = oldState !== value;
819
872
  }
820
873
  if (isDifferent) {
821
- this._state[prop] = value;
874
+ // if the decorator is on a setter, use it for storage
875
+ if (origSet) {
876
+ origSet.call(this, value);
877
+ }
878
+ else {
879
+ this._state[prop] = value;
880
+ }
822
881
  _invalidate.call(this, {
823
882
  type: "property",
824
883
  name: prop,
@@ -852,13 +911,6 @@ class UI5Element extends HTMLElement {
852
911
  }
853
912
  }
854
913
  }
855
- /**
856
- * Returns the CSS for this UI5 Web Component Class
857
- * @protected
858
- */
859
- static get styles() {
860
- return "";
861
- }
862
914
  /**
863
915
  * Returns the Static Area CSS for this UI5 Web Component Class
864
916
  * @protected
@@ -890,8 +942,6 @@ class UI5Element extends HTMLElement {
890
942
  }
891
943
  /**
892
944
  * Returns a promise that resolves whenever all dependencies for this UI5 Web Component have resolved
893
- *
894
- * @returns {Promise}
895
945
  */
896
946
  static whenDependenciesDefined() {
897
947
  return Promise.all(this.getUniqueDependencies().map(dep => dep.define()));
@@ -900,7 +950,6 @@ class UI5Element extends HTMLElement {
900
950
  * Hook that will be called upon custom element definition
901
951
  *
902
952
  * @protected
903
- * @returns {Promise<void>}
904
953
  */
905
954
  static async onDefine() {
906
955
  return Promise.resolve();
@@ -908,7 +957,6 @@ class UI5Element extends HTMLElement {
908
957
  /**
909
958
  * Registers a UI5 Web Component in the browser window object
910
959
  * @public
911
- * @returns {Promise<UI5Element>}
912
960
  */
913
961
  static async define() {
914
962
  await boot();
@@ -925,7 +973,7 @@ class UI5Element extends HTMLElement {
925
973
  else if (!definedGlobally) {
926
974
  this._generateAccessors();
927
975
  registerTag(tag);
928
- window.customElements.define(tag, this);
976
+ customElements.define(tag, this);
929
977
  preloadLinks(this);
930
978
  }
931
979
  return this;
@@ -934,7 +982,6 @@ class UI5Element extends HTMLElement {
934
982
  * Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')
935
983
  * Note: not to be confused with the "get metadata()" method, which returns an object for this class's metadata only
936
984
  * @public
937
- * @returns {UI5ElementMetadata}
938
985
  */
939
986
  static getMetadata() {
940
987
  if (this.hasOwnProperty("_metadata")) { // eslint-disable-line
@@ -956,9 +1003,13 @@ class UI5Element extends HTMLElement {
956
1003
  * @protected
957
1004
  */
958
1005
  UI5Element.metadata = {};
1006
+ /**
1007
+ * Returns the CSS for this UI5 Web Component Class
1008
+ * @protected
1009
+ */
1010
+ UI5Element.styles = "";
959
1011
  /**
960
1012
  * Always use duck-typing to cover all runtimes on the page.
961
- * @returns {boolean}
962
1013
  */
963
1014
  const instanceOfUI5Element = (object) => {
964
1015
  return "isUI5Element" in object;