@ui5/webcomponents-base 0.0.0-cc312800a → 0.0.0-cf50976ce

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 (209) hide show
  1. package/.eslintignore +3 -1
  2. package/CHANGELOG.md +280 -0
  3. package/README.md +53 -7
  4. package/bundle.esm.js +13 -11
  5. package/dist/Boot.js +34 -18
  6. package/dist/CSP.js +59 -0
  7. package/dist/CustomElementsRegistry.js +60 -4
  8. package/dist/CustomElementsScope.js +20 -98
  9. package/dist/CustomElementsScopeUtils.js +108 -0
  10. package/dist/Device.js +22 -1
  11. package/dist/EventProvider.js +19 -25
  12. package/dist/FeaturesRegistry.js +4 -1
  13. package/dist/FontFace.js +7 -95
  14. package/dist/InitialConfiguration.js +31 -14
  15. package/dist/Keys.js +62 -0
  16. package/dist/ManagedStyles.js +83 -0
  17. package/dist/Render.js +3 -1
  18. package/dist/Runtimes.js +107 -0
  19. package/dist/StaticAreaItem.js +15 -10
  20. package/dist/SystemCSSVars.js +4 -25
  21. package/dist/UI5Element.js +71 -60
  22. package/dist/UI5ElementMetadata.js +18 -2
  23. package/dist/asset-registries/Icons.js +26 -9
  24. package/dist/asset-registries/Illustrations.js +30 -0
  25. package/dist/asset-registries/LocaleData.js +18 -4
  26. package/dist/asset-registries/Themes.js +6 -2
  27. package/dist/asset-registries/i18n.js +3 -1
  28. package/dist/assets/bundle.esm.83f057b4.js +43 -0
  29. package/dist/assets-meta/IconCollectionsAlias.js +18 -0
  30. package/dist/config/Icons.js +52 -0
  31. package/dist/config/Theme.js +25 -0
  32. package/dist/css/BusyIndicator.css +80 -0
  33. package/dist/css/FontFace.css +66 -0
  34. package/dist/css/OverrideFontFace.css +32 -0
  35. package/dist/css/SystemCSSVars.css +17 -0
  36. package/dist/delegate/ItemNavigation.js +75 -4
  37. package/dist/delegate/ScrollEnablement.js +7 -1
  38. package/dist/features/F6Navigation.js +110 -0
  39. package/dist/features/OpenUI5Enablement.js +119 -0
  40. package/dist/generated/AssetParameters.js +1 -1
  41. package/dist/generated/VersionInfo.js +10 -0
  42. package/dist/generated/css/BusyIndicator.css.js +5 -0
  43. package/dist/generated/css/FontFace.css.js +5 -0
  44. package/dist/generated/css/OverrideFontFace.css.js +5 -0
  45. package/dist/generated/css/SystemCSSVars.css.js +5 -0
  46. package/dist/i18nBundle.js +34 -3
  47. package/dist/renderer/LitRenderer.js +39 -18
  48. package/dist/renderer/directives/style-map.js +72 -0
  49. package/dist/renderer/executeTemplate.js +19 -2
  50. package/dist/sap/base/Log.js +241 -0
  51. package/dist/sap/base/assert.js +8 -0
  52. package/dist/sap/base/security/URLListValidator.js +148 -0
  53. package/dist/sap/base/security/encodeCSS.js +14 -0
  54. package/dist/sap/base/security/encodeXML.js +23 -0
  55. package/dist/sap/base/security/sanitizeHTML.js +16 -0
  56. package/dist/sap/base/strings/toHex.js +8 -0
  57. package/dist/sap/base/util/now.js +7 -0
  58. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3585 -0
  59. package/dist/theming/CustomStyle.js +23 -3
  60. package/dist/theming/applyTheme.js +11 -10
  61. package/dist/theming/getEffectiveLinksHrefs.js +27 -0
  62. package/dist/theming/getEffectiveStyle.js +9 -0
  63. package/dist/theming/getStylesString.js +4 -2
  64. package/dist/theming/getThemeDesignerTheme.js +25 -5
  65. package/dist/theming/preloadLinks.js +23 -0
  66. package/dist/types/DOMReference.js +24 -0
  67. package/dist/types/DataType.js +12 -0
  68. package/dist/types/Float.js +4 -0
  69. package/dist/types/Integer.js +4 -0
  70. package/dist/types/InvisibleMessageMode.js +30 -0
  71. package/dist/updateShadowRoot.js +9 -6
  72. package/dist/util/AriaLabelHelper.js +6 -8
  73. package/dist/util/Caret.js +1 -14
  74. package/dist/util/ColorConversion.js +30 -2
  75. package/dist/util/FocusableElements.js +13 -7
  76. package/dist/util/HTMLSanitizer.js +7 -0
  77. package/dist/util/InvisibleMessage.js +69 -0
  78. package/dist/util/PopupUtils.js +1 -1
  79. package/dist/util/TabbableElements.js +5 -1
  80. package/dist/util/createLinkInHead.js +19 -0
  81. package/dist/util/escapeRegex.js +10 -0
  82. package/dist/util/generateHighlightedMarkup.js +42 -0
  83. package/dist/util/getEffectiveScrollbarStyle.js +5 -0
  84. package/dist/util/getNormalizedTarget.js +16 -0
  85. package/dist/util/isDefaultSlotProvided.js +11 -0
  86. package/dist/util/isNodeHidden.js +1 -1
  87. package/dist/util/isNodeTabbable.js +4 -4
  88. package/hash.txt +1 -1
  89. package/index.js +1 -1
  90. package/lib/generate-asset-parameters/index.js +8 -5
  91. package/lib/generate-styles/index.js +26 -0
  92. package/lib/generate-version-info/index.js +32 -0
  93. package/package-scripts.js +36 -23
  94. package/package.json +18 -9
  95. package/src/Boot.js +34 -18
  96. package/src/CSP.js +59 -0
  97. package/src/CustomElementsRegistry.js +60 -4
  98. package/src/CustomElementsScope.js +20 -98
  99. package/src/CustomElementsScopeUtils.js +108 -0
  100. package/src/Device.js +22 -1
  101. package/src/EventProvider.js +19 -25
  102. package/src/FeaturesRegistry.js +4 -1
  103. package/src/FontFace.js +7 -95
  104. package/src/InitialConfiguration.js +31 -14
  105. package/src/Keys.js +62 -0
  106. package/src/ManagedStyles.js +83 -0
  107. package/src/Render.js +3 -1
  108. package/src/Runtimes.js +107 -0
  109. package/src/StaticAreaItem.js +15 -10
  110. package/src/SystemCSSVars.js +4 -25
  111. package/src/UI5Element.js +71 -60
  112. package/src/UI5ElementMetadata.js +18 -2
  113. package/src/asset-registries/Icons.js +26 -9
  114. package/src/asset-registries/Illustrations.js +30 -0
  115. package/src/asset-registries/LocaleData.js +18 -4
  116. package/src/asset-registries/Themes.js +6 -2
  117. package/src/asset-registries/i18n.js +3 -1
  118. package/src/assets-meta/IconCollectionsAlias.js +18 -0
  119. package/src/config/Icons.js +52 -0
  120. package/src/config/Theme.js +25 -0
  121. package/src/css/BusyIndicator.css +80 -0
  122. package/src/css/FontFace.css +66 -0
  123. package/src/css/OverrideFontFace.css +32 -0
  124. package/src/css/SystemCSSVars.css +17 -0
  125. package/src/delegate/ItemNavigation.js +75 -4
  126. package/src/delegate/ScrollEnablement.js +7 -1
  127. package/src/features/F6Navigation.js +110 -0
  128. package/src/features/OpenUI5Enablement.js +119 -0
  129. package/src/i18nBundle.js +34 -3
  130. package/src/renderer/LitRenderer.js +39 -18
  131. package/src/renderer/directives/style-map.js +72 -0
  132. package/src/renderer/executeTemplate.js +19 -2
  133. package/src/theming/CustomStyle.js +23 -3
  134. package/src/theming/applyTheme.js +11 -10
  135. package/src/theming/getEffectiveLinksHrefs.js +27 -0
  136. package/src/theming/getEffectiveStyle.js +9 -0
  137. package/src/theming/getStylesString.js +4 -2
  138. package/src/theming/getThemeDesignerTheme.js +25 -5
  139. package/src/theming/preloadLinks.js +23 -0
  140. package/src/types/DOMReference.js +24 -0
  141. package/src/types/DataType.js +12 -0
  142. package/src/types/Float.js +4 -0
  143. package/src/types/Integer.js +4 -0
  144. package/src/types/InvisibleMessageMode.js +30 -0
  145. package/src/updateShadowRoot.js +9 -6
  146. package/src/util/AriaLabelHelper.js +6 -8
  147. package/src/util/Caret.js +1 -14
  148. package/src/util/ColorConversion.js +30 -2
  149. package/src/util/FocusableElements.js +13 -7
  150. package/src/util/HTMLSanitizer.js +7 -0
  151. package/src/util/InvisibleMessage.js +69 -0
  152. package/src/util/PopupUtils.js +1 -1
  153. package/src/util/TabbableElements.js +5 -1
  154. package/src/util/createLinkInHead.js +19 -0
  155. package/src/util/escapeRegex.js +10 -0
  156. package/src/util/generateHighlightedMarkup.js +42 -0
  157. package/src/util/getEffectiveScrollbarStyle.js +5 -0
  158. package/src/util/getNormalizedTarget.js +16 -0
  159. package/src/util/isDefaultSlotProvided.js +11 -0
  160. package/src/util/isNodeHidden.js +1 -1
  161. package/src/util/isNodeTabbable.js +4 -4
  162. package/used-modules.txt +10 -0
  163. package/config/.eslintrc.js +0 -3
  164. package/config/rollup.config.js +0 -1
  165. package/dist/config/AssetsPath.js +0 -17
  166. package/dist/isLegacyBrowser.js +0 -3
  167. package/dist/renderer/ifDefined.js +0 -21
  168. package/dist/renderer/scopeHTML.js +0 -32
  169. package/dist/resources/bundle.esm.js +0 -121
  170. package/dist/resources/bundle.esm.js.map +0 -1
  171. package/dist/test-resources/assets/Themes.js +0 -17
  172. package/dist/test-resources/elements/Child.js +0 -35
  173. package/dist/test-resources/elements/Generic.js +0 -84
  174. package/dist/test-resources/elements/GenericExt.js +0 -26
  175. package/dist/test-resources/elements/NoShadowDOM.js +0 -13
  176. package/dist/test-resources/elements/Parent.js +0 -41
  177. package/dist/test-resources/elements/WithStaticArea.js +0 -76
  178. package/dist/test-resources/pages/AllTestElements.html +0 -39
  179. package/dist/test-resources/pages/Configuration.html +0 -18
  180. package/dist/test-resources/pages/ConfigurationScript.html +0 -34
  181. package/dist/test-resources/pages/assets/messagebundle_de.properties +0 -1
  182. package/dist/test-resources/pages/assets/messagebundle_en.properties +0 -1
  183. package/dist/test-resources/pages/assets/messagebundle_es.properties +0 -1
  184. package/dist/test-resources/pages/assets/messagebundle_fr.properties +0 -1
  185. package/dist/test-resources/pages/i18n.html +0 -35
  186. package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -27
  187. package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -63
  188. package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -47
  189. package/dist/test-resources/specs/CustomTheme.spec.js +0 -27
  190. package/dist/test-resources/specs/StaticArea.spec.js +0 -36
  191. package/dist/test-resources/specs/Theming.spec.js +0 -33
  192. package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -242
  193. package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -98
  194. package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -75
  195. package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -42
  196. package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -14
  197. package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -67
  198. package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -24
  199. package/dist/test-resources/specs/UI5ElementSlots.js +0 -36
  200. package/dist/theming/createThemePropertiesStyleTag.js +0 -20
  201. package/dist/util/encodeCSS.js +0 -24
  202. package/dist/util/findNodeOwner.js +0 -35
  203. package/src/config/AssetsPath.js +0 -17
  204. package/src/isLegacyBrowser.js +0 -3
  205. package/src/renderer/ifDefined.js +0 -21
  206. package/src/renderer/scopeHTML.js +0 -32
  207. package/src/theming/createThemePropertiesStyleTag.js +0 -20
  208. package/src/util/encodeCSS.js +0 -24
  209. package/src/util/findNodeOwner.js +0 -35
