@ui5/webcomponents-base 1.11.0-rc.1 → 1.11.0-rc.3

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 (55) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/bundle.esm.js +3 -1
  3. package/dist/UI5Element.d.ts +2 -2
  4. package/dist/asset-registries/Icons.d.ts +1 -1
  5. package/dist/asset-registries/Icons.js +21 -21
  6. package/dist/asset-registries/Icons.js.map +1 -1
  7. package/dist/asset-registries/Illustrations.d.ts +1 -1
  8. package/dist/asset-registries/Themes.d.ts +1 -0
  9. package/dist/assets/bundle.esm.76492ab6.js +60 -0
  10. package/dist/assets/test/pages/{i18n.html.4b1c0bdb.js → i18n.html.2fe80529.js} +1 -1
  11. package/dist/assets/test/pages/{i18n_texts.html.e98a417d.js → i18n_texts.html.fef7ef14.js} +1 -1
  12. package/dist/assets-meta/IconCollectionsAlias.d.ts +24 -10
  13. package/dist/assets-meta/IconCollectionsAlias.js +29 -9
  14. package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
  15. package/dist/config/FormatSettings.d.ts +5 -1
  16. package/dist/config/FormatSettings.js +5 -1
  17. package/dist/config/FormatSettings.js.map +1 -1
  18. package/dist/config/Icons.d.ts +43 -18
  19. package/dist/config/Icons.js +80 -25
  20. package/dist/config/Icons.js.map +1 -1
  21. package/dist/config/RTL.js +3 -0
  22. package/dist/config/RTL.js.map +1 -1
  23. package/dist/features/LegacyDateFormats.d.ts +18 -0
  24. package/dist/features/LegacyDateFormats.js +20 -0
  25. package/dist/features/LegacyDateFormats.js.map +1 -0
  26. package/dist/features/OpenUI5Support.d.ts +2 -0
  27. package/dist/features/OpenUI5Support.js +1 -0
  28. package/dist/features/OpenUI5Support.js.map +1 -1
  29. package/dist/generated/VersionInfo.js +3 -3
  30. package/dist/test/pages/AllTestElements.html +1 -1
  31. package/dist/test/pages/Configuration.html +1 -1
  32. package/dist/test/pages/ConfigurationScript.html +19 -2
  33. package/dist/test/pages/WithComplexTemplate.html +1 -1
  34. package/dist/test/pages/i18n.html +2 -2
  35. package/dist/test/pages/i18n_texts.html +2 -2
  36. package/dist/theming/getStylesString.d.ts +1 -1
  37. package/dist/util/AriaLabelHelper.d.ts +10 -1
  38. package/dist/util/AriaLabelHelper.js +135 -8
  39. package/dist/util/AriaLabelHelper.js.map +1 -1
  40. package/package-scripts.js +1 -1
  41. package/package.json +3 -3
  42. package/src/UI5Element.ts +2 -2
  43. package/src/asset-registries/Icons.ts +26 -27
  44. package/src/asset-registries/Illustrations.ts +1 -1
  45. package/src/asset-registries/Themes.ts +5 -0
  46. package/src/assets-meta/IconCollectionsAlias.ts +32 -9
  47. package/src/config/FormatSettings.ts +16 -2
  48. package/src/config/Icons.ts +92 -25
  49. package/src/config/RTL.ts +4 -0
  50. package/src/features/LegacyDateFormats.ts +40 -0
  51. package/src/features/OpenUI5Support.ts +5 -0
  52. package/src/theming/getEffectiveLinksHrefs.ts +1 -1
  53. package/src/theming/getStylesString.ts +1 -1
  54. package/src/util/AriaLabelHelper.ts +167 -12
  55. package/dist/assets/bundle.esm.25073731.js +0 -56
