@ui5/webcomponents-base 0.0.0-0fcda382e → 0.0.0-11d529e8a
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 +137 -0
- package/README.md +26 -1
- package/bundle.esm.js +17 -7
- package/dist/AssetRegistry.js +8 -6
- package/dist/Boot.js +43 -0
- package/dist/CustomElementsRegistry.js +24 -8
- package/dist/CustomElementsScope.js +108 -0
- package/dist/DOMObserver.js +65 -0
- package/dist/Device.js +58 -779
- package/dist/EventProvider.js +38 -26
- package/dist/FontFace.js +52 -7
- package/dist/InitialConfiguration.js +32 -8
- package/dist/Keys.js +89 -2
- package/dist/MediaRange.js +109 -0
- package/dist/PropertiesFileFormat.js +95 -0
- package/dist/Render.js +173 -0
- package/dist/RenderQueue.js +41 -17
- package/dist/RenderScheduler.js +24 -126
- package/dist/StaticArea.js +1 -39
- package/dist/StaticAreaItem.js +64 -62
- package/dist/SystemCSSVars.js +31 -0
- package/dist/Theming.js +2 -1
- package/dist/UI5Element.js +427 -299
- package/dist/UI5ElementMetadata.js +157 -19
- package/dist/asset-registries/Icons.js +118 -14
- package/dist/asset-registries/Illustrations.js +30 -0
- package/dist/asset-registries/LocaleData.js +90 -65
- package/dist/asset-registries/Themes.js +23 -32
- package/dist/asset-registries/i18n.js +72 -30
- package/dist/config/AnimationMode.js +11 -1
- package/dist/config/Language.js +58 -2
- package/dist/delegate/ItemNavigation.js +244 -171
- package/dist/delegate/ResizeHandler.js +78 -38
- package/dist/delegate/ScrollEnablement.js +49 -20
- package/dist/features/OpenUI5Support.js +42 -7
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/getSharedResource.js +30 -0
- package/dist/i18nBundle.js +27 -4
- package/dist/isLegacyBrowser.js +3 -0
- package/dist/locale/RTLAwareRegistry.js +14 -0
- package/dist/locale/applyDirection.js +17 -0
- package/dist/locale/directionChange.js +32 -0
- package/dist/locale/getEffectiveDir.js +28 -0
- package/dist/locale/getLocale.js +12 -2
- package/dist/locale/languageChange.js +22 -0
- package/dist/renderer/LitRenderer.js +21 -4
- package/dist/renderer/executeTemplate.js +17 -0
- package/dist/resources/bundle.esm.js +17 -109
- package/dist/resources/bundle.esm.js.map +1 -1
- package/dist/sap/base/Log.js +241 -0
- package/dist/sap/base/assert.js +8 -0
- package/dist/sap/base/security/URLListValidator.js +148 -0
- package/dist/sap/base/security/sanitizeHTML.js +16 -0
- package/dist/sap/base/util/now.js +7 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3585 -0
- package/dist/test-resources/assets/Themes.js +10 -6
- package/dist/test-resources/elements/Parent.js +6 -2
- package/dist/test-resources/elements/WithStaticArea.js +2 -1
- package/dist/test-resources/pages/AllTestElements.html +3 -3
- package/dist/test-resources/pages/Configuration.html +0 -2
- package/dist/test-resources/pages/ConfigurationScript.html +1 -3
- package/dist/test-resources/pages/assets/messagebundle_de.properties +1 -0
- package/dist/test-resources/pages/assets/messagebundle_en.properties +1 -0
- package/dist/test-resources/pages/assets/messagebundle_es.properties +1 -0
- package/dist/test-resources/pages/assets/messagebundle_fr.properties +1 -0
- package/dist/test-resources/pages/i18n.html +35 -0
- package/dist/test-resources/specs/ConfigurationChange.spec.js +11 -9
- package/dist/test-resources/specs/ConfigurationScript.spec.js +25 -23
- package/dist/test-resources/specs/ConfigurationURL.spec.js +65 -17
- package/dist/test-resources/specs/CustomTheme.spec.js +7 -5
- package/dist/test-resources/specs/EventProvider.spec.js +63 -0
- package/dist/test-resources/specs/StaticArea.spec.js +56 -12
- package/dist/test-resources/specs/Theming.spec.js +9 -7
- package/dist/test-resources/specs/UI5ElementInvalidation.js +54 -70
- package/dist/test-resources/specs/UI5ElementLifecycle.js +19 -14
- package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +25 -51
- package/dist/test-resources/specs/UI5ElementMetadataExt.js +9 -7
- package/dist/test-resources/specs/UI5ElementPropertyValidation.js +7 -5
- package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +37 -35
- package/dist/test-resources/specs/UI5ElementShadowDOM.js +10 -8
- package/dist/test-resources/specs/UI5ElementSlots.js +10 -8
- package/dist/theming/CustomStyle.js +28 -7
- package/dist/theming/ThemeLoaded.js +22 -0
- package/dist/theming/applyTheme.js +2 -5
- package/dist/theming/getConstructableStyle.js +15 -10
- package/dist/theming/getEffectiveStyle.js +23 -8
- package/dist/theming/getStylesString.js +13 -0
- package/dist/types/CSSColor.js +9 -0
- package/dist/types/CalendarType.js +1 -1
- package/dist/types/DataType.js +13 -1
- package/dist/types/Float.js +14 -0
- package/dist/types/Integer.js +4 -0
- package/dist/types/InvisibleMessageMode.js +30 -0
- package/dist/types/ItemNavigationBehavior.js +2 -7
- package/dist/types/NavigationMode.js +1 -0
- package/dist/types/PopupState.js +1 -1
- package/dist/types/ValueState.js +1 -1
- package/dist/updateShadowRoot.js +26 -0
- package/dist/util/AriaLabelHelper.js +41 -0
- package/dist/util/Caret.js +45 -0
- package/dist/util/ColorConversion.js +370 -0
- package/dist/util/FocusableElements.js +25 -8
- package/dist/util/HTMLSanitizer.js +7 -0
- package/dist/util/InvisibleMessage.js +58 -0
- package/dist/util/PopupUtils.js +93 -0
- package/dist/util/SlotsHelper.js +43 -0
- package/dist/util/TabbableElements.js +1 -1
- package/dist/util/arraysAreEqual.js +15 -0
- package/dist/util/clamp.js +12 -0
- package/dist/util/debounce.js +17 -0
- package/dist/util/encodeCSS.js +24 -0
- package/dist/util/getActiveElement.js +11 -0
- package/dist/util/getClassCopy.js +10 -0
- package/dist/util/getEffectiveContentDensity.js +5 -0
- package/dist/util/getSingletonElementInstance.js +13 -0
- package/dist/util/isElementInView.js +15 -0
- package/dist/util/isNodeHidden.js +1 -5
- package/dist/util/isNodeTabbable.js +4 -4
- package/dist/util/isValidPropertyName.js +9 -3
- package/dist/util/setToArray.js +10 -0
- package/hash.txt +1 -0
- package/index.js +1 -1
- package/package-scripts.js +33 -18
- package/package.json +20 -11
- package/src/AssetRegistry.js +8 -6
- package/src/Boot.js +43 -0
- package/src/CustomElementsRegistry.js +24 -8
- package/src/CustomElementsScope.js +108 -0
- package/src/DOMObserver.js +65 -0
- package/src/Device.js +58 -779
- package/src/EventProvider.js +38 -26
- package/src/FontFace.js +52 -7
- package/src/InitialConfiguration.js +32 -8
- package/src/Keys.js +89 -2
- package/src/MediaRange.js +109 -0
- package/src/PropertiesFileFormat.js +95 -0
- package/src/Render.js +173 -0
- package/src/RenderQueue.js +41 -17
- package/src/RenderScheduler.js +24 -126
- package/src/StaticArea.js +1 -39
- package/src/StaticAreaItem.js +64 -62
- package/src/SystemCSSVars.js +31 -0
- package/src/Theming.js +2 -1
- package/src/UI5Element.js +427 -299
- package/src/UI5ElementMetadata.js +157 -19
- package/src/asset-registries/Icons.js +118 -14
- package/src/asset-registries/Illustrations.js +30 -0
- package/src/asset-registries/LocaleData.js +90 -65
- package/src/asset-registries/Themes.js +23 -32
- package/src/asset-registries/i18n.js +72 -30
- package/src/config/AnimationMode.js +11 -1
- package/src/config/Language.js +58 -2
- package/src/delegate/ItemNavigation.js +244 -171
- package/src/delegate/ResizeHandler.js +78 -38
- package/src/delegate/ScrollEnablement.js +49 -20
- package/src/features/OpenUI5Support.js +42 -7
- package/src/getSharedResource.js +30 -0
- package/src/i18nBundle.js +27 -4
- package/src/isLegacyBrowser.js +3 -0
- package/src/locale/RTLAwareRegistry.js +14 -0
- package/src/locale/applyDirection.js +17 -0
- package/src/locale/directionChange.js +32 -0
- package/src/locale/getEffectiveDir.js +28 -0
- package/src/locale/getLocale.js +12 -2
- package/src/locale/languageChange.js +22 -0
- package/src/renderer/LitRenderer.js +21 -4
- package/src/renderer/executeTemplate.js +17 -0
- package/src/theming/CustomStyle.js +28 -7
- package/src/theming/ThemeLoaded.js +22 -0
- package/src/theming/applyTheme.js +2 -5
- package/src/theming/getConstructableStyle.js +15 -10
- package/src/theming/getEffectiveStyle.js +23 -8
- package/src/theming/getStylesString.js +13 -0
- package/src/types/CSSColor.js +9 -0
- package/src/types/CalendarType.js +1 -1
- package/src/types/DataType.js +13 -1
- package/src/types/Float.js +14 -0
- package/src/types/Integer.js +4 -0
- package/src/types/InvisibleMessageMode.js +30 -0
- package/src/types/ItemNavigationBehavior.js +2 -7
- package/src/types/NavigationMode.js +1 -0
- package/src/types/PopupState.js +1 -1
- package/src/types/ValueState.js +1 -1
- package/src/updateShadowRoot.js +26 -0
- package/src/util/AriaLabelHelper.js +41 -0
- package/src/util/Caret.js +45 -0
- package/src/util/ColorConversion.js +370 -0
- package/src/util/FocusableElements.js +25 -8
- package/src/util/HTMLSanitizer.js +7 -0
- package/src/util/InvisibleMessage.js +58 -0
- package/src/util/PopupUtils.js +93 -0
- package/src/util/SlotsHelper.js +43 -0
- package/src/util/TabbableElements.js +1 -1
- package/src/util/arraysAreEqual.js +15 -0
- package/src/util/clamp.js +12 -0
- package/src/util/debounce.js +17 -0
- package/src/util/encodeCSS.js +24 -0
- package/src/util/getActiveElement.js +11 -0
- package/src/util/getClassCopy.js +10 -0
- package/src/util/getEffectiveContentDensity.js +5 -0
- package/src/util/getSingletonElementInstance.js +13 -0
- package/src/util/isElementInView.js +15 -0
- package/src/util/isNodeHidden.js +1 -5
- package/src/util/isNodeTabbable.js +4 -4
- package/src/util/isValidPropertyName.js +9 -3
- package/src/util/setToArray.js +10 -0
- package/used-modules.txt +7 -0
- package/bundle.es5.js +0 -28
- package/dist/SVGIconRegistry.js +0 -60
- package/dist/boot.js +0 -32
- package/dist/compatibility/DOMObserver.js +0 -62
- package/dist/compatibility/patchNodeValue.js +0 -24
- package/dist/compatibility/whenPolyfillLoaded.js +0 -26
- package/dist/delegate/CustomResize.js +0 -78
- package/dist/delegate/NativeResize.js +0 -44
- package/dist/features/browsersupport/Edge.js +0 -6
- package/dist/features/browsersupport/IE11.js +0 -41
- package/dist/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
- package/dist/renderer/ifDefined.js +0 -21
- package/dist/resources/bundle.es5.js +0 -212
- package/dist/resources/bundle.es5.js.map +0 -1
- package/dist/theming/CSSVarsPonyfill.js +0 -24
- package/dist/theming/adaptCSSForIE.js +0 -90
- package/dist/theming/createComponentStyleTag.js +0 -49
- package/dist/thirdparty/Array.from.js +0 -16
- package/dist/thirdparty/Array.prototype.fill.js +0 -44
- package/dist/thirdparty/Array.prototype.find.js +0 -46
- package/dist/thirdparty/Array.prototype.includes.js +0 -51
- package/dist/thirdparty/Element.prototype.closest.js +0 -11
- package/dist/thirdparty/Element.prototype.matches.js +0 -6
- package/dist/thirdparty/Map.prototype.keys.js +0 -9
- package/dist/thirdparty/Number.isInteger.js +0 -5
- package/dist/thirdparty/Number.isNaN.js +0 -1
- package/dist/thirdparty/Number.parseInt.js +0 -1
- package/dist/thirdparty/Object.assign.js +0 -31
- package/dist/thirdparty/Object.entries.js +0 -11
- package/dist/thirdparty/Symbol.js +0 -2
- package/dist/thirdparty/WeakSet.js +0 -27
- package/dist/thirdparty/es6-string-methods.js +0 -182
- package/dist/thirdparty/events-polyfills.js +0 -89
- package/dist/thirdparty/fetch.js +0 -1
- package/dist/thirdparty/template.js +0 -600
- package/dist/thirdparty/webcomponents-sd-ce-pf.js +0 -318
- package/dist/webcomponentsjs/LICENSE.md +0 -19
- package/dist/webcomponentsjs/README.md +0 -229
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -297
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -208
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js +0 -166
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
- package/dist/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
- package/dist/webcomponentsjs/package.json +0 -46
- package/dist/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -53
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -28
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
- package/dist/webcomponentsjs/webcomponents-bundle.js +0 -298
- package/dist/webcomponentsjs/webcomponents-bundle.js.map +0 -1
- package/dist/webcomponentsjs/webcomponents-loader.js +0 -185
- package/src/SVGIconRegistry.js +0 -60
- package/src/boot.js +0 -32
- package/src/compatibility/DOMObserver.js +0 -62
- package/src/compatibility/patchNodeValue.js +0 -24
- package/src/compatibility/whenPolyfillLoaded.js +0 -26
- package/src/delegate/CustomResize.js +0 -78
- package/src/delegate/NativeResize.js +0 -44
- package/src/features/browsersupport/Edge.js +0 -6
- package/src/features/browsersupport/IE11.js +0 -41
- package/src/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
- package/src/renderer/ifDefined.js +0 -21
- package/src/theming/CSSVarsPonyfill.js +0 -24
- package/src/theming/adaptCSSForIE.js +0 -90
- package/src/theming/createComponentStyleTag.js +0 -49
- package/src/thirdparty/Array.from.js +0 -16
- package/src/thirdparty/Array.prototype.fill.js +0 -44
- package/src/thirdparty/Array.prototype.find.js +0 -46
- package/src/thirdparty/Array.prototype.includes.js +0 -51
- package/src/thirdparty/Element.prototype.closest.js +0 -11
- package/src/thirdparty/Element.prototype.matches.js +0 -6
- package/src/thirdparty/Map.prototype.keys.js +0 -9
- package/src/thirdparty/Number.isInteger.js +0 -5
- package/src/thirdparty/Number.isNaN.js +0 -1
- package/src/thirdparty/Number.parseInt.js +0 -1
- package/src/thirdparty/Object.assign.js +0 -31
- package/src/thirdparty/Object.entries.js +0 -11
- package/src/thirdparty/Symbol.js +0 -2
- package/src/thirdparty/WeakSet.js +0 -27
- package/src/thirdparty/es6-string-methods.js +0 -182
- package/src/thirdparty/events-polyfills.js +0 -89
- package/src/thirdparty/fetch.js +0 -1
- package/src/thirdparty/template.js +0 -600
- package/src/thirdparty/webcomponents-sd-ce-pf.js +0 -318
package/dist/Render.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import EventProvider from "./EventProvider.js";
|
|
2
|
+
import RenderQueue from "./RenderQueue.js";
|
|
3
|
+
import { getAllRegisteredTags } from "./CustomElementsRegistry.js";
|
|
4
|
+
import { isRtlAware } from "./locale/RTLAwareRegistry.js";
|
|
5
|
+
|
|
6
|
+
const registeredElements = new Set();
|
|
7
|
+
const eventProvider = new EventProvider();
|
|
8
|
+
|
|
9
|
+
const invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components
|
|
10
|
+
|
|
11
|
+
let renderTaskPromise,
|
|
12
|
+
renderTaskPromiseResolve;
|
|
13
|
+
|
|
14
|
+
let mutationObserverTimer;
|
|
15
|
+
|
|
16
|
+
let queuePromise;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Schedules a render task (if not already scheduled) to render the component
|
|
20
|
+
*
|
|
21
|
+
* @param webComponent
|
|
22
|
+
* @returns {Promise}
|
|
23
|
+
*/
|
|
24
|
+
const renderDeferred = async webComponent => {
|
|
25
|
+
// Enqueue the web component
|
|
26
|
+
invalidatedWebComponents.add(webComponent);
|
|
27
|
+
|
|
28
|
+
// Schedule a rendering task
|
|
29
|
+
await scheduleRenderTask();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Renders a component synchronously and adds it to the registry of rendered components
|
|
34
|
+
*
|
|
35
|
+
* @param webComponent
|
|
36
|
+
*/
|
|
37
|
+
const renderImmediately = webComponent => {
|
|
38
|
+
eventProvider.fireEvent("beforeComponentRender", webComponent);
|
|
39
|
+
registeredElements.add(webComponent);
|
|
40
|
+
webComponent._render();
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components
|
|
45
|
+
*
|
|
46
|
+
* @param webComponent
|
|
47
|
+
*/
|
|
48
|
+
const cancelRender = webComponent => {
|
|
49
|
+
invalidatedWebComponents.remove(webComponent);
|
|
50
|
+
registeredElements.delete(webComponent);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Schedules a rendering task, if not scheduled already
|
|
55
|
+
*/
|
|
56
|
+
const scheduleRenderTask = async () => {
|
|
57
|
+
if (!queuePromise) {
|
|
58
|
+
queuePromise = new Promise(resolve => {
|
|
59
|
+
window.requestAnimationFrame(() => {
|
|
60
|
+
// Render all components in the queue
|
|
61
|
+
|
|
62
|
+
// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line
|
|
63
|
+
invalidatedWebComponents.process(renderImmediately);
|
|
64
|
+
// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line
|
|
65
|
+
|
|
66
|
+
// Resolve the promise so that callers of renderDeferred can continue
|
|
67
|
+
queuePromise = null;
|
|
68
|
+
resolve();
|
|
69
|
+
|
|
70
|
+
// Wait for Mutation observer before the render task is considered finished
|
|
71
|
+
if (!mutationObserverTimer) {
|
|
72
|
+
mutationObserverTimer = setTimeout(() => {
|
|
73
|
+
mutationObserverTimer = undefined;
|
|
74
|
+
if (invalidatedWebComponents.isEmpty()) {
|
|
75
|
+
_resolveTaskPromise();
|
|
76
|
+
}
|
|
77
|
+
}, 200);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
await queuePromise;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* return a promise that will be resolved once all invalidated web components are rendered
|
|
88
|
+
*/
|
|
89
|
+
const whenDOMUpdated = () => {
|
|
90
|
+
if (renderTaskPromise) {
|
|
91
|
+
return renderTaskPromise;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
renderTaskPromise = new Promise(resolve => {
|
|
95
|
+
renderTaskPromiseResolve = resolve;
|
|
96
|
+
window.requestAnimationFrame(() => {
|
|
97
|
+
if (invalidatedWebComponents.isEmpty()) {
|
|
98
|
+
renderTaskPromise = undefined;
|
|
99
|
+
resolve();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return renderTaskPromise;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const whenAllCustomElementsAreDefined = () => {
|
|
108
|
+
const definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));
|
|
109
|
+
return Promise.all(definedPromises);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const renderFinished = async () => {
|
|
113
|
+
await whenAllCustomElementsAreDefined();
|
|
114
|
+
await whenDOMUpdated();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const _resolveTaskPromise = () => {
|
|
118
|
+
if (!invalidatedWebComponents.isEmpty()) {
|
|
119
|
+
// More updates are pending. Resolve will be called again
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (renderTaskPromiseResolve) {
|
|
124
|
+
renderTaskPromiseResolve();
|
|
125
|
+
renderTaskPromiseResolve = undefined;
|
|
126
|
+
renderTaskPromise = undefined;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.
|
|
132
|
+
*
|
|
133
|
+
* Usage:
|
|
134
|
+
* reRenderAllUI5Elements() -> re-renders all components
|
|
135
|
+
* reRenderAllUI5Elements({tag: "ui5-button"}) -> re-renders only instances of ui5-button
|
|
136
|
+
* reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components
|
|
137
|
+
* reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components
|
|
138
|
+
* reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware
|
|
139
|
+
* etc...
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
* @param {Object|undefined} filters - Object with keys that can be "rtlAware" or "languageAware"
|
|
143
|
+
* @returns {Promise<void>}
|
|
144
|
+
*/
|
|
145
|
+
const reRenderAllUI5Elements = async filters => {
|
|
146
|
+
registeredElements.forEach(element => {
|
|
147
|
+
const tag = element.constructor.getMetadata().getTag();
|
|
148
|
+
const rtlAware = isRtlAware(element.constructor);
|
|
149
|
+
const languageAware = element.constructor.getMetadata().isLanguageAware();
|
|
150
|
+
if (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware)) {
|
|
151
|
+
renderDeferred(element);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
await renderFinished();
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const attachBeforeComponentRender = listener => {
|
|
158
|
+
eventProvider.attachEvent("beforeComponentRender", listener);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const detachBeforeComponentRender = listener => {
|
|
162
|
+
eventProvider.detachEvent("beforeComponentRender", listener);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
renderDeferred,
|
|
167
|
+
renderImmediately,
|
|
168
|
+
cancelRender,
|
|
169
|
+
renderFinished,
|
|
170
|
+
reRenderAllUI5Elements,
|
|
171
|
+
attachBeforeComponentRender,
|
|
172
|
+
detachBeforeComponentRender,
|
|
173
|
+
};
|
package/dist/RenderQueue.js
CHANGED
|
@@ -1,41 +1,65 @@
|
|
|
1
|
+
const MAX_PROCESS_COUNT = 10;
|
|
2
|
+
|
|
1
3
|
class RenderQueue {
|
|
2
4
|
constructor() {
|
|
3
5
|
this.list = []; // Used to store the web components in order
|
|
4
|
-
this.
|
|
6
|
+
this.lookup = new Set(); // Used for faster search
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
add(webComponent) {
|
|
8
|
-
if (this.
|
|
9
|
-
return
|
|
10
|
+
if (this.lookup.has(webComponent)) {
|
|
11
|
+
return;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
let deferredResolve;
|
|
13
|
-
const promise = new Promise(resolve => {
|
|
14
|
-
deferredResolve = resolve;
|
|
15
|
-
});
|
|
16
|
-
promise._deferredResolve = deferredResolve;
|
|
17
|
-
|
|
18
14
|
this.list.push(webComponent);
|
|
19
|
-
this.
|
|
15
|
+
this.lookup.add(webComponent);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
remove(webComponent) {
|
|
19
|
+
if (!this.lookup.has(webComponent)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
this.list = this.list.filter(item => item !== webComponent);
|
|
24
|
+
this.lookup.delete(webComponent);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
shift() {
|
|
25
28
|
const webComponent = this.list.shift();
|
|
26
29
|
if (webComponent) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return { webComponent, promise };
|
|
30
|
+
this.lookup.delete(webComponent);
|
|
31
|
+
return webComponent;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
return this.list;
|
|
35
|
+
isEmpty() {
|
|
36
|
+
return this.list.length === 0;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
isAdded(webComponent) {
|
|
38
|
-
return this.
|
|
40
|
+
return this.lookup.has(webComponent);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Processes the whole queue by executing the callback on each component,
|
|
45
|
+
* while also imposing restrictions on how many times a component may be processed.
|
|
46
|
+
*
|
|
47
|
+
* @param callback - function with one argument (the web component to be processed)
|
|
48
|
+
*/
|
|
49
|
+
process(callback) {
|
|
50
|
+
let webComponent;
|
|
51
|
+
const stats = new Map();
|
|
52
|
+
|
|
53
|
+
webComponent = this.shift();
|
|
54
|
+
while (webComponent) {
|
|
55
|
+
const timesProcessed = stats.get(webComponent) || 0;
|
|
56
|
+
if (timesProcessed > MAX_PROCESS_COUNT) {
|
|
57
|
+
throw new Error(`Web component processed too many times this task, max allowed is: ${MAX_PROCESS_COUNT}`);
|
|
58
|
+
}
|
|
59
|
+
callback(webComponent);
|
|
60
|
+
stats.set(webComponent, timesProcessed + 1);
|
|
61
|
+
webComponent = this.shift();
|
|
62
|
+
}
|
|
39
63
|
}
|
|
40
64
|
}
|
|
41
65
|
|
package/dist/RenderScheduler.js
CHANGED
|
@@ -1,145 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// Tells whether a render task is currently scheduled
|
|
7
|
-
let renderTaskId;
|
|
8
|
-
|
|
9
|
-
// Queue for invalidated web components
|
|
10
|
-
const invalidatedWebComponents = new RenderQueue();
|
|
11
|
-
|
|
12
|
-
let renderTaskPromise,
|
|
13
|
-
renderTaskPromiseResolve,
|
|
14
|
-
taskResult;
|
|
15
|
-
|
|
16
|
-
let mutationObserverTimer;
|
|
1
|
+
import {
|
|
2
|
+
renderDeferred,
|
|
3
|
+
renderImmediately,
|
|
4
|
+
renderFinished,
|
|
5
|
+
} from "./Render.js";
|
|
17
6
|
|
|
18
7
|
/**
|
|
19
|
-
*
|
|
20
|
-
* This is always asynchronous
|
|
8
|
+
* @deprecated Use the Render.js module instead
|
|
21
9
|
*/
|
|
22
10
|
class RenderScheduler {
|
|
23
|
-
constructor() {
|
|
24
|
-
throw new Error("Static class");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
11
|
/**
|
|
28
|
-
*
|
|
12
|
+
* Schedules a render task (if not already scheduled) to render the component
|
|
13
|
+
*
|
|
29
14
|
* @param webComponent
|
|
15
|
+
* @returns {Promise}
|
|
16
|
+
* @deprecated Use renderDeferred from the Render.js module instead
|
|
30
17
|
*/
|
|
31
|
-
static renderDeferred(webComponent) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Schedule a rendering task
|
|
36
|
-
RenderScheduler.scheduleRenderTask();
|
|
37
|
-
return res;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static renderImmediately(webComponent) {
|
|
41
|
-
// Enqueue the web component
|
|
42
|
-
const res = invalidatedWebComponents.add(webComponent);
|
|
43
|
-
|
|
44
|
-
// Immediately start a render task
|
|
45
|
-
RenderScheduler.runRenderTask();
|
|
46
|
-
return res;
|
|
18
|
+
static async renderDeferred(webComponent) {
|
|
19
|
+
console.log("RenderScheduler.renderDeferred is deprecated, please use renderDeferred, exported by Render.js instead"); // eslint-disable-line
|
|
20
|
+
await renderDeferred(webComponent);
|
|
47
21
|
}
|
|
48
22
|
|
|
49
23
|
/**
|
|
50
|
-
*
|
|
24
|
+
* Renders a component synchronously
|
|
25
|
+
*
|
|
26
|
+
* @param webComponent
|
|
27
|
+
* @deprecated Use renderImmediately from the Render.js module instead
|
|
51
28
|
*/
|
|
52
|
-
static
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// renderTaskId = Promise.resolve().then(RenderScheduler.renderWebComponents); // Micro task
|
|
56
|
-
renderTaskId = window.requestAnimationFrame(RenderScheduler.renderWebComponents); // AF
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static runRenderTask() {
|
|
61
|
-
if (!renderTaskId) {
|
|
62
|
-
renderTaskId = 1; // prevent another rendering task from being scheduled, all web components should use this task
|
|
63
|
-
RenderScheduler.renderWebComponents();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static renderWebComponents() {
|
|
68
|
-
// console.log("------------- NEW RENDER TASK ---------------");
|
|
69
|
-
|
|
70
|
-
let webComponentInfo,
|
|
71
|
-
webComponent,
|
|
72
|
-
promise;
|
|
73
|
-
const renderStats = new Map();
|
|
74
|
-
while (webComponentInfo = invalidatedWebComponents.shift()) { // eslint-disable-line
|
|
75
|
-
webComponent = webComponentInfo.webComponent;
|
|
76
|
-
promise = webComponentInfo.promise;
|
|
77
|
-
|
|
78
|
-
const timesRerendered = renderStats.get(webComponent) || 0;
|
|
79
|
-
if (timesRerendered > MAX_RERENDER_COUNT) {
|
|
80
|
-
// console.warn("WARNING RERENDER", webComponent);
|
|
81
|
-
throw new Error(`Web component re-rendered too many times this task, max allowed is: ${MAX_RERENDER_COUNT}`);
|
|
82
|
-
}
|
|
83
|
-
webComponent._render();
|
|
84
|
-
promise._deferredResolve();
|
|
85
|
-
renderStats.set(webComponent, timesRerendered + 1);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// wait for Mutation observer just in case
|
|
89
|
-
if (!mutationObserverTimer) {
|
|
90
|
-
mutationObserverTimer = setTimeout(() => {
|
|
91
|
-
mutationObserverTimer = undefined;
|
|
92
|
-
if (invalidatedWebComponents.getList().length === 0) {
|
|
93
|
-
RenderScheduler._resolveTaskPromise();
|
|
94
|
-
}
|
|
95
|
-
}, 200);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
renderTaskId = undefined;
|
|
29
|
+
static renderImmediately(webComponent) {
|
|
30
|
+
console.log("RenderScheduler.renderImmediately is deprecated, please use renderImmediately, exported by Render.js instead"); // eslint-disable-line
|
|
31
|
+
return renderImmediately(webComponent);
|
|
99
32
|
}
|
|
100
33
|
|
|
101
34
|
/**
|
|
102
|
-
*
|
|
35
|
+
* @deprecated Use renderFinished from the Render.js module instead
|
|
36
|
+
* @returns {Promise<void>}
|
|
103
37
|
*/
|
|
104
|
-
static whenDOMUpdated() {
|
|
105
|
-
if (renderTaskPromise) {
|
|
106
|
-
return renderTaskPromise;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
renderTaskPromise = new Promise(resolve => {
|
|
110
|
-
renderTaskPromiseResolve = resolve;
|
|
111
|
-
window.requestAnimationFrame(() => {
|
|
112
|
-
if (invalidatedWebComponents.getList().length === 0) {
|
|
113
|
-
renderTaskPromise = undefined;
|
|
114
|
-
resolve();
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
return renderTaskPromise;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
static whenAllCustomElementsAreDefined() {
|
|
123
|
-
const definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));
|
|
124
|
-
return Promise.all(definedPromises);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
38
|
static async whenFinished() {
|
|
128
|
-
|
|
129
|
-
await
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
static _resolveTaskPromise() {
|
|
133
|
-
if (invalidatedWebComponents.getList().length > 0) {
|
|
134
|
-
// More updates are pending. Resolve will be called again
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (renderTaskPromiseResolve) {
|
|
139
|
-
renderTaskPromiseResolve.call(this, taskResult);
|
|
140
|
-
renderTaskPromiseResolve = undefined;
|
|
141
|
-
renderTaskPromise = undefined;
|
|
142
|
-
}
|
|
39
|
+
console.log("RenderScheduler.whenFinished is deprecated, please use renderFinished, exported by Render.js instead"); // eslint-disable-line
|
|
40
|
+
await renderFinished();
|
|
143
41
|
}
|
|
144
42
|
}
|
|
145
43
|
|
package/dist/StaticArea.js
CHANGED
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
const getStaticAreaInstance = () => {
|
|
2
|
-
let staticArea = document.querySelector("ui5-static-area");
|
|
3
|
-
|
|
4
|
-
if (staticArea) {
|
|
5
|
-
return staticArea;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// Create static area if it is not present
|
|
9
|
-
const bodyElement = document.body;
|
|
10
|
-
staticArea = document.createElement("ui5-static-area");
|
|
11
|
-
|
|
12
|
-
return bodyElement.insertBefore(staticArea, bodyElement.firstChild);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const removeStaticArea = () => {
|
|
16
|
-
getStaticAreaInstance().destroy();
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
class StaticAreaElement extends HTMLElement {
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get isUI5Element() {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
destroy() {
|
|
29
|
-
const staticAreaDomRef = document.querySelector(this.tagName.toLowerCase());
|
|
30
|
-
staticAreaDomRef.parentElement.removeChild(staticAreaDomRef);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
1
|
if (!customElements.get("ui5-static-area")) {
|
|
35
|
-
customElements.define("ui5-static-area",
|
|
2
|
+
customElements.define("ui5-static-area", class extends HTMLElement {});
|
|
36
3
|
}
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
getStaticAreaInstance,
|
|
40
|
-
removeStaticArea,
|
|
41
|
-
};
|
package/dist/StaticAreaItem.js
CHANGED
|
@@ -1,77 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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 "./CustomElementsScope.js";
|
|
6
|
+
import getEffectiveDir from "./locale/getEffectiveDir.js";
|
|
3
7
|
|
|
4
8
|
/**
|
|
9
|
+
*
|
|
5
10
|
* @class
|
|
6
11
|
* @author SAP SE
|
|
7
12
|
* @private
|
|
8
|
-
* Defines and takes care of ui5-static-are-item items
|
|
9
13
|
*/
|
|
10
|
-
class StaticAreaItem {
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
14
|
+
class StaticAreaItem extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
13
17
|
this._rendered = false;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
isRendered() {
|
|
17
|
-
return this._rendered;
|
|
18
|
+
this.attachShadow({ mode: "open" });
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @protected
|
|
23
|
+
* @param ownerElement The UI5Element instance that owns this static area item
|
|
22
24
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (!this.staticAreaItemDomRef) {
|
|
28
|
-
// Initial rendering of fragment
|
|
29
|
-
|
|
30
|
-
this.staticAreaItemDomRef = document.createElement("ui5-static-area-item");
|
|
31
|
-
this.staticAreaItemDomRef.attachShadow({ mode: "open" });
|
|
32
|
-
this.staticAreaItemDomRef.classList.add(this.ui5ElementContext._id); // used for getting the popover in the tests
|
|
33
|
-
|
|
34
|
-
getStaticAreaInstance().appendChild(this.staticAreaItemDomRef);
|
|
35
|
-
this._rendered = true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.ui5ElementContext.constructor.render(renderResult, this.staticAreaItemDomRef.shadowRoot, stylesToAdd, { eventContext: this.ui5ElementContext });
|
|
25
|
+
setOwnerElement(ownerElement) {
|
|
26
|
+
this.ownerElement = ownerElement;
|
|
27
|
+
this.classList.add(this.ownerElement._id); // used for getting the popover in the tests
|
|
39
28
|
}
|
|
40
29
|
|
|
41
30
|
/**
|
|
31
|
+
* Updates the shadow root of the static area item with the latest state, if rendered
|
|
42
32
|
* @protected
|
|
43
33
|
*/
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const staticArea = getStaticAreaInstance();
|
|
50
|
-
|
|
51
|
-
staticArea.removeChild(this.staticAreaItemDomRef);
|
|
52
|
-
|
|
53
|
-
this.staticAreaItemDomRef = null;
|
|
54
|
-
|
|
55
|
-
// remove static area
|
|
56
|
-
if (staticArea.childElementCount < 1) {
|
|
57
|
-
removeStaticArea();
|
|
34
|
+
update() {
|
|
35
|
+
if (this._rendered) {
|
|
36
|
+
this._updateContentDensity();
|
|
37
|
+
this._updateDirection();
|
|
38
|
+
updateShadowRoot(this.ownerElement, true);
|
|
58
39
|
}
|
|
59
40
|
}
|
|
60
41
|
|
|
61
42
|
/**
|
|
62
|
-
*
|
|
43
|
+
* Sets the correct content density based on the owner element's state
|
|
44
|
+
* @private
|
|
63
45
|
*/
|
|
64
|
-
_updateContentDensity(
|
|
65
|
-
if (
|
|
66
|
-
|
|
46
|
+
_updateContentDensity() {
|
|
47
|
+
if (getEffectiveContentDensity(this.ownerElement) === "compact") {
|
|
48
|
+
this.classList.add("sapUiSizeCompact");
|
|
49
|
+
this.classList.add("ui5-content-density-compact");
|
|
50
|
+
} else {
|
|
51
|
+
this.classList.remove("sapUiSizeCompact");
|
|
52
|
+
this.classList.remove("ui5-content-density-compact");
|
|
67
53
|
}
|
|
54
|
+
}
|
|
68
55
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
_updateDirection() {
|
|
57
|
+
const dir = getEffectiveDir(this.ownerElement);
|
|
58
|
+
if (dir) {
|
|
59
|
+
this.setAttribute("dir", dir);
|
|
72
60
|
} else {
|
|
73
|
-
this.
|
|
74
|
-
this.staticAreaItemDomRef.classList.remove("ui5-content-density-compact");
|
|
61
|
+
this.removeAttribute("dir");
|
|
75
62
|
}
|
|
76
63
|
}
|
|
77
64
|
|
|
@@ -80,26 +67,41 @@ class StaticAreaItem {
|
|
|
80
67
|
* Returns reference to the DOM element where the current fragment is added.
|
|
81
68
|
*/
|
|
82
69
|
async getDomRef() {
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
this._updateContentDensity();
|
|
71
|
+
if (!this._rendered) {
|
|
72
|
+
this._rendered = true;
|
|
73
|
+
updateShadowRoot(this.ownerElement, true);
|
|
85
74
|
}
|
|
86
|
-
await
|
|
87
|
-
return this.
|
|
75
|
+
await renderFinished(); // Wait for the content of the ui5-static-area-item to be rendered
|
|
76
|
+
return this.shadowRoot;
|
|
88
77
|
}
|
|
89
|
-
}
|
|
90
78
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
/**
|
|
80
|
+
* @protected
|
|
81
|
+
* @param refName
|
|
82
|
+
* @returns {Element}
|
|
83
|
+
*/
|
|
84
|
+
getStableDomRef(refName) {
|
|
85
|
+
return this.shadowRoot.querySelector(`[data-ui5-stable=${refName}]`);
|
|
94
86
|
}
|
|
95
87
|
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
static getTag() {
|
|
89
|
+
const pureTag = "ui5-static-area-item";
|
|
90
|
+
const suffix = getEffectiveScopingSuffixForTag(pureTag);
|
|
91
|
+
if (!suffix) {
|
|
92
|
+
return pureTag;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return `${pureTag}-${suffix}`;
|
|
98
96
|
}
|
|
99
|
-
}
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
static createInstance() {
|
|
99
|
+
if (!customElements.get(StaticAreaItem.getTag())) {
|
|
100
|
+
customElements.define(StaticAreaItem.getTag(), StaticAreaItem);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return document.createElement(this.getTag());
|
|
104
|
+
}
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export default StaticAreaItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import createStyleInHead from "./util/createStyleInHead.js";
|
|
2
|
+
|
|
3
|
+
const systemCSSVars = `
|
|
4
|
+
:root {
|
|
5
|
+
--_ui5_content_density:cozy;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-ui5-compact-size],
|
|
9
|
+
.ui5-content-density-compact,
|
|
10
|
+
.sapUiSizeCompact {
|
|
11
|
+
--_ui5_content_density:compact;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[dir="rtl"] {
|
|
15
|
+
--_ui5_dir:rtl;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[dir="ltr"] {
|
|
19
|
+
--_ui5_dir:ltr;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
const insertSystemCSSVars = () => {
|
|
24
|
+
if (document.querySelector(`head>style[data-ui5-system-css-vars]`)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
createStyleInHead(systemCSSVars, { "data-ui5-system-css-vars": "" });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default insertSystemCSSVars;
|
package/dist/Theming.js
CHANGED