@ui5/webcomponents-base 1.12.0-rc.1 → 1.12.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/.eslintrc.js +3 -0
  2. package/CHANGELOG.md +19 -0
  3. package/dist/AssetRegistry.js.map +1 -1
  4. package/dist/Boot.js +14 -0
  5. package/dist/Boot.js.map +1 -1
  6. package/dist/CSP.js.map +1 -1
  7. package/dist/CustomElementsRegistry.js.map +1 -1
  8. package/dist/CustomElementsScope.js.map +1 -1
  9. package/dist/CustomElementsScopeUtils.js.map +1 -1
  10. package/dist/DOMObserver.js.map +1 -1
  11. package/dist/Device.js.map +1 -1
  12. package/dist/EventProvider.js.map +1 -1
  13. package/dist/FeaturesRegistry.js.map +1 -1
  14. package/dist/FontFace.js.map +1 -1
  15. package/dist/InitialConfiguration.js.map +1 -1
  16. package/dist/Keys.js.map +1 -1
  17. package/dist/ManagedStyles.js.map +1 -1
  18. package/dist/MarkedEvents.js.map +1 -1
  19. package/dist/MediaRange.js.map +1 -1
  20. package/dist/PropertiesFileFormat.js.map +1 -1
  21. package/dist/Render.js.map +1 -1
  22. package/dist/RenderQueue.js.map +1 -1
  23. package/dist/Runtimes.js.map +1 -1
  24. package/dist/StaticArea.js.map +1 -1
  25. package/dist/StaticAreaItem.js.map +1 -1
  26. package/dist/SystemCSSVars.js.map +1 -1
  27. package/dist/Theming.js.map +1 -1
  28. package/dist/UI5Element.js.map +1 -1
  29. package/dist/UI5ElementMetadata.js.map +1 -1
  30. package/dist/animations/AnimationQueue.js.map +1 -1
  31. package/dist/animations/animate.js.map +1 -1
  32. package/dist/animations/scroll.js.map +1 -1
  33. package/dist/animations/slideDown.js.map +1 -1
  34. package/dist/animations/slideUp.js.map +1 -1
  35. package/dist/asset-registries/Icons.d.ts +6 -6
  36. package/dist/asset-registries/Icons.js +1 -1
  37. package/dist/asset-registries/Icons.js.map +1 -1
  38. package/dist/asset-registries/Illustrations.js.map +1 -1
  39. package/dist/asset-registries/LocaleData.js.map +1 -1
  40. package/dist/asset-registries/Themes.js +2 -0
  41. package/dist/asset-registries/Themes.js.map +1 -1
  42. package/dist/asset-registries/i18n.js +9 -3
  43. package/dist/asset-registries/i18n.js.map +1 -1
  44. package/dist/assets/Boot.0f056029.js +9 -0
  45. package/dist/assets/Boot.34b7cea0.css +1 -0
  46. package/dist/assets/{bundle.esm.31092611.js → bundle.esm.90296f02.js} +1 -1
  47. package/dist/assets/test/pages/Boot.html.a40788ce.js +1 -0
  48. package/dist/assets/test/pages/{i18n.html.ae9cb4a6.js → i18n.html.65058ddf.js} +1 -1
  49. package/dist/assets/test/pages/{i18n_texts.html.3f536773.js → i18n_texts.html.4d80a4fd.js} +1 -1
  50. package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
  51. package/dist/config/AnimationMode.js.map +1 -1
  52. package/dist/config/CalendarType.js.map +1 -1
  53. package/dist/config/FormatSettings.js.map +1 -1
  54. package/dist/config/Icons.js.map +1 -1
  55. package/dist/config/Language.d.ts +10 -1
  56. package/dist/config/Language.js +13 -1
  57. package/dist/config/Language.js.map +1 -1
  58. package/dist/config/NoConflict.js.map +1 -1
  59. package/dist/config/RTL.js.map +1 -1
  60. package/dist/config/Theme.d.ts +10 -1
  61. package/dist/config/Theme.js +13 -1
  62. package/dist/config/Theme.js.map +1 -1
  63. package/dist/config/ThemeRoots.js.map +1 -1
  64. package/dist/decorators/customElement.js.map +1 -1
  65. package/dist/decorators/event.js.map +1 -1
  66. package/dist/decorators/property.js.map +1 -1
  67. package/dist/decorators/slot.js.map +1 -1
  68. package/dist/delegate/ItemNavigation.js.map +1 -1
  69. package/dist/delegate/ResizeHandler.js.map +1 -1
  70. package/dist/delegate/ScrollEnablement.js.map +1 -1
  71. package/dist/features/F6Navigation.js.map +1 -1
  72. package/dist/features/LegacyDateFormats.js.map +1 -1
  73. package/dist/features/OpenUI5Element.js.map +1 -1
  74. package/dist/features/OpenUI5Enablement.js.map +1 -1
  75. package/dist/features/OpenUI5Support.js.map +1 -1
  76. package/dist/generated/VersionInfo.js +3 -3
  77. package/dist/generated/css/BusyIndicator.css.js.map +1 -1
  78. package/dist/generated/css/FontFace.css.js.map +1 -1
  79. package/dist/generated/css/OverrideFontFace.css.js.map +1 -1
  80. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  81. package/dist/getSharedResource.js.map +1 -1
  82. package/dist/i18nBundle.js.map +1 -1
  83. package/dist/locale/Locale.js.map +1 -1
  84. package/dist/locale/RTLAwareRegistry.js.map +1 -1
  85. package/dist/locale/applyDirection.js.map +1 -1
  86. package/dist/locale/directionChange.js.map +1 -1
  87. package/dist/locale/getEffectiveDir.js.map +1 -1
  88. package/dist/locale/getLocale.js.map +1 -1
  89. package/dist/locale/languageChange.js.map +1 -1
  90. package/dist/locale/nextFallbackLocale.js.map +1 -1
  91. package/dist/locale/normalizeLocale.js.map +1 -1
  92. package/dist/renderer/LitRenderer.js.map +1 -1
  93. package/dist/renderer/executeTemplate.js.map +1 -1
  94. package/dist/test/pages/AllTestElements.html +2 -2
  95. package/dist/test/pages/Boot.html +4 -4
  96. package/dist/test/pages/Configuration.html +2 -2
  97. package/dist/test/pages/ConfigurationScript.html +2 -2
  98. package/dist/test/pages/WithComplexTemplate.html +2 -2
  99. package/dist/test/pages/i18n.html +3 -3
  100. package/dist/test/pages/i18n_texts.html +3 -3
  101. package/dist/theming/CustomStyle.js.map +1 -1
  102. package/dist/theming/ThemeLoaded.js.map +1 -1
  103. package/dist/theming/ThemeRegistered.d.ts +4 -0
  104. package/dist/theming/ThemeRegistered.js +11 -0
  105. package/dist/theming/ThemeRegistered.js.map +1 -0
  106. package/dist/theming/applyTheme.js.map +1 -1
  107. package/dist/theming/getConstructableStyle.js.map +1 -1
  108. package/dist/theming/getEffectiveLinksHrefs.js.map +1 -1
  109. package/dist/theming/getEffectiveStyle.js.map +1 -1
  110. package/dist/theming/getStylesString.js.map +1 -1
  111. package/dist/theming/getThemeDesignerTheme.js.map +1 -1
  112. package/dist/theming/preloadLinks.js.map +1 -1
  113. package/dist/thirdparty/_merge.js.map +1 -1
  114. package/dist/thirdparty/isPlainObject.js.map +1 -1
  115. package/dist/thirdparty/merge.js.map +1 -1
  116. package/dist/types/AnimationMode.js.map +1 -1
  117. package/dist/types/CSSColor.js.map +1 -1
  118. package/dist/types/CalendarType.js.map +1 -1
  119. package/dist/types/DOMReference.js.map +1 -1
  120. package/dist/types/DataType.js.map +1 -1
  121. package/dist/types/Float.js.map +1 -1
  122. package/dist/types/Integer.js.map +1 -1
  123. package/dist/types/InvisibleMessageMode.js.map +1 -1
  124. package/dist/types/ItemNavigationBehavior.js.map +1 -1
  125. package/dist/types/NavigationMode.js.map +1 -1
  126. package/dist/types/ValueState.js.map +1 -1
  127. package/dist/types.js.map +1 -1
  128. package/dist/updateShadowRoot.js.map +1 -1
  129. package/dist/util/AriaLabelHelper.js.map +1 -1
  130. package/dist/util/Caret.js.map +1 -1
  131. package/dist/util/ColorConversion.js.map +1 -1
  132. package/dist/util/FetchHelper.js.map +1 -1
  133. package/dist/util/FocusableElements.js.map +1 -1
  134. package/dist/util/HTMLSanitizer.js.map +1 -1
  135. package/dist/util/InvisibleMessage.js.map +1 -1
  136. package/dist/util/PopupUtils.js.map +1 -1
  137. package/dist/util/SlotsHelper.js.map +1 -1
  138. package/dist/util/StringHelper.js.map +1 -1
  139. package/dist/util/TabbableElements.js.map +1 -1
  140. package/dist/util/arraysAreEqual.js.map +1 -1
  141. package/dist/util/clamp.js.map +1 -1
  142. package/dist/util/createLinkInHead.js.map +1 -1
  143. package/dist/util/createStyleInHead.js.map +1 -1
  144. package/dist/util/debounce.js.map +1 -1
  145. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  146. package/dist/util/escapeRegex.js.map +1 -1
  147. package/dist/util/formatMessage.js.map +1 -1
  148. package/dist/util/generateHighlightedMarkup.js.map +1 -1
  149. package/dist/util/getActiveElement.js.map +1 -1
  150. package/dist/util/getClassCopy.js.map +1 -1
  151. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  152. package/dist/util/getEffectiveContentDensity.js.map +1 -1
  153. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
  154. package/dist/util/getFastNavigationGroups.js.map +1 -1
  155. package/dist/util/getFileExtension.js.map +1 -1
  156. package/dist/util/getNormalizedTarget.js.map +1 -1
  157. package/dist/util/getSingletonElementInstance.js.map +1 -1
  158. package/dist/util/isElementClickable.js.map +1 -1
  159. package/dist/util/isElementHidden.js.map +1 -1
  160. package/dist/util/isElementInView.js.map +1 -1
  161. package/dist/util/isElementTabbable.js.map +1 -1
  162. package/dist/util/isValidPropertyName.js.map +1 -1
  163. package/dist/util/whenDOMReady.js.map +1 -1
  164. package/dist/util/willShowContent.js.map +1 -1
  165. package/dist/validateThemeRoot.js.map +1 -1
  166. package/package-scripts.js +1 -2
  167. package/package.json +3 -3
  168. package/tsconfig.json +1 -0
  169. package/dist/assets/Boot.3c90c777.js +0 -9
  170. package/dist/assets/Boot.6335ce08.css +0 -1
  171. package/dist/assets/test/pages/Boot.html.7497ea3e.js +0 -1
  172. package/src/AssetRegistry.ts +0 -11
  173. package/src/Boot.ts +0 -76
  174. package/src/CSP.ts +0 -66
  175. package/src/CustomElementsRegistry.ts +0 -98
  176. package/src/CustomElementsScope.ts +0 -33
  177. package/src/CustomElementsScopeUtils.ts +0 -115
  178. package/src/DOMObserver.ts +0 -28
  179. package/src/Device.ts +0 -203
  180. package/src/EventProvider.ts +0 -87
  181. package/src/FeaturesRegistry.ts +0 -14
  182. package/src/FontFace.ts +0 -31
  183. package/src/InitialConfiguration.ts +0 -207
  184. package/src/Keys.ts +0 -295
  185. package/src/ManagedStyles.ts +0 -92
  186. package/src/MarkedEvents.ts +0 -20
  187. package/src/MediaRange.ts +0 -110
  188. package/src/PropertiesFileFormat.ts +0 -95
  189. package/src/Render.ts +0 -180
  190. package/src/RenderQueue.ts +0 -71
  191. package/src/Runtimes.ts +0 -114
  192. package/src/StaticArea.ts +0 -3
  193. package/src/StaticAreaItem.ts +0 -113
  194. package/src/SystemCSSVars.ts +0 -10
  195. package/src/Theming.ts +0 -4
  196. package/src/UI5Element.ts +0 -1159
  197. package/src/UI5ElementMetadata.ts +0 -389
  198. package/src/animations/AnimationQueue.ts +0 -43
  199. package/src/animations/animate.ts +0 -64
  200. package/src/animations/scroll.ts +0 -21
  201. package/src/animations/slideDown.ts +0 -72
  202. package/src/animations/slideUp.ts +0 -67
  203. package/src/asset-registries/Icons.ts +0 -161
  204. package/src/asset-registries/Illustrations.ts +0 -75
  205. package/src/asset-registries/LocaleData.ts +0 -172
  206. package/src/asset-registries/Themes.ts +0 -72
  207. package/src/asset-registries/i18n.ts +0 -118
  208. package/src/assets-meta/IconCollectionsAlias.ts +0 -41
  209. package/src/config/AnimationMode.ts +0 -33
  210. package/src/config/CalendarType.ts +0 -23
  211. package/src/config/FormatSettings.ts +0 -35
  212. package/src/config/Icons.ts +0 -126
  213. package/src/config/Language.ts +0 -72
  214. package/src/config/NoConflict.ts +0 -67
  215. package/src/config/RTL.ts +0 -45
  216. package/src/config/Theme.ts +0 -64
  217. package/src/config/ThemeRoots.ts +0 -41
  218. package/src/decorators/customElement.ts +0 -57
  219. package/src/decorators/event.ts +0 -28
  220. package/src/decorators/property.ts +0 -30
  221. package/src/decorators/slot.ts +0 -49
  222. package/src/delegate/ItemNavigation.ts +0 -393
  223. package/src/delegate/ResizeHandler.ts +0 -100
  224. package/src/delegate/ScrollEnablement.ts +0 -224
  225. package/src/features/F6Navigation.ts +0 -195
  226. package/src/features/LegacyDateFormats.ts +0 -40
  227. package/src/features/OpenUI5Element.ts +0 -11
  228. package/src/features/OpenUI5Enablement.ts +0 -117
  229. package/src/features/OpenUI5Support.ts +0 -153
  230. package/src/generated/css/BusyIndicator.css.ts +0 -9
  231. package/src/generated/css/FontFace.css.ts +0 -9
  232. package/src/generated/css/OverrideFontFace.css.ts +0 -9
  233. package/src/generated/css/SystemCSSVars.css.ts +0 -9
  234. package/src/getSharedResource.ts +0 -39
  235. package/src/global.d.ts +0 -38
  236. package/src/i18nBundle.ts +0 -108
  237. package/src/locale/Locale.ts +0 -101
  238. package/src/locale/RTLAwareRegistry.ts +0 -16
  239. package/src/locale/applyDirection.ts +0 -18
  240. package/src/locale/directionChange.ts +0 -34
  241. package/src/locale/getEffectiveDir.ts +0 -28
  242. package/src/locale/getLocale.ts +0 -46
  243. package/src/locale/languageChange.ts +0 -24
  244. package/src/locale/nextFallbackLocale.ts +0 -28
  245. package/src/locale/normalizeLocale.ts +0 -56
  246. package/src/renderer/LitRenderer.ts +0 -60
  247. package/src/renderer/executeTemplate.ts +0 -40
  248. package/src/theming/CustomStyle.ts +0 -64
  249. package/src/theming/ThemeLoaded.ts +0 -24
  250. package/src/theming/applyTheme.ts +0 -90
  251. package/src/theming/getConstructableStyle.ts +0 -31
  252. package/src/theming/getEffectiveLinksHrefs.ts +0 -26
  253. package/src/theming/getEffectiveStyle.ts +0 -41
  254. package/src/theming/getStylesString.ts +0 -15
  255. package/src/theming/getThemeDesignerTheme.ts +0 -101
  256. package/src/theming/preloadLinks.ts +0 -24
  257. package/src/thirdparty/_merge.ts +0 -32
  258. package/src/thirdparty/isPlainObject.ts +0 -18
  259. package/src/thirdparty/merge.ts +0 -5
  260. package/src/types/AnimationMode.ts +0 -33
  261. package/src/types/CSSColor.ts +0 -19
  262. package/src/types/CalendarType.ts +0 -38
  263. package/src/types/DOMReference.ts +0 -28
  264. package/src/types/DataType.ts +0 -51
  265. package/src/types/Float.ts +0 -24
  266. package/src/types/Integer.ts +0 -24
  267. package/src/types/InvisibleMessageMode.ts +0 -27
  268. package/src/types/ItemNavigationBehavior.ts +0 -26
  269. package/src/types/NavigationMode.ts +0 -33
  270. package/src/types/ValueState.ts +0 -47
  271. package/src/types.ts +0 -30
  272. package/src/updateShadowRoot.ts +0 -42
  273. package/src/util/AriaLabelHelper.ts +0 -218
  274. package/src/util/Caret.ts +0 -28
  275. package/src/util/ColorConversion.ts +0 -399
  276. package/src/util/FetchHelper.ts +0 -31
  277. package/src/util/FocusableElements.ts +0 -92
  278. package/src/util/HTMLSanitizer.ts +0 -9
  279. package/src/util/InvisibleMessage.ts +0 -69
  280. package/src/util/PopupUtils.ts +0 -112
  281. package/src/util/SlotsHelper.ts +0 -39
  282. package/src/util/StringHelper.ts +0 -26
  283. package/src/util/TabbableElements.ts +0 -70
  284. package/src/util/arraysAreEqual.ts +0 -15
  285. package/src/util/clamp.ts +0 -12
  286. package/src/util/createLinkInHead.ts +0 -25
  287. package/src/util/createStyleInHead.ts +0 -20
  288. package/src/util/debounce.ts +0 -18
  289. package/src/util/detectNavigatorLanguage.ts +0 -13
  290. package/src/util/escapeRegex.ts +0 -11
  291. package/src/util/formatMessage.ts +0 -24
  292. package/src/util/generateHighlightedMarkup.ts +0 -43
  293. package/src/util/getActiveElement.ts +0 -11
  294. package/src/util/getClassCopy.ts +0 -12
  295. package/src/util/getDesigntimePropertyAsArray.ts +0 -4
  296. package/src/util/getEffectiveContentDensity.ts +0 -5
  297. package/src/util/getEffectiveScrollbarStyle.ts +0 -5
  298. package/src/util/getFastNavigationGroups.ts +0 -63
  299. package/src/util/getFileExtension.ts +0 -21
  300. package/src/util/getNormalizedTarget.ts +0 -16
  301. package/src/util/getSingletonElementInstance.ts +0 -13
  302. package/src/util/isElementClickable.ts +0 -19
  303. package/src/util/isElementHidden.ts +0 -9
  304. package/src/util/isElementInView.ts +0 -15
  305. package/src/util/isElementTabbable.ts +0 -37
  306. package/src/util/isValidPropertyName.ts +0 -29
  307. package/src/util/whenDOMReady.ts +0 -13
  308. package/src/util/willShowContent.ts +0 -7
  309. package/src/validateThemeRoot.ts +0 -58
