@ui5/webcomponents-base 0.0.0-c41f1b293 → 0.0.0-c48b38fdc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/CHANGELOG.md +647 -0
- package/README.md +2 -1
- package/bundle.esm.js +1 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/AssetRegistry.d.ts +2 -2
- package/dist/AssetRegistry.js +2 -2
- package/dist/AssetRegistry.js.map +1 -1
- package/dist/Boot.d.ts +3 -2
- package/dist/Boot.js +7 -4
- package/dist/Boot.js.map +1 -1
- package/dist/CSP.d.ts +9 -6
- package/dist/CSP.js +9 -6
- package/dist/CSP.js.map +1 -1
- package/dist/CustomElementsScope.d.ts +4 -4
- package/dist/CustomElementsScope.js +2 -2
- package/dist/CustomElementsScope.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +8 -1
- package/dist/CustomElementsScopeUtils.js +13 -1
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/Device.d.ts +2 -1
- package/dist/Device.js +10 -1
- package/dist/Device.js.map +1 -1
- package/dist/FontFace.js +1 -1
- package/dist/FontFace.js.map +1 -1
- package/dist/IgnoreCustomElements.d.ts +3 -5
- package/dist/IgnoreCustomElements.js +3 -5
- package/dist/IgnoreCustomElements.js.map +1 -1
- package/dist/InitialConfiguration.d.ts +2 -2
- package/dist/InitialConfiguration.js +7 -6
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +5 -1
- package/dist/Keys.js +109 -106
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.d.ts +5 -4
- package/dist/ManagedStyles.js +96 -23
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/MediaRange.d.ts +6 -12
- package/dist/MediaRange.js +21 -31
- package/dist/MediaRange.js.map +1 -1
- package/dist/StaticAreaItem.d.ts +3 -4
- package/dist/StaticAreaItem.js +10 -12
- package/dist/StaticAreaItem.js.map +1 -1
- package/dist/UI5Element.d.ts +36 -27
- package/dist/UI5Element.js +98 -47
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +6 -13
- package/dist/UI5ElementMetadata.js +17 -15
- package/dist/UI5ElementMetadata.js.map +1 -1
- 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/asset-registries/Illustrations.d.ts +2 -0
- package/dist/asset-registries/Illustrations.js +51 -20
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +1 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +4 -3
- package/dist/asset-registries/Themes.js +26 -10
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/asset-registries/i18n.d.ts +2 -2
- package/dist/asset-registries/i18n.js +4 -3
- package/dist/asset-registries/i18n.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/config/CalendarType.d.ts +8 -1
- package/dist/config/CalendarType.js +18 -2
- package/dist/config/CalendarType.js.map +1 -1
- package/dist/config/Icons.d.ts +9 -24
- package/dist/config/Icons.js +8 -67
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/Language.d.ts +1 -1
- package/dist/config/Language.js +6 -3
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +1 -1
- package/dist/config/Theme.js +7 -4
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +2 -4
- package/dist/config/ThemeRoot.js +2 -4
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/config/Timezone.d.ts +1 -1
- package/dist/config/Timezone.js +1 -1
- package/dist/config/Timezone.js.map +1 -1
- package/dist/connectToComponent.d.ts +9 -0
- package/dist/connectToComponent.js +59 -0
- package/dist/connectToComponent.js.map +1 -0
- package/dist/css/FontFace.css +47 -17
- package/dist/css/SystemCSSVars.css +0 -8
- package/dist/custom-elements-internal.json +2863 -0
- package/dist/custom-elements.json +2593 -0
- package/dist/decorators/customElement.d.ts +1 -1
- package/dist/decorators/customElement.js +1 -1
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.d.ts +5 -2
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators.d.ts +5 -0
- package/dist/decorators.js +6 -0
- package/dist/decorators.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +9 -8
- package/dist/delegate/ItemNavigation.js +13 -14
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +4 -6
- package/dist/delegate/ResizeHandler.js +4 -6
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/delegate/ScrollEnablement.js +2 -2
- package/dist/delegate/ScrollEnablement.js.map +1 -1
- package/dist/features/OpenUI5Enablement.d.ts +1 -1
- package/dist/features/OpenUI5Support.d.ts +13 -3
- package/dist/features/OpenUI5Support.js +94 -33
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPopup.d.ts +10 -0
- package/dist/features/patchPopup.js +15 -0
- package/dist/features/patchPopup.js.map +1 -0
- package/dist/generated/AssetParameters.d.ts +6 -0
- package/dist/generated/AssetParameters.js +3 -10
- package/dist/generated/AssetParameters.js.map +1 -0
- package/dist/generated/VersionInfo.d.ts +10 -0
- package/dist/generated/VersionInfo.js +9 -8
- package/dist/generated/VersionInfo.js.map +1 -0
- package/dist/generated/css/FontFace.css.js +1 -1
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +1 -1
- package/dist/i18nBundle.d.ts +2 -4
- package/dist/i18nBundle.js +1 -4
- package/dist/i18nBundle.js.map +1 -1
- package/dist/locale/applyDirection.d.ts +3 -2
- package/dist/locale/applyDirection.js +3 -2
- package/dist/locale/applyDirection.js.map +1 -1
- package/dist/locale/getEffectiveDir.d.ts +1 -1
- package/dist/locale/getEffectiveDir.js +3 -19
- package/dist/locale/getEffectiveDir.js.map +1 -1
- package/dist/renderer/LitRenderer.d.ts +2 -2
- package/dist/renderer/directives/style-map.d.ts +13 -0
- package/dist/renderer/directives/style-map.js +59 -59
- package/dist/renderer/directives/style-map.js.map +1 -0
- package/dist/sap/base/Log.js +698 -188
- package/dist/sap/base/assert.js +28 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/security/URLListValidator.js +253 -6
- package/dist/sap/base/security/encodeCSS.js +34 -8
- package/dist/sap/base/security/encodeXML.js +47 -17
- package/dist/sap/base/security/sanitizeHTML.js +35 -13
- package/dist/sap/base/strings/toHex.js +27 -2
- package/dist/sap/base/util/now.js +24 -3
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +112 -97
- package/dist/ssr-dom-shim.d.ts +1 -0
- package/dist/ssr-dom-shim.js +12 -0
- package/dist/ssr-dom-shim.js.map +1 -0
- package/dist/ssr-dom.d.ts +0 -0
- package/dist/ssr-dom.js +3 -0
- package/dist/ssr-dom.js.map +1 -0
- package/dist/theming/applyTheme.js +5 -5
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/types/AnimationMode.d.ts +0 -8
- package/dist/types/AnimationMode.js +0 -8
- package/dist/types/AnimationMode.js.map +1 -1
- package/dist/types/CSSColor.d.ts +0 -4
- package/dist/types/CSSColor.js +0 -4
- package/dist/types/CSSColor.js.map +1 -1
- package/dist/types/CSSSize.d.ts +11 -0
- package/dist/types/CSSSize.js +14 -0
- package/dist/types/CSSSize.js.map +1 -0
- package/dist/types/CalendarType.d.ts +0 -9
- package/dist/types/CalendarType.js +0 -9
- package/dist/types/CalendarType.js.map +1 -1
- package/dist/types/DOMReference.d.ts +1 -5
- package/dist/types/DOMReference.js +1 -5
- package/dist/types/DOMReference.js.map +1 -1
- package/dist/types/DataType.d.ts +1 -6
- package/dist/types/DataType.js +1 -6
- package/dist/types/DataType.js.map +1 -1
- package/dist/types/Float.d.ts +0 -3
- package/dist/types/Float.js +0 -3
- package/dist/types/Float.js.map +1 -1
- package/dist/types/Integer.d.ts +0 -3
- package/dist/types/Integer.js +0 -3
- package/dist/types/Integer.js.map +1 -1
- package/dist/types/InvisibleMessageMode.d.ts +5 -10
- package/dist/types/InvisibleMessageMode.js +4 -11
- package/dist/types/InvisibleMessageMode.js.map +1 -1
- package/dist/types/ItemNavigationBehavior.d.ts +0 -6
- package/dist/types/ItemNavigationBehavior.js +0 -6
- package/dist/types/ItemNavigationBehavior.js.map +1 -1
- package/dist/types/MovePlacement.d.ts +20 -0
- package/dist/types/MovePlacement.js +22 -0
- package/dist/types/MovePlacement.js.map +1 -0
- package/dist/types/NavigationMode.d.ts +0 -8
- package/dist/types/NavigationMode.js +0 -8
- package/dist/types/NavigationMode.js.map +1 -1
- package/dist/types/Orientation.d.ts +16 -0
- package/dist/types/Orientation.js +18 -0
- package/dist/types/Orientation.js.map +1 -0
- package/dist/types/ValueState.d.ts +0 -14
- package/dist/types/ValueState.js +0 -14
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/ColorConversion.js +200 -195
- package/dist/util/ColorConversion.js.map +1 -1
- package/dist/util/InvisibleMessage.d.ts +1 -1
- package/dist/util/InvisibleMessage.js.map +1 -1
- package/dist/util/PopupUtils.js +1 -1
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/clamp.js +2 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/createLinkInHead.d.ts +1 -1
- package/dist/util/createLinkInHead.js +1 -1
- package/dist/util/createLinkInHead.js.map +1 -1
- package/dist/util/createStyleInHead.d.ts +1 -1
- package/dist/util/createStyleInHead.js +1 -1
- package/dist/util/createStyleInHead.js.map +1 -1
- package/dist/util/detectNavigatorLanguage.d.ts +2 -2
- package/dist/util/detectNavigatorLanguage.js +6 -1
- package/dist/util/detectNavigatorLanguage.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
- package/dist/util/dragAndDrop/DragRegistry.js +66 -0
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
- package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
- package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +54 -34
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
- package/dist/util/getDesigntimePropertyAsArray.js +2 -1
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
- package/dist/util/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/dist/util/isElementContainingBlock.d.ts +2 -0
- package/dist/util/isElementContainingBlock.js +11 -0
- package/dist/util/isElementContainingBlock.js.map +1 -0
- package/dist/vscode.html-custom-data.json +22 -0
- package/index.js +3 -5
- package/lib/generate-asset-parameters/index.js +2 -2
- package/lib/generate-version-info/index.js +2 -2
- package/package-scripts.cjs +14 -18
- package/package.json +14 -6
- package/src/css/FontFace.css +47 -17
- package/src/css/SystemCSSVars.css +0 -8
- package/tsconfig.json +6 -0
- package/used-modules.txt +4 -0
- package/dist/api.json +0 -1
- package/dist/assets/Boot.18e749cb.js +0 -9
- package/dist/assets/Boot.34b7cea0.css +0 -1
- package/dist/assets/bundle.esm.179dce7c.js +0 -50
- package/dist/assets-meta/IconCollectionsAlias.js.map +0 -1
- package/dist/config/RTL.d.ts +0 -7
- package/dist/config/RTL.js +0 -37
- package/dist/config/RTL.js.map +0 -1
- package/src/renderer/directives/style-map.js +0 -72
|
@@ -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
|
+
* **For exmaple:** 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
|
+
* **For exmaple:** 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 * **For exmaple:** 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"]}
|
|
@@ -5,4 +5,11 @@ import CalendarType from "../types/CalendarType.js";
|
|
|
5
5
|
* @returns { CalendarType } the effective calendar type
|
|
6
6
|
*/
|
|
7
7
|
declare const getCalendarType: () => CalendarType;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Returns the configured secondary calendar type.
|
|
10
|
+
* @public
|
|
11
|
+
* @returns { CalendarType | undefined } the effective calendar type
|
|
12
|
+
* @since 1.18.0
|
|
13
|
+
*/
|
|
14
|
+
declare const getSecondaryCalendarType: () => CalendarType | undefined;
|
|
15
|
+
export { getCalendarType, getSecondaryCalendarType, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import CalendarType from "../types/CalendarType.js";
|
|
2
|
-
import { getCalendarType as getConfiguredCalendarType } from "../InitialConfiguration.js";
|
|
2
|
+
import { getCalendarType as getConfiguredCalendarType, getSecondaryCalendarType as getConfiguredSecondaryCalendarType, } from "../InitialConfiguration.js";
|
|
3
3
|
let calendarType;
|
|
4
|
+
let secondaryCalendarType;
|
|
4
5
|
/**
|
|
5
6
|
* Returns the configured or default calendar type.
|
|
6
7
|
* @public
|
|
@@ -15,5 +16,20 @@ const getCalendarType = () => {
|
|
|
15
16
|
}
|
|
16
17
|
return CalendarType.Gregorian;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Returns the configured secondary calendar type.
|
|
21
|
+
* @public
|
|
22
|
+
* @returns { CalendarType | undefined } the effective calendar type
|
|
23
|
+
* @since 1.18.0
|
|
24
|
+
*/
|
|
25
|
+
const getSecondaryCalendarType = () => {
|
|
26
|
+
if (secondaryCalendarType === undefined) {
|
|
27
|
+
secondaryCalendarType = getConfiguredSecondaryCalendarType();
|
|
28
|
+
}
|
|
29
|
+
if (secondaryCalendarType && secondaryCalendarType in CalendarType) {
|
|
30
|
+
return secondaryCalendarType;
|
|
31
|
+
}
|
|
32
|
+
return secondaryCalendarType;
|
|
33
|
+
};
|
|
34
|
+
export { getCalendarType, getSecondaryCalendarType, };
|
|
19
35
|
//# sourceMappingURL=CalendarType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACN,eAAe,IAAI,yBAAyB,EAC5C,wBAAwB,IAAI,kCAAkC,GAC9D,MAAM,4BAA4B,CAAC;AAEpC,IAAI,YAAsC,CAAC;AAC3C,IAAI,qBAA+C,CAAC;AAEpD;;;;GAIG;AACH,MAAM,eAAe,GAAG,GAAiB,EAAE;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,yBAAyB,EAAE,CAAC;KAC3C;IAED,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE;QACjD,OAAO,YAAY,CAAC;KACpB;IAED,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,GAA6B,EAAE;IAC/D,IAAI,qBAAqB,KAAK,SAAS,EAAE;QACxC,qBAAqB,GAAG,kCAAkC,EAAE,CAAC;KAC7D;IAED,IAAI,qBAAqB,IAAI,qBAAqB,IAAI,YAAY,EAAE;QACnE,OAAO,qBAAqB,CAAC;KAC7B;IAED,OAAO,qBAAqB,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,wBAAwB,GACxB,CAAC","sourcesContent":["import CalendarType from \"../types/CalendarType.js\";\nimport {\n\tgetCalendarType as getConfiguredCalendarType,\n\tgetSecondaryCalendarType as getConfiguredSecondaryCalendarType,\n} from \"../InitialConfiguration.js\";\n\nlet calendarType: CalendarType | undefined;\nlet secondaryCalendarType: CalendarType | undefined;\n\n/**\n * Returns the configured or default calendar type.\n * @public\n * @returns { CalendarType } the effective calendar type\n */\nconst getCalendarType = (): CalendarType => {\n\tif (calendarType === undefined) {\n\t\tcalendarType = getConfiguredCalendarType();\n\t}\n\n\tif (calendarType && calendarType in CalendarType) {\n\t\treturn calendarType;\n\t}\n\n\treturn CalendarType.Gregorian;\n};\n\n/**\n * Returns the configured secondary calendar type.\n * @public\n * @returns { CalendarType | undefined } the effective calendar type\n * @since 1.18.0\n */\nconst getSecondaryCalendarType = (): CalendarType | undefined => {\n\tif (secondaryCalendarType === undefined) {\n\t\tsecondaryCalendarType = getConfiguredSecondaryCalendarType();\n\t}\n\n\tif (secondaryCalendarType && secondaryCalendarType in CalendarType) {\n\t\treturn secondaryCalendarType;\n\t}\n\n\treturn secondaryCalendarType;\n};\n\nexport {\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n};\n"]}
|
package/dist/config/Icons.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
type IconCollection =
|
|
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
|
-
}
|
|
1
|
+
type IconCollection = string;
|
|
10
2
|
/**
|
|
11
3
|
* Sets the default icon collection for a given theme.
|
|
12
4
|
*
|
|
@@ -14,22 +6,22 @@ declare enum RegisteredIconCollection {
|
|
|
14
6
|
* 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.
|
|
15
7
|
* This method allows setting another (built-in or custom) icon collection as default per theme.
|
|
16
8
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* **Usage**
|
|
10
|
+
* **For example**, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
|
|
19
11
|
*
|
|
20
|
-
*
|
|
12
|
+
* ```
|
|
21
13
|
* setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
|
|
22
14
|
*
|
|
23
15
|
* <ui5-icon name="home"></ui5-icon>
|
|
24
|
-
*
|
|
16
|
+
* ```
|
|
25
17
|
*
|
|
26
|
-
*
|
|
18
|
+
* **For example**, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
|
|
27
19
|
*
|
|
28
|
-
*
|
|
20
|
+
* ```
|
|
29
21
|
* setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
|
|
30
22
|
*
|
|
31
23
|
* <ui5-icon name="custom-icon-name"></ui5-icon>
|
|
32
|
-
*
|
|
24
|
+
* ```
|
|
33
25
|
*
|
|
34
26
|
* @public
|
|
35
27
|
* @param { string } theme
|
|
@@ -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
|
*
|
|
@@ -18,22 +6,22 @@ var RegisteredIconCollection;
|
|
|
18
6
|
* 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.
|
|
19
7
|
* This method allows setting another (built-in or custom) icon collection as default per theme.
|
|
20
8
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
9
|
+
* **Usage**
|
|
10
|
+
* **For example**, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
|
|
23
11
|
*
|
|
24
|
-
*
|
|
12
|
+
* ```
|
|
25
13
|
* setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
|
|
26
14
|
*
|
|
27
15
|
* <ui5-icon name="home"></ui5-icon>
|
|
28
|
-
*
|
|
16
|
+
* ```
|
|
29
17
|
*
|
|
30
|
-
*
|
|
18
|
+
* **For example**, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
|
|
31
19
|
*
|
|
32
|
-
*
|
|
20
|
+
* ```
|
|
33
21
|
* setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
|
|
34
22
|
*
|
|
35
23
|
* <ui5-icon name="custom-icon-name"></ui5-icon>
|
|
36
|
-
*
|
|
24
|
+
* ```
|
|
37
25
|
*
|
|
38
26
|
* @public
|
|
39
27
|
* @param { string } theme
|
|
@@ -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 = 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 * **Usage**\n * **For example**, to make \"SAP-icons version 5.x\" the default icon collection in \"sap_fiori_3\":\n *\n * ```\n * setDefaultIconCollection(\"sap_fiori_3\", \"SAP-icons-v5\");\n *\n * <ui5-icon name=\"home\"></ui5-icon>\n * ```\n *\n * **For example**, to make a custom icon collection (with name \"my-custom-collection\") the default icon collection in \"sap_fiori_3\":\n *\n * ```\n * setDefaultIconCollection(\"sap_fiori_3\", \"my-custom-collection\");\n *\n * <ui5-icon name=\"custom-icon-name\"></ui5-icon>\n * ```\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"]}
|
|
@@ -25,7 +25,7 @@ declare const getDefaultLanguage: () => string;
|
|
|
25
25
|
/**
|
|
26
26
|
* Defines if the default language, that is inlined, should be
|
|
27
27
|
* fetched over the network instead of using the inlined one.
|
|
28
|
-
*
|
|
28
|
+
* **Note:** By default the language will not be fetched.
|
|
29
29
|
*
|
|
30
30
|
* @public
|
|
31
31
|
* @param {boolean} fetchDefaultLang
|
package/dist/config/Language.js
CHANGED
|
@@ -2,6 +2,7 @@ import { getLanguage as getConfiguredLanguage, getFetchDefaultLanguage as getCon
|
|
|
2
2
|
import { fireLanguageChange } from "../locale/languageChange.js";
|
|
3
3
|
import { reRenderAllUI5Elements } from "../Render.js";
|
|
4
4
|
import { DEFAULT_LANGUAGE } from "../generated/AssetParameters.js";
|
|
5
|
+
import { isBooted } from "../Boot.js";
|
|
5
6
|
let curLanguage;
|
|
6
7
|
let fetchDefaultLanguage;
|
|
7
8
|
/**
|
|
@@ -28,8 +29,10 @@ const setLanguage = async (language) => {
|
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
curLanguage = language;
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
if (isBooted()) {
|
|
33
|
+
await fireLanguageChange(language);
|
|
34
|
+
await reRenderAllUI5Elements({ languageAware: true });
|
|
35
|
+
}
|
|
33
36
|
};
|
|
34
37
|
/**
|
|
35
38
|
* Returns the default languague.
|
|
@@ -45,7 +48,7 @@ const getDefaultLanguage = () => {
|
|
|
45
48
|
/**
|
|
46
49
|
* Defines if the default language, that is inlined, should be
|
|
47
50
|
* fetched over the network instead of using the inlined one.
|
|
48
|
-
*
|
|
51
|
+
* **Note:** By default the language will not be fetched.
|
|
49
52
|
*
|
|
50
53
|
* @public
|
|
51
54
|
* @param {boolean} fetchDefaultLang
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAI,WAA+B,CAAC;AACpC,IAAI,oBAA6B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,WAAW,KAAK,SAAS,EAAE;QAC9B,WAAW,GAAG,qBAAqB,EAAE,CAAC;KACtC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAC7D,IAAI,WAAW,KAAK,QAAQ,EAAE;QAC7B,OAAO;KACP;IAED,WAAW,GAAG,QAAQ,CAAC;IAEvB,IAAI,QAAQ,EAAE,EAAE;QACf,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;KACtD;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,CAAC,gBAAyB,EAAE,EAAE;IAC7D,oBAAoB,GAAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACvC,uBAAuB,CAAC,iCAAiC,EAAE,CAAC,CAAC;KAC7D;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,CAAC","sourcesContent":["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean;\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise<void>}\n */\nconst setLanguage = async (language: string): Promise<void> => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tif (isBooted()) {\n\t\tawait fireLanguageChange(language);\n\t\tawait reRenderAllUI5Elements({ languageAware: true });\n\t}\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * **Note:** By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tsetFetchDefaultLanguage(getConfiguredFetchDefaultLanguage());\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n};\n"]}
|
package/dist/config/Theme.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare const getDefaultTheme: () => string;
|
|
|
29
29
|
declare const isTheme: (theme: string) => boolean;
|
|
30
30
|
/**
|
|
31
31
|
* Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
|
|
32
|
-
*
|
|
32
|
+
* **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
|
|
33
33
|
*
|
|
34
34
|
* @private
|
|
35
35
|
* @returns { boolean }
|
package/dist/config/Theme.js
CHANGED
|
@@ -3,6 +3,7 @@ import { reRenderAllUI5Elements } from "../Render.js";
|
|
|
3
3
|
import applyTheme from "../theming/applyTheme.js";
|
|
4
4
|
import getThemeDesignerTheme from "../theming/getThemeDesignerTheme.js";
|
|
5
5
|
import { DEFAULT_THEME, SUPPORTED_THEMES } from "../generated/AssetParameters.js";
|
|
6
|
+
import { isBooted } from "../Boot.js";
|
|
6
7
|
let curTheme;
|
|
7
8
|
/**
|
|
8
9
|
* Returns the current theme.
|
|
@@ -26,9 +27,11 @@ const setTheme = async (theme) => {
|
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
curTheme = theme;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (isBooted()) {
|
|
31
|
+
// Update CSS Custom Properties
|
|
32
|
+
await applyTheme(curTheme);
|
|
33
|
+
await reRenderAllUI5Elements({ themeAware: true });
|
|
34
|
+
}
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* Returns the default theme.
|
|
@@ -53,7 +56,7 @@ const isTheme = (theme) => {
|
|
|
53
56
|
};
|
|
54
57
|
/**
|
|
55
58
|
* Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
|
|
56
|
-
*
|
|
59
|
+
* **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
|
|
57
60
|
*
|
|
58
61
|
* @private
|
|
59
62
|
* @returns { boolean }
|
package/dist/config/Theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAI,QAAgB,CAAC;AAErB;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC7B,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC3B,QAAQ,GAAG,kBAAkB,EAAE,CAAC;KAChC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IACvD,IAAI,QAAQ,KAAK,KAAK,EAAE;QACvB,OAAO;KACP;IAED,QAAQ,GAAG,KAAK,CAAC;IAEjB,IAAI,QAAQ,EAAE,EAAE;QACf,+BAA+B;QAC/B,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3B,MAAM,sBAAsB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;KACnD;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,GAAW,EAAE;IACpC,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;IACjC,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAChC,OAAO,YAAY,KAAK,KAAK,IAAI,YAAY,KAAK,GAAG,KAAK,MAAM,CAAC;AAClE,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAChC,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAEhC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;QAChC,OAAO,CAAC,qBAAqB,EAAE,EAAE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;KAC1E;IAED,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEzE,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,eAAe,GACf,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_belize\" or \"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tgetDefaultTheme,\n};\n"]}
|
|
@@ -10,12 +10,10 @@ declare const getThemeRoot: () => string | undefined;
|
|
|
10
10
|
* Sets theme root for the current theme.
|
|
11
11
|
* When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.
|
|
14
14
|
* The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* <b>Note:</b> Certain security restrictions will apply before fetching the theme assets.
|
|
16
|
+
* **Note:** Certain security restrictions will apply before fetching the theme assets.
|
|
19
17
|
* Absolute URLs to a different origin than the current page will result in using the current page as an origin.
|
|
20
18
|
* To allow specific origins, use <meta name="sap-allowedThemeOrigins" content="https://my-example-host.com/"> tag inside the <head> of the page.
|
|
21
19
|
*
|
package/dist/config/ThemeRoot.js
CHANGED
|
@@ -20,12 +20,10 @@ const getThemeRoot = () => {
|
|
|
20
20
|
* Sets theme root for the current theme.
|
|
21
21
|
* When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.
|
|
24
24
|
* The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* <b>Note:</b> Certain security restrictions will apply before fetching the theme assets.
|
|
26
|
+
* **Note:** Certain security restrictions will apply before fetching the theme assets.
|
|
29
27
|
* Absolute URLs to a different origin than the current page will result in using the current page as an origin.
|
|
30
28
|
* To allow specific origins, use <meta name="sap-allowedThemeOrigins" content="https://my-example-host.com/"> tag inside the <head> of the page.
|
|
31
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAI,aAAiC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,IAAI,aAAa,KAAK,SAAS,EAAE;QAChC,aAAa,GAAG,sBAAsB,EAAE,CAAC;KACzC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAI,aAAiC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,IAAI,aAAa,KAAK,SAAS,EAAE;QAChC,aAAa,GAAG,sBAAsB,EAAE,CAAC;KACzC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,YAAY,GAAG,CAAC,SAAiB,EAA6B,EAAE;IACrE,IAAI,aAAa,KAAK,SAAS,EAAE;QAChC,OAAO;KACP;IAED,aAAa,GAAG,SAAS,CAAC;IAE1B,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE;QAClC,OAAO,CAAC,IAAI,CAAC,OAAO,SAAS,0FAA0F,CAAC,CAAC,CAAC,sBAAsB;QAChJ,OAAO;KACP;IAED,OAAO,6BAA6B,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,OAAO,GAAG,YAAY,EAAG,gBAAgB,KAAK,oBAAoB,CAAC,CAAC,0CAA0C;AAC/G,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IAC5E,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,KAAK,IAAI,CAAC,CAAC;IAE/E,IAAI,IAAI,EAAE;QACT,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,MAAM,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,6BAA6B,GAC7B,CAAC","sourcesContent":["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\n\nlet currThemeRoot: string | undefined;\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n * To allow specific origins, use <meta name=\"sap-allowedThemeOrigins\" content=\"https://my-example-host.com/\"> tag inside the <head> of the page.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
declare const getTimezone: () => string | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* Sets the IANA timezone ID.
|
|
10
|
-
*
|
|
10
|
+
* **For example:** "America/New_York", "Europe/London", "Australia/Sydney", "Asia/Bishkek", etc.
|
|
11
11
|
*>
|
|
12
12
|
* @param {string} timezone
|
|
13
13
|
* @private
|
package/dist/config/Timezone.js
CHANGED
|
@@ -14,7 +14,7 @@ const getTimezone = () => {
|
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Sets the IANA timezone ID.
|
|
17
|
-
*
|
|
17
|
+
* **For example:** "America/New_York", "Europe/London", "Australia/Sydney", "Asia/Bishkek", etc.
|
|
18
18
|
*>
|
|
19
19
|
* @param {string} timezone
|
|
20
20
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timezone.js","sourceRoot":"","sources":["../../src/config/Timezone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAElF,IAAI,YAAgC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,qBAAqB,EAAE,CAAC;KACvC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,IAAI,YAAY,KAAK,QAAQ,EAAE;QAC9B,OAAO;KACP;IAED,YAAY,GAAG,QAAQ,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,GACX,CAAC","sourcesContent":["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\n\nlet currTimezone: string | undefined;\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n *
|
|
1
|
+
{"version":3,"file":"Timezone.js","sourceRoot":"","sources":["../../src/config/Timezone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAElF,IAAI,YAAgC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,qBAAqB,EAAE,CAAC;KACvC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,IAAI,YAAY,KAAK,QAAQ,EAAE;QAC9B,OAAO;KACP;IAED,YAAY,GAAG,QAAQ,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,GACX,CAAC","sourcesContent":["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\n\nlet currTimezone: string | undefined;\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n * **For example:** \"America/New_York\", \"Europe/London\", \"Australia/Sydney\", \"Asia/Bishkek\", etc.\n *>\n * @param {string} timezone\n * @private\n * @returns { Promise<void> }\n */\nconst setTimezone = (timezone: string) => {\n\tif (currTimezone === timezone) {\n\t\treturn;\n\t}\n\n\tcurrTimezone = timezone;\n};\n\nexport {\n\tgetTimezone,\n\tsetTimezone,\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type UI5Element from "./UI5Element.js";
|
|
2
|
+
type ConnectOptions = {
|
|
3
|
+
host: UI5Element;
|
|
4
|
+
propName: string;
|
|
5
|
+
onConnect?: (friend: HTMLElement) => void;
|
|
6
|
+
onDisconnect?: (friend: HTMLElement) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const connectToComponent: (options: ConnectOptions) => HTMLElement | undefined;
|
|
9
|
+
export default connectToComponent;
|