@ui5/webcomponents-base 1.24.0 → 2.0.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/.eslintignore +0 -1
- package/CHANGELOG.md +279 -0
- package/README.md +0 -8
- package/bundle.esm.js +0 -1
- package/config/wdio.conf.cjs +0 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/Device.d.ts +1 -2
- package/dist/Device.js +5 -12
- package/dist/Device.js.map +1 -1
- package/dist/ManagedStyles.js +21 -99
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/UI5Element.d.ts +5 -26
- package/dist/UI5Element.js +24 -54
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +2 -0
- package/dist/UI5ElementMetadata.js +3 -0
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/custom-elements-internal.json +0 -76
- package/dist/custom-elements.json +0 -76
- package/dist/decorators/customElement.d.ts +1 -2
- package/dist/decorators/customElement.js +6 -4
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +0 -2
- package/dist/features/OpenUI5Support.js +2 -23
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/VersionInfo.js +5 -5
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/renderer/LitRenderer.js +2 -8
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/theming/getConstructableStyle.d.ts +1 -1
- package/dist/theming/getConstructableStyle.js +3 -3
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveStyle.d.ts +1 -1
- package/dist/theming/getEffectiveStyle.js +5 -12
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/updateShadowRoot.d.ts +1 -2
- package/dist/updateShadowRoot.js +5 -29
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -3
- package/dist/util/PopupUtils.js +1 -15
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +1 -1
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +1 -8
- package/index.js +0 -14
- package/package-scripts.cjs +1 -1
- package/package.json +3 -3
- package/dist/CSP.d.ts +0 -33
- package/dist/CSP.js +0 -54
- package/dist/CSP.js.map +0 -1
- package/dist/StaticAreaItem.d.ts +0 -35
- package/dist/StaticAreaItem.js +0 -100
- package/dist/StaticAreaItem.js.map +0 -1
- package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
- package/dist/theming/getEffectiveLinksHrefs.js +0 -17
- package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
- package/dist/theming/preloadLinks.d.ts +0 -3
- package/dist/theming/preloadLinks.js +0 -19
- package/dist/theming/preloadLinks.js.map +0 -1
- package/dist/util/createStyleInHead.d.ts +0 -8
- package/dist/util/createStyleInHead.js +0 -18
- package/dist/util/createStyleInHead.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"AAEA,IAAI,cAAc,GAAuB,IAAI,CAAC;AAC9C,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAc,CAAC;AAC1C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,CAAY,EAAE,EAAE;IACpC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE;QAC1D,OAAO;KACP;IAED,CAAC,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC;IACnC,CAAC,CAAC,YAAY,CAAC,aAAa,GAAG,MAAM,CAAC;IAEtC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,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E,CAAC;KACvB;AACF,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC9C,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAE/B,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,sBAAsB,EAAE;QACrD,oBAAoB,EAAE,CAAC;KACvB;AACF,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAC7D,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,iBAAiB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAChE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG;IACpB,SAAS;IACT,WAAW;IACX,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type UI5Element from \"../../UI5Element\";\n\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\te.dataTransfer.dropEffect = \"move\";\n\te.dataTransfer.effectAllowed = \"move\";\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\n};\n\nconst DragRegistry = {\n\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n};\n\nexport default DragRegistry;\nexport type {\n\tSetDraggedElementFunction,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"DragRegistry.js","sourceRoot":"","sources":["../../../src/util/dragAndDrop/DragRegistry.ts"],"names":[],"mappings":"AAEA,IAAI,cAAc,GAAuB,IAAI,CAAC;AAC9C,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAc,CAAC;AAC1C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,CAAY,EAAE,EAAE;IACpC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,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,GAAG,KAAK,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC5C,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAE5B,IAAI,CAAC,sBAAsB,EAAE;QAC5B,oBAAoB,EAAE,CAAC;KACvB;AACF,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC9C,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAE/B,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,sBAAsB,EAAE;QACrD,oBAAoB,EAAE,CAAC;KACvB;AACF,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAC7D,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,iBAAiB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,IAA8B,EAAE,EAAE;IAChE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG;IACpB,SAAS;IACT,WAAW;IACX,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type UI5Element from \"../../UI5Element.js\";\n\nlet draggedElement: HTMLElement | null = null;\nlet globalHandlersAttached = false;\nconst subscribers = new Set<UI5Element>();\nconst selfManagedDragAreas = new Set<HTMLElement | ShadowRoot>();\n\nconst ondragstart = (e: DragEvent) => {\n\tif (!e.dataTransfer || !(e.target instanceof HTMLElement)) {\n\t\treturn;\n\t}\n\n\te.dataTransfer.dropEffect = \"move\";\n\te.dataTransfer.effectAllowed = \"move\";\n\n\tif (!selfManagedDragAreas.has(e.target)) {\n\t\tdraggedElement = e.target;\n\t}\n};\n\nconst ondragend = () => {\n\tdraggedElement = null;\n};\n\nconst ondrop = () => {\n\tdraggedElement = null;\n};\n\nconst setDraggedElement = (element: HTMLElement | null) => {\n\tdraggedElement = element;\n};\ntype SetDraggedElementFunction = typeof setDraggedElement;\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst attachGlobalHandlers = () => {\n\tif (globalHandlersAttached) {\n\t\treturn;\n\t}\n\n\tdocument.body.addEventListener(\"dragstart\", ondragstart);\n\tdocument.body.addEventListener(\"dragend\", ondragend);\n\tdocument.body.addEventListener(\"drop\", ondrop);\n};\n\nconst detachGlobalHandlers = () => {\n\tdocument.body.removeEventListener(\"dragstart\", ondragstart);\n\tdocument.body.removeEventListener(\"dragend\", ondragend);\n\tdocument.body.removeEventListener(\"drop\", ondrop);\n\tglobalHandlersAttached = false;\n};\n\nconst subscribe = (subscriber: UI5Element) => {\n\tsubscribers.add(subscriber);\n\n\tif (!globalHandlersAttached) {\n\t\tattachGlobalHandlers();\n\t}\n};\n\nconst unsubscribe = (subscriber: UI5Element) => {\n\tsubscribers.delete(subscriber);\n\n\tif (subscribers.size === 0 && globalHandlersAttached) {\n\t\tdetachGlobalHandlers();\n\t}\n};\n\nconst addSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.add(area);\n\n\treturn setDraggedElement;\n};\n\nconst removeSelfManagedArea = (area: HTMLElement | ShadowRoot) => {\n\tselfManagedDragAreas.delete(area);\n};\n\nconst DragRegistry = {\n\tsubscribe,\n\tunsubscribe,\n\taddSelfManagedArea,\n\tremoveSelfManagedArea,\n\tgetDraggedElement,\n};\n\nexport default DragRegistry;\nexport type {\n\tSetDraggedElementFunction,\n};\n"]}
|
|
@@ -20,10 +20,8 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
20
20
|
_doNotSyncAttributes: Set<string>;
|
|
21
21
|
_state: import("../UI5ElementMetadata.js").State;
|
|
22
22
|
_getRealDomRef?: (() => HTMLElement) | undefined;
|
|
23
|
-
staticAreaItem?: import("../StaticAreaItem.js").default | undefined;
|
|
24
23
|
readonly _id: string;
|
|
25
24
|
render(): object;
|
|
26
|
-
renderStatic(): object;
|
|
27
25
|
connectedCallback(): Promise<void>;
|
|
28
26
|
disconnectedCallback(): void;
|
|
29
27
|
onBeforeRendering(): void;
|
|
@@ -72,7 +70,6 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
72
70
|
readonly isUI5Element: boolean;
|
|
73
71
|
readonly classes: import("../types.js").ClassMap;
|
|
74
72
|
readonly accessibilityInfo: import("../types.js").AccessibilityInfo;
|
|
75
|
-
getStaticAreaItemDomRef(): Promise<ShadowRoot | null>;
|
|
76
73
|
accessKey: string;
|
|
77
74
|
readonly accessKeyLabel: string;
|
|
78
75
|
autocapitalize: string;
|
|
@@ -399,17 +396,13 @@ declare const getClassCopy: (klass: typeof UI5Element, constructorCallback: () =
|
|
|
399
396
|
blur(): void;
|
|
400
397
|
};
|
|
401
398
|
template?: import("../renderer/executeTemplate.js").TemplateFunction | undefined;
|
|
402
|
-
staticAreaTemplate?: import("../renderer/executeTemplate.js").TemplateFunction | undefined;
|
|
403
399
|
_metadata: import("../UI5ElementMetadata.js").default;
|
|
404
|
-
|
|
405
|
-
renderer?: import("../UI5Element.js").Renderer | undefined;
|
|
400
|
+
renderer: import("../UI5Element.js").Renderer;
|
|
406
401
|
readonly observedAttributes: string[];
|
|
407
402
|
_needsShadowDOM(): boolean;
|
|
408
|
-
_needsStaticArea(): boolean;
|
|
409
403
|
_generateAccessors(): void;
|
|
410
404
|
metadata: import("../UI5ElementMetadata.js").Metadata;
|
|
411
405
|
styles: import("../types.js").ComponentStylesData;
|
|
412
|
-
readonly staticAreaStyles: import("../types.js").ComponentStylesData;
|
|
413
406
|
readonly dependencies: (typeof UI5Element)[];
|
|
414
407
|
getUniqueDependencies(this: typeof UI5Element): (typeof UI5Element)[];
|
|
415
408
|
whenDependenciesDefined(): Promise<(typeof UI5Element)[]>;
|
package/index.js
CHANGED
|
@@ -56,13 +56,6 @@ import { registerIconLoader } from "./dist/asset-registries/Icons.js";
|
|
|
56
56
|
// Boot.ts
|
|
57
57
|
import { attachBoot } from "./dist/Boot.js";
|
|
58
58
|
|
|
59
|
-
// CSP.ts
|
|
60
|
-
import {
|
|
61
|
-
setPackageCSSRoot,
|
|
62
|
-
setUseLinks,
|
|
63
|
-
setPreloadLinks,
|
|
64
|
-
} from "./dist/CSP.js";
|
|
65
|
-
|
|
66
59
|
// CustomElementsScope.ts
|
|
67
60
|
import {
|
|
68
61
|
setCustomElementsScopingSuffix,
|
|
@@ -75,7 +68,6 @@ import {
|
|
|
75
68
|
// Device.ts
|
|
76
69
|
import {
|
|
77
70
|
supportsTouch,
|
|
78
|
-
isIE,
|
|
79
71
|
isSafari,
|
|
80
72
|
isChrome,
|
|
81
73
|
isFirefox,
|
|
@@ -173,11 +165,6 @@ export {
|
|
|
173
165
|
// Boot.ts
|
|
174
166
|
attachBoot,
|
|
175
167
|
|
|
176
|
-
// CSP.ts
|
|
177
|
-
setPackageCSSRoot,
|
|
178
|
-
setUseLinks,
|
|
179
|
-
setPreloadLinks,
|
|
180
|
-
|
|
181
168
|
// CustomElementsScope.ts
|
|
182
169
|
setCustomElementsScopingSuffix,
|
|
183
170
|
getCustomElementsScopingSuffix,
|
|
@@ -187,7 +174,6 @@ export {
|
|
|
187
174
|
|
|
188
175
|
// Device.ts
|
|
189
176
|
supportsTouch,
|
|
190
|
-
isIE,
|
|
191
177
|
isSafari,
|
|
192
178
|
isChrome,
|
|
193
179
|
isFirefox,
|
package/package-scripts.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const LIB = path.join(__dirname, `../tools/lib/`);
|
|
|
13
13
|
const viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
|
14
14
|
|
|
15
15
|
const scripts = {
|
|
16
|
-
clean: "rimraf
|
|
16
|
+
clean: "rimraf src/generated && rimraf dist && rimraf .port",
|
|
17
17
|
lint: `eslint .`,
|
|
18
18
|
generate: "cross-env UI5_TS=true nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates",
|
|
19
19
|
prepare: "cross-env UI5_TS=true nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates typescript integrate.no-remaining-require",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@openui5/sap.ui.core": "1.120.5",
|
|
48
|
-
"@ui5/webcomponents-tools": "
|
|
48
|
+
"@ui5/webcomponents-tools": "2.0.0-rc.1",
|
|
49
49
|
"chromedriver": "^122.0.6",
|
|
50
50
|
"clean-css": "^5.2.2",
|
|
51
51
|
"copy-and-watch": "^0.1.5",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"replace-in-file": "^6.3.5",
|
|
56
56
|
"resolve": "^1.20.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "4594e9aa13dbb152e422c93126412c654357f43f"
|
|
59
59
|
}
|
package/dist/CSP.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use this function to provide the path to the directory where the css resources for the given package will be served from.
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
* @param packageName name of the package that is being configured
|
|
6
|
-
* @param root path, accessible by the server that will serve the css resources
|
|
7
|
-
*/
|
|
8
|
-
declare const setPackageCSSRoot: (packageName: string, root: string) => void;
|
|
9
|
-
declare const getUrl: (packageName: string, path: string) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Call this function to enable or disable the usage of `<link>` tags instead of `<style>` tags to achieve CSP compliance
|
|
12
|
-
*
|
|
13
|
-
* Example: "setUseLinks(true)" will unconditionally use `<link>` tags for all browsers.
|
|
14
|
-
*
|
|
15
|
-
* Example: "setUseLinks(!document.adoptedStyleSheets) will only enable the usage of `<link>` tags for browsers that do not support constructable stylesheets.
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
* @param use whether links will be used
|
|
19
|
-
*/
|
|
20
|
-
declare const setUseLinks: (use: boolean) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Call this function to enable or disable the preloading of `<link>` tags.
|
|
23
|
-
*
|
|
24
|
-
* **Note:** only taken into account when `<link>` tags are being used.
|
|
25
|
-
* **Note:** links are being preloaded by default, so call "setPreloadLinks(false)" to opt out of this.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
* @param preload
|
|
29
|
-
*/
|
|
30
|
-
declare const setPreloadLinks: (preload: boolean) => void;
|
|
31
|
-
declare const shouldUseLinks: () => boolean;
|
|
32
|
-
declare const shouldPreloadLinks: () => boolean;
|
|
33
|
-
export { setPackageCSSRoot, getUrl, setUseLinks, setPreloadLinks, shouldUseLinks, shouldPreloadLinks, };
|
package/dist/CSP.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const roots = new Map();
|
|
2
|
-
let useLinks = false;
|
|
3
|
-
let preloadLinks = true;
|
|
4
|
-
/**
|
|
5
|
-
* Use this function to provide the path to the directory where the css resources for the given package will be served from.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
* @param packageName name of the package that is being configured
|
|
9
|
-
* @param root path, accessible by the server that will serve the css resources
|
|
10
|
-
*/
|
|
11
|
-
const setPackageCSSRoot = (packageName, root) => {
|
|
12
|
-
roots.set(packageName, root);
|
|
13
|
-
};
|
|
14
|
-
const getUrl = (packageName, path) => {
|
|
15
|
-
const packageCSSRoot = roots.get(packageName);
|
|
16
|
-
if (!packageCSSRoot) {
|
|
17
|
-
console.warn(`Root path to the CSS resources ${packageName} not provided - use "setPackageCSSRoot" to provide the root.`); // eslint-disable-line
|
|
18
|
-
return "";
|
|
19
|
-
}
|
|
20
|
-
return `${packageCSSRoot}${path}`;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Call this function to enable or disable the usage of `<link>` tags instead of `<style>` tags to achieve CSP compliance
|
|
24
|
-
*
|
|
25
|
-
* Example: "setUseLinks(true)" will unconditionally use `<link>` tags for all browsers.
|
|
26
|
-
*
|
|
27
|
-
* Example: "setUseLinks(!document.adoptedStyleSheets) will only enable the usage of `<link>` tags for browsers that do not support constructable stylesheets.
|
|
28
|
-
*
|
|
29
|
-
* @public
|
|
30
|
-
* @param use whether links will be used
|
|
31
|
-
*/
|
|
32
|
-
const setUseLinks = (use) => {
|
|
33
|
-
useLinks = use;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Call this function to enable or disable the preloading of `<link>` tags.
|
|
37
|
-
*
|
|
38
|
-
* **Note:** only taken into account when `<link>` tags are being used.
|
|
39
|
-
* **Note:** links are being preloaded by default, so call "setPreloadLinks(false)" to opt out of this.
|
|
40
|
-
*
|
|
41
|
-
* @public
|
|
42
|
-
* @param preload
|
|
43
|
-
*/
|
|
44
|
-
const setPreloadLinks = (preload) => {
|
|
45
|
-
preloadLinks = preload;
|
|
46
|
-
};
|
|
47
|
-
const shouldUseLinks = () => {
|
|
48
|
-
return useLinks;
|
|
49
|
-
};
|
|
50
|
-
const shouldPreloadLinks = () => {
|
|
51
|
-
return preloadLinks;
|
|
52
|
-
};
|
|
53
|
-
export { setPackageCSSRoot, getUrl, setUseLinks, setPreloadLinks, shouldUseLinks, shouldPreloadLinks, };
|
|
54
|
-
//# sourceMappingURL=CSP.js.map
|
package/dist/CSP.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CSP.js","sourceRoot":"","sources":["../src/CSP.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AACxC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,YAAY,GAAG,IAAI,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAAE,IAAY,EAAE,EAAE;IAC/D,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,WAAmB,EAAE,IAAY,EAAE,EAAE;IACpD,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE9C,IAAI,CAAC,cAAc,EAAE;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,WAAW,8DAA8D,CAAC,CAAC,CAAC,sBAAsB;QACjJ,OAAO,EAAE,CAAC;KACV;IAED,OAAO,GAAG,cAAc,GAAG,IAAI,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAG,CAAC,GAAY,EAAE,EAAE;IACpC,QAAQ,GAAG,GAAG,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5C,YAAY,GAAG,OAAO,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IAC3B,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC/B,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF,OAAO,EACN,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,eAAe,EACf,cAAc,EACd,kBAAkB,GAClB,CAAC","sourcesContent":["const roots = new Map<string, string>();\nlet useLinks = false;\nlet preloadLinks = true;\n\n/**\n * Use this function to provide the path to the directory where the css resources for the given package will be served from.\n *\n * @public\n * @param packageName name of the package that is being configured\n * @param root path, accessible by the server that will serve the css resources\n */\nconst setPackageCSSRoot = (packageName: string, root: string) => {\n\troots.set(packageName, root);\n};\n\nconst getUrl = (packageName: string, path: string) => {\n\tconst packageCSSRoot = roots.get(packageName);\n\n\tif (!packageCSSRoot) {\n\t\tconsole.warn(`Root path to the CSS resources ${packageName} not provided - use \"setPackageCSSRoot\" to provide the root.`); // eslint-disable-line\n\t\treturn \"\";\n\t}\n\n\treturn `${packageCSSRoot}${path}`;\n};\n\n/**\n * Call this function to enable or disable the usage of `<link>` tags instead of `<style>` tags to achieve CSP compliance\n *\n * Example: \"setUseLinks(true)\" will unconditionally use `<link>` tags for all browsers.\n *\n * Example: \"setUseLinks(!document.adoptedStyleSheets) will only enable the usage of `<link>` tags for browsers that do not support constructable stylesheets.\n *\n * @public\n * @param use whether links will be used\n */\nconst setUseLinks = (use: boolean) => {\n\tuseLinks = use;\n};\n\n/**\n * Call this function to enable or disable the preloading of `<link>` tags.\n *\n * **Note:** only taken into account when `<link>` tags are being used.\n * **Note:** links are being preloaded by default, so call \"setPreloadLinks(false)\" to opt out of this.\n *\n * @public\n * @param preload\n */\nconst setPreloadLinks = (preload: boolean) => {\n\tpreloadLinks = preload;\n};\n\nconst shouldUseLinks = () => {\n\treturn useLinks;\n};\n\nconst shouldPreloadLinks = () => {\n\treturn preloadLinks;\n};\n\nexport {\n\tsetPackageCSSRoot,\n\tgetUrl,\n\tsetUseLinks,\n\tsetPreloadLinks,\n\tshouldUseLinks,\n\tshouldPreloadLinks,\n};\n"]}
|
package/dist/StaticAreaItem.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import "./StaticArea.js";
|
|
2
|
-
import type UI5Element from "./UI5Element.js";
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* @private
|
|
6
|
-
*/
|
|
7
|
-
declare class StaticAreaItem extends HTMLElement {
|
|
8
|
-
_rendered: boolean;
|
|
9
|
-
ownerElement?: UI5Element;
|
|
10
|
-
constructor();
|
|
11
|
-
/**
|
|
12
|
-
* @param ownerElement the UI5Element instance that owns this static area item
|
|
13
|
-
*/
|
|
14
|
-
setOwnerElement(ownerElement: UI5Element): void;
|
|
15
|
-
/**
|
|
16
|
-
* Updates the shadow root of the static area item with the latest state, if rendered
|
|
17
|
-
*/
|
|
18
|
-
update(): void;
|
|
19
|
-
updateAdditionalProperties(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Sets the correct content density based on the owner element's state
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
_updateContentDensity(): void;
|
|
25
|
-
_updateDirection(): void;
|
|
26
|
-
_updateAdditionalAttrs(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Returns reference to the DOM element where the current fragment is added.
|
|
29
|
-
* @protected
|
|
30
|
-
*/
|
|
31
|
-
getDomRef(): Promise<ShadowRoot | null>;
|
|
32
|
-
static getTag(): string;
|
|
33
|
-
static createInstance(): StaticAreaItem;
|
|
34
|
-
}
|
|
35
|
-
export default StaticAreaItem;
|
package/dist/StaticAreaItem.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import "./StaticArea.js";
|
|
2
|
-
import updateShadowRoot from "./updateShadowRoot.js";
|
|
3
|
-
import { renderFinished } from "./Render.js";
|
|
4
|
-
import getEffectiveContentDensity from "./util/getEffectiveContentDensity.js";
|
|
5
|
-
import { getEffectiveScopingSuffixForTag } from "./CustomElementsScopeUtils.js";
|
|
6
|
-
import getEffectiveDir from "./locale/getEffectiveDir.js";
|
|
7
|
-
const pureTagName = "ui5-static-area-item";
|
|
8
|
-
const popupIntegrationAttr = "data-sap-ui-integration-popup-content";
|
|
9
|
-
/**
|
|
10
|
-
* @class
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
class StaticAreaItem extends HTMLElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
this._rendered = false;
|
|
17
|
-
this.attachShadow({ mode: "open" });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @param ownerElement the UI5Element instance that owns this static area item
|
|
21
|
-
*/
|
|
22
|
-
setOwnerElement(ownerElement) {
|
|
23
|
-
this.ownerElement = ownerElement;
|
|
24
|
-
this.classList.add(this.ownerElement._id); // used for getting the popover in the tests
|
|
25
|
-
if (this.ownerElement.hasAttribute("data-ui5-static-stable")) {
|
|
26
|
-
this.setAttribute("data-ui5-stable", this.ownerElement.getAttribute("data-ui5-static-stable")); // stable selector
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Updates the shadow root of the static area item with the latest state, if rendered
|
|
31
|
-
*/
|
|
32
|
-
update() {
|
|
33
|
-
if (this._rendered) {
|
|
34
|
-
this.updateAdditionalProperties();
|
|
35
|
-
updateShadowRoot(this.ownerElement, true);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
updateAdditionalProperties() {
|
|
39
|
-
this._updateAdditionalAttrs();
|
|
40
|
-
this._updateContentDensity();
|
|
41
|
-
this._updateDirection();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Sets the correct content density based on the owner element's state
|
|
45
|
-
* @private
|
|
46
|
-
*/
|
|
47
|
-
_updateContentDensity() {
|
|
48
|
-
if (getEffectiveContentDensity(this.ownerElement) === "compact") {
|
|
49
|
-
this.classList.add("sapUiSizeCompact");
|
|
50
|
-
this.classList.add("ui5-content-density-compact");
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.classList.remove("sapUiSizeCompact");
|
|
54
|
-
this.classList.remove("ui5-content-density-compact");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
_updateDirection() {
|
|
58
|
-
if (this.ownerElement) {
|
|
59
|
-
const dir = getEffectiveDir(this.ownerElement);
|
|
60
|
-
if (dir === "rtl") {
|
|
61
|
-
this.setAttribute("dir", dir);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.removeAttribute("dir");
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_updateAdditionalAttrs() {
|
|
69
|
-
this.setAttribute(pureTagName, "");
|
|
70
|
-
this.setAttribute(popupIntegrationAttr, "");
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns reference to the DOM element where the current fragment is added.
|
|
74
|
-
* @protected
|
|
75
|
-
*/
|
|
76
|
-
async getDomRef() {
|
|
77
|
-
this.updateAdditionalProperties();
|
|
78
|
-
if (!this._rendered) {
|
|
79
|
-
this._rendered = true;
|
|
80
|
-
updateShadowRoot(this.ownerElement, true);
|
|
81
|
-
}
|
|
82
|
-
await renderFinished(); // Wait for the content of the ui5-static-area-item to be rendered
|
|
83
|
-
return this.shadowRoot;
|
|
84
|
-
}
|
|
85
|
-
static getTag() {
|
|
86
|
-
const suffix = getEffectiveScopingSuffixForTag(pureTagName);
|
|
87
|
-
if (!suffix) {
|
|
88
|
-
return pureTagName;
|
|
89
|
-
}
|
|
90
|
-
return `${pureTagName}-${suffix}`;
|
|
91
|
-
}
|
|
92
|
-
static createInstance() {
|
|
93
|
-
if (!customElements.get(StaticAreaItem.getTag())) {
|
|
94
|
-
customElements.define(StaticAreaItem.getTag(), StaticAreaItem);
|
|
95
|
-
}
|
|
96
|
-
return document.createElement(this.getTag());
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
export default StaticAreaItem;
|
|
100
|
-
//# sourceMappingURL=StaticAreaItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,GAA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E,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 * @class\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 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 === \"rtl\") {\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 * Returns reference to the DOM element where the current fragment is added.\n\t * @protected\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"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getUrl } from "../CSP.js";
|
|
2
|
-
import { getFeature } from "../FeaturesRegistry.js";
|
|
3
|
-
const MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers
|
|
4
|
-
const getEffectiveLinksHrefs = (ElementClass, forStaticArea = false) => {
|
|
5
|
-
const stylesData = ElementClass[forStaticArea ? "staticAreaStyles" : "styles"];
|
|
6
|
-
if (!stylesData) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const stylesDataArray = Array.isArray(stylesData) ? stylesData : [stylesData];
|
|
10
|
-
const openUI5Enablement = getFeature("OpenUI5Enablement");
|
|
11
|
-
if (openUI5Enablement) {
|
|
12
|
-
stylesDataArray.push(openUI5Enablement.getBusyIndicatorStyles());
|
|
13
|
-
}
|
|
14
|
-
return stylesDataArray.flat(MAX_DEPTH_INHERITED_CLASSES).filter(data => !!data).map(data => getUrl(data.packageName, data.fileName));
|
|
15
|
-
};
|
|
16
|
-
export default getEffectiveLinksHrefs;
|
|
17
|
-
//# sourceMappingURL=getEffectiveLinksHrefs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getEffectiveLinksHrefs.js","sourceRoot":"","sources":["../../src/theming/getEffectiveLinksHrefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD,MAAM,2BAA2B,GAAG,EAAE,CAAC,CAAC,sDAAsD;AAE9F,MAAM,sBAAsB,GAAG,CAAC,YAA+B,EAAE,aAAa,GAAG,KAAK,EAAE,EAAE;IACzF,MAAM,UAAU,GAAwB,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEpG,IAAI,CAAC,UAAU,EAAE;QAChB,OAAO;KACP;IAED,MAAM,eAAe,GAAwB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAEnG,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;IACpF,IAAI,iBAAiB,EAAE;QACtB,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,CAAC;KACjE;IAED,OAAO,eAAe,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAE,IAAqB,CAAC,WAAW,EAAG,IAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1K,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { getUrl } from \"../CSP.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport type OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\nimport type { ComponentStylesData, StyleDataCSP } from \"../types.js\";\n\nconst MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers\n\nconst getEffectiveLinksHrefs = (ElementClass: typeof UI5Element, forStaticArea = false) => {\n\tconst stylesData: ComponentStylesData = ElementClass[forStaticArea ? \"staticAreaStyles\" : \"styles\"];\n\n\tif (!stylesData) {\n\t\treturn;\n\t}\n\n\tconst stylesDataArray: ComponentStylesData = Array.isArray(stylesData) ? stylesData : [stylesData];\n\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\tif (openUI5Enablement) {\n\t\tstylesDataArray.push(openUI5Enablement.getBusyIndicatorStyles());\n\t}\n\n\treturn stylesDataArray.flat(MAX_DEPTH_INHERITED_CLASSES).filter(data => !!data).map(data => getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName));\n};\n\nexport default getEffectiveLinksHrefs;\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import getEffectiveLinksHrefs from "./getEffectiveLinksHrefs.js";
|
|
2
|
-
import createLinkInHead from "../util/createLinkInHead.js";
|
|
3
|
-
import { shouldUseLinks, shouldPreloadLinks } from "../CSP.js";
|
|
4
|
-
const preloaded = new Set();
|
|
5
|
-
const preloadLinks = (ElementClass) => {
|
|
6
|
-
if (!shouldUseLinks() || !shouldPreloadLinks()) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const linksHrefs = getEffectiveLinksHrefs(ElementClass, false) || [];
|
|
10
|
-
const staticAreaLinksHrefs = getEffectiveLinksHrefs(ElementClass, true) || [];
|
|
11
|
-
[...linksHrefs, ...staticAreaLinksHrefs].forEach(href => {
|
|
12
|
-
if (!preloaded.has(href)) {
|
|
13
|
-
createLinkInHead(href, { rel: "preload", as: "style" });
|
|
14
|
-
preloaded.add(href);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export default preloadLinks;
|
|
19
|
-
//# sourceMappingURL=preloadLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preloadLinks.js","sourceRoot":"","sources":["../../src/theming/preloadLinks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;AAEpC,MAAM,YAAY,GAAG,CAAC,YAA+B,EAAE,EAAE;IACxD,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE,EAAE;QAC/C,OAAO;KACP;IAED,MAAM,UAAU,GAAG,sBAAsB,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACrE,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAE9E,CAAC,GAAG,UAAU,EAAE,GAAG,oBAAoB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACzB,gBAAgB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YACxD,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACpB;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import getEffectiveLinksHrefs from \"./getEffectiveLinksHrefs.js\";\nimport createLinkInHead from \"../util/createLinkInHead.js\";\nimport { shouldUseLinks, shouldPreloadLinks } from \"../CSP.js\";\nimport type UI5Element from \"../UI5Element.js\";\n\nconst preloaded = new Set<string>();\n\nconst preloadLinks = (ElementClass: typeof UI5Element) => {\n\tif (!shouldUseLinks() || !shouldPreloadLinks()) {\n\t\treturn;\n\t}\n\n\tconst linksHrefs = getEffectiveLinksHrefs(ElementClass, false) || [];\n\tconst staticAreaLinksHrefs = getEffectiveLinksHrefs(ElementClass, true) || [];\n\n\t[...linksHrefs, ...staticAreaLinksHrefs].forEach(href => {\n\t\tif (!preloaded.has(href)) {\n\t\t\tcreateLinkInHead(href, { rel: \"preload\", as: \"style\" });\n\t\t\tpreloaded.add(href);\n\t\t}\n\t});\n};\n\nexport default preloadLinks;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a `<style>` tag in the `<head>` tag
|
|
3
|
-
* @param cssText - the CSS
|
|
4
|
-
* @param attributes - optional attributes to add to the tag
|
|
5
|
-
* @returns {HTMLElement}
|
|
6
|
-
*/
|
|
7
|
-
declare const createStyleInHead: (cssText: string, attributes?: Record<string, string>) => HTMLStyleElement;
|
|
8
|
-
export default createStyleInHead;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a `<style>` tag in the `<head>` tag
|
|
3
|
-
* @param cssText - the CSS
|
|
4
|
-
* @param attributes - optional attributes to add to the tag
|
|
5
|
-
* @returns {HTMLElement}
|
|
6
|
-
*/
|
|
7
|
-
const createStyleInHead = (cssText, attributes) => {
|
|
8
|
-
const style = document.createElement("style");
|
|
9
|
-
style.type = "text/css";
|
|
10
|
-
if (attributes) {
|
|
11
|
-
Object.entries(attributes).forEach(pair => style.setAttribute(...pair));
|
|
12
|
-
}
|
|
13
|
-
style.textContent = cssText;
|
|
14
|
-
document.head.appendChild(style);
|
|
15
|
-
return style;
|
|
16
|
-
};
|
|
17
|
-
export default createStyleInHead;
|
|
18
|
-
//# sourceMappingURL=createStyleInHead.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createStyleInHead.js","sourceRoot":"","sources":["../../src/util/createStyleInHead.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,UAAmC,EAAE,EAAE;IAClF,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;IAExB,IAAI,UAAU,EAAE;QACf,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACxE;IAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Creates a `<style>` tag in the `<head>` tag\n * @param cssText - the CSS\n * @param attributes - optional attributes to add to the tag\n * @returns {HTMLElement}\n */\nconst createStyleInHead = (cssText: string, attributes?: Record<string, string>) => {\n\tconst style = document.createElement(\"style\");\n\tstyle.type = \"text/css\";\n\n\tif (attributes) {\n\t\tObject.entries(attributes).forEach(pair => style.setAttribute(...pair));\n\t}\n\n\tstyle.textContent = cssText;\n\tdocument.head.appendChild(style);\n\treturn style;\n};\n\nexport default createStyleInHead;\n"]}
|