@ui5/webcomponents-base 1.16.0 → 1.17.0-rc.1
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 +22 -0
- package/dist/CustomElementsScope.d.ts +2 -2
- 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/ManagedStyles.js +7 -13
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/StaticAreaItem.js +0 -3
- package/dist/StaticAreaItem.js.map +1 -1
- package/dist/UI5Element.js +0 -3
- package/dist/UI5Element.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -0
- package/dist/asset-registries/Illustrations.js +58 -19
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/assets/Boot.ef37314a.js +9 -0
- package/dist/assets/bundle.esm.d676f7fd.js +50 -0
- package/dist/assets/test/pages/{Boot.html.139d18a3.js → Boot.html.8e474f27.js} +1 -1
- package/dist/assets/test/pages/{i18n.html.9cb89d0c.js → i18n.html.f0fddfa3.js} +1 -1
- package/dist/assets/test/pages/{i18n_texts.html.20728054.js → i18n_texts.html.06c858e4.js} +1 -1
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/VersionInfo.js +4 -4
- 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/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/package.json +3 -3
- package/dist/assets/Boot.d50b4c00.js +0 -9
- package/dist/assets/bundle.esm.d83f5ad4.js +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.17.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.0...v1.17.0-rc.1) (2023-08-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **framework:** scope css variables per runtime and version ([#7449](https://github.com/SAP/ui5-webcomponents/issues/7449)) ([d3f6c2e](https://github.com/SAP/ui5-webcomponents/commit/d3f6c2efba9cfda389ea4d700a375f75b3e2996b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.17.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0...v1.17.0-rc.0) (2023-08-10)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **ui5-illustrated-message:** support collection based illustration loading ([#7318](https://github.com/SAP/ui5-webcomponents/issues/7318)) ([6b52dbd](https://github.com/SAP/ui5-webcomponents/commit/6b52dbd157a3c8198e41c84157e3d9ae89e3386e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [1.16.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.4...v1.16.0) (2023-08-03)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @ui5/webcomponents-base
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag } from "./CustomElementsScopeUtils.js";
|
|
1
|
+
import { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName } from "./CustomElementsScopeUtils.js";
|
|
2
2
|
declare class LitStatic {
|
|
3
3
|
static html: (strings: TemplateStringsArray, ...values: unknown[]) => import("lit-html").TemplateResult<1 | 2>;
|
|
4
4
|
static svg: (strings: TemplateStringsArray, ...values: unknown[]) => import("lit-html").TemplateResult<1 | 2>;
|
|
5
5
|
static unsafeStatic: (value: string) => object;
|
|
6
6
|
}
|
|
7
|
-
export { LitStatic, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, };
|
|
7
|
+
export { LitStatic, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html, svg, unsafeStatic, } from "lit-html/static.js";
|
|
2
|
-
import { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, } from "./CustomElementsScopeUtils.js";
|
|
2
|
+
import { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName, } from "./CustomElementsScopeUtils.js";
|
|
3
3
|
import { registerFeature } from "./FeaturesRegistry.js";
|
|
4
4
|
class LitStatic {
|
|
5
5
|
}
|
|
@@ -7,5 +7,5 @@ LitStatic.html = html;
|
|
|
7
7
|
LitStatic.svg = svg;
|
|
8
8
|
LitStatic.unsafeStatic = unsafeStatic;
|
|
9
9
|
registerFeature("LitStatic", LitStatic);
|
|
10
|
-
export { LitStatic, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, };
|
|
10
|
+
export { LitStatic, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName, };
|
|
11
11
|
//# sourceMappingURL=CustomElementsScope.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementsScope.js","sourceRoot":"","sources":["../src/CustomElementsScope.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,IAAI,EACJ,GAAG,EACH,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,
|
|
1
|
+
{"version":3,"file":"CustomElementsScope.js","sourceRoot":"","sources":["../src/CustomElementsScope.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,IAAI,EACJ,GAAG,EACH,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,SAAS;;AACP,cAAI,GAAG,IAAI,CAAC;AACZ,aAAG,GAAG,GAAG,CAAC;AACV,sBAAY,GAA8B,YAAY,CAAC;AAG/D,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAExC,OAAO,EACN,SAAS,EACT,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,CAAC","sourcesContent":["import {\n\thtml,\n\tsvg,\n\tunsafeStatic,\n} from \"lit-html/static.js\";\n\nimport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n} from \"./CustomElementsScopeUtils.js\";\nimport { registerFeature } from \"./FeaturesRegistry.js\";\n\nclass LitStatic {\n\tstatic html = html;\n\tstatic svg = svg;\n\tstatic unsafeStatic: (value: string) => object = unsafeStatic;\n}\n\nregisterFeature(\"LitStatic\", LitStatic);\n\nexport {\n\tLitStatic,\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n};\n"]}
|
|
@@ -52,4 +52,11 @@ declare const shouldScopeCustomElement: (tag: string) => boolean | undefined;
|
|
|
52
52
|
* @returns {String}
|
|
53
53
|
*/
|
|
54
54
|
declare const getEffectiveScopingSuffixForTag: (tag: string) => string | undefined;
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @public
|
|
57
|
+
* Used for getting a scoped name for a CSS variable using the same transformation used in the build
|
|
58
|
+
* @name the name of the css variable as written in the code
|
|
59
|
+
* @returns a variable name with the current version inserted as available at runtime
|
|
60
|
+
*/
|
|
61
|
+
declare const getScopedVarName: (name: string) => string;
|
|
62
|
+
export { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import VersionInfo from "./generated/VersionInfo.js";
|
|
1
2
|
let suf;
|
|
2
3
|
let rulesObj = {
|
|
3
4
|
include: [/^ui5-/],
|
|
@@ -86,5 +87,16 @@ const getEffectiveScopingSuffixForTag = (tag) => {
|
|
|
86
87
|
return getCustomElementsScopingSuffix();
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
|
|
90
|
+
/**
|
|
91
|
+
* @public
|
|
92
|
+
* Used for getting a scoped name for a CSS variable using the same transformation used in the build
|
|
93
|
+
* @name the name of the css variable as written in the code
|
|
94
|
+
* @returns a variable name with the current version inserted as available at runtime
|
|
95
|
+
*/
|
|
96
|
+
const getScopedVarName = (name) => {
|
|
97
|
+
const versionStr = `v${VersionInfo.version.replaceAll(".", "-")}`;
|
|
98
|
+
const expr = /(--_?ui5)([^,:)\s]+)/g;
|
|
99
|
+
return name.replaceAll(expr, `$1-${versionStr}$2`);
|
|
100
|
+
};
|
|
101
|
+
export { setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, shouldScopeCustomElement, getEffectiveScopingSuffixForTag, getScopedVarName, };
|
|
90
102
|
//# sourceMappingURL=CustomElementsScopeUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementsScopeUtils.js","sourceRoot":"","sources":["../src/CustomElementsScopeUtils.ts"],"names":[],"mappings":"AAAA,IAAI,GAAW,CAAC;AAOhB,IAAI,QAAQ,GAAU;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAC,CAAC,uFAAuF;AAErI;;;;;;GAMG;AACH,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAE,EAAE;IACzD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;KAC1F;IAED,GAAG,GAAG,MAAM,CAAC;AACd,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,GAAG,EAAE;IAC3C,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,6BAA6B,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CAAC,CAAC;QACjH,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;KAC3B;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,+BAA+B,GAAG,CAAC,GAAW,EAAE,EAAE;IACvD,IAAI,wBAAwB,CAAC,GAAG,CAAC,EAAE;QAClC,OAAO,8BAA8B,EAAE,CAAC;KACxC;AACF,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAClE,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,UAAU,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,CAAC","sourcesContent":["import VersionInfo from \"./generated/VersionInfo.js\";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [/^ui5-/],\n\texclude: [],\n};\n\nconst tagsCache = new Map<string, boolean>(); // true/false means the tag should/should not be cached, undefined means not known yet.\n\n/**\n * Sets the suffix to be used for custom elements scoping, f.e. pass \"demo\" to get tags such as \"ui5-button-demo\".\n * Note: by default all tags starting with \"ui5-\" will be scoped, unless you change this by calling \"setCustomElementsScopingRules\"\n *\n * @public\n * @param suffix The scoping suffix\n */\nconst setCustomElementsScopingSuffix = (suffix: string) => {\n\tif (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {\n\t\tthrow new Error(\"Only alphanumeric characters and dashes allowed for the scoping suffix\");\n\t}\n\n\tsuf = suffix;\n};\n\n/**\n * Returns the currently set scoping suffix, or undefined if not set.\n *\n * @public\n * @returns {String|undefined}\n */\nconst getCustomElementsScopingSuffix = () => {\n\treturn suf;\n};\n\n/**\n * Sets the rules, governing which custom element tags to scope and which not, f.e.\n * setCustomElementsScopingRules({include: [/^ui5-/]}, exclude: [/^ui5-mylib-/, /^ui5-carousel$/]);\n * will scope all elements starting with \"ui5-\" but not the ones starting with \"ui5-mylib-\" and not \"ui5-carousel\".\n *\n * @public\n * @param rules Object with \"include\" and \"exclude\" properties, both arrays of regular expressions. Note that \"include\"\n * rules are applied first and \"exclude\" rules second.\n */\nconst setCustomElementsScopingRules = (rules: Rules) => {\n\tif (!rules || !rules.include) {\n\t\tthrow new Error(`\"rules\" must be an object with at least an \"include\" property`);\n\t}\n\n\tif (!Array.isArray(rules.include) || rules.include.some(rule => !(rule instanceof RegExp))) {\n\t\tthrow new Error(`\"rules.include\" must be an array of regular expressions`);\n\t}\n\n\tif (rules.exclude && (!Array.isArray(rules.exclude) || rules.exclude.some(rule => !(rule instanceof RegExp)))) {\n\t\tthrow new Error(`\"rules.exclude\" must be an array of regular expressions`);\n\t}\n\n\trules.exclude = rules.exclude || [];\n\trulesObj = rules;\n\ttagsCache.clear(); // reset the cache upon setting new rules\n};\n\n/**\n * Returns the rules, governing which custom element tags to scope and which not. By default, all elements\n * starting with \"ui5-\" are scoped. The default rules are: {include: [/^ui5-/]}.\n *\n * @public\n * @returns {Object}\n */\nconst getCustomElementsScopingRules = () => {\n\treturn rulesObj;\n};\n\n/**\n * Determines whether custom elements with the given tag should be scoped or not.\n * The tag is first matched against the \"include\" rules and then against the \"exclude\" rules and the\n * result is cached until new rules are set.\n *\n * @public\n * @param tag\n */\nconst shouldScopeCustomElement = (tag: string) => {\n\tif (!tagsCache.has(tag)) {\n\t\tconst result = rulesObj.include.some(rule => tag.match(rule)) && !rulesObj.exclude.some(rule => tag.match(rule));\n\t\ttagsCache.set(tag, result);\n\t}\n\n\treturn tagsCache.get(tag);\n};\n\n/**\n * Returns the currently set scoping suffix, if any and if the tag should be scoped, or undefined otherwise.\n *\n * @public\n * @param tag\n * @returns {String}\n */\nconst getEffectiveScopingSuffixForTag = (tag: string) => {\n\tif (shouldScopeCustomElement(tag)) {\n\t\treturn getCustomElementsScopingSuffix();\n\t}\n};\n\n/**\n * @public\n * Used for getting a scoped name for a CSS variable using the same transformation used in the build\n * @name the name of the css variable as written in the code\n * @returns a variable name with the current version inserted as available at runtime\n */\nconst getScopedVarName = (name: string) => {\n\tconst versionStr = `v${VersionInfo.version.replaceAll(\".\", \"-\")}`;\n\tconst expr = /(--_?ui5)([^,:)\\s]+)/g;\n\treturn name.replaceAll(expr, `$1-${versionStr}$2`);\n};\n\nexport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n};\n"]}
|
package/dist/ManagedStyles.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import createStyleInHead from "./util/createStyleInHead.js";
|
|
2
2
|
import createLinkInHead from "./util/createLinkInHead.js";
|
|
3
3
|
import { shouldUseLinks, getUrl } from "./CSP.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isSafari } from "./Device.js";
|
|
5
5
|
const getStyleId = (name, value) => {
|
|
6
6
|
return value ? `${name}|${value}` : name;
|
|
7
7
|
};
|
|
8
8
|
const createStyle = (data, name, value = "") => {
|
|
9
|
-
|
|
10
|
-
if (content.includes("[_ui5host]")) {
|
|
11
|
-
content = content.replaceAll("[_ui5host]", `[_ui5rt${getCurrentRuntimeIndex()}]`);
|
|
12
|
-
}
|
|
9
|
+
const content = typeof data === "string" ? data : data.content;
|
|
13
10
|
if (shouldUseLinks()) {
|
|
14
11
|
const attributes = {};
|
|
15
12
|
attributes[name] = value;
|
|
16
13
|
const href = getUrl(data.packageName, data.fileName);
|
|
17
14
|
createLinkInHead(href, attributes);
|
|
18
15
|
}
|
|
19
|
-
else if (document.adoptedStyleSheets) {
|
|
16
|
+
else if (document.adoptedStyleSheets && !isSafari()) {
|
|
20
17
|
const stylesheet = new CSSStyleSheet();
|
|
21
18
|
stylesheet.replaceSync(content);
|
|
22
19
|
stylesheet._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later
|
|
@@ -29,15 +26,12 @@ const createStyle = (data, name, value = "") => {
|
|
|
29
26
|
}
|
|
30
27
|
};
|
|
31
28
|
const updateStyle = (data, name, value = "") => {
|
|
32
|
-
|
|
33
|
-
if (content.includes("[_ui5host]")) {
|
|
34
|
-
content = content.replaceAll("[_ui5host]", `[_ui5rt${getCurrentRuntimeIndex()}]`);
|
|
35
|
-
}
|
|
29
|
+
const content = typeof data === "string" ? data : data.content;
|
|
36
30
|
if (shouldUseLinks()) {
|
|
37
31
|
const link = document.querySelector(`head>link[${name}="${value}"]`);
|
|
38
32
|
link.href = getUrl(data.packageName, data.fileName);
|
|
39
33
|
}
|
|
40
|
-
else if (document.adoptedStyleSheets) {
|
|
34
|
+
else if (document.adoptedStyleSheets && !isSafari()) {
|
|
41
35
|
const stylesheet = document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
|
|
42
36
|
if (stylesheet) {
|
|
43
37
|
stylesheet.replaceSync(content || "");
|
|
@@ -54,7 +48,7 @@ const hasStyle = (name, value = "") => {
|
|
|
54
48
|
if (shouldUseLinks()) {
|
|
55
49
|
return !!document.querySelector(`head>link[${name}="${value}"]`);
|
|
56
50
|
}
|
|
57
|
-
if (document.adoptedStyleSheets) {
|
|
51
|
+
if (document.adoptedStyleSheets && !isSafari()) {
|
|
58
52
|
return !!document.adoptedStyleSheets.find(sh => sh._ui5StyleId === getStyleId(name, value));
|
|
59
53
|
}
|
|
60
54
|
return !!document.querySelector(`head>style[${name}="${value}"]`);
|
|
@@ -64,7 +58,7 @@ const removeStyle = (name, value = "") => {
|
|
|
64
58
|
const linkElement = document.querySelector(`head>link[${name}="${value}"]`);
|
|
65
59
|
linkElement?.parentElement?.removeChild(linkElement);
|
|
66
60
|
}
|
|
67
|
-
else if (document.adoptedStyleSheets) {
|
|
61
|
+
else if (document.adoptedStyleSheets && !isSafari()) {
|
|
68
62
|
document.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => sh._ui5StyleId !== getStyleId(name, value));
|
|
69
63
|
}
|
|
70
64
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedStyles.js","sourceRoot":"","sources":["../src/ManagedStyles.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ManagedStyles.js","sourceRoot":"","sources":["../src/ManagedStyles.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAe,EAAE,IAAY,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IACjE,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAA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AK,IAAI,CAAC,CAAC;QAC5E,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACrD;SAAM,IAAI,QAAQ,CAAC,kBAAkB,IAAI,CAAC,QAAQ,EAAE,EAAE;QACtD,QAAQ,CAAC,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAE,EAA0B,CAAC,WAAW,KAAK,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KAC5I;SAAM;QACN,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC;QAChF,YAAY,EAAE,aAAa,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;KACvD;AACF,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,IAAe,EAAE,IAAY,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IACzE,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;QAC1B,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;KAC/B;SAAM;QACN,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;KAC/B;AACF,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,mBAAmB,GACnB,CAAC","sourcesContent":["import createStyleInHead from \"./util/createStyleInHead.js\";\nimport createLinkInHead from \"./util/createLinkInHead.js\";\nimport { shouldUseLinks, getUrl } from \"./CSP.js\";\nimport { StyleData, StyleDataCSP } from \"./types.js\";\nimport { isSafari } from \"./Device.js\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst createStyle = (data: StyleData, name: string, value = \"\") => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\n\tif (shouldUseLinks()) {\n\t\tconst attributes = {} as Record<string, any>;\n\t\tattributes[name] = value;\n\t\tconst href = getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName);\n\t\tcreateLinkInHead(href, attributes);\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tconst stylesheet = new CSSStyleSheet();\n\t\tstylesheet.replaceSync(content);\n\t\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\t\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n\t} else {\n\t\tconst attributes = {} as Record<string, any>;\n\t\tattributes[name] = value;\n\t\tcreateStyleInHead(content, attributes);\n\t}\n};\n\nconst updateStyle = (data: StyleData, name: string, value = \"\") => {\n\tconst content = typeof data === \"string\" ? data : data.content;\n\n\tif (shouldUseLinks()) {\n\t\tconst link = document.querySelector(`head>link[${name}=\"${value}\"]`) as HTMLLinkElement;\n\t\tlink.href = getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName);\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\t\tif (stylesheet) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t}\n\t} else {\n\t\tconst style = document.querySelector(`head>style[${name}=\"${value}\"]`);\n\t\tif (style) {\n\t\t\tstyle.textContent = content || \"\";\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\") => {\n\tif (shouldUseLinks()) {\n\t\treturn !!document.querySelector(`head>link[${name}=\"${value}\"]`);\n\t}\n\n\tif (document.adoptedStyleSheets && !isSafari()) {\n\t\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\t}\n\n\treturn !!document.querySelector(`head>style[${name}=\"${value}\"]`);\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tif (shouldUseLinks()) {\n\t\tconst linkElement = document.querySelector(`head>link[${name}=\"${value}\"]`);\n\t\tlinkElement?.parentElement?.removeChild(linkElement);\n\t} else if (document.adoptedStyleSheets && !isSafari()) {\n\t\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n\t} else {\n\t\tconst styleElement = document.querySelector(`head > style[${name}=\"${value}\"]`);\n\t\tstyleElement?.parentElement?.removeChild(styleElement);\n\t}\n};\n\nconst createOrUpdateStyle = (data: StyleData, name: string, value = \"\") => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(data, name, value);\n\t} else {\n\t\tcreateStyle(data, name, value);\n\t}\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n};\n\nexport type {\n\tStyleData,\n\tStyleDataCSP,\n};\n"]}
|
package/dist/StaticAreaItem.js
CHANGED
|
@@ -4,7 +4,6 @@ import { renderFinished } from "./Render.js";
|
|
|
4
4
|
import getEffectiveContentDensity from "./util/getEffectiveContentDensity.js";
|
|
5
5
|
import { getEffectiveScopingSuffixForTag } from "./CustomElementsScopeUtils.js";
|
|
6
6
|
import getEffectiveDir from "./locale/getEffectiveDir.js";
|
|
7
|
-
import { getCurrentRuntimeIndex } from "./Runtimes.js";
|
|
8
7
|
const pureTagName = "ui5-static-area-item";
|
|
9
8
|
const popupIntegrationAttr = "data-sap-ui-integration-popup-content";
|
|
10
9
|
/**
|
|
@@ -69,8 +68,6 @@ class StaticAreaItem extends HTMLElement {
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
_updateAdditionalAttrs() {
|
|
72
|
-
this.setAttribute(`_ui5rt${getCurrentRuntimeIndex()}`, "");
|
|
73
|
-
this.setAttribute("_ui5host", "");
|
|
74
71
|
this.setAttribute(pureTagName, "");
|
|
75
72
|
this.setAttribute(popupIntegrationAttr, "");
|
|
76
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticAreaItem.js","sourceRoot":"","sources":["../src/StaticAreaItem.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,eAAe,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"StaticAreaItem.js","sourceRoot":"","sources":["../src/StaticAreaItem.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAG1D,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,cAAe,SAAQ,WAAW;IAIvC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,YAAwB;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,4CAA4C;QACvF,IAAI,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,wBAAwB,CAAC,EAAE;YAC7D,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,CA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SAAS;QACd,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,gBAAgB,CAAC,IAAI,CAAC,YAAa,EAAE,IAAI,CAAC,CAAC;SAC3C;QACD,MAAM,cAAc,EAAE,CAAC,CAAC,kEAAkE;QAC1F,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,MAAM;QACZ,MAAM,MAAM,GAAG,+BAA+B,CAAC,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,EAAE;YACZ,OAAO,WAAW,CAAC;SACnB;QAED,OAAO,GAAG,WAAW,IAAI,MAAM,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,cAAc;QACpB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE;YACjD,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC;SAC/D;QAED,OAAO,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAmB,CAAC;IAChE,CAAC;CACD;AAED,eAAe,cAAc,CAAC","sourcesContent":["import \"./StaticArea.js\";\nimport updateShadowRoot from \"./updateShadowRoot.js\";\nimport { renderFinished } from \"./Render.js\";\nimport getEffectiveContentDensity from \"./util/getEffectiveContentDensity.js\";\nimport { getEffectiveScopingSuffixForTag } from \"./CustomElementsScopeUtils.js\";\nimport getEffectiveDir from \"./locale/getEffectiveDir.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\nconst pureTagName = \"ui5-static-area-item\";\nconst popupIntegrationAttr = \"data-sap-ui-integration-popup-content\";\n\n/**\n *\n * @class\n * @author SAP SE\n * @private\n */\nclass StaticAreaItem extends HTMLElement {\n\t_rendered: boolean;\n\townerElement?: UI5Element;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._rendered = false;\n\t\tthis.attachShadow({ mode: \"open\" });\n\t}\n\n\t/**\n\t * @param {UI5Element} ownerElement the UI5Element instance that owns this static area item\n\t */\n\tsetOwnerElement(ownerElement: UI5Element) {\n\t\tthis.ownerElement = ownerElement;\n\t\tthis.classList.add(this.ownerElement._id); // used for getting the popover in the tests\n\t\tif (this.ownerElement.hasAttribute(\"data-ui5-static-stable\")) {\n\t\t\tthis.setAttribute(\"data-ui5-stable\", this.ownerElement.getAttribute(\"data-ui5-static-stable\")!); // stable selector\n\t\t}\n\t}\n\n\t/**\n\t * Updates the shadow root of the static area item with the latest state, if rendered\n\t */\n\tupdate() {\n\t\tif (this._rendered) {\n\t\t\tthis.updateAdditionalProperties();\n\t\t\tupdateShadowRoot(this.ownerElement!, true);\n\t\t}\n\t}\n\n\tupdateAdditionalProperties() {\n\t\tthis._updateAdditionalAttrs();\n\t\tthis._updateContentDensity();\n\t\tthis._updateDirection();\n\t}\n\n\t/**\n\t * Sets the correct content density based on the owner element's state\n\t * @private\n\t */\n\t_updateContentDensity() {\n\t\tif (getEffectiveContentDensity(this.ownerElement!) === \"compact\") {\n\t\t\tthis.classList.add(\"sapUiSizeCompact\");\n\t\t\tthis.classList.add(\"ui5-content-density-compact\");\n\t\t} else {\n\t\t\tthis.classList.remove(\"sapUiSizeCompact\");\n\t\t\tthis.classList.remove(\"ui5-content-density-compact\");\n\t\t}\n\t}\n\n\t_updateDirection() {\n\t\tif (this.ownerElement) {\n\t\t\tconst dir = getEffectiveDir(this.ownerElement);\n\t\t\tif (dir) {\n\t\t\t\tthis.setAttribute(\"dir\", dir);\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute(\"dir\");\n\t\t\t}\n\t\t}\n\t}\n\n\t_updateAdditionalAttrs() {\n\t\tthis.setAttribute(pureTagName, \"\");\n\t\tthis.setAttribute(popupIntegrationAttr, \"\");\n\t}\n\n\t/**\n\t * @protected\n\t * Returns reference to the DOM element where the current fragment is added.\n\t */\n\tasync getDomRef() {\n\t\tthis.updateAdditionalProperties();\n\t\tif (!this._rendered) {\n\t\t\tthis._rendered = true;\n\t\t\tupdateShadowRoot(this.ownerElement!, true);\n\t\t}\n\t\tawait renderFinished(); // Wait for the content of the ui5-static-area-item to be rendered\n\t\treturn this.shadowRoot;\n\t}\n\n\tstatic getTag() {\n\t\tconst suffix = getEffectiveScopingSuffixForTag(pureTagName);\n\t\tif (!suffix) {\n\t\t\treturn pureTagName;\n\t\t}\n\n\t\treturn `${pureTagName}-${suffix}`;\n\t}\n\n\tstatic createInstance() {\n\t\tif (!customElements.get(StaticAreaItem.getTag())) {\n\t\t\tcustomElements.define(StaticAreaItem.getTag(), StaticAreaItem);\n\t\t}\n\n\t\treturn document.createElement(this.getTag()) as StaticAreaItem;\n\t}\n}\n\nexport default StaticAreaItem;\n"]}
|
package/dist/UI5Element.js
CHANGED
|
@@ -18,7 +18,6 @@ import arraysAreEqual from "./util/arraysAreEqual.js";
|
|
|
18
18
|
import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
|
|
19
19
|
import preloadLinks from "./theming/preloadLinks.js";
|
|
20
20
|
import executeTemplate from "./renderer/executeTemplate.js";
|
|
21
|
-
import { getCurrentRuntimeIndex } from "./Runtimes.js";
|
|
22
21
|
let autoId = 0;
|
|
23
22
|
const elementTimeouts = new Map();
|
|
24
23
|
const uniqueDependenciesCache = new Map();
|
|
@@ -98,8 +97,6 @@ class UI5Element extends HTMLElement {
|
|
|
98
97
|
*/
|
|
99
98
|
async connectedCallback() {
|
|
100
99
|
const ctor = this.constructor;
|
|
101
|
-
this.setAttribute(`_ui5rt${getCurrentRuntimeIndex()}`, "");
|
|
102
|
-
this.setAttribute("_ui5host", "");
|
|
103
100
|
this.setAttribute(ctor.getMetadata().getPureTag(), "");
|
|
104
101
|
if (ctor.getMetadata().supportsF6FastNavigation()) {
|
|
105
102
|
this.setAttribute("data-sap-ui-fastnavgroup", "true");
|