@ui5/webcomponents-base 1.2.1 → 1.2.4
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 +38 -0
- package/dist/asset-registries/Icons.js +2 -2
- package/dist/asset-registries/LocaleData.js +6 -1
- package/dist/config/Theme.js +11 -0
- package/dist/css/FontFace.css +30 -0
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/css/FontFace.css.js +1 -1
- package/dist/renderer/executeTemplate.js +18 -1
- package/dist/resources/bundle.esm.js +8 -8
- package/dist/resources/bundle.esm.js.map +1 -1
- package/hash.txt +1 -1
- package/package.json +3 -3
- package/src/asset-registries/Icons.js +2 -2
- package/src/asset-registries/LocaleData.js +6 -1
- package/src/config/Theme.js +11 -0
- package/src/css/FontFace.css +30 -0
- package/src/renderer/executeTemplate.js +18 -1
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
g/Qs2ySyAS17EF43TarO3rDow/Q=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
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.94.0",
|
|
40
|
-
"@ui5/webcomponents-tools": "1.2.
|
|
41
|
-
"chromedriver": "
|
|
40
|
+
"@ui5/webcomponents-tools": "1.2.4",
|
|
41
|
+
"chromedriver": "99.0.0",
|
|
42
42
|
"clean-css": "^5.2.2",
|
|
43
43
|
"copy-and-watch": "^0.1.5",
|
|
44
44
|
"eslint": "^7.22.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import getSharedResource from "../getSharedResource.js";
|
|
2
2
|
import IconCollectionsAlias from "../assets-meta/IconCollectionsAlias.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isThemeFamily } from "../config/Theme.js";
|
|
4
4
|
|
|
5
5
|
const loaders = new Map();
|
|
6
6
|
const registry = getSharedResource("SVGIcons.registry", new Map());
|
|
@@ -118,7 +118,7 @@ const _getRegisteredNames = async () => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const _getDefaultCollection = () => {
|
|
121
|
-
return
|
|
121
|
+
return isThemeFamily("sap_horizon") ? "SAP-icons-v5" : "SAP-icons";
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
const _normalizeCollection = collectionName => {
|
|
@@ -13,7 +13,6 @@ const M_ISO639_OLD_TO_NEW = {
|
|
|
13
13
|
"iw": "he",
|
|
14
14
|
"ji": "yi",
|
|
15
15
|
"in": "id",
|
|
16
|
-
"sh": "sr",
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
const DEV_MODE = false;
|
|
@@ -48,6 +47,12 @@ const calcLocale = (language, region, script) => {
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
// Special case 3: for Serbian, there are cyrillic and latin scripts, "sh" and "sr-latn" map to "latin", "sr" maps to cyrillic.
|
|
51
|
+
if (language === "sh" || (language === "sr" && script === "Latn")) {
|
|
52
|
+
language = "sr";
|
|
53
|
+
region = "Latn";
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
// try language + region
|
|
52
57
|
let localeId = `${language}_${region}`;
|
|
53
58
|
if (SUPPORTED_LOCALES.includes(localeId)) {
|
package/src/config/Theme.js
CHANGED
|
@@ -35,8 +35,19 @@ const isTheme = _theme => {
|
|
|
35
35
|
return currentTheme === _theme || currentTheme === `${_theme}_exp`;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Returns if the current theme is part of given theme family
|
|
40
|
+
* @private
|
|
41
|
+
* @param {String} the theme family
|
|
42
|
+
* @returns {boolean}
|
|
43
|
+
*/
|
|
44
|
+
const isThemeFamily = _theme => {
|
|
45
|
+
return getTheme().startsWith(_theme);
|
|
46
|
+
};
|
|
47
|
+
|
|
38
48
|
export {
|
|
39
49
|
getTheme,
|
|
40
50
|
setTheme,
|
|
41
51
|
isTheme,
|
|
52
|
+
isThemeFamily,
|
|
42
53
|
};
|
package/src/css/FontFace.css
CHANGED
|
@@ -35,6 +35,36 @@
|
|
|
35
35
|
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: '72-Bold';
|
|
40
|
+
font-style: normal;
|
|
41
|
+
src: local('72-Bold'),
|
|
42
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),
|
|
43
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff?ui5-webcomponents) format("woff");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@font-face {
|
|
47
|
+
font-family: '72-Boldfull';
|
|
48
|
+
font-style: normal;
|
|
49
|
+
src: url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2"),
|
|
50
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@font-face {
|
|
54
|
+
font-family: '72-Light';
|
|
55
|
+
font-style: normal;
|
|
56
|
+
src: local('72-Light'),
|
|
57
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2"),
|
|
58
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff?ui5-webcomponents) format("woff");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@font-face {
|
|
62
|
+
font-family: '72-Lightfull';
|
|
63
|
+
font-style: normal;
|
|
64
|
+
src: url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2"),
|
|
65
|
+
url(https://ui5.sap.com/sdk/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff?ui5-webcomponents) format("woff");
|
|
66
|
+
}
|
|
67
|
+
|
|
38
68
|
@font-face {
|
|
39
69
|
font-family: "72Black";
|
|
40
70
|
font-style: bold;
|
|
@@ -9,9 +9,26 @@ import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from "../Cus
|
|
|
9
9
|
* @returns {*}
|
|
10
10
|
*/
|
|
11
11
|
const executeTemplate = (template, component) => {
|
|
12
|
-
const tagsToScope = component
|
|
12
|
+
const tagsToScope = getTagsToScope(component);
|
|
13
13
|
const scope = getCustomElementsScopingSuffix();
|
|
14
14
|
return template(component, tagsToScope, scope);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Returns all tags, used inside component's template subject to scoping.
|
|
19
|
+
* @param component - the component
|
|
20
|
+
* @returns {Array[]}
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
const getTagsToScope = component => {
|
|
24
|
+
const componentTag = component.constructor.getMetadata().getPureTag();
|
|
25
|
+
const tagsToScope = component.constructor.getUniqueDependencies().map(dep => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);
|
|
26
|
+
|
|
27
|
+
if (shouldScopeCustomElement(componentTag)) {
|
|
28
|
+
tagsToScope.push(componentTag);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return tagsToScope;
|
|
32
|
+
};
|
|
33
|
+
|
|
17
34
|
export default executeTemplate;
|