@ui5/webcomponents-base 1.16.0-rc.3 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/asset-registries/Icons.d.ts +4 -3
- package/dist/asset-registries/Icons.js +28 -17
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/{assets-meta → asset-registries/util}/IconCollectionsAlias.d.ts +1 -2
- package/dist/{assets-meta → asset-registries/util}/IconCollectionsAlias.js +1 -2
- package/dist/asset-registries/util/IconCollectionsAlias.js.map +1 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +20 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.js +42 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +13 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.js +29 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -0
- package/dist/assets/Boot.d50b4c00.js +9 -0
- package/dist/assets/{bundle.esm.e0ff2f8c.js → bundle.esm.d83f5ad4.js} +1 -1
- package/dist/assets/test/pages/{Boot.html.297ac63f.js → Boot.html.139d18a3.js} +1 -1
- package/dist/assets/test/pages/{i18n.html.da527088.js → i18n.html.9cb89d0c.js} +1 -1
- package/dist/assets/test/pages/{i18n_texts.html.c8ead431.js → i18n_texts.html.20728054.js} +1 -1
- package/dist/config/Icons.d.ts +1 -16
- package/dist/config/Icons.js +1 -60
- package/dist/config/Icons.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/test/pages/AllTestElements.html +2 -2
- package/dist/test/pages/Boot.html +2 -2
- package/dist/test/pages/Configuration.html +2 -2
- package/dist/test/pages/ConfigurationScript.html +2 -2
- package/dist/test/pages/WithComplexTemplate.html +2 -2
- package/dist/test/pages/i18n.html +3 -3
- package/dist/test/pages/i18n_texts.html +3 -3
- package/index.js +2 -2
- package/package.json +4 -4
- package/dist/assets/Boot.5a9b49d7.js +0 -9
- package/dist/assets-meta/IconCollectionsAlias.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.16.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.4...v1.16.0) (2023-08-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-base
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.16.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.3...v1.16.0-rc.4) (2023-08-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **framework:** support theme dependent custom icon collections ([#7341](https://github.com/SAP/ui5-webcomponents/issues/7341)) ([33967dd](https://github.com/SAP/ui5-webcomponents/commit/33967dd12e31e17828986c7b40a5471c2936f0b7))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.16.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.2...v1.16.0-rc.3) (2023-07-27)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @ui5/webcomponents-base
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { I18nText } from "../i18nBundle.js";
|
|
2
2
|
import type { TemplateFunction } from "../renderer/executeTemplate.js";
|
|
3
|
-
type IconLoader = (collectionName: string) => Promise<CollectionData
|
|
3
|
+
type IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;
|
|
4
4
|
type CollectionData = {
|
|
5
5
|
collection: string;
|
|
6
6
|
packageName: string;
|
|
7
|
+
themeFamily?: "legacy" | "sap_horizon";
|
|
7
8
|
version?: string;
|
|
8
9
|
data: Record<string, {
|
|
9
10
|
path?: string;
|
|
@@ -23,8 +24,8 @@ type IconData = {
|
|
|
23
24
|
};
|
|
24
25
|
declare const registerIconLoader: (collectionName: string, loader: IconLoader) => void;
|
|
25
26
|
declare const registerIcon: (name: string, iconData: IconData) => void;
|
|
26
|
-
declare const getIconDataSync: (
|
|
27
|
-
declare const getIconData: (
|
|
27
|
+
declare const getIconDataSync: (iconName: string) => IconData | undefined;
|
|
28
|
+
declare const getIconData: (iconName: string) => Promise<IconData | "ICON_NOT_FOUND" | undefined>;
|
|
28
29
|
/**
|
|
29
30
|
* Returns the accessible name for the given icon,
|
|
30
31
|
* or undefined if accessible name is not present.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import getSharedResource from "../getSharedResource.js";
|
|
2
|
-
import { getIconCollectionByAlias } from "
|
|
3
|
-
import {
|
|
2
|
+
import { getIconCollectionByAlias } from "./util/IconCollectionsAlias.js";
|
|
3
|
+
import { registerIconCollectionForTheme } from "./util/IconCollectionsByTheme.js";
|
|
4
|
+
import getEffectiveIconCollection from "./util/getIconCollectionByTheme.js";
|
|
4
5
|
import { getI18nBundle } from "../i18nBundle.js";
|
|
6
|
+
const DEFAULT_THEME_FAMILY = "legacy"; // includes sap_belize_* and sap_fiori_*
|
|
5
7
|
const loaders = new Map();
|
|
6
8
|
const registry = getSharedResource("SVGIcons.registry", new Map());
|
|
7
9
|
const iconCollectionPromises = getSharedResource("SVGIcons.promises", new Map());
|
|
@@ -45,12 +47,9 @@ const registerIcon = (name, iconData) => {
|
|
|
45
47
|
});
|
|
46
48
|
};
|
|
47
49
|
/**
|
|
48
|
-
* Processes the full icon name and splits it into - "name", "collection"
|
|
49
|
-
* to form the proper registry key ("collection/name") under which the icon is registered:
|
|
50
|
-
*
|
|
50
|
+
* Processes the full icon name and splits it into - "name", "collection".
|
|
51
51
|
* - removes legacy protocol ("sap-icon://")
|
|
52
52
|
* - resolves aliases (f.e "SAP-icons-TNT/actor" => "tnt/actor")
|
|
53
|
-
* - determines theme dependant icon collection (f.e "home" => "SAP-icons-v4/home" in Quartz | "SAP-icons-v5/home" in Horizon)
|
|
54
53
|
*
|
|
55
54
|
* @param { string } name
|
|
56
55
|
* @return { object }
|
|
@@ -66,19 +65,17 @@ const processName = (name) => {
|
|
|
66
65
|
if (collection) {
|
|
67
66
|
collection = getIconCollectionByAlias(collection);
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
const registryKey = `${collection}/${name}`;
|
|
71
|
-
return { name, collection, registryKey };
|
|
68
|
+
return { name, collection };
|
|
72
69
|
};
|
|
73
|
-
const getIconDataSync = (
|
|
74
|
-
const {
|
|
75
|
-
return
|
|
70
|
+
const getIconDataSync = (iconName) => {
|
|
71
|
+
const { name, collection } = processName(iconName);
|
|
72
|
+
return getRegisteredIconData(collection, name);
|
|
76
73
|
};
|
|
77
|
-
const getIconData = async (
|
|
78
|
-
const {
|
|
74
|
+
const getIconData = async (iconName) => {
|
|
75
|
+
const { name, collection } = processName(iconName);
|
|
79
76
|
let iconData = ICON_NOT_FOUND;
|
|
80
77
|
try {
|
|
81
|
-
iconData = (await _loadIconCollectionOnce(collection));
|
|
78
|
+
iconData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)));
|
|
82
79
|
}
|
|
83
80
|
catch (error) {
|
|
84
81
|
const e = error;
|
|
@@ -87,10 +84,24 @@ const getIconData = async (name) => {
|
|
|
87
84
|
if (iconData === ICON_NOT_FOUND) {
|
|
88
85
|
return iconData;
|
|
89
86
|
}
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
const registeredIconData = getRegisteredIconData(collection, name);
|
|
88
|
+
if (registeredIconData) {
|
|
89
|
+
return registeredIconData;
|
|
90
|
+
}
|
|
91
|
+
// not filled by another await. many getters will await on the same loader, but fill only once
|
|
92
|
+
if (Array.isArray(iconData)) {
|
|
93
|
+
iconData.forEach(data => {
|
|
94
|
+
_fillRegistry(data);
|
|
95
|
+
registerIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
92
99
|
_fillRegistry(iconData);
|
|
93
100
|
}
|
|
101
|
+
return getRegisteredIconData(collection, name);
|
|
102
|
+
};
|
|
103
|
+
const getRegisteredIconData = (collection, name) => {
|
|
104
|
+
const registryKey = `${getEffectiveIconCollection(collection)}/${name}`;
|
|
94
105
|
return registry.get(registryKey);
|
|
95
106
|
};
|
|
96
107
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"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","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"../assets-meta/IconCollectionsAlias.js\";\nimport { getEffectiveIconCollection } from \"../config/Icons.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\"\n * to form the proper registry key (\"collection/name\") under which the icon is registered:\n *\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n * - determines theme dependant icon collection (f.e \"home\" => \"SAP-icons-v4/home\" in Quartz | \"SAP-icons-v5/home\" in Horizon)\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\tcollection = getEffectiveIconCollection(collection);\n\n\tconst registryKey = `${collection}/${name}`;\n\treturn { name, collection, registryKey };\n};\n\nconst getIconDataSync = (name: string) => {\n\tconst { registryKey } = processName(name);\n\treturn registry.get(registryKey);\n};\n\nconst getIconData = async (name: string) => {\n\tconst { collection, registryKey } = processName(name);\n\n\tlet iconData: string | CollectionData = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(collection))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tif (!registry.has(registryKey)) {\n\t\t// not filled by another await. many getters will await on the same loader, but fill only once\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"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","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"./util/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_belize_* and sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
|
|
@@ -16,9 +16,8 @@ declare enum IconCollectionsAlias {
|
|
|
16
16
|
"BusinessSuiteInAppSymbols" = "business-suite"
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Returns the
|
|
19
|
+
* Returns the collection name for a given alias:
|
|
20
20
|
*
|
|
21
|
-
* <b>For example</b>:
|
|
22
21
|
* - "SAP-icons-TNT"resolves to "tnt"
|
|
23
22
|
* - "BusinessSuiteInAppSymbols" resolves to "business-suite"
|
|
24
23
|
* - "horizon" resolves to "SAP-icons-v5"
|
|
@@ -17,9 +17,8 @@ var IconCollectionsAlias;
|
|
|
17
17
|
IconCollectionsAlias["BusinessSuiteInAppSymbols"] = "business-suite";
|
|
18
18
|
})(IconCollectionsAlias || (IconCollectionsAlias = {}));
|
|
19
19
|
/**
|
|
20
|
-
* Returns the
|
|
20
|
+
* Returns the collection name for a given alias:
|
|
21
21
|
*
|
|
22
|
-
* <b>For example</b>:
|
|
23
22
|
* - "SAP-icons-TNT"resolves to "tnt"
|
|
24
23
|
* - "BusinessSuiteInAppSymbols" resolves to "business-suite"
|
|
25
24
|
* - "horizon" resolves to "SAP-icons-v5"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACxB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;AAC/C,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC3D,IAAI,oBAAoB,CAAC,cAAmD,CAAC,EAAE;QAC9E,OAAO,oBAAoB,CAAC,cAAmD,CAAC,CAAC;KACjF;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC;AACpC,OAAO,EACN,wBAAwB,GACxB,CAAC","sourcesContent":["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the collection name for a given alias:\n *\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare enum RegisteredIconCollection {
|
|
2
|
+
SAPIconsV4 = "SAP-icons-v4",
|
|
3
|
+
SAPIconsV5 = "SAP-icons-v5",
|
|
4
|
+
SAPIconsTNTV2 = "tnt-v2",
|
|
5
|
+
SAPIconsTNTV3 = "tnt-v3",
|
|
6
|
+
SAPBSIconsV1 = "business-suite-v1",
|
|
7
|
+
SAPBSIconsV2 = "business-suite-v2"
|
|
8
|
+
}
|
|
9
|
+
type ThemeToCollectionMap = {
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Registers collection version per theme.
|
|
14
|
+
* </b>For exmaple:</b> registerIconCollectionForTheme("my-custom-icons", {"sap_horizon": "my-custom-icons-v5"})
|
|
15
|
+
* @param { string } collectionName
|
|
16
|
+
* @param { ThemeToCollectionMap } themeCollectionMap
|
|
17
|
+
*/
|
|
18
|
+
declare const registerIconCollectionForTheme: (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => void;
|
|
19
|
+
declare const getIconCollectionForTheme: (collectionName: string) => string;
|
|
20
|
+
export { registerIconCollectionForTheme, getIconCollectionForTheme, RegisteredIconCollection, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isLegacyThemeFamily } from "../../config/Theme.js";
|
|
2
|
+
var RegisteredIconCollection;
|
|
3
|
+
(function (RegisteredIconCollection) {
|
|
4
|
+
RegisteredIconCollection["SAPIconsV4"] = "SAP-icons-v4";
|
|
5
|
+
RegisteredIconCollection["SAPIconsV5"] = "SAP-icons-v5";
|
|
6
|
+
RegisteredIconCollection["SAPIconsTNTV2"] = "tnt-v2";
|
|
7
|
+
RegisteredIconCollection["SAPIconsTNTV3"] = "tnt-v3";
|
|
8
|
+
RegisteredIconCollection["SAPBSIconsV1"] = "business-suite-v1";
|
|
9
|
+
RegisteredIconCollection["SAPBSIconsV2"] = "business-suite-v2";
|
|
10
|
+
})(RegisteredIconCollection || (RegisteredIconCollection = {}));
|
|
11
|
+
const iconCollections = new Map();
|
|
12
|
+
iconCollections.set("SAP-icons", {
|
|
13
|
+
"legacy": RegisteredIconCollection.SAPIconsV4,
|
|
14
|
+
"sap_horizon": RegisteredIconCollection.SAPIconsV5,
|
|
15
|
+
});
|
|
16
|
+
iconCollections.set("tnt", {
|
|
17
|
+
"legacy": RegisteredIconCollection.SAPIconsTNTV2,
|
|
18
|
+
"sap_horizon": RegisteredIconCollection.SAPIconsTNTV3,
|
|
19
|
+
});
|
|
20
|
+
iconCollections.set("business-suite", {
|
|
21
|
+
"legacy": RegisteredIconCollection.SAPBSIconsV1,
|
|
22
|
+
"sap_horizon": RegisteredIconCollection.SAPBSIconsV2,
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Registers collection version per theme.
|
|
26
|
+
* </b>For exmaple:</b> registerIconCollectionForTheme("my-custom-icons", {"sap_horizon": "my-custom-icons-v5"})
|
|
27
|
+
* @param { string } collectionName
|
|
28
|
+
* @param { ThemeToCollectionMap } themeCollectionMap
|
|
29
|
+
*/
|
|
30
|
+
const registerIconCollectionForTheme = (collectionName, themeCollectionMap) => {
|
|
31
|
+
if (iconCollections.has(collectionName)) {
|
|
32
|
+
iconCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
iconCollections.set(collectionName, themeCollectionMap);
|
|
36
|
+
};
|
|
37
|
+
const getIconCollectionForTheme = (collectionName) => {
|
|
38
|
+
const themeFamily = isLegacyThemeFamily() ? "legacy" : "sap_horizon";
|
|
39
|
+
return iconCollections.has(collectionName) ? iconCollections.get(collectionName)[themeFamily] : collectionName;
|
|
40
|
+
};
|
|
41
|
+
export { registerIconCollectionForTheme, getIconCollectionForTheme, RegisteredIconCollection, };
|
|
42
|
+
//# sourceMappingURL=IconCollectionsByTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconCollectionsByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,IAAK,wBAOJ;AAPD,WAAK,wBAAwB;IAC5B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,oDAAwB,CAAA;IACxB,oDAAwB,CAAA;IACxB,8DAAkC,CAAA;IAClC,8DAAkC,CAAA;AACnC,CAAC,EAPI,wBAAwB,KAAxB,wBAAwB,QAO5B;AAID,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAChE,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE;IAChC,QAAQ,EAAE,wBAAwB,CAAC,UAAU;IAC7C,aAAa,EAAE,wBAAwB,CAAC,UAAU;CAClD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE;IAC1B,QAAQ,EAAE,wBAAwB,CAAC,aAAa;IAChD,aAAa,EAAE,wBAAwB,CAAC,aAAa;CACrD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE;IACrC,QAAQ,EAAE,wBAAwB,CAAC,YAAY;IAC/C,aAAa,EAAE,wBAAwB,CAAC,YAAY;CACpD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,CAAC,cAAsB,EAAE,kBAAwC,EAAE,EAAE;IAC3G,IAAI,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;QACxC,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvG,OAAO;KACP;IACD,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC5D,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC;IACrE,OAAO,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,cAAc,CAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;AACjH,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,GACxB,CAAC","sourcesContent":["import { isLegacyThemeFamily } from \"../../config/Theme.js\";\n\nenum RegisteredIconCollection {\n\tSAPIconsV4 = \"SAP-icons-v4\",\n\tSAPIconsV5 = \"SAP-icons-v5\",\n\tSAPIconsTNTV2 = \"tnt-v2\",\n\tSAPIconsTNTV3 = \"tnt-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\n\ntype ThemeToCollectionMap = {[x: string]: string; };\n\nconst iconCollections = new Map<string, ThemeToCollectionMap>();\niconCollections.set(\"SAP-icons\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsV4,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsV5,\n});\niconCollections.set(\"tnt\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsTNTV2,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsTNTV3,\n});\niconCollections.set(\"business-suite\", {\n\t\"legacy\": RegisteredIconCollection.SAPBSIconsV1,\n\t\"sap_horizon\": RegisteredIconCollection.SAPBSIconsV2,\n});\n\n/**\n * Registers collection version per theme.\n * </b>For exmaple:</b> registerIconCollectionForTheme(\"my-custom-icons\", {\"sap_horizon\": \"my-custom-icons-v5\"})\n * @param { string } collectionName\n * @param { ThemeToCollectionMap } themeCollectionMap\n */\nconst registerIconCollectionForTheme = (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => {\n\tif (iconCollections.has(collectionName)) {\n\t\ticonCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });\n\t\treturn;\n\t}\n\ticonCollections.set(collectionName, themeCollectionMap);\n};\n\nconst getIconCollectionForTheme = (collectionName: string) => {\n\tconst themeFamily = isLegacyThemeFamily() ? \"legacy\" : \"sap_horizon\";\n\treturn iconCollections.has(collectionName) ? iconCollections.get(collectionName)![themeFamily] : collectionName;\n};\n\nexport {\n\tregisterIconCollectionForTheme,\n\tgetIconCollectionForTheme,\n\tRegisteredIconCollection,\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IconCollection } from "../../config/Icons.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the effective theme dependant icon collection:
|
|
4
|
+
*
|
|
5
|
+
* - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon"
|
|
6
|
+
* - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
|
|
7
|
+
* - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
|
|
8
|
+
*
|
|
9
|
+
* @param { IconCollection } collectionName
|
|
10
|
+
* @returns { IconCollection } the effective collection name
|
|
11
|
+
*/
|
|
12
|
+
declare const getEffectiveIconCollection: (collectionName?: IconCollection) => IconCollection;
|
|
13
|
+
export default getEffectiveIconCollection;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getTheme } from "../../config/Theme.js";
|
|
2
|
+
import { getDefaultIconCollection } from "../../config/Icons.js";
|
|
3
|
+
import { getIconCollectionByAlias } from "./IconCollectionsAlias.js";
|
|
4
|
+
import { getIconCollectionForTheme } from "./IconCollectionsByTheme.js";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the effective theme dependant icon collection:
|
|
7
|
+
*
|
|
8
|
+
* - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon"
|
|
9
|
+
* - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
|
|
10
|
+
* - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
|
|
11
|
+
*
|
|
12
|
+
* @param { IconCollection } collectionName
|
|
13
|
+
* @returns { IconCollection } the effective collection name
|
|
14
|
+
*/
|
|
15
|
+
const getEffectiveIconCollection = (collectionName) => {
|
|
16
|
+
const defaultIconCollection = getDefaultIconCollection(getTheme());
|
|
17
|
+
// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.
|
|
18
|
+
if (!collectionName && defaultIconCollection) {
|
|
19
|
+
return getIconCollectionByAlias(defaultIconCollection);
|
|
20
|
+
}
|
|
21
|
+
// no collection - return "SAP-icons-v4" or "SAP-icons-v5".
|
|
22
|
+
if (!collectionName) {
|
|
23
|
+
return getIconCollectionForTheme("SAP-icons");
|
|
24
|
+
}
|
|
25
|
+
// has collection - return "SAP-icons-v4", "SAP-icons-v5", "tnt-v1", "tnt-v2", "business-suite-v1", "business-suite-v2", or custom ones.
|
|
26
|
+
return getIconCollectionForTheme(collectionName);
|
|
27
|
+
};
|
|
28
|
+
export default getEffectiveIconCollection;
|
|
29
|
+
//# sourceMappingURL=getIconCollectionByTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIconCollectionByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/getIconCollectionByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,cAA+B,EAAkB,EAAE;IACtF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnE,uHAAuH;IACvH,IAAI,CAAC,cAAc,IAAI,qBAAqB,EAAE;QAC7C,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;KACvD;IAED,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE;QACpB,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC9C;IAED,wIAAwI;IACxI,OAAO,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and \"Belize\", and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\", \"Belize\", and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\", \"Belize\", and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const E={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"]}},k=E.themes.default,ht=E.themes.all,V=E.languages.default,f=E.locales.default,de=E.locales.all,pt=()=>{const e=navigator.languages,t=()=>navigator.language;return e&&e[0]||t()||V};var Me={},ke=Me.hasOwnProperty,gt=Me.toString,ze=ke.toString,mt=ze.call(Object),he=function(e){var t,n;return!e||gt.call(e)!=="[object Object]"?!1:(t=Object.getPrototypeOf(e),t?(n=ke.call(t,"constructor")&&t.constructor,typeof n=="function"&&ze.call(n)===mt):!0)},wt=Object.create(null),xe=function(e,t,n,s){var o,r,a,i,m,w,h=arguments[2]||{},W=3,ft=arguments.length,fe=arguments[0]||!1,dt=arguments[1]?void 0:wt;for(typeof h!="object"&&typeof h!="function"&&(h={});W<ft;W++)if((m=arguments[W])!=null)for(i in m)o=h[i],a=m[i],!(i==="__proto__"||h===a)&&(fe&&a&&(he(a)||(r=Array.isArray(a)))?(r?(r=!1,w=o&&Array.isArray(o)?o:[]):w=o&&he(o)?o:{},h[i]=xe(fe,arguments[1],w,a)):a!==dt&&(h[i]=a));return h};const Be=function(e,t){return xe(!0,!1,...arguments)},Fe=new Map,yt=(e,t)=>{Fe.set(e,t)},T=e=>Fe.get(e),St=e=>{const t=document.querySelector(`META[name="${e}"]`);return t&&t.getAttribute("content")},_t=e=>{const t=St("sap-allowedThemeOrigins");return t&&t.split(",").some(n=>n==="*"||e===n.trim())},Tt=(e,t)=>{const n=new URL(e).pathname;return new URL(n,t).toString()},Ve=e=>{let t;try{if(e.startsWith(".")||e.startsWith("/"))t=new URL(e,window.location.href).toString();else{const n=new URL(e),s=n.origin;s&&_t(s)?t=n.toString():t=Tt(n.toString(),window.location.href)}return t.endsWith("/")||(t=`${t}/`),`${t}UI5/`}catch{}};var ee;(function(e){e.Full="full",e.Basic="basic",e.Minimal="minimal",e.None="none"})(ee||(ee={}));const bt=ee;let pe=!1,u={animationMode:bt.Full,theme:k,themeRoot:void 0,rtl:void 0,language:void 0,timezone:void 0,calendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1};const ts=()=>(d(),u.animationMode),Lt=()=>(d(),u.theme),At=()=>(d(),u.themeRoot),ns=()=>(d(),u.rtl),vt=()=>(d(),u.language),Ct=()=>(d(),u.fetchDefaultLanguage),ss=()=>(d(),u.noConflict),os=()=>(d(),u.calendarType),rs=()=>(d(),u.formatSettings),z=new Map;z.set("true",!0);z.set("false",!1);const Et=()=>{const e=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let t;if(e){try{t=JSON.parse(e.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}t&&(u=Be(u,t))}},Pt=()=>{const e=new URLSearchParams(window.location.search);e.forEach((t,n)=>{const s=n.split("sap-").length;s===0||s===n.split("sap-ui-").length||ge(n,t,"sap")}),e.forEach((t,n)=>{!n.startsWith("sap-ui")||ge(n,t,"sap-ui")})},It=e=>{const t=e.split("@")[1];return Ve(t)},$t=(e,t)=>e==="theme"&&t.includes("@")?t.split("@")[0]:t,ge=(e,t,n)=>{const s=t.toLowerCase(),o=e.split(`${n}-`)[1];z.has(t)&&(t=z.get(s)),o==="theme"?(u.theme=$t(o,t),t&&t.includes("@")&&(u.themeRoot=It(t))):u[o]=t},Rt=()=>{const e=T("OpenUI5Support");if(!e||!e.isOpenUI5Detected())return;const t=e.getConfigurationSettingsObject();u=Be(u,t)},d=()=>{typeof document>"u"||pe||(Et(),Pt(),Rt(),pe=!0)};class P{constructor(){this._eventRegistry=new Map}attachEvent(t,n){const s=this._eventRegistry,o=s.get(t);if(!Array.isArray(o)){s.set(t,[n]);return}o.includes(n)||o.push(n)}detachEvent(t,n){const s=this._eventRegistry,o=s.get(t);if(!o)return;const r=o.indexOf(n);r!==-1&&o.splice(r,1),o.length===0&&s.delete(t)}fireEvent(t,n){const o=this._eventRegistry.get(t);return o?o.map(r=>r.call(this,n)):[]}fireEventAsync(t,n){return Promise.all(this.fireEvent(t,n))}isHandlerAttached(t,n){const o=this._eventRegistry.get(t);return o?o.includes(n):!1}hasListeners(t){return!!this._eventRegistry.get(t)}}const je=new P,qe="languageChange",Ze=e=>{je.attachEvent(qe,e)},Ot=e=>je.fireEventAsync(qe,e),me=10;class Dt{constructor(){this.list=[],this.lookup=new Set}add(t){this.lookup.has(t)||(this.list.push(t),this.lookup.add(t))}remove(t){!this.lookup.has(t)||(this.list=this.list.filter(n=>n!==t),this.lookup.delete(t))}shift(){const t=this.list.shift();if(t)return this.lookup.delete(t),t}isEmpty(){return this.list.length===0}isAdded(t){return this.lookup.has(t)}process(t){let n;const s=new Map;for(n=this.shift();n;){const o=s.get(n)||0;if(o>me)throw new Error(`Web component processed too many times this task, max allowed is: ${me}`);t(n),s.set(n,o+1),n=this.shift()}}}const Ut=(e,t=document.body,n)=>{let s=document.querySelector(e);return s||(s=n?n():document.createElement(e),t.insertBefore(s,t.firstChild))},Mt=()=>{const e=document.createElement("meta");return e.setAttribute("name","ui5-shared-resources"),e.setAttribute("content",""),e},kt=()=>typeof document>"u"?null:Ut('meta[name="ui5-shared-resources"]',document.head,Mt),I=(e,t)=>{const n=e.split(".");let s=kt();if(!s)return t;for(let o=0;o<n.length;o++){const r=n[o],a=o===n.length-1;Object.prototype.hasOwnProperty.call(s,r)||(s[r]=a?t:{}),s=s[r]}return s},zt={version:"1.16.0",major:1,minor:16,patch:0,suffix:"",isNext:!1,buildTime:1691061047};let U,xt="";const N=new Map,v=I("Runtimes",[]),Bt=()=>{if(U===void 0){U=v.length;const e=zt;v.push({...e,alias:xt,description:`Runtime ${U} - ver ${e.version}`})}},$=()=>U,Ft=(e,t)=>{const n=`${e},${t}`;if(N.has(n))return N.get(n);const s=v[e],o=v[t];if(!s||!o)throw new Error("Invalid runtime index supplied");if(s.isNext||o.isNext)return s.buildTime-o.buildTime;const r=s.major-o.major;if(r)return r;const a=s.minor-o.minor;if(a)return a;const i=s.patch-o.patch;if(i)return i;const w=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare(s.suffix,o.suffix);return N.set(n,w),w},Vt=()=>v,We=I("Tags",new Map),oe=new Set;let g=new Map,H;const Ne=-1,as=e=>{oe.add(e),We.set(e,$())},is=e=>oe.has(e),jt=()=>[...oe.values()],cs=e=>{let t=We.get(e);t===void 0&&(t=Ne),g.has(t)||g.set(t,new Set),g.get(t).add(e),H||(H=setTimeout(()=>{qt(),g=new Map,H=void 0},1e3))},qt=()=>{const e=Vt(),t=$(),n=e[t];let s="Multiple UI5 Web Components instances detected.";e.length>1&&(s=`${s}
|
|
2
|
+
Loading order (versions before 1.1.0 not listed): ${e.map(o=>`
|
|
3
|
+
${o.description}`).join("")}`),[...g.keys()].forEach(o=>{let r,a;o===Ne?(r=1,a={description:"Older unknown runtime"}):(r=Ft(t,o),a=e[o]);let i;r>0?i="an older":r<0?i="a newer":i="the same",s=`${s}
|
|
4
|
+
|
|
5
|
+
"${n.description}" failed to define ${g.get(o).size} tag(s) as they were defined by a runtime of ${i} version "${a.description}": ${[...g.get(o)].sort().join(", ")}.`,r>0?s=`${s}
|
|
6
|
+
WARNING! If your code uses features of the above web components, unavailable in ${a.description}, it might not work as expected!`:s=`${s}
|
|
7
|
+
Since the above web components were defined by the same or newer version runtime, they should be compatible with your code.`}),s=`${s}
|
|
8
|
+
|
|
9
|
+
To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(s)},He=new Set,us=e=>{He.add(e)},Zt=e=>He.has(e),re=new Set,Wt=new P,b=new Dt;let y,M,G,O;const Nt=async e=>{b.add(e),await Gt()},Ht=e=>{Wt.fireEvent("beforeComponentRender",e),re.add(e),e._render()},ls=e=>{b.remove(e),re.delete(e)},Gt=async()=>{O||(O=new Promise(e=>{window.requestAnimationFrame(()=>{b.process(Ht),O=null,e(),G||(G=setTimeout(()=>{G=void 0,b.isEmpty()&&Yt()},200))})})),await O},Kt=()=>y||(y=new Promise(e=>{M=e,window.requestAnimationFrame(()=>{b.isEmpty()&&(y=void 0,e())})}),y),Jt=()=>{const e=jt().map(t=>customElements.whenDefined(t));return Promise.all(e)},Xt=async()=>{await Jt(),await Kt()},Yt=()=>{!b.isEmpty()||M&&(M(),M=void 0,y=void 0)},Ge=async e=>{re.forEach(t=>{const n=t.constructor,s=n.getMetadata().getTag(),o=Zt(n),r=n.getMetadata().isLanguageAware(),a=n.getMetadata().isThemeAware();(!e||e.tag===s||e.rtlAware&&o||e.languageAware&&r||e.themeAware&&a)&&Nt(t)}),await Xt()};let L,te;const Qt=()=>(L===void 0&&(L=vt()),L),fs=async e=>{L!==e&&(L=e,await Ot(e),await Ge({languageAware:!0}))},en=e=>{te=e},tn=()=>(te===void 0&&en(Ct()),te),nn=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i;class Ke{constructor(t){const n=nn.exec(t.replace(/_/g,"-"));if(n===null)throw new Error(`The given language ${t} does not adhere to BCP-47.`);this.sLocaleId=t,this.sLanguage=n[1]||V,this.sScript=n[2]||"",this.sRegion=n[3]||"",this.sVariant=n[4]&&n[4].slice(1)||null,this.sExtension=n[5]&&n[5].slice(1)||null,this.sPrivateUse=n[6]||null,this.sLanguage&&(this.sLanguage=this.sLanguage.toLowerCase()),this.sScript&&(this.sScript=this.sScript.toLowerCase().replace(/^[a-z]/,s=>s.toUpperCase())),this.sRegion&&(this.sRegion=this.sRegion.toUpperCase())}getLanguage(){return this.sLanguage}getScript(){return this.sScript}getRegion(){return this.sRegion}getVariant(){return this.sVariant}getVariantSubtags(){return this.sVariant?this.sVariant.split("-"):[]}getExtension(){return this.sExtension}getExtensionSubtags(){return this.sExtension?this.sExtension.slice(2).split("-"):[]}getPrivateUse(){return this.sPrivateUse}getPrivateUseSubtags(){return this.sPrivateUse?this.sPrivateUse.slice(2).split("-"):[]}hasPrivateUseSubtag(t){return this.getPrivateUseSubtags().indexOf(t)>=0}toString(){const t=[this.sLanguage];return this.sScript&&t.push(this.sScript),this.sRegion&&t.push(this.sRegion),this.sVariant&&t.push(this.sVariant),this.sExtension&&t.push(this.sExtension),this.sPrivateUse&&t.push(this.sPrivateUse),t.join("-")}}const K=new Map,Je=e=>(K.has(e)||K.set(e,new Ke(e)),K.get(e)),we=e=>{try{if(e&&typeof e=="string")return Je(e)}catch{}return new Ke(f)},ne=e=>{if(e)return we(e);const t=Qt();return t?Je(t):we(pt())},sn=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i,ye=/(?:^|-)(saptrc|sappsd)(?:-|$)/i,on={he:"iw",yi:"ji",nb:"no",sr:"sh"},rn=e=>{let t;if(!e)return f;if(typeof e=="string"&&(t=sn.exec(e.replace(/_/g,"-")))){let n=t[1].toLowerCase(),s=t[3]?t[3].toUpperCase():void 0;const o=t[2]?t[2].toLowerCase():void 0,r=t[4]?t[4].slice(1):void 0,a=t[6];return n=on[n]||n,a&&(t=ye.exec(a))||r&&(t=ye.exec(r))?`en_US_${t[1].toLowerCase()}`:(n==="zh"&&!s&&(o==="hans"?s="CN":o==="hant"&&(s="TW")),n+(s?"_"+s+(r?"_"+r.replace("-","_"):""):""))}return f},an=e=>{if(!e)return f;if(e==="zh_HK")return"zh_TW";const t=e.lastIndexOf("_");return t>=0?e.slice(0,t):e!==f?f:""},Se=new Set,_e=new Set,ae=new Map,J=new Map,ie=new Map,ds=(e,t,n)=>{const s=`${e}/${t}`;ie.set(s,n)},Te=(e,t)=>{ae.set(e,t)},hs=e=>ae.get(e),Xe=(e,t)=>{const n=`${e}/${t}`;return ie.has(n)},cn=(e,t)=>{const n=`${e}/${t}`,s=ie.get(n);return s&&!J.get(n)&&J.set(n,s(t)),J.get(n)},un=e=>{Se.has(e)||(console.warn(`[${e}]: Message bundle assets are not configured. Falling back to English texts.`,` Add \`import "${e}/dist/Assets.js"\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section "Assets" in the documentation for more information.`),Se.add(e))},be=(e,t)=>t!==V&&!Xe(e,t),ln=async e=>{const t=ne().getLanguage(),n=ne().getRegion();let s=t+(n?`-${n}`:"");if(be(e,s))for(s=rn(s);be(e,s);)s=an(s);const o=tn();if(s===V&&!o){Te(e,null);return}if(!Xe(e,s)){un(e);return}try{const r=await cn(e,s);Te(e,r)}catch(r){const a=r;_e.has(a.message)||(_e.add(a.message),console.error(a.message))}};Ze(e=>{const t=[...ae.keys()];return Promise.all(t.map(ln))});const fn=new Map,x=new Map,X=new Map,Le=new Set;let Ae=!1;const dn={iw:"he",ji:"yi",in:"id"},ve=e=>{Ae||(console.warn(`[LocaleData] Supported locale "${e}" not configured, import the "Assets.js" module from the webcomponents package you are using.`),Ae=!0)},hn=(e,t,n)=>{e=e&&dn[e]||e,e==="no"&&(e="nb"),e==="zh"&&!t&&(n==="Hans"?t="CN":n==="Hant"&&(t="TW")),(e==="sh"||e==="sr"&&n==="Latn")&&(e="sr",t="Latn");let s=`${e}_${t}`;return de.includes(s)||(s=e,de.includes(s))?x.has(s)?s:(ve(s),f):f},Ce=(e,t)=>{fn.set(e,t)},pn=e=>{if(!X.get(e)){const t=x.get(e);if(!t)throw new Error(`CLDR data for locale ${e} is not loaded!`);X.set(e,t(e))}return X.get(e)},gn=async(e,t,n)=>{const s=hn(e,t,n),o=T("OpenUI5Support");if(o){const r=o.getLocaleDataObject();if(r){Ce(s,r);return}}try{const r=await pn(s);Ce(s,r)}catch(r){const a=r;Le.has(a.message)||(Le.add(a.message),console.error(a.message))}},mn=(e,t)=>{x.set(e,t)};mn("en",async()=>(await fetch("https://sdk.openui5.org/1.103.0/resources/sap/ui/core/cldr/en.json")).json());Ze(()=>{const e=ne();return gn(e.getLanguage(),e.getRegion(),e.getScript())});const Ye=new P,Qe="themeRegistered",wn=e=>{Ye.attachEvent(Qe,e)},yn=e=>Ye.fireEvent(Qe,e),et=new Map,tt=new Map,nt=new Set,B=new Set,ps=(e,t,n)=>{tt.set(`${e}/${t}`,n),nt.add(e),B.add(t),yn(t)},st=async(e,t)=>{const n=et.get(`${e}_${t}`);if(n!==void 0)return n;if(!B.has(t)){const s=[...B.values()].join(", ");return console.warn(`You have requested a non-registered theme ${t} - falling back to ${k}. Registered themes are: ${s}`),Ee(e,k)}return Ee(e,t)},Ee=async(e,t)=>{const n=tt.get(`${e}/${t}`);if(!n){console.error(`Theme [${t}] not registered for package [${e}]`);return}let s;try{s=await n(t)}catch(r){console.error(e,r.message);return}const o=s._||s;return et.set(`${e}_${t}`,o),o},ot=()=>nt,Sn=e=>B.has(e);var F;(function(e){e["SAP-icons"]="SAP-icons-v4",e.horizon="SAP-icons-v5",e["SAP-icons-TNT"]="tnt",e.BusinessSuiteInAppSymbols="business-suite"})(F||(F={}));const rt=e=>F[e]?F[e]:e,_n=(e,t)=>{const n=document.createElement("style");return n.type="text/css",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.textContent=e,document.head.appendChild(n),n},Tn=(e,t)=>{const n=document.createElement("link");return n.type="text/css",n.rel="stylesheet",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.href=e,document.head.appendChild(n),new Promise(s=>{n.addEventListener("load",s),n.addEventListener("error",s)})},j=(e,t)=>t?`${e}|${t}`:e,q=(e,t,n="")=>{let s=typeof e=="string"?e:e.content;if(s.includes("[_ui5host]")&&(s=s.replaceAll("[_ui5host]",`[_ui5rt${$()}]`)),document.adoptedStyleSheets){const o=new CSSStyleSheet;o.replaceSync(s),o._ui5StyleId=j(t,n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}else{const o={};o[t]=n,_n(s,o)}},bn=(e,t,n="")=>{let s=typeof e=="string"?e:e.content;if(s.includes("[_ui5host]")&&(s=s.replaceAll("[_ui5host]",`[_ui5rt${$()}]`)),document.adoptedStyleSheets){const o=document.adoptedStyleSheets.find(r=>r._ui5StyleId===j(t,n));o&&o.replaceSync(s||"")}else{const o=document.querySelector(`head>style[${t}="${n}"]`);o&&(o.textContent=s||"")}},Z=(e,t="")=>document.adoptedStyleSheets?!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===j(e,t)):!!document.querySelector(`head>style[${e}="${t}"]`),Ln=(e,t="")=>{var n;if(document.adoptedStyleSheets)document.adoptedStyleSheets=document.adoptedStyleSheets.filter(s=>s._ui5StyleId!==j(e,t));else{const s=document.querySelector(`head > style[${e}="${t}"]`);(n=s==null?void 0:s.parentElement)==null||n.removeChild(s)}},at=(e,t,n="")=>{Z(t,n)?bn(e,t,n):q(e,t,n)},S=new Set,An=()=>{let e=document.querySelector(".sapThemeMetaData-Base-baseLib")||document.querySelector(".sapThemeMetaData-UI5-sap-ui-core");if(e)return getComputedStyle(e).backgroundImage;e=document.createElement("span"),e.style.display="none",e.classList.add("sapThemeMetaData-Base-baseLib"),document.body.appendChild(e);let t=getComputedStyle(e).backgroundImage;return t==="none"&&(e.classList.add("sapThemeMetaData-UI5-sap-ui-core"),t=getComputedStyle(e).backgroundImage),document.body.removeChild(e),t},vn=e=>{const t=/\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(e);if(t&&t.length>=2){let n=t[1];if(n=n.replace(/\\"/g,'"'),n.charAt(0)!=="{"&&n.charAt(n.length-1)!=="}")try{n=decodeURIComponent(n)}catch{S.has("decode")||(console.warn("Malformed theme metadata string, unable to decodeURIComponent"),S.add("decode"));return}try{return JSON.parse(n)}catch{S.has("parse")||(console.warn("Malformed theme metadata string, unable to parse JSON"),S.add("parse"))}}},Cn=e=>{let t,n;try{t=e.Path.match(/\.([^.]+)\.css_variables$/)[1],n=e.Extends[0]}catch{S.has("object")||(console.warn("Malformed theme metadata Object",e),S.add("object"));return}return{themeName:t,baseThemeName:n}},se=()=>{const e=An();if(!e||e==="none")return;const t=vn(e);if(t)return Cn(t)},En=new P,Pn="themeLoaded",In=e=>En.fireEvent(Pn,e);let A;const it=()=>(A===void 0&&(A=At()),A),gs=e=>{if(A!==e){if(A=e,!Ve(e)){console.warn(`The ${e} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}return ct(R())}},$n=e=>`${it()}Base/baseLib/${e}/css_variables.css`,ct=async e=>{const t=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);t&&document.head.removeChild(t),await Tn($n(e),{"sap-ui-webcomponents-theme":e})},Rn=I("PopupUtilsData",{currentZIndex:100}),Pe=()=>Rn.currentZIndex;class c{static isAtLeastVersion116(){const n=window.sap.ui.version.split(".");return!n||n.length<2?!1:parseInt(n[0])>1||parseInt(n[1])>=116}static isOpenUI5Detected(){var t,n;return typeof((n=(t=window.sap)==null?void 0:t.ui)==null?void 0:n.require)=="function"}static init(){return c.isOpenUI5Detected()?new Promise(t=>{window.sap.ui.require(["sap/ui/core/Core"],async n=>{const s=()=>{let o=["sap/ui/core/Popup","sap/ui/core/LocaleData"];c.isAtLeastVersion116()&&(o=[...o,"sap/base/i18n/Formatting","sap/base/i18n/Localization","sap/ui/core/ControlBehavior","sap/ui/core/Theming","sap/ui/core/date/CalendarUtils"]),window.sap.ui.require(o,r=>{r.setInitialZIndex(Pe()),t()})};c.isAtLeastVersion116()?(await n.ready(),s()):n.attachInit(s)})}):Promise.resolve()}static getConfigurationSettingsObject(){if(!c.isOpenUI5Detected())return{};if(c.isAtLeastVersion116()){const o=window.sap.ui.require("sap/ui/core/ControlBehavior"),r=window.sap.ui.require("sap/base/i18n/Localization"),a=window.sap.ui.require("sap/ui/core/Theming"),i=window.sap.ui.require("sap/base/i18n/Formatting"),m=window.sap.ui.require("sap/ui/core/date/CalendarUtils");return{animationMode:o.getAnimationMode(),language:r.getLanguage(),theme:a.getTheme(),themeRoot:a.getThemeRoot(),rtl:r.getRTL(),timezone:r.getTimezone(),calendarType:i.getCalendarType(),formatSettings:{firstDayOfWeek:m.getWeekConfigurationValues().firstDayOfWeek,legacyDateCalendarCustomizing:i.getLegacyDateCalendarCustomizing()}}}const n=window.sap.ui.require("sap/ui/core/Core").getConfiguration(),s=window.sap.ui.require("sap/ui/core/LocaleData");return{animationMode:n.getAnimationMode(),language:n.getLanguage(),theme:n.getTheme(),themeRoot:n.getThemeRoot(),rtl:n.getRTL(),timezone:n.getTimezone(),calendarType:n.getCalendarType(),formatSettings:{firstDayOfWeek:s?s.getInstance(n.getLocale()).getFirstDayOfWeek():void 0,legacyDateCalendarCustomizing:n.getFormatSettings().getLegacyDateCalendarCustomizing()}}}static getLocaleDataObject(){if(!c.isOpenUI5Detected())return;const t=window.sap.ui.require("sap/ui/core/LocaleData");if(c.isAtLeastVersion116()){const o=window.sap.ui.require("sap/base/i18n/Localization");return t.getInstance(o.getLanguageTag())._get()}const s=window.sap.ui.require("sap/ui/core/Core").getConfiguration();return t.getInstance(s.getLocale())._get()}static _listenForThemeChange(){if(c.isAtLeastVersion116()){const t=window.sap.ui.require("sap/ui/core/Theming");t.attachApplied(()=>{Ie(t.getTheme())})}else{const t=window.sap.ui.require("sap/ui/core/Core"),n=t.getConfiguration();t.attachThemeChanged(()=>{Ie(n.getTheme())})}}static attachListeners(){!c.isOpenUI5Detected()||c._listenForThemeChange()}static cssVariablesLoaded(){if(!c.isOpenUI5Detected())return;const t=[...document.head.children].find(n=>n.id==="sap-ui-theme-sap.ui.core");return t?!!t.href.match(/\/css(-|_)variables\.css/):!1}static getNextZIndex(){if(!c.isOpenUI5Detected())return;const t=window.sap.ui.require("sap/ui/core/Popup");return t||console.warn(`The OpenUI5Support feature hasn't been initialized properly. Make sure you import the "@ui5/webcomponents-base/dist/features/OpenUI5Support.js" module before all components' modules.`),t.getNextZIndex()}static setInitialZIndex(){if(!c.isOpenUI5Detected())return;window.sap.ui.require("sap/ui/core/Popup").setInitialZIndex(Pe())}}yt("OpenUI5Support",c);const C="@ui5/webcomponents-theming",On=()=>ot().has(C),Dn=async e=>{if(!On())return;const t=await st(C,e);t&&at(t,"data-ui5-theme-properties",C)},Un=()=>{Ln("data-ui5-theme-properties",C)},Mn=async e=>{const n=[...ot()].map(async s=>{if(s===C)return;const o=await st(s,e);o&&at(o,`data-ui5-component-properties-${$()}`,s)});return Promise.all(n)},kn=async e=>{var s;const t=se();if(t)return t;const n=T("OpenUI5Support");if(n&&c.isOpenUI5Detected()){if(n.cssVariablesLoaded())return{themeName:(s=n.getConfigurationSettingsObject())==null?void 0:s.theme,baseThemeName:""}}else if(it())return await ct(e),se()},ce=async e=>{const t=await kn(e);!t||e!==t.themeName?await Dn(e):Un();const n=Sn(e)?e:t&&t.baseThemeName;await Mn(n||k),In(e)};let _;const R=()=>(_===void 0&&(_=Lt()),_),Ie=async e=>{_!==e&&(_=e,await ce(_),await Ge({themeAware:!0}))},zn=()=>{var t,n;const e=R();return xn(e)?!e.startsWith("sap_horizon"):!((n=(t=se())==null?void 0:t.baseThemeName)!=null&&n.startsWith("sap_horizon"))},xn=e=>ht.includes(e);var p;(function(e){e.SAPIconsV4="SAP-icons-v4",e.SAPIconsV5="SAP-icons-v5",e.SAPIconsTNTV2="tnt-v2",e.SAPIconsTNTV3="tnt-v3",e.SAPBSIconsV1="business-suite-v1",e.SAPBSIconsV2="business-suite-v2"})(p||(p={}));const l=new Map;l.set("SAP-icons",{legacy:p.SAPIconsV4,sap_horizon:p.SAPIconsV5});l.set("tnt",{legacy:p.SAPIconsTNTV2,sap_horizon:p.SAPIconsTNTV3});l.set("business-suite",{legacy:p.SAPBSIconsV1,sap_horizon:p.SAPBSIconsV2});const Bn=(e,t)=>{if(l.has(e)){l.set(e,{...t,...l.get(e)});return}l.set(e,t)},$e=e=>{const t=zn()?"legacy":"sap_horizon";return l.has(e)?l.get(e)[t]:e},Fn=new Map,Vn=e=>Fn.get(e),ut=e=>{const t=Vn(R());return!e&&t?rt(t):$e(e||"SAP-icons")},jn="legacy",Re=new Map,ue=I("SVGIcons.registry",new Map),Y=I("SVGIcons.promises",new Map),Oe="ICON_NOT_FOUND",qn=async e=>{if(!Y.has(e)){if(!Re.has(e))throw new Error(`No loader registered for the ${e} icons collection. Probably you forgot to import the "AllIcons.js" module for the respective package.`);const t=Re.get(e);Y.set(e,t(e))}return Y.get(e)},De=e=>{Object.keys(e.data).forEach(t=>{const n=e.data[t];Zn(t,{pathData:n.path||n.paths,ltr:n.ltr,accData:n.acc,collection:e.collection,packageName:e.packageName})})},Zn=(e,t)=>{const n=`${t.collection}/${e}`;ue.set(n,{pathData:t.pathData,ltr:t.ltr,accData:t.accData,packageName:t.packageName,customTemplate:t.customTemplate,viewBox:t.viewBox,collection:t.collection})},Wn=e=>{e.startsWith("sap-icon://")&&(e=e.replace("sap-icon://",""));let t;return[e,t]=e.split("/").reverse(),e=e.replace("icon-",""),t&&(t=rt(t)),{name:e,collection:t}},Q=async e=>{const{name:t,collection:n}=Wn(e);let s=Oe;try{s=await qn(ut(n))}catch(r){console.error(r.message)}if(s===Oe)return s;const o=Ue(n,t);return o||(Array.isArray(s)?s.forEach(r=>{De(r),Bn(n,{[r.themeFamily||jn]:r.collection})}):De(s),Ue(n,t))},Ue=(e,t)=>{const n=`${ut(e)}/${t}`;return ue.get(n)},ms=async()=>(await Q("edit"),await Q("tnt/arrow"),await Q("business-suite/3d"),Array.from(ue.keys())),Nn=()=>new Promise(e=>{document.body?e():document.addEventListener("DOMContentLoaded",()=>{e()})}),Hn={packageName:"@ui5/webcomponents-base",fileName:"FontFace.css",content:`@font-face{font-family:"72";font-style:normal;font-weight:400;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2"),local("72")}@font-face{font-family:"72full";font-style:normal;font-weight:400;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2"),local('72-full')}@font-face{font-family:"72";font-style:normal;font-weight:700;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),local('72-Bold')}@font-face{font-family:"72full";font-style:normal;font-weight:700;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Bold';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),local('72-Bold')}@font-face{font-family:'72-Boldfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Light';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Light.woff2?ui5-webcomponents) format("woff2"),local('72-Light')}@font-face{font-family:'72-Lightfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72Mono';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Regular.woff2?ui5-webcomponents) format('woff2'),local('72Mono')}@font-face{font-family:'72Monofull';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Regular-full.woff2?ui5-webcomponents) format('woff2')}@font-face{font-family:'72Mono-Bold';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Bold.woff2?ui5-webcomponents) format('woff2'),local('72Mono-Bold')}@font-face{font-family:'72Mono-Boldfull';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Bold-full.woff2?ui5-webcomponents) format('woff2')}@font-face{font-family:"72Black";font-style:bold;font-weight:900;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Black.woff2?ui5-webcomponents) format("woff2"),local('72Black')}@font-face{font-family:"72-SemiboldDuplex";src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-SemiboldDuplex.woff2?ui5-webcomponents) format("woff2"),local('72-SemiboldDuplex')}`},Gn={packageName:"@ui5/webcomponents-base",fileName:"OverrideFontFace.css",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')}"},Kn=()=>{const e=T("OpenUI5Support");(!e||!e.isOpenUI5Detected())&&Jn(),Xn()},Jn=()=>{Z("data-ui5-font-face")||q(Hn,"data-ui5-font-face")},Xn=()=>{Z("data-ui5-font-face-override")||q(Gn,"data-ui5-font-face-override")},Yn={packageName:"@ui5/webcomponents-base",fileName:"SystemCSSVars.css",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}"},Qn=()=>{Z("data-ui5-system-css-vars")||q(Yn,"data-ui5-system-css-vars")};let le=!1,D;const lt=new P,ws=e=>{if(!le){lt.attachEvent("boot",e);return}e()},ys=async()=>{if(D!==void 0)return D;const e=async t=>{if(typeof document>"u"){t();return}wn(es),Bt();const n=T("OpenUI5Support"),s=n?n.isOpenUI5Detected():!1,o=T("F6Navigation");n&&await n.init(),o&&!s&&o.init(),await Nn(),await ce(R()),n&&n.attachListeners(),Kn(),Qn(),t(),le=!0,await lt.fireEventAsync("boot")};return D=new Promise(e),D},es=e=>{const t=R();le&&e===t&&ce(t)};export{fs as A,R as B,it as C,gs as D,P as E,Ie as F,ds as G,ws as H,ms as _,I as a,T as b,ns as c,Qt as d,pt as e,ln as f,hs as g,$ as h,Xt as i,ss as j,Ht as k,ls as l,us as m,Ut as n,ys as o,is as p,cs as q,Ge as r,as as s,Be as t,Nt as u,ps as v,ts as w,os as x,yt as y,rs as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as he,g as pe,r as Ht,a as kt,E as K,b as J,c as fe,d as Bt,e as ge,h as ft,i as Vt,j as me,k as _e,l as ye,m as ve,n as Ae,o as $e,p as we,q as Se,s as be,t as Ce,u as Ee,v as w,w as Me,x as Te,y as xe,z as Ft,A as De,B as Ie,C as Pe,D as Le,F as Ne,_ as Re,G as Oe}from"./Boot.5a9b49d7.js";const He=/('')|'([^']+(?:''[^']*)*)(?:'|$)|\{([0-9]+(?:\s*,[^{}]*)?)\}|[{}]/g,ke=(s,t)=>(t=t||[],s.replace(He,(e,n,i,r,o)=>{if(n)return"'";if(i)return i.replace(/''/g,"'");if(r){const l=typeof r=="string"?parseInt(r):r;return String(t[l])}throw new Error(`[i18n]: pattern syntax error at pos ${o}`)})),Y=new Map;class Be{constructor(t){this.packageName=t}getText(t,...e){if(typeof t=="string"&&(t={key:t,defaultText:t}),!t||!t.key)return"";const n=pe(this.packageName);n&&!n[t.key]&&console.warn(`Key ${t.key} not found in the i18n bundle, the default text will be used`);const i=n&&n[t.key]?n[t.key]:t.defaultText||t.key;return ke(i,e)}}const Ve=s=>{if(Y.has(s))return Y.get(s);const t=new Be(s);return Y.set(s,t),t},Fe=async s=>(await he(s),Ve(s)),Q=new Map,tt=new Map,yt=s=>{if(!Q.has(s)){const t=Ue(s.split("-"));Q.set(s,t)}return Q.get(s)},Ut=s=>{if(!tt.has(s)){const t=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();tt.set(s,t)}return tt.get(s)},Ue=s=>s.map((t,e)=>e===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),je=s=>{if(!(s instanceof HTMLElement))return"default";const t=s.getAttribute("slot");if(t){const e=t.match(/^(.+?)-\d+$/);return e?e[1]:t}return"default"},jt=s=>s instanceof HTMLSlotElement?s.assignedNodes({flatten:!0}).filter(t=>t instanceof HTMLElement):[s],We=s=>s.reduce((t,e)=>t.concat(jt(e)),[]);let ze,vt={include:[/^ui5-/],exclude:[]};const et=new Map,Wt=()=>ze,dt=s=>{if(!et.has(s)){const t=vt.include.some(e=>s.match(e))&&!vt.exclude.some(e=>s.match(e));et.set(s,t)}return et.get(s)},zt=s=>{if(dt(s))return Wt()};class Ge{constructor(t){this.metadata=t}getInitialState(){if(Object.prototype.hasOwnProperty.call(this,"_initialState"))return this._initialState;const t={},e=this.slotsAreManaged(),n=this.getProperties();for(const i in n){const r=n[i].type,o=n[i].defaultValue;r===Boolean?(t[i]=!1,o!==void 0&&console.warn("The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default")):n[i].multiple?t[i]=[]:r===Object?t[i]="defaultValue"in n[i]?n[i].defaultValue:{}:r===String?t[i]="defaultValue"in n[i]?n[i].defaultValue:"":t[i]=o}if(e){const i=this.getSlots();for(const[r,o]of Object.entries(i)){const l=o.propertyName||r;t[l]=[]}}return this._initialState=t,t}static validatePropertyValue(t,e){return e.multiple&&t?t.map(i=>At(i,e)):At(t,e)}static validateSlotValue(t,e){return qe(t,e)}getPureTag(){return this.metadata.tag||""}getTag(){const t=this.metadata.tag;if(!t)return"";const e=zt(t);return e?`${t}-${e}`:t}hasAttribute(t){const e=this.getProperties()[t];return e.type!==Object&&!e.noAttribute&&!e.multiple}getPropertiesList(){return Object.keys(this.getProperties())}getAttributesList(){return this.getPropertiesList().filter(this.hasAttribute.bind(this)).map(Ut)}canSlotText(){const t=this.getSlots().default;return t&&t.type===Node}hasSlots(){return!!Object.entries(this.getSlots()).length}hasIndividualSlots(){return this.slotsAreManaged()&&Object.values(this.getSlots()).some(t=>t.individualSlots)}slotsAreManaged(){return!!this.metadata.managedSlots}supportsF6FastNavigation(){return!!this.metadata.fastNavigation}getProperties(){return this.metadata.properties||(this.metadata.properties={}),this.metadata.properties}getEvents(){return this.metadata.events||(this.metadata.events={}),this.metadata.events}getSlots(){return this.metadata.slots||(this.metadata.slots={}),this.metadata.slots}isLanguageAware(){return!!this.metadata.languageAware}isThemeAware(){return!!this.metadata.themeAware}shouldInvalidateOnChildChange(t,e,n){const i=this.getSlots()[t].invalidateOnChildChange;if(i===void 0)return!1;if(typeof i=="boolean")return i;if(typeof i=="object"){if(e==="property"){if(i.properties===void 0)return!1;if(typeof i.properties=="boolean")return i.properties;if(Array.isArray(i.properties))return i.properties.includes(n);throw new Error("Wrong format for invalidateOnChildChange.properties: boolean or array is expected")}if(e==="slot"){if(i.slots===void 0)return!1;if(typeof i.slots=="boolean")return i.slots;if(Array.isArray(i.slots))return i.slots.includes(n);throw new Error("Wrong format for invalidateOnChildChange.slots: boolean or array is expected")}}throw new Error("Wrong format for invalidateOnChildChange: boolean or object is expected")}}const At=(s,t)=>{const e=t.type;let n=t.validator;return e&&e.isDataTypeClass&&(n=e),n?n.isValid(s)?s:t.defaultValue:!e||e===String?typeof s=="string"||typeof s>"u"||s===null?s:s.toString():e===Boolean?typeof s=="boolean"?s:!1:e===Object?typeof s=="object"?s:t.defaultValue:s in e?s:t.defaultValue},qe=(s,t)=>(s&&jt(s).forEach(e=>{if(!(e instanceof t.type))throw new Error(`The element is not of type ${t.type.toString()}`)}),s);class Ze extends HTMLElement{}customElements.get("ui5-static-area")||customElements.define("ui5-static-area",Ze);const Ke=()=>kt("CustomStyle.eventProvider",new K),Je="CustomCSSChange",gt=s=>{Ke().attachEvent(Je,s)},Xe=()=>kt("CustomStyle.customCSSFor",{});gt(s=>{Ht({tag:s})});const Ye=s=>{const t=Xe();return t[s]?t[s].join(""):""},Qe=10,st=s=>Array.isArray(s)?s.filter(t=>!!t).flat(Qe).map(t=>typeof t=="string"?t:t.content).join(" "):typeof s=="string"?s:s.content,W=new Map;gt(s=>{W.delete(`${s}_normal`)});const Gt=(s,t=!1)=>{const e=s.getMetadata().getTag(),n=`${e}_${t?"static":"normal"}`,i=J("OpenUI5Enablement");if(!W.has(n)){let r,o="";if(i&&(o=st(i.getBusyIndicatorStyles())),t)r=st(s.staticAreaStyles);else{const l=Ye(e)||"";r=`${st(s.styles)} ${l}`}r=`${r} ${o}`,W.set(n,r)}return W.get(n)},z=new Map;gt(s=>{z.delete(`${s}_normal`)});const ts=(s,t=!1)=>{const n=`${s.getMetadata().getTag()}_${t?"static":"normal"}`;if(!z.has(n)){const i=Gt(s,t),r=new CSSStyleSheet;r.replaceSync(i),z.set(n,[r])}return z.get(n)},ut=(s,t=!1)=>{let e;const n=s.constructor,i=t?s.staticAreaItem.shadowRoot:s.shadowRoot;let r;if(t?r=s.renderStatic():r=s.render(),!i){console.warn("There is no shadow root to update");return}if(document.adoptedStyleSheets?i.adoptedStyleSheets=ts(n,t):e=Gt(n,t),n.renderer){n.renderer(r,i,e,t,{host:s});return}n.render(r,i,e,t,{host:s})},es="--_ui5_content_density",ss=s=>getComputedStyle(s).getPropertyValue(es),ns=s=>{const t=/\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(s);return t&&t[2]?t[2].split(/,/):null},is={iw:"he",ji:"yi",in:"id",sh:"sr"},rs=ns("$cldr-rtl-locales:ar,fa,he$")||[],os=s=>(s=s&&is[s]||s,rs.indexOf(s)>=0),qt=()=>{if(typeof document>"u")return!1;const s=fe();return s!==void 0?!!s:os(Bt()||ge())},as="--_ui5_dir",Zt=s=>{const t=window.document,e=["ltr","rtl"],n=getComputedStyle(s).getPropertyValue(as);return e.includes(n)?n:e.includes(s.dir)?s.dir:e.includes(t.documentElement.dir)?t.documentElement.dir:e.includes(t.body.dir)?t.body.dir:qt()?"rtl":void 0},j="ui5-static-area-item",ls="data-sap-ui-integration-popup-content";class R extends HTMLElement{constructor(){super(),this._rendered=!1,this.attachShadow({mode:"open"})}setOwnerElement(t){this.ownerElement=t,this.classList.add(this.ownerElement._id),this.ownerElement.hasAttribute("data-ui5-static-stable")&&this.setAttribute("data-ui5-stable",this.ownerElement.getAttribute("data-ui5-static-stable"))}update(){this._rendered&&(this.updateAdditionalProperties(),ut(this.ownerElement,!0))}updateAdditionalProperties(){this._updateAdditionalAttrs(),this._updateContentDensity(),this._updateDirection()}_updateContentDensity(){ss(this.ownerElement)==="compact"?(this.classList.add("sapUiSizeCompact"),this.classList.add("ui5-content-density-compact")):(this.classList.remove("sapUiSizeCompact"),this.classList.remove("ui5-content-density-compact"))}_updateDirection(){if(this.ownerElement){const t=Zt(this.ownerElement);t?this.setAttribute("dir",t):this.removeAttribute("dir")}}_updateAdditionalAttrs(){this.setAttribute(`_ui5rt${ft()}`,""),this.setAttribute("_ui5host",""),this.setAttribute(j,""),this.setAttribute(ls,"")}async getDomRef(){return this.updateAdditionalProperties(),this._rendered||(this._rendered=!0,ut(this.ownerElement,!0)),await Vt(),this.shadowRoot}static getTag(){const t=zt(j);return t?`${j}-${t}`:j}static createInstance(){return customElements.get(R.getTag())||customElements.define(R.getTag(),R),document.createElement(this.getTag())}}const cs=[],ds=s=>cs.some(t=>s.startsWith(t)),ht=new WeakMap,us=(s,t,e)=>{const n=new MutationObserver(t);ht.set(s,n),n.observe(s,e)},hs=s=>{const t=ht.get(s);t&&(t.disconnect(),ht.delete(s))},ps=["value-changed","click"];let G;const fs=s=>ps.includes(s),gs=s=>{const t=mt();return!(typeof t!="boolean"&&t.events&&t.events.includes&&t.events.includes(s))},mt=()=>(G===void 0&&(G=me()),G),ms=s=>{G=s},_s=s=>{const t=mt();return fs(s)?!1:t===!0?!0:!gs(s)},ys=["disabled","title","hidden","role","draggable"],$t=s=>ys.includes(s)||s.startsWith("aria")?!0:![HTMLElement,Element,Node].some(e=>e.prototype.hasOwnProperty(s)),wt=(s,t)=>{if(s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==t[e])return!1;return!0},St=(s,t)=>{const e=vs(t),n=Wt();return s.call(t,t,e,n)},vs=s=>{const t=s.constructor,e=t.getMetadata().getPureTag(),n=t.getUniqueDependencies().map(i=>i.getMetadata().getPureTag()).filter(dt);return dt(e)&&n.push(e),n};let As=0;const bt=new Map,nt=new Map;function I(s){this._suppressInvalidation||(this.onInvalidation(s),this._changedState.push(s),Ee(this),this._eventProvider.fireEvent("invalidate",{...s,target:this}))}class $ extends HTMLElement{constructor(){super();const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._eventProvider=new K;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._state={...t.getMetadata().getInitialState()},this._upgradeAllProperties(),t._needsShadowDOM()&&this.attachShadow({mode:"open"})}get _id(){return this.__id||(this.__id=`ui5wc_${++As}`),this.__id}render(){const t=this.constructor.template;return St(t,this)}renderStatic(){const t=this.constructor.staticAreaTemplate;return St(t,this)}async connectedCallback(){const t=this.constructor;this.setAttribute(`_ui5rt${ft()}`,""),this.setAttribute("_ui5host",""),this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),this._inDOM&&(_e(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this.staticAreaItem&&this.staticAreaItem.parentElement&&this.staticAreaItem.parentElement.removeChild(this.staticAreaItem),ye(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const t=this.constructor;if(!t.getMetadata().hasSlots())return;const n=t.getMetadata().canSlotText(),i={childList:!0,subtree:n,characterData:n};us(this,this._processChildren.bind(this),i)}_stopObservingDOMChildren(){hs(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),n=t.getMetadata().canSlotText(),i=Array.from(n?this.childNodes:this.children),r=new Map,o=new Map;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;o.set(h,d),r.set(h,[...this._state[h]]),this._clearSlot(d,u)}const l=new Map,a=new Map,c=i.map(async(d,u)=>{const h=je(d),f=e[h];if(f===void 0){if(h!=="default"){const g=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${h}, ignoring`,d,`Valid values are: ${g}`)}return}if(f.individualSlots){const g=(l.get(h)||0)+1;l.set(h,g),d._individualSlot=`${h}-${g}`}if(d instanceof HTMLElement){const g=d.localName;if(g.includes("-")&&!ds(g)){if(!window.customElements.get(g)){const de=window.customElements.whenDefined(g);let U=bt.get(g);U||(U=new Promise(ue=>setTimeout(ue,1e3)),bt.set(g,U)),await Promise.race([de,U])}window.customElements.upgrade(d)}}if(d=t.getMetadata().constructor.validateSlotValue(d,f),Ct(d)&&f.invalidateOnChildChange){const g=this._getChildChangeListener(h);g&&d.attachInvalidate.call(d,g)}d instanceof HTMLSlotElement&&this._attachSlotChange(d,h);const m=f.propertyName||h;a.has(m)?a.get(m).push({child:d,idx:u}):a.set(m,[{child:d,idx:u}])});await Promise.all(c),a.forEach((d,u)=>{this._state[u]=d.sort((h,f)=>h.idx-f.idx).map(h=>h.child)});let p=!1;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;wt(r.get(h),this._state[h])||(I.call(this,{type:"slot",name:o.get(h),reason:"children"}),p=!0)}p||I.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const n=e.propertyName||t;this._state[n].forEach(r=>{if(Ct(r)){const o=this._getChildChangeListener(t);o&&r.detachInvalidate.call(r,o)}r instanceof HTMLSlotElement&&this._detachSlotChange(r,t)}),this._state[n]=[]}attachInvalidate(t){this._eventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._eventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){!this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)||I.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,n){let i;if(this._doNotSyncAttributes.has(t))return;const r=this.constructor.getMetadata().getProperties(),o=t.replace(/^ui5-/,""),l=yt(o);if(r.hasOwnProperty(l)){const a=r[l],c=a.type;let p=a.validator;c&&c.isDataTypeClass&&(p=c),p?i=p.attributeToProperty(n):c===Boolean?i=n!==null:i=n,this[l]=i}}_updateAttribute(t,e){const n=this.constructor;if(!n.getMetadata().hasAttribute(t))return;const r=n.getMetadata().getProperties()[t],o=r.type;let l=r.validator;const a=Ut(t),c=this.getAttribute(a);if(o&&o.isDataTypeClass&&(l=o),l){const p=l.propertyToAttribute(e);p===null?(this._doNotSyncAttributes.add(a),this.removeAttribute(a),this._doNotSyncAttributes.delete(a)):this.setAttribute(a,p)}else o===Boolean?e===!0&&c===null?this.setAttribute(a,""):e===!1&&c!==null&&this.removeAttribute(a):typeof e!="object"&&c!==e&&this.setAttribute(a,e)}_upgradeProperty(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}_upgradeAllProperties(){this.constructor.getMetadata().getPropertiesList().forEach(this._upgradeProperty.bind(this))}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e){const n=this._getSlotChangeListener(e);n&&t.addEventListener("slotchange",n)}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){I.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this._suppressInvalidation=!0,this.onBeforeRendering(),this._onComponentStateFinalized&&this._onComponentStateFinalized(),this._suppressInvalidation=!1,this._changedState=[],t._needsShadowDOM()&&ut(this),this.staticAreaItem&&this.staticAreaItem.update(),e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!this.shadowRoot||this.shadowRoot.children.length===0)return;const t=[...this.shadowRoot.children].filter(e=>!["link","style"].includes(e.localName));return t.length!==1&&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`),t[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,n=!1,i=!0){const r=this._fireEvent(t,e,n,i),o=yt(t);return o!==t?r&&this._fireEvent(o,e,n):r}_fireEvent(t,e,n=!1,i=!0){const r=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:i,cancelable:n}),o=this.dispatchEvent(r);if(_s(t))return o;const l=new CustomEvent(t,{detail:e,composed:!1,bubbles:i,cancelable:n});return this.dispatchEvent(l)&&o}getSlottedNodes(t){return We(this[t])}get effectiveDir(){return ve(this.constructor),Zt(this)}get isUI5Element(){return!0}get classes(){return{}}static get observedAttributes(){return this.getMetadata().getAttributesList()}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _needsStaticArea(){return!!this.staticAreaTemplate||Object.prototype.hasOwnProperty.call(this.prototype,"renderStatic")}getStaticAreaItemDomRef(){if(!this.constructor._needsStaticArea())throw new Error("This component does not use the static area");return this.staticAreaItem||(this.staticAreaItem=R.createInstance(),this.staticAreaItem.setOwnerElement(this)),this.staticAreaItem.parentElement||Ae("ui5-static-area").appendChild(this.staticAreaItem),this.staticAreaItem.getDomRef()}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),n=this.getMetadata().getProperties();for(const[i,r]of Object.entries(n)){if($t(i)||console.warn(`"${i}" is not a valid property name. Use a name that does not collide with DOM APIs`),r.type===Boolean&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All booleans are false by default.`);if(r.type===Array)throw new Error(`Wrong type for property "${i}". Properties cannot be of type Array - use "multiple: true" and set "type" to the single value type, such as "String", "Object", etc...`);if(r.type===Object&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All properties of type "Object" are empty objects by default.`);if(r.multiple&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All multiple properties are empty arrays by default.`);Object.defineProperty(t,i,{get(){if(this._state[i]!==void 0)return this._state[i];const o=r.defaultValue;return r.type===Boolean?!1:r.type===String?o:r.multiple?[]:o},set(o){let l;o=this.constructor.getMetadata().constructor.validatePropertyValue(o,r);const p=r.type;let d=r.validator;const u=this._state[i];p&&p.isDataTypeClass&&(d=p),d?l=!d.valuesAreEqual(u,o):Array.isArray(u)&&Array.isArray(o)&&r.multiple&&r.compareValues?l=!wt(u,o):l=u!==o,l&&(this._state[i]=o,I.call(this,{type:"property",name:i,newValue:o,oldValue:u}),this._updateAttribute(i,o))}})}if(e){const i=this.getMetadata().getSlots();for(const[r,o]of Object.entries(i)){$t(r)||console.warn(`"${r}" is not a valid property name. Use a name that does not collide with DOM APIs`);const l=o.propertyName||r;Object.defineProperty(t,l,{get(){return this._state[l]!==void 0?this._state[l]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}})}}}static get styles(){return""}static get staticAreaStyles(){return""}static get dependencies(){return[]}static getUniqueDependencies(){if(!nt.has(this)){const t=this.dependencies.filter((e,n,i)=>i.indexOf(e)===n);nt.set(this,t)}return nt.get(this)||[]}static whenDependenciesDefined(){return Promise.all(this.getUniqueDependencies().map(t=>t.define()))}static async onDefine(){return Promise.resolve()}static async define(){await $e(),await Promise.all([this.whenDependenciesDefined(),this.onDefine()]);const t=this.getMetadata().getTag(),e=we(t),n=customElements.get(t);return n&&!e?Se(t):n||(this._generateAccessors(),be(t),window.customElements.define(t,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==$;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const n=Ce({},...t);return this._metadata=new Ge(n),this._metadata}}$.metadata={};const Ct=s=>"isUI5Element"in s;/**
|
|
1
|
+
import{f as he,g as pe,r as Ht,a as kt,E as K,b as J,c as fe,d as Bt,e as ge,h as ft,i as Vt,j as me,k as _e,l as ye,m as ve,n as Ae,o as $e,p as we,q as Se,s as be,t as Ce,u as Ee,v as w,w as Me,x as Te,y as xe,z as Ft,A as De,B as Ie,C as Pe,D as Le,F as Ne,_ as Re,G as Oe}from"./Boot.d50b4c00.js";const He=/('')|'([^']+(?:''[^']*)*)(?:'|$)|\{([0-9]+(?:\s*,[^{}]*)?)\}|[{}]/g,ke=(s,t)=>(t=t||[],s.replace(He,(e,n,i,r,o)=>{if(n)return"'";if(i)return i.replace(/''/g,"'");if(r){const l=typeof r=="string"?parseInt(r):r;return String(t[l])}throw new Error(`[i18n]: pattern syntax error at pos ${o}`)})),Y=new Map;class Be{constructor(t){this.packageName=t}getText(t,...e){if(typeof t=="string"&&(t={key:t,defaultText:t}),!t||!t.key)return"";const n=pe(this.packageName);n&&!n[t.key]&&console.warn(`Key ${t.key} not found in the i18n bundle, the default text will be used`);const i=n&&n[t.key]?n[t.key]:t.defaultText||t.key;return ke(i,e)}}const Ve=s=>{if(Y.has(s))return Y.get(s);const t=new Be(s);return Y.set(s,t),t},Fe=async s=>(await he(s),Ve(s)),Q=new Map,tt=new Map,yt=s=>{if(!Q.has(s)){const t=Ue(s.split("-"));Q.set(s,t)}return Q.get(s)},Ut=s=>{if(!tt.has(s)){const t=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();tt.set(s,t)}return tt.get(s)},Ue=s=>s.map((t,e)=>e===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),je=s=>{if(!(s instanceof HTMLElement))return"default";const t=s.getAttribute("slot");if(t){const e=t.match(/^(.+?)-\d+$/);return e?e[1]:t}return"default"},jt=s=>s instanceof HTMLSlotElement?s.assignedNodes({flatten:!0}).filter(t=>t instanceof HTMLElement):[s],We=s=>s.reduce((t,e)=>t.concat(jt(e)),[]);let ze,vt={include:[/^ui5-/],exclude:[]};const et=new Map,Wt=()=>ze,dt=s=>{if(!et.has(s)){const t=vt.include.some(e=>s.match(e))&&!vt.exclude.some(e=>s.match(e));et.set(s,t)}return et.get(s)},zt=s=>{if(dt(s))return Wt()};class Ge{constructor(t){this.metadata=t}getInitialState(){if(Object.prototype.hasOwnProperty.call(this,"_initialState"))return this._initialState;const t={},e=this.slotsAreManaged(),n=this.getProperties();for(const i in n){const r=n[i].type,o=n[i].defaultValue;r===Boolean?(t[i]=!1,o!==void 0&&console.warn("The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default")):n[i].multiple?t[i]=[]:r===Object?t[i]="defaultValue"in n[i]?n[i].defaultValue:{}:r===String?t[i]="defaultValue"in n[i]?n[i].defaultValue:"":t[i]=o}if(e){const i=this.getSlots();for(const[r,o]of Object.entries(i)){const l=o.propertyName||r;t[l]=[]}}return this._initialState=t,t}static validatePropertyValue(t,e){return e.multiple&&t?t.map(i=>At(i,e)):At(t,e)}static validateSlotValue(t,e){return qe(t,e)}getPureTag(){return this.metadata.tag||""}getTag(){const t=this.metadata.tag;if(!t)return"";const e=zt(t);return e?`${t}-${e}`:t}hasAttribute(t){const e=this.getProperties()[t];return e.type!==Object&&!e.noAttribute&&!e.multiple}getPropertiesList(){return Object.keys(this.getProperties())}getAttributesList(){return this.getPropertiesList().filter(this.hasAttribute.bind(this)).map(Ut)}canSlotText(){const t=this.getSlots().default;return t&&t.type===Node}hasSlots(){return!!Object.entries(this.getSlots()).length}hasIndividualSlots(){return this.slotsAreManaged()&&Object.values(this.getSlots()).some(t=>t.individualSlots)}slotsAreManaged(){return!!this.metadata.managedSlots}supportsF6FastNavigation(){return!!this.metadata.fastNavigation}getProperties(){return this.metadata.properties||(this.metadata.properties={}),this.metadata.properties}getEvents(){return this.metadata.events||(this.metadata.events={}),this.metadata.events}getSlots(){return this.metadata.slots||(this.metadata.slots={}),this.metadata.slots}isLanguageAware(){return!!this.metadata.languageAware}isThemeAware(){return!!this.metadata.themeAware}shouldInvalidateOnChildChange(t,e,n){const i=this.getSlots()[t].invalidateOnChildChange;if(i===void 0)return!1;if(typeof i=="boolean")return i;if(typeof i=="object"){if(e==="property"){if(i.properties===void 0)return!1;if(typeof i.properties=="boolean")return i.properties;if(Array.isArray(i.properties))return i.properties.includes(n);throw new Error("Wrong format for invalidateOnChildChange.properties: boolean or array is expected")}if(e==="slot"){if(i.slots===void 0)return!1;if(typeof i.slots=="boolean")return i.slots;if(Array.isArray(i.slots))return i.slots.includes(n);throw new Error("Wrong format for invalidateOnChildChange.slots: boolean or array is expected")}}throw new Error("Wrong format for invalidateOnChildChange: boolean or object is expected")}}const At=(s,t)=>{const e=t.type;let n=t.validator;return e&&e.isDataTypeClass&&(n=e),n?n.isValid(s)?s:t.defaultValue:!e||e===String?typeof s=="string"||typeof s>"u"||s===null?s:s.toString():e===Boolean?typeof s=="boolean"?s:!1:e===Object?typeof s=="object"?s:t.defaultValue:s in e?s:t.defaultValue},qe=(s,t)=>(s&&jt(s).forEach(e=>{if(!(e instanceof t.type))throw new Error(`The element is not of type ${t.type.toString()}`)}),s);class Ze extends HTMLElement{}customElements.get("ui5-static-area")||customElements.define("ui5-static-area",Ze);const Ke=()=>kt("CustomStyle.eventProvider",new K),Je="CustomCSSChange",gt=s=>{Ke().attachEvent(Je,s)},Xe=()=>kt("CustomStyle.customCSSFor",{});gt(s=>{Ht({tag:s})});const Ye=s=>{const t=Xe();return t[s]?t[s].join(""):""},Qe=10,st=s=>Array.isArray(s)?s.filter(t=>!!t).flat(Qe).map(t=>typeof t=="string"?t:t.content).join(" "):typeof s=="string"?s:s.content,W=new Map;gt(s=>{W.delete(`${s}_normal`)});const Gt=(s,t=!1)=>{const e=s.getMetadata().getTag(),n=`${e}_${t?"static":"normal"}`,i=J("OpenUI5Enablement");if(!W.has(n)){let r,o="";if(i&&(o=st(i.getBusyIndicatorStyles())),t)r=st(s.staticAreaStyles);else{const l=Ye(e)||"";r=`${st(s.styles)} ${l}`}r=`${r} ${o}`,W.set(n,r)}return W.get(n)},z=new Map;gt(s=>{z.delete(`${s}_normal`)});const ts=(s,t=!1)=>{const n=`${s.getMetadata().getTag()}_${t?"static":"normal"}`;if(!z.has(n)){const i=Gt(s,t),r=new CSSStyleSheet;r.replaceSync(i),z.set(n,[r])}return z.get(n)},ut=(s,t=!1)=>{let e;const n=s.constructor,i=t?s.staticAreaItem.shadowRoot:s.shadowRoot;let r;if(t?r=s.renderStatic():r=s.render(),!i){console.warn("There is no shadow root to update");return}if(document.adoptedStyleSheets?i.adoptedStyleSheets=ts(n,t):e=Gt(n,t),n.renderer){n.renderer(r,i,e,t,{host:s});return}n.render(r,i,e,t,{host:s})},es="--_ui5_content_density",ss=s=>getComputedStyle(s).getPropertyValue(es),ns=s=>{const t=/\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(s);return t&&t[2]?t[2].split(/,/):null},is={iw:"he",ji:"yi",in:"id",sh:"sr"},rs=ns("$cldr-rtl-locales:ar,fa,he$")||[],os=s=>(s=s&&is[s]||s,rs.indexOf(s)>=0),qt=()=>{if(typeof document>"u")return!1;const s=fe();return s!==void 0?!!s:os(Bt()||ge())},as="--_ui5_dir",Zt=s=>{const t=window.document,e=["ltr","rtl"],n=getComputedStyle(s).getPropertyValue(as);return e.includes(n)?n:e.includes(s.dir)?s.dir:e.includes(t.documentElement.dir)?t.documentElement.dir:e.includes(t.body.dir)?t.body.dir:qt()?"rtl":void 0},j="ui5-static-area-item",ls="data-sap-ui-integration-popup-content";class R extends HTMLElement{constructor(){super(),this._rendered=!1,this.attachShadow({mode:"open"})}setOwnerElement(t){this.ownerElement=t,this.classList.add(this.ownerElement._id),this.ownerElement.hasAttribute("data-ui5-static-stable")&&this.setAttribute("data-ui5-stable",this.ownerElement.getAttribute("data-ui5-static-stable"))}update(){this._rendered&&(this.updateAdditionalProperties(),ut(this.ownerElement,!0))}updateAdditionalProperties(){this._updateAdditionalAttrs(),this._updateContentDensity(),this._updateDirection()}_updateContentDensity(){ss(this.ownerElement)==="compact"?(this.classList.add("sapUiSizeCompact"),this.classList.add("ui5-content-density-compact")):(this.classList.remove("sapUiSizeCompact"),this.classList.remove("ui5-content-density-compact"))}_updateDirection(){if(this.ownerElement){const t=Zt(this.ownerElement);t?this.setAttribute("dir",t):this.removeAttribute("dir")}}_updateAdditionalAttrs(){this.setAttribute(`_ui5rt${ft()}`,""),this.setAttribute("_ui5host",""),this.setAttribute(j,""),this.setAttribute(ls,"")}async getDomRef(){return this.updateAdditionalProperties(),this._rendered||(this._rendered=!0,ut(this.ownerElement,!0)),await Vt(),this.shadowRoot}static getTag(){const t=zt(j);return t?`${j}-${t}`:j}static createInstance(){return customElements.get(R.getTag())||customElements.define(R.getTag(),R),document.createElement(this.getTag())}}const cs=[],ds=s=>cs.some(t=>s.startsWith(t)),ht=new WeakMap,us=(s,t,e)=>{const n=new MutationObserver(t);ht.set(s,n),n.observe(s,e)},hs=s=>{const t=ht.get(s);t&&(t.disconnect(),ht.delete(s))},ps=["value-changed","click"];let G;const fs=s=>ps.includes(s),gs=s=>{const t=mt();return!(typeof t!="boolean"&&t.events&&t.events.includes&&t.events.includes(s))},mt=()=>(G===void 0&&(G=me()),G),ms=s=>{G=s},_s=s=>{const t=mt();return fs(s)?!1:t===!0?!0:!gs(s)},ys=["disabled","title","hidden","role","draggable"],$t=s=>ys.includes(s)||s.startsWith("aria")?!0:![HTMLElement,Element,Node].some(e=>e.prototype.hasOwnProperty(s)),wt=(s,t)=>{if(s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==t[e])return!1;return!0},St=(s,t)=>{const e=vs(t),n=Wt();return s.call(t,t,e,n)},vs=s=>{const t=s.constructor,e=t.getMetadata().getPureTag(),n=t.getUniqueDependencies().map(i=>i.getMetadata().getPureTag()).filter(dt);return dt(e)&&n.push(e),n};let As=0;const bt=new Map,nt=new Map;function I(s){this._suppressInvalidation||(this.onInvalidation(s),this._changedState.push(s),Ee(this),this._eventProvider.fireEvent("invalidate",{...s,target:this}))}class $ extends HTMLElement{constructor(){super();const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._eventProvider=new K;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._state={...t.getMetadata().getInitialState()},this._upgradeAllProperties(),t._needsShadowDOM()&&this.attachShadow({mode:"open"})}get _id(){return this.__id||(this.__id=`ui5wc_${++As}`),this.__id}render(){const t=this.constructor.template;return St(t,this)}renderStatic(){const t=this.constructor.staticAreaTemplate;return St(t,this)}async connectedCallback(){const t=this.constructor;this.setAttribute(`_ui5rt${ft()}`,""),this.setAttribute("_ui5host",""),this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),this._inDOM&&(_e(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this.staticAreaItem&&this.staticAreaItem.parentElement&&this.staticAreaItem.parentElement.removeChild(this.staticAreaItem),ye(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const t=this.constructor;if(!t.getMetadata().hasSlots())return;const n=t.getMetadata().canSlotText(),i={childList:!0,subtree:n,characterData:n};us(this,this._processChildren.bind(this),i)}_stopObservingDOMChildren(){hs(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),n=t.getMetadata().canSlotText(),i=Array.from(n?this.childNodes:this.children),r=new Map,o=new Map;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;o.set(h,d),r.set(h,[...this._state[h]]),this._clearSlot(d,u)}const l=new Map,a=new Map,c=i.map(async(d,u)=>{const h=je(d),f=e[h];if(f===void 0){if(h!=="default"){const g=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${h}, ignoring`,d,`Valid values are: ${g}`)}return}if(f.individualSlots){const g=(l.get(h)||0)+1;l.set(h,g),d._individualSlot=`${h}-${g}`}if(d instanceof HTMLElement){const g=d.localName;if(g.includes("-")&&!ds(g)){if(!window.customElements.get(g)){const de=window.customElements.whenDefined(g);let U=bt.get(g);U||(U=new Promise(ue=>setTimeout(ue,1e3)),bt.set(g,U)),await Promise.race([de,U])}window.customElements.upgrade(d)}}if(d=t.getMetadata().constructor.validateSlotValue(d,f),Ct(d)&&f.invalidateOnChildChange){const g=this._getChildChangeListener(h);g&&d.attachInvalidate.call(d,g)}d instanceof HTMLSlotElement&&this._attachSlotChange(d,h);const m=f.propertyName||h;a.has(m)?a.get(m).push({child:d,idx:u}):a.set(m,[{child:d,idx:u}])});await Promise.all(c),a.forEach((d,u)=>{this._state[u]=d.sort((h,f)=>h.idx-f.idx).map(h=>h.child)});let p=!1;for(const[d,u]of Object.entries(e)){const h=u.propertyName||d;wt(r.get(h),this._state[h])||(I.call(this,{type:"slot",name:o.get(h),reason:"children"}),p=!0)}p||I.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const n=e.propertyName||t;this._state[n].forEach(r=>{if(Ct(r)){const o=this._getChildChangeListener(t);o&&r.detachInvalidate.call(r,o)}r instanceof HTMLSlotElement&&this._detachSlotChange(r,t)}),this._state[n]=[]}attachInvalidate(t){this._eventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._eventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){!this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)||I.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,n){let i;if(this._doNotSyncAttributes.has(t))return;const r=this.constructor.getMetadata().getProperties(),o=t.replace(/^ui5-/,""),l=yt(o);if(r.hasOwnProperty(l)){const a=r[l],c=a.type;let p=a.validator;c&&c.isDataTypeClass&&(p=c),p?i=p.attributeToProperty(n):c===Boolean?i=n!==null:i=n,this[l]=i}}_updateAttribute(t,e){const n=this.constructor;if(!n.getMetadata().hasAttribute(t))return;const r=n.getMetadata().getProperties()[t],o=r.type;let l=r.validator;const a=Ut(t),c=this.getAttribute(a);if(o&&o.isDataTypeClass&&(l=o),l){const p=l.propertyToAttribute(e);p===null?(this._doNotSyncAttributes.add(a),this.removeAttribute(a),this._doNotSyncAttributes.delete(a)):this.setAttribute(a,p)}else o===Boolean?e===!0&&c===null?this.setAttribute(a,""):e===!1&&c!==null&&this.removeAttribute(a):typeof e!="object"&&c!==e&&this.setAttribute(a,e)}_upgradeProperty(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}_upgradeAllProperties(){this.constructor.getMetadata().getPropertiesList().forEach(this._upgradeProperty.bind(this))}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e){const n=this._getSlotChangeListener(e);n&&t.addEventListener("slotchange",n)}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){I.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this._suppressInvalidation=!0,this.onBeforeRendering(),this._onComponentStateFinalized&&this._onComponentStateFinalized(),this._suppressInvalidation=!1,this._changedState=[],t._needsShadowDOM()&&ut(this),this.staticAreaItem&&this.staticAreaItem.update(),e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!this.shadowRoot||this.shadowRoot.children.length===0)return;const t=[...this.shadowRoot.children].filter(e=>!["link","style"].includes(e.localName));return t.length!==1&&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`),t[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,n=!1,i=!0){const r=this._fireEvent(t,e,n,i),o=yt(t);return o!==t?r&&this._fireEvent(o,e,n):r}_fireEvent(t,e,n=!1,i=!0){const r=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:i,cancelable:n}),o=this.dispatchEvent(r);if(_s(t))return o;const l=new CustomEvent(t,{detail:e,composed:!1,bubbles:i,cancelable:n});return this.dispatchEvent(l)&&o}getSlottedNodes(t){return We(this[t])}get effectiveDir(){return ve(this.constructor),Zt(this)}get isUI5Element(){return!0}get classes(){return{}}static get observedAttributes(){return this.getMetadata().getAttributesList()}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _needsStaticArea(){return!!this.staticAreaTemplate||Object.prototype.hasOwnProperty.call(this.prototype,"renderStatic")}getStaticAreaItemDomRef(){if(!this.constructor._needsStaticArea())throw new Error("This component does not use the static area");return this.staticAreaItem||(this.staticAreaItem=R.createInstance(),this.staticAreaItem.setOwnerElement(this)),this.staticAreaItem.parentElement||Ae("ui5-static-area").appendChild(this.staticAreaItem),this.staticAreaItem.getDomRef()}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),n=this.getMetadata().getProperties();for(const[i,r]of Object.entries(n)){if($t(i)||console.warn(`"${i}" is not a valid property name. Use a name that does not collide with DOM APIs`),r.type===Boolean&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All booleans are false by default.`);if(r.type===Array)throw new Error(`Wrong type for property "${i}". Properties cannot be of type Array - use "multiple: true" and set "type" to the single value type, such as "String", "Object", etc...`);if(r.type===Object&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All properties of type "Object" are empty objects by default.`);if(r.multiple&&r.defaultValue)throw new Error(`Cannot set a default value for property "${i}". All multiple properties are empty arrays by default.`);Object.defineProperty(t,i,{get(){if(this._state[i]!==void 0)return this._state[i];const o=r.defaultValue;return r.type===Boolean?!1:r.type===String?o:r.multiple?[]:o},set(o){let l;o=this.constructor.getMetadata().constructor.validatePropertyValue(o,r);const p=r.type;let d=r.validator;const u=this._state[i];p&&p.isDataTypeClass&&(d=p),d?l=!d.valuesAreEqual(u,o):Array.isArray(u)&&Array.isArray(o)&&r.multiple&&r.compareValues?l=!wt(u,o):l=u!==o,l&&(this._state[i]=o,I.call(this,{type:"property",name:i,newValue:o,oldValue:u}),this._updateAttribute(i,o))}})}if(e){const i=this.getMetadata().getSlots();for(const[r,o]of Object.entries(i)){$t(r)||console.warn(`"${r}" is not a valid property name. Use a name that does not collide with DOM APIs`);const l=o.propertyName||r;Object.defineProperty(t,l,{get(){return this._state[l]!==void 0?this._state[l]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}})}}}static get styles(){return""}static get staticAreaStyles(){return""}static get dependencies(){return[]}static getUniqueDependencies(){if(!nt.has(this)){const t=this.dependencies.filter((e,n,i)=>i.indexOf(e)===n);nt.set(this,t)}return nt.get(this)||[]}static whenDependenciesDefined(){return Promise.all(this.getUniqueDependencies().map(t=>t.define()))}static async onDefine(){return Promise.resolve()}static async define(){await $e(),await Promise.all([this.whenDependenciesDefined(),this.onDefine()]);const t=this.getMetadata().getTag(),e=we(t),n=customElements.get(t);return n&&!e?Se(t):n||(this._generateAccessors(),be(t),window.customElements.define(t,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==$;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const n=Ce({},...t);return this._metadata=new Ge(n),this._metadata}}$.metadata={};const Ct=s=>"isUI5Element"in s;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as o,o as e,v as t}from"../../Boot.
|
|
1
|
+
import{H as o,o as e,v as t}from"../../Boot.d50b4c00.js";o(()=>{console.log("Listener1: after framework booted!")});e();const s={registerThemeProps:async()=>{t("@ui5/webcomponents-theming","sap_fiori_3",()=>({content:":root{ --customCol: #fff; --customBg: #000; }",packageName:"",fileName:""}))}};window["sap-ui-webcomponents-bundle"]=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../Boot.
|
|
1
|
+
import"../../Boot.d50b4c00.js";import"../../bundle.esm.d83f5ad4.js";const s=async()=>{["de","es","fr","en"].forEach(e=>window["sap-ui-webcomponents-bundle"].registerI18nLoader("myApp",e,()=>`./assets/messagebundle_${e}.properties`));const n=(await window["sap-ui-webcomponents-bundle"].getI18nBundle("myApp")).getText("PLEASE_WAIT");console.log("Please wait in the current language is: ",n)};s();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../Boot.
|
|
1
|
+
import"../../Boot.d50b4c00.js";import"../../bundle.esm.d83f5ad4.js";const a=async()=>{window["sap-ui-webcomponents-bundle"].configuration.setLanguage("fr");const s=["test_1","test_2","test_3","test_4","test_5","test_6","test_7","test_8","test_9"];window["sap-ui-webcomponents-bundle"].registerI18nLoader("myApp","fr",async e=>{const t=await(await fetch(`./assets/messagebundle_${e}.properties`)).text();return window["sap-ui-webcomponents-bundle"].parseProperties(t)});const r=await window["sap-ui-webcomponents-bundle"].getI18nBundle("myApp");s.forEach(e=>{const t=r.getText(e.toUpperCase(),"test"),n=document.getElementById(`${e}_text`);n.innerText=t}),s.forEach(e=>{const t=document.getElementById(`${e}_text`),n=document.getElementById(`${e}_result`);if(t.innerText!==n.innerText){const o=n.parentElement;o.style.textDecoration="underline",o.style.color="red"}})};a();
|
package/dist/config/Icons.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
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;
|
|
2
|
-
declare enum RegisteredIconCollection {
|
|
3
|
-
SAPIconsV4 = "SAP-icons-v4",
|
|
4
|
-
SAPIconsV5 = "SAP-icons-v5",
|
|
5
|
-
SAPIconsTNTV2 = "tnt-v2",
|
|
6
|
-
SAPIconsTNTV3 = "tnt-v3",
|
|
7
|
-
SAPBSIconsV1 = "business-suite-v1",
|
|
8
|
-
SAPBSIconsV2 = "business-suite-v2"
|
|
9
|
-
}
|
|
10
2
|
/**
|
|
11
3
|
* Sets the default icon collection for a given theme.
|
|
12
4
|
*
|
|
@@ -44,12 +36,5 @@ declare const setDefaultIconCollection: (theme: string, collectionName: IconColl
|
|
|
44
36
|
* @returns { string | undefined }
|
|
45
37
|
*/
|
|
46
38
|
declare const getDefaultIconCollection: (theme: string) => string | undefined;
|
|
47
|
-
|
|
48
|
-
* Returns the effective icon collection,
|
|
49
|
-
* based on the default icon collection configuration and the current theme:
|
|
50
|
-
* @param { IconCollection } collectionName
|
|
51
|
-
* @returns { IconCollection } the effective collection name
|
|
52
|
-
*/
|
|
53
|
-
declare const getEffectiveIconCollection: (collectionName?: IconCollection) => IconCollection;
|
|
54
|
-
export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
|
|
39
|
+
export { setDefaultIconCollection, getDefaultIconCollection, };
|
|
55
40
|
export type { IconCollection, };
|
package/dist/config/Icons.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import { getTheme, isLegacyThemeFamily } from "./Theme.js";
|
|
2
|
-
import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
|
|
3
1
|
const IconCollectionConfiguration = new Map();
|
|
4
|
-
// All registered icon collections - all icon collections resolves to these options at the end
|
|
5
|
-
var RegisteredIconCollection;
|
|
6
|
-
(function (RegisteredIconCollection) {
|
|
7
|
-
RegisteredIconCollection["SAPIconsV4"] = "SAP-icons-v4";
|
|
8
|
-
RegisteredIconCollection["SAPIconsV5"] = "SAP-icons-v5";
|
|
9
|
-
RegisteredIconCollection["SAPIconsTNTV2"] = "tnt-v2";
|
|
10
|
-
RegisteredIconCollection["SAPIconsTNTV3"] = "tnt-v3";
|
|
11
|
-
RegisteredIconCollection["SAPBSIconsV1"] = "business-suite-v1";
|
|
12
|
-
RegisteredIconCollection["SAPBSIconsV2"] = "business-suite-v2";
|
|
13
|
-
})(RegisteredIconCollection || (RegisteredIconCollection = {}));
|
|
14
2
|
/**
|
|
15
3
|
* Sets the default icon collection for a given theme.
|
|
16
4
|
*
|
|
@@ -52,52 +40,5 @@ const setDefaultIconCollection = (theme, collectionName) => {
|
|
|
52
40
|
const getDefaultIconCollection = (theme) => {
|
|
53
41
|
return IconCollectionConfiguration.get(theme);
|
|
54
42
|
};
|
|
55
|
-
|
|
56
|
-
* Returns the effective icon collection,
|
|
57
|
-
* based on the default icon collection configuration and the current theme:
|
|
58
|
-
* @param { IconCollection } collectionName
|
|
59
|
-
* @returns { IconCollection } the effective collection name
|
|
60
|
-
*/
|
|
61
|
-
const getEffectiveIconCollection = (collectionName) => {
|
|
62
|
-
const currentTheme = getTheme();
|
|
63
|
-
const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
|
|
64
|
-
// when no collection is set and default collection is configured - return the configured icon collection
|
|
65
|
-
if (!collectionName && currentThemeConfiguration) {
|
|
66
|
-
return getIconCollectionByAlias(currentThemeConfiguration);
|
|
67
|
-
}
|
|
68
|
-
// when collection is set - return the theme dependant icon collection
|
|
69
|
-
// when collection is not set and there is no default icon collection configured - return theme dependant icon collection
|
|
70
|
-
return getIconCollectionByTheme(collectionName);
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Returns the icon theme dependant collection, based on the collection name and current theme as follows:
|
|
74
|
-
*
|
|
75
|
-
* - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon" (or as confugred via setDefaultIconCollection)
|
|
76
|
-
* - "SAP-icons-v4" (and its alias "SAP-icons") forces "SAP-icons v4" in any theme and resolves to itself "SAP-icons-v4"
|
|
77
|
-
* - "SAP-icons-v5" (and its alias "horizon") forces "SAP-icons v5" in any theme and resolves to itself "SAP-icons-v5"
|
|
78
|
-
* - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
|
|
79
|
-
* - "tnt-v2" forces "TNT icons v2" in any theme and resolves to itself "tnt-v2"
|
|
80
|
-
* - "tnt-v3" forces "TNT icons v3" in any theme and resolves to itself "tnt-v3"
|
|
81
|
-
* - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
|
|
82
|
-
* - "business-suite-v1" forces "Business Suite icons v1" in any theme and resolves to itself "business-suite-v1"
|
|
83
|
-
* - "business-suite-v2" forces "Business Suite icons v2" in any theme and resolves to itself "business-suite-v2"
|
|
84
|
-
*
|
|
85
|
-
* <b>Note:</b> "SAP-icons-v4", "SAP-icons-v5", "tnt-v2", "tnt-v3", "business-suite-v1" and "business-suite-v2" are just returned
|
|
86
|
-
* @param { IconCollection } collectionName
|
|
87
|
-
* @returns { RegisteredIconCollection } the registered collection name
|
|
88
|
-
*/
|
|
89
|
-
const getIconCollectionByTheme = (collectionName) => {
|
|
90
|
-
const legacyThemeFamily = isLegacyThemeFamily();
|
|
91
|
-
if (!collectionName) {
|
|
92
|
-
return legacyThemeFamily ? RegisteredIconCollection.SAPIconsV4 : RegisteredIconCollection.SAPIconsV5;
|
|
93
|
-
}
|
|
94
|
-
if (collectionName === "tnt") {
|
|
95
|
-
return legacyThemeFamily ? RegisteredIconCollection.SAPIconsTNTV2 : RegisteredIconCollection.SAPIconsTNTV3;
|
|
96
|
-
}
|
|
97
|
-
if (collectionName === "business-suite") {
|
|
98
|
-
return legacyThemeFamily ? RegisteredIconCollection.SAPBSIconsV1 : RegisteredIconCollection.SAPBSIconsV2;
|
|
99
|
-
}
|
|
100
|
-
return collectionName;
|
|
101
|
-
};
|
|
102
|
-
export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
|
|
43
|
+
export { setDefaultIconCollection, getDefaultIconCollection, };
|
|
103
44
|
//# sourceMappingURL=Icons.js.map
|
package/dist/config/Icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,MAAM,2BAA2B,GAAG,IAAI,GAAG,EAAkB,CAAC;AAK9D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAE,cAA8B,EAAE,EAAE;IAClF,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAsB,EAAE;IACtE,OAAO,2BAA2B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,GACxB,CAAC","sourcesContent":["const IconCollectionConfiguration = new Map<string, string>();\n\n// All supported icon collections + unknown custom ones\ntype IconCollection = \"SAP-icons\" | \"SAP-icons-v4\" | \"SAP-icons-v5\" | \"horizon\" | \"tnt\" | \"tnt-v2\" | \"tnt-v3\" | \"business-suite\" | \"business-suite-v1\" | \"business-suite-v2\" | string;\n\n/**\n * Sets the default icon collection for a given theme.\n *\n * 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)\n * 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.\n * This method allows setting another (built-in or custom) icon collection as default per theme.\n *\n * <b>Usage</b>\n * <b>For example</b>, to make \"SAP-icons version 5.x\" the default icon collection in \"sap_fiori_3\":\n *\n * <pre>\n * setDefaultIconCollection(\"sap_fiori_3\", \"SAP-icons-v5\");\n *\n * <ui5-icon name=\"home\"></ui5-icon>\n * </pre>\n *\n * <b>For example</b>, to make a custom icon collection (with name \"my-custom-collection\") the default icon collection in \"sap_fiori_3\":\n *\n * <pre>\n * setDefaultIconCollection(\"sap_fiori_3\", \"my-custom-collection\");\n *\n * <ui5-icon name=\"custom-icon-name\"></ui5-icon>\n * </pre>\n *\n * @public\n * @param { string } theme\n * @param { string } collectionName\n */\nconst setDefaultIconCollection = (theme: string, collectionName: IconCollection) => {\n\tIconCollectionConfiguration.set(theme, collectionName);\n};\n\n/**\n * Returns the configured default icon collection for a given theme.\n *\n * @param { string } theme\n * @public\n * @returns { string | undefined }\n */\nconst getDefaultIconCollection = (theme: string): string | undefined => {\n\treturn IconCollectionConfiguration.get(theme);\n};\n\nexport {\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n};\n\nexport type {\n\tIconCollection,\n};\n"]}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<title>Base package default test page</title>
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
<script type="module" crossorigin src="/assets/Boot.
|
|
10
|
-
<script type="module" crossorigin src="/assets/bundle.esm.
|
|
9
|
+
<script type="module" crossorigin src="/assets/Boot.d50b4c00.js"></script>
|
|
10
|
+
<script type="module" crossorigin src="/assets/bundle.esm.d83f5ad4.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
<body>
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<script>delete Document.prototype.adoptedStyleSheets</script>
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
<script type="module" crossorigin src="/assets/test/pages/Boot.html.
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/Boot.
|
|
9
|
+
<script type="module" crossorigin src="/assets/test/pages/Boot.html.139d18a3.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.d50b4c00.js">
|
|
11
11
|
<link rel="stylesheet" href="/assets/Boot.34b7cea0.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
<script type="module" crossorigin src="/assets/Boot.
|
|
12
|
-
<script type="module" crossorigin src="/assets/bundle.esm.
|
|
11
|
+
<script type="module" crossorigin src="/assets/Boot.d50b4c00.js"></script>
|
|
12
|
+
<script type="module" crossorigin src="/assets/bundle.esm.d83f5ad4.js"></script>
|
|
13
13
|
</head>
|
|
14
14
|
|
|
15
15
|
<body>
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
<script type="module" crossorigin src="/assets/Boot.
|
|
44
|
-
<script type="module" crossorigin src="/assets/bundle.esm.
|
|
43
|
+
<script type="module" crossorigin src="/assets/Boot.d50b4c00.js"></script>
|
|
44
|
+
<script type="module" crossorigin src="/assets/bundle.esm.d83f5ad4.js"></script>
|
|
45
45
|
</head>
|
|
46
46
|
|
|
47
47
|
<body>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Compex Template Test Page</title>
|
|
6
6
|
|
|
7
|
-
<script type="module" crossorigin src="/assets/Boot.
|
|
8
|
-
<script type="module" crossorigin src="/assets/bundle.esm.
|
|
7
|
+
<script type="module" crossorigin src="/assets/Boot.d50b4c00.js"></script>
|
|
8
|
+
<script type="module" crossorigin src="/assets/bundle.esm.d83f5ad4.js"></script>
|
|
9
9
|
</head>
|
|
10
10
|
|
|
11
11
|
<body>
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
<script type="module" crossorigin src="/assets/test/pages/i18n.html.
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/Boot.
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.
|
|
10
|
+
<script type="module" crossorigin src="/assets/test/pages/i18n.html.9cb89d0c.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.d50b4c00.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.d83f5ad4.js">
|
|
13
13
|
</head>
|
|
14
14
|
|
|
15
15
|
<body>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
<script type="module" crossorigin src="/assets/test/pages/i18n_texts.html.
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/Boot.
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.
|
|
11
|
+
<script type="module" crossorigin src="/assets/test/pages/i18n_texts.html.20728054.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/Boot.d50b4c00.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/bundle.esm.d83f5ad4.js">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
16
|
<body>
|
package/index.js
CHANGED
|
@@ -10,9 +10,9 @@ import { getFirstDayOfWeek, getLegacyDateCalendarCustomizing } from "./dist/conf
|
|
|
10
10
|
import {
|
|
11
11
|
setDefaultIconCollection,
|
|
12
12
|
getDefaultIconCollection,
|
|
13
|
-
getEffectiveIconCollection,
|
|
14
|
-
RegisteredIconCollection,
|
|
15
13
|
} from "./dist/config/Icons.js";
|
|
14
|
+
import { RegisteredIconCollection } from "./dist/asset-registries/util/IconCollectionsByTheme.js";
|
|
15
|
+
import getEffectiveIconCollection from "./dist/asset-registries/util/getIconCollectionsByTheme.js";
|
|
16
16
|
import {
|
|
17
17
|
getLanguage,
|
|
18
18
|
setLanguage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "1.16.0
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@buxlabs/amd-to-es6": "0.16.1",
|
|
39
39
|
"@openui5/sap.ui.core": "1.116.0",
|
|
40
|
-
"@ui5/webcomponents-tools": "1.16.0
|
|
41
|
-
"chromedriver": "
|
|
40
|
+
"@ui5/webcomponents-tools": "1.16.0",
|
|
41
|
+
"chromedriver": "114.0.0",
|
|
42
42
|
"clean-css": "^5.2.2",
|
|
43
43
|
"copy-and-watch": "^0.1.5",
|
|
44
44
|
"cross-env": "^7.0.3",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"replace-in-file": "^6.3.5",
|
|
48
48
|
"resolve": "^1.20.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "fe4e7e41b2a2780e04e6b35aabbb48dff4fd0ef8"
|
|
51
51
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const C={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"]}},M=C.themes.default,ct=C.themes.all,V=C.languages.default,l=C.locales.default,fe=C.locales.all,ut=()=>{const e=navigator.languages,t=()=>navigator.language;return e&&e[0]||t()||V};var Ie={},Oe=Ie.hasOwnProperty,lt=Ie.toString,Ue=Oe.toString,ft=Ue.call(Object),de=function(e){var t,n;return!e||lt.call(e)!=="[object Object]"?!1:(t=Object.getPrototypeOf(e),t?(n=Oe.call(t,"constructor")&&t.constructor,typeof n=="function"&&Ue.call(n)===ft):!0)},dt=Object.create(null),De=function(e,t,n,s){var o,r,a,i,g,m,d=arguments[2]||{},N=3,at=arguments.length,le=arguments[0]||!1,it=arguments[1]?void 0:dt;for(typeof d!="object"&&typeof d!="function"&&(d={});N<at;N++)if((g=arguments[N])!=null)for(i in g)o=d[i],a=g[i],!(i==="__proto__"||d===a)&&(le&&a&&(de(a)||(r=Array.isArray(a)))?(r?(r=!1,m=o&&Array.isArray(o)?o:[]):m=o&&de(o)?o:{},d[i]=De(le,arguments[1],m,a)):a!==it&&(d[i]=a));return d};const Me=function(e,t){return De(!0,!1,...arguments)},ke=new Map,ht=(e,t)=>{ke.set(e,t)},_=e=>ke.get(e),pt=e=>{const t=document.querySelector(`META[name="${e}"]`);return t&&t.getAttribute("content")},gt=e=>{const t=pt("sap-allowedThemeOrigins");return t&&t.split(",").some(n=>n==="*"||e===n.trim())},mt=(e,t)=>{const n=new URL(e).pathname;return new URL(n,t).toString()},ze=e=>{let t;try{if(e.startsWith(".")||e.startsWith("/"))t=new URL(e,window.location.href).toString();else{const n=new URL(e),s=n.origin;s&>(s)?t=n.toString():t=mt(n.toString(),window.location.href)}return t.endsWith("/")||(t=`${t}/`),`${t}UI5/`}catch{}};var ee;(function(e){e.Full="full",e.Basic="basic",e.Minimal="minimal",e.None="none"})(ee||(ee={}));const wt=ee;let he=!1,u={animationMode:wt.Full,theme:M,themeRoot:void 0,rtl:void 0,language:void 0,timezone:void 0,calendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1};const Jn=()=>(f(),u.animationMode),yt=()=>(f(),u.theme),St=()=>(f(),u.themeRoot),Xn=()=>(f(),u.rtl),_t=()=>(f(),u.language),Tt=()=>(f(),u.fetchDefaultLanguage),Yn=()=>(f(),u.noConflict),Qn=()=>(f(),u.calendarType),es=()=>(f(),u.formatSettings),k=new Map;k.set("true",!0);k.set("false",!1);const bt=()=>{const e=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let t;if(e){try{t=JSON.parse(e.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}t&&(u=Me(u,t))}},Lt=()=>{const e=new URLSearchParams(window.location.search);e.forEach((t,n)=>{const s=n.split("sap-").length;s===0||s===n.split("sap-ui-").length||pe(n,t,"sap")}),e.forEach((t,n)=>{!n.startsWith("sap-ui")||pe(n,t,"sap-ui")})},At=e=>{const t=e.split("@")[1];return ze(t)},vt=(e,t)=>e==="theme"&&t.includes("@")?t.split("@")[0]:t,pe=(e,t,n)=>{const s=t.toLowerCase(),o=e.split(`${n}-`)[1];k.has(t)&&(t=k.get(s)),o==="theme"?(u.theme=vt(o,t),t&&t.includes("@")&&(u.themeRoot=At(t))):u[o]=t},Ct=()=>{const e=_("OpenUI5Support");if(!e||!e.isOpenUI5Detected())return;const t=e.getConfigurationSettingsObject();u=Me(u,t)},f=()=>{typeof document>"u"||he||(bt(),Lt(),Ct(),he=!0)};class E{constructor(){this._eventRegistry=new Map}attachEvent(t,n){const s=this._eventRegistry,o=s.get(t);if(!Array.isArray(o)){s.set(t,[n]);return}o.includes(n)||o.push(n)}detachEvent(t,n){const s=this._eventRegistry,o=s.get(t);if(!o)return;const r=o.indexOf(n);r!==-1&&o.splice(r,1),o.length===0&&s.delete(t)}fireEvent(t,n){const o=this._eventRegistry.get(t);return o?o.map(r=>r.call(this,n)):[]}fireEventAsync(t,n){return Promise.all(this.fireEvent(t,n))}isHandlerAttached(t,n){const o=this._eventRegistry.get(t);return o?o.includes(n):!1}hasListeners(t){return!!this._eventRegistry.get(t)}}const xe=new E,Be="languageChange",Fe=e=>{xe.attachEvent(Be,e)},Et=e=>xe.fireEventAsync(Be,e),ge=10;class Pt{constructor(){this.list=[],this.lookup=new Set}add(t){this.lookup.has(t)||(this.list.push(t),this.lookup.add(t))}remove(t){!this.lookup.has(t)||(this.list=this.list.filter(n=>n!==t),this.lookup.delete(t))}shift(){const t=this.list.shift();if(t)return this.lookup.delete(t),t}isEmpty(){return this.list.length===0}isAdded(t){return this.lookup.has(t)}process(t){let n;const s=new Map;for(n=this.shift();n;){const o=s.get(n)||0;if(o>ge)throw new Error(`Web component processed too many times this task, max allowed is: ${ge}`);t(n),s.set(n,o+1),n=this.shift()}}}const $t=(e,t=document.body,n)=>{let s=document.querySelector(e);return s||(s=n?n():document.createElement(e),t.insertBefore(s,t.firstChild))},Rt=()=>{const e=document.createElement("meta");return e.setAttribute("name","ui5-shared-resources"),e.setAttribute("content",""),e},It=()=>typeof document>"u"?null:$t('meta[name="ui5-shared-resources"]',document.head,Rt),P=(e,t)=>{const n=e.split(".");let s=It();if(!s)return t;for(let o=0;o<n.length;o++){const r=n[o],a=o===n.length-1;Object.prototype.hasOwnProperty.call(s,r)||(s[r]=a?t:{}),s=s[r]}return s},Ot={version:"1.16.0-rc.3",major:1,minor:16,patch:0,suffix:"-rc.3",isNext:!1,buildTime:1690445606};let U,Ut="";const W=new Map,A=P("Runtimes",[]),Dt=()=>{if(U===void 0){U=A.length;const e=Ot;A.push({...e,alias:Ut,description:`Runtime ${U} - ver ${e.version}`})}},$=()=>U,Mt=(e,t)=>{const n=`${e},${t}`;if(W.has(n))return W.get(n);const s=A[e],o=A[t];if(!s||!o)throw new Error("Invalid runtime index supplied");if(s.isNext||o.isNext)return s.buildTime-o.buildTime;const r=s.major-o.major;if(r)return r;const a=s.minor-o.minor;if(a)return a;const i=s.patch-o.patch;if(i)return i;const m=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare(s.suffix,o.suffix);return W.set(n,m),m},kt=()=>A,Ve=P("Tags",new Map),oe=new Set;let p=new Map,H;const je=-1,ts=e=>{oe.add(e),Ve.set(e,$())},ns=e=>oe.has(e),zt=()=>[...oe.values()],ss=e=>{let t=Ve.get(e);t===void 0&&(t=je),p.has(t)||p.set(t,new Set),p.get(t).add(e),H||(H=setTimeout(()=>{xt(),p=new Map,H=void 0},1e3))},xt=()=>{const e=kt(),t=$(),n=e[t];let s="Multiple UI5 Web Components instances detected.";e.length>1&&(s=`${s}
|
|
2
|
-
Loading order (versions before 1.1.0 not listed): ${e.map(o=>`
|
|
3
|
-
${o.description}`).join("")}`),[...p.keys()].forEach(o=>{let r,a;o===je?(r=1,a={description:"Older unknown runtime"}):(r=Mt(t,o),a=e[o]);let i;r>0?i="an older":r<0?i="a newer":i="the same",s=`${s}
|
|
4
|
-
|
|
5
|
-
"${n.description}" failed to define ${p.get(o).size} tag(s) as they were defined by a runtime of ${i} version "${a.description}": ${[...p.get(o)].sort().join(", ")}.`,r>0?s=`${s}
|
|
6
|
-
WARNING! If your code uses features of the above web components, unavailable in ${a.description}, it might not work as expected!`:s=`${s}
|
|
7
|
-
Since the above web components were defined by the same or newer version runtime, they should be compatible with your code.`}),s=`${s}
|
|
8
|
-
|
|
9
|
-
To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(s)},qe=new Set,os=e=>{qe.add(e)},Bt=e=>qe.has(e),re=new Set,Ft=new E,T=new Pt;let w,D,G,I;const Vt=async e=>{T.add(e),await qt()},jt=e=>{Ft.fireEvent("beforeComponentRender",e),re.add(e),e._render()},rs=e=>{T.remove(e),re.delete(e)},qt=async()=>{I||(I=new Promise(e=>{window.requestAnimationFrame(()=>{T.process(jt),I=null,e(),G||(G=setTimeout(()=>{G=void 0,T.isEmpty()&&Ht()},200))})})),await I},Zt=()=>w||(w=new Promise(e=>{D=e,window.requestAnimationFrame(()=>{T.isEmpty()&&(w=void 0,e())})}),w),Nt=()=>{const e=zt().map(t=>customElements.whenDefined(t));return Promise.all(e)},Wt=async()=>{await Nt(),await Zt()},Ht=()=>{!T.isEmpty()||D&&(D(),D=void 0,w=void 0)},Ze=async e=>{re.forEach(t=>{const n=t.constructor,s=n.getMetadata().getTag(),o=Bt(n),r=n.getMetadata().isLanguageAware(),a=n.getMetadata().isThemeAware();(!e||e.tag===s||e.rtlAware&&o||e.languageAware&&r||e.themeAware&&a)&&Vt(t)}),await Wt()};let b,te;const Gt=()=>(b===void 0&&(b=_t()),b),as=async e=>{b!==e&&(b=e,await Et(e),await Ze({languageAware:!0}))},Kt=e=>{te=e},Jt=()=>(te===void 0&&Kt(Tt()),te),Xt=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i;class Ne{constructor(t){const n=Xt.exec(t.replace(/_/g,"-"));if(n===null)throw new Error(`The given language ${t} does not adhere to BCP-47.`);this.sLocaleId=t,this.sLanguage=n[1]||V,this.sScript=n[2]||"",this.sRegion=n[3]||"",this.sVariant=n[4]&&n[4].slice(1)||null,this.sExtension=n[5]&&n[5].slice(1)||null,this.sPrivateUse=n[6]||null,this.sLanguage&&(this.sLanguage=this.sLanguage.toLowerCase()),this.sScript&&(this.sScript=this.sScript.toLowerCase().replace(/^[a-z]/,s=>s.toUpperCase())),this.sRegion&&(this.sRegion=this.sRegion.toUpperCase())}getLanguage(){return this.sLanguage}getScript(){return this.sScript}getRegion(){return this.sRegion}getVariant(){return this.sVariant}getVariantSubtags(){return this.sVariant?this.sVariant.split("-"):[]}getExtension(){return this.sExtension}getExtensionSubtags(){return this.sExtension?this.sExtension.slice(2).split("-"):[]}getPrivateUse(){return this.sPrivateUse}getPrivateUseSubtags(){return this.sPrivateUse?this.sPrivateUse.slice(2).split("-"):[]}hasPrivateUseSubtag(t){return this.getPrivateUseSubtags().indexOf(t)>=0}toString(){const t=[this.sLanguage];return this.sScript&&t.push(this.sScript),this.sRegion&&t.push(this.sRegion),this.sVariant&&t.push(this.sVariant),this.sExtension&&t.push(this.sExtension),this.sPrivateUse&&t.push(this.sPrivateUse),t.join("-")}}const K=new Map,We=e=>(K.has(e)||K.set(e,new Ne(e)),K.get(e)),me=e=>{try{if(e&&typeof e=="string")return We(e)}catch{}return new Ne(l)},ne=e=>{if(e)return me(e);const t=Gt();return t?We(t):me(ut())},Yt=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i,we=/(?:^|-)(saptrc|sappsd)(?:-|$)/i,Qt={he:"iw",yi:"ji",nb:"no",sr:"sh"},en=e=>{let t;if(!e)return l;if(typeof e=="string"&&(t=Yt.exec(e.replace(/_/g,"-")))){let n=t[1].toLowerCase(),s=t[3]?t[3].toUpperCase():void 0;const o=t[2]?t[2].toLowerCase():void 0,r=t[4]?t[4].slice(1):void 0,a=t[6];return n=Qt[n]||n,a&&(t=we.exec(a))||r&&(t=we.exec(r))?`en_US_${t[1].toLowerCase()}`:(n==="zh"&&!s&&(o==="hans"?s="CN":o==="hant"&&(s="TW")),n+(s?"_"+s+(r?"_"+r.replace("-","_"):""):""))}return l},tn=e=>{if(!e)return l;if(e==="zh_HK")return"zh_TW";const t=e.lastIndexOf("_");return t>=0?e.slice(0,t):e!==l?l:""},ye=new Set,Se=new Set,ae=new Map,J=new Map,ie=new Map,is=(e,t,n)=>{const s=`${e}/${t}`;ie.set(s,n)},_e=(e,t)=>{ae.set(e,t)},cs=e=>ae.get(e),He=(e,t)=>{const n=`${e}/${t}`;return ie.has(n)},nn=(e,t)=>{const n=`${e}/${t}`,s=ie.get(n);return s&&!J.get(n)&&J.set(n,s(t)),J.get(n)},sn=e=>{ye.has(e)||(console.warn(`[${e}]: Message bundle assets are not configured. Falling back to English texts.`,` Add \`import "${e}/dist/Assets.js"\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section "Assets" in the documentation for more information.`),ye.add(e))},Te=(e,t)=>t!==V&&!He(e,t),on=async e=>{const t=ne().getLanguage(),n=ne().getRegion();let s=t+(n?`-${n}`:"");if(Te(e,s))for(s=en(s);Te(e,s);)s=tn(s);const o=Jt();if(s===V&&!o){_e(e,null);return}if(!He(e,s)){sn(e);return}try{const r=await nn(e,s);_e(e,r)}catch(r){const a=r;Se.has(a.message)||(Se.add(a.message),console.error(a.message))}};Fe(e=>{const t=[...ae.keys()];return Promise.all(t.map(on))});const rn=new Map,z=new Map,X=new Map,be=new Set;let Le=!1;const an={iw:"he",ji:"yi",in:"id"},Ae=e=>{Le||(console.warn(`[LocaleData] Supported locale "${e}" not configured, import the "Assets.js" module from the webcomponents package you are using.`),Le=!0)},cn=(e,t,n)=>{e=e&&an[e]||e,e==="no"&&(e="nb"),e==="zh"&&!t&&(n==="Hans"?t="CN":n==="Hant"&&(t="TW")),(e==="sh"||e==="sr"&&n==="Latn")&&(e="sr",t="Latn");let s=`${e}_${t}`;return fe.includes(s)||(s=e,fe.includes(s))?z.has(s)?s:(Ae(s),l):l},ve=(e,t)=>{rn.set(e,t)},un=e=>{if(!X.get(e)){const t=z.get(e);if(!t)throw new Error(`CLDR data for locale ${e} is not loaded!`);X.set(e,t(e))}return X.get(e)},ln=async(e,t,n)=>{const s=cn(e,t,n),o=_("OpenUI5Support");if(o){const r=o.getLocaleDataObject();if(r){ve(s,r);return}}try{const r=await un(s);ve(s,r)}catch(r){const a=r;be.has(a.message)||(be.add(a.message),console.error(a.message))}},fn=(e,t)=>{z.set(e,t)};fn("en",async()=>(await fetch("https://sdk.openui5.org/1.103.0/resources/sap/ui/core/cldr/en.json")).json());Fe(()=>{const e=ne();return ln(e.getLanguage(),e.getRegion(),e.getScript())});const Ge=new E,Ke="themeRegistered",dn=e=>{Ge.attachEvent(Ke,e)},hn=e=>Ge.fireEvent(Ke,e),Je=new Map,Xe=new Map,Ye=new Set,x=new Set,us=(e,t,n)=>{Xe.set(`${e}/${t}`,n),Ye.add(e),x.add(t),hn(t)},Qe=async(e,t)=>{const n=Je.get(`${e}_${t}`);if(n!==void 0)return n;if(!x.has(t)){const s=[...x.values()].join(", ");return console.warn(`You have requested a non-registered theme ${t} - falling back to ${M}. Registered themes are: ${s}`),Ce(e,M)}return Ce(e,t)},Ce=async(e,t)=>{const n=Xe.get(`${e}/${t}`);if(!n){console.error(`Theme [${t}] not registered for package [${e}]`);return}let s;try{s=await n(t)}catch(r){console.error(e,r.message);return}const o=s._||s;return Je.set(`${e}_${t}`,o),o},et=()=>Ye,pn=e=>x.has(e);var B;(function(e){e["SAP-icons"]="SAP-icons-v4",e.horizon="SAP-icons-v5",e["SAP-icons-TNT"]="tnt",e.BusinessSuiteInAppSymbols="business-suite"})(B||(B={}));const tt=e=>B[e]?B[e]:e,gn=(e,t)=>{const n=document.createElement("style");return n.type="text/css",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.textContent=e,document.head.appendChild(n),n},mn=(e,t)=>{const n=document.createElement("link");return n.type="text/css",n.rel="stylesheet",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.href=e,document.head.appendChild(n),new Promise(s=>{n.addEventListener("load",s),n.addEventListener("error",s)})},j=(e,t)=>t?`${e}|${t}`:e,q=(e,t,n="")=>{let s=typeof e=="string"?e:e.content;if(s.includes("[_ui5host]")&&(s=s.replaceAll("[_ui5host]",`[_ui5rt${$()}]`)),document.adoptedStyleSheets){const o=new CSSStyleSheet;o.replaceSync(s),o._ui5StyleId=j(t,n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}else{const o={};o[t]=n,gn(s,o)}},wn=(e,t,n="")=>{let s=typeof e=="string"?e:e.content;if(s.includes("[_ui5host]")&&(s=s.replaceAll("[_ui5host]",`[_ui5rt${$()}]`)),document.adoptedStyleSheets){const o=document.adoptedStyleSheets.find(r=>r._ui5StyleId===j(t,n));o&&o.replaceSync(s||"")}else{const o=document.querySelector(`head>style[${t}="${n}"]`);o&&(o.textContent=s||"")}},Z=(e,t="")=>document.adoptedStyleSheets?!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===j(e,t)):!!document.querySelector(`head>style[${e}="${t}"]`),yn=(e,t="")=>{var n;if(document.adoptedStyleSheets)document.adoptedStyleSheets=document.adoptedStyleSheets.filter(s=>s._ui5StyleId!==j(e,t));else{const s=document.querySelector(`head > style[${e}="${t}"]`);(n=s==null?void 0:s.parentElement)==null||n.removeChild(s)}},nt=(e,t,n="")=>{Z(t,n)?wn(e,t,n):q(e,t,n)},y=new Set,Sn=()=>{let e=document.querySelector(".sapThemeMetaData-Base-baseLib")||document.querySelector(".sapThemeMetaData-UI5-sap-ui-core");if(e)return getComputedStyle(e).backgroundImage;e=document.createElement("span"),e.style.display="none",e.classList.add("sapThemeMetaData-Base-baseLib"),document.body.appendChild(e);let t=getComputedStyle(e).backgroundImage;return t==="none"&&(e.classList.add("sapThemeMetaData-UI5-sap-ui-core"),t=getComputedStyle(e).backgroundImage),document.body.removeChild(e),t},_n=e=>{const t=/\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(e);if(t&&t.length>=2){let n=t[1];if(n=n.replace(/\\"/g,'"'),n.charAt(0)!=="{"&&n.charAt(n.length-1)!=="}")try{n=decodeURIComponent(n)}catch{y.has("decode")||(console.warn("Malformed theme metadata string, unable to decodeURIComponent"),y.add("decode"));return}try{return JSON.parse(n)}catch{y.has("parse")||(console.warn("Malformed theme metadata string, unable to parse JSON"),y.add("parse"))}}},Tn=e=>{let t,n;try{t=e.Path.match(/\.([^.]+)\.css_variables$/)[1],n=e.Extends[0]}catch{y.has("object")||(console.warn("Malformed theme metadata Object",e),y.add("object"));return}return{themeName:t,baseThemeName:n}},se=()=>{const e=Sn();if(!e||e==="none")return;const t=_n(e);if(t)return Tn(t)},bn=new E,Ln="themeLoaded",An=e=>bn.fireEvent(Ln,e);let L;const st=()=>(L===void 0&&(L=St()),L),ls=e=>{if(L!==e){if(L=e,!ze(e)){console.warn(`The ${e} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}return ot(R())}},vn=e=>`${st()}Base/baseLib/${e}/css_variables.css`,ot=async e=>{const t=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);t&&document.head.removeChild(t),await mn(vn(e),{"sap-ui-webcomponents-theme":e})},Cn=P("PopupUtilsData",{currentZIndex:100}),Ee=()=>Cn.currentZIndex;class c{static isAtLeastVersion116(){const n=window.sap.ui.version.split(".");return!n||n.length<2?!1:parseInt(n[0])>1||parseInt(n[1])>=116}static isOpenUI5Detected(){var t,n;return typeof((n=(t=window.sap)==null?void 0:t.ui)==null?void 0:n.require)=="function"}static init(){return c.isOpenUI5Detected()?new Promise(t=>{window.sap.ui.require(["sap/ui/core/Core"],async n=>{const s=()=>{let o=["sap/ui/core/Popup","sap/ui/core/LocaleData"];c.isAtLeastVersion116()&&(o=[...o,"sap/base/i18n/Formatting","sap/base/i18n/Localization","sap/ui/core/ControlBehavior","sap/ui/core/Theming","sap/ui/core/date/CalendarUtils"]),window.sap.ui.require(o,r=>{r.setInitialZIndex(Ee()),t()})};c.isAtLeastVersion116()?(await n.ready(),s()):n.attachInit(s)})}):Promise.resolve()}static getConfigurationSettingsObject(){if(!c.isOpenUI5Detected())return{};if(c.isAtLeastVersion116()){const o=window.sap.ui.require("sap/ui/core/ControlBehavior"),r=window.sap.ui.require("sap/base/i18n/Localization"),a=window.sap.ui.require("sap/ui/core/Theming"),i=window.sap.ui.require("sap/base/i18n/Formatting"),g=window.sap.ui.require("sap/ui/core/date/CalendarUtils");return{animationMode:o.getAnimationMode(),language:r.getLanguage(),theme:a.getTheme(),themeRoot:a.getThemeRoot(),rtl:r.getRTL(),timezone:r.getTimezone(),calendarType:i.getCalendarType(),formatSettings:{firstDayOfWeek:g.getWeekConfigurationValues().firstDayOfWeek,legacyDateCalendarCustomizing:i.getLegacyDateCalendarCustomizing()}}}const n=window.sap.ui.require("sap/ui/core/Core").getConfiguration(),s=window.sap.ui.require("sap/ui/core/LocaleData");return{animationMode:n.getAnimationMode(),language:n.getLanguage(),theme:n.getTheme(),themeRoot:n.getThemeRoot(),rtl:n.getRTL(),timezone:n.getTimezone(),calendarType:n.getCalendarType(),formatSettings:{firstDayOfWeek:s?s.getInstance(n.getLocale()).getFirstDayOfWeek():void 0,legacyDateCalendarCustomizing:n.getFormatSettings().getLegacyDateCalendarCustomizing()}}}static getLocaleDataObject(){if(!c.isOpenUI5Detected())return;const t=window.sap.ui.require("sap/ui/core/LocaleData");if(c.isAtLeastVersion116()){const o=window.sap.ui.require("sap/base/i18n/Localization");return t.getInstance(o.getLanguageTag())._get()}const s=window.sap.ui.require("sap/ui/core/Core").getConfiguration();return t.getInstance(s.getLocale())._get()}static _listenForThemeChange(){if(c.isAtLeastVersion116()){const t=window.sap.ui.require("sap/ui/core/Theming");t.attachApplied(()=>{Pe(t.getTheme())})}else{const t=window.sap.ui.require("sap/ui/core/Core"),n=t.getConfiguration();t.attachThemeChanged(()=>{Pe(n.getTheme())})}}static attachListeners(){!c.isOpenUI5Detected()||c._listenForThemeChange()}static cssVariablesLoaded(){if(!c.isOpenUI5Detected())return;const t=[...document.head.children].find(n=>n.id==="sap-ui-theme-sap.ui.core");return t?!!t.href.match(/\/css(-|_)variables\.css/):!1}static getNextZIndex(){if(!c.isOpenUI5Detected())return;const t=window.sap.ui.require("sap/ui/core/Popup");return t||console.warn(`The OpenUI5Support feature hasn't been initialized properly. Make sure you import the "@ui5/webcomponents-base/dist/features/OpenUI5Support.js" module before all components' modules.`),t.getNextZIndex()}static setInitialZIndex(){if(!c.isOpenUI5Detected())return;window.sap.ui.require("sap/ui/core/Popup").setInitialZIndex(Ee())}}ht("OpenUI5Support",c);const v="@ui5/webcomponents-theming",En=()=>et().has(v),Pn=async e=>{if(!En())return;const t=await Qe(v,e);t&&nt(t,"data-ui5-theme-properties",v)},$n=()=>{yn("data-ui5-theme-properties",v)},Rn=async e=>{const n=[...et()].map(async s=>{if(s===v)return;const o=await Qe(s,e);o&&nt(o,`data-ui5-component-properties-${$()}`,s)});return Promise.all(n)},In=async e=>{var s;const t=se();if(t)return t;const n=_("OpenUI5Support");if(n&&c.isOpenUI5Detected()){if(n.cssVariablesLoaded())return{themeName:(s=n.getConfigurationSettingsObject())==null?void 0:s.theme,baseThemeName:""}}else if(st())return await ot(e),se()},ce=async e=>{const t=await In(e);!t||e!==t.themeName?await Pn(e):$n();const n=pn(e)?e:t&&t.baseThemeName;await Rn(n||M),An(e)};let S;const R=()=>(S===void 0&&(S=yt()),S),Pe=async e=>{S!==e&&(S=e,await ce(S),await Ze({themeAware:!0}))},On=()=>{var t,n;const e=R();return Un(e)?!e.startsWith("sap_horizon"):!((n=(t=se())==null?void 0:t.baseThemeName)!=null&&n.startsWith("sap_horizon"))},Un=e=>ct.includes(e),Dn=new Map;var h;(function(e){e.SAPIconsV4="SAP-icons-v4",e.SAPIconsV5="SAP-icons-v5",e.SAPIconsTNTV2="tnt-v2",e.SAPIconsTNTV3="tnt-v3",e.SAPBSIconsV1="business-suite-v1",e.SAPBSIconsV2="business-suite-v2"})(h||(h={}));const Mn=e=>{const t=R(),n=Dn.get(t);return!e&&n?tt(n):kn(e)},kn=e=>{const t=On();return e?e==="tnt"?t?h.SAPIconsTNTV2:h.SAPIconsTNTV3:e==="business-suite"?t?h.SAPBSIconsV1:h.SAPBSIconsV2:e:t?h.SAPIconsV4:h.SAPIconsV5},$e=new Map,F=P("SVGIcons.registry",new Map),Y=P("SVGIcons.promises",new Map),Re="ICON_NOT_FOUND",zn=async e=>{if(!Y.has(e)){if(!$e.has(e))throw new Error(`No loader registered for the ${e} icons collection. Probably you forgot to import the "AllIcons.js" module for the respective package.`);const t=$e.get(e);Y.set(e,t(e))}return Y.get(e)},xn=e=>{Object.keys(e.data).forEach(t=>{const n=e.data[t];Bn(t,{pathData:n.path||n.paths,ltr:n.ltr,accData:n.acc,collection:e.collection,packageName:e.packageName})})},Bn=(e,t)=>{const n=`${t.collection}/${e}`;F.set(n,{pathData:t.pathData,ltr:t.ltr,accData:t.accData,packageName:t.packageName,customTemplate:t.customTemplate,viewBox:t.viewBox,collection:t.collection})},Fn=e=>{e.startsWith("sap-icon://")&&(e=e.replace("sap-icon://",""));let t;[e,t]=e.split("/").reverse(),e=e.replace("icon-",""),t&&(t=tt(t)),t=Mn(t);const n=`${t}/${e}`;return{name:e,collection:t,registryKey:n}},Q=async e=>{const{collection:t,registryKey:n}=Fn(e);let s=Re;try{s=await zn(t)}catch(o){console.error(o.message)}return s===Re?s:(F.has(n)||xn(s),F.get(n))},fs=async()=>(await Q("edit"),await Q("tnt/arrow"),await Q("business-suite/3d"),Array.from(F.keys())),Vn=()=>new Promise(e=>{document.body?e():document.addEventListener("DOMContentLoaded",()=>{e()})}),jn={packageName:"@ui5/webcomponents-base",fileName:"FontFace.css",content:`@font-face{font-family:"72";font-style:normal;font-weight:400;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2"),local("72")}@font-face{font-family:"72full";font-style:normal;font-weight:400;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2"),local('72-full')}@font-face{font-family:"72";font-style:normal;font-weight:700;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),local('72-Bold')}@font-face{font-family:"72full";font-style:normal;font-weight:700;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Bold';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),local('72-Bold')}@font-face{font-family:'72-Boldfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Light';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Light.woff2?ui5-webcomponents) format("woff2"),local('72-Light')}@font-face{font-family:'72-Lightfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72Mono';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Regular.woff2?ui5-webcomponents) format('woff2'),local('72Mono')}@font-face{font-family:'72Monofull';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Regular-full.woff2?ui5-webcomponents) format('woff2')}@font-face{font-family:'72Mono-Bold';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Bold.woff2?ui5-webcomponents) format('woff2'),local('72Mono-Bold')}@font-face{font-family:'72Mono-Boldfull';src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72Mono-Bold-full.woff2?ui5-webcomponents) format('woff2')}@font-face{font-family:"72Black";font-style:bold;font-weight:900;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Black.woff2?ui5-webcomponents) format("woff2"),local('72Black')}@font-face{font-family:"72-SemiboldDuplex";src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-SemiboldDuplex.woff2?ui5-webcomponents) format("woff2"),local('72-SemiboldDuplex')}`},qn={packageName:"@ui5/webcomponents-base",fileName:"OverrideFontFace.css",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')}"},Zn=()=>{const e=_("OpenUI5Support");(!e||!e.isOpenUI5Detected())&&Nn(),Wn()},Nn=()=>{Z("data-ui5-font-face")||q(jn,"data-ui5-font-face")},Wn=()=>{Z("data-ui5-font-face-override")||q(qn,"data-ui5-font-face-override")},Hn={packageName:"@ui5/webcomponents-base",fileName:"SystemCSSVars.css",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}"},Gn=()=>{Z("data-ui5-system-css-vars")||q(Hn,"data-ui5-system-css-vars")};let ue=!1,O;const rt=new E,ds=e=>{if(!ue){rt.attachEvent("boot",e);return}e()},hs=async()=>{if(O!==void 0)return O;const e=async t=>{if(typeof document>"u"){t();return}dn(Kn),Dt();const n=_("OpenUI5Support"),s=n?n.isOpenUI5Detected():!1,o=_("F6Navigation");n&&await n.init(),o&&!s&&o.init(),await Vn(),await ce(R()),n&&n.attachListeners(),Zn(),Gn(),t(),ue=!0,await rt.fireEventAsync("boot")};return O=new Promise(e),O},Kn=e=>{const t=R();ue&&e===t&&ce(t)};export{as as A,R as B,st as C,ls as D,E,Pe as F,is as G,ds as H,fs as _,P as a,_ as b,Xn as c,Gt as d,ut as e,on as f,cs as g,$ as h,Wt as i,Yn as j,jt as k,rs as l,os as m,$t as n,hs as o,ns as p,ss as q,Ze as r,ts as s,Me as t,Vt as u,us as v,Jn as w,Qn as x,ht as y,es as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../src/assets-meta/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACxB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;AAC/C,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED;;;;;;;;;;GAUG;AACH,MAAM,wBAAwB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC3D,IAAI,oBAAoB,CAAC,cAAmD,CAAC,EAAE;QAC9E,OAAO,oBAAoB,CAAC,cAAmD,CAAC,CAAC;KACjF;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC;AACpC,OAAO,EACN,wBAAwB,GACxB,CAAC","sourcesContent":["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the mapped collection name for a given alias.\n *\n * <b>For example</b>:\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"]}
|