@@ -0,0 +1,110 @@
1
+ import { registerFeature } from "../FeaturesRegistry.js";
2
+ import { isF6Next, isF6Previous } from "../Keys.js";
3
+ import { getFirstFocusableElement } from "../util/FocusableElements.js";
4
+
5
+ class F6Navigation {
6
+ init() {
7
+ this.keydownHandler = this._keydownHandler.bind(this);
8
+ this.attachEventListeners();
9
+ this.selectedGroup = null;
10
+ this.groups = [];
11
+ }
12
+
13
+ attachEventListeners() {
14
+ document.addEventListener("keydown", this.keydownHandler);
15
+ }
16
+
17
+ async _keydownHandler(event) {
18
+ if (isF6Next(event)) {
19
+ this.updateGroups();
20
+ if (this.groups.length < 1) {
21
+ return;
22
+ }
23
+
24
+ event.preventDefault();
25
+
26
+ const nextIndex = this.groups.indexOf(this.selectedGroup);
27
+ let nextElement = null;
28
+
29
+ if (nextIndex > -1) {
30
+ if (nextIndex + 1 >= this.groups.length) {
31
+ nextElement = this.groups[0];
32
+ } else {
33
+ nextElement = this.groups[nextIndex + 1];
34
+ }
35
+ } else {
36
+ nextElement = this.groups[0];
37
+ }
38
+
39
+ const elementToFocus = await getFirstFocusableElement(nextElement.isUI5Element ? nextElement.getDomRef() : nextElement, true);
40
+ elementToFocus.focus();
41
+ }
42
+
43
+ if (isF6Previous(event)) {
44
+ this.updateGroups();
45
+ if (this.groups.length < 1) {
46
+ return;
47
+ }
48
+
49
+ event.preventDefault();
50
+
51
+ const nextIndex = this.groups.indexOf(this.selectedGroup);
52
+ let nextElement = null;
53
+
54
+ if (nextIndex > -1) {
55
+ if (nextIndex - 1 < 0) {
56
+ nextElement = this.groups[this.groups.length - 1];
57
+ } else {
58
+ // Handle the situation where the first focusable element of two neighbor groups is the same
59
+ // For example:
60
+ // <ui5-flexible-column-layout>
61
+ // <ui5-list>
62
+ // <ui5-li>List Item</ui5-li>
63
+ // </ui5-list>
64
+ // </ui5-flexible-column-layout>
65
+ // Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)
66
+
67
+ const firstFocusable = await getFirstFocusableElement(this.groups[nextIndex - 1], true);
68
+ const shouldSkipParent = firstFocusable === await getFirstFocusableElement(this.groups[nextIndex], true);
69
+
70
+ nextElement = this.groups[shouldSkipParent ? nextIndex - 2 : nextIndex - 1];
71
+ }
72
+ } else {
73
+ nextElement = this.groups[this.groups.length - 1];
74
+ }
75
+
76
+ const elementToFocus = await getFirstFocusableElement(nextElement.isUI5Element ? nextElement.getDomRef() : nextElement, true);
77
+ elementToFocus.focus();
78
+ }
79
+ }
80
+
81
+ removeEventListeners() {
82
+ document.removeEventListener("keydown", this.keydownHandler);
83
+ }
84
+
85
+ updateGroups() {
86
+ this.setSelectedGroup(document.activeElement);
87
+ this.setGroups();
88
+ }
89
+
90
+ setGroups() {
91
+ this.groups = Array.from(document.querySelectorAll("[data-sap-ui-fastnavgroup='true']")).filter(group => group.clientWidth && window.getComputedStyle(group).visibility !== "hidden");
92
+ }
93
+
94
+ setSelectedGroup(element) {
95
+ while (element && element.getAttribute("data-sap-ui-fastnavgroup") !== "true" && element !== document.querySelector("html")) {
96
+ element = element.parentElement ? element.parentNode : element.parentNode.host;
97
+ }
98
+
99
+ this.selectedGroup = element;
100
+ }
101
+
102
+ destroy() {
103
+ this.removeEventListeners();
104
+ }
105
+ }
106
+
107
+ const F6HelperInstance = new F6Navigation();
108
+ registerFeature("F6Navigation", F6HelperInstance);
109
+
110
+ export default F6Navigation;
@@ -0,0 +1,119 @@
1
+ import { registerFeature } from "../FeaturesRegistry.js";
2
+ import BusyIndicatorStyles from "../generated/css/BusyIndicator.css.js";
3
+ import merge from "../thirdparty/merge.js";
4
+ import {
5
+ isTabPrevious,
6
+ } from "../Keys.js";
7
+
8
+ const busyIndicatorMetadata = {
9
+ properties: {
10
+ __isBusy: {
11
+ type: Boolean,
12
+ },
13
+ },
14
+ };
15
+
16
+ const getBusyIndicatorStyles = () => {
17
+ return BusyIndicatorStyles;
18
+ };
19
+
20
+ const wrapTemplateResultInBusyMarkup = (html, host, templateResult) => {
21
+ if (host.isOpenUI5Component && host.__isBusy) {
22
+ templateResult = html`
23
+ <div class="busy-indicator-wrapper">
24
+ <span tabindex="0" busy-indicator-before-span @focusin=${host.__suppressFocusIn}></span>
25
+ ${templateResult}
26
+ <div class="busy-indicator-overlay"></div>
27
+ <div busy-indicator
28
+ class="busy-indicator-busy-area"
29
+ tabindex="0"
30
+ role="progressbar"
31
+ @keydown=${host.__suppressFocusBack}
32
+ aria-valuemin="0"
33
+ aria-valuemax="100"
34
+ aria-valuetext="Busy">
35
+ <div>
36
+ <div class="busy-indicator-circle circle-animation-0"></div>
37
+ <div class="busy-indicator-circle circle-animation-1"></div>
38
+ <div class="busy-indicator-circle circle-animation-2"></div>
39
+ </div>
40
+ </div>
41
+ </div>`;
42
+ }
43
+
44
+ return templateResult;
45
+ };
46
+
47
+ const enrichBusyIndicatorMetadata = UI5Element => {
48
+ UI5Element.metadata = merge(UI5Element.metadata, busyIndicatorMetadata);
49
+ };
50
+
51
+ const enrichBusyIndicatorMethods = UI5ElementPrototype => {
52
+ Object.defineProperties(UI5ElementPrototype, {
53
+ "__redirectFocus": { value: true, writable: true },
54
+ "__suppressFocusBack": {
55
+ get() {
56
+ const that = this;
57
+
58
+ return {
59
+ handleEvent: e => {
60
+ if (isTabPrevious(e)) {
61
+ const beforeElem = that.shadowRoot.querySelector("[busy-indicator-before-span]");
62
+ that.__redirectFocus = false;
63
+ beforeElem.focus();
64
+ that.__redirectFocus = true;
65
+ }
66
+ },
67
+ capture: true,
68
+ passive: false,
69
+ };
70
+ },
71
+ },
72
+ "isOpenUI5Component": { get: () => { return true; } },
73
+ });
74
+
75
+ UI5ElementPrototype.__suppressFocusIn = function handleFocusIn() {
76
+ const busyIndicator = this.shadowRoot.querySelector("[busy-indicator]");
77
+ if (busyIndicator && this.__redirectFocus) {
78
+ busyIndicator.focus();
79
+ }
80
+ };
81
+
82
+ UI5ElementPrototype.getDomRef = function getDomRef() {
83
+ // If a component set _getRealDomRef to its children, use the return value of this function
84
+ if (typeof this._getRealDomRef === "function") {
85
+ return this._getRealDomRef();
86
+ }
87
+
88
+ if (!this.shadowRoot || this.shadowRoot.children.length === 0) {
89
+ return;
90
+ }
91
+
92
+ const children = [...this.shadowRoot.children].filter(child => !["link", "style"].includes(child.localName));
93
+
94
+ if (children.length !== 1) {
95
+ console.warn(`The shadow DOM for ${this.constructor.getMetadata().getTag()} does not have a top level element, the getDomRef() method might not work as expected`); // eslint-disable-line
96
+ }
97
+
98
+ if (this.__isBusy) {
99
+ return children[0].querySelector(".busy-indicator-wrapper > :not([busy-indicator-before-span]):not(.busy-indicator-overlay):not(.busy-indicator-busy-area)");
100
+ }
101
+
102
+ return children[0];
103
+ };
104
+ };
105
+
106
+ const enrichBusyIndicatorSettings = UI5Element => {
107
+ enrichBusyIndicatorMetadata(UI5Element);
108
+ enrichBusyIndicatorMethods(UI5Element.prototype);
109
+ };
110
+
111
+ const OpenUI5Enablement = {
112
+ enrichBusyIndicatorSettings,
113
+ wrapTemplateResultInBusyMarkup,
114
+ getBusyIndicatorStyles,
115
+ };
116
+
117
+ export default OpenUI5Enablement;
118
+
119
+ registerFeature("OpenUI5Enablement", OpenUI5Enablement);
@@ -1,4 +1,4 @@
1
- const assetParameters = {"themes":{"default":"sap_fiori_3","all":["sap_fiori_3","sap_fiori_3_dark","sap_belize","sap_belize_hcb","sap_belize_hcw","sap_fiori_3_hcb","sap_fiori_3_hcw"]},"languages":{"default":"en","all":["ar","bg","ca","cs","cy","da","de","el","en","en_GB","en_US_sappsd","en_US_saprigi","en_US_saptrc","es","es_MX","et","fi","fr","fr_CA","hi","hr","hu","in","it","iw","ja","kk","ko","lt","lv","ms","nl","no","pl","pt_PT","pt","ro","ru","sh","sk","sl","sv","th","tr","uk","vi","zh_CN","zh_TW"]},"locales":{"default":"en","all":["ar","ar_EG","ar_SA","bg","ca","cs","da","de","de_AT","de_CH","el","el_CY","en","en_AU","en_GB","en_HK","en_IE","en_IN","en_NZ","en_PG","en_SG","en_ZA","es","es_AR","es_BO","es_CL","es_CO","es_MX","es_PE","es_UY","es_VE","et","fa","fi","fr","fr_BE","fr_CA","fr_CH","fr_LU","he","hi","hr","hu","id","it","it_CH","ja","kk","ko","lt","lv","ms","nb","nl","nl_BE","pl","pt","pt_PT","ro","ru","ru_UA","sk","sl","sr","sv","th","tr","uk","vi","zh_CN","zh_HK","zh_SG","zh_TW"]}};
1
+ const assetParameters = {"themes":{"default":"sap_fiori_3","all":["sap_fiori_3","sap_fiori_3_dark","sap_belize","sap_belize_hcb","sap_belize_hcw","sap_fiori_3_hcb","sap_fiori_3_hcw","sap_horizon","sap_horizon_dark","sap_horizon_hcb","sap_horizon_hcw","sap_horizon_exp"]},"languages":{"default":"en","all":["ar","bg","ca","cs","cy","da","de","el","en","en_GB","en_US_sappsd","en_US_saprigi","en_US_saptrc","es","es_MX","et","fi","fr","fr_CA","hi","hr","hu","in","it","iw","ja","kk","ko","lt","lv","ms","nl","no","pl","pt_PT","pt","ro","ru","sh","sk","sl","sv","th","tr","uk","vi","zh_CN","zh_TW"]},"locales":{"default":"en","all":["ar","ar_EG","ar_SA","bg","ca","cs","da","de","de_AT","de_CH","el","el_CY","en","en_AU","en_GB","en_HK","en_IE","en_IN","en_NZ","en_PG","en_SG","en_ZA","es","es_AR","es_BO","es_CL","es_CO","es_MX","es_PE","es_UY","es_VE","et","fa","fi","fr","fr_BE","fr_CA","fr_CH","fr_LU","he","hi","hr","hu","id","it","it_CH","ja","kk","ko","lt","lv","ms","nb","nl","nl_BE","pl","pt","pt_PT","ro","ru","ru_UA","sk","sl","sr","sr_Latn","sv","th","tr","uk","vi","zh_CN","zh_HK","zh_SG","zh_TW"]}};
2
2
 
