@ui5/webcomponents-base 0.0.0-0742854fd → 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 +109 -0
- package/README.md +26 -1
- package/bundle.esm.js +13 -10
- package/dist/AssetRegistry.js +8 -7
- package/dist/Boot.js +43 -0
- package/dist/DOMObserver.js +65 -0
- package/dist/Device.js +58 -779
- package/dist/EventProvider.js +30 -26
- package/dist/FontFace.js +52 -7
- package/dist/InitialConfiguration.js +26 -21
- package/dist/Keys.js +51 -0
- package/dist/MediaRange.js +109 -0
- package/{src/util/parseProperties.js → dist/PropertiesFileFormat.js} +6 -0
- package/dist/Render.js +173 -0
- package/dist/RenderScheduler.js +16 -138
- package/dist/StaticArea.js +1 -29
- package/dist/StaticAreaItem.js +64 -65
- package/dist/Theming.js +2 -1
- package/dist/UI5Element.js +305 -374
- package/dist/UI5ElementMetadata.js +115 -16
- package/dist/asset-registries/Icons.js +110 -14
- package/dist/asset-registries/Illustrations.js +30 -0
- package/dist/asset-registries/LocaleData.js +90 -66
- package/dist/asset-registries/Themes.js +23 -33
- package/dist/asset-registries/i18n.js +61 -50
- package/dist/config/Language.js +18 -20
- package/dist/delegate/ItemNavigation.js +233 -201
- package/dist/delegate/ResizeHandler.js +78 -37
- package/dist/delegate/ScrollEnablement.js +49 -20
- package/dist/features/OpenUI5Support.js +41 -6
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/i18nBundle.js +6 -2
- package/dist/isLegacyBrowser.js +3 -0
- package/dist/locale/applyDirection.js +6 -4
- 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 +1 -1
- package/dist/renderer/LitRenderer.js +19 -18
- 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 +8 -8
- 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 +0 -2
- package/dist/test-resources/pages/i18n.html +1 -6
- package/dist/test-resources/specs/ConfigurationChange.spec.js +10 -8
- 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 +17 -15
- 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 +2 -2
- package/dist/theming/ThemeLoaded.js +22 -0
- package/dist/theming/applyTheme.js +2 -5
- package/dist/theming/getConstructableStyle.js +7 -6
- package/dist/theming/getEffectiveStyle.js +15 -8
- package/dist/theming/getStylesString.js +1 -1
- 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 +4 -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/PopupState.js +1 -1
- package/dist/types/ValueState.js +1 -1
- package/dist/updateShadowRoot.js +26 -0
- package/dist/util/AriaLabelHelper.js +4 -4
- package/dist/util/Caret.js +45 -0
- package/dist/util/ColorConversion.js +370 -0
- package/dist/util/FocusableElements.js +17 -6
- 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/isElementInView.js +15 -0
- package/dist/util/isNodeTabbable.js +4 -4
- package/hash.txt +1 -0
- package/index.js +1 -1
- package/package-scripts.js +33 -18
- package/package.json +20 -12
- package/src/AssetRegistry.js +8 -7
- package/src/Boot.js +43 -0
- package/src/DOMObserver.js +65 -0
- package/src/Device.js +58 -779
- package/src/EventProvider.js +30 -26
- package/src/FontFace.js +52 -7
- package/src/InitialConfiguration.js +26 -21
- package/src/Keys.js +51 -0
- package/src/MediaRange.js +109 -0
- package/{dist/util/parseProperties.js → src/PropertiesFileFormat.js} +6 -0
- package/src/Render.js +173 -0
- package/src/RenderScheduler.js +16 -138
- package/src/StaticArea.js +1 -29
- package/src/StaticAreaItem.js +64 -65
- package/src/Theming.js +2 -1
- package/src/UI5Element.js +305 -374
- package/src/UI5ElementMetadata.js +115 -16
- package/src/asset-registries/Icons.js +110 -14
- package/src/asset-registries/Illustrations.js +30 -0
- package/src/asset-registries/LocaleData.js +90 -66
- package/src/asset-registries/Themes.js +23 -33
- package/src/asset-registries/i18n.js +61 -50
- package/src/config/Language.js +18 -20
- package/src/delegate/ItemNavigation.js +233 -201
- package/src/delegate/ResizeHandler.js +78 -37
- package/src/delegate/ScrollEnablement.js +49 -20
- package/src/features/OpenUI5Support.js +41 -6
- package/src/i18nBundle.js +6 -2
- package/src/isLegacyBrowser.js +3 -0
- package/src/locale/applyDirection.js +6 -4
- 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 +1 -1
- package/src/renderer/LitRenderer.js +19 -18
- package/src/theming/CustomStyle.js +2 -2
- package/src/theming/ThemeLoaded.js +22 -0
- package/src/theming/applyTheme.js +2 -5
- package/src/theming/getConstructableStyle.js +7 -6
- package/src/theming/getEffectiveStyle.js +15 -8
- package/src/theming/getStylesString.js +1 -1
- 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 +4 -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/PopupState.js +1 -1
- package/src/types/ValueState.js +1 -1
- package/src/updateShadowRoot.js +26 -0
- package/src/util/AriaLabelHelper.js +4 -4
- package/src/util/Caret.js +45 -0
- package/src/util/ColorConversion.js +370 -0
- package/src/util/FocusableElements.js +17 -6
- 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/isElementInView.js +15 -0
- package/src/util/isNodeTabbable.js +4 -4
- package/used-modules.txt +7 -0
- package/bundle.es5.js +0 -28
- package/dist/SVGIconRegistry.js +0 -62
- package/dist/boot.js +0 -34
- package/dist/compatibility/DOMObserver.js +0 -62
- package/dist/compatibility/patchNodeValue.js +0 -24
- package/dist/compatibility/whenPolyfillLoaded.js +0 -26
- package/dist/config/AssetsPath.js +0 -17
- package/dist/delegate/CustomResize.js +0 -78
- package/dist/delegate/NativeResize.js +0 -44
- package/dist/features/PropertiesFormatSupport.js +0 -8
- 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/renderer/scopeHTML.js +0 -32
- package/dist/resources/bundle.es5.js +0 -212
- package/dist/resources/bundle.es5.js.map +0 -1
- package/dist/theming/CSSVarsPonyfill.js +0 -48
- package/dist/theming/adaptCSSForIE.js +0 -95
- package/dist/theming/createComponentStyleTag.js +0 -54
- 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/util/getEffectiveAssetPath.js +0 -12
- package/dist/util/isSlot.js +0 -3
- 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 -62
- package/src/boot.js +0 -34
- package/src/compatibility/DOMObserver.js +0 -62
- package/src/compatibility/patchNodeValue.js +0 -24
- package/src/compatibility/whenPolyfillLoaded.js +0 -26
- package/src/config/AssetsPath.js +0 -17
- package/src/delegate/CustomResize.js +0 -78
- package/src/delegate/NativeResize.js +0 -44
- package/src/features/PropertiesFormatSupport.js +0 -8
- 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/renderer/scopeHTML.js +0 -32
- package/src/theming/CSSVarsPonyfill.js +0 -48
- package/src/theming/adaptCSSForIE.js +0 -95
- package/src/theming/createComponentStyleTag.js +0 -54
- 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/src/util/getEffectiveAssetPath.js +0 -12
- package/src/util/isSlot.js +0 -3
package/dist/RenderScheduler.js
CHANGED
|
@@ -1,165 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// Queue for invalidated web components
|
|
8
|
-
const invalidatedWebComponents = new RenderQueue();
|
|
9
|
-
|
|
10
|
-
let renderTaskPromise,
|
|
11
|
-
renderTaskPromiseResolve;
|
|
12
|
-
|
|
13
|
-
let mutationObserverTimer;
|
|
14
|
-
|
|
15
|
-
let queuePromise;
|
|
1
|
+
import {
|
|
2
|
+
renderDeferred,
|
|
3
|
+
renderImmediately,
|
|
4
|
+
renderFinished,
|
|
5
|
+
} from "./Render.js";
|
|
16
6
|
|
|
17
7
|
/**
|
|
18
|
-
*
|
|
19
|
-
* This is always asynchronous
|
|
8
|
+
* @deprecated Use the Render.js module instead
|
|
20
9
|
*/
|
|
21
10
|
class RenderScheduler {
|
|
22
|
-
constructor() {
|
|
23
|
-
throw new Error("Static class");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
11
|
/**
|
|
27
12
|
* Schedules a render task (if not already scheduled) to render the component
|
|
28
13
|
*
|
|
29
14
|
* @param webComponent
|
|
30
15
|
* @returns {Promise}
|
|
16
|
+
* @deprecated Use renderDeferred from the Render.js module instead
|
|
31
17
|
*/
|
|
32
18
|
static async renderDeferred(webComponent) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// Schedule a rendering task
|
|
37
|
-
await RenderScheduler.scheduleRenderTask();
|
|
19
|
+
console.log("RenderScheduler.renderDeferred is deprecated, please use renderDeferred, exported by Render.js instead"); // eslint-disable-line
|
|
20
|
+
await renderDeferred(webComponent);
|
|
38
21
|
}
|
|
39
22
|
|
|
40
23
|
/**
|
|
41
24
|
* Renders a component synchronously
|
|
42
25
|
*
|
|
43
26
|
* @param webComponent
|
|
27
|
+
* @deprecated Use renderImmediately from the Render.js module instead
|
|
44
28
|
*/
|
|
45
29
|
static renderImmediately(webComponent) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Cancels the rendering of a component, added to the queue with renderDeferred
|
|
51
|
-
*
|
|
52
|
-
* @param webComponent
|
|
53
|
-
*/
|
|
54
|
-
static cancelRender(webComponent) {
|
|
55
|
-
invalidatedWebComponents.remove(webComponent);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Schedules a rendering task, if not scheduled already
|
|
60
|
-
*/
|
|
61
|
-
static async scheduleRenderTask() {
|
|
62
|
-
if (!queuePromise) {
|
|
63
|
-
queuePromise = new Promise(resolve => {
|
|
64
|
-
window.requestAnimationFrame(() => {
|
|
65
|
-
// Render all components in the queue
|
|
66
|
-
invalidatedWebComponents.process(component => component._render());
|
|
67
|
-
|
|
68
|
-
// Resolve the promise so that callers of renderDeferred can continue
|
|
69
|
-
queuePromise = null;
|
|
70
|
-
resolve();
|
|
71
|
-
|
|
72
|
-
// Wait for Mutation observer before the render task is considered finished
|
|
73
|
-
if (!mutationObserverTimer) {
|
|
74
|
-
mutationObserverTimer = setTimeout(() => {
|
|
75
|
-
mutationObserverTimer = undefined;
|
|
76
|
-
if (invalidatedWebComponents.isEmpty()) {
|
|
77
|
-
RenderScheduler._resolveTaskPromise();
|
|
78
|
-
}
|
|
79
|
-
}, 200);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
await queuePromise;
|
|
30
|
+
console.log("RenderScheduler.renderImmediately is deprecated, please use renderImmediately, exported by Render.js instead"); // eslint-disable-line
|
|
31
|
+
return renderImmediately(webComponent);
|
|
86
32
|
}
|
|
87
33
|
|
|
88
34
|
/**
|
|
89
|
-
*
|
|
35
|
+
* @deprecated Use renderFinished from the Render.js module instead
|
|
36
|
+
* @returns {Promise<void>}
|
|
90
37
|
*/
|
|
91
|
-
static whenDOMUpdated() {
|
|
92
|
-
if (renderTaskPromise) {
|
|
93
|
-
return renderTaskPromise;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
renderTaskPromise = new Promise(resolve => {
|
|
97
|
-
renderTaskPromiseResolve = resolve;
|
|
98
|
-
window.requestAnimationFrame(() => {
|
|
99
|
-
if (invalidatedWebComponents.isEmpty()) {
|
|
100
|
-
renderTaskPromise = undefined;
|
|
101
|
-
resolve();
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
return renderTaskPromise;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
static whenAllCustomElementsAreDefined() {
|
|
110
|
-
const definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));
|
|
111
|
-
return Promise.all(definedPromises);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
38
|
static async whenFinished() {
|
|
115
|
-
|
|
116
|
-
await
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
static _resolveTaskPromise() {
|
|
120
|
-
if (!invalidatedWebComponents.isEmpty()) {
|
|
121
|
-
// More updates are pending. Resolve will be called again
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (renderTaskPromiseResolve) {
|
|
126
|
-
renderTaskPromiseResolve.call(this);
|
|
127
|
-
renderTaskPromiseResolve = undefined;
|
|
128
|
-
renderTaskPromise = undefined;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
static register(element) {
|
|
133
|
-
registeredElements.add(element);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
static deregister(element) {
|
|
137
|
-
registeredElements.delete(element);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.
|
|
142
|
-
*
|
|
143
|
-
* Usage:
|
|
144
|
-
* reRenderAllUI5Elements() -> rerenders all components
|
|
145
|
-
* reRenderAllUI5Elements({tag: "ui5-button"}) -> re-renders only instances of ui5-button
|
|
146
|
-
* reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components
|
|
147
|
-
* reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components
|
|
148
|
-
* reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware
|
|
149
|
-
* etc...
|
|
150
|
-
*
|
|
151
|
-
* @public
|
|
152
|
-
* @param {Object|undefined} filters - Object with keys that can be "rtlAware" or "languageAware"
|
|
153
|
-
*/
|
|
154
|
-
static reRenderAllUI5Elements(filters) {
|
|
155
|
-
registeredElements.forEach(element => {
|
|
156
|
-
const tag = element.constructor.getMetadata().getTag();
|
|
157
|
-
const rtlAware = isRtlAware(element.constructor);
|
|
158
|
-
const languageAware = element.constructor.getMetadata().isLanguageAware();
|
|
159
|
-
if (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware)) {
|
|
160
|
-
RenderScheduler.renderDeferred(element);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
39
|
+
console.log("RenderScheduler.whenFinished is deprecated, please use renderFinished, exported by Render.js instead"); // eslint-disable-line
|
|
40
|
+
await renderFinished();
|
|
163
41
|
}
|
|
164
42
|
}
|
|
165
43
|
|
package/dist/StaticArea.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
import getSingletonElementInstance from "./util/getSingletonElementInstance.js";
|
|
2
|
-
|
|
3
|
-
const getStaticAreaInstance = () => getSingletonElementInstance("ui5-static-area");
|
|
4
|
-
|
|
5
|
-
const removeStaticArea = () => {
|
|
6
|
-
getStaticAreaInstance().destroy();
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
class StaticAreaElement extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
get isUI5Element() {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
destroy() {
|
|
19
|
-
const staticAreaDomRef = document.querySelector(this.tagName.toLowerCase());
|
|
20
|
-
staticAreaDomRef.parentElement.removeChild(staticAreaDomRef);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
1
|
if (!customElements.get("ui5-static-area")) {
|
|
25
|
-
customElements.define("ui5-static-area",
|
|
2
|
+
customElements.define("ui5-static-area", class extends HTMLElement {});
|
|
26
3
|
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
getStaticAreaInstance,
|
|
30
|
-
removeStaticArea,
|
|
31
|
-
};
|
package/dist/StaticAreaItem.js
CHANGED
|
@@ -1,80 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
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";
|
|
5
7
|
|
|
6
8
|
/**
|
|
9
|
+
*
|
|
7
10
|
* @class
|
|
8
11
|
* @author SAP SE
|
|
9
12
|
* @private
|
|
10
|
-
* Defines and takes care of ui5-static-are-item items
|
|
11
13
|
*/
|
|
12
|
-
class StaticAreaItem {
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
14
|
+
class StaticAreaItem extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
15
17
|
this._rendered = false;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isRendered() {
|
|
19
|
-
return this._rendered;
|
|
18
|
+
this.attachShadow({ mode: "open" });
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* @protected
|
|
23
|
+
* @param ownerElement The UI5Element instance that owns this static area item
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!this.staticAreaItemDomRef) {
|
|
30
|
-
// Initial rendering of fragment
|
|
31
|
-
|
|
32
|
-
this.staticAreaItemDomRef = document.createElement("ui5-static-area-item");
|
|
33
|
-
this.staticAreaItemDomRef.attachShadow({ mode: "open" });
|
|
34
|
-
this.staticAreaItemDomRef.classList.add(this.ui5ElementContext._id); // used for getting the popover in the tests
|
|
35
|
-
|
|
36
|
-
getStaticAreaInstance().appendChild(this.staticAreaItemDomRef);
|
|
37
|
-
this._rendered = true;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this._updateContentDensity(this.ui5ElementContext.isCompact);
|
|
41
|
-
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
|
|
42
28
|
}
|
|
43
29
|
|
|
44
30
|
/**
|
|
31
|
+
* Updates the shadow root of the static area item with the latest state, if rendered
|
|
45
32
|
* @protected
|
|
46
33
|
*/
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const staticArea = getStaticAreaInstance();
|
|
53
|
-
|
|
54
|
-
staticArea.removeChild(this.staticAreaItemDomRef);
|
|
55
|
-
|
|
56
|
-
this.staticAreaItemDomRef = null;
|
|
57
|
-
|
|
58
|
-
// remove static area
|
|
59
|
-
if (staticArea.childElementCount < 1) {
|
|
60
|
-
removeStaticArea();
|
|
34
|
+
update() {
|
|
35
|
+
if (this._rendered) {
|
|
36
|
+
this._updateContentDensity();
|
|
37
|
+
this._updateDirection();
|
|
38
|
+
updateShadowRoot(this.ownerElement, true);
|
|
61
39
|
}
|
|
62
40
|
}
|
|
63
41
|
|
|
64
42
|
/**
|
|
65
|
-
*
|
|
43
|
+
* Sets the correct content density based on the owner element's state
|
|
44
|
+
* @private
|
|
66
45
|
*/
|
|
67
|
-
_updateContentDensity(
|
|
68
|
-
if (
|
|
69
|
-
|
|
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");
|
|
70
53
|
}
|
|
54
|
+
}
|
|
71
55
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
_updateDirection() {
|
|
57
|
+
const dir = getEffectiveDir(this.ownerElement);
|
|
58
|
+
if (dir) {
|
|
59
|
+
this.setAttribute("dir", dir);
|
|
75
60
|
} else {
|
|
76
|
-
this.
|
|
77
|
-
this.staticAreaItemDomRef.classList.remove("ui5-content-density-compact");
|
|
61
|
+
this.removeAttribute("dir");
|
|
78
62
|
}
|
|
79
63
|
}
|
|
80
64
|
|
|
@@ -83,26 +67,41 @@ class StaticAreaItem {
|
|
|
83
67
|
* Returns reference to the DOM element where the current fragment is added.
|
|
84
68
|
*/
|
|
85
69
|
async getDomRef() {
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
this._updateContentDensity();
|
|
71
|
+
if (!this._rendered) {
|
|
72
|
+
this._rendered = true;
|
|
73
|
+
updateShadowRoot(this.ownerElement, true);
|
|
88
74
|
}
|
|
89
|
-
await
|
|
90
|
-
return this.
|
|
75
|
+
await renderFinished(); // Wait for the content of the ui5-static-area-item to be rendered
|
|
76
|
+
return this.shadowRoot;
|
|
91
77
|
}
|
|
92
|
-
}
|
|
93
78
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
/**
|
|
80
|
+
* @protected
|
|
81
|
+
* @param refName
|
|
82
|
+
* @returns {Element}
|
|
83
|
+
*/
|
|
84
|
+
getStableDomRef(refName) {
|
|
85
|
+
return this.shadowRoot.querySelector(`[data-ui5-stable=${refName}]`);
|
|
97
86
|
}
|
|
98
87
|
|
|
99
|
-
|
|
100
|
-
|
|
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}`;
|
|
101
96
|
}
|
|
102
|
-
}
|
|
103
97
|
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
static createInstance() {
|
|
99
|
+
if (!customElements.get(StaticAreaItem.getTag())) {
|
|
100
|
+
customElements.define(StaticAreaItem.getTag(), StaticAreaItem);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return document.createElement(this.getTag());
|
|
104
|
+
}
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
export default StaticAreaItem;
|
package/dist/Theming.js
CHANGED