@ui5/webcomponents-base 0.0.0-6895c16dd → 0.0.0-6cb3eb0db
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 +39 -0
- package/README.md +26 -1
- package/bundle.esm.js +5 -0
- package/dist/Boot.js +15 -20
- package/dist/Device.js +2 -0
- package/dist/EventProvider.js +19 -25
- package/dist/InitialConfiguration.js +20 -15
- package/dist/Keys.js +15 -0
- package/dist/MediaRange.js +0 -1
- package/dist/Render.js +0 -1
- package/dist/StaticArea.js +3 -0
- package/dist/StaticAreaItem.js +30 -3
- package/dist/UI5Element.js +37 -43
- package/dist/UI5ElementMetadata.js +1 -1
- package/dist/asset-registries/Icons.js +10 -0
- package/dist/asset-registries/Illustrations.js +30 -0
- package/dist/delegate/ItemNavigation.js +66 -0
- package/dist/delegate/ScrollEnablement.js +7 -1
- package/dist/features/OpenUI5Support.js +41 -6
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/i18nBundle.js +4 -0
- package/dist/renderer/LitRenderer.js +19 -18
- package/dist/resources/bundle.esm.js +17 -101
- 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/elements/WithStaticArea.js +2 -1
- package/dist/test-resources/pages/AllTestElements.html +3 -0
- 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 +6 -4
- 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 +30 -28
- package/dist/test-resources/specs/UI5ElementLifecycle.js +12 -10
- package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +12 -10
- 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/types/DataType.js +12 -0
- package/dist/types/Float.js +4 -0
- package/dist/types/Integer.js +4 -0
- package/dist/types/InvisibleMessageMode.js +30 -0
- package/dist/updateShadowRoot.js +1 -1
- package/dist/util/AriaLabelHelper.js +4 -4
- package/dist/util/FocusableElements.js +5 -1
- package/dist/util/HTMLSanitizer.js +7 -0
- package/dist/util/InvisibleMessage.js +58 -0
- package/dist/util/PopupUtils.js +93 -0
- package/dist/util/TabbableElements.js +1 -1
- package/dist/util/clamp.js +12 -0
- package/dist/util/getClassCopy.js +10 -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 +30 -14
- package/package.json +20 -9
- package/src/Boot.js +15 -20
- package/src/Device.js +2 -0
- package/src/EventProvider.js +19 -25
- package/src/InitialConfiguration.js +20 -15
- package/src/Keys.js +15 -0
- package/src/MediaRange.js +0 -1
- package/src/Render.js +0 -1
- package/src/StaticArea.js +3 -0
- package/src/StaticAreaItem.js +30 -3
- package/src/UI5Element.js +37 -43
- package/src/UI5ElementMetadata.js +1 -1
- package/src/asset-registries/Icons.js +10 -0
- package/src/asset-registries/Illustrations.js +30 -0
- package/src/delegate/ItemNavigation.js +66 -0
- package/src/delegate/ScrollEnablement.js +7 -1
- package/src/features/OpenUI5Support.js +41 -6
- package/src/i18nBundle.js +4 -0
- package/src/renderer/LitRenderer.js +19 -18
- package/src/types/DataType.js +12 -0
- package/src/types/Float.js +4 -0
- package/src/types/Integer.js +4 -0
- package/src/types/InvisibleMessageMode.js +30 -0
- package/src/updateShadowRoot.js +1 -1
- package/src/util/AriaLabelHelper.js +4 -4
- package/src/util/FocusableElements.js +5 -1
- package/src/util/HTMLSanitizer.js +7 -0
- package/src/util/InvisibleMessage.js +58 -0
- package/src/util/PopupUtils.js +93 -0
- package/src/util/TabbableElements.js +1 -1
- package/src/util/clamp.js +12 -0
- package/src/util/getClassCopy.js +10 -0
- package/src/util/isElementInView.js +15 -0
- package/src/util/isNodeTabbable.js +4 -4
- package/used-modules.txt +7 -0
- package/dist/config/AssetsPath.js +0 -17
- package/dist/renderer/ifDefined.js +0 -21
- package/dist/renderer/scopeHTML.js +0 -32
- package/src/config/AssetsPath.js +0 -17
- package/src/renderer/ifDefined.js +0 -21
- package/src/renderer/scopeHTML.js +0 -32
|
@@ -17,7 +17,7 @@ const getTabbables = (nodes, tabbables) => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
Array.from(nodes).forEach(currentNode => {
|
|
20
|
-
if (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {
|
|
20
|
+
if (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE || currentNode.hasAttribute("data-sap-no-tab-ref")) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a value clamped between an upper bound 'max' and lower bound 'min'.
|
|
3
|
+
* @param {number} val value
|
|
4
|
+
* @param {number} min lower bound
|
|
5
|
+
* @param {number} max upper bound
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
const clamp = (val, min, max) => {
|
|
9
|
+
return Math.min(Math.max(val, min), max);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default clamp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if the element is within the viewport.
|
|
3
|
+
* @param el {HTMLElement}
|
|
4
|
+
*/
|
|
5
|
+
const isElementInView = el => {
|
|
6
|
+
const rect = el.getBoundingClientRect();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
rect.top >= 0 && rect.left >= 0
|
|
10
|
+
&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)
|
|
11
|
+
&& rect.right <= (window.innerWidth || document.documentElement.clientWidth)
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default isElementInView;
|
|
@@ -15,14 +15,14 @@ const isNodeTabbable = node => {
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
|
|
19
|
-
return !node.disabled;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
const tabIndex = node.getAttribute("tabindex");
|
|
23
19
|
if (tabIndex !== null && tabIndex !== undefined) {
|
|
24
20
|
return parseInt(tabIndex) >= 0;
|
|
25
21
|
}
|
|
22
|
+
|
|
23
|
+
if (nodeName === "a" || /input|select|textarea|button|object/.test(nodeName)) {
|
|
24
|
+
return !node.disabled;
|
|
25
|
+
}
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export default isNodeTabbable;
|
package/hash.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rdDAWx+4D0PvEdxuBB9NMlHEXYo=
|
package/index.js
CHANGED
package/package-scripts.js
CHANGED
|
@@ -1,23 +1,42 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
1
|
const resolve = require("resolve");
|
|
3
2
|
|
|
4
|
-
const serveConfig = `../tools/components-package/serve.json`;
|
|
5
|
-
const port = `9191`;
|
|
6
|
-
|
|
7
3
|
const assetParametersScript = resolve.sync("@ui5/webcomponents-base/lib/generate-asset-parameters/index.js");
|
|
4
|
+
const serve = resolve.sync("@ui5/webcomponents-tools/lib/serve/index.js");
|
|
5
|
+
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
|
6
|
+
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
|
7
|
+
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
|
8
|
+
const replaceGlobalCore = resolve.sync("@ui5/webcomponents-tools/lib/replace-global-core/index.js");
|
|
9
|
+
const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/index.js");
|
|
10
|
+
const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
|
|
8
11
|
|
|
9
12
|
const scripts = {
|
|
10
|
-
clean: "rimraf dist",
|
|
13
|
+
clean: "rimraf dist && rimraf .port",
|
|
11
14
|
lint: "eslint . --config config/.eslintrc.js",
|
|
12
|
-
prepare: "nps clean copy generateAssetParameters",
|
|
15
|
+
prepare: "nps clean integrate copy generateAssetParameters",
|
|
16
|
+
integrate: {
|
|
17
|
+
default: "nps integrate.copy-used-modules integrate.copy-overlay integrate.replace-amd integrate.replace-export-true integrate.replace-export-false integrate.amd-to-es6 integrate.replace-global-core-usage integrate.esm-abs-to-rel integrate.third-party",
|
|
18
|
+
"copy-used-modules": `node "${copyUsedModules}" ./used-modules.txt dist/`,
|
|
19
|
+
"copy-overlay": `copy-and-watch "overlay/**/*.js" dist/`,
|
|
20
|
+
"replace-amd": "replace-in-file sap.ui.define define dist/**/*.js",
|
|
21
|
+
"replace-export-true": `replace-in-file ", /* bExport= */ true" "" dist/**/*.js`,
|
|
22
|
+
"replace-export-false": `replace-in-file ", /* bExport= */ false" "" dist/**/*.js`,
|
|
23
|
+
"amd-to-es6": "amdtoes6 --src=dist/ --replace --glob=**/*.js",
|
|
24
|
+
"replace-global-core-usage": `node "${replaceGlobalCore}" dist/`,
|
|
25
|
+
"esm-abs-to-rel": `node "${esmAbsToRel}" dist/ dist/`,
|
|
26
|
+
"third-party": {
|
|
27
|
+
default: "nps integrate.third-party.copy integrate.third-party.fix",
|
|
28
|
+
copy: "mkdirp dist/sap/ui/thirdparty/ && copy-and-watch ../../node_modules/@openui5/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js dist/sap/ui/thirdparty/",
|
|
29
|
+
fix: "replace-in-file 240 xA0 dist/sap/ui/thirdparty/caja-html-sanitizer.js"
|
|
30
|
+
},
|
|
31
|
+
},
|
|
13
32
|
build: {
|
|
14
|
-
default:
|
|
33
|
+
default: `${UP_TO_DATE} || nps lint prepare build.bundle hash`,
|
|
15
34
|
bundle: "rollup --config config/rollup.config.js",
|
|
16
35
|
},
|
|
17
36
|
copy: {
|
|
18
37
|
default: "nps copy.src copy.test",
|
|
19
|
-
src:
|
|
20
|
-
test:
|
|
38
|
+
src: `copy-and-watch "src/**/*.js" dist/`,
|
|
39
|
+
test: `copy-and-watch "test/**/*.*" dist/test-resources`,
|
|
21
40
|
},
|
|
22
41
|
generateAssetParameters: `node "${assetParametersScript}"`,
|
|
23
42
|
watch: {
|
|
@@ -28,16 +47,13 @@ const scripts = {
|
|
|
28
47
|
},
|
|
29
48
|
dev: 'concurrently "nps serve" "nps watch"',
|
|
30
49
|
start: "nps prepare dev",
|
|
31
|
-
serve: {
|
|
32
|
-
default: "nps serve.prepare serve.run",
|
|
33
|
-
prepare: `copy-and-watch "${serveConfig}" dist/`,
|
|
34
|
-
run: `serve --no-clipboard -l ${port} dist`,
|
|
35
|
-
},
|
|
50
|
+
serve: `node "${serve}" --dir="dist/" --port=9191 --packageName="@ui5/webcomponents-base"`,
|
|
36
51
|
test: {
|
|
37
52
|
// --success first - report the exit code of the test run (first command to finish), as serve is always terminated and has a non-0 exit code
|
|
38
53
|
default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
|
|
39
54
|
run: "cross-env WDIO_LOG_LEVEL=error FORCE_COLOR=0 wdio config/wdio.conf.js",
|
|
40
55
|
},
|
|
56
|
+
hash: `node "${generateHash}" dist/ hash.txt`,
|
|
41
57
|
};
|
|
42
58
|
|
|
43
59
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-6cb3eb0db",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -15,25 +15,36 @@
|
|
|
15
15
|
"url": "https://github.com/SAP/ui5-webcomponents.git",
|
|
16
16
|
"directory": "packages/base"
|
|
17
17
|
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./index.js",
|
|
20
|
+
"./dist/*": "./dist/*",
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
"./bundle.esm.js": "./bundle.esm.js",
|
|
23
|
+
"./*": "./dist/*"
|
|
24
|
+
},
|
|
18
25
|
"scripts": {
|
|
19
26
|
"clean": "nps clean",
|
|
20
27
|
"lint": "nps lint",
|
|
21
28
|
"start": "nps start",
|
|
22
29
|
"build": "nps build",
|
|
23
30
|
"test": "nps test",
|
|
31
|
+
"hash": "nps hash",
|
|
24
32
|
"prepublishOnly": "npm run clean && npm run build"
|
|
25
33
|
},
|
|
26
34
|
"dependencies": {
|
|
27
|
-
"lit-html": "
|
|
35
|
+
"lit-html": "2.0.0"
|
|
28
36
|
},
|
|
29
37
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
38
|
+
"@buxlabs/amd-to-es6": "0.16.1",
|
|
39
|
+
"@openui5/sap.ui.core": "1.94.0",
|
|
40
|
+
"@ui5/webcomponents-tools": "0.0.0-6cb3eb0db",
|
|
41
|
+
"array-uniq": "^3.0.0",
|
|
42
|
+
"chromedriver": "94.0.0",
|
|
43
|
+
"copy-and-watch": "^0.1.5",
|
|
44
|
+
"eslint": "^7.22.0",
|
|
45
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
36
46
|
"npm-run-all": "^4.1.5",
|
|
37
|
-
"path-exists-cli": "^
|
|
47
|
+
"path-exists-cli": "^2.0.0",
|
|
48
|
+
"replace-in-file": "^6.2.0"
|
|
38
49
|
}
|
|
39
50
|
}
|
package/src/Boot.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getTheme } from "./config/Theme.js";
|
|
|
6
6
|
import applyTheme from "./theming/applyTheme.js";
|
|
7
7
|
import { getFeature } from "./FeaturesRegistry.js";
|
|
8
8
|
|
|
9
|
-
let
|
|
9
|
+
let booted = false;
|
|
10
10
|
const eventProvider = new EventProvider();
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -18,28 +18,23 @@ const attachBoot = listener => {
|
|
|
18
18
|
eventProvider.attachEvent("boot", listener);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const boot = () => {
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
21
|
+
const boot = async () => {
|
|
22
|
+
if (booted) {
|
|
23
|
+
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
await whenDOMReady();
|
|
33
|
-
await applyTheme(getTheme());
|
|
34
|
-
OpenUI5Support && OpenUI5Support.attachListeners();
|
|
35
|
-
insertFontFace();
|
|
36
|
-
insertSystemCSSVars();
|
|
37
|
-
await eventProvider.fireEventAsync("boot");
|
|
38
|
-
|
|
39
|
-
resolve();
|
|
40
|
-
});
|
|
26
|
+
const OpenUI5Support = getFeature("OpenUI5Support");
|
|
27
|
+
if (OpenUI5Support) {
|
|
28
|
+
await OpenUI5Support.init();
|
|
29
|
+
}
|
|
41
30
|
|
|
42
|
-
|
|
31
|
+
await whenDOMReady();
|
|
32
|
+
await applyTheme(getTheme());
|
|
33
|
+
OpenUI5Support && OpenUI5Support.attachListeners();
|
|
34
|
+
insertFontFace();
|
|
35
|
+
insertSystemCSSVars();
|
|
36
|
+
await eventProvider.fireEventAsync("boot");
|
|
37
|
+
booted = true;
|
|
43
38
|
};
|
|
44
39
|
|
|
45
40
|
export {
|
package/src/Device.js
CHANGED
|
@@ -75,6 +75,7 @@ const detectTablet = () => {
|
|
|
75
75
|
const supportsTouch = () => touch;
|
|
76
76
|
const isIE = () => ie;
|
|
77
77
|
const isSafari = () => safari;
|
|
78
|
+
const isChrome = () => chrome;
|
|
78
79
|
|
|
79
80
|
const isTablet = () => {
|
|
80
81
|
detectTablet();
|
|
@@ -94,6 +95,7 @@ export {
|
|
|
94
95
|
supportsTouch,
|
|
95
96
|
isIE,
|
|
96
97
|
isSafari,
|
|
98
|
+
isChrome,
|
|
97
99
|
isPhone,
|
|
98
100
|
isTablet,
|
|
99
101
|
isDesktop,
|
package/src/EventProvider.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
class EventProvider {
|
|
2
2
|
constructor() {
|
|
3
|
-
this._eventRegistry =
|
|
3
|
+
this._eventRegistry = new Map();
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
attachEvent(eventName, fnFunction) {
|
|
7
7
|
const eventRegistry = this._eventRegistry;
|
|
8
|
-
|
|
8
|
+
const eventListeners = eventRegistry.get(eventName);
|
|
9
9
|
|
|
10
10
|
if (!Array.isArray(eventListeners)) {
|
|
11
|
-
eventRegistry
|
|
12
|
-
|
|
11
|
+
eventRegistry.set(eventName, [fnFunction]);
|
|
12
|
+
return;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
eventListeners.
|
|
16
|
-
|
|
17
|
-
}
|
|
15
|
+
if (!eventListeners.includes(fnFunction)) {
|
|
16
|
+
eventListeners.push(fnFunction);
|
|
17
|
+
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
detachEvent(eventName, fnFunction) {
|
|
21
21
|
const eventRegistry = this._eventRegistry;
|
|
22
|
-
|
|
22
|
+
const eventListeners = eventRegistry.get(eventName);
|
|
23
23
|
|
|
24
24
|
if (!eventListeners) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
+
const indexOfFnToDetach = eventListeners.indexOf(fnFunction);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
29
|
+
if (indexOfFnToDetach !== -1) {
|
|
30
|
+
eventListeners.splice(indexOfFnToDetach, 1);
|
|
31
|
+
}
|
|
31
32
|
|
|
32
33
|
if (eventListeners.length === 0) {
|
|
33
|
-
delete
|
|
34
|
+
eventRegistry.delete(eventName);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -43,14 +44,14 @@ class EventProvider {
|
|
|
43
44
|
*/
|
|
44
45
|
fireEvent(eventName, data) {
|
|
45
46
|
const eventRegistry = this._eventRegistry;
|
|
46
|
-
const eventListeners = eventRegistry
|
|
47
|
+
const eventListeners = eventRegistry.get(eventName);
|
|
47
48
|
|
|
48
49
|
if (!eventListeners) {
|
|
49
50
|
return [];
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
return eventListeners.map(
|
|
53
|
-
return
|
|
53
|
+
return eventListeners.map(fn => {
|
|
54
|
+
return fn.call(this, data); // eslint-disable-line
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -67,24 +68,17 @@ class EventProvider {
|
|
|
67
68
|
|
|
68
69
|
isHandlerAttached(eventName, fnFunction) {
|
|
69
70
|
const eventRegistry = this._eventRegistry;
|
|
70
|
-
const eventListeners = eventRegistry
|
|
71
|
+
const eventListeners = eventRegistry.get(eventName);
|
|
71
72
|
|
|
72
73
|
if (!eventListeners) {
|
|
73
74
|
return false;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
const event = eventListeners[i];
|
|
78
|
-
if (event["function"] === fnFunction) { // eslint-disable-line
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return false;
|
|
77
|
+
return eventListeners.includes(fnFunction);
|
|
84
78
|
}
|
|
85
79
|
|
|
86
80
|
hasListeners(eventName) {
|
|
87
|
-
return !!this._eventRegistry
|
|
81
|
+
return !!this._eventRegistry.get(eventName);
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
|
|
@@ -13,7 +13,6 @@ let initialConfig = {
|
|
|
13
13
|
noConflict: false, // no URL
|
|
14
14
|
formatSettings: {},
|
|
15
15
|
fetchDefaultLanguage: false,
|
|
16
|
-
assetsPath: "",
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
/* General settings */
|
|
@@ -62,11 +61,6 @@ const getFormatSettings = () => {
|
|
|
62
61
|
return initialConfig.formatSettings;
|
|
63
62
|
};
|
|
64
63
|
|
|
65
|
-
const getAssetsPath = () => {
|
|
66
|
-
initConfiguration();
|
|
67
|
-
return initialConfig.assetsPath;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
64
|
const booleanMapping = new Map();
|
|
71
65
|
booleanMapping.set("true", true);
|
|
72
66
|
booleanMapping.set("false", false);
|
|
@@ -92,23 +86,36 @@ const parseConfigurationScript = () => {
|
|
|
92
86
|
const parseURLParameters = () => {
|
|
93
87
|
const params = new URLSearchParams(window.location.search);
|
|
94
88
|
|
|
89
|
+
// Process "sap-*" params first
|
|
95
90
|
params.forEach((value, key) => {
|
|
96
|
-
|
|
91
|
+
const parts = key.split("sap-").length;
|
|
92
|
+
if (parts === 0 || parts === key.split("sap-ui-").length) {
|
|
97
93
|
return;
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const param = key.split("sap-ui-")[1];
|
|
96
|
+
applyURLParam(key, value, "sap");
|
|
97
|
+
});
|
|
103
98
|
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
// Process "sap-ui-*" params
|
|
100
|
+
params.forEach((value, key) => {
|
|
101
|
+
if (!key.startsWith("sap-ui")) {
|
|
102
|
+
return;
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
applyURLParam(key, value, "sap-ui");
|
|
109
106
|
});
|
|
110
107
|
};
|
|
111
108
|
|
|
109
|
+
const applyURLParam = (key, value, paramType) => {
|
|
110
|
+
const lowerCaseValue = value.toLowerCase();
|
|
111
|
+
const param = key.split(`${paramType}-`)[1];
|
|
112
|
+
|
|
113
|
+
if (booleanMapping.has(value)) {
|
|
114
|
+
value = booleanMapping.get(lowerCaseValue);
|
|
115
|
+
}
|
|
116
|
+
initialConfig[param] = value;
|
|
117
|
+
};
|
|
118
|
+
|
|
112
119
|
const applyOpenUI5Configuration = () => {
|
|
113
120
|
const OpenUI5Support = getFeature("OpenUI5Support");
|
|
114
121
|
if (!OpenUI5Support || !OpenUI5Support.isLoaded()) {
|
|
@@ -119,7 +126,6 @@ const applyOpenUI5Configuration = () => {
|
|
|
119
126
|
initialConfig = merge(initialConfig, OpenUI5Config);
|
|
120
127
|
};
|
|
121
128
|
|
|
122
|
-
|
|
123
129
|
const initConfiguration = () => {
|
|
124
130
|
if (initialized) {
|
|
125
131
|
return;
|
|
@@ -146,5 +152,4 @@ export {
|
|
|
146
152
|
getNoConflict,
|
|
147
153
|
getCalendarType,
|
|
148
154
|
getFormatSettings,
|
|
149
|
-
getAssetsPath,
|
|
150
155
|
};
|
package/src/Keys.js
CHANGED
|
@@ -131,6 +131,10 @@ const isUpShift = event => (event.key ? (event.key === "ArrowUp" || event.key ==
|
|
|
131
131
|
|
|
132
132
|
const isDownShift = event => (event.key ? (event.key === "ArrowDown" || event.key === "Down") : event.keyCode === KeyCodes.ARROW_DOWN) && checkModifierKeys(event, false, false, true);
|
|
133
133
|
|
|
134
|
+
const isLeftShift = event => (event.key ? (event.key === "ArrowLeft" || event.key === "Left") : event.keyCode === KeyCodes.ARROW_LEFT) && checkModifierKeys(event, false, false, true);
|
|
135
|
+
|
|
136
|
+
const isRightShift = event => (event.key ? (event.key === "ArrowRight" || event.key === "Right") : event.keyCode === KeyCodes.ARROW_RIGHT) && checkModifierKeys(event, false, false, true);
|
|
137
|
+
|
|
134
138
|
const isUpShiftCtrl = event => (event.key ? (event.key === "ArrowUp" || event.key === "Up") : event.keyCode === KeyCodes.ARROW_UP) && checkModifierKeys(event, true, false, true);
|
|
135
139
|
|
|
136
140
|
const isDownShiftCtrl = event => (event.key ? (event.key === "ArrowDown" || event.key === "Down") : event.keyCode === KeyCodes.ARROW_DOWN) && checkModifierKeys(event, true, false, true);
|
|
@@ -159,8 +163,12 @@ const isPageDown = event => (event.key ? event.key === "PageDown" : event.keyCod
|
|
|
159
163
|
|
|
160
164
|
const isPageUpShift = event => (event.key ? event.key === "PageUp" : event.keyCode === KeyCodes.PAGE_UP) && checkModifierKeys(event, false, false, true);
|
|
161
165
|
|
|
166
|
+
const isPageUpAlt = event => (event.key ? event.key === "PageUp" : event.keyCode === KeyCodes.PAGE_UP) && checkModifierKeys(event, false, true, false);
|
|
167
|
+
|
|
162
168
|
const isPageDownShift = event => (event.key ? event.key === "PageDown" : event.keyCode === KeyCodes.PAGE_DOWN) && checkModifierKeys(event, false, false, true);
|
|
163
169
|
|
|
170
|
+
const isPageDownAlt = event => (event.key ? event.key === "PageDown" : event.keyCode === KeyCodes.PAGE_DOWN) && checkModifierKeys(event, false, true, false);
|
|
171
|
+
|
|
164
172
|
const isPageUpShiftCtrl = event => (event.key ? event.key === "PageUp" : event.keyCode === KeyCodes.PAGE_UP) && checkModifierKeys(event, true, false, true);
|
|
165
173
|
|
|
166
174
|
const isPageDownShiftCtrl = event => (event.key ? event.key === "PageDown" : event.keyCode === KeyCodes.PAGE_DOWN) && checkModifierKeys(event, true, false, true);
|
|
@@ -183,6 +191,8 @@ const isF4 = event => {
|
|
|
183
191
|
|
|
184
192
|
const isF4Shift = event => (event.key ? event.key === "F4" : event.keyCode === KeyCodes.F4) && checkModifierKeys(event, false, false, true);
|
|
185
193
|
|
|
194
|
+
const isF7 = event => (event.key ? event.key === "F7" : event.keyCode === KeyCodes.F7) && !hasModifierKeys(event);
|
|
195
|
+
|
|
186
196
|
const isShowByArrows = event => {
|
|
187
197
|
return ((event.key === "ArrowDown" || event.key === "Down") || (event.key === "ArrowUp" || event.key === "Up")) && checkModifierKeys(event, /* Ctrl */ false, /* Alt */ true, /* Shift */ false);
|
|
188
198
|
};
|
|
@@ -208,6 +218,8 @@ export {
|
|
|
208
218
|
isDownCtrl,
|
|
209
219
|
isUpShift,
|
|
210
220
|
isDownShift,
|
|
221
|
+
isLeftShift,
|
|
222
|
+
isRightShift,
|
|
211
223
|
isUpShiftCtrl,
|
|
212
224
|
isDownShiftCtrl,
|
|
213
225
|
isHome,
|
|
@@ -224,10 +236,13 @@ export {
|
|
|
224
236
|
isShow,
|
|
225
237
|
isF4,
|
|
226
238
|
isF4Shift,
|
|
239
|
+
isF7,
|
|
227
240
|
isPageUp,
|
|
228
241
|
isPageDown,
|
|
229
242
|
isPageUpShift,
|
|
243
|
+
isPageUpAlt,
|
|
230
244
|
isPageDownShift,
|
|
245
|
+
isPageDownAlt,
|
|
231
246
|
isPageUpShiftCtrl,
|
|
232
247
|
isPageDownShiftCtrl,
|
|
233
248
|
};
|
package/src/MediaRange.js
CHANGED
package/src/Render.js
CHANGED
package/src/StaticAreaItem.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import "./StaticArea.js";
|
|
1
2
|
import updateShadowRoot from "./updateShadowRoot.js";
|
|
2
3
|
import { renderFinished } from "./Render.js";
|
|
3
4
|
import getEffectiveContentDensity from "./util/getEffectiveContentDensity.js";
|
|
5
|
+
import { getEffectiveScopingSuffixForTag } from "./CustomElementsScope.js";
|
|
6
|
+
import getEffectiveDir from "./locale/getEffectiveDir.js";
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
*
|
|
@@ -31,6 +34,7 @@ class StaticAreaItem extends HTMLElement {
|
|
|
31
34
|
update() {
|
|
32
35
|
if (this._rendered) {
|
|
33
36
|
this._updateContentDensity();
|
|
37
|
+
this._updateDirection();
|
|
34
38
|
updateShadowRoot(this.ownerElement, true);
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -49,6 +53,15 @@ class StaticAreaItem extends HTMLElement {
|
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
56
|
+
_updateDirection() {
|
|
57
|
+
const dir = getEffectiveDir(this.ownerElement);
|
|
58
|
+
if (dir) {
|
|
59
|
+
this.setAttribute("dir", dir);
|
|
60
|
+
} else {
|
|
61
|
+
this.removeAttribute("dir");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
52
65
|
/**
|
|
53
66
|
* @protected
|
|
54
67
|
* Returns reference to the DOM element where the current fragment is added.
|
|
@@ -71,10 +84,24 @@ class StaticAreaItem extends HTMLElement {
|
|
|
71
84
|
getStableDomRef(refName) {
|
|
72
85
|
return this.shadowRoot.querySelector(`[data-ui5-stable=${refName}]`);
|
|
73
86
|
}
|
|
74
|
-
}
|
|
75
87
|
|
|
76
|
-
|
|
77
|
-
|
|
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}`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static createInstance() {
|
|
99
|
+
if (!customElements.get(StaticAreaItem.getTag())) {
|
|
100
|
+
customElements.define(StaticAreaItem.getTag(), StaticAreaItem);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return document.createElement(this.getTag());
|
|
104
|
+
}
|
|
78
105
|
}
|
|
79
106
|
|
|
80
107
|
export default StaticAreaItem;
|