3
3
  const DEFAULT_THEME = assetParameters.themes.default;
4
4
  const DEFAULT_LANGUAGE = assetParameters.languages.default;
@@ -0,0 +1,10 @@
1
+ const VersionInfo = {
2
+ version: "0.0.0-cf50976ce",
3
+ major: 0,
4
+ minor: 0,
5
+ patch: 0,
6
+ suffix: "-cf50976ce",
7
+ isNext: true,
8
+ buildTime: 1663566007,
9
+ };
10
+ export default VersionInfo;
@@ -0,0 +1,5 @@
1
+ export default {
2
+ packageName: "@ui5/webcomponents-base",
3
+ fileName: "BusyIndicator.css",
4
+ content: `.busy-indicator-wrapper{position:relative;height:100%;width:100%}.busy-indicator-overlay{display:var(--ui5_web_components_busy_indicator_display);position:absolute;inset:0;background:var(--ui5_web_components_busy_indicator_background-color);z-index:99}.busy-indicator-busy-area{display:var(--ui5_web_components_busy_indicator_display);position:absolute;z-index:99;inset:0;justify-content:center;align-items:center;background-color:inherit;flex-direction:column;color:var(--_ui5_busy_indicator_color)}:host([__is-busy]) .busy-indicator-wrapper>:not(.busy-indicator-busy-area):not(.busy-indicator-overlay):not([busy-indicator-before-span]){--ui5_web_components_busy_indicator_display:none}.busy-indicator-busy-area:focus{outline:var(--_ui5_busy_indicator_focus_outline);outline-offset:-.125rem}.busy-indicator-circle{width:1rem;height:1rem;display:inline-block;background-color:currentColor;border-radius:50%}.circle-animation-0{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11)}.circle-animation-1{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.2s}.circle-animation-2{animation:grow 1.6s infinite cubic-bezier(.32,.06,.85,1.11);animation-delay:.4s}.sapUiLocalBusy{--ui5_web_components_busy_indicator_display:none}.busy-indicator-wrapper [ui5-busy-indicator]{display:none}@keyframes grow{0%,100%,50%{-webkit-transform:scale(.5);-moz-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}25%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}`
5
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ packageName: "@ui5/webcomponents-base",
3
+ fileName: "FontFace.css",
4
+ content: `@font-face{font-family:"72";font-style:normal;font-weight:400;src:local("72"),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:400;src:local('72-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72";font-style:normal;font-weight:700;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:700;src:local('72-Bold-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Bold';font-style:normal;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Boldfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Light';font-style:normal;src:local('72-Light'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Lightfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72Black";font-style:bold;font-weight:900;src:local('72Black'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Black.woff2?ui5-webcomponents) format("woff2")}`
5
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ packageName: "@ui5/webcomponents-base",
3
+ fileName: "OverrideFontFace.css",
4
+ content: `@font-face{font-family:'72override';unicode-range:U+0102-0103,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EB7,U+1EB8-1EC7,U+1EC8-1ECB,U+1ECC-1EE3,U+1EE4-1EF1,U+1EF4-1EF7;src:local('Arial'),local('Helvetica'),local('sans-serif')}`
5
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ packageName: "@ui5/webcomponents-base",
3
+ fileName: "SystemCSSVars.css",
4
+ content: `:root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}[dir=rtl]{--_ui5_dir:rtl}[dir=ltr]{--_ui5_dir:ltr}`
5
+ };
@@ -3,6 +3,8 @@ import formatMessage from "./util/formatMessage.js";
3
3
 