@@ -1,35 +0,0 @@
1
- import LegacyDateFormats from "../features/LegacyDateFormats.js";
2
- import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
3
- import { getFormatSettings } from "../InitialConfiguration.js";
4
- import { getFeature } from "../FeaturesRegistry.js";
5
-
6
- type FormatSettings = {
7
- firstDayOfWeek?: number,
8
- legacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,
9
- };
10
-
11
- let formatSettings: FormatSettings;
12
-
13
- /**
14
- * Returns the first day of the week from the configured format settings or based on the current locale.
15
- * @public
16
- * @returns {Number} 0 (Sunday) through 6 (Saturday)
17
- */
18
- const getFirstDayOfWeek = (): number | undefined => {
19
- if (formatSettings === undefined) {
20
- formatSettings = getFormatSettings();
21
- }
22
-
23
- return formatSettings.firstDayOfWeek;
24
- };
25
-
26
- const legacyDateFormats = getFeature<typeof LegacyDateFormats>("LegacyDateFormats");
27
-
28
- const getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };
29
-
30
- export {
31
- getFirstDayOfWeek,
32
- getLegacyDateCalendarCustomizing,
33
- };
34
-
35
- export type { FormatSettings };
@@ -1,126 +0,0 @@
1
- import { getTheme, isThemeFamily } from "./Theme.js";
2
- import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
3
-
4
- const IconCollectionConfiguration = new Map<string, string>();
5
-
6
- // All supported icon collections + unknown custom ones
7
- type IconCollection = "SAP-icons" | "SAP-icons-v4" | "SAP-icons-v5" | "horizon" | "tnt" | "tnt-v2" | "tnt-v3" | "business-suite" | "business-suite-v1" | "business-suite-v2" | string;
8
-
9
- // All registered icon collections - all icon collections resolves to these options at the end
10
- enum RegisteredIconCollection {
11
- SAPIconsV4 = "SAP-icons-v4",
12
- SAPIconsV5 = "SAP-icons-v5",
13
- SAPIconsTNTV2 = "tnt-v2",
14
- SAPIconsTNTV3 = "tnt-v3",
15
- SAPBSIconsV1 = "business-suite-v1",
16
- SAPBSIconsV2 = "business-suite-v2",
17
- }
18
-
19
- /**
20
- * Sets the default icon collection for a given theme.
21
- *
22
- * SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)
23
- * and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: "tnt/actor", "business-suite/1x2-grid-layout", etc.
24
- * This method allows setting another (built-in or custom) icon collection as default per theme.
25
- *
26
- * <b>Usage</b>
27
- * <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
28
- *
29
- * <pre>
30
- * setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
31
- *
32
- * <ui5-icon name="home"></ui5-icon>
33
- * </pre>
34
- *
35
- * <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
36
- *
37
- * <pre>
38
- * setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
39
- *
40
- * <ui5-icon name="custom-icon-name"></ui5-icon>
41
- * </pre>
42
- *
43
- * @public
44
- * @param { string } theme
45
- * @param { string } collectionName
46
- */
47
- const setDefaultIconCollection = (theme: string, collectionName: IconCollection) => {
48
- IconCollectionConfiguration.set(theme, collectionName);
49
- };
50
-
51
- /**
52
- * Returns the configured default icon collection for a given theme.
53
- *
54
- * @param { string } theme
55
- * @public
56
- * @returns { string | undefined }
57
- */
58
- const getDefaultIconCollection = (theme: string): string | undefined => {
59
- return IconCollectionConfiguration.get(theme);
60
- };
61
-
62
- /**
63
- * Returns the effective icon collection,
64
- * based on the default icon collection configuration and the current theme:
65
- * @param { IconCollection } collectionName
66
- * @returns { IconCollection } the effective collection name
67
- */
68
- const getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {
69
- const currentTheme = getTheme();
70
- const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
71
-
72
- // when no collection is set and default collection is configured - return the configured icon collection
73
- if (!collectionName && currentThemeConfiguration) {
74
- return getIconCollectionByAlias(currentThemeConfiguration);
75
- }
76
-
77
- // when collection is set - return the theme dependant icon collection
78
- // when collection is not set and there is no default icon collection configured - return theme dependant icon collection
79
- return getIconCollectionByTheme(collectionName);
80
- };
81
-
82
- /**
83
- * Returns the icon theme dependant collection, based on the collection name and current theme as follows:
84
- *
85
- * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon" (or as confugred via setDefaultIconCollection)
86
- * - "SAP-icons-v4" (and its alias "SAP-icons") forces "SAP-icons v4" in any theme and resolves to itself "SAP-icons-v4"
87
- * - "SAP-icons-v5" (and its alias "horizon") forces "SAP-icons v5" in any theme and resolves to itself "SAP-icons-v5"
88
- * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
89
- * - "tnt-v2" forces "TNT icons v2" in any theme and resolves to itself "tnt-v2"
90
- * - "tnt-v3" forces "TNT icons v3" in any theme and resolves to itself "tnt-v3"
91
- * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
92
- * - "business-suite-v1" forces "Business Suite icons v1" in any theme and resolves to itself "business-suite-v1"
93
- * - "business-suite-v2" forces "Business Suite icons v2" in any theme and resolves to itself "business-suite-v2"
94
- *
95
- * <b>Note:</b> "SAP-icons-v4", "SAP-icons-v5", "tnt-v2", "tnt-v3", "business-suite-v1" and "business-suite-v2" are just returned
96
- * @param { IconCollection } collectionName
97
- * @returns { RegisteredIconCollection } the registered collection name
98
- */
99
- const getIconCollectionByTheme = (collectionName?: IconCollection): RegisteredIconCollection => {
100
- const horizonThemeFamily = isThemeFamily("sap_horizon");
101
-
102
- if (!collectionName) {
103
- return horizonThemeFamily ? RegisteredIconCollection.SAPIconsV5 : RegisteredIconCollection.SAPIconsV4;
104
- }
105
-
106
- if (collectionName === "tnt") {
107
- return horizonThemeFamily ? RegisteredIconCollection.SAPIconsTNTV3 : RegisteredIconCollection.SAPIconsTNTV2;
108
- }
109
-
110
- if (collectionName === "business-suite") {
111
- return horizonThemeFamily ? RegisteredIconCollection.SAPBSIconsV2 : RegisteredIconCollection.SAPBSIconsV1;
112
- }
113
-
114
- return collectionName as RegisteredIconCollection;
115
- };
116
-
117
- export {
118
- setDefaultIconCollection,
119
- getDefaultIconCollection,
120
- getEffectiveIconCollection,
121
- RegisteredIconCollection,
122
- };
123
-
124
- export type {
125
- IconCollection,
126
- };
@@ -1,72 +0,0 @@
1
- import {
2
- getLanguage as getConfiguredLanguage,
3
- getFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,
4
- } from "../InitialConfiguration.js";
5
- import { fireLanguageChange } from "../locale/languageChange.js";
6
- import { reRenderAllUI5Elements } from "../Render.js";
7
-
8
- let curLanguage: string | undefined;
9
- let fetchDefaultLanguage: boolean;
10
-
11
- /**
12
- * Returns the currently configured language, or the browser language as a fallback.
13
- * @public
14
- * @returns {string}
15
- */
16
- const getLanguage = (): string | undefined => {
17
- if (curLanguage === undefined) {
18
- curLanguage = getConfiguredLanguage();
19
- }
20
- return curLanguage;
21
- };
22
-
23
- /**
24
- * Changes the current language, re-fetches all message bundles, updates all language-aware components
25
- * and returns a promise that resolves when all rendering is done.
26
- *
27
- * @param {string} language
28
- * @public
29
- * @returns {Promise<void>}
30
- */
31
- const setLanguage = async (language: string): Promise<void> => {
32
- if (curLanguage === language) {
33
- return;
34
- }
35
-
36
- curLanguage = language;
37
-
38
- await fireLanguageChange(language);
39
- await reRenderAllUI5Elements({ languageAware: true });
40
- };
41
-
42
- /**
43
- * Defines if the default language, that is inlined, should be
44
- * fetched over the network instead of using the inlined one.
45
- * <b>Note:</b> By default the language will not be fetched.
46
- *
47
- * @public
48
- * @param {boolean} fetchDefaultLang
49
- */
50
- const setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {
51
- fetchDefaultLanguage = fetchDefaultLang;
52
- };
53
-
54
- /**
55
- * Returns if the default language, that is inlined, should be fetched over the network.
56
- * @public
57
- * @returns {boolean}
58
- */
59
- const getFetchDefaultLanguage = (): boolean => {
60
- if (fetchDefaultLanguage === undefined) {
61
- setFetchDefaultLanguage(getConfiguredFetchDefaultLanguage());
62
- }
63
-
64
- return fetchDefaultLanguage;
65
- };
66
-
67
- export {
68
- getLanguage,
69
- setLanguage,
70
- setFetchDefaultLanguage,
71
- getFetchDefaultLanguage,
72
- };
@@ -1,67 +0,0 @@
1
- import { getNoConflict as getConfiguredNoConflict } from "../InitialConfiguration.js";
2
-
3
- // Fire these events even with noConflict: true
4
- const excludeList = [
5
- "value-changed",
6
- ];
7
-
8
- type NoConflictData = boolean | { events: Array<string>};
9
-
10
- let noConflict: NoConflictData;
11
-
12
- const shouldFireOriginalEvent = (eventName: string) => {
13
- return excludeList.includes(eventName);
14
- };
15
-
16
- const shouldNotFireOriginalEvent = (eventName: string) => {
17
- const nc = getNoConflict();
18
- // return !(nc.events && nc.events.includes && nc.events.includes(eventName));
19
- return !(typeof nc !== "boolean" && nc.events && nc.events.includes && nc.events.includes(eventName));
20
- };
21
-
22
- /**
23
- * Returns if the "noConflict" configuration is set.
24
- * @public
25
- * @returns { NoConflictData }
26
- */
27
- const getNoConflict = (): NoConflictData => {
28
- if (noConflict === undefined) {
29
- noConflict = getConfiguredNoConflict();
30
- }
31
-
32
- return noConflict;
33
- };
34
-
35
- /**
36
- * Sets the "noConflict" mode.
37
- * - When "false" (default value), all custom events are fired with and without the "ui5-" prefix.
38
- * - When "true", all custom events are fired with the "ui5-" prefix only.
39
- * - When an object is supplied, just the specified events will be fired with the "ui5-" prefix.
40
- * @public
41
- * @param { NoConflictData } noConflictData
42
- */
43
- const setNoConflict = (noConflictData: NoConflictData) => {
44
- noConflict = noConflictData;
45
- };
46
-
47
- const skipOriginalEvent = (eventName: string) => {
48
- const nc = getNoConflict();
49
-
50
- // Always fire these events
51
- if (shouldFireOriginalEvent(eventName)) {
52
- return false;
53
- }
54
-
55
- // Read from the configuration
56
- if (nc === true) {
57
- return true;
58
- }
59
-
60
- return !shouldNotFireOriginalEvent(eventName);
61
- };
62
-
63
- export {
64
- getNoConflict,
65
- setNoConflict,
66
- skipOriginalEvent,
67
- };
package/src/config/RTL.ts DELETED
@@ -1,45 +0,0 @@
1
- import { getRTL as getConfiguredRTL } from "../InitialConfiguration.js";
2
- import { getLanguage } from "./Language.js";
3
- import getDesigntimePropertyAsArray from "../util/getDesigntimePropertyAsArray.js";
4
- import detectNavigatorLanguage from "../util/detectNavigatorLanguage.js";
5
-
6
- const M_ISO639_OLD_TO_NEW = {
7
- "iw": "he",
8
- "ji": "yi",
9
- "in": "id",
10
- "sh": "sr",
11
- };
12
-
13
- const A_RTL_LOCALES = getDesigntimePropertyAsArray("$cldr-rtl-locales:ar,fa,he$") || [];
14
-
15
- /**
16
- * Checks whether the language is using RTL
17
- * @param {string} language
18
- * @returns {boolean} whether the language is using RTL
19
- */
20
- const impliesRTL = (language: string) => {
21
- language = (language && M_ISO639_OLD_TO_NEW[language as keyof typeof M_ISO639_OLD_TO_NEW]) || language;
22
-
23
- return A_RTL_LOCALES.indexOf(language) >= 0;
24
- };
25
-
26
- /**
27
- * Gets the effective RTL setting by first checking the configuration
28
- * and if not set using the currently set language or the navigator language if the language is not explicitly set.
29
- * @returns {boolean} whether RTL should be used
30
- */
31
- const getRTL = (): boolean => {
32
- if (typeof document === "undefined") {
33
- return false;
34
- }
35
-
36
- const configurationRTL = getConfiguredRTL();
37
-
38
- if (configurationRTL !== undefined) {
39
- return !!configurationRTL;
40
- }
41
-
42
- return impliesRTL(getLanguage() || detectNavigatorLanguage());
43
- };
44
-
45
- export { getRTL }; // eslint-disable-line
@@ -1,64 +0,0 @@
1
- import { getTheme as getConfiguredTheme } from "../InitialConfiguration.js";
2
- import { reRenderAllUI5Elements } from "../Render.js";
3
- import applyTheme from "../theming/applyTheme.js";
4
-
5
- let curTheme: string;
6
-
7
- /**
8
- * Returns the current theme.
9
- * @public
10
- * @returns {string} the current theme name
11
- */
12
- const getTheme = (): string => {
13
- if (curTheme === undefined) {
14
- curTheme = getConfiguredTheme();
15
- }
16
-
17
- return curTheme;
18
- };
19
-
20
- /**
21
- * Applies a new theme after fetching its assets from the network.
22
- * @public
23
- * @param {string} theme the name of the new theme
24
- * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM
25
- */
26
- const setTheme = async (theme: string): Promise<void> => {
27
- if (curTheme === theme) {
28
- return;
29
- }
30
-
31
- curTheme = theme;
32
-
33
- // Update CSS Custom Properties
34
- await applyTheme(curTheme);
35
- await reRenderAllUI5Elements({ themeAware: true });
36
- };
37
-
38
- /**
39
- * Returns if the given theme name is the one currently applied.
40
- * @private
41
- * @param {string} theme
42
- * @returns {boolean}
43
- */
44
- const isTheme = (theme: string) => {
45
- const currentTheme = getTheme();
46
- return currentTheme === theme || currentTheme === `${theme}_exp`;
47
- };
48
-
49
- /**
50
- * Returns if the current theme is part of given theme family.
51
- * @private
52
- * @param {string} theme the theme family
53
- * @returns {boolean}
54
- */
55
- const isThemeFamily = (theme: string) => {
56
- return getTheme().startsWith(theme);
57
- };
58
-
59
- export {
60
- getTheme,
61
- setTheme,
62
- isTheme,
63
- isThemeFamily,
64
- };
@@ -1,41 +0,0 @@
1
- import createLinkInHead from "../util/createLinkInHead.js";
2
- import validateThemeRoot from "../validateThemeRoot.js";
3
- import { getThemeRoot as getConfiguredThemeRoot } from "../InitialConfiguration.js";
4
-
5
- let themeRoot: string | undefined;
6
-
7
- const getThemeRoot = (): string | undefined => {
8
- if (themeRoot === undefined) {
9
- themeRoot = getConfiguredThemeRoot();
10
- }
11
-
12
- return themeRoot;
13
- };
14
-
15
- const setThemeRoot = (theme: string, newThemeRoot: string) => {
16
- themeRoot = validateThemeRoot(newThemeRoot);
17
-
18
- if (themeRoot) {
19
- attachCustomThemeStylesToHead(theme);
20
- }
21
- };
22
-
23
- const formatThemeLink = (theme: string) => {
24
- return `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set.
25
- };
26
-
27
- const attachCustomThemeStylesToHead = async (theme: string) => {
28
- const link = document.querySelector(`[sap-ui-webcomponents-theme="${theme}"]`);
29
-
30
- if (link) {
31
- document.head.removeChild(link);
32
- }
33
-
34
- await createLinkInHead(formatThemeLink(theme), { "sap-ui-webcomponents-theme": theme });
35
- };
36
-
37
- export {
38
- getThemeRoot,
39
- setThemeRoot,
40
- attachCustomThemeStylesToHead,
41
- };
@@ -1,57 +0,0 @@
1
- import type UI5Element from "../UI5Element.js";
2
- import type { Renderer } from "../UI5Element.js";
3
- import type { TemplateFunction as Template } from "../renderer/executeTemplate.js";
4
- import type { ComponentStylesData as Styles } from "../types.js";
5
-
6
- /**
7
- * Returns a custom element class decorator.
8
- *
9
- * @param { string | object } tagNameOrComponentSettings
10
- * @returns { ClassDecorator }
11
- */
12
- const customElement = (tagNameOrComponentSettings: string | {
13
- tag?: string,
14
- renderer?: Renderer,
15
- styles?: Styles,
16
- template?: Template,
17
- dependencies?: Array<typeof UI5Element>,
18
- staticAreaStyles?: Styles,
19
- staticAreaTemplate?: Template,
20
- languageAware?: boolean,
21
- themeAware?: boolean,
22
- fastNavigation?: boolean,
23
- }): ClassDecorator => {
24
- return (target: any) => {
25
- if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
26
- target.metadata = {};
27
- }
28
-
29
- if (typeof tagNameOrComponentSettings === "string") {
30
- target.metadata.tag = tagNameOrComponentSettings;
31
- return;
32
- }
33
-
34
- const {
35
- tag,
36
- languageAware = false,
37
- themeAware = false,
38
- fastNavigation = false,
39
- } = tagNameOrComponentSettings;
40
-
41
- target.metadata.tag = tag;
42
- target.metadata.languageAware = languageAware;
43
- target.metadata.themeAware = themeAware;
44
- target.metadata.fastNavigation = fastNavigation;
45
-
46
- ["render", "renderer", "template", "staticAreaTemplate", "styles", "staticAreaStyles", "dependencies"].forEach((customElementEntity: string) => {
47
- const _customElementEntity = customElementEntity === "render" ? "renderer" : customElementEntity;
48
- const customElementEntityValue = tagNameOrComponentSettings[_customElementEntity as keyof typeof tag];
49
-
50
- customElementEntityValue && Object.defineProperty(target, customElementEntity, {
51
- get: () => customElementEntityValue,
52
- });
53
- });
54
- };
55
- };
56
-
57
- export default customElement;
@@ -1,28 +0,0 @@
1
- import { EventData } from "../UI5ElementMetadata.js";
2
-
3
- /**
4
- * Returns an event class decorator.
5
- *
6
- * @param { string } name the event name
7
- * @param { EventData } data the event data
8
- * @returns { ClassDecorator }
9
- */
10
- const event = (name: string, data: EventData = {}): ClassDecorator => {
11
- return (target: any) => {
12
- if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
13
- target.metadata = {};
14
- }
15
-
16
- const metadata = target.metadata;
17
- if (!metadata.events) {
18
- metadata.events = {};
19
- }
20
-
21
- const eventsMetadata = metadata.events;
22
- if (!eventsMetadata[name]) {
23
- eventsMetadata[name] = data;
24
- }
25
- };
26
- };
27
-
28
- export default event;
@@ -1,30 +0,0 @@
1
- import type UI5Element from "../UI5Element.js";
2
- import { Property } from "../UI5ElementMetadata.js";
3
-
4
- /**
5
- * Returns a property decorator.
6
- *
7
- * @param { Property } propData
8
- * @returns { PropertyDecorator }
9
- */
10
- const property = (propData?: Property): PropertyDecorator => {
11
- return (target: any, propertyKey: string | symbol) => {
12
- const ctor = target.constructor as typeof UI5Element;
13
-
14
- if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
15
- ctor.metadata = {};
16
- }
17
-
18
- const metadata = ctor.metadata;
19
- if (!metadata.properties) {
20
- metadata.properties = {};
21
- }
22
-
23
- const propsMetadata = metadata.properties;
24
- if (!propsMetadata[propertyKey as string]) {
25
- propsMetadata[propertyKey as string] = propData || { type: String };
26
- }
27
- };
28
- };
29
-
30
- export default property;
@@ -1,49 +0,0 @@
1
- import type UI5Element from "../UI5Element.js";
2
- import { Slot } from "../UI5ElementMetadata.js";
3
-
4
- /**
5
- * Returns a slot decorator.
6
- *
7
- * @param { Slot } slotData
8
- * @returns { PropertyDecorator }
9
- */
10
- const slot = (slotData?: Slot): PropertyDecorator => {
11
- return (target: any, slotKey: string | symbol) => {
12
- const ctor = target.constructor as typeof UI5Element;
13
-
14
- if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
15
- ctor.metadata = {};
16
- }
17
-
18
- const metadata = ctor.metadata;
19
- if (!metadata.slots) {
20
- metadata.slots = {};
21
- }
22
-
23
- const slotMetadata = metadata.slots;
24
-
25
- if (slotData?.default && slotMetadata.default) {
26
- throw new Error("Only one slot can be the default slot.");
27
- }
28
-
29
- const key = slotData?.default ? "default" : slotKey as string;
30
- slotData = slotData || { type: HTMLElement };
31
-
32
- if (!slotData.type) {
33
- slotData.type = HTMLElement;
34
- }
35
-
36
- if (!slotMetadata[key]) {
37
- slotMetadata[key] = slotData;
38
- }
39
-
40
- if (slotData.default) {
41
- delete slotMetadata.default.default;
42
- slotMetadata.default.propertyName = slotKey as string;
43
- }
44
-
45
- ctor.metadata.managedSlots = true;
46
- };
47
- };
48
-
49
- export default slot;