@@ -1 +1 @@
1
- {"version":3,"file":"AriaLabelHelper.js","sourceRoot":"","sources":["../../src/util/AriaLabelHelper.ts"],"names":[],"mappings":"AAKA,MAAM,yBAAyB,GAAG,CAAC,EAAe,EAAE,EAAE;IACrD,MAAM,YAAY,GAAG,EAAuB,CAAC;IAE7C,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE;QACpC,IAAI,YAAY,CAAC,cAAc,EAAE;YAChC,OAAO,YAAY,CAAC,cAAc,CAAC;SACnC;QAED,OAAO,SAAS,CAAC;KACjB;IAED,OAAO,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,uBAAuB,GAAG,CAAC,EAAe,EAAE,EAAE;IACnD,MAAM,GAAG,GAAI,EAAwB,CAAC,iBAAiB,CAAC,KAAK,CA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AQ,EAAE,UAAU,EAAE,CAAC;YACzC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACnC;KACD;IACD,iBAAiB,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC;AACxG,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,EAAc,EAAE,EAAE;IAC/C,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrD,IAAI,CAAC,iBAAiB,EAAE;QACvB,OAAO;KACP;IACD,MAAM,mBAAmB,GAAG,CAAC,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpE,mBAAmB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QAC7C,2CAA2C,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC5D,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC"}
@@ -16,7 +16,7 @@ const eslintConfig = `--config ${require.resolve("@ui5/webcomponents-tools/compo
16
16
  const scripts = {
17
17
  clean: "rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port",
18
18
  lint: `eslint . ${eslintConfig}`,
19
- prepare: "nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates typescript generateAPI",
19
+ prepare: "cross-env UI5_TS=true nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates typescript generateAPI",
20
20
  typescript: "tsc",
21
21
  integrate: {
22
22
  default: "nps integrate.copy-used-modules integrate.replace-amd integrate.amd-to-es6 integrate.esm-abs-to-rel integrate.third-party",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "1.11.0-rc.1",
3
+ "version": "1.11.0-rc.3",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -36,7 +36,7 @@
36
36
  "devDependencies": {
37
37
  "@buxlabs/amd-to-es6": "0.16.1",
38
38
  "@openui5/sap.ui.core": "1.109.0",
39
- "@ui5/webcomponents-tools": "1.11.0-rc.1",
39
+ "@ui5/webcomponents-tools": "1.11.0-rc.3",
40
40
  "chromedriver": "109.0.0",
41
41
  "clean-css": "^5.2.2",
42
42
  "copy-and-watch": "^0.1.5",
@@ -46,5 +46,5 @@
46
46
  "replace-in-file": "^6.3.5",
47
47
  "resolve": "^1.20.0"
48
48
  },
49
- "gitHead": "a76323e09b0190bbb72cbff141bb8093b8d0f4ff"
49
+ "gitHead": "228475d7914731c7dd1a59e570eb406add604047"
50
50
  }
package/src/UI5Element.ts CHANGED
@@ -23,8 +23,8 @@ import { getSlotName, getSlottedNodesList } from "./util/SlotsHelper.js";
23
23
  import arraysAreEqual from "./util/arraysAreEqual.js";
24
24
  import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
25
25
  import preloadLinks from "./theming/preloadLinks.js";
26
- import { TemplateFunction, TemplateFunctionResult } from "./renderer/executeTemplate.js";
27
- import { PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
26
+ import type { TemplateFunction, TemplateFunctionResult } from "./renderer/executeTemplate.js";
27
+ import type { PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
28
28
 
29
29
  let autoId = 0;
30
30
 
@@ -1,6 +1,6 @@
1
1
  import getSharedResource from "../getSharedResource.js";
2
- import IconCollectionsAlias from "../assets-meta/IconCollectionsAlias.js";
3
- import { getEffectiveDefaultIconCollection } from "../config/Icons.js";
2
+ import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
3
+ import { getEffectiveIconCollection } from "../config/Icons.js";
4
4
  import { I18nText } from "../i18nBundle.js";
5
5
  import { TemplateFunction } from "../renderer/executeTemplate.js";
6
6
 
@@ -19,7 +19,7 @@ type CollectionData = {
19
19
  };
20
20
 
21
21
  type IconData = {
22
- collection?: string,
22
+ collection: string,
23
23
  packageName: string,
24
24
  pathData: string | Array<string>,
25
25
  ltr: boolean,
@@ -67,11 +67,8 @@ const _fillRegistry = (bundleData: CollectionData) => {
67
67
 
68
68
  // set
69
69
  const registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line
70
- if (!iconData.collection) {
71
- iconData.collection = getEffectiveDefaultIconCollection();
72
- }
73
-
74
70
  const key = `${iconData.collection}/${name}`;
71
+
75
72
  registry.set(key, {
76
73
  pathData: iconData.pathData,
77
74
  ltr: iconData.ltr,
@@ -79,38 +76,48 @@ const registerIcon = (name: string, iconData: IconData) => { // eslint-disable-l
79
76
  packageName: iconData.packageName,
80
77
  customTemplate: iconData.customTemplate,
81
78
  viewBox: iconData.viewBox,
79
+ collection: iconData.collection,
82
80
  });
83
81
  };
84
82
 
85
- const _parseName = (name: string) => {
83
+ /**
84
+ * Processes the full icon name and splits it into - "name", "collection"
85
+ * to form the proper registry key ("collection/name") under which the icon is registered:
86
+ *
87
+ * - removes legacy protocol ("sap-icon://")
88
+ * - resolves aliases (f.e "SAP-icons-TNT/actor" => "tnt/actor")
89
+ * - determines theme dependant icon collection (f.e "home" => "SAP-icons-v4/home" in Quartz | "SAP-icons-v5/home" in Horizon)
90
+ *
91
+ * @param { string } name
92
+ * @return { object }
93
+ */
94
+ const processName = (name: string) => {
86
95
  // silently support ui5-compatible URIs
87
96
  if (name.startsWith("sap-icon://")) {
88
97
  name = name.replace("sap-icon://", "");
89
98
  }
90
99
 
91
- let collection;
100
+ let collection: string;
92
101
  [name, collection] = name.split("/").reverse();
93
- collection = collection || getEffectiveDefaultIconCollection();
94
-
95
- // Normalize collection name.
96
- // - resolve `SAP-icons-TNT` to `tnt`.
97
- // - resolve `BusinessSuiteInAppSymbols` to `business-suite`.
98
- // - resolve `horizon` to `SAP-icons-v5`,
99
- // Note: aliases can be made as a feature, if more collections need it or more aliases are needed.
100
- collection = _normalizeCollection(collection);
102
+
101
103
  name = name.replace("icon-", "");
102
104
 
105
+ if (collection) {
106
+ collection = getIconCollectionByAlias(collection);
107
+ }
108
+ collection = getEffectiveIconCollection(collection);
109
+
103
110
  const registryKey = `${collection}/${name}`;
104
111
  return { name, collection, registryKey };
105
112
  };
106
113
 
107
114
  const getIconDataSync = (name: string) => {
108
- const { registryKey } = _parseName(name);
115
+ const { registryKey } = processName(name);
109
116
  return registry.get(registryKey);
110
117
  };
111
118
 
112
119
  const getIconData = async (name: string) => {
113
- const { collection, registryKey } = _parseName(name);
120
+ const { collection, registryKey } = processName(name);
114
121
 
115
122
  let iconData: string | CollectionData = ICON_NOT_FOUND;
116
123
  try {
@@ -140,14 +147,6 @@ const _getRegisteredNames = async () => {
140
147
  return Array.from(registry.keys());
141
148
  };
142
149
 
143
- const _normalizeCollection = (collectionName: string) => {
144
- if (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {
145
- return IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];
146
- }
147
-
148
- return collectionName;
149
- };
150
-
151
150
  export {
152
151
  registerIconLoader,
153
152
  getIconData,
@@ -1,5 +1,5 @@
1
1
  import getSharedResource from "../getSharedResource.js";
2
- import { I18nText } from "../i18nBundle.js";
2
+ import type { I18nText } from "../i18nBundle.js";
3
3
 
4
4
  type IllustrationLoader = (illustrationName: string) => Promise<IllustrationData>;
5
5
 
@@ -65,3 +65,8 @@ export {
65
65
  getRegisteredPackages,
66
66
  isThemeRegistered,
67
67
  };
68
+
69
+ export type {
70
+ ThemeData,
71
+ ThemeLoader,
72
+ };
@@ -1,18 +1,41 @@
1
1
  /**
2
- * Supported icon collection names and aliases.
2
+ * Supported icon collection aliases.
3
3
  *
4
4
  * Users might specify a collection, using both the key and the value in the following key-value pairs,
5
5
  * e.g the following pairs are completely exchangeable:
6
- * "SAP-icons-TNT/actor" and "tnt/actor", "BusinessSuiteInAppSymbols/3d" and "business-suite/3d",
7
- * "SAP-icons-v5/accept" and "horizon/accept".
8
6
  *
9
- * Note: technically, in the code we maintain the collections under the "value" name - "tnt", "business-suite",
10
- * SAP-icons-v5" and "SAP-icons"(which does not have an alias).
7
+ * - "SAP-icons/accept" and "SAP-icons-v4/accept"
8
+ * - "horizon/accept" and "SAP-icons-v5/accept"
9
+ * - "SAP-icons-TNT/actor" and "tnt/actor"
10
+ * - "BusinessSuiteInAppSymbols/3d" and "business-suite/3d"
11
11
  */
12
- const IconCollectionsAlias = {
13
- "SAP-icons-TNT": "tnt",
14
- "BusinessSuiteInAppSymbols": "business-suite",
15
- "horizon": "SAP-icons-v5",
12
+ enum IconCollectionsAlias {
13
+ "SAP-icons" = "SAP-icons-v4",
14
+ "horizon" = "SAP-icons-v5",
15
+ "SAP-icons-TNT" = "tnt",
16
+ "BusinessSuiteInAppSymbols" = "business-suite",
17
+ }
18
+
19
+ /**
20
+ * Returns the mapped collection name for a given alias.
21
+ *
22
+ * <b>For example</b>:
23
+ * - "SAP-icons-TNT"resolves to "tnt"
24
+ * - "BusinessSuiteInAppSymbols" resolves to "business-suite"
25
+ * - "horizon" resolves to "SAP-icons-v5"
26
+ *
27
+ * @param { string } collectionName
28
+ * @return { string } the normalized collection name
29
+ */
30
+ const getIconCollectionByAlias = (collectionName: string) => {
31
+ if (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {
32
+ return IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];
33
+ }
34
+
35
+ return collectionName;
16
36
  };
17
37
 
18
38
  export default IconCollectionsAlias;
39
+ export {
40
+ getIconCollectionByAlias,
41
+ };
@@ -1,6 +1,12 @@
1
+ import LegacyDateFormats from "../features/LegacyDateFormats.js";
2
+ import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
1
3
  import { getFormatSettings } from "../InitialConfiguration.js";
4
+ import { getFeature } from "../FeaturesRegistry.js";
2
5
 
3
- type FormatSettings = { firstDayOfWeek?: number };
6
+ type FormatSettings = {
7
+ firstDayOfWeek?: number,
8
+ legacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,
9
+ };
4
10
 
5
11
  let formatSettings: FormatSettings;
6
12
 
@@ -17,5 +23,13 @@ const getFirstDayOfWeek = (): number | undefined => {
17
23
  return formatSettings.firstDayOfWeek;
18
24
  };
19
25
 
20
- export { getFirstDayOfWeek }; // eslint-disable-line
26
+ const legacyDateFormats = getFeature<typeof LegacyDateFormats>("LegacyDateFormats");
27
+
28
+ const getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };
29
+
30
+ export {
31
+ getFirstDayOfWeek,
32
+ getLegacyDateCalendarCustomizing,
33
+ };
34
+
21
35
  export type { FormatSettings };
@@ -1,59 +1,126 @@
1
1
  import { getTheme, isThemeFamily } from "./Theme.js";
2
+ import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
2
3
 
3
4
  const IconCollectionConfiguration = new Map<string, string>();
4
5
 
5
- enum IconCollection {
6
- v4 = "SAP-icons",
7
- v5 = "SAP-icons-v5",
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",
8
17
  }
9
18
 
10
19
  /**
11
- * Sets the default icon collection (SAP-icons font v4 or SAP-icons font v5) per theme,
12
- * which will be applied in case icon collection is not specified.
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>
13
42
  *
14
- * Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
15
43
  * @public
16
- * @param {string} theme
17
- * @param {IconCollection} collectionName
44
+ * @param { string } theme
45
+ * @param { string } collectionName
18
46
  */
19
- const setDefaultIconCollection = (theme: string, collectionName: "horizon" | IconCollection) => {
20
- if (collectionName === "horizon") {
21
- collectionName = IconCollection.v5;
22
- }
23
-
47
+ const setDefaultIconCollection = (theme: string, collectionName: IconCollection) => {
24
48
  IconCollectionConfiguration.set(theme, collectionName);
25
49
  };
26
50
 
27
51
  /**
28
- * Returns the default icon collection (v4 or v5) for given theme,
29
- * that is configured.
52
+ * Returns the configured default icon collection for a given theme.
30
53
  *
31
- * @param {string} theme
54
+ * @param { string } theme
32
55
  * @public
33
- * @returns {string | undefined}
56
+ * @returns { string | undefined }
34
57
  */
35
58
  const getDefaultIconCollection = (theme: string): string | undefined => {
36
59
  return IconCollectionConfiguration.get(theme);
37
60
  };
38
61
 
39
62
  /**
40
- * Returns the effective icon collection that will be applied for icon web components
41
- * whenever namespace is not specified.
42
- * @returns {string}
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
43
67
  */
44
- const getEffectiveDefaultIconCollection = () => {
68
+ const getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {
45
69
  const currentTheme = getTheme();
46
70
  const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
47
71
 
48
- if (currentThemeConfiguration) {
49
- return currentThemeConfiguration;
72
+ // when no collection is set and default collection is configured - return the configured icon collection
73
+ if (!collectionName && currentThemeConfiguration) {
74
+ return getIconCollectionByAlias(currentThemeConfiguration);
50
75
  }
51
76
 
52
- return isThemeFamily("sap_horizon") ? IconCollection.v5 : IconCollection.v4;
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;
53
115
  };
54
116
 
55
117
  export {
56
118
  setDefaultIconCollection,
57
119
  getDefaultIconCollection,
58
- getEffectiveDefaultIconCollection,
120
+ getEffectiveIconCollection,
121
+ RegisteredIconCollection,
122
+ };
123
+
124
+ export type {
125
+ IconCollection,
59
126
  };
package/src/config/RTL.ts CHANGED
@@ -29,6 +29,10 @@ const impliesRTL = (language: string) => {
29
29
  * @returns {boolean} whether RTL should be used
30
30
  */
31
31
  const getRTL = (): boolean => {
32
+ if (typeof document === "undefined") {
33
+ return false;
34
+ }
35
+
32
36
  const configurationRTL = getConfiguredRTL();
33
37
 
34
38
  if (configurationRTL !== undefined) {
@@ -0,0 +1,40 @@
1
+ import { getFormatSettings } from "../InitialConfiguration.js";
2
+ import type { FormatSettings } from "../config/FormatSettings.js";
3
+ import { registerFeature } from "../FeaturesRegistry.js";
4
+
5
+ // Allows specifying the customizing data for Islamic calendar support
6
+ // dateFormat - The date format
7
+ // islamicMonthStart - The Islamic date in string format // 14360101
8
+ // gregDate - Corresponding Gregorian date to the Islamic one in string format // 20141024
9
+ type IslamicToGregorianMapping = {
10
+ dateFormat: string,
11
+ islamicMonthStart: string,
12
+ gregDate: string,
13
+ };
14
+ type LegacyDateCalendarCustomizing = Array<IslamicToGregorianMapping>;
15
+
16
+ let formatSettings: FormatSettings;
17
+
18
+ class LegacyDateFormats {
19
+ /**
20
+ * Returns the currently set customizing data for Islamic calendar support
21
+ *
22
+ * @return {object[]} Returns an array that contains the customizing data.
23
+ * @public
24
+ */
25
+ static getLegacyDateCalendarCustomizing(this: void): LegacyDateCalendarCustomizing {
26
+ if (formatSettings === undefined) {
27
+ formatSettings = getFormatSettings();
28
+ }
29
+
30
+ return formatSettings.legacyDateCalendarCustomizing || [];
31
+ }
32
+ }
33
+
34
+ registerFeature("LegacyDateFormats", LegacyDateFormats);
35
+
36
+ export default LegacyDateFormats;
37
+ export type {
38
+ FormatSettings,
39
+ LegacyDateCalendarCustomizing,
40
+ };
@@ -2,6 +2,7 @@ import { registerFeature } from "../FeaturesRegistry.js";
2
2
  import { setTheme } from "../config/Theme.js";
3
3
  import { getCurrentZIndex } from "../util/PopupUtils.js";
4
4
  import { CLDRData } from "../asset-registries/LocaleData.js";
5
+ import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
5
6
 
6
7
  type OpenUI5Popup = {
7
8
  setInitialZIndex: (zIndex: number) => void,
@@ -22,6 +23,9 @@ type OpenUI5CoreConfiguration = {
22
23
  getRTL: () => string,
23
24
  getCalendarType: () => string,
24
25
  getLocale: () => string,
26
+ getFormatSettings: () => {
27
+ getLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;
28
+ }
25
29
  };
26
30
 
27
31
  type LocaleData = {
@@ -76,6 +80,7 @@ class OpenUI5Support {
76
80
  calendarType: config.getCalendarType(),
77
81
  formatSettings: {
78
82
  firstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,
83
+ legacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),
79
84
  },
80
85
  };
81
86
  }
@@ -2,7 +2,7 @@ import { getUrl } from "../CSP.js";
2
2
  import { getFeature } from "../FeaturesRegistry.js";
3
3
  import type UI5Element from "../UI5Element.js";
4
4
  import type OpenUI5Enablement from "../features/OpenUI5Enablement.js";
5
- import { ComponentStylesData, StyleDataCSP } from "../types.js";
5
+ import type { ComponentStylesData, StyleDataCSP } from "../types.js";
6
6
 
7
7
  const MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers
8
8
 
@@ -1,4 +1,4 @@
1
- import { ComponentStylesData, StyleData } from "../types.js";
1
+ import type { ComponentStylesData, StyleData } from "../types.js";
2
2
 
3
3
  const MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers
4
4