4
4
  const I18nBundleInstances = new Map();
5
5
 
6
+ let customGetI18nBundle;
7
+
6
8
  /**
7
9
  * @class
8
10
  * @public
@@ -15,6 +17,7 @@ class I18nBundle {
15
17
  /**
16
18
  * Returns a text in the currently loaded language
17
19
  *
20
+ * @public
18
21
  * @param {Object|String} textObj key/defaultText pair or just the key
19
22
  * @param params Values for the placeholders
20
23
  * @returns {*}
@@ -34,11 +37,11 @@ class I18nBundle {
34
37
  }
35
38
  const messageText = bundle && bundle[textObj.key] ? bundle[textObj.key] : (textObj.defaultText || textObj.key);
36
39
 
37
- return formatMessage(messageText, params);
40
+ return params.length ? formatMessage(messageText, params) : messageText;
38
41
  }
39
42
  }
40
43
 
41
- const getI18nBundle = packageName => {
44
+ const getI18nBundleSync = packageName => {
42
45
  if (I18nBundleInstances.has(packageName)) {
43
46
  return I18nBundleInstances.get(packageName);
44
47
  }
@@ -48,8 +51,36 @@ const getI18nBundle = packageName => {
48
51
  return i18nBundle;
49
52
  };
50
53
 
54
+ /**
55
+ * Allows developers to provide a custom getI18nBundle implementation
56
+ * If this function is called, the custom implementation will be used for all components and will completely
57
+ * replace the default implementation.
58
+ *
59
+ * @public
60
+ * @param customGet the function to use instead of the standard getI18nBundle implementation
61
+ */
62
+ const registerCustomI18nBundleGetter = customGet => {
63
+ customGetI18nBundle = customGet;
64
+ };
65
+
66
+ /**
67
+ * Fetches and returns the I18nBundle instance for the given package
68
+ *
69
+ * @public
70
+ * @param packageName
71
+ * @returns {Promise<I18nBundle>}
72
+ */
73
+ const getI18nBundle = async packageName => {
74
+ if (customGetI18nBundle) {
75
+ return customGetI18nBundle(packageName);
76
+ }
77
+
78
+ await fetchI18nBundle(packageName);
79
+ return getI18nBundleSync(packageName);
80
+ };
81
+
51
82
  export {
52
83
  registerI18nLoader,
53
- fetchI18nBundle,
54
84
  getI18nBundle,
85
+ registerCustomI18nBundleGetter,
55
86
  };
