@ui5/webcomponents-base 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +27 -6
- package/bundle.esm.js +7 -9
- package/dist/CustomElementsRegistry.js +1 -1
- package/dist/asset-registries/LocaleData.js +1 -1
- package/dist/asset-registries/Themes.js +6 -2
- package/dist/asset-registries/i18n.js +3 -1
- package/dist/assets/bundle.esm.a812dc7f.js +43 -0
- package/dist/css/BusyIndicator.css +4 -0
- package/dist/css/FontFace.css +16 -16
- package/dist/delegate/ItemNavigation.js +9 -4
- package/dist/features/F6Navigation.js +4 -2
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/css/BusyIndicator.css.js +1 -1
- package/dist/generated/css/FontFace.css.js +1 -1
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/dist/updateShadowRoot.js +1 -2
- package/dist/util/Caret.js +1 -14
- package/dist/util/isDefaultSlotProvided.js +11 -0
- package/hash.txt +1 -1
- package/lib/generate-asset-parameters/index.js +8 -4
- package/lib/generate-styles/index.js +17 -9
- package/lib/generate-version-info/index.js +18 -13
- package/package-scripts.js +15 -21
- package/package.json +7 -6
- package/src/CustomElementsRegistry.js +1 -1
- package/src/asset-registries/LocaleData.js +1 -1
- package/src/asset-registries/Themes.js +6 -2
- package/src/asset-registries/i18n.js +3 -1
- package/src/css/BusyIndicator.css +4 -0
- package/src/css/FontFace.css +16 -16
- package/src/delegate/ItemNavigation.js +9 -4
- package/src/features/F6Navigation.js +4 -2
- package/src/updateShadowRoot.js +1 -2
- package/src/util/Caret.js +1 -14
- package/src/util/isDefaultSlotProvided.js +11 -0
- package/config/.eslintrc.js +0 -3
- package/config/rollup.config.js +0 -1
- package/dist/isLegacyBrowser.js +0 -3
- package/dist/resources/bundle.esm.js +0 -32
- package/dist/resources/bundle.esm.js.map +0 -1
- package/dist/test-resources/assets/Themes.js +0 -17
- package/dist/test-resources/elements/Child.js +0 -35
- package/dist/test-resources/elements/Generic.js +0 -84
- package/dist/test-resources/elements/GenericExt.js +0 -26
- package/dist/test-resources/elements/NoShadowDOM.js +0 -13
- package/dist/test-resources/elements/Parent.js +0 -41
- package/dist/test-resources/elements/WithStaticArea.js +0 -77
- package/dist/test-resources/pages/AllTestElements.html +0 -42
- package/dist/test-resources/pages/Configuration.html +0 -18
- package/dist/test-resources/pages/ConfigurationScript.html +0 -34
- package/dist/test-resources/pages/assets/messagebundle_de.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_en.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_es.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_fr.properties +0 -1
- package/dist/test-resources/pages/i18n.html +0 -33
- package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -27
- package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -63
- package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -93
- package/dist/test-resources/specs/CustomTheme.spec.js +0 -27
- package/dist/test-resources/specs/EventProvider.spec.js +0 -63
- package/dist/test-resources/specs/StaticArea.spec.js +0 -78
- package/dist/test-resources/specs/Theming.spec.js +0 -33
- package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -242
- package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -98
- package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -75
- package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -42
- package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -14
- package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -67
- package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -24
- package/dist/test-resources/specs/UI5ElementSlots.js +0 -36
- package/src/isLegacyBrowser.js +0 -3
package/dist/util/Caret.js
CHANGED
|
@@ -6,20 +6,7 @@ const getCaretPosition = field => {
|
|
|
6
6
|
// Initialize
|
|
7
7
|
let caretPos = 0;
|
|
8
8
|
|
|
9
|
-
//
|
|
10
|
-
if (document.selection) {
|
|
11
|
-
// Set focus on the element
|
|
12
|
-
field.focus();
|
|
13
|
-
|
|
14
|
-
// To get cursor position, get empty selection range
|
|
15
|
-
const selection = document.selection.createRange();
|
|
16
|
-
|
|
17
|
-
// Move selection start to 0 position
|
|
18
|
-
selection.moveStart("character", -field.value.length);
|
|
19
|
-
|
|
20
|
-
// The caret position is selection length
|
|
21
|
-
caretPos = selection.text.length;
|
|
22
|
-
} else if (field.selectionStart || field.selectionStart === "0") { // Firefox support
|
|
9
|
+
if (field.selectionStart || field.selectionStart === "0") { // Firefox support
|
|
23
10
|
caretPos = field.selectionDirection === "backward" ? field.selectionStart : field.selectionEnd;
|
|
24
11
|
}
|
|
25
12
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getSlotName } from "./SlotsHelper.js";
|
|
2
|
+
|
|
3
|
+
const isDefaultSlotProvided = element => {
|
|
4
|
+
return Array.from(element.childNodes).filter(node => {
|
|
5
|
+
return node.nodeType !== Node.COMMENT_NODE
|
|
6
|
+
&& getSlotName(node) === "default"
|
|
7
|
+
&& (node.nodeType !== Node.TEXT_NODE || node.nodeValue.trim().length !== 0);
|
|
8
|
+
}).length > 0;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default isDefaultSlotProvided;
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
XeoUDYYqmjUwnJg4dGNgbPltSMo=
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const mkdirp = require('mkdirp');
|
|
1
|
+
const fs = require('fs').promises;
|
|
3
2
|
const assets = require('@ui5/webcomponents-tools/assets-meta.js');
|
|
4
3
|
|
|
5
4
|
const fileContent = `const assetParameters = ${JSON.stringify(assets)};
|
|
@@ -16,6 +15,11 @@ export {
|
|
|
16
15
|
SUPPORTED_LOCALES,
|
|
17
16
|
};`;
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
fs.
|
|
18
|
+
const generate = async () => {
|
|
19
|
+
await fs.mkdir("dist/generated/", { recursive: true });
|
|
20
|
+
return fs.writeFile("dist/generated/AssetParameters.js", fileContent);
|
|
21
|
+
}
|
|
21
22
|
|
|
23
|
+
generate().then(() => {
|
|
24
|
+
console.log("Assets parameters generated.");
|
|
25
|
+
});
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const mkdirp = require('mkdirp');
|
|
4
3
|
const CleanCSS = require('clean-css');
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
fs.
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
5
|
+
const generate = async () => {
|
|
6
|
+
await fs.mkdir("dist/generated/css/");
|
|
7
|
+
|
|
8
|
+
const files = (await fs.readdir("src/css/")).filter(file => file.endsWith(".css"));
|
|
9
|
+
const filesPromises = files.map(async file => {
|
|
10
|
+
let content = await fs.readFile(path.join("src/css/", file));
|
|
11
|
+
const res = new CleanCSS().minify(`${content}`);
|
|
12
|
+
content = `export default {
|
|
11
13
|
packageName: "@ui5/webcomponents-base",
|
|
12
14
|
fileName: "${file}",
|
|
13
15
|
content: \`${res.styles}\`
|
|
14
16
|
};`;
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
+
return fs.writeFile(path.join("dist/generated/css/", `${file}.js`), content);
|
|
19
|
+
});
|
|
18
20
|
|
|
21
|
+
return Promise.all(filesPromises);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
generate().then(() => {
|
|
25
|
+
console.log("Styles files generated.");
|
|
26
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const mkdirp = require('mkdirp');
|
|
1
|
+
const fs = require('fs').promises;
|
|
3
2
|
|
|
4
|
-
const
|
|
3
|
+
const generate = async () => {
|
|
4
|
+
const version = JSON.parse(await fs.readFile("package.json")).version;
|
|
5
5
|
|
|
6
|
-
// Parse version
|
|
7
|
-
const matches = version.match(/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/);
|
|
8
|
-
if (!matches) {
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
// Parse version
|
|
7
|
+
const matches = version.match(/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/);
|
|
8
|
+
if (!matches) {
|
|
9
|
+
throw new Error("Unsupported version format");
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
const isNext = version.match(/[a-f0-9]{9}$/);
|
|
13
|
-
const buildTime = Math.floor(new Date().getTime() / 1000);
|
|
12
|
+
const isNext = version.match(/[a-f0-9]{9}$/);
|
|
13
|
+
const buildTime = Math.floor(new Date().getTime() / 1000);
|
|
14
14
|
|
|
15
|
-
const fileContent = `const VersionInfo = {
|
|
15
|
+
const fileContent = `const VersionInfo = {
|
|
16
16
|
version: "${version}",
|
|
17
17
|
major: ${matches[1]},
|
|
18
18
|
minor: ${matches[2]},
|
|
@@ -23,5 +23,10 @@ const fileContent = `const VersionInfo = {
|
|
|
23
23
|
};
|
|
24
24
|
export default VersionInfo;`;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
fs.
|
|
26
|
+
await fs.mkdir("dist/generated/", { recursive: true });
|
|
27
|
+
await fs.writeFile("dist/generated/VersionInfo.js", fileContent);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
generate().then(() => {
|
|
31
|
+
console.log("Version info file generated.");
|
|
32
|
+
});
|
package/package-scripts.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
const resolve = require("resolve");
|
|
2
|
+
const path = require("path");
|
|
2
3
|
|
|
3
4
|
const assetParametersScript = resolve.sync("@ui5/webcomponents-base/lib/generate-asset-parameters/index.js");
|
|
4
5
|
const stylesScript = resolve.sync("@ui5/webcomponents-base/lib/generate-styles/index.js");
|
|
5
6
|
const versionScript = resolve.sync("@ui5/webcomponents-base/lib/generate-version-info/index.js");
|
|
6
|
-
const serve = resolve.sync("@ui5/webcomponents-tools/lib/serve/index.js");
|
|
7
|
-
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
|
8
|
-
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
|
9
7
|
const copyUsedModules = resolve.sync("@ui5/webcomponents-tools/lib/copy-list/index.js");
|
|
10
8
|
const esmAbsToRel = resolve.sync("@ui5/webcomponents-tools/lib/esm-abs-to-rel/index.js");
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
const LIB = path.join(__dirname, `../tools/lib/`);
|
|
11
|
+
|
|
12
|
+
const viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
|
13
|
+
const eslintConfig = `--config ${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}`;
|
|
12
14
|
|
|
13
15
|
const scripts = {
|
|
14
16
|
clean: "rimraf dist && rimraf .port",
|
|
15
|
-
lint:
|
|
17
|
+
lint: `eslint . ${eslintConfig}`,
|
|
16
18
|
prepare: "nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles",
|
|
17
19
|
integrate: {
|
|
18
20
|
default: "nps integrate.copy-used-modules integrate.replace-amd integrate.amd-to-es6 integrate.esm-abs-to-rel integrate.third-party",
|
|
@@ -27,33 +29,25 @@ const scripts = {
|
|
|
27
29
|
},
|
|
28
30
|
},
|
|
29
31
|
build: {
|
|
30
|
-
default:
|
|
31
|
-
bundle:
|
|
32
|
+
default: `nps lint prepare build.bundle`,
|
|
33
|
+
bundle: `vite build ${viteConfig}`,
|
|
32
34
|
},
|
|
33
35
|
copy: {
|
|
34
|
-
default: "nps copy.src
|
|
36
|
+
default: "nps copy.src",
|
|
35
37
|
src: `copy-and-watch "src/**/*.{js,css}" dist/`,
|
|
36
|
-
test: `copy-and-watch "test/**/*.*" dist/test-resources`,
|
|
37
38
|
},
|
|
38
39
|
generateAssetParameters: `node "${assetParametersScript}"`,
|
|
39
40
|
generateVersionInfo: `node "${versionScript}"`,
|
|
40
41
|
generateStyles: `node "${stylesScript}"`,
|
|
41
42
|
watch: {
|
|
42
|
-
default: 'concurrently "nps watch.
|
|
43
|
+
default: 'concurrently "nps watch.src" "nps watch.styles"',
|
|
44
|
+
withBundle: 'concurrently "nps watch.src" "nps watch.bundle" "nps watch.styles"',
|
|
43
45
|
src: 'nps "copy.src --watch --skip-initial-copy"',
|
|
44
|
-
|
|
45
|
-
bundle: "rollup --config config/rollup.config.js -w --environment DEV",
|
|
46
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
|
46
47
|
styles: 'chokidar "src/css/*.css" -c "nps generateStyles"'
|
|
47
48
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
serve: `node "${serve}" --dir="dist/" --port=9191 --packageName="@ui5/webcomponents-base"`,
|
|
51
|
-
test: {
|
|
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
|
|
53
|
-
default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
|
|
54
|
-
run: "cross-env WDIO_LOG_LEVEL=error FORCE_COLOR=0 wdio config/wdio.conf.js",
|
|
55
|
-
},
|
|
56
|
-
hash: `node "${generateHash}" dist/ hash.txt`,
|
|
49
|
+
start: "nps prepare watch.withBundle",
|
|
50
|
+
test: `node "${LIB}/test-runner/test-runner.js"`,
|
|
57
51
|
};
|
|
58
52
|
|
|
59
53
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.base",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,21 +28,22 @@
|
|
|
28
28
|
"start": "nps start",
|
|
29
29
|
"build": "nps build",
|
|
30
30
|
"test": "nps test",
|
|
31
|
-
"hash": "nps hash",
|
|
32
31
|
"prepublishOnly": "npm run clean && npm run build"
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
|
-
"lit-html": "2.0.1"
|
|
34
|
+
"lit-html": "^2.0.1"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@buxlabs/amd-to-es6": "0.16.1",
|
|
39
|
-
"@openui5/sap.ui.core": "1.
|
|
40
|
-
"@ui5/webcomponents-tools": "1.
|
|
41
|
-
"chromedriver": "
|
|
38
|
+
"@openui5/sap.ui.core": "1.101.0",
|
|
39
|
+
"@ui5/webcomponents-tools": "1.5.0",
|
|
40
|
+
"chromedriver": "102.0.0",
|
|
42
41
|
"clean-css": "^5.2.2",
|
|
43
42
|
"copy-and-watch": "^0.1.5",
|
|
43
|
+
"cross-env": "^7.0.3",
|
|
44
44
|
"eslint": "^7.22.0",
|
|
45
45
|
"mkdirp": "^1.0.4",
|
|
46
|
+
"replace-in-file": "^6.3.5",
|
|
46
47
|
"resolve": "^1.20.0"
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -82,7 +82,7 @@ const displayFailedRegistrations = () => {
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
message = `${message}\n\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/
|
|
85
|
+
message = `${message}\n\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`;
|
|
86
86
|
|
|
87
87
|
console.warn(message); // eslint-disable-line
|
|
88
88
|
};
|
|
@@ -147,7 +147,7 @@ const registerLocaleDataLoader = (localeId, loader) => {
|
|
|
147
147
|
|
|
148
148
|
// register default loader for "en" from ui5 CDN (dev workflow without assets)
|
|
149
149
|
registerLocaleDataLoader("en", async runtimeLocaleId => {
|
|
150
|
-
return (await fetch(`https://ui5.sap.com/1.
|
|
150
|
+
return (await fetch(`https://ui5.sap.com/1.103.0/resources/sap/ui/core/cldr/en.json`)).json();
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
// When the language changes dynamically (the user calls setLanguage),
|
|
@@ -38,10 +38,14 @@ const getThemeProperties = async (packageName, themeName) => {
|
|
|
38
38
|
|
|
39
39
|
if (!registeredThemes.has(themeName)) {
|
|
40
40
|
const regThemesStr = [...registeredThemes.values()].join(", ");
|
|
41
|
-
console.warn(`You have requested a non-registered theme - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */
|
|
42
|
-
return
|
|
41
|
+
console.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */
|
|
42
|
+
return _getThemeProperties(packageName, DEFAULT_THEME);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
return _getThemeProperties(packageName, themeName);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const _getThemeProperties = async (packageName, themeName) => {
|
|
45
49
|
const loader = loaders.get(`${packageName}/${themeName}`);
|
|
46
50
|
if (!loader) {
|
|
47
51
|
// no themes for package
|
|
@@ -14,10 +14,12 @@ const bundlePromises = new Map();
|
|
|
14
14
|
const loaders = new Map();
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
+
* Registers i18n loader function for given package and locale.
|
|
17
18
|
*
|
|
19
|
+
* @public
|
|
18
20
|
* @param {string} packageName for which package this loader can fetch data
|
|
21
|
+
* @param {string} localeId locale that this loader can handle
|
|
19
22
|
* @param {function} loader async function that will be passed a localeId and should return a JSON object
|
|
20
|
-
* @param {Array} localeIds Array of locale IDs that this loader can handle
|
|
21
23
|
*/
|
|
22
24
|
const registerI18nLoader = (packageName, localeId, loader) => {
|
|
23
25
|
// register loader by key
|
package/src/css/FontFace.css
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 400;
|
|
5
5
|
src: local("72"),
|
|
6
|
-
url(https://ui5.sap.com/
|
|
7
|
-
url(https://ui5.sap.com/
|
|
6
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2"),
|
|
7
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff?ui5-webcomponents) format("woff");
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@font-face {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
font-style: normal;
|
|
13
13
|
font-weight: 400;
|
|
14
14
|
src: local('72-full'),
|
|
15
|
-
url(https://ui5.sap.com/
|
|
16
|
-
url(https://ui5.sap.com/
|
|
15
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2"),
|
|
16
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff?ui5-webcomponents) format("woff");
|
|
17
17
|
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
font-style: normal;
|
|
23
23
|
font-weight: 700;
|
|
24
24
|
src: local('72-Bold'),
|
|
25
|
-
url(https://ui5.sap.com/
|
|
26
|
-
url(https://ui5.sap.com/
|
|
25
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),
|
|
26
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff?ui5-webcomponents) format("woff");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@font-face {
|
|
@@ -31,38 +31,38 @@
|
|
|
31
31
|
font-style: normal;
|
|
32
32
|
font-weight: 700;
|
|
33
33
|
src: local('72-Bold-full'),
|
|
34
|
-
url(https://ui5.sap.com/
|
|
35
|
-
url(https://ui5.sap.com/
|
|
34
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2"),
|
|
35
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@font-face {
|
|
39
39
|
font-family: '72-Bold';
|
|
40
40
|
font-style: normal;
|
|
41
41
|
src: local('72-Bold'),
|
|
42
|
-
url(https://ui5.sap.com/
|
|
43
|
-
url(https://ui5.sap.com/
|
|
42
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2"),
|
|
43
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff?ui5-webcomponents) format("woff");
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
@font-face {
|
|
47
47
|
font-family: '72-Boldfull';
|
|
48
48
|
font-style: normal;
|
|
49
|
-
src: url(https://ui5.sap.com/
|
|
50
|
-
url(https://ui5.sap.com/
|
|
49
|
+
src: url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2"),
|
|
50
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff?ui5-webcomponents) format("woff");
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@font-face {
|
|
54
54
|
font-family: '72-Light';
|
|
55
55
|
font-style: normal;
|
|
56
56
|
src: local('72-Light'),
|
|
57
|
-
url(https://ui5.sap.com/
|
|
58
|
-
url(https://ui5.sap.com/
|
|
57
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2"),
|
|
58
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff?ui5-webcomponents) format("woff");
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
@font-face {
|
|
62
62
|
font-family: '72-Lightfull';
|
|
63
63
|
font-style: normal;
|
|
64
|
-
src: url(https://ui5.sap.com/
|
|
65
|
-
url(https://ui5.sap.com/
|
|
64
|
+
src: url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2"),
|
|
65
|
+
url(https://ui5.sap.com/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff?ui5-webcomponents) format("woff");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@font-face {
|
|
@@ -133,15 +133,20 @@ class ItemNavigation {
|
|
|
133
133
|
|
|
134
134
|
const horizontalNavigationOn = this._navigationMode === NavigationMode.Horizontal || this._navigationMode === NavigationMode.Auto;
|
|
135
135
|
const verticalNavigationOn = this._navigationMode === NavigationMode.Vertical || this._navigationMode === NavigationMode.Auto;
|
|
136
|
+
const isRTL = this.rootWebComponent.effectiveDir === "rtl";
|
|
136
137
|
|
|
137
|
-
if (
|
|
138
|
-
this.
|
|
139
|
-
} else if (
|
|
140
|
-
this.
|
|
138
|
+
if (isRTL && isLeft(event) && horizontalNavigationOn) {
|
|
139
|
+
this._handleRight();
|
|
140
|
+
} else if (isRTL && isRight(event) && horizontalNavigationOn) {
|
|
141
|
+
this._handleLeft();
|
|
141
142
|
} else if (isLeft(event) && horizontalNavigationOn) {
|
|
142
143
|
this._handleLeft();
|
|
143
144
|
} else if (isRight(event) && horizontalNavigationOn) {
|
|
144
145
|
this._handleRight();
|
|
146
|
+
} else if (isUp(event) && verticalNavigationOn) {
|
|
147
|
+
this._handleUp();
|
|
148
|
+
} else if (isDown(event) && verticalNavigationOn) {
|
|
149
|
+
this._handleDown();
|
|
145
150
|
} else if (isHome(event)) {
|
|
146
151
|
this._handleHome();
|
|
147
152
|
} else if (isEnd(event)) {
|
|
@@ -15,14 +15,14 @@ class F6Navigation {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
async _keydownHandler(event) {
|
|
18
|
-
event.preventDefault();
|
|
19
|
-
|
|
20
18
|
if (isF6Next(event)) {
|
|
21
19
|
this.updateGroups();
|
|
22
20
|
if (this.groups.length < 1) {
|
|
23
21
|
return;
|
|
24
22
|
}
|
|
25
23
|
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
|
|
26
26
|
const nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
27
27
|
let nextElement = null;
|
|
28
28
|
|
|
@@ -46,6 +46,8 @@ class F6Navigation {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
|
|
49
51
|
const nextIndex = this.groups.indexOf(this.selectedGroup);
|
|
50
52
|
let nextElement = null;
|
|
51
53
|
|
package/src/updateShadowRoot.js
CHANGED
|
@@ -2,7 +2,6 @@ import executeTemplate from "./renderer/executeTemplate.js";
|
|
|
2
2
|
import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
3
3
|
import getEffectiveStyle from "./theming/getEffectiveStyle.js";
|
|
4
4
|
import getEffectiveLinksHrefs from "./theming/getEffectiveLinksHrefs.js";
|
|
5
|
-
import isLegacyBrowser from "./isLegacyBrowser.js";
|
|
6
5
|
import { shouldUseLinks } from "./CSP.js";
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -20,7 +19,7 @@ const updateShadowRoot = (element, forStaticArea = false) => {
|
|
|
20
19
|
styleStrOrHrefsArr = getEffectiveLinksHrefs(element.constructor, forStaticArea);
|
|
21
20
|
} else if (document.adoptedStyleSheets) { // Chrome
|
|
22
21
|
shadowRoot.adoptedStyleSheets = getConstructableStyle(element.constructor, forStaticArea);
|
|
23
|
-
} else
|
|
22
|
+
} else { // FF, Safari
|
|
24
23
|
styleStrOrHrefsArr = getEffectiveStyle(element.constructor, forStaticArea);
|
|
25
24
|
}
|
|
26
25
|
|
package/src/util/Caret.js
CHANGED
|
@@ -6,20 +6,7 @@ const getCaretPosition = field => {
|
|
|
6
6
|
// Initialize
|
|
7
7
|
let caretPos = 0;
|
|
8
8
|
|
|
9
|
-
//
|
|
10
|
-
if (document.selection) {
|
|
11
|
-
// Set focus on the element
|
|
12
|
-
field.focus();
|
|
13
|
-
|
|
14
|
-
// To get cursor position, get empty selection range
|
|
15
|
-
const selection = document.selection.createRange();
|
|
16
|
-
|
|
17
|
-
// Move selection start to 0 position
|
|
18
|
-
selection.moveStart("character", -field.value.length);
|
|
19
|
-
|
|
20
|
-
// The caret position is selection length
|
|
21
|
-
caretPos = selection.text.length;
|
|
22
|
-
} else if (field.selectionStart || field.selectionStart === "0") { // Firefox support
|
|
9
|
+
if (field.selectionStart || field.selectionStart === "0") { // Firefox support
|
|
23
10
|
caretPos = field.selectionDirection === "backward" ? field.selectionStart : field.selectionEnd;
|
|
24
11
|
}
|
|
25
12
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getSlotName } from "./SlotsHelper.js";
|
|
2
|
+
|
|
3
|
+
const isDefaultSlotProvided = element => {
|
|
4
|
+
return Array.from(element.childNodes).filter(node => {
|
|
5
|
+
return node.nodeType !== Node.COMMENT_NODE
|
|
6
|
+
&& getSlotName(node) === "default"
|
|
7
|
+
&& (node.nodeType !== Node.TEXT_NODE || node.nodeValue.trim().length !== 0);
|
|
8
|
+
}).length > 0;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default isDefaultSlotProvided;
|
package/config/.eslintrc.js
DELETED
package/config/rollup.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/rollup.js");
|
package/dist/isLegacyBrowser.js
DELETED