@@ -1,31 +1,52 @@
1
- import { html, svg, render } from "lit-html/lit-html.js";
2
- import scopeHTML from "./scopeHTML.js";
1
+ import {
2
+ render,
3
+ html,
4
+ svg,
5
+ } from "lit-html";
6
+ import { getFeature } from "../FeaturesRegistry.js";
3
7
 
4
- let tags;
5
- let suffix;
6
-
7
- const setTags = t => {
8
- tags = t;
8
+ const effectiveHtml = (...args) => {
9
+ const LitStatic = getFeature("LitStatic");
10
+ const fn = LitStatic ? LitStatic.html : html;
11
+ return fn(...args);
9
12
  };
10
- const setSuffix = s => {
11
- suffix = s;
13
+
14
+ const effectiveSvg = (...args) => {
15
+ const LitStatic = getFeature("LitStatic");
16
+ const fn = LitStatic ? LitStatic.svg : svg;
17
+ return fn(...args);
12
18
  };
13
19
 
14
- const litRender = (templateResult, domNode, styles, { eventContext } = {}) => {
15
- if (styles) {
16
- templateResult = html`<style>${styles}</style>${templateResult}`;
20
+ const litRender = (templateResult, domNode, styleStrOrHrefsArr, forStaticArea, { host } = {}) => {
21
+ const OpenUI5Enablement = getFeature("OpenUI5Enablement");
22
+ if (OpenUI5Enablement && !forStaticArea) {
23
+ templateResult = OpenUI5Enablement.wrapTemplateResultInBusyMarkup(effectiveHtml, host, templateResult);
24
+ }
25
+
26
+ if (typeof styleStrOrHrefsArr === "string") {
27
+ templateResult = effectiveHtml`<style>${styleStrOrHrefsArr}</style>${templateResult}`;
28
+ } else if (Array.isArray(styleStrOrHrefsArr) && styleStrOrHrefsArr.length) {
29
+ templateResult = effectiveHtml`${styleStrOrHrefsArr.map(href => effectiveHtml`<link type="text/css" rel="stylesheet" href="${href}">`)}${templateResult}`;
17
30
  }
18
- render(templateResult, domNode, { eventContext });
31
+ render(templateResult, domNode, { host });
19
32
  };
20
33
 
21
- const scopedHtml = (strings, ...values) => html(scopeHTML(strings, tags, suffix), ...values);
22
- const scopedSvg = (strings, ...values) => svg(scopeHTML(strings, tags, suffix), ...values);
34
+ const scopeTag = (tag, tags, suffix) => {
35
+ const LitStatic = getFeature("LitStatic");
36
+ if (LitStatic) {
37
+ return LitStatic.unsafeStatic((tags || []).includes(tag) ? `${tag}-${suffix}` : tag);
38
+ }
39
+ };
23
40
 
24
- export { setTags, setSuffix };
25
- export { scopedHtml as html, scopedSvg as svg };
41
+ export {
42
+ effectiveHtml as html,
43
+ effectiveSvg as svg,
44
+ };
45
+ export { scopeTag };
26
46
  export { repeat } from "lit-html/directives/repeat.js";
27
47
  export { classMap } from "lit-html/directives/class-map.js";
28
- export { styleMap } from "lit-html/directives/style-map.js";
48
+ export { styleMap } from "./directives/style-map.js";
49
+ export { ifDefined } from "lit-html/directives/if-defined.js";
29
50
  export { unsafeHTML } from "lit-html/directives/unsafe-html.js";
30
51
 
31
52
  export default litRender;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ /**
8
+ * This is the original style-map.js directive from lit-html 2 with the only difference that "render" is not called even for the first rendering (update is used instead)
9
+ */
10
+
11
+ import { noChange } from 'lit-html';
12
+ import { directive, Directive, PartType, } from 'lit-html/directive.js';
13
+ class StyleMapDirective extends Directive {
14
+ constructor(partInfo) {
15
+ var _a;
16
+ super(partInfo);
17
+ if (partInfo.type !== PartType.ATTRIBUTE ||
18
+ partInfo.name !== 'style' ||
19
+ ((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
20
+ throw new Error('The `styleMap` directive must be used in the `style` attribute ' +
21
+ 'and must be the only part in the attribute.');
22
+ }
23
+ }
24
+ render(styleInfo) {
25
+ return "";
26
+ }
27
+ update(part, [styleInfo]) {
28
+ const { style } = part.element;
29
+ if (this._previousStyleProperties === undefined) {
30
+ this._previousStyleProperties = new Set();
31
+ for (const name in styleInfo) {
32
+ this._previousStyleProperties.add(name);
33
+ }
34
+ // return this.render(styleInfo);
35
+ }
36
+ // Remove old properties that no longer exist in styleInfo
37
+ // We use forEach() instead of for-of so that re don't require down-level
38
+ // iteration.
39
+ this._previousStyleProperties.forEach((name) => {
40
+ // If the name isn't in styleInfo or it's null/undefined
41
+ if (styleInfo[name] == null) {
42
+ this._previousStyleProperties.delete(name);
43
+ if (name.includes('-')) {
44
+ style.removeProperty(name);
45
+ }
46
+ else {
47
+ // Note reset using empty string (vs null) as IE11 does not always
48
+ // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ style[name] = '';
51
+ }
52
+ }
53
+ });
54
+ // Add or update properties
55
+ for (const name in styleInfo) {
56
+ const value = styleInfo[name];
57
+ if (value != null) {
58
+ this._previousStyleProperties.add(name);
59
+ if (name.includes('-')) {
60
+ style.setProperty(name, value);
61
+ }
62
+ else {
63
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
+ style[name] = value;
65
+ }
66
+ }
67
+ }
68
+ return noChange;
69
+ }
70
+ }
71
+
72
+ export const styleMap = directive(StyleMapDirective);
@@ -1,4 +1,4 @@
1
- import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from "../CustomElementsScope.js";
1
+ import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from "../CustomElementsScopeUtils.js";
2
2
 
3
3
  /**
4
4
  * Runs a component's template with the component's current state, while also scoping HTML
@@ -9,9 +9,26 @@ import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from "../Cus
9
9
  * @returns {*}
10
10
  */
11
11
  const executeTemplate = (template, component) => {
12
- const tagsToScope = component.constructor.getUniqueDependencies().map(dep => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);
12
+ const tagsToScope = getTagsToScope(component);
13
13
  const scope = getCustomElementsScopingSuffix();
14
14
  return template(component, tagsToScope, scope);
15
15
  };
16
16
 
17
+ /**
18
+ * Returns all tags, used inside component's template subject to scoping.
19
+ * @param component - the component
20
+ * @returns {Array[]}
21
+ * @private
22
+ */
23
+ const getTagsToScope = component => {
24
+ const componentTag = component.constructor.getMetadata().getPureTag();
25
+ const tagsToScope = component.constructor.getUniqueDependencies().map(dep => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);
26
+
27
+ if (shouldScopeCustomElement(componentTag)) {
28
+ tagsToScope.push(componentTag);
29
+ }
30
+
31
+ return tagsToScope;
32
+ };
33
+
17
34
  export default executeTemplate;