INIT_PACKAGE_VAR_TAG
component is a demo component that displays some text.
- *
- * @constructor
- * @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
- * @extends sap.ui.webc.base.UI5Element
- * @tagname INIT_PACKAGE_VAR_TAG
- * @public
- */
-class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
- static get metadata() {
- return metadata;
- }
-
- static get render() {
- return litRender;
- }
-
- static get template() {
- return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
- }
-
- static get styles() {
- return INIT_PACKAGE_VAR_CLASS_NAMECss;
- }
-
- static async onDefine() {
- INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
- }
-
- onClick() {
- this.count++;
- }
-
- get counterText() {
- return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
- }
-}
-
-INIT_PACKAGE_VAR_CLASS_NAME.define();
-
-export default INIT_PACKAGE_VAR_CLASS_NAME;
diff --git a/packages/tools/lib/create-new-component/index.js b/packages/tools/lib/create-new-component/index.js
index b9eaa7dda9e4..574776617883 100644
--- a/packages/tools/lib/create-new-component/index.js
+++ b/packages/tools/lib/create-new-component/index.js
@@ -58,21 +58,15 @@ const getLibraryName = packageName => {
return packageName.substr("webcomponents-".length);
};
-const generateFiles = (componentName, tagName, library, packageName, isTypeScript) => {
+const generateFiles = (componentName, tagName, library, packageName) => {
componentName = capitalizeFirstLetter(componentName);
const filePaths = {
- "main": isTypeScript
- ? `./src/${componentName}.ts`
- : `./src/${componentName}.js`,
+ "main": `./src/${componentName}.ts`,
"css": `./src/themes/${componentName}.css`,
"template": `./src/${componentName}.hbs`,
};
- const FileContentTemplate = isTypeScript
- ? tsFileContentTemplate(componentName, tagName, library, packageName)
- : jsFileContentTemplate(componentName, tagName, library, packageName);
-
- fs.writeFileSync(filePaths.main, FileContentTemplate, { flag: "wx+" });
+ fs.writeFileSync(filePaths.main, tsFileContentTemplate(componentName, tagName, library, packageName), { flag: "wx+" });
fs.writeFileSync(filePaths.css, "", { flag: "wx+" });
fs.writeFileSync(filePaths.template, "${tagName}
- * import "${packageName}/dist/${componentName}.js";
- *
- * @constructor
- * @author SAP SE
- * @alias sap.ui.webc.${library}.${componentName}
- * @extends sap.ui.webc.base.UI5Element
- * @tagname ${tagName}
- * @public
- */
-class ${componentName} extends UI5Element {
- static get metadata() {
- return metadata;
- }
-
- static get render() {
- return litRender;
- }
-
- static get styles() {
- return ${componentName}Css;
- }
-
- static get template() {
- return ${componentName}Template;
- }
-
- static get dependencies() {
- return [];
- }
-}
-
-${componentName}.define();
-
-export default ${componentName};
-`;
-};
-
-module.exports = jsFileContentTemplate;
From 0789c344131bd0150d69c237a4b2fe9b102385ee Mon Sep 17 00:00:00 2001
From: Nayden Naydenov <31909318+nnaydenow@users.noreply.github.com>
Date: Fri, 22 Mar 2024 16:51:59 +0200
Subject: [PATCH 10/60] chore: remove unused command (#8506)
---
package.json | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/package.json b/package.json
index dbf4e65523b4..e06714241928 100644
--- a/package.json
+++ b/package.json
@@ -19,14 +19,14 @@
"watch:base": "yarn workspace @ui5/webcomponents-base nps watch",
"watch:main": "yarn workspace @ui5/webcomponents nps watch",
"watch:fiori": "yarn workspace @ui5/webcomponents-fiori nps watch",
- "watch:allWithDelay": "node -e \"setTimeout(function(){}, 5000)\" && npm-run-all --parallel copy-css watch:base watch:main watch:fiori",
+ "watch:allWithDelay": "node -e \"setTimeout(function(){}, 5000)\" && npm-run-all --parallel watch:base watch:main watch:fiori",
"scopeWatch:main": "yarn workspace @ui5/webcomponents nps scope.watch",
"scopeWatch:fiori": "yarn workspace @ui5/webcomponents-fiori nps scope.watch",
- "startWithScope": "npm-run-all --sequential generate scopePrepare:main scopePrepare:fiori copy-css scopeStart:all",
+ "startWithScope": "npm-run-all --sequential generate scopePrepare:main scopePrepare:fiori scopeStart:all",
"start:all": "npm-run-all --parallel watch:allWithDelay dev",
"dev": "node packages/tools/lib/dev-server/dev-server.js",
"scopeStart:all": "npm-run-all --parallel watch:base scopeWatch:main scopeWatch:fiori dev",
- "start:storybook": "yarn ci:releasebuild && yarn copy-css && yarn workspace @ui5/webcomponents-playground start",
+ "start:storybook": "yarn ci:releasebuild && yarn workspace @ui5/webcomponents-playground start",
"start:website": "yarn ci:releasebuild && yarn workspace @ui5/webcomponents-website start",
"start": "npm-run-all --sequential generate start:all",
@@ -36,9 +36,9 @@
"ci:releasebuild": "npm-run-all --sequential generate ts generateAPI",
"ci:lint": "npm-run-all --sequential generate lint",
"ci:testbuild": "npm-run-all --sequential generate ts bundle",
- "ci:deploybuild": "yarn ci:testbuild && yarn generateAPI && yarn copy-css && yarn workspace @ui5/webcomponents-playground build",
- "ci:deploy": "yarn ci:testbuild && yarn generateAPI && yarn copy-css && yarn workspace @ui5/webcomponents-website ci:build",
- "ci:deploy:nightly": "yarn ci:testbuild && yarn generateAPI && yarn copy-css && yarn workspace @ui5/webcomponents-website ci:build:nightly",
+ "ci:deploybuild": "yarn ci:testbuild && yarn generateAPI && yarn workspace @ui5/webcomponents-playground build",
+ "ci:deploy": "yarn ci:testbuild && yarn generateAPI && yarn workspace @ui5/webcomponents-website ci:build",
+ "ci:deploy:nightly": "yarn ci:testbuild && yarn generateAPI && yarn workspace @ui5/webcomponents-website ci:build:nightly",
"ci:test:base": "yarn workspace @ui5/webcomponents-base test",
"ci:test:main:suite-1": "yarn workspace @ui5/webcomponents test:ssr && yarn workspace @ui5/webcomponents test:suite-1",
@@ -49,7 +49,6 @@
"lint:scope": "wsrun --exclude-missing lint:scope",
"link-all": "wsrun link",
"unlink-all": "wsrun unlink",
- "copy-css": "copy-and-watch \"packages/base/dist/css/**/*\" packages/main/test/pages/resources/css/base/ && copy-and-watch \"packages/theming/dist/css/**/*\" packages/main/test/pages/resources/css/theming/ && copy-and-watch \"packages/main/dist/css/**/*\" packages/main/test/pages/resources/css/main/ && copy-and-watch \"packages/base/dist/css/**/*\" packages/fiori/test/pages/resources/css/base/ && copy-and-watch \"packages/theming/dist/css/**/*\" packages/fiori/test/pages/resources/css/theming/ && copy-and-watch \"packages/fiori/dist/css/**/*\" packages/fiori/test/pages/resources/css/fiori/ && copy-and-watch \"packages/main/dist/css/**/*\" packages/fiori/test/pages/resources/css/main/",
"release": "node ./.github/actions/release.js",
"prepare": "husky install",
"husky:commit-msg": "commitlint -e",
From d6f2836a39281184be6b017b4fb348cda983113c Mon Sep 17 00:00:00 2001
From: Petar Dimov <32839090+dimovpetar@users.noreply.github.com>
Date: Mon, 25 Mar 2024 11:48:59 +0200
Subject: [PATCH 11/60] refactor(ui5-popover): rename PopoverHorizontalAlign
and PopoverPlacementType values (#8502)
Renames the `Left` and `Right` values of `PopoverHorizontalAlign` and `PopoverPlacementType` to `Start` and `End`.
BREAKING CHANGE: The `Left` and `Right` options option have been renamed. If you previously used them to set the placement or the alignment of the popover:
```html
No space on the Right, try Left, Bottom, Top
+No space on the End, try Start, Bottom, Top
No space on the right, try Left, Bottom, Top and if nothing works, the target will be overlapped
+No space on the End, try Start, Bottom, Top and if nothing works, the target will be overlapped
No space on the Left, try Right, Bottom, Top
+No space on the Start, try End, Bottom, Top
No space on the right, try Right, Bottom, Top and if nothing works, the target will be overlapped
+No space on the Start, try End, Bottom, Top and if nothing works, the target will be overlapped
Right-aligned Popover, wider than button, arrow should be centered on the button
+End-aligned Popover, wider than button, arrow should be centered on the button
mSettings
that defines initial",
- "property values, aggregated and associated objects as well as event handlers.",
- "See {@link sap.ui.base.ManagedObject#constructor} for a general description of the syntax of the settings object."
- );
- }
-
- // add the settings section only if there are any settings
- if ( !isEmpty(oClassInfo.properties)
- || !isEmpty(oClassInfo.aggregations)
- || !isEmpty(oClassInfo.associations)
- || !isEmpty(oClassInfo.events) ) {
-
- lines.push(
- "",
- includeSettings ? "" : "@ui5-settings",
- "The supported settings are:",
- "sClassName
",
- "and enriches it with the information contained in oClassInfo
.",
- "",
- "oClassInfo
might contain the same kind of information as described in {@link " + (oClassInfo.baseType ? oClassInfo.baseType + ".extend" : "sap.ui.base.Object.extend Object.extend") + "}.",
- "",
- "@param {string} sClassName Name of the class being created",
- "@param {object} [oClassInfo] Object literal with information about the class",
- "@param {function} [FNMetaImpl] Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
",
- "@returns {function} Created class / constructor function",
- "@public",
- "@static",
- "@name " + name("extend", "", true),
- "@function"
- ]);
- }
-
- for (n in oClassInfo.properties ) {
- info = oClassInfo.properties[n];
- if ( info.visibility === 'hidden' ) {
- continue;
- }
- // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "" + n + "
";
- link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
- newJSDoc([
- "Gets current value of property " + link + ".",
- "",
- !newStyle && info.doc ? info.doc : "",
- "",
- info.defaultValue !== null ? "Default value is " + (info.defaultValue === "" ? "empty string" : info.defaultValue) + "
." : "",
- "@returns {" + info.type + "} Value of property " + n + "
",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("get",n),
- "@function"
- ]);
- newJSDoc([
- "Sets a new value for property " + link + ".",
- "",
- !newStyle && info.doc ? info.doc : "",
- "",
- "When called with a value of null
or undefined
, the default value of the property will be restored.",
- "",
- info.defaultValue !== null ? "Default value is " + (info.defaultValue === "" ? "empty string" : info.defaultValue) + "
." : "",
- "@param {" + info.type + "} " + varname(n,info.type,true) + " New value for property " + n + "
",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("set",n),
- "@function"
- ]);
- if ( info.bindable ) {
- newJSDoc([
- "Binds property " + link + " to model data.",
- "",
- "See {@link sap.ui.base.ManagedObject#bindProperty ManagedObject.bindProperty} for a ",
- "detailed description of the possible properties of oBindingInfo
",
- "@param {object} oBindingInfo The binding information",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("bind",n),
- "@function"
- ]);
- newJSDoc([
- "Unbinds property " + link + " from model data.",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("unbind",n),
- "@function"
- ]);
- }
- }
-
- for (n in oClassInfo.aggregations ) {
- info = oClassInfo.aggregations[n];
- if ( info.visibility === 'hidden' ) {
- continue;
- }
- // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "" + n + "
";
- link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
- newJSDoc([
- "Gets content of aggregation " + link + ".",
- "",
- !newStyle && info.doc ? info.doc : "",
- "",
- n === info.defaultAggregation ? "Note: this is the default aggregation for " + n + "." : "",
- "@returns {" + makeTypeString(info) + "}",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("get",n),
- "@function"
- ]);
- if ( info.cardinality == "0..n" ) {
- n1 = info.singularName;
- newJSDoc([
- "Inserts a " + n1 + " into the aggregation " + link + ".",
- "",
- "@param {" + makeTypeString(info, true) + "}",
- " " + varname(n1,info.altTypes ? "variant" : info.type) + " The " + n1 + " to insert; if empty, nothing is inserted",
- "@param {int}",
- " iIndex The 0
-based index the " + n1 + " should be inserted at; for",
- " a negative value of iIndex
, the " + n1 + " is inserted at position 0; for a value",
- " greater than the current size of the aggregation, the " + n1 + " is inserted at",
- " the last position",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("insert",n1),
- "@function"
- ]);
- newJSDoc([
- "Adds some " + n1 + " to the aggregation " + link + ".",
-
- "@param {" + makeTypeString(info, true) + "}",
- " " + varname(n1,info.altTypes ? "variant" : info.type) + " The " + n1 + " to add; if empty, nothing is inserted",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("add",n1),
- "@function"
- ]);
- newJSDoc([
- "Removes a " + n1 + " from the aggregation " + link + ".",
- "",
- "@param {int | string | " + makeTypeString(info, true) + "} " + varname(n1,"variant") + " The " + n1 + " to remove or its index or id",
- "@returns {" + makeTypeString(info, true) + "} The removed " + n1 + " or null
",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("remove", n1),
- "@function"
- ]);
- newJSDoc([
- "Removes all the controls from the aggregation " + link + ".",
- "",
- "Additionally, it unregisters them from the hosting UIArea.",
- "@returns {" + makeTypeString(info) + "} An array of the removed elements (might be empty)",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("removeAll", n),
- "@function"
- ]);
- newJSDoc([
- "Checks for the provided " + info.type + "
in the aggregation " + link + ".",
- "and returns its index if found or -1 otherwise.",
- "@param {" + makeTypeString(info, true) + "}",
- " " + varname(n1, info.altTypes ? "variant" : info.type) + " The " + n1 + " whose index is looked for",
- "@returns {int} The index of the provided control in the aggregation if found, or -1 otherwise",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("indexOf", n1),
- "@function"
- ]);
- } else {
- newJSDoc([
- "Sets the aggregated " + link + ".",
- "@param {" + makeTypeString(info) + "} " + varname(n, info.altTypes ? "variant" : info.type) + " The " + n + " to set",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("set", n),
- "@function"
- ]);
- }
- newJSDoc([
- "Destroys " + (info.cardinality === "0..n" ? "all " : "") + "the " + n + " in the aggregation " + link + ".",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("destroy", n),
- "@function"
- ]);
- if ( info.bindable ) {
- newJSDoc([
- "Binds aggregation " + link + " to model data.",
- "",
- "See {@link sap.ui.base.ManagedObject#bindAggregation ManagedObject.bindAggregation} for a ",
- "detailed description of the possible properties of oBindingInfo
.",
- "@param {object} oBindingInfo The binding information",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("bind",n),
- "@function"
- ]);
- newJSDoc([
- "Unbinds aggregation " + link + " from model data.",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("unbind",n),
- "@function"
- ]);
- }
- }
-
- for (n in oClassInfo.associations ) {
- info = oClassInfo.associations[n];
- if ( info.visibility === 'hidden' ) {
- continue;
- }
- // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "" + n + "
";
- link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
- newJSDoc([
- info.cardinality === "0..n" ?
- "Returns array of IDs of the elements which are the current targets of the association " + link + "." :
- "ID of the element which is the current target of the association " + link + ", or null
.",
- "",
- newStyle && info.doc ? info.doc : "",
- "",
- "@returns {sap.ui.core.ID" + (info.cardinality === "0..n" ? "[]" : "") + "}",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("get",n),
- "@function"
- ]);
- if ( info.cardinality === "0..n" ) {
- n1 = info.singularName;
- newJSDoc([
- "Adds some " + n1 + " into the association " + link + ".",
- "",
- "@param {sap.ui.core.ID | " + info.type + "} " + varname(n1, "variant") + " The " + n + " to add; if empty, nothing is inserted",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("add",n1),
- "@function"
- ]);
- newJSDoc([
- "Removes an " + n1 + " from the association named " + link + ".",
- "@param {int | sap.ui.core.ID | " + info.type + "} " + varname(n1,"variant") + " The " + n1 + " to be removed or its index or ID",
- "@returns {sap.ui.core.ID} The removed " + n1 + " or null
",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("remove", n1),
- "@function"
- ]);
- newJSDoc([
- "Removes all the controls in the association named " + link + ".",
- "@returns {sap.ui.core.ID[]} An array of the removed elements (might be empty)",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("removeAll", n),
- "@function"
- ]);
- } else {
- newJSDoc([
- "Sets the associated " + link + ".",
- "@param {sap.ui.core.ID | " + info.type + "} " + varname(n, info.type) + " ID of an element which becomes the new target of this " + n + " association; alternatively, an element instance may be given",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("set", n),
- "@function"
- ]);
- }
- }
-
- for (n in oClassInfo.events ) {
- info = oClassInfo.events[n];
- //link = newStyle ? "{@link #event:" + n + " " + n + "}" : "" + n + "
";
- link = "{@link #event:" + n + " " + n + "}";
-
- lines = [
- info.doc ? info.doc : "",
- "",
- "@name " + oClassInfo.name + "#" + n,
- "@event",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@param {sap.ui.base.Event} oControlEvent",
- "@param {sap.ui.base.EventProvider} oControlEvent.getSource",
- "@param {object} oControlEvent.getParameters"
- ];
- for (pName in info.parameters ) {
- lines.push(
- "@param {" + (info.parameters[pName].type || "") + "} oControlEvent.getParameters." + pName + " " + (info.parameters[pName].doc || "")
- );
- }
- lines.push("@public");
- newJSDoc(lines);
-
- newJSDoc([
- "Attaches event handler fnFunction
to the " + link + " event of this " + oClassInfo.name + "
.",
- "",
- "When called, the context of the event handler (its this
) will be bound to oListener
if specified, ",
- "otherwise it will be bound to this " + oClassInfo.name + "
itself.",
- "",
- !newStyle && info.doc ? info.doc : "",
- "",
- "@param {object}",
- " [oData] An application-specific payload object that will be passed to the event handler along with the event object when firing the event",
- "@param {function}",
- " fnFunction The function to be called when the event occurs",
- "@param {object}",
- " [oListener] Context object to call the event handler with. Defaults to this " + oClassInfo.name + "
itself",
- "",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- "@public",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@name " + name("attach", n),
- "@function"
- ]);
- newJSDoc([
- "Detaches event handler fnFunction
from the " + link + " event of this " + oClassInfo.name + "
.",
- "",
- "The passed function and listener object must match the ones used for event registration.",
- "",
- "@param {function}",
- " fnFunction The function to be called, when the event occurs",
- "@param {object}",
- " oListener Context object on which the given function had to be called",
- "@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@public",
- "@name " + name("detach", n),
- "@function"
- ]);
-
- // build documentation for fireEvent. It contains conditional parts which makes it a bit more complicated
- lines = [
- "Fires event " + link + " to attached listeners."
- ];
- if ( info.allowPreventDefault ) {
- lines.push(
- "",
- "Listeners may prevent the default action of this event by using the preventDefault
-method on the event object.",
- "");
- }
- lines.push(
- "",
- "@param {object} [mParameters] Parameters to pass along with the event"
- );
- if ( !isEmpty(info.parameters) ) {
- for (pName in info.parameters) {
- lines.push(
- "@param {" + (info.parameters[pName].type || "any") + "} [mParameters." + pName + "] " + (info.parameters[pName].doc || "")
- );
- }
- lines.push("");
- }
- if ( info.allowPreventDefault ) {
- lines.push("@returns {boolean} Whether or not to prevent the default action");
- } else {
- lines.push("@returns {" + oClassInfo.name + "} Reference to this
in order to allow method chaining");
- }
- lines.push(
- "@protected",
- info.since ? "@since " + info.since : "",
- info.deprecation ? "@deprecated " + info.deprecation : "",
- info.experimental ? "@experimental " + info.experimental : "",
- "@name " + name("fire", n),
- "@function"
- );
- newJSDoc(lines);
- }
-
-}
-
-function createDataTypeAutoDoc(oTypeInfo, classComment, node, parser, filename) {
-}
-
-/**
- * Creates a human readable location info for a given doclet.
- * @param doclet
- * @returns {String}
- */
-function location(doclet) {
- var filename = (doclet.meta && doclet.meta.filename) || "unknown";
- return " #" + ui5data(doclet).id + "@" + filename + (doclet.meta.lineno != null ? ":" + doclet.meta.lineno : "") + (doclet.synthetic ? "(synthetic)" : "");
-}
-
-// ---- Comment handling ---------------------------------------------------------------------------
-
-// --- comment related functions that depend on the JSdoc version (e.g. on the used parser)
-
-var isDocComment;
-var getLeadingCommentNode;
-
-// JSDoc added the node type Syntax.File
with the same change that activated Babylon
-// See https://github.com/jsdoc3/jsdoc/commit/ffec4a42291de6d68e6240f304b68d6abb82a869
-if ( Syntax.File === 'File' ) {
-
- // JSDoc starting with version 3.5.0
-
- isDocComment = function isDocCommentBabylon(comment) {
- return comment && comment.type === 'CommentBlock' && comment.value && comment.value.charAt(0) === '*';
- }
-
- getLeadingCommentNode = function getLeadingCommentNodeBabylon(node, longname) {
- var leadingComments = node.leadingComments;
- if ( Array.isArray(leadingComments) ) {
- // in babylon, all comments are already attached to the node
- // and the last one is the closest one and should win
- // non-block comments have to be filtered out
- leadingComments = leadingComments.filter(isDocComment);
- if ( leadingComments.length > 0 ) {
- return leadingComments[leadingComments.length - 1];
- }
- }
- }
-
-} else {
-
- // JSDoc versions before 3.5.0
-
- isDocComment = function isDoccommentEsprima(comment) {
- return comment && comment.type === 'Block';
- };
-
- getLeadingCommentNode = function getLeadingCommentNodeEsprima(node, longname) {
- var comment,
- leadingComments = node.leadingComments;
-
- // when espree is used, JSDOc attached the leading comment and the first one was picked
- if (Array.isArray(leadingComments) && leadingComments.length && leadingComments[0].raw) {
- comment = leadingComments[0];
- }
-
- // also check all comments attached to the Program node (if found) whether they refer to the same longname
- // TODO check why any matches here override the direct leading comment from above
- if ( longname && currentProgram && currentProgram.leadingComments && currentProgram.leadingComments.length ) {
- leadingComments = currentProgram.leadingComments;
- var rLongname = new RegExp("@(name|alias|class|namespace)\\s+" + longname.replace(/\./g, '\\.'));
- for ( var i = 0; i < leadingComments.length; i++ ) {
- var raw = getRawComment(leadingComments[i]);
- if ( /^\/\*\*[\s\S]*\*\/$/.test(raw) && rLongname.test(raw) ) {
- comment = leadingComments[i];
- // console.log("\n\n**** alternative comment found for " + longname + " on program level\n\n", comment);
- break;
- }
- }
- }
-
- return comment;
- }
-}
-
-//--- comment related functions that are independent from the JSdoc version
-
-function getLeadingComment(node) {
- var comment = getLeadingCommentNode(node);
- return comment ? getRawComment(comment) : null;
-}
-
-function getLeadingDoclet(node, preprocess) {
- var comment = getLeadingComment(node)
- if ( comment && preprocess ) {
- comment = preprocessComment({comment:comment, lineno: node.loc.start.line });
- }
- return comment ? new Doclet(comment, {}) : null;
-}
-
-/**
- * Determines the raw comment string (source code form, including leading and trailing comment markers / *...* /) from a comment node.
- * Works for Esprima and Babylon based JSDoc versions.
- * @param commentNode
- * @returns
- */
-function getRawComment(commentNode) {
- // in esprima, there's a 'raw' property, in babylon, the 'raw' string has to be reconstructed from the 'value' by adding the markers
- return commentNode ? commentNode.raw ||Â '/*' + commentNode.value + '*/' : '';
-}
-
-function setRawComment(commentNode, newRawComment) {
- if ( commentNode.raw ) {
- commentNode.raw = newRawComment;
- }
- commentNode.value = newRawComment.slice(2, -2);
-}
-
-/**
- * Removes the mandatory comment markers and the optional but common asterisks at the beginning of each JSDoc comment line.
- *
- * The result is easier to parse/analyze.
- *
- * Implementation is a 1:1 copy from JSDoc's lib/jsdoc/doclet.js (closure function, not directly reusable)
- *
- * @param {string} docletSrc the source comment with or without block comment markers
- * @returns {string} the unwrapped content of the JSDoc comment
- *
- */
-function unwrap(docletSrc) {
- if (!docletSrc) { return ''; }
-
- // note: keep trailing whitespace for @examples
- // extra opening/closing stars are ignored
- // left margin is considered a star and a space
- // use the /m flag on regex to avoid having to guess what this platform's newline is
- docletSrc =
- docletSrc.replace(/^\/\*\*+/, '') // remove opening slash+stars
- .replace(/\**\*\/$/, "\\Z") // replace closing star slash with end-marker
- .replace(/^\s*(\* ?|\\Z)/gm, '') // remove left margin like: spaces+star or spaces+end-marker
- .replace(/\s*\\Z$/g, ''); // remove end-marker
-
- return docletSrc;
-}
-
-/**
- * Inverse operation of unwrap.
- *
- * The prefix for lines is fixed to be " * ", lines are separated with '\n', independent from the platform.
- */
-function wrap(lines) {
- if ( typeof lines === "string" ) {
- lines = lines.split(/\r\n?|\n/);
- }
- return "/**\n * " + lines.join('\n * ') + "\n */";
-}
-
-/**
- * Preprocesses a JSDoc comment string to ensure some UI5 standards.
- *
- * @param {event} e Event for the new comment
- * @returns {event}
- */
-function preprocessComment(e) {
-
- var src = e.comment;
-
- // add a default visibility
- if ( !/@private|@public|@protected|@sap-restricted|@ui5-restricted/.test(src) ) {
- src = unwrap(src);
- src = src + "\n@private";
- src = wrap(src);
- // console.log("added default visibility to '" + src + "'");
- }
-
- if ( /@class/.test(src) && /@static/.test(src) ) {
- warning("combination of @class and @static is no longer supported with jsdoc3, converting it to @namespace and @classdesc: (line " + e.lineno + ")");
- src = unwrap(src);
- src = src.replace(/@class/, "@classdesc").replace(/@static/, "@namespace");
- src = wrap(src);
- //console.log(src);
- }
-
- return src;
-
-}
-
-// ---- other functionality ---------------------------------------------------------------------------
-
-// HACK: override cli.exit() to avoid that JSDoc3 exits the VM
-if ( pluginConfig.noExit ) {
- info("disabling exit() call");
- require( path.join(global.env.dirname, 'cli') ).exit = function(retval) {
- info("cli.exit(): do nothing (ret val=" + retval + ")");
- };
-}
-
-
-// ---- exports ----------------------------------------------------------------------------------------
-
-exports.defineTags = function(dictionary) {
-
- /**
- * a special value that is not 'falsy' but results in an empty string when output
- * Used for the disclaimer and experimental tag
- */
- var EMPTY = {
- toString: function() { return ""; }
- };
-
- /**
- * A sapui5 specific tag to add a disclaimer to a symbol
- */
- dictionary.defineTag('disclaimer', {
- // value is optional
- onTagged: function(doclet, tag) {
- doclet.disclaimer = tag.value || EMPTY;
- }
- });
-
- /**
- * A sapui5 specific tag to mark a symbol as experimental.
- */
- dictionary.defineTag('experimental', {
- // value is optional
- onTagged: function(doclet, tag) {
- doclet.experimental = tag.value || EMPTY;
- }
- });
-
- /**
- * Re-introduce the deprecated 'final tag. JSDoc used it as a synonym for readonly, but we use it to mark classes as final
- */
- dictionary.defineTag('final', {
- mustNotHaveValue: true,
- onTagged: function(doclet, tag) {
- doclet.final_ = true;
- }
- });
-
- /**
- * Introduce a new kind of symbol: 'interface'
- * 'interface' is like 'class', but without a constructor.
- * Support for 'interface' might not be complete (only standard UI5 use cases tested)
- */
- dictionary.defineTag('interface', {
- //mustNotHaveValue: true,
- onTagged: function(doclet, tag) {
- // debug("setting kind of " + doclet.name + " to 'interface'");
- doclet.kind = 'interface';
- if ( tag.value ) {
- doclet.classdesc = tag.value;
- }
- }
- });
-
- /**
- * Classes can declare that they implement a set of interfaces
- */
- dictionary.defineTag('implements', {
- mustHaveValue: true,
- onTagged: function(doclet, tag) {
- // console.log("setting implements of " + doclet.name + " to 'interface'");
- if ( tag.value ) {
- doclet.implements = doclet.implements || [];
- tag.value.split(/\s*,\s*/g).forEach(function($) {
- if ( doclet.implements.indexOf($) < 0 ) {
- doclet.implements.push($);
- }
- });
- }
- }
- });
-
- /**
- * Set the visibility of a doclet to 'restricted'.
- */
- dictionary.defineTag('ui5-restricted', {
- onTagged: function(doclet, tag) {
- doclet.access = 'restricted';
- if ( tag.value ) {
- ui5data(doclet).stakeholders = tag.value.trim().split(/(?:\s*,\s*|\s+)/);
- }
- }
- });
- dictionary.defineSynonym('ui5-restricted', 'sap-restricted');
-
- /**
- * Mark a doclet as synthetic.
- *
- * Used for doclets that the autodoc generation creates. This helps the template
- * later to recognize such doclets and maybe filter them out.
- */
- dictionary.defineTag('synthetic', {
- mustNotHaveValue: true,
- onTagged: function(doclet, tag) {
- doclet.synthetic = true;
- }
- });
-
- /**
- * Mark a doclet that intentionally updates a previous doclet
- */
- dictionary.defineTag('ui5-updated-doclet', {
- mustNotHaveValue: true,
- onTagged: function(doclet, tag) {
- ui5data(doclet).updatedDoclet = true;
- }
- });
-
- /**
- * The @hideconstructor tag tells JSDoc that the generated documentation should not display the constructor for a class.
- * Note: this tag will be natively available in JSDoc >= 3.5.0
- */
- dictionary.defineTag('hideconstructor', {
- mustNotHaveValue: true,
- onTagged: function(doclet, tag) {
- doclet.hideconstructor = true;
- }
- });
-
- dictionary.defineTag('slot', {
- onTagged: function(doclet, tag) {
- doclet.slot = true;
- if (tag.value) {
- doclet.propertyName = tag.value;
- }
- }
- });
-
- dictionary.defineTag('appenddocs', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.appenddocs = tag.value;
- }
- });
-
- dictionary.defineTag('tagname', {
- mustHaveValue: true,
- onTagged: function(doclet, tag) {
- doclet.tagname = tag.value;
- }
- });
-
- dictionary.defineTag('allowPreventDefault', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.allowPreventDefault = true;
- }
- });
-
- dictionary.defineTag('native', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.native = true;
- }
- });
-
- dictionary.defineTag('noattribute', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.noattribute = true;
- }
- });
-
- dictionary.defineTag('formEvents', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- if (tag.value) {
- doclet.formEvents = doclet.formEvents || [];
- tag.value.split(" ").forEach(function($) {
- if ( doclet.formEvents.indexOf($) < 0 ) {
- doclet.formEvents.push($);
- }
- });
- }
- }
- });
-
- dictionary.defineTag('formProperty', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.formProperty = true;
- }
- });
-
- dictionary.defineTag('formAssociated', {
- mustHaveValue: false,
- onTagged: function(doclet, tag) {
- doclet.formAssociated = doclet.formAssociated || true;
- }
- });
-};
-
-exports.handlers = {
-
- /**
- * Before all files are parsed, determine the common path prefix of all filenames
- */
- parseBegin : function(e) {
-
- pathPrefixes = env.opts._.reduce(function(result, fileOrDir) {
- fileOrDir = path.resolve( path.normalize(fileOrDir) );
- if ( fs.statSync(fileOrDir).isDirectory() ) {
- // ensure a trailing path separator
- if ( fileOrDir.indexOf(path.sep, fileOrDir.length - path.sep.length) < 0 ) {
- fileOrDir += path.sep;
- }
- result.push(fileOrDir);
- }
- return result;
- }, []);
- resourceNamePrefixes = pluginConfig.resourceNamePrefixes || [];
- if ( !Array.isArray(resourceNamePrefixes) ) {
- resourceNamePrefixes = [resourceNamePrefixes];
- }
- resourceNamePrefixes.forEach(ensureEndingSlash);
- while ( resourceNamePrefixes.length < pathPrefixes.length ) {
- resourceNamePrefixes.push('');
- }
-
- debug("path prefixes " + JSON.stringify(pathPrefixes));
- debug("resource name prefixes " + JSON.stringify(resourceNamePrefixes));
- },
-
- /**
- * Log each file before it is parsed
- */
- fileBegin: function (e) {
- currentProgram = undefined;
- currentModule = {
- name: null,
- resource: getResourceName(e.filename),
- module: getModuleName(getResourceName(e.filename)),
- localNames: Object.create(null)
- };
- },
-
- fileComplete: function (e) {
- // debug("module info after parsing: ", currentModule);
- currentSource = undefined;
- currentProgram = undefined;
- currentModule = undefined;
- },
-
- jsdocCommentFound: function(e) {
- // console.log("jsdocCommentFound: " + e.comment);
- e.comment = preprocessComment(e);
- },
-
- symbolFound: function(e) {
- // console.log("symbolFound: " + e.comment);
- },
-
- newDoclet: function(e) {
-
- var _ui5data = ui5data(e.doclet);
-
- // remove code: this is a try to reduce the required heap size
- if ( e.doclet.meta ) {
- if ( e.doclet.meta.code ) {
- e.doclet.meta.code = {};
- }
- var filepath = (e.doclet.meta.path && e.doclet.meta.path !== 'null' ) ? path.join(e.doclet.meta.path, e.doclet.meta.filename) : e.doclet.meta.filename;
- e.doclet.meta.__shortpath = getRelativePath(filepath);
- _ui5data.resource = currentModule.resource;
- _ui5data.module = currentModule.name || currentModule.module;
- }
-
-
- // JSDoc 3 has a bug when it encounters a property in an object literal with an empty string as name
- // (e.g. { "" : something } will result in a doclet without longname
- if ( !e.doclet.longname ) {
- if ( e.doclet.memberof ) {
- e.doclet.longname = e.doclet.memberof + "." + e.doclet.name; // TODO '.' depends on scope?
- warning("found doclet without longname, derived longname: " + e.doclet.longname + " " + location(e.doclet));
- } else {
- error("found doclet without longname, could not derive longname " + location(e.doclet));
- }
- return;
- }
-
- // try to detect misused memberof
- if ( e.doclet.memberof && e.doclet.longname.indexOf(e.doclet.memberof) !== 0 ) {
- warning("potentially unsupported use of @name and @memberof " + location(e.doclet));
- //console.log(e.doclet);
- }
-
- if ( e.doclet.returns
- && e.doclet.returns.length > 0
- && e.doclet.returns[0]
- && e.doclet.returns[0].type
- && e.doclet.returns[0].type.names
- && e.doclet.returns[0].type.names[0] === 'this'
- && e.doclet.memberof ) {
- warning("fixing return type 'this' with " + e.doclet.memberof);
- e.doclet.returns[0].type.names[0] = e.doclet.memberof;
- }
- },
-
- beforeParse : function(e) {
- msgHeader("parsing " + getRelativePath(e.filename));
- currentSource = e.source;
- },
-
- parseComplete : function(e) {
-
- var doclets = e.doclets;
- var l = doclets.length,i,j,doclet;
- //var noprivate = !env.opts.private;
- var rAnonymous = /^new
) or as a normal function.
- * It always returns an immutable Version instance.
- *
- * The parts of the version number (major, minor, patch, suffix) can be provided in several ways:
- * tag, whitespace is preserved - * - * Whitespace inside an element tag is not touched (although it could be normalized as well) - * @param {string} content raw HTML file - * @returns {string} HTML file with normalized whitespace - */ -function normalizeWhitespace(content) { - var compressed = '', - preformatted = 0, - p = 0, m, text; - - REGEXP_TAG.lastIndex = 0; - while ( m = REGEXP_TAG.exec(content) ) { - if ( m.index > p ) { - text = content.slice(p, m.index); - if ( preformatted ) { - compressed += text; - // console.log(' "' + text + '" (preformatted)'); - } else { - text = text.replace(/\s+/g,' '); - if ( text.trim() ) { - compressed += text; - } - // console.log(' "' + text + '" (trimmed)'); - } - } - - compressed += m[0]; - // console.log(' "' + m[0] + '" (tag)'); - p = m.index + m[0].length; - - if ( /^pre$/i.test(m[1]) ) { - preformatted++; - } else if ( /^\/pre$/i.test(m[1]) && preformatted ) { - preformatted--; - } - - } - - if ( content.length > p ) { - text = content.slice(p, content.length); - if ( preformatted ) { - compressed += text; - // console.log(' "' + text + '" (preformatted)'); - } else { - text = text.replace(/\s+/g,' '); - if ( text.trim() ) { - compressed += text; - } - // console.log(' "' + text + '" (trimmed)'); - } - } - - return compressed; -} - -function makeLinkToSymbolFile(longname) { - return Link.baseSymbols + __uniqueFilenames[longname] + conf.ext; -} - -function simpleNameOf(longname) { - longname = String(longname); - var p = longname.lastIndexOf('.'); - return p < 0 ? longname : longname.slice(p + 1); -} - -function bySimpleName(a,b) { - if ( a === b ) { - return 0; - } - var simpleA = simpleNameOf(a); - var simpleB = simpleNameOf(b); - if ( simpleA === simpleB ) { - return a < b ? -1 : 1; - } else { - return simpleA < simpleB ? -1 : 1; - } -} - -/** Build output for displaying function parameters. */ -function makeSignature(params) { - var r = ['('], desc; - if ( params ) { - for (var i = 0, p; p = params[i]; i++) { - // ignore @param tags for 'virtual' params that are used to document members of config-like params - // (e.g. like "@param param1.key ...") - if (p.name && p.name.indexOf('.') == -1) { - if (i > 0) - r.push(', '); - - r.push(''); - r.push(p.name); - r.push(''); - if ( p.optional ) - r.push('?'); - } - } - } - r.push(')'); - return r.join(''); -} - - -/* - * regexp to recognize important places in the text - * - * Capturing groups of the RegExp: - * group 1: begin of a pre block - * group 2: end of a pre block - * group 3: begin of a header/ul/ol/table, implicitly ends a paragraph - * group 4: end of a header/ul/ol/table, implicitly starts a new paragraph - * group 5: target portion of an inline @link tag - * group 6: (optional) text portion of an inline link tag - * group 7: an empty line which implicitly starts a new paragraph - * - * [-------block -------] [----------------------- some flow content -----------------------] [---- an inline {@link ...} tag ----] [---------- an empty line ---------] */ -var rFormatText = /(]*)?>)|(<\/pre>)|(<(?:h[\d+]|ul|ol|table)(?:\s[^>]*)?>)|(<\/(?:h[\d+]|ul|ol|table)>)|\{@link\s+([^}\s]+)(?:\s+([^\}]*))?\}|((?:\r\n|\r|\n)[ \t]*(?:\r\n|\r|\n))/gi; - -function formatText(text) { - - if ( !text ) { - return ''; - } - - var inpre = false, - paragraphs = 0; - - text = String(text).replace(rFormatText, function(match, pre, endpre, flow, endflow, linkTarget, linkText, emptyline) { - if ( pre ) { - inpre = true; - return pre.replace(//gi, "").replace(//gi, ""); - } else if ( endpre ) { - inpre = false; - } else if ( flow ) { - if ( !inpre ) { - paragraphs++; - return '' + match; - } - } else if ( endflow ) { - if ( !inpre ) { - paragraphs++; - return match + ''; - } - } else if ( emptyline ) { - if ( !inpre ) { - paragraphs++; - return '
'; - } - } else if ( linkTarget ) { - if ( !inpre ) { - // convert to a hyperlink - var link = new Link().toSymbol(linkTarget); - // if link tag contained a replacement text, use it - if ( linkText && linkText.trim()) { - link = link.withText(linkText.trim()); - } - return link.toString(); - } - } - return match; - }); - - if ( paragraphs > 0 ) { - text = '
' + text + '
'; - } - - // remove empty paragraphs - text = text.replace(/\s*<\/p>/g, ''); - - return text; -} - - -//console.log("#### samples"); -//console.log(formatText(summarize("This is a first\n\nparagraph with empty \n \n \nlines in it. This is the remainder."))); - -function childrenOfKind(data, kind) { - /* old version based on TaffyDB (slow) - var oChildren = symbolSet({kind: kind, memberof: data.longname === GLOBAL_LONGNAME ? {isUndefined: true} : data.longname}).filter(function() { return conf.filter(this); }); - return { - own : oChildren.filter({inherited: {isUndefined:true}}).get().sort(makeSortby("!deprecated","static","name")), - borrowed : groupByContributors(data, oChildren.filter({inherited: true}).get().sort(makeSortby("name"))) - } */ - var oResult = { - own: [], - borrowed: [] - }; - //console.log("calculating kind " + kind + " from " + data.longname); - //console.log(data); - var fnFilter; - switch (kind) { - case 'property': - fnFilter = function($) { - return $.kind === 'constant' || ($.kind === 'member' && !$.isEnum); - } - break; - case 'event': - fnFilter = function($) { - return $.kind === 'event'; - } - break; - case 'method': - fnFilter = function($) { - return $.kind === 'function'; - } - break; - default: - // default: none - fnFilter = function($) { return false; }; - break; - } - - if ( data.__ui5.members ) { - data.__ui5.members.forEach(function($) { - if ( fnFilter($) && conf.filter($) ) { - oResult[$.inherited ? 'borrowed' : 'own'].push($); - } - }); - } - oResult.own.sort(makeSortby("!deprecated","static","name")); - oResult.borrowed = groupByContributors(data, oResult.borrowed); - - return oResult; -} - -/** - * Determines the set of contributors of the given borrowed members. - * The contributors are sorted according to the inheritance hierarchy: - * first the base class of symbol, then the base class of the base class etc. - * Any contributors that can not be found in the hierarchy are appended - * to the set. - * - * @param symbol of which these are the members - * @param borrowedMembers set of borrowed members to determine the contributors for - * @return sorted array of contributors - */ -function groupByContributors(symbol, aBorrowedMembers) { - - var MAX_ORDER = 1000, // a sufficiently large number - mContributors = {}, - aSortedContributors = [], - i,order; - - aBorrowedMembers.forEach(function($) { - $ = lookup($.inherits); - if ($ && mContributors[$.memberof] == null) { - mContributors[$.memberof] = { order : MAX_ORDER, items : [$] }; - } else { - mContributors[$.memberof].items.push($); - } - }); - - // order contributors according to their distance in the inheritance hierarchy - order = 0; - (function handleAugments(oSymbol) { - var i,oTarget,aParentsToVisit; - if ( oSymbol.augments ) { - aParentsToVisit = []; - // first assign an order - for (i = 0; i < oSymbol.augments.length; i++) { - if ( mContributors[oSymbol.augments[i]] != null && mContributors[oSymbol.augments[i]].order === MAX_ORDER ) { - mContributors[oSymbol.augments[i]].order = ++order; - aParentsToVisit.push(oSymbol.augments[i]); - } - } - // only then dive into parents (breadth first search) - for (i = 0; i < aParentsToVisit.length; i++) { - oTarget = lookup(aParentsToVisit); - if ( oTarget ) { - handleAugments(oTarget); - } - } - } - }(symbol)); - - // convert to an array and sort by order - for (i in mContributors) { - aSortedContributors.push(mContributors[i]); - } - aSortedContributors.sort(function (a,b) { return a.order - b.order; }); - - return aSortedContributors; - -} - -function makeLinkList(aSymbols) { - return aSymbols - .sort(makeSortby("name")) - .map(function($) { return new Link().toSymbol($.longname).withText($.name); }) - .join(", "); -} - -// ---- type parsing --------------------------------------------------------------------------------------------- - -function TypeParser(defaultBuilder) { - - /* TODO - * - function(this:) // type of this - * - function(new:) // constructor - */ - var rLexer = /\s*(Array\.?<|Object\.?<|Set\.?<|Promise\.?<|function\(|\{|:|\(|\||\}|>|\)|,|\[\]|\*|\?|!|\.\.\.)|\s*((?:module:)?\w+(?:[\/.#~]\w+)*)|./g; - - var input, - builder, - token, - tokenStr; - - function next(expected) { - if ( expected !== undefined && token !== expected ) { - throw new SyntaxError("TypeParser: expected '" + expected + "', but found '" + tokenStr + "' (pos: " + rLexer.lastIndex + ", input='" + input + "')"); - } - var match = rLexer.exec(input); - if ( match ) { - tokenStr = match[1] ||Â match[2]; - token = match[1] || (match[2] && 'symbol'); - if ( !token ) { - throw new SyntaxError("TypeParser: unexpected '" + tokenStr + "' (pos: " + match.index + ", input='" + input + "')"); - } - } else { - tokenStr = token = null; - } - } - - function parseType() { - var nullable = false; - var mandatory = false; - if ( token === '?' ) { - next(); - nullable = true; - } else if ( token === '!' ) { - next(); - mandatory = true; - } - - var type; - - if ( token === 'Array.<' ||Â token === 'Array<' ) { - next(); - var componentType = parseType(); - next('>'); - type = builder.array(componentType); - } else if ( token === 'Object.<' ||Â token === 'Object<' ) { - next(); - var keyType; - var valueType = parseType(); - if ( token === ',' ) { - next(); - keyType = valueType; - valueType = parseType(); - } else { - keyType = builder.synthetic(builder.simpleType('string')); - } - next('>'); - type = builder.object(keyType, valueType); - } else if ( token === 'Set.<' ||Â token === 'Set<' ) { - next(); - var elementType = parseType(); - next('>'); - type = builder.set(elementType); - } else if ( token === 'Promise.<' ||Â token === 'Promise<' ) { - next(); - var elementType = parseType(); - next('>'); - type = builder.promise(elementType); - } else if ( token === 'function(' ) { - next(); - var thisType, constructorType, paramTypes = [], returnType; - if ( tokenStr === 'this' ) { - next(); - next(':'); - thisType = parseType(); - if ( token === ',' ) { - next(); - } - } else if ( tokenStr === 'new' ) { - next(); - next(':'); - constructorType = parseType(); - if ( token === ',' ) { - next(); - } - } - while ( token === 'symbol' || token === '...' ) { - var repeatable = token === '...'; - if ( repeatable) { - next(); - } - var paramType = parseType(); - if ( repeatable ) { - paramType = builder.repeatable(paramType); - } - paramTypes.push(paramType); - if ( token === ',' ) { - if ( repeatable ) { - throw new SyntaxError("TypeParser: only the last parameter of a function can be repeatable (pos: " + rLexer.lastIndex + ", input='" + input + "')"); - } - next(); - } - } - next(')'); - if ( token === ':' ) { - next(':'); - returnType = parseType(); - } - type = builder.function(paramTypes, returnType, thisType, constructorType); - } else if ( token === '{' ) { - var structure = Object.create(null); - var propName,propType; - next(); - do { - propName = tokenStr; - if ( !/^\w+$/.test(propName) ) { - throw new SyntaxError("TypeParser: structure field must have a simple name (pos: " + rLexer.lastIndex + ", input='" + input + "', field:'" + propName + "')"); - } - next('symbol'); - if ( token === ':' ) { - next(); - propType = parseType(); - } else { - propType = builder.synthetic(builder.simpleType('any')); - } - structure[propName] = propType; - if ( token === '}' ) { - break; - } - next(','); - } while (token); - next('}'); - type = builder.structure(structure); - } else if ( token === '(' ) { - next(); - type = parseTypes(); - next(')'); - } else if ( token === '*' ) { - next(); - type = builder.simpleType('*'); - } else { - type = builder.simpleType(tokenStr); - next('symbol'); - while ( token === '[]' ) { - next(); - type = builder.array(type); - } - } - if ( nullable ) { - type = builder.nullable(type); - } - if ( mandatory ) { - type = builder.mandatory(type); - } - return type; - } - - function parseTypes() { - var types = []; - do { - types.push(parseType()); - if ( token !== '|' ) { - break; - } - next(); - } while (token); - return types.length === 1 ? types[0] : builder.union(types); - } - - this.parse = function(typeStr, tempBuilder) { - builder = tempBuilder ||Â defaultBuilder ||Â TypeParser.ASTBuilder; - input = String(typeStr); - rLexer.lastIndex = 0; - next(); - var type = parseTypes(); - next(null); - return type; - } - -} - -TypeParser.ASTBuilder = { - simpleType: function(type) { - return { - type: 'simpleType', - name: type - }; - }, - array: function(componentType) { - return { - type: 'array', - component: componentType - }; - }, - object: function(keyType, valueType) { - return { - type: 'object', - key: keyType, - value: valueType - }; - }, - set: function(elementType) { - return { - type: 'set', - element: elementType - }; - }, - promise: function(fulfillmentType) { - return { - type: 'promise', - fulfill: fulfillmentType - }; - }, - function: function(paramTypes, returnType, thisType, constructorType) { - return { - type: 'function', - params: paramTypes, - return: returnType, - this: thisType, - constructor: constructorType - }; - }, - structure: function(structure) { - return { - type: 'structure', - fields: structure - }; - }, - union: function(types) { - return { - type: 'union', - types: types - }; - }, - synthetic: function(type) { - type.synthetic = true; - return type; - }, - nullable: function(type) { - type.nullable = true; - return type; - }, - mandatory: function(type) { - type.mandatory = true; - return type; - }, - repeatable: function(type) { - type.repeatable = true; - return type; - } -}; - -TypeParser.LinkBuilder = function(style, encoded) { - this.linkStyle = style; - this.lt = encoded ? "<" : "<"; - this.gt = encoded ? ">" : ">"; -}; -TypeParser.LinkBuilder.prototype = { - safe: function(type) { - return type.needsParenthesis ? "(" + type.str + ")" : type.str; - }, - simpleType: function(type) { - if ( this.linkStyle === 'text' ) { - return { - str: type - }; - } - var link = new Link().toSymbol(type); - if ( this.linkStyle === 'short' ) { - link.withText(simpleNameOf(type)).withTooltip(type); - } - return { - str: link.toString() - }; - }, - array: function(componentType) { - if ( componentType.needsParenthesis ) { - return { - str: "Array.<" + componentType.str + ">" - }; - } - return { - str: componentType.str + "[]" - }; - }, - object: function(keyType, valueType) { - if ( keyType.synthetic ) { - return { - str: "Object." + this.lt + valueType.str + this.gt - }; - } - return { - str: "Object." + this.lt + keyType.str + "," + valueType.str + this.gt - }; - }, - set: function(elementType) { - return { - str: 'Set.' + this.lt + elementType.str + this.gt - }; - }, - promise: function(fulfillmentType) { - return { - str: 'Promise.' + this.lt + fulfillmentType.str + this.gt - }; - }, - function: function(paramTypes, returnType) { - return { - str: "function(" + paramTypes.map(function(type) {Â return type.str; }).join(',') + ")" + ( returnType ? " : " + this.safe(returnType) : "") - }; - }, - structure: function(structure) { - var r = []; - for ( var fieldName in structure ) { - if ( structure[fieldName].synthetic ) { - r.push(fieldName); - } else { - r.push(fieldName + ":" + structure[fieldName].str); - } - } - return { - str: "{" + r.join(",") + "}" - }; - }, - union: function(types) { - return { - needsParenthesis: true, - str: types.map( this.safe.bind(this) ).join('|') - }; - }, - synthetic: function(type) { - type.synthetic = true; - return type; - }, - nullable: function(type) { - type.str = "?" + type.str; - return type; - }, - mandatory: function(type) { - type.str = "!" + type.str; - return type; - }, - repeatable: function(type) { - type.str = "..." + type.str; - return type; - } -}; - -var typeParser = new TypeParser(); -var _SHORT_BUILDER = new TypeParser.LinkBuilder('short', true); -var _LONG_BUILDER = new TypeParser.LinkBuilder('long', true); -var _TEXT_BUILDER = new TypeParser.LinkBuilder('text', false); -var _TEXT_BUILDER_ENCODED = new TypeParser.LinkBuilder('text', true); - -/* -function testTypeParser(type) { - console.log("Type: '" + type + "' gives AST"); - try { - console.log(typeParser.parse(type)); - } catch (e) { - console.log("**** throws: " + e); - } -} - -testTypeParser("Array.
"); -testTypeParser("Array "); -testTypeParser("Object. "); -testTypeParser("Object "); -testTypeParser("function(...string):Set "); -testTypeParser("{a:int,b,c:float,d,e}"); -*/ - -function _processTypeString(type, builder) { - if ( type && Array.isArray(type.names) ) { - type = type.names.join('|'); - } - if ( type ) { - try { - return typeParser.parse( type, builder ).str; - }Â catch (e) { - error("failed to parse type string '" + type + "': " + e); - return type; - } - } -} - -function listTypes(type, encoded) { - return _processTypeString(type, encoded ? _TEXT_BUILDER_ENCODED : _TEXT_BUILDER); -} - -function linkTypes(type, short) { - return _processTypeString(type, short ? _SHORT_BUILDER : _LONG_BUILDER ); -} - -function isArrayType(type) { - if ( type && Array.isArray(type.names) ) { - type = type.names.join('|'); - } - if ( type ) { - try { - var ast = typeParser.parse( type, TypeParser.ASTBuilder ); - return ( ast.type === 'array' || (ast.type === 'union' && ast.types.some( function(subtype) { return subtype.type === 'array'; })) ); - }Â catch (e) { - error("failed to parse type string '" + type + "': " + e); - } - } - return false; -} - -/** - * Reduces the given text to a summary and removes all tags links etc. and escapes double quotes. - * The result therefore should be suitable as content for an HTML tag attribute (e.g. title). - * @param sText - * @return summarized, plain attribute - */ -function asPlainSummary(sText) { - return sText ? summarize(sText).replace(/<.*?>/g, '').replace(/\{\@link\s*(.*?)\}/g, '$1').replace(/"/g,""") : ''; -} - -function getNSClass(item) { - if (item.kind === 'interface') { - return " interface"; - } else if (item.kind === 'namespace') { - return " namespace"; - } else if (item.kind === 'typedef' ) { - return " typedef"; - } else if (item.kind === 'member' && item.isEnum ) { - return " enum"; - } else { - return ""; - } -} - -/* - * regexp to recognize important places in the text - * - * Capturing groups of the RegExp: - * group 1: begin of a pre block - * group 2: end of a pre block - * group 3: an empty line + surrounding whitespace (implicitly starts a new paragraph) - * group 4: an isolated line feed + surrounding whitespace - * - * [------- block -------] [---- an empty line and surrounding whitespace ----] [---- new line or whitespaces ----] */ -var rNormalizeText = /(]*)?>)|(<\/pre>)|([ \t]*(?:\r\n|\r|\n)[ \t]*(?:\r\n|\r|\n)[ \t\r\n]*)|([ \t]*(?:\r\n|\r|\n)[ \t]*|[ \t]+)/gi; - -function normalizeWS(text) { - if ( text == null ) { - return text; - } - - var inpre = false; - return String(text).replace(rNormalizeText, function(match, pre, endpre, emptyline, ws) { - if ( pre ) { - inpre = true; - return pre; - } else if ( endpre ) { - inpre = false; - return endpre; - } else if ( emptyline ) { - return inpre ? emptyline : '\n\n'; - } else if ( ws ) { - return inpre ? ws : ' '; - } - return match; - }); - -} - -//---- add on: API JSON ----------------------------------------------------------------- - -function createAPIJSON(symbols, filename) { - - var api = { - "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0" - } - - if ( templateConf.version ) { - api.version = templateConf.version.replace(/-SNAPSHOT$/,""); - } - if ( templateConf.uilib ) { - api.library = templateConf.uilib; - } - - api.symbols = []; - // sort only a copy(!) of the symbols, otherwise the SymbolSet lookup is broken - symbols.slice(0).sort(sortByAlias).forEach(function(symbol) { - if ( isFirstClassSymbol(symbol) && !symbol.synthetic ) { // dump a symbol if it as a class symbol and if it is not a synthetic symbol - api.symbols.push(createAPIJSON4Symbol(symbol, false)); - } - }); - - postProcessAPIJSON(api); - - fs.mkPath(path.dirname(filename)); - fs.writeFileSync(filename, JSON.stringify(api), 'utf8'); - info(" apiJson saved as " + filename); -} - -function createAPIJSON4Symbol(symbol, omitDefaults) { - - var obj = []; - var curr = obj; - var attribForKind = 'kind'; - var stack = []; - - function isEmpty(obj) { - if ( !obj ) { - return true; - } - for (var n in obj) { - if ( obj.hasOwnProperty(n) ) { - return false; - } - } - return true; - } - - function tag(name, value, omitEmpty) { - - if ( omitEmpty && !value ) { - return; - } - if ( arguments.length === 1 ) { // opening tag - stack.push(curr); - stack.push(attribForKind); - var obj = {}; - if ( Array.isArray(curr) ) { - if ( attribForKind != null ) { - obj[attribForKind] = name; - } - curr.push(obj); - } else { - curr[name] = obj; - } - curr = obj; - attribForKind = null; - return; - } - if ( value == null ) { - curr[name] = true; - } else { - curr[name] = String(value); - } - } - - function attrib(name, value, defaultValue, raw) { - var emptyTag = arguments.length === 1; - if ( omitDefaults && arguments.length >= 3 && value === defaultValue ) { - return; - } - curr[name] = emptyTag ? true : (raw ? value : String(value)); - } - - function closeTag(name, noIndent) { - attribForKind = stack.pop(); - curr = stack.pop(); - } - - function collection(name, attribForKind) { - stack.push(curr); - stack.push(attribForKind); - // TODO only supported if this.curr was an object check or fully implement - curr = curr[name] = []; - attribForKind = attribForKind || null; - } - - function endCollection(name) { - attribForKind = stack.pop(); - curr = stack.pop(); - } - - function tagWithSince(name, value) { - - if ( !value ) { - return; - } - - var info = extractSince(value); - - tag(name); - if ( info.since ) { - attrib("since", info.since); - } - if ( info.value ) { - curr["text"] = normalizeWS(info.value); - } - closeTag(name, true); - - } - - function examples(symbol) { - var j, example; - - if ( symbol.examples && symbol.examples.length ) { - collection("examples"); - for ( j = 0; j < symbol.examples.length; j++) { - example = makeExample(symbol.examples[j]); - tag("example"); - if ( example.caption ) { - attrib("caption", example.caption); - } - attrib("text", example.example); - closeTag("example"); - } - endCollection("examples"); - } - } - - function referencesList(symbol) { - if ( symbol.see && symbol.see.length ) { - curr["references"] = symbol.see.slice(); - } - } - - function visibility($) { - if ( $.access === 'protected' ) { - return "protected"; - } else if ( $.access === 'restricted' ) { - return "restricted"; - } else if ( $.access === 'private' ) { - return "private"; - } else { - return "public"; - } - } - - function exceptions(symbol) { - var array = symbol.exceptions, - j, exception; - - if ( Array.isArray(array) ) { - array = array.filter( function (ex) { - return (ex.type && listTypes(ex.type)) || (ex.description && ex.description.trim()); - }); - } - if ( array == null ||Â array.length === 0 ) { - return; - } - - collection("throws"); - for (j = 0; j < array.length; j++) { - exception = array[j]; - tag("exception"); - if ( exception.type !== undefined ) { - attrib("type", listTypes(exception.type)); - } - tag("description", normalizeWS(exception.description), true); - closeTag("exception"); - } - endCollection("throws"); - } - - function methodList(tagname, methods) { - methods = methods && Object.keys(methods).map(function(key) { return methods[key]; }); - if ( methods != null && methods.length > 0 ) { - curr[tagname] = methods; - } - } - - function interfaceList(tagname, interfaces) { - if ( interfaces != null && interfaces.length > 0 ) { - curr[tagname] = interfaces.slice(); - } - } - - function hasSettings($, visited) { - - visited = visited || {}; - - if ( $.augments && $.augments.length > 0 ) { - var baseSymbol = $.augments[0]; - if ( visited.hasOwnProperty(baseSymbol) ) { - error("detected cyclic inheritance when looking at " + $.longname + ": " + JSON.stringify(visited)); - return false; - } - visited[baseSymbol] = true; - baseSymbol = lookup(baseSymbol) ; - if ( hasSettings(baseSymbol, visited) ) { - return true; - } - } - - var metadata = $.__ui5.metadata; - return metadata && - ( - !isEmpty(metadata.specialSettings) - || !isEmpty(metadata.properties) - || !isEmpty(metadata.aggregations) - || !isEmpty(metadata.associations) - || !isEmpty(metadata.annotations) - || !isEmpty(metadata.events) - ); - } - - function writeMetadata($) { - - var metadata = $.__ui5.metadata; - if ( !metadata ) { - return; - } - - var n; - - if ( metadata.specialSettings && Object.keys(metadata.specialSettings).length > 0 ) { - collection("specialSettings"); - for ( n in metadata.specialSettings ) { - var special = metadata.specialSettings[n]; - tag("specialSetting"); - attrib("name", special.name); - attrib("type", special.type); - attrib("visibility", special.visibility, 'public'); - if ( special.since ) { - attrib("since", extractVersion(special.since)); - } - tag("description", normalizeWS(special.doc), true); - tagWithSince("experimental", special.experimental); - tagWithSince("deprecated", special.deprecation); - methodList("method", special.methods); - closeTag("specialSetting"); - } - endCollection("specialSettings"); - } - - if ( metadata.properties && Object.keys(metadata.properties).length > 0 ) { - collection("properties"); - for ( n in metadata.properties ) { - var prop = metadata.properties[n]; - tag("property"); - attrib("name", prop.name); - attrib("type", prop.type, 'string'); - attrib("defaultValue", prop.defaultValue, null, /* raw = */true); - attrib("group", prop.group, 'Misc'); - attrib("readonly", prop.readonly); - attrib("visibility", prop.visibility, 'public'); - if ( prop.since ) { - attrib("since", extractVersion(prop.since)); - } - if ( prop.bindable ) { - attrib("bindable", prop.bindable, false, /* raw = */true); - } - tag("description", normalizeWS(prop.doc), true); - tagWithSince("experimental", prop.experimental); - tagWithSince("deprecated", prop.deprecation); - methodList("methods", prop.methods); - closeTag("property"); - } - endCollection("properties"); - } - - if ( metadata.defaultProperty ) { - tag("defaultProperty", metadata.defaultProperty); - } - - if ( metadata.dnd ) { - curr.dnd = metadata.dnd; - } - - if ( metadata.aggregations && Object.keys(metadata.aggregations).length > 0 ) { - collection("aggregations"); - for ( n in metadata.aggregations ) { - var aggr = metadata.aggregations[n]; - tag("aggregation"); - attrib("name", aggr.name); - attrib("singularName", aggr.singularName); // TODO omit default? - attrib("type", aggr.type, 'sap.ui.core.Control'); - if ( aggr.altTypes ) { - curr.altTypes = aggr.altTypes.slice(); - } - attrib("cardinality", aggr.cardinality, '0..n'); - attrib("visibility", aggr.visibility, 'public'); - if ( aggr.since ) { - attrib("since", extractVersion(aggr.since)); - } - if ( aggr.bindable ) { - attrib("bindable", aggr.bindable, false, /* raw = */true); - } - if ( aggr.dnd ) { - curr.dnd = aggr.dnd; - } - tag("description", normalizeWS(aggr.doc), true); - tagWithSince("experimental", aggr.experimental); - tagWithSince("deprecated", aggr.deprecation); - methodList("methods", aggr.methods); - closeTag("aggregation"); - } - endCollection("aggregations"); - } - - if ( metadata.defaultAggregation ) { - tag("defaultAggregation", metadata.defaultAggregation); - } - - if ( metadata.associations && Object.keys(metadata.associations).length > 0 ) { - collection("associations"); - for ( n in metadata.associations ) { - var assoc = metadata.associations[n]; - tag("association"); - attrib("name", assoc.name); - attrib("singularName", assoc.singularName); // TODO omit default? - attrib("type", assoc.type, 'sap.ui.core.Control'); - attrib("cardinality", assoc.cardinality, '0..1'); - attrib("visibility", assoc.visibility, 'public'); - if ( assoc.since ) { - attrib("since", extractVersion(assoc.since)); - } - tag("description", normalizeWS(assoc.doc), true); - tagWithSince("experimental", assoc.experimental); - tagWithSince("deprecated", assoc.deprecation); - methodList("methods", assoc.methods); - closeTag("association"); - } - endCollection("associations"); - } - - if ( metadata.events && Object.keys(metadata.events).length > 0 ) { - collection("events"); - for ( n in metadata.events ) { - var event = metadata.events[n]; - tag("event"); - attrib("name", event.name); - attrib("visibility", event.visibility, 'public'); - if ( event.since ) { - attrib("since", extractVersion(event.since)); - } - tag("description", normalizeWS(event.doc), true); - tagWithSince("experimental", event.experimental); - tagWithSince("deprecated", event.deprecation); - if ( event.parameters && Object.keys(event.parameters).length > 0 ) { - tag("parameters"); - for ( var pn in event.parameters ) { - if ( event.parameters.hasOwnProperty(pn) ) { - var param = event.parameters[pn]; - tag(pn); - attrib("name", pn); - attrib("type", param.type); - if ( param.since ) { - attrib("since", extractVersion(param.since)); - } - tag("description", normalizeWS(param.doc), true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecation); - closeTag(pn); - } - } - closeTag("parameters"); - } - methodList("methods", event.methods); - closeTag("event"); - } - endCollection("events"); - } - - if ( metadata.annotations && Object.keys(metadata.annotations).length > 0 ) { - collection("annotations"); - for ( n in metadata.annotations ) { - var anno = metadata.annotations[n]; - tag("annotation"); - attrib("name", anno.name); - attrib("namespace", anno.namespace); - if ( anno.target && anno.target.length > 0 ) { - curr.target = anno.target.slice(); - } - attrib("annotation", anno.annotation); - attrib("defaultValue", anno.defaultValue); - if ( anno.appliesTo && anno.appliesTo.length > 0 ) { - curr.appliesTo = anno.appliesTo.slice(); - } - if ( anno.since ) { - attrib("since", extractVersion(anno.since)); - } - tag("description", normalizeWS(anno.doc), true); - tagWithSince("deprecated", anno.deprecation); - closeTag("annotation"); - } - endCollection("annotations"); - } - - if ( metadata.designtime ) { // don't write falsy values - tag("designtime", metadata.designtime); - } - - } - - function writeParameterProperties(param, params) { - var prefix = param.name + '.', - altPrefix = isArrayType(param.type) ? param.name + '[].' : null, - count = 0, - i; - - for ( i = 0; i < params.length; i++ ) { - - var name = params[i].name; - if ( altPrefix && name.lastIndexOf(altPrefix, 0) === 0 ) { // startsWith - name = name.slice(altPrefix.length); - } else if ( name.lastIndexOf(prefix, 0) === 0 ) { // startsWith - if ( altPrefix ) { - warning("Nested @param tag in the context of an array type is used without []-suffix", name); - } - name = name.slice(prefix.length); - } else { - continue; - } - - if ( name.indexOf('.') >= 0 ) { - continue; - } - - if ( count === 0 ) { - tag("parameterProperties"); - } - - count++; - - tag(name); - attrib("name", name); - attrib("type", listTypes(params[i].type)); - attrib("optional", !!params[i].optional, false, /* raw = */true); - if ( params[i].defaultvalue !== undefined ) { - attrib("defaultValue", params[i].defaultvalue, undefined, /* raw = */true); - } - if ( params[i].since ) { - attrib("since", extractVersion(params[i].since)); - } - - writeParameterProperties(params[i], params); - - tag("description", normalizeWS(params[i].description), true); - tagWithSince("experimental", params[i].experimental); - tagWithSince("deprecated", params[i].deprecated); - - closeTag(name); - } - - if ( count > 0 ) { - closeTag("parameterProperties"); - } - } - - function methodSignature(member) { - var returns = member.returns && member.returns.length && member.returns[0]; - var type = member.type || (returns && returns.type); - type = listTypes(type); - //if ( type && type !== 'void' ) { - // attrib("type", type, 'void'); - //} - if ( type && type !== 'void' || returns && returns.description ) { - tag("returnValue"); - if ( type && type !== 'void' ) { - attrib("type", type); - } - if ( returns && returns.description ) { - attrib("description", normalizeWS(returns.description)); - } - closeTag("returnValue"); - } - - if ( member.params && member.params.length > 0 ) { - collection("parameters"); - for ( j = 0; j < member.params.length; j++) { - param = member.params[j]; - if ( param.name.indexOf('.') >= 0 ) { - continue; - } - tag("parameter"); - attrib("name", param.name); - attrib("type", listTypes(param.type)); - attrib("optional", !!param.optional, false, /* raw = */true); - if ( param.defaultvalue !== undefined ) { - attrib("defaultValue", param.defaultvalue, undefined, /* raw = */true); - } - if ( param.since ) { - attrib("since", extractVersion(param.since)); - } - writeParameterProperties(param, member.params); - tag("description", normalizeWS(param.description), true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - closeTag("parameter"); - } - endCollection("parameters"); - } - - exceptions(member); - - } - - function writeMethod(member, name) { - tag("method"); - attrib("name", name || member.name); - if ( member.__ui5.module && member.__ui5.module !== symbol.__ui5.module ) { - attrib("module", member.__ui5.module); - attrib("export", undefined, '', true); - } - attrib("visibility", visibility(member), 'public'); - if ( member.scope === 'static' ) { - attrib("static", true, false, /* raw = */true); - } - if ( member.since ) { - attrib("since", extractVersion(member.since)); - } - if ( member.tags && member.tags.some(function(tag) { return tag.title === 'ui5-metamodel'; }) ) { - attrib('ui5-metamodel', true, false, /* raw = */true); - } - - methodSignature(member); - - tag("description", normalizeWS(member.description), true); - tagWithSince("experimental", member.experimental); - tagWithSince("deprecated", member.deprecated); - examples(member); - referencesList(member); - //secTags(member); - if ( member.__ui5.resource && member.__ui5.resource !== symbol.__ui5.resource ) { - attrib("resource", member.__ui5.resource); - } - closeTag("method"); - - } - - /* - var rSplitSecTag = /^\s*\{([^\}]*)\}/; - - function secTags($) { - if ( true ) { - return; - } - var aTags = $.tags; - if ( !aTags ) { - return; - } - for (var iTag = 0; iTag < A_SECURITY_TAGS.length; iTag++ ) { - var oTagDef = A_SECURITY_TAGS[iTag]; - for (var j = 0; j < aTags.length; j++ ) { - if ( aTags[j].title.toLowerCase() === oTagDef.name.toLowerCase() ) { - tag(oTagDef.name); - var m = rSplitSecTag.exec(aTags[j].text); - if ( m && m[1].trim() ) { - var aParams = m[1].trim().split(/\s*\|\s* /); <-- remember to remove the space! - for (var iParam = 0; iParam < aParams.length; iParam++ ) { - tag(oTagDef.params[iParam], aParams[iParam]); - } - } - var sDesc = aTags[j].description; - tag("description", sDesc, true); - closeTag(oTagDef.name); - } - } - } - } - */ - - var kind = (symbol.kind === 'member' && symbol.isEnum) ? "enum" : symbol.kind; // handle pseudo-kind 'enum' - - tag(kind); - - attrib("name", symbol.longname); - attrib("basename", symbol.name); - if (symbol.tagname) { - attrib("tagname", symbol.tagname); - } - if (symbol.appenddocs) { - attrib("appenddocs", symbol.appenddocs); - } - if ( symbol.__ui5.resource ) { - attrib("resource", symbol.__ui5.resource); - } - if ( symbol.__ui5.module ) { - attrib("module", symbol.__ui5.module); - attrib("export", undefined, '', true); - } - if ( symbol.virtual ) { - attrib("abstract", true, false, /* raw = */true); - } - if ( symbol.final_ ) { - attrib("final", true, false, /* raw = */true); - } - if ( symbol.scope === 'static' ) { - attrib("static", true, false, /* raw = */true); - } - attrib("visibility", visibility(symbol), 'public'); - if ( symbol.since ) { - attrib("since", extractVersion(symbol.since)); - } - if ( symbol.augments && symbol.augments.length ) { - tag("extends", symbol.augments.sort().join(",")); // TODO what about multiple inheritance? - } - interfaceList("implements", symbol.implements); - tag("description", normalizeWS(symbol.classdesc || (symbol.kind === 'class' ? '' : symbol.description)), true); - tagWithSince("experimental", symbol.experimental); - tagWithSince("deprecated", symbol.deprecated); - if ( symbol.tags && symbol.tags.some(function(tag) { return tag.title === 'ui5-metamodel'; }) ) { - attrib('ui5-metamodel', true, false, /* raw = */true); - } - - var skipMembers = false; - var i, j, member, param; - - if ( kind === 'class' ) { - - if ( symbol.__ui5.stereotype || hasSettings(symbol) ) { - - tag("ui5-metadata"); - - if ( symbol.__ui5.stereotype ) { - attrib("stereotype", symbol.__ui5.stereotype); - } - - writeMetadata(symbol); - - closeTag("ui5-metadata"); - } - - - // IF @hideconstructor tag is present we omit the whole constructor - if ( !symbol.hideconstructor ) { - - tag("constructor"); - attrib("visibility", visibility(symbol)); - if (symbol.params && symbol.params.length > 0) { - collection("parameters"); - for (j = 0; j < symbol.params.length; j++) { - param = symbol.params[j]; - if (param.name.indexOf('.') >= 0) { - continue; - } - tag("parameter"); - attrib("name", param.name); - attrib("type", listTypes(param.type)); - attrib("optional", !!param.optional, false, /* raw = */true); - if (param.defaultvalue !== undefined) { - attrib("defaultValue", param.defaultvalue, undefined, /* raw = */true); - } - if (param.since) { - attrib("since", extractVersion(param.since)); - } - - writeParameterProperties(param, symbol.params); - tag("description", normalizeWS(param.description), true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - closeTag("parameter"); - } - endCollection("parameters"); - } - exceptions(symbol); - tag("description", normalizeWS(symbol.description), true); - // tagWithSince("experimental", symbol.experimental); // TODO repeat from class? - // tagWithSince("deprecated", symbol.deprecated); // TODO repeat from class? - examples(symbol); // TODO here or for class? - referencesList(symbol); // TODO here or for class? - // secTags(symbol); // TODO repeat from class? - closeTag("constructor"); - - } - } else if ( kind === 'namespace' ) { - if ( symbol.__ui5.stereotype || symbol.__ui5.metadata ) { - tag("ui5-metadata"); - - if ( symbol.__ui5.stereotype ) { - attrib("stereotype", symbol.__ui5.stereotype); - } - - if ( symbol.__ui5.metadata && symbol.__ui5.metadata.basetype ) { - attrib("basetype", symbol.__ui5.metadata.basetype); - } - - if ( symbol.__ui5.metadata && symbol.__ui5.metadata.pattern ) { - attrib("pattern", symbol.__ui5.metadata.pattern); - } - - if ( symbol.__ui5.metadata && symbol.__ui5.metadata.range ) { - attrib("range", symbol.__ui5.metadata.range, null, /* raw = */ true); - } - - closeTag("ui5-metadata"); - } - } else if ( kind === 'typedef' ) { - // typedefs have their own property structure - skipMembers = true; - if ( symbol.properties && symbol.properties.length > 0 ) { - collection("properties"); - symbol.properties.forEach(function(prop) { - tag("property"); - attrib("name", prop.name); - attrib("type", listTypes(prop.type)); - attrib("readonly", prop.readonly); - attrib("visibility", visibility(symbol), 'public'); // properties inherit visibility of typedef - tag("description", normalizeWS(prop.description), true); - closeTag("property") - }); - endCollection("properties"); - } - } else if ( kind === 'function' ) { - methodSignature(symbol); - } - - if ( !skipMembers ) { - var ownProperties = childrenOfKind(symbol, "property").own.sort(sortByAlias); - if ( ownProperties.length > 0 ) { - collection("properties"); - for ( i = 0; i < ownProperties.length; i++ ) { - member = ownProperties[i]; - if (!member.slot) { - tag("property"); - attrib("name", member.name); - if ( member.__ui5.module && member.__ui5.module !== symbol.__ui5.module ) { - attrib("module", member.__ui5.module); - attrib("export", undefined, '', true); - } - - if (member.noattribute) { - attrib("noattribute", true); - } - - if (member.readonly) { - attrib("readonly", member.readonly, null); - } - - attrib("visibility", visibility(member), 'public'); - if ( member.scope === 'static' ) { - attrib("static", true, false, /* raw = */true); - } - if ( member.since ) { - attrib("since", extractVersion(member.since)); - } - - if ( member.formEvents ) { - attrib("formEvents", member.formEvents); - } - - if ( member.formEvents ) { - attrib("formProperty", member.formProperty); - } - - var type = listTypes(member.type); - attrib("type", type); - - if ((type === "object" || type === "Object") && visibility(member) === "public") { - attrib("noattribute", true); - } - - tag("description", normalizeWS(member.description), true); - if (member.defaultvalue) { - attrib("defaultValue", member.defaultvalue); - } - - tagWithSince("experimental", member.experimental); - tagWithSince("deprecated", member.deprecated); - examples(member); - referencesList(member); - if ( member.__ui5.resource && member.__ui5.resource !== symbol.__ui5.resource ) { - attrib("resource", member.__ui5.resource); - } - closeTag("property"); - } - } - endCollection("properties"); - collection("slots"); - for (i = 0; i < ownProperties.length; i++) { - member = ownProperties[i]; - if (member.slot) { - tag("property"); - attrib("name", member.name); - if (member.propertyName) { - attrib("propertyName", member.propertyName); - } - if (member.__ui5.module && member.__ui5.module !== symbol.__ui5.module) { - attrib("module", member.__ui5.module); - attrib("export", undefined, '', true); - } - attrib("visibility", visibility(member), 'public'); - if (member.scope === 'static') { - attrib("static", true, false, /* raw = */true); - } - if (member.since) { - attrib("since", extractVersion(member.since)); - } - attrib("type", listTypes(member.type)); - tag("description", normalizeWS(member.description), true); - if (member.defaultvalue) { - attrib("defaultValue", member.defaultvalue); - } - - tagWithSince("experimental", member.experimental); - tagWithSince("deprecated", member.deprecated); - examples(member); - referencesList(member); - if (member.__ui5.resource && member.__ui5.resource !== symbol.__ui5.resource) { - attrib("resource", member.__ui5.resource); - } - closeTag("property"); - } - } - endCollection("slots"); - } - - var ownEvents = childrenOfKind(symbol, 'event').own.sort(sortByAlias); - if ( ownEvents.length > 0 ) { - collection("events"); - for (i = 0; i < ownEvents.length; i++ ) { - member = ownEvents[i]; - tag("event"); - attrib("name", member.name); - if ( member.__ui5.module && member.__ui5.module !== symbol.__ui5.module ) { - attrib("module", member.__ui5.module); - attrib("export", undefined, '', true); - } - if (member.allowPreventDefault) { - attrib("allowPreventDefault", true); - } - if (member.native) { - attrib("native", true); - } - attrib("visibility", visibility(member), 'public'); - if ( member.scope === 'static' ) { - attrib("static", true, false, /* raw = */true); - } - if ( member.since ) { - attrib("since", extractVersion(member.since)); - } - - if ( member.params && member.params.length > 0 ) { - collection("parameters"); - for (j = 0; j < member.params.length; j++) { - param = member.params[j]; - if ( param.name.indexOf('.') >= 0 ) { - continue; - } - - tag("parameter"); - attrib("name", param.name); - attrib("type", listTypes(param.type)); - if ( param.since ) { - attrib("since", extractVersion(param.since)); - } - writeParameterProperties(param, member.params); - tag("description", normalizeWS(param.description), true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - closeTag("parameter"); - } - endCollection("parameters"); - } - tag("description", normalizeWS(member.description), true); - tagWithSince("deprecated", member.deprecated); - tagWithSince("experimental", member.experimental); - examples(member); - referencesList(member); - //secTags(member); - if ( member.__ui5.resource && member.__ui5.resource !== symbol.__ui5.resource ) { - attrib("resource", member.__ui5.resource); - } - closeTag("event"); - } - endCollection("events"); - } - - var ownMethods = childrenOfKind(symbol, 'method').own.sort(sortByAlias); - if ( ownMethods.length > 0 ) { - collection("methods"); - for ( i = 0; i < ownMethods.length; i++ ) { - member = ownMethods[i]; - writeMethod(member); - if ( member.__ui5.members ) { - // HACK: export nested static functions as siblings of the current function - // A correct representation has to be discussed with the SDK / WebIDE - member.__ui5.members.forEach(function($) { - if ( $.kind === 'function' && $.scope === 'static' - && conf.filter($) && !$.inherited ) { - console.error("exporting nested function '" + member.name + "." + $.name + "'"); - writeMethod($, member.name + "." + $.name); - } - }); - } - } - endCollection("methods"); - } - - // if ( roots && symbol.__ui5.children && symbol.__ui5.children.length ) { - // collection("children", "kind"); - // symbol.__ui5.children.forEach(writeSymbol); - // endCollection("children"); - // } - } - - closeTag(kind); - - return obj[0]; -} - -function postProcessAPIJSON(api) { - var modules = {}; - var symbols = api.symbols; - var i,j,n,symbol,defaultExport; - - // collect modules and the symbols that refer to them - for ( i = 0; i < symbols.length; i++) { - symbol = symbols[i]; - if ( symbol.module ) { - modules[symbol.module] = modules[symbol.module] ||Â []; - modules[symbol.module].push({ - name: symbol.name, - symbol: symbol - }); - } - if ( symbol.properties ) { - for ( j = 0; j < symbol.properties.length; j++ ) { - if ( symbol.properties[j].static && symbol.properties[j].module ) { - modules[symbol.properties[j].module] = modules[symbol.properties[j].module] ||Â []; - modules[symbol.properties[j].module].push({ - name: symbol.name + "." + symbol.properties[j].name, - symbol: symbol.properties[j] - }); - } - } - } - if ( symbol.methods ) { - for ( j = 0; j < symbol.methods.length; j++ ) { - if ( symbol.methods[j].static && symbol.methods[j].module ) { - modules[symbol.methods[j].module] = modules[symbol.methods[j].module] ||Â []; - modules[symbol.methods[j].module].push({ - name: symbol.name + "." + symbol.methods[j].name, - symbol: symbol.methods[j] - }); - } - } - } - } - - for ( n in modules ) { - - symbols = modules[n].sort(function(a,b) { - if ( a.name === b.name ) { - return 0; - } - return a.name < b.name ? -1 : 1; - }); - - // info('resolving exports of ' + n + ": " + symbols.map(function(symbol) { return symbol.name; } )); - var moduleNamePath = "module:" + n; - if ( /^jquery\.sap\./.test(n) ) { - // the jquery.sap.* modules all export 'jQuery'. - // any API from those modules is reachable via 'jQuery.*' - defaultExport = 'jQuery'; - } else { - // library.js modules export the library namespace; for all other modules, the assumed default export - // is identical to the name of the module (converted to a 'dot' name) - defaultExport = n.replace(/\/library$/, "").replace(/\//g, "."); - } - - symbols.forEach(function(symbol) { - // console.log("check ", symbol.name, "against", defaultExport, "and", moduleNamePath); - if ( symbol.name === moduleNamePath ) { - // symbol name is the same as the module namepath -> symbol is the default export - symbol.symbol.export = ""; - } else if ( symbol.name.lastIndexOf(moduleNamePath + ".", 0) === 0 ) { - // symbol name starts with the module namepath and a dot -> symbol is a named export (static) - symbol.symbol.export = symbol.name.slice(moduleNamePath.length + 1); - } else if ( symbol.name === defaultExport ) { - // default export equals the symbol name - symbol.symbol.export = ""; - //console.log(" (default):" + defaultExport); - } else if (Â symbol.name.lastIndexOf(defaultExport + ".", 0) === 0 ) { - // default export is a prefix of the symbol name - symbol.symbol.export = symbol.name.slice(defaultExport.length + 1); - //console.log(" " + symbol.name.slice(defaultExport.length + 1) + ":" + symbol.name); - } else { - - // default export is not a prefix of the symbol name -> no way to access it in AMD - symbol.symbol.export = undefined; - if ( symbol.symbol.kind !== "namespace" - || (symbol.symbol.properties &&Â symbol.symbol.properties.length > 0) - || (symbol.symbol.methods &&Â symbol.symbol.methods.length > 0) ) { - error("could not identify export name of '" + symbol.name + "', contained in module '" + n + "'"); - } else { - debug("could not identify export name of namespace '" + symbol.name + "', contained in module '" + n + "'"); - } - } - }); - - } -} - -//---- add on: API XML ----------------------------------------------------------------- - -function createAPIXML(symbols, filename, options) { - - options = options || {}; - var roots = options.roots || null; - var legacyContent = !!options.legacyContent; - var omitDefaults = !!options.omitDefaults; - var addRedundancy = !!options.resolveInheritance; - - var indent = 0; - var output = []; - var sIndent = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; - var tags = []; - var ENUM = legacyContent ? "namespace" : "enum" ; - var BASETYPE = legacyContent ? "baseType" : "extends"; - var PROPERTY = legacyContent ? "parameter" : "property"; - var unclosedStartTag = false; - - function getAPIJSON(name) { - - var symbol = lookup(name); - if ( symbol && !symbol.synthetic ) { - return createAPIJSON4Symbol(symbol, false); - } - if ( addRedundancy && externalSymbols[name] ) { - debug(" using " + name + " from external dependency"); - return externalSymbols[name]; - } - return symbol; - } - - function encode(s) { - return s ? s.replace(/&/g, "&").replace(/ 0 ) - output.push(sIndent.slice(0,indent)); - if ( arguments.length ) { - for (var i = 0; i < arguments.length; i++) - output.push(arguments[i]); - } - output.push("\n"); - } - - function rootTag(name) { - tags = []; - unclosedStartTag = false; - tag(name); - } - - function closeRootTag(name) { - closeTag(name); - } - - function namespace(alias, namespace) { - attrib(alias, namespace); - } - - function tag(name, value, omitEmpty) { - - if ( omitEmpty && !value ) { - return; - } - if ( unclosedStartTag ) { - unclosedStartTag = false; - write('>\n'); - } - if ( arguments.length === 1 ) { // opening tag - if ( indent > 0 ) { - output.push(sIndent.slice(0,indent)); - } - write("<", name); - unclosedStartTag = true; - if ( legacyContent ) { - unclosedStartTag = false; - write(">\n"); - } - tags.push(name); - indent++; - return; - } - if ( value == null ) { - writeln("<", name, "/>"); - } else { - writeln("<", name, ">", encode(String(value)), "", name, ">"); - } - } - - function attrib(name, value, defaultValue) { - var emptyTag = arguments.length === 1; - if ( omitDefaults && arguments.length === 3 && value === defaultValue ) { - return; - } - - if ( !legacyContent ) { - write(" " + name + "=\""); - write(emptyTag ? "true" : encode(String(value)).replace(/"/g, """)); - write("\""); - } else { - if ( emptyTag ) { - writeln("<", name, "/>"); - } else { - writeln("<", name, ">", encode(String(value)), "", name, ">"); - } - } - } - - function closeTag(name, noIndent) { - - indent--; - var top = tags.pop(); - if ( top != name ) { - // ERROR? - } - - if ( unclosedStartTag ) { - unclosedStartTag = false; - write("/>\n"); - } else if ( noIndent ) { - write("", name, ">\n"); - } else { - writeln("", name, ">"); - } - } - - function textContent(text) { - if ( unclosedStartTag ) { - unclosedStartTag = false; - write('>'); - } - write(encode(text)); - } - - function tagWithSince(tagName, prop) { - if ( prop ) { - tag(tagName); - if ( prop.since ) { - attrib("since", prop.since); - } - if ( prop.text && prop.text.trim() ) { - textContent(prop.text); - } - closeTag(tagName, true); - } - } - - function getAsString() { - return output.join(""); - } - - function writeMetadata(symbolAPI, inherited) { - - var ui5Metadata = symbolAPI["ui5-metadata"]; - if ( !ui5Metadata ) { - return; - } - - if ( addRedundancy && symbolAPI["extends"] ) { - var baseSymbolAPI = getAPIJSON(symbolAPI["extends"]); - if ( baseSymbolAPI ) { - writeMetadata(baseSymbolAPI, true); - } - } - - if ( ui5Metadata.specialSettings ) { - ui5Metadata.specialSettings.forEach(function(special) { - tag("specialSetting"); - attrib("name", special.name); - attrib("type", special.type); - attrib("visibility", special.visibility, 'public'); - if ( special.since ) { - attrib("since", special.since); - } - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", special.description, true); - tagWithSince("experimental", special.experimental); - tagWithSince("deprecated", special.deprecated); - tag("methods", special.methods); - closeTag("specialSetting"); - }); - } - - if ( ui5Metadata.properties ) { - ui5Metadata.properties.forEach(function(prop) { - tag("property"); - attrib("name", prop.name); - attrib("type", prop.type, 'string'); - if ( prop.defaultValue !== null ) { - attrib("defaultValue", prop.defaultValue, null); - } - attrib("readonly", prop.readonly); - attrib("visibility", prop.visibility, 'public'); - if ( prop.since ) { - attrib("since", prop.since); - } - if ( prop.bindable ) { - attrib("bindable", prop.bindable); - } - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", prop.description, true); - tagWithSince("experimental", prop.experimental); - tagWithSince("deprecated", prop.deprecated); - tag("methods", prop.methods); - closeTag("property"); - }); - } - - if ( ui5Metadata.defaultProperty ) { - tag("defaultProperty", ui5Metadata.defaultProperty); - } - - if ( ui5Metadata.aggregations ) { - ui5Metadata.aggregations.forEach(function(aggr) { - tag("aggregation"); - attrib("name", aggr.name); - attrib("singularName", aggr.singularName); // TODO omit default? - attrib("type", aggr.type, 'sap.ui.core.Control'); - if ( aggr.altTypes ) { - attrib("altTypes", aggr.altTypes.join(",")); - } - attrib("cardinality", aggr.cardinality, '0..n'); - attrib("visibility", aggr.visibility, 'public'); - if ( aggr.since ) { - attrib("since", aggr.since); - } - if ( aggr.bindable ) { - attrib("bindable", aggr.bindable); - } - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", aggr.description, true); - tagWithSince("experimental", aggr.experimental); - tagWithSince("deprecated", aggr.deprecated); - tag("methods", aggr.methods); - closeTag("aggregation"); - }); - } - - if ( ui5Metadata.defaultAggregation ) { - tag("defaultAggregation", ui5Metadata.defaultAggregation); - } - - if ( ui5Metadata.associations ) { - ui5Metadata.associations.forEach(function(assoc) { - tag("association"); - attrib("name", assoc.name); - attrib("singularName", assoc.singularName); // TODO omit default? - attrib("type", assoc.type, 'sap.ui.core.Control'); - attrib("cardinality", assoc.cardinality, '0..1'); - attrib("visibility", assoc.visibility, 'public'); - if ( assoc.since ) { - attrib("since", assoc.since); - } - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", assoc.description, true); - tagWithSince("experimental", assoc.experimental); - tagWithSince("deprecated", assoc.deprecated); - tag("methods", assoc.methods); - closeTag("association"); - }); - } - - if ( ui5Metadata.events ) { - ui5Metadata.events.forEach(function(event) { - tag("event"); - attrib("name", event.name); - attrib("visibility", event.visibility, 'public'); - if ( event.since ) { - attrib("since", event.since); - } - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", event.description, true); - tagWithSince("experimental", event.experimental); - tagWithSince("deprecated", event.deprecated); - if ( event.parameters ) { - tag("parameters"); - for ( var pn in event.parameters ) { - if ( event.parameters.hasOwnProperty(pn) ) { - var param = event.parameters[pn]; - - tag("parameter"); - attrib("name", param.name); - attrib("type", param.type); - if ( param.since ) { - attrib("since", param.since); - } - tag("description", param.description, true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - closeTag("parameter"); - } - } - closeTag("parameters"); - } - tag("methods", event.methods, true); - closeTag("event"); - }); - } - - if ( ui5Metadata.annotations ) { - ui5Metadata.annotations.forEach(function(anno) { - tag("annotation"); - attrib("name", anno.name); - attrib("namespace", anno.namespace); // TODO omit default? - attrib("target", anno.target); - attrib("annotation", anno.annotation); - attrib("appliesTo", anno.appliesTo); - if ( anno.since ) { - attrib("since", anno.since); - } - tag("description", anno.description, true); - tagWithSince("deprecated", anno.deprecated); - closeTag("annotation"); - }); - } - - } - - function writeParameterPropertiesForMSettings(symbolAPI, inherited) { - - var ui5Metadata = symbolAPI["ui5-metadata"]; - if ( !ui5Metadata ) { - return; - } - - if ( symbolAPI["extends"] ) { - var baseSymbolAPI = getAPIJSON(symbolAPI["extends"]); - writeParameterPropertiesForMSettings(baseSymbolAPI, true); - } - - if ( ui5Metadata.specialSettings ) { - ui5Metadata.specialSettings.forEach(function(special) { - if ( special.visibility !== 'hidden' ) { - tag("property"); - attrib("name", special.name); - attrib("type", special.type); - attrib("optional"); - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", special.description, true); - closeTag("property"); - } - }); - } - - if ( ui5Metadata.properties ) { - ui5Metadata.properties.forEach(function(prop) { - tag("property"); - attrib("name", prop.name); - attrib("type", prop.type); - attrib("group", prop.group, 'Misc'); - if ( prop.defaultValue !== null ) { - attrib("defaultValue", typeof prop.defaultValue === 'string' ? "\"" + prop.defaultValue + "\"" : prop.defaultValue); - } - attrib("readonly", prop.readonly); - attrib("optional"); - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", prop.description, true); - closeTag("property"); - }); - } - - if ( ui5Metadata.aggregations ) { - ui5Metadata.aggregations.forEach(function(aggr) { - if ( aggr.visibility !== "hidden" ) { - tag("property"); - attrib("name", aggr.name); - attrib("type", aggr.type + (aggr.cardinality === '0..1' ? "" : "[]")); - if ( aggr.altTypes ) { - attrib("altTypes", aggr.altTypes.join(",")); - } - attrib("optional"); - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", aggr.description, true); - closeTag("property"); - } - }); - } - - if ( ui5Metadata.associations ) { - ui5Metadata.associations.forEach(function(assoc) { - if ( assoc.visibility !== "hidden" ) { - tag("property"); - attrib("name", assoc.name); - attrib("type", "(" + assoc.type + "|" + "string)" + (assoc.cardinality === '0..1' ? "" : "[]")); - attrib("optional"); - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", assoc.description, true); - closeTag("property"); - } - }); - } - - if ( ui5Metadata.events ) { - ui5Metadata.events.forEach(function(event) { - tag("property"); - attrib("name", event.name); - attrib("type", "function|array"); - attrib("optional"); - if ( inherited ) { - attrib("origin", symbolAPI.name); - } - tag("description", event.description, true); - closeTag("property"); - }); - } - - } - - function writeParameterProperties(param, paramName) { - var props = param.parameterProperties, - prefix = paramName + '.', - count = 0; - - if ( props ) { - for (var n in props ) { - if ( props.hasOwnProperty(n) ) { - - param = props[n]; - - if ( !legacyContent && count === 0 ) { - tag("parameterProperties"); - } - - count++; - - tag(PROPERTY); - attrib("name", legacyContent ? prefix + n : n); - attrib("type", param.type); - if ( param.since ) { - attrib("since", param.since); - } - if ( param.optional ) { - attrib("optional", param.optional); - } - - if ( !legacyContent ) { - writeParameterProperties(param, prefix + n); - } - - tag("description", param.description, true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - - closeTag(PROPERTY); - - if ( legacyContent ) { - writeParameterProperties(param, prefix + n); - } - } - } - } - - if ( !legacyContent && count > 0 ) { - closeTag("parameterProperties"); - } - } - - /* - var rSplitSecTag = /^\s*\{([^\}]*)\}/; - - function secTags($) { - if ( !legacyContent ) { - return; - } - var aTags = $.tags; - if ( !aTags ) { - return; - } - for (var iTag = 0; iTag < A_SECURITY_TAGS.length; iTag++ ) { - var oTagDef = A_SECURITY_TAGS[iTag]; - for (var j = 0; j < aTags.length; j++ ) { - if ( aTags[j].title.toLowerCase() === oTagDef.name.toLowerCase() ) { - tag(oTagDef.name); - var m = rSplitSecTag.exec(aTags[j].text); - if ( m && m[1].trim() ) { - var aParams = m[1].trim().split(/\s*\|\s* /); <-- remove the blank! - for (var iParam = 0; iParam < aParams.length; iParam++ ) { - tag(oTagDef.params[iParam], aParams[iParam]); - } - } - var sDesc = aTags[j].description; - tag("description", sDesc, true); - closeTag(oTagDef.name); - } - } - } - } - */ - - function writeSymbol(symbol) { - - var kind; - - if ( isFirstClassSymbol(symbol) && (roots || !symbol.synthetic) ) { // dump a symbol if it as a class symbol and if either hierarchies are dumped or if it is not a synthetic symbol - - // for the hierarchy we use only the local information - var symbolAPI = createAPIJSON4Symbol(symbol); - - kind = symbolAPI.kind === 'enum' ? ENUM : symbolAPI.kind; - - tag(kind); - - attrib("name", symbolAPI.name); - attrib("basename", symbolAPI.basename); -// if ( symbolAPI["resource"] ) { -// attrib("resource"); -// } - if ( symbolAPI["module"] ) { - attrib("module", symbolAPI["module"]); - } - if ( symbolAPI["abstract"] ) { - attrib("abstract"); - } - if ( symbolAPI["final"] ) { - attrib("final"); - } - if ( symbolAPI["static"] ) { - attrib("static"); - } - attrib("visibility", symbolAPI.visibility, 'public'); - if ( symbolAPI.since ) { - attrib("since", symbolAPI.since); - } - if ( symbolAPI["extends"] ) { - tag(BASETYPE, symbolAPI["extends"]); // TODO what about multiple inheritance? - } - tag("description", symbolAPI.description, true); - tagWithSince("experimental", symbolAPI.experimental); - tagWithSince("deprecated", symbolAPI.deprecated); - - if ( kind === 'class' ) { - - var hasSettings = symbolAPI["ui5-metadata"]; - - if ( !legacyContent && symbolAPI["ui5-metadata"] ) { - - tag("ui5-metadata"); - - if ( symbolAPI["ui5-metadata"].stereotype ) { - attrib("stereotype", symbolAPI["ui5-metadata"].stereotype); - } - - writeMetadata(symbolAPI); - - closeTag("ui5-metadata"); - - } - - tag("constructor"); - if ( legacyContent ) { - attrib("name", symbolAPI.basename); - } - attrib("visibility", symbolAPI.visibility, 'public'); - if ( symbolAPI.constructor.parameters ) { - symbolAPI.constructor.parameters.forEach(function(param, j) { - - tag("parameter"); - attrib("name", param.name); - attrib("type", param.type); - attrib("optional", param.optional, false); - if ( param.defaultValue !== undefined ) { - attrib("defaultValue", param.defaultValue); - } - if ( param.since ) { - attrib("since", param.since); - } - - if ( !legacyContent ) { - if ( hasSettings && j == 1 && /setting/i.test(param.name) && /object/i.test(param.type) ) { - if ( addRedundancy ) { - tag("parameterProperties"); - writeParameterPropertiesForMSettings(symbolAPI); - closeTag("parameterProperties"); - } - } else { - writeParameterProperties(param, param.name); - } - } - tag("description", param.description, true); - tagWithSince("experimental", param.experimental); - tagWithSince("deprecated", param.deprecated); - closeTag("parameter"); - if ( legacyContent ) { - writeParameterProperties(param, param.name); - } - }); - } - - tag("description", getConstructorDescription(symbol), true); - // tagWithSince("experimental", symbol.experimental); // TODO repeat from class? - // tagWithSince("deprecated", symbol.deprecated); // TODO repeat from class? - // secTags(symbol); // TODO repeat from class? - closeTag("constructor"); - } - - /* TODO MIGRATE or remove, if not needed - var ownSubspaces = ( symbol.__ui5.children || [] ).filter(function($) { return $.kind === 'namespace' }).sort(sortByAlias); - for (var i=0; i"); - rootTag("api"); - if ( !legacyContent ) { - namespace("xmlns", "http://www.sap.com/sap.ui.library.api.xsd"); - attrib("_version", "1.0.0"); - if ( templateConf.version ) { - attrib("version", templateConf.version.replace(/-SNAPSHOT$/,"")); - } - if ( templateConf.uilib ) { - attrib("library", templateConf.uilib); - } - } - - if ( roots ) { - roots.forEach(writeSymbol); - } else { - // sort only a copy(!) of the symbols, otherwise the SymbolSet lookup is broken - symbols.slice(0).sort(sortByAlias).forEach(writeSymbol); - } - - closeRootTag("api"); - - fs.mkPath(path.dirname(filename)); - fs.writeFileSync(filename, getAsString(), 'utf8'); -} - -//---- add on: API JS ----------------------------------------------------------------- - -function createAPIJS(symbols, filename) { - - var output = []; - - var rkeywords = /^(?:abstract|as|boolean|break|byte|case|catch|char|class|continue|const|debugger|default|delete|do|double|else|enum|export|extends|false|final|finally|float|for|function|formEvents|formProperty|goto|if|implements|import|in|instanceof|int|interface|is|long|namespace|native|new|null|noattribute|package|private|protected|public|return|short|static|super|switch|synchronized|this|throw|throws|transient|true|try|typeof|use|var|void|volatile|while|with)$/; - - function isNoKeyword($) { return !rkeywords.test($.name); } - - function isAPI($) { return $.access === 'public' || $.access === 'protected' || !$.access } - - function writeln(args) { - if ( arguments.length ) { - for (var i = 0; i < arguments.length; i++) - output.push(arguments[i]); - } - output.push("\n"); - } - - function unwrap(docletSrc) { - if (!docletSrc) { return ''; } - - // note: keep trailing whitespace for @examples - // extra opening/closing stars are ignored - // left margin is considered a star and a space - // use the /m flag on regex to avoid having to guess what this platform's newline is - docletSrc = - docletSrc.replace(/^\/\*\*+/, '') // remove opening slash+stars - .replace(/\**\*\/$/, "\\Z") // replace closing star slash with end-marker - .replace(/^\s*(\* ?|\\Z)/gm, '') // remove left margin like: spaces+star or spaces+end-marker - .replace(/\s*\\Z$/g, ''); // remove end-marker - - return docletSrc; - } - - function comment($, sMetaType) { - - var s = unwrap($.comment.toString()); - - // remove the @desc tag - s = s.replace(/(\r\n|\r|\n)/gm, "\n"); - s = s.replace(/^\s*@desc\s*/gm, ""); - s = s.replace(/^\s*@alias[^\r\n]*(\r\n|\r|\n)?/gm, ""); - s = s.replace(/^\s*@name[^\r\n]*(\r\n|\r|\n)?/gm, ""); - s = s.replace(/^\s*@function[^\r\n]*(\r\n|\r|\n)?/gm, ""); - s = s.replace(/^\s*@author[^\r\n]*(\r\n|\r|\n)?/gm, ""); - s = s.replace(/^\s*@synthetic[^\r\n]*(\r\n|\r|\n)?/gm, ""); - s = s.replace(/^\s*<\/p> \s*(\r\n|\r|\n)?/gm, "\n"); - // skip empty documentation - if ( !s ) return; - - // for namespaces, enforce the @.memberof tag - if ( sMetaType === "namespace" && $.memberof && s.indexOf("@memberof") < 0 ) { - s = s + "\n@memberof " + $.memberof; - } - - writeln("/**\n * " + s.replace(/\n/g, "\n * ") + "\n */"); - - /* - writeln("/**"); - writeln(s.split(/\r\n|\r|\n/g).map(function($) { return " * " + $;}).join("\r\n")); - writeln(" * /"); - */ - - } - - function signature($) { - var p = $.params, - r = [], - i; - if ( p ) { - for (i = 0; i < p.length; i++) { - // ignore @param tags for 'virtual' params that are used to document members of config-like params - // (e.g. like "@param param1.key ...") - if (p[i].name && p[i].name.indexOf('.') < 0) { - r.push(p[i].name); - } - } - } - return r.join(','); - } - - function qname(member,parent) { - var r = member.memberof; - if ( member.scope !== 'static' ) { - r += ".prototype"; - } - return (r ? r + "." : "") + member.name; - } - - var mValues = { - "boolean" : "false", - "int" : "0", - "float" : "0.0", - "number" : "0.0", - "string" : "\"\"", - "object" : "new Object()", - "function" : "function() {}" - }; - - function valueForType(type) { - if ( type && type.names && type.names[0] ) { - type = type.names[0]; - if ( REGEXP_ARRAY_TYPE.test(type) || type.indexOf("[]") > 0 ) { - return "new Array()"; - } else if ( mValues[type] ) { - return mValues[type]; - } else if ( type.indexOf(".") > 0 ) { - return "new " + type + "()"; - } else { - // return "/* unsupported type: " + member.type + " */ null"; - return "null"; - } - } - } - - function value(member) { - return valueForType(member.type); - } - - function retvalue(member) { - //console.log(member); - var r = valueForType(member.type || (member.returns && member.returns.length && member.returns[0] && member.returns[0].type && member.returns[0].type)); - if ( r ) { - return "return " + r + ";"; - } - return ""; - } - - var sortedSymbols = symbols.slice(0).filter(function($) { return isaClass($) && isAPI($) && !$.synthetic; }).sort(sortByAlias); // sort only a copy(!) of the symbols, otherwise the SymbolSet lookup is broken - sortedSymbols.forEach(function(symbol) { - - var sMetaType = (symbol.kind === 'member' && symbol.isEnum) ? 'enum' : symbol.kind; - if ( sMetaType ) { - - writeln(""); - writeln("// ---- " + symbol.longname + " --------------------------------------------------------------------------"); - writeln(""); - - var memberId, member; - - var ownProperties = childrenOfKind(symbol, 'property').own.filter(isNoKeyword).sort(sortByAlias); - if ( sMetaType === "class" ) { - comment(symbol, sMetaType); - writeln(symbol.longname + " = function(" + signature(symbol) + ") {};"); - for ( memberId in ownProperties ) { - member = ownProperties[memberId]; - comment(member, sMetaType); - writeln(qname(member, symbol) + " = " + value(member)); - writeln(""); - } - } else if ( sMetaType === 'namespace' || sMetaType === 'enum' ) { - //console.log("found namespace " + symbol.longname); - //console.log(ownProperties); - if ( ownProperties.length ) { - writeln("// dummy function to make Eclipse aware of namespace"); - writeln(symbol.longname + ".toString = function() { return \"\"; };"); - } - } - - var ownEvents = childrenOfKind(symbol, 'event').own.filter(isNoKeyword).sort(sortByAlias); - if ( ownEvents.length ) { - for ( memberId in ownEvents ) { - member = ownEvents[memberId]; - comment(member, sMetaType); - writeln(qname(member, symbol) + " = function(" + signature(member) + ") { " + retvalue(member) + " };"); - writeln(""); - } - } - - var ownMethods = childrenOfKind(symbol, 'method').own.filter(isNoKeyword).sort(sortByAlias); - if ( ownMethods.length ) { - for ( memberId in ownMethods ) { - member = ownMethods[memberId]; - comment(member, sMetaType); - writeln(qname(member, symbol) + " = function(" + signature(member) + ") { " + retvalue(member) + " };"); - writeln(""); - } - } - - } - }); - - writeln("// ---- static fields of namespaces ---------------------------------------------------------------------"); - - sortedSymbols.forEach(function(symbol) { - - var sMetaType = (symbol.kind === 'member' && symbol.isEnum) ? 'enum' : symbol.kind; - - if ( sMetaType === 'namespace' || sMetaType === 'enum' ) { - - var ownProperties = childrenOfKind(symbol, 'property').own.filter(isNoKeyword).sort(sortByAlias); - if ( ownProperties.length ) { - writeln(""); - writeln("// ---- " + symbol.longname + " --------------------------------------------------------------------------"); - writeln(""); - - for (var memberId in ownProperties ) { - var member = ownProperties[memberId]; - comment(member, sMetaType); - writeln(qname(member, symbol) + " = " + value(member) + ";"); - writeln(""); - } - } - } - - }); - - fs.mkPath(path.dirname(filename)); - fs.writeFileSync(filename, output.join(""), 'utf8'); - info(" saved as " + filename); -} - -// Description + Settings - -function getConstructorDescription(symbol) { - var description = symbol.description; - var tags = symbol.tags; - if ( tags ) { - for (var i = 0; i < tags.length; i++) { - if ( tags[i].title === "ui5-settings" && tags[i].text) { - description += "\n
\n" + tags[i].text; - break; - } - } - } - return description; -} - - -// Example - -function makeExample(example) { - var result = { - caption: null, - example: example - }, - match = /^\s*
([\s\S]+?)<\/caption>(?:[ \t]*[\n\r]*)([\s\S]+)$/i.exec(example); - - if ( match ) { - result.caption = match[1]; - result.example = match[2]; - } - - return result; -} - -/* ---- exports ---- */ - -exports.publish = publish; diff --git a/packages/tools/package.json b/packages/tools/package.json index 22d1bb791df9..0e4e32beaf78 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -52,7 +52,6 @@ "globby": "^13.1.1", "handlebars": "^4.7.7", "is-port-reachable": "^3.1.0", - "jsdoc": "^3.6.6", "json-beautify": "^1.1.1", "mkdirp": "^1.0.4", "nps": "^5.10.0", From d7bb8ac67d07228e4c72811bb8a5ea93684b30fd Mon Sep 17 00:00:00 2001 From: ilhan orhan Date: Mon, 25 Mar 2024 14:00:41 +0200 Subject: [PATCH 16/60] refactor: remove all Assets-static.js modules (#8526) Remove all Assets-static.js modules in favour of their dynamic counterparts - the Assets.js modules. BREAKING CHANGE: All Assets-static.js modules are removed. If you previously imported any Assets-static.js module from any package: ```ts import "@ui5/webcomponents/dist/Assets-static.js"; import "@ui5/webcomponents-icons/dist/Assets-static.js" ``` use the dynamic equivalent of it: ```ts import "@ui5/webcomponents/dist/Assets.js"; import "@ui5/webcomponents-icons/dist/Assets.js" ``` Related to: https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/fiori/src/Assets-static.ts | 6 ------ packages/icons-business-suite/src/Assets-static.ts | 0 packages/icons-business-suite/src/json-imports/Icons.ts | 2 +- packages/icons-tnt/src/Assets-static.ts | 0 packages/icons-tnt/src/json-imports/Icons.ts | 2 +- packages/icons/src/Assets-static.ts | 1 - packages/icons/src/json-imports/Icons.ts | 2 +- packages/localization/lib/generate-json-imports/cldr.js | 2 +- packages/localization/src/Assets-static.ts | 2 -- packages/main/src/Assets-static.ts | 6 ------ packages/theming/src/Assets-static.ts | 2 -- packages/tools/lib/generate-json-imports/i18n.js | 2 +- packages/tools/lib/generate-json-imports/themes.js | 2 +- 13 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 packages/fiori/src/Assets-static.ts delete mode 100644 packages/icons-business-suite/src/Assets-static.ts delete mode 100644 packages/icons-tnt/src/Assets-static.ts delete mode 100644 packages/icons/src/Assets-static.ts delete mode 100644 packages/localization/src/Assets-static.ts delete mode 100644 packages/main/src/Assets-static.ts delete mode 100644 packages/theming/src/Assets-static.ts diff --git a/packages/fiori/src/Assets-static.ts b/packages/fiori/src/Assets-static.ts deleted file mode 100644 index 06b7321eba26..000000000000 --- a/packages/fiori/src/Assets-static.ts +++ /dev/null @@ -1,6 +0,0 @@ -// main package assets (transitively base and theming) -import "@ui5/webcomponents/dist/Assets-static.js"; - -// own fiori package assets -import "./generated/json-imports/Themes-static.js"; -import "./generated/json-imports/i18n-static.js"; diff --git a/packages/icons-business-suite/src/Assets-static.ts b/packages/icons-business-suite/src/Assets-static.ts deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/icons-business-suite/src/json-imports/Icons.ts b/packages/icons-business-suite/src/json-imports/Icons.ts index 3a47716cb26b..273b5e514ad0 100644 --- a/packages/icons-business-suite/src/json-imports/Icons.ts +++ b/packages/icons-business-suite/src/json-imports/Icons.ts @@ -10,7 +10,7 @@ const loadIconsBundle = async (collection: string): Promise => { } if (typeof iconData === "string" && (iconData as string).endsWith(".json")) { - throw new Error("[icons-business-suite] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use `import \"@ui5/webcomponents-icons-business-suite/dist/Assets-static.js\". Check the \"Assets\" documentation for more information."); + throw new Error("[icons-business-suite] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information."); } return iconData; } diff --git a/packages/icons-tnt/src/Assets-static.ts b/packages/icons-tnt/src/Assets-static.ts deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/icons-tnt/src/json-imports/Icons.ts b/packages/icons-tnt/src/json-imports/Icons.ts index ba996281fb2c..034022a89756 100644 --- a/packages/icons-tnt/src/json-imports/Icons.ts +++ b/packages/icons-tnt/src/json-imports/Icons.ts @@ -10,7 +10,7 @@ const loadIconsBundle = async (collection: string): Promise => { } if (typeof iconData === "string" && (iconData as string).endsWith(".json")) { - throw new Error("[icons-tnt] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use `import \"@ui5/webcomponents-icons-tnt/dist/Assets-static.js\". Check the \"Assets\" documentation for more information."); + throw new Error("[icons-tnt] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information."); } return iconData; } diff --git a/packages/icons/src/Assets-static.ts b/packages/icons/src/Assets-static.ts deleted file mode 100644 index c49e620bb353..000000000000 --- a/packages/icons/src/Assets-static.ts +++ /dev/null @@ -1 +0,0 @@ -import "./generated/json-imports/i18n-static.js"; diff --git a/packages/icons/src/json-imports/Icons.ts b/packages/icons/src/json-imports/Icons.ts index 99ee8cecd86a..0d58e07a4264 100644 --- a/packages/icons/src/json-imports/Icons.ts +++ b/packages/icons/src/json-imports/Icons.ts @@ -10,7 +10,7 @@ const loadIconsBundle = async (collection: string): Promise => { } if (typeof iconData === "string" && (iconData as string).endsWith(".json")) { - throw new Error("[icons] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use `import \"@ui5/webcomponents-icons/dist/Assets-static.js\". Check the \"Assets\" documentation for more information."); + throw new Error("[icons] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information."); } return iconData; } diff --git a/packages/localization/lib/generate-json-imports/cldr.js b/packages/localization/lib/generate-json-imports/cldr.js index 642659866bf3..87b44383b539 100644 --- a/packages/localization/lib/generate-json-imports/cldr.js +++ b/packages/localization/lib/generate-json-imports/cldr.js @@ -43,7 +43,7 @@ ${caseImports} const importAndCheck = async (localeId) => { const data = await importCldrJson(localeId); if (typeof data === "string" && data.endsWith(".json")) { - throw new Error(\`[LocaleData] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use 'import ".../Assets-static.js"'. Check the \"Assets\" documentation for more information.\`); + throw new Error(\`[LocaleData] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.\`); } return data; } diff --git a/packages/localization/src/Assets-static.ts b/packages/localization/src/Assets-static.ts deleted file mode 100644 index 6d083ff01773..000000000000 --- a/packages/localization/src/Assets-static.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Currently the base package provides CLDR assets only -import "./generated/json-imports/LocaleData-static.js"; diff --git a/packages/main/src/Assets-static.ts b/packages/main/src/Assets-static.ts deleted file mode 100644 index 74b2b2ccf897..000000000000 --- a/packages/main/src/Assets-static.ts +++ /dev/null @@ -1,6 +0,0 @@ -import "@ui5/webcomponents-localization/dist/Assets-static.js"; // CLDR -import "@ui5/webcomponents-theming/dist/Assets-static.js"; // Theming - -// own main package assets -import "./generated/json-imports/Themes-static.js"; -import "./generated/json-imports/i18n-static.js"; diff --git a/packages/theming/src/Assets-static.ts b/packages/theming/src/Assets-static.ts deleted file mode 100644 index e433b96e075d..000000000000 --- a/packages/theming/src/Assets-static.ts +++ /dev/null @@ -1,2 +0,0 @@ -// The theming package provides theming assets only -import "./generated/json-imports/Themes-static.js"; diff --git a/packages/tools/lib/generate-json-imports/i18n.js b/packages/tools/lib/generate-json-imports/i18n.js index a98476024520..74e8d1d1a14b 100644 --- a/packages/tools/lib/generate-json-imports/i18n.js +++ b/packages/tools/lib/generate-json-imports/i18n.js @@ -76,7 +76,7 @@ import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registrie const importAndCheck = async (localeId) => { const data = await importMessageBundle(localeId); if (typeof data === "string" && data.endsWith(".json")) { - throw new Error(\`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use 'import ".../Assets-static.js"'. Check the \"Assets\" documentation for more information.\`); + throw new Error(\`[i18n] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.\`); } return data; } diff --git a/packages/tools/lib/generate-json-imports/themes.js b/packages/tools/lib/generate-json-imports/themes.js index 3326b39356c9..4f83c25fd767 100644 --- a/packages/tools/lib/generate-json-imports/themes.js +++ b/packages/tools/lib/generate-json-imports/themes.js @@ -64,7 +64,7 @@ ${dynamicImportLines} const loadAndCheck = async (themeName) => { const data = await loadThemeProperties(themeName); if (typeof data === "string" && data.endsWith(".json")) { - throw new Error(\`[themes] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build or use 'import ".../Assets-static.js"'. Check the \"Assets\" documentation for more information.\`); + throw new Error(\`[themes] Invalid bundling detected - dynamic JSON imports bundled as URLs. Switch to inlining JSON files from the build. Check the \"Assets\" documentation for more information.\`); } return data; }; From 111e585a58f22ef32f0d8f271fc884ba0c76712a Mon Sep 17 00:00:00 2001 From: Tsanislav Gatev Date: Mon, 25 Mar 2024 16:20:18 +0200 Subject: [PATCH 17/60] refactor(ui5-calendar): rename `selected-dates-change` to `selection-change` and rename few event details (#8529) Renames the `selected-dates-change ` event name of the Calendar to `selection-change` and the names of two event details - `values` and `dates` to `selectedValues` and `selectedDateValues` respectively. BREAKING CHANGE: The event `selected-dates-change ` is renamed to `selection-change`. In addition the event details `values` and `dates` are renamed to `selectedValues` and `selectedDateValues`. If you previously used the Calendar event as follows: ```ts myCalendar.addEventListener("selected-dates-change", () => { const values = e.detail.values; const dates = e.detail.dates; }) ``` Now you have to use the new event name and details: ```ts myCalendar.addEventListener("selection-change", () => { const values = event.detail.selectedValues; const dates = event.detail.selectedDateValues; }) ``` Related to: https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/main/src/Calendar.ts | 22 ++++++++++----------- packages/main/src/DatePicker.ts | 6 +++--- packages/main/src/DatePickerPopover.hbs | 2 +- packages/main/src/DateRangePicker.ts | 8 ++++---- packages/main/src/DateTimePicker.ts | 6 +++--- packages/main/src/DateTimePickerPopover.hbs | 2 +- packages/main/test/pages/Calendar.html | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/main/src/Calendar.ts b/packages/main/src/Calendar.ts index cd5683698c44..93558d798fe1 100644 --- a/packages/main/src/Calendar.ts +++ b/packages/main/src/Calendar.ts @@ -49,9 +49,9 @@ interface ICalendarPicker { _lastYear?: number, } -type CalendarSelectedDatesChangeEventDetail = { - values: Array , - dates: Array , +type CalendarSelectionChangeEventDetail = { + selectedValues: Array , + selectedDates: Array , timestamp: number | undefined, } @@ -72,7 +72,7 @@ type SpecialCalendarDateT = { * date string, correctly formatted according to the `ui5-calendar`'s `formatPattern` property. * Whenever the user changes the date selection, `ui5-calendar` will automatically create/remove instances * of `ui5-date` in itself, unless you prevent this behavior by calling `preventDefault()` for the - * `selected-dates-change` event. This is useful if you want to control the selected dates externally. + * `selection-change` event. This is useful if you want to control the selected dates externally. * * ### Usage * @@ -177,20 +177,20 @@ type SpecialCalendarDateT = { * **Note:** If you call `preventDefault()` for this event, the component will not * create instances of `ui5-date` for the newly selected dates. In that case you should do this manually. * @allowPreventDefault - * @param {Array } values The selected dates - * @param {Array } dates The selected dates as UTC timestamps + * @param {Array } selectedValues The selected dates + * @param {Array } selectedDates The selected dates as UTC timestamps * @public */ -@event ("selected-dates-change", { +@event ("selection-change", { detail: { /** * @public */ - dates: { type: Array }, + selectedDates: { type: Array }, /** * @public */ - values: { type: Array }, + selectedValues: { type: Array }, timestamp: { type: Number }, }, @@ -523,7 +523,7 @@ class Calendar extends CalendarPart { return this.getFormat().format(calendarDate.toUTCJSDate(), true); }); - const defaultPrevented = !this.fireEvent ("selected-dates-change", { timestamp: this.timestamp, dates: [...selectedDates], values: datesValues }, true); + const defaultPrevented = !this.fireEvent ("selection-change", { timestamp: this.timestamp, selectedDates: [...selectedDates], selectedValues: datesValues }, true); if (!defaultPrevented) { this._setSelectedDates(selectedDates); } @@ -607,6 +607,6 @@ Calendar.define(); export default Calendar; export type { ICalendarPicker, - CalendarSelectedDatesChangeEventDetail, + CalendarSelectionChangeEventDetail, SpecialCalendarDateT, }; diff --git a/packages/main/src/DatePicker.ts b/packages/main/src/DatePicker.ts index d3311dc65a33..795e3ae9c83a 100644 --- a/packages/main/src/DatePicker.ts +++ b/packages/main/src/DatePicker.ts @@ -39,7 +39,7 @@ import Icon from "./Icon.js"; import Button from "./Button.js"; import ResponsivePopover from "./ResponsivePopover.js"; import Calendar from "./Calendar.js"; -import type { CalendarSelectedDatesChangeEventDetail } from "./Calendar.js"; +import type { CalendarSelectionChangeEventDetail } from "./Calendar.js"; import CalendarDateComponent from "./CalendarDate.js"; import Input from "./Input.js"; import InputType from "./types/InputType.js"; @@ -763,9 +763,9 @@ class DatePicker extends DateComponentBase implements IFormElement { * @param e * @protected */ - onSelectedDatesChange(e: CustomEvent ) { + onSelectedDatesChange(e: CustomEvent ) { e.preventDefault(); - const newValue = e.detail.values && e.detail.values[0]; + const newValue = e.detail.selectedValues && e.detail.selectedValues[0]; this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]); this.closePicker(); diff --git a/packages/main/src/DatePickerPopover.hbs b/packages/main/src/DatePickerPopover.hbs index 0e816d4e3d97..1d61d1b45dd2 100644 --- a/packages/main/src/DatePickerPopover.hbs +++ b/packages/main/src/DatePickerPopover.hbs @@ -44,7 +44,7 @@ .selectionMode="{{_calendarSelectionMode}}" .minDate="{{minDate}}" .maxDate="{{maxDate}}" - @ui5-selected-dates-change="{{onSelectedDatesChange}}" + @ui5-selection-change="{{onSelectedDatesChange}}" @ui5-show-month-press="{{onHeaderShowMonthPress}}" @ui5-show-year-press="{{onHeaderShowYearPress}}" ?hide-week-numbers="{{hideWeekNumbers}}" diff --git a/packages/main/src/DateRangePicker.ts b/packages/main/src/DateRangePicker.ts index d219db28f896..193f5efb598a 100644 --- a/packages/main/src/DateRangePicker.ts +++ b/packages/main/src/DateRangePicker.ts @@ -15,7 +15,7 @@ import type { DatePickerChangeEventDetail as DateRangePickerChangeEventDetail, DatePickerInputEventDetail as DateRangePickerInputEventDetail, } from "./DatePicker.js"; -import type { CalendarSelectedDatesChangeEventDetail } from "./Calendar.js"; +import type { CalendarSelectionChangeEventDetail } from "./Calendar.js"; /** * @class @@ -215,9 +215,9 @@ class DateRangePicker extends DatePicker { /** * @override */ - onSelectedDatesChange(event: CustomEvent ) { + onSelectedDatesChange(event: CustomEvent ) { event.preventDefault(); // never let the calendar update its own dates, the parent component controls them - const values = event.detail.values; + const values = event.detail.selectedValues; if (values.length === 0) { return; @@ -227,7 +227,7 @@ class DateRangePicker extends DatePicker { this._tempValue = values[0]; return; } - const newValue = this._buildValue(event.detail.dates[0], event.detail.dates[1]); // the value will be normalized so we don't need to order them here + const newValue = this._buildValue(event.detail.selectedDates[0], event.detail.selectedDates[1]); // the value will be normalized so we don't need to order them here this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]); this.closePicker(); } diff --git a/packages/main/src/DateTimePicker.ts b/packages/main/src/DateTimePicker.ts index f0a7173d164c..51d495f05a3f 100644 --- a/packages/main/src/DateTimePicker.ts +++ b/packages/main/src/DateTimePicker.ts @@ -12,7 +12,7 @@ import type ResponsivePopover from "./ResponsivePopover.js"; import ToggleButton from "./ToggleButton.js"; import SegmentedButton from "./SegmentedButton.js"; import Calendar from "./Calendar.js"; -import type { CalendarSelectedDatesChangeEventDetail } from "./Calendar.js"; +import type { CalendarSelectionChangeEventDetail } from "./Calendar.js"; import DatePicker from "./DatePicker.js"; import type { DatePickerChangeEventDetail as DateTimePickerChangeEventDetail, @@ -296,14 +296,14 @@ class DateTimePicker extends DatePicker { /** * @override */ - onSelectedDatesChange(e: CustomEvent ) { + onSelectedDatesChange(e: CustomEvent ) { e.preventDefault(); // @ts-ignore Needed for FF const dateTimePickerContent = e.path ? e.path[1] : e.composedPath()[1]; this._previewValues = { ...this._previewValues, calendarTimestamp: e.detail.timestamp, - calendarValue: e.detail.values[0], + calendarValue: e.detail.selectedValues[0], timeSelectionValue: dateTimePickerContent.lastChild.value, }; } diff --git a/packages/main/src/DateTimePickerPopover.hbs b/packages/main/src/DateTimePickerPopover.hbs index 4cb146cbef46..f2706fb1bdb6 100644 --- a/packages/main/src/DateTimePickerPopover.hbs +++ b/packages/main/src/DateTimePickerPopover.hbs @@ -24,7 +24,7 @@ .selectionMode="{{_calendarSelectionMode}}" .minDate="{{minDate}}" .maxDate="{{maxDate}}" - @ui5-selected-dates-change="{{onSelectedDatesChange}}" + @ui5-selection-change="{{onSelectedDatesChange}}" @ui5-show-month-press="{{onHeaderShowMonthPress}}" @ui5-show-year-press="{{onHeaderShowYearPress}}" ?hide-week-numbers="{{hideWeekNumbers}}" diff --git a/packages/main/test/pages/Calendar.html b/packages/main/test/pages/Calendar.html index a3b8956c0c3d..3645978bd9f2 100644 --- a/packages/main/test/pages/Calendar.html +++ b/packages/main/test/pages/Calendar.html @@ -100,8 +100,8 @@ toggleButton.innerHTML = event.target.pressed ? "show" : "hide"; }); - calendar1.addEventListener("ui5-selected-dates-change", function(event) { - textArea.setAttribute("value", event.detail.dates.join(", ") + " / " + event.detail.values.join(", ")); + calendar1.addEventListener("ui5-selection-change", function(event) { + textArea.setAttribute("value", event.detail.selectedDates.join(", ") + " / " + event.detail.selectedValues.join(", ")); }); From 6b7237e0fa90ce2c64fe5b82fcd8512d4664272e Mon Sep 17 00:00:00 2001 From: ilhan orhan Date: Mon, 25 Mar 2024 16:22:04 +0200 Subject: [PATCH 18/60] docs: update keyboard keys abbreviations (#8528) * docs: update keyboard key abbreviation * chore: update * chore: update * chore: update --- packages/fiori/src/Bar.ts | 2 +- packages/fiori/src/FlexibleColumnLayout.ts | 6 +-- packages/fiori/src/MediaGallery.ts | 8 ++-- packages/fiori/src/MediaGalleryItem.ts | 2 +- packages/fiori/src/ProductSwitch.ts | 6 +-- packages/fiori/src/ProductSwitchItem.ts | 2 +- packages/fiori/src/ShellBar.ts | 2 +- packages/fiori/src/SideNavigation.ts | 2 +- packages/fiori/src/ViewSettingsDialog.ts | 2 +- packages/fiori/src/Wizard.ts | 12 ++--- packages/main/src/Avatar.ts | 4 +- packages/main/src/AvatarGroup.ts | 30 ++++++------ packages/main/src/Breadcrumbs.ts | 18 +++---- packages/main/src/Calendar.ts | 48 +++++++++---------- packages/main/src/Carousel.ts | 6 +-- packages/main/src/CheckBox.ts | 2 +- packages/main/src/ComboBox.ts | 18 +++---- packages/main/src/DatePicker.ts | 16 +++---- packages/main/src/DateRangePicker.ts | 12 ++--- packages/main/src/Dialog.ts | 8 ++-- packages/main/src/Icon.ts | 4 +- packages/main/src/Input.ts | 22 ++++----- packages/main/src/List.ts | 12 ++--- packages/main/src/ListItemBase.ts | 2 +- packages/main/src/MessageStrip.ts | 2 +- packages/main/src/MultiComboBox.ts | 2 +- packages/main/src/Panel.ts | 2 +- packages/main/src/RatingIndicator.ts | 4 +- packages/main/src/Select.ts | 12 ++--- packages/main/src/TabContainer.ts | 2 +- packages/main/src/Table.ts | 16 +++---- packages/main/src/TimePicker.ts | 26 +++++----- packages/main/src/Toolbar.ts | 2 +- packages/main/src/Tree.ts | 10 ++-- .../test/pages/List_keyboard_support.html | 4 +- packages/main/test/pages/Menu.html | 2 +- .../main/test/samples/RadioButton.sample.html | 2 +- packages/main/test/specs/DatePicker.spec.js | 8 ++-- 38 files changed, 170 insertions(+), 170 deletions(-) diff --git a/packages/fiori/src/Bar.ts b/packages/fiori/src/Bar.ts index 7b9b5dffcb62..cb25f48e10e7 100644 --- a/packages/fiori/src/Bar.ts +++ b/packages/fiori/src/Bar.ts @@ -33,7 +33,7 @@ import BarCss from "./generated/themes/Bar.css.js"; * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/fiori/src/FlexibleColumnLayout.ts b/packages/fiori/src/FlexibleColumnLayout.ts index ca6c4f8de178..f08453c4c7a0 100644 --- a/packages/fiori/src/FlexibleColumnLayout.ts +++ b/packages/fiori/src/FlexibleColumnLayout.ts @@ -107,13 +107,13 @@ type FlexibleColumnLayoutAccessibilityRoles = { * * #### Basic Navigation * - * - [SPACE, ENTER, RETURN] - If focus is on the layout toggle button (arrow button), once activated, it triggers the associated action (such as expand/collapse the column). - * - This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * - [Space] / [Enter] or [Return] - If focus is on the layout toggle button (arrow button), once activated, it triggers the associated action (such as expand/collapse the column). + * - This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/fiori/src/MediaGallery.ts b/packages/fiori/src/MediaGallery.ts index ff38bea9d28d..c10b8f3ec460 100644 --- a/packages/fiori/src/MediaGallery.ts +++ b/packages/fiori/src/MediaGallery.ts @@ -72,10 +72,10 @@ const COLUMNS_COUNT: Record = { * When the thumbnails menu is focused the following keyboard * shortcuts allow the user to navigate through the thumbnail items: * - * - [UP/DOWN] - Navigates up and down the items - * - [HOME] - Navigates to first item - * - [END] - Navigates to the last item - * - [SPACE/ENTER] - Select an item + * - [Up] or [Down] - Navigates up and down the items + * - [Home] - Navigates to first item + * - [End] - Navigates to the last item + * - [Space], [Enter] - Selects an item * * ### ES6 Module Import * `import "@ui5/webcomponents-fiori/dist/MediaGallery.js";` diff --git a/packages/fiori/src/MediaGalleryItem.ts b/packages/fiori/src/MediaGalleryItem.ts index 8a5675c0d7bb..e0434f61583d 100644 --- a/packages/fiori/src/MediaGalleryItem.ts +++ b/packages/fiori/src/MediaGalleryItem.ts @@ -29,7 +29,7 @@ import MediaGalleryItemTemplate from "./generated/templates/MediaGalleryItemTemp * When focused, the user can use the following keyboard * shortcuts in order to perform a navigation: * - * - [SPACE/ENTER/RETURN] - Trigger `ui5-click` event + * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event * * ### ES6 Module Import * `import "@ui5/webcomponents-fiori/dist/MediaGalleryItem.js";` (comes with `ui5-media-gallery`) diff --git a/packages/fiori/src/ProductSwitch.ts b/packages/fiori/src/ProductSwitch.ts index 88b74576b571..75807a1afd0e 100644 --- a/packages/fiori/src/ProductSwitch.ts +++ b/packages/fiori/src/ProductSwitch.ts @@ -50,9 +50,9 @@ interface IProductSwitchItem extends HTMLElement, ITabbable { * When focused, the user can use the following keyboard * shortcuts in order to perform a navigation: * - * - [TAB] - Move focus to the next interactive element after the `ui5-product-switch` - * - [UP/DOWN] - Navigates up and down the items - * - [LEFT/RIGHT] - Navigates left and right the items + * - [Tab] - Move focus to the next interactive element after the `ui5-product-switch` + * - [Up] or [Down] - Navigates up and down the items + * - [Left] or [Right] - Navigates left and right the items * * ### ES6 Module Import * `import "@ui5/webcomponents-fiori/dist/ProductSwitch.js";` diff --git a/packages/fiori/src/ProductSwitchItem.ts b/packages/fiori/src/ProductSwitchItem.ts index 476f24afa94c..a9f40a644a0f 100644 --- a/packages/fiori/src/ProductSwitchItem.ts +++ b/packages/fiori/src/ProductSwitchItem.ts @@ -24,7 +24,7 @@ import ProductSwitchItemCss from "./generated/themes/ProductSwitchItem.css.js"; * When focused, the user can use the following keyboard * shortcuts in order to perform a navigation: * - * - [SPACE/ENTER/RETURN] - Trigger `ui5-click` event + * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event * * ### ES6 Module Import * `import "@ui5/webcomponents-fiori/dist/ProductSwitchItem.js";` diff --git a/packages/fiori/src/ShellBar.ts b/packages/fiori/src/ShellBar.ts index bd27fe81b624..7e0ad09753de 100644 --- a/packages/fiori/src/ShellBar.ts +++ b/packages/fiori/src/ShellBar.ts @@ -153,7 +153,7 @@ const HANDLE_RESIZE_DEBOUNCE_RATE = 200; // ms * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/fiori/src/SideNavigation.ts b/packages/fiori/src/SideNavigation.ts index 21dace0ee990..89eb699e003f 100644 --- a/packages/fiori/src/SideNavigation.ts +++ b/packages/fiori/src/SideNavigation.ts @@ -84,7 +84,7 @@ type NavigationMenuClickEventDetail = MenuItemClickEventDetail & { * ### Keyboard Handling * * ### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/fiori/src/ViewSettingsDialog.ts b/packages/fiori/src/ViewSettingsDialog.ts index bdb2f77d53aa..2635eb92da7a 100644 --- a/packages/fiori/src/ViewSettingsDialog.ts +++ b/packages/fiori/src/ViewSettingsDialog.ts @@ -632,7 +632,7 @@ class ViewSettingsDialog extends UI5Element { } /** - * If the dialog is closed by [ESC] key, do the same as if the `Cancel` button is pressed. + * If the dialog is closed by [Escape] key, do the same as if the `Cancel` button is pressed. * @param evt */ _restoreConfirmedOnEscape(evt: CustomEvent) { // Dialog#before-close diff --git a/packages/fiori/src/Wizard.ts b/packages/fiori/src/Wizard.ts index aa2f0aff7635..814066cbeaba 100644 --- a/packages/fiori/src/Wizard.ts +++ b/packages/fiori/src/Wizard.ts @@ -125,14 +125,14 @@ type StepInfo = { * * #### Wizard Progress Navigation * - * - [LEFT], [DOWN] - Focus moves backward to the WizardProgressNavAnchors. - * - [UP], [RIGHT] - Focus moves forward to the WizardProgressNavAnchor. - * - [SPACE] or [ENTER], [RETURN] - Selects an active step - * - [HOME] or [PAGE UP] - Focus goes to the first step - * - [END] or [PAGE DOWN] - Focus goes to the last step + * - [Left] or [Down] - Focus moves backward to the WizardProgressNavAnchors. + * - [Up] or [Right] - Focus moves forward to the WizardProgressNavAnchor. + * - [Space] / [Enter] or [Return] - Selects an active step + * - [Home] or [PAGE UP] - Focus goes to the first step + * - [End] or [PAGE DOWN] - Focus goes to the last step * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/Avatar.ts b/packages/main/src/Avatar.ts index c8fe64482279..38672878c3a8 100644 --- a/packages/main/src/Avatar.ts +++ b/packages/main/src/Avatar.ts @@ -42,8 +42,8 @@ import "@ui5/webcomponents-icons/dist/alert.js"; * * ### Keyboard Handling * - * - [SPACE, ENTER, RETURN] - Fires the `click` event if the `interactive` property is set to true. - * - [SHIFT] - If [SPACE] is pressed, pressing [SHIFT] releases the component without triggering the click event. + * - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true. + * - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event. * * ### ES6 Module Import * `import "@ui5/webcomponents/dist/Avatar.js";` diff --git a/packages/main/src/AvatarGroup.ts b/packages/main/src/AvatarGroup.ts index 7ad0a2aaf42d..84aa8bf18f3b 100644 --- a/packages/main/src/AvatarGroup.ts +++ b/packages/main/src/AvatarGroup.ts @@ -95,13 +95,6 @@ type AvatarGroupClickEventDetail = { * - `Individual` type: The avatars are displayed side-by-side and each * avatar has its own click/tap area. * - * ### Responsive Behavior - * - * When the available space is less than the width required to display all avatars, - * an overflow visualization appears as a button placed at the end with the same shape - * and size as the avatars. The visualization displays the number of avatars that have overflowed - * and are not currently visible. - * * ### Usage * * Use the `AvatarGroup` if: @@ -115,6 +108,13 @@ type AvatarGroupClickEventDetail = { * - You want to display a gallery for simple images. * - You want to use it for other visual content than avatars. * + * ### Responsive Behavior + * + * When the available space is less than the width required to display all avatars, + * an overflow visualization appears as a button placed at the end with the same shape + * and size as the avatars. The visualization displays the number of avatars that have overflowed + * and are not currently visible. + * * ### Keyboard Handling * The component provides advanced keyboard handling. * When focused, the user can use the following keyboard @@ -122,17 +122,17 @@ type AvatarGroupClickEventDetail = { * * `type` Individual: * - * - [TAB] - Move focus to the overflow button - * - [LEFT] - Navigate one avatar to the left - * - [RIGHT] - Navigate one avatar to the right - * - [HOME] - Navigate to the first avatar - * - [END] - Navigate to the last avatar - * - [SPACE],[ENTER],[RETURN] - Trigger `ui5-click` event + * - [Tab] - Move focus to the overflow button + * - [Left] - Navigate one avatar to the left + * - [Right] - Navigate one avatar to the right + * - [Home] - Navigate to the first avatar + * - [End] - Navigate to the last avatar + * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event * * `type` Group: * - * - [TAB] - Move focus to the next interactive element after the component - * - [SPACE],[ENTER],[RETURN] - Trigger `ui5-click` event + * - [Tab] - Move focus to the next interactive element after the component + * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event * @constructor * @extends UI5Element * @since 1.0.0-rc.11 diff --git a/packages/main/src/Breadcrumbs.ts b/packages/main/src/Breadcrumbs.ts index fa0d21d9ac07..b56b1f1442f2 100644 --- a/packages/main/src/Breadcrumbs.ts +++ b/packages/main/src/Breadcrumbs.ts @@ -67,15 +67,15 @@ type BreadcrumbsItemClickEventDetail = { * ### Keyboard Handling * The `ui5-breadcrumbs` provides advanced keyboard handling. * - * - [F4, ALT+UP, ALT+DOWN, SPACE, ENTER] - If the dropdown arrow is focused - opens/closes the drop-down. - * - [SPACE, ENTER] - Activates the focused item and triggers the `item-click` event. - * - [ESC] - Closes the drop-down. - * - [LEFT] - If the drop-down is closed - navigates one item to the left. - * - [RIGHT] - If the drop-down is closed - navigates one item to the right. - * - [UP] - If the drop-down is open - moves focus to the next item. - * - [DOWN] - If the drop-down is open - moves focus to the previous item. - * - [HOME] - Navigates to the first item. - * - [END] - Navigates to the last item. + * - [F4], [Alt] + [Up], [Alt] + [Down], [Space], or [Enter] - If the dropdown arrow is focused - opens/closes the drop-down. + * - [Space],[Enter] - Activates the focused item and triggers the `item-click` event. + * - [Escape] - Closes the drop-down. + * - [Left] - If the drop-down is closed - navigates one item to the left. + * - [Right] - If the drop-down is closed - navigates one item to the right. + * - [Up] - If the drop-down is open - moves focus to the next item. + * - [Down] - If the drop-down is open - moves focus to the previous item. + * - [Home] - Navigates to the first item. + * - [End] - Navigates to the last item. * @constructor * @extends UI5Element * @public diff --git a/packages/main/src/Calendar.ts b/packages/main/src/Calendar.ts index 93558d798fe1..81fb1a615fb8 100644 --- a/packages/main/src/Calendar.ts +++ b/packages/main/src/Calendar.ts @@ -91,38 +91,38 @@ type SpecialCalendarDateT = { * - Day picker: * * - [F4] - Shows month picker - * - [SHIFT] + [F4] - Shows year picker - * - [PAGEUP] - Navigate to the previous month - * - [PAGEDOWN] - Navigate to the next month - * - [SHIFT] + [PAGEUP] - Navigate to the previous year - * - [SHIFT] + [PAGEDOWN] - Navigate to the next year - * - [CTRL] + [SHIFT] + [PAGEUP] - Navigate ten years backwards - * - [CTRL] + [SHIFT] + [PAGEDOWN] - Navigate ten years forwards - * - [HOME] - Navigate to the first day of the week - * - [END] - Navigate to the last day of the week - * - [CTRL] + [HOME] - Navigate to the first day of the month - * - [CTRL] + [END] - Navigate to the last day of the month + * - [Shift] + [F4] - Shows year picker + * - [Page Up] - Navigate to the previous month + * - [Page Down] - Navigate to the next month + * - [Shift] + [Page Up] - Navigate to the previous year + * - [Shift] + [Page Down] - Navigate to the next year + * - [Ctrl] + [Shift] + [Page Up] - Navigate ten years backwards + * - [Ctrl] + [Shift] + [Page Down] - Navigate ten years forwards + * - [Home] - Navigate to the first day of the week + * - [End] - Navigate to the last day of the week + * - [Ctrl] + [Home] - Navigate to the first day of the month + * - [Ctrl] + [End] - Navigate to the last day of the month * * - Month picker: * - * - [PAGEUP] - Navigate to the previous year - * - [PAGEDOWN] - Navigate to the next year - * - [HOME] - Navigate to the first month of the current row - * - [END] - Navigate to the last month of the current row - * - [CTRL] + [HOME] - Navigate to the first month of the current year - * - [CTRL] + [END] - Navigate to the last month of the year + * - [Page Up] - Navigate to the previous year + * - [Page Down] - Navigate to the next year + * - [Home] - Navigate to the first month of the current row + * - [End] - Navigate to the last month of the current row + * - [Ctrl] + [Home] - Navigate to the first month of the current year + * - [Ctrl] + [End] - Navigate to the last month of the year * * - Year picker: * - * - [PAGEUP] - Navigate to the previous year range - * - [PAGEDOWN] - Navigate the next year range - * - [HOME] - Navigate to the first year of the current row - * - [END] - Navigate to the last year of the current row - * - [CTRL] + [HOME] - Navigate to the first year of the current year range - * - [CTRL] + [END] - Navigate to the last year of the current year range + * - [Page Up] - Navigate to the previous year range + * - [Page Down] - Navigate the next year range + * - [Home] - Navigate to the first year of the current row + * - [End] - Navigate to the last year of the current row + * - [Ctrl] + [Home] - Navigate to the first year of the current year range + * - [Ctrl] + [End] - Navigate to the last year of the current year range * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/Carousel.ts b/packages/main/src/Carousel.ts index 3b99a4d2f650..2c67bdb5cbba 100644 --- a/packages/main/src/Carousel.ts +++ b/packages/main/src/Carousel.ts @@ -76,11 +76,11 @@ type CarouselNavigateEventDetail = { * When the `ui5-carousel` is focused the user can navigate between the items * with the following keyboard shortcuts: * - * - [UP/DOWN] - Navigates to previous and next item - * - [LEFT/RIGHT] - Navigates to previous and next item + * - [Up] or [Down] - Navigates to previous and next item + * - [Left] or [Right] - Navigates to previous and next item * * ### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` diff --git a/packages/main/src/CheckBox.ts b/packages/main/src/CheckBox.ts index 6c43d5c34d49..319cd0211393 100644 --- a/packages/main/src/CheckBox.ts +++ b/packages/main/src/CheckBox.ts @@ -65,7 +65,7 @@ let activeCb: CheckBox; * * The user can use the following keyboard shortcuts to toggle the checked state of the `ui5-checkbox`. * - * - [SPACE, ENTER] - Toggles between different states: checked, not checked. + * - [Space],[Enter] - Toggles between different states: checked, not checked. * * ### ES6 Module Import * diff --git a/packages/main/src/ComboBox.ts b/packages/main/src/ComboBox.ts index 7c9e765e83b6..2cdea49b5ff9 100644 --- a/packages/main/src/ComboBox.ts +++ b/packages/main/src/ComboBox.ts @@ -135,15 +135,15 @@ type ComboBoxSelectionChangeEventDetail = { * * The `ui5-combobox` provides advanced keyboard handling. * - * - [F4], [ALT]+[UP], or [ALT]+[DOWN] - Toggles the picker. - * - [ESC] - Closes the picker, if open. If closed, cancels changes and reverts the typed in value. - * - [ENTER] or [RETURN] - If picker is open, takes over the currently selected item and closes it. - * - [DOWN] - Selects the next matching item in the picker. - * - [UP] - Selects the previous matching item in the picker. - * - [PAGEDOWN] - Moves selection down by page size (10 items by default). - * - [PAGEUP] - Moves selection up by page size (10 items by default). - * - [HOME] - If focus is in the ComboBox, moves cursor at the beginning of text. If focus is in the picker, selects the first item. - * - [END] - If focus is in the ComboBox, moves cursor at the end of text. If focus is in the picker, selects the last item. + * - [F4], [Alt]+[Up], or [Alt]+[Down] - Toggles the picker. + * - [Escape] - Closes the picker, if open. If closed, cancels changes and reverts the typed in value. + * - [Enter] or [Return] - If picker is open, takes over the currently selected item and closes it. + * - [Down] - Selects the next matching item in the picker. + * - [Up] - Selects the previous matching item in the picker. + * - [Page Down] - Moves selection down by page size (10 items by default). + * - [Page Up] - Moves selection up by page size (10 items by default). + * - [Home] - If focus is in the ComboBox, moves cursor at the beginning of text. If focus is in the picker, selects the first item. + * - [End] - If focus is in the ComboBox, moves cursor at the end of text. If focus is in the picker, selects the last item. * * ### ES6 Module Import * diff --git a/packages/main/src/DatePicker.ts b/packages/main/src/DatePicker.ts index 795e3ae9c83a..2468e14a5c1c 100644 --- a/packages/main/src/DatePicker.ts +++ b/packages/main/src/DatePicker.ts @@ -103,8 +103,8 @@ type DatePickerInputEventDetail = { * ### Keyboard Handling * The `ui5-date-picker` provides advanced keyboard handling. * If the `ui5-date-picker` is focused, - * you can open or close the drop-down by pressing `F4`, `ALT+UP` or `ALT+DOWN` keys. - * Once the drop-down is opened, you can use the `UP`, `DOWN`, `LEFT`, `RIGHT` arrow keys + * you can open or close the drop-down by pressing [F4], [Alt] + [Up] or [Alt] + [Down] keys. + * Once the drop-down is opened, you can use the [Up], [Down], [Left] or [Right] arrow keys * to navigate through the dates and select one by pressing the `Space` or `Enter` keys. Moreover you can * use TAB to reach the buttons for changing month and year. * @@ -112,12 +112,12 @@ type DatePickerInputEventDetail = { * then users can increment or decrement the date referenced by `dateValue` property * by using the following shortcuts: * - * - [PAGEDOWN] - Decrements the corresponding day of the month by one - * - [SHIFT] + [PAGEDOWN] - Decrements the corresponding month by one - * - [SHIFT] + [CTRL] + [PAGEDOWN] - Decrements the corresponding year by one - * - [PAGEUP] - Increments the corresponding day of the month by one - * - [SHIFT] + [PAGEUP] - Increments the corresponding month by one - * - [SHIFT] + [CTRL] + [PAGEUP] - Increments the corresponding year by one + * - [Page Down] - Decrements the corresponding day of the month by one + * - [Shift] + [Page Down] - Decrements the corresponding month by one + * - [Shift] + [Ctrl] + [Page Down] - Decrements the corresponding year by one + * - [Page Up] - Increments the corresponding day of the month by one + * - [Shift] + [Page Up] - Increments the corresponding month by one + * - [Shift] + [Ctrl] + [Page Up] - Increments the corresponding year by one * * ### Calendar types * The component supports several calendar types - Gregorian, Buddhist, Islamic, Japanese and Persian. diff --git a/packages/main/src/DateRangePicker.ts b/packages/main/src/DateRangePicker.ts index 193f5efb598a..faea24f76d22 100644 --- a/packages/main/src/DateRangePicker.ts +++ b/packages/main/src/DateRangePicker.ts @@ -38,12 +38,12 @@ import type { CalendarSelectionChangeEventDetail } from "./Calendar.js"; * increment or decrement respectively the range start or end date, depending on where the cursor is. * The following shortcuts are available: * - * - [PAGEDOWN] - Decrements the corresponding day of the month by one - * - [SHIFT] + [PAGEDOWN] - Decrements the corresponding month by one - * - [SHIFT] + [CTRL] + [PAGEDOWN] - Decrements the corresponding year by one - * - [PAGEUP] - Increments the corresponding day of the month by one - * - [SHIFT] + [PAGEUP] - Increments the corresponding month by one - * - [SHIFT] + [CTRL] + [PAGEUP] - Increments the corresponding year by one + * - [Page Down] - Decrements the corresponding day of the month by one + * - [Shift] + [Page Down] - Decrements the corresponding month by one + * - [Shift] + [Ctrl] + [Page Down] - Decrements the corresponding year by one + * - [Page Up] - Increments the corresponding day of the month by one + * - [Shift] + [Page Up] - Increments the corresponding month by one + * - [Shift] + [Ctrl] + [Page Up] - Increments the corresponding year by one * @constructor * @extends DatePicker * @since 1.0.0-rc.8 diff --git a/packages/main/src/Dialog.ts b/packages/main/src/Dialog.ts index bb6d0e18fcad..8fc0847f418b 100644 --- a/packages/main/src/Dialog.ts +++ b/packages/main/src/Dialog.ts @@ -85,15 +85,15 @@ const ICON_PER_STATE: Record = { * When the `ui5-dialog` has the `draggable` property set to `true` and the header is focused, the user can move the dialog * with the following keyboard shortcuts: * - * - [UP/DOWN] arrow keys - Move the dialog up/down. - * - [LEFT/RIGHT] arrow keys - Move the dialog left/right. + * - [Up] or [Down] arrow keys - Move the dialog up/down. + * - [Left] or [Right] arrow keys - Move the dialog left/right. * * #### Resizing * When the `ui5-dialog` has the `resizable` property set to `true` and the header is focused, the user can change the size of the dialog * with the following keyboard shortcuts: * - * - [SHIFT] + [UP/DOWN] - Decrease/Increase the height of the dialog. - * - [SHIFT] + [LEFT/RIGHT] - Decrease/Increase the width of the dialog. + * - [Shift] + [Up] or [Down] - Decrease/Increase the height of the dialog. + * - [Shift] + [Left] or [Right] - Decrease/Increase the width of the dialog. * * ### ES6 Module Import * diff --git a/packages/main/src/Icon.ts b/packages/main/src/Icon.ts index 23a3abc620b8..c008d1431577 100644 --- a/packages/main/src/Icon.ts +++ b/packages/main/src/Icon.ts @@ -81,8 +81,8 @@ const PRESENTATION_ROLE = "presentation"; * * ### Keyboard Handling * - * - [SPACE, ENTER, RETURN] - Fires the `click` event if the `interactive` property is set to true. - * - [SHIFT] - If [SPACE] or [ENTER],[RETURN] is pressed, pressing [SHIFT] releases the ui5-icon without triggering the click event. + * - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true. + * - [Shift] - If [Space] / [Enter] or [Return] is pressed, pressing [Shift] releases the ui5-icon without triggering the click event. * * ### ES6 Module Import * diff --git a/packages/main/src/Input.ts b/packages/main/src/Input.ts index d65ecb148e00..58ac008a5bd9 100644 --- a/packages/main/src/Input.ts +++ b/packages/main/src/Input.ts @@ -173,14 +173,14 @@ type InputSuggestionScrollEventDetail = { * ### Keyboard Handling * The `ui5-input` provides the following keyboard shortcuts: * - * - [ESC] - Closes the suggestion list, if open. If closed or not enabled, cancels changes and reverts to the value which the Input field had when it got the focus. - * - [ENTER] or [RETURN] - If suggestion list is open takes over the current matching item and closes it. If value state or group header is focused, does nothing. - * - [DOWN] - Focuses the next matching item in the suggestion list. - * - [UP] - Focuses the previous matching item in the suggestion list. - * - [HOME] - If focus is in the text input, moves caret before the first character. If focus is in the list, highlights the first item and updates the input accordingly. - * - [END] - If focus is in the text input, moves caret after the last character. If focus is in the list, highlights the last item and updates the input accordingly. - * - [PAGEUP] - If focus is in the list, moves highlight up by page size (10 items by default). If focus is in the input, does nothing. - * - [PAGEDOWN] - If focus is in the list, moves highlight down by page size (10 items by default). If focus is in the input, does nothing. + * - [Escape] - Closes the suggestion list, if open. If closed or not enabled, cancels changes and reverts to the value which the Input field had when it got the focus. + * - [Enter] or [Return] - If suggestion list is open takes over the current matching item and closes it. If value state or group header is focused, does nothing. + * - [Down] - Focuses the next matching item in the suggestion list. + * - [Up] - Focuses the previous matching item in the suggestion list. + * - [Home] - If focus is in the text input, moves caret before the first character. If focus is in the list, highlights the first item and updates the input accordingly. + * - [End] - If focus is in the text input, moves caret after the last character. If focus is in the list, highlights the last item and updates the input accordingly. + * - [Page Up] - If focus is in the list, moves highlight up by page size (10 items by default). If focus is in the input, does nothing. + * - [Page Down] - If focus is in the list, moves highlight down by page size (10 items by default). If focus is in the input, does nothing. * * ### ES6 Module Import * @@ -594,16 +594,16 @@ class Input extends UI5Element implements SuggestionComponent, IFormElement { // Represents the value before user moves selection from suggestion item to another // and its value is updated after each move. - // Note: Used to register and fire "input" event upon [SPACE] or [ENTER]. + // Note: Used to register and fire "input" event upon [Space] or [Enter]. // Note: The property "value" is updated upon selection move and can`t be used. this.valueBeforeItemSelection = ""; // Represents the value before user moves selection between the suggestion items // and its value remains the same when the user navigates up or down the list. - // Note: Used to cancel selection upon [ESC]. + // Note: Used to cancel selection upon [Escape]. this.valueBeforeItemPreview = ""; - // Indicates if the user selection has been canceled with [ESC]. + // Indicates if the user selection has been canceled with [Escape]. this.suggestionSelectionCancelled = false; // tracks the value between focus in and focus out to detect that change event should be fired. diff --git a/packages/main/src/List.ts b/packages/main/src/List.ts index a60fbc15445b..554413a0a88a 100644 --- a/packages/main/src/List.ts +++ b/packages/main/src/List.ts @@ -127,18 +127,18 @@ type ListItemClickEventDetail = { * When a list is focused the user can use the following keyboard * shortcuts in order to perform a navigation: * - * - [UP/DOWN] - Navigates up and down the items - * - [HOME] - Navigates to first item - * - [END] - Navigates to the last item + * - [Up] or [Down] - Navigates up and down the items + * - [Home] - Navigates to first item + * - [End] - Navigates to the last item * * The user can use the following keyboard shortcuts to perform actions (such as select, delete), * when the `mode` property is in use: * - * - [SPACE] - Select an item (if `type` is 'Active') when `mode` is selection - * - [DELETE] - Delete an item if `mode` property is `Delete` + * - [Space] - Select an item (if `type` is 'Active') when `mode` is selection + * - [Delete] - Delete an item if `mode` property is `Delete` * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/ListItemBase.ts b/packages/main/src/ListItemBase.ts index 2ac2ccb88f0a..80a5a6a6deae 100644 --- a/packages/main/src/ListItemBase.ts +++ b/packages/main/src/ListItemBase.ts @@ -119,7 +119,7 @@ class ListItemBase extends UI5Element implements ITabbable { /* * Determines if th current list item either has no tabbable content or - * [TAB] is performed onto the last tabbale content item. + * [Tab] is performed onto the last tabbale content item. */ shouldForwardTabAfter() { const aContent = getTabbableElements(this.getFocusDomRef()!); diff --git a/packages/main/src/MessageStrip.ts b/packages/main/src/MessageStrip.ts index 74fd33d56554..5a4ac3f5c420 100644 --- a/packages/main/src/MessageStrip.ts +++ b/packages/main/src/MessageStrip.ts @@ -64,7 +64,7 @@ type DesignTypeAnnouncemnt = Record ; * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/MultiComboBox.ts b/packages/main/src/MultiComboBox.ts index 6b0e4a98a153..f7fdaf6ae8f4 100644 --- a/packages/main/src/MultiComboBox.ts +++ b/packages/main/src/MultiComboBox.ts @@ -154,7 +154,7 @@ type MultiComboboxItemWithSelection = { * * #### Picker * If the `ui5-multi-combobox` is focused, - * you can open or close the drop-down by pressing `F4`, `ALT+UP` or `ALT+DOWN` keys. + * you can open or close the drop-down by pressing [F4], [Alt] + [Up] or [Alt] + [Down] keys. * Once the drop-down is opened, you can use the `UP` and `DOWN` arrow keys * to navigate through the available options and select one by pressing the `Space` or `Enter` keys. * diff --git a/packages/main/src/Panel.ts b/packages/main/src/Panel.ts index 20d9c5c53969..0eb5ab7d5ee7 100644 --- a/packages/main/src/Panel.ts +++ b/packages/main/src/Panel.ts @@ -65,7 +65,7 @@ import panelCss from "./generated/themes/Panel.css.js"; * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/RatingIndicator.ts b/packages/main/src/RatingIndicator.ts index e34e5ae1dd43..f51df14612cc 100644 --- a/packages/main/src/RatingIndicator.ts +++ b/packages/main/src/RatingIndicator.ts @@ -59,8 +59,8 @@ type Star = { * * - [RIGHT/UP] - Increases the value of the rating by one step. If the highest value is reached, does nothing * - [LEFT/DOWN] - Decreases the value of the rating by one step. If the lowest value is reached, does nothing. - * - [HOME] - Sets the lowest value. - * - [END] - Sets the highest value. + * - [Home] - Sets the lowest value. + * - [End] - Sets the highest value. * - [SPACE/ENTER/RETURN] - Increases the value of the rating by one step. If the highest value is reached, sets the rating to the lowest value. * - Any number - Changes value to the corresponding number. If typed number is larger than the number of values, sets the highest value. * diff --git a/packages/main/src/Select.ts b/packages/main/src/Select.ts index 08ddf1db4ddf..99cf49462fa7 100644 --- a/packages/main/src/Select.ts +++ b/packages/main/src/Select.ts @@ -126,12 +126,12 @@ type SelectLiveChangeEventDetail = { * ### Keyboard Handling * The `ui5-select` provides advanced keyboard handling. * - * - [F4, ALT+UP, ALT+DOWN, SPACE, ENTER] - Opens/closes the drop-down. - * - [UP, DOWN] - If the drop-down is closed - changes selection to the next or the previous option. If the drop-down is opened - moves focus to the next or the previous option. - * - [SPACE, ENTER] - If the drop-down is opened - selects the focused option. - * - [ESC] - Closes the drop-down without changing the selection. - * - [HOME] - Navigates to first option - * - [END] - Navigates to the last option + * - [F4] / [Alt] + [Up] / [Alt] + [Down] / [Space] or [Enter] - Opens/closes the drop-down. + * - [Up] or [Down] - If the drop-down is closed - changes selection to the next or the previous option. If the drop-down is opened - moves focus to the next or the previous option. + * - [Space], [Enter] - If the drop-down is opened - selects the focused option. + * - [Escape] - Closes the drop-down without changing the selection. + * - [Home] - Navigates to first option + * - [End] - Navigates to the last option * * ### ES6 Module Import * `import "@ui5/webcomponents/dist/Select";` diff --git a/packages/main/src/TabContainer.ts b/packages/main/src/TabContainer.ts index 2e962f3cdf67..f8459631bfda 100644 --- a/packages/main/src/TabContainer.ts +++ b/packages/main/src/TabContainer.ts @@ -148,7 +148,7 @@ interface TabContainerTabInOverflow extends CustomListItem { * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * diff --git a/packages/main/src/Table.ts b/packages/main/src/Table.ts index c2348c5f4fe4..1a4ad98bdd04 100644 --- a/packages/main/src/Table.ts +++ b/packages/main/src/Table.ts @@ -145,20 +145,20 @@ enum TableFocusTargetElement { * ### Keyboard Handling * * #### Fast Navigation - * This component provides a build in fast navigation group which can be used via `F6 / Shift + F6` or ` Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up`. + * This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up]. * In order to use this functionality, you need to import the following module: * `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"` * * Furthermore, you can interact with `ui5-table` via the following keys. * * - [F7] - If focus is on an interactive control inside an item, moves focus to the corresponding item. - * - [CTRL]+[A] - Selects all items, if MultiSelect mode is enabled. - * - [HOME]/[END] - Focuses the first/last item. - * - [PAGEUP]/[PAGEDOWN] - Moves focus up/down by page size (20 items by default). - * - [ALT]+[DOWN]/[UP] - Switches focus between header, last focused item, and More button (if applies) in either direction. - * - [SHIFT]+[DOWN]/[UP] - Selects the next/previous item in a MultiSelect table, if the current item is selected (Range selection). Otherwise, deselects them (Range deselection). - * - [SHIFT]+[HOME]/[END] - Range selection to the first/last item of the List. - * - [CTRL]+[HOME]/[END] - Same behavior as HOME & END. + * - [Ctrl]+[A] - Selects all items, if MultiSelect mode is enabled. + * - [Home]/[End] - Focuses the first/last item. + * - [Page Up]/[Page Down] - Moves focus up/down by page size (20 items by default). + * - [Alt]+[Down]/[Up] - Switches focus between header, last focused item, and More button (if applies) in either direction. + * - [Shift]+[Down]/[Up] - Selects the next/previous item in a MultiSelect table, if the current item is selected (Range selection). Otherwise, deselects them (Range deselection). + * - [Shift]+[Home]/[End] - Range selection to the first/last item of the List. + * - [Ctrl]+[Home]/[End] - Same behavior as HOME & END. * * ### ES6 Module Import * diff --git a/packages/main/src/TimePicker.ts b/packages/main/src/TimePicker.ts index 9baef243c110..b2223b0fc0d7 100644 --- a/packages/main/src/TimePicker.ts +++ b/packages/main/src/TimePicker.ts @@ -43,26 +43,26 @@ import { * a valid value string is "11:42:35" and the same is displayed in the input. * * ### Keyboard handling - * [F4], [ALT]+[UP], [ALT]+[DOWN] Open/Close picker dialog and move focus to it. + * [F4], [Alt]+[Up], [Alt]+[Down] Open/Close picker dialog and move focus to it. * * When closed: * - * - [PAGEUP] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa. - * - [PAGEDOWN] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa. - * - [SHIFT]+[PAGEUP] - Increments minutes by 1. - * - [SHIFT]+[PAGEDOWN] - Decrements minutes by 1. - * - [SHIFT]+[CTRL]+[PAGEUP] - Increments seconds by 1. - * - [SHIFT]+[CTRL]+[PAGEDOWN] - Decrements seconds by 1. + * - [Page Up] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa. + * - [Page Down] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa. + * - [Shift]+[Page Up] - Increments minutes by 1. + * - [Shift]+[Page Down] - Decrements minutes by 1. + * - [Shift]+[Ctrl]+[Page Up] - Increments seconds by 1. + * - [Shift]+[Ctrl]+[Page Down] - Decrements seconds by 1. * - * * When opened: * - * - [PAGEUP] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa. - * - [PAGEDOWN] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa. - * - [SHIFT]+[PAGEUP] - Increments minutes by 1. - * - [SHIFT]+[PAGEDOWN] - Decrements minutes by 1. - * - [SHIFT]+[CTRL]+[PAGEUP] - Increments seconds by 1. - * - [SHIFT]+[CTRL]+[PAGEDOWN] - Decrements seconds by 1. + * - [Page Up] - Increments hours by 1. If 12 am is reached, increment hours to 1 pm and vice versa. + * - [Page Down] - Decrements the corresponding field by 1. If 1 pm is reached, decrement hours to 12 am and vice versa. + * - [Shift]+[Page Up] - Increments minutes by 1. + * - [Shift]+[Page Down] - Decrements minutes by 1. + * - [Shift]+[Ctrl]+[Page Up] - Increments seconds by 1. + * - [Shift]+[Ctrl]+[Page Down] - Decrements seconds by 1. * - [A] or [P] - Selects AM or PM respectively. * - [0]-[9] - Allows direct time selecting (hours/minutes/seconds). * - [:] - Allows switching between hours/minutes/seconds clocks. If the last clock is displayed and [:] is pressed, the first clock is beind displayed. diff --git a/packages/main/src/Toolbar.ts b/packages/main/src/Toolbar.ts index 66c282dafba8..2f00012e9c10 100644 --- a/packages/main/src/Toolbar.ts +++ b/packages/main/src/Toolbar.ts @@ -61,7 +61,7 @@ function parsePxValue(styleSet: CSSStyleDeclaration, propertyName: string): numb * The `ui5-toolbar` provides advanced keyboard handling. * * - The control is not interactive, but can contain of interactive elements - * - [TAB] - iterates through elements + * - [Tab] - iterates through elements * * ### ES6 Module Import * `import "@ui5/webcomponents/dist/Toolbar.js";` diff --git a/packages/main/src/Tree.ts b/packages/main/src/Tree.ts index 51d9c956e3ae..9c414f76b7a8 100644 --- a/packages/main/src/Tree.ts +++ b/packages/main/src/Tree.ts @@ -68,15 +68,15 @@ type WalkCallback = (item: TreeItemBase, level: number, index: number) => void; * The `ui5-tree` provides advanced keyboard handling. * The user can use the following keyboard shortcuts in order to navigate trough the tree: * - * - [UP/DOWN] - Navigates up and down the tree items that are currently visible. - * - [RIGHT] - Drills down the tree by expanding the tree nodes. - * - [LEFT] - Goes up the tree and collapses the tree nodes. + * - [Up] or [Down] - Navigates up and down the tree items that are currently visible. + * - [Right] - Drills down the tree by expanding the tree nodes. + * - [Left] - Goes up the tree and collapses the tree nodes. * * The user can use the following keyboard shortcuts to perform selection, * when the `mode` property is in use: * - * - [SPACE] - Selects the currently focused item upon keyup. - * - [ENTER] - Selects the currently focused item upon keydown. + * - [Space] - Selects the currently focused item upon keyup. + * - [Enter] - Selects the currently focused item upon keydown. * * ### ES6 Module Import * `import "@ui5/webcomponents/dist/Tree.js";` diff --git a/packages/main/test/pages/List_keyboard_support.html b/packages/main/test/pages/List_keyboard_support.html index ce03d78c34ae..bc923075f29b 100644 --- a/packages/main/test/pages/List_keyboard_support.html +++ b/packages/main/test/pages/List_keyboard_support.html @@ -22,8 +22,8 @@ UI5 Table Web Component
The sample shows the keyboard navigation support of the Table
-
diff --git a/packages/main/test/pages/Menu.html b/packages/main/test/pages/Menu.html index 72779f1b1bf9..0d62195ae7b3 100644 --- a/packages/main/test/pages/Menu.html +++ b/packages/main/test/pages/Menu.html @@ -139,7 +139,7 @@ menu.addEventListener("ui5-before-close", function(event) { preventBeforeClose.checked && event.preventDefault(); - eventLogger.value += "* [before-close]" + (event.detail.escPressed ? "[Esc]" : "") + (preventBeforeClose.checked ? "[prevented]" : "") + " "; + eventLogger.value += "* [before-close]" + (event.detail.escPressed ? "[Escape]" : "") + (preventBeforeClose.checked ? "[prevented]" : "") + " "; }); menu.addEventListener("ui5-after-close", function() { diff --git a/packages/main/test/samples/RadioButton.sample.html b/packages/main/test/samples/RadioButton.sample.html index d43ff8f5594d..f9575fae58d0 100644 --- a/packages/main/test/samples/RadioButton.sample.html +++ b/packages/main/test/samples/RadioButton.sample.html @@ -31,7 +31,7 @@- To navigate between items use the [UP] and [DOWN] arrow keys
-- To navigate within an item use the [TAB] and [SHIFT+TAB] keys
+- To navigate between items use the [Up] and [Down] arrow keys
+- To navigate within an item use the [Tab] and [SHIFT+TAB] keys
Basic RadioButton Types
- RadioButton in group - navigate via [UP/Right] and [DOWN/Left] arrow keys
+RadioButton in group - navigate via [Up] or [Right] and [Down], [Left] arrow keys
diff --git a/packages/main/src/ColorPicker.ts b/packages/main/src/ColorPicker.ts index a30a253df263..c01d868b6fb5 100644 --- a/packages/main/src/ColorPicker.ts +++ b/packages/main/src/ColorPicker.ts @@ -96,7 +96,7 @@ class ColorPicker extends UI5Element { * @public */ @property({ validator: CSSColor, defaultValue: "rgba(255, 255, 255, 1)" }) - color!: string; + value!: string; /** * Defines the HEX code of the currently selected color @@ -112,14 +112,14 @@ class ColorPicker extends UI5Element { * @private */ @property({ type: Object }) - _mainColor!: ColorRGB; + _mainValue!: ColorRGB; /** * Defines the currenty selected color from the main color section. * @private */ @property({ type: Object }) - _color!: ColorRGB; + _value!: ColorRGB; /** * @private @@ -179,7 +179,7 @@ class ColorPicker extends UI5Element { }; // Default main color is red - this._mainColor = { + this._mainValue = { r: 255, g: 0, b: 0, @@ -192,9 +192,9 @@ class ColorPicker extends UI5Element { } onBeforeRendering() { - // we have the color & _mainColor properties here - this._color = getRGBColor(this.color); - const tempColor = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, 1)`; + // we have the color & ._mainValue properties here + this._value = getRGBColor(this.value); + const tempColor = `rgba(${this._value.r}, ${this._value.g}, ${this._value.b}, 1)`; this._setHex(); this._setValues(); this.style.setProperty(getScopedVarName("--ui5_Color_Picker_Progress_Container_Color"), tempColor); @@ -260,7 +260,7 @@ class ColorPicker extends UI5Element { _handleAlphaInput(e: CustomEvent) { const aphaInputValue: string = (e.target as Input).value; this._alpha = parseFloat(aphaInputValue); - this._setColor(this._color); + this._setColor(this._value); } _handleHueInput(e: CustomEvent) { @@ -316,18 +316,18 @@ class ColorPicker extends UI5Element { let tempColor; switch (target.id) { case "red": - tempColor = { ...this._color, r: targetValue }; + tempColor = { ...this._value, r: targetValue }; break; case "green": - tempColor = { ...this._color, g: targetValue }; + tempColor = { ...this._value, g: targetValue }; break; case "blue": - tempColor = { ...this._color, b: targetValue }; + tempColor = { ...this._value, b: targetValue }; break; default: - tempColor = { ...this._color }; + tempColor = { ...this._value }; } this._setColor(tempColor); @@ -335,37 +335,37 @@ class ColorPicker extends UI5Element { _setMainColor(hueValue: number) { if (hueValue <= 255) { - this._mainColor = { + this._mainValue = { r: 255, g: hueValue, b: 0, }; } else if (hueValue <= 510) { - this._mainColor = { + this._mainValue = { r: 255 - (hueValue - 255), g: 255, b: 0, }; } else if (hueValue <= 765) { - this._mainColor = { + this._mainValue = { r: 0, g: 255, b: hueValue - 510, }; } else if (hueValue <= 1020) { - this._mainColor = { + this._mainValue = { r: 0, g: 765 - (hueValue - 255), b: 255, }; } else if (hueValue <= 1275) { - this._mainColor = { + this._mainValue = { r: hueValue - 1020, g: 0, b: 255, }; } else { - this._mainColor = { + this._mainValue = { r: 255, g: 0, b: 1275 - (hueValue - 255), @@ -425,7 +425,7 @@ class ColorPicker extends UI5Element { } _setColor(color: ColorRGB = { r: 0, g: 0, b: 0 }) { - this.color = `rgba(${color.r}, ${color.g}, ${color.b}, ${this._alpha})`; + this.value = `rgba(${color.r}, ${color.g}, ${color.b}, ${this._alpha})`; this._wrongHEX = !this.isValidRGBColor(color); this.fireEvent("change"); } @@ -435,9 +435,9 @@ class ColorPicker extends UI5Element { } _setHex() { - let red = this._color.r.toString(16), - green = this._color.g.toString(16), - blue = this._color.b.toString(16); + let red = this._value.r.toString(16), + green = this._value.g.toString(16), + blue = this._value.b.toString(16); if (red.length === 1) { red = `0${red}`; @@ -453,7 +453,7 @@ class ColorPicker extends UI5Element { } _setValues() { - const hslColours: ColorHSL = RGBToHSL(this._color); + const hslColours: ColorHSL = RGBToHSL(this._value); this._selectedCoordinates = { x: ((Math.round(hslColours.l * 100) * 2.56)) - PICKER_POINTER_WIDTH, // Center the coordinates, because of the width of the circle y: (256 - (Math.round(hslColours.s * 100) * 2.56)) - PICKER_POINTER_WIDTH, // Center the coordinates, because of the height of the circle @@ -510,14 +510,14 @@ class ColorPicker extends UI5Element { get styles() { return { mainColor: { - "background-color": `rgb(${this._mainColor.r}, ${this._mainColor.g}, ${this._mainColor.b})`, + "background-color": `rgb(${this._mainValue.r}, ${this._mainValue.g}, ${this._mainValue.b})`, }, circle: { left: `${this._selectedCoordinates.x}px`, top: `${this._selectedCoordinates.y}px`, }, colorSpan: { - "background-color": `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._alpha})`, + "background-color": `rgba(${this._value.r}, ${this._value.g}, ${this._value.b}, ${this._alpha})`, }, }; } diff --git a/packages/main/test/pages/ColorPicker.html b/packages/main/test/pages/ColorPicker.html index 0f5f25b6803f..0f9d453133cf 100644 --- a/packages/main/test/pages/ColorPicker.html +++ b/packages/main/test/pages/ColorPicker.html @@ -51,8 +51,8 @@ colorPicker1 = document.getElementById("cp1"), stepInput = document.getElementById("changeEventCounter"); - colorPicker.addEventListener("ui5-change", function(event) { - colorLabel.value = event.target.color; + colorPicker.addEventListener("ui5-change", () => { + colorLabel.value = event.target.value; }); colorPicker1.addEventListener("ui5-change", function(event) { diff --git a/packages/main/test/specs/ColorPalette.spec.js b/packages/main/test/specs/ColorPalette.spec.js index 16b7de97bac4..b8e0d0513fa0 100644 --- a/packages/main/test/specs/ColorPalette.spec.js +++ b/packages/main/test/specs/ColorPalette.spec.js @@ -84,7 +84,7 @@ describe("ColorPalette interactions", () => { assert.ok(colorPicker, "Color picker is rendered"); - await colorPicker.setProperty("color", "#fafafa"); + await colorPicker.setProperty("value", "#fafafa"); // The initial focus is on the HEX input await browser.keys("Tab"); // Slider 1 diff --git a/packages/main/test/specs/ColorPicker.spec.js b/packages/main/test/specs/ColorPicker.spec.js index 978031e96173..2fe067ae1e6c 100644 --- a/packages/main/test/specs/ColorPicker.spec.js +++ b/packages/main/test/specs/ColorPicker.spec.js @@ -41,7 +41,7 @@ describe("Color Picker general interaction", () => { const colorPicker = await browser.$("#cp1"); const alphaInput = await colorPicker.shadow$("#alpha"); - await colorPicker.setAttribute("color", "rgba(100, 100, 100, 1)"); + await colorPicker.setAttribute("value", "rgba(100, 100, 100, 1)"); await alphaInput.click(); await browser.keys('Delete'); @@ -49,7 +49,7 @@ describe("Color Picker general interaction", () => { await browser.keys("0"); await browser.keys("Tab"); - assert.strictEqual(await colorPicker.getAttribute("color"), "rgba(100, 100, 100, 0)", "Alpha value propely changed"); + assert.strictEqual(await colorPicker.getAttribute("value"), "rgba(100, 100, 100, 0)", "Alpha value propely changed"); }); it("Alpha value change via the slider", async () => { @@ -59,11 +59,11 @@ describe("Color Picker general interaction", () => { await stepInput.setAttribute("value", 0); await colorPicker.scrollIntoView(); - await colorPicker.setAttribute("color", "rgba(183, 61, 61, 1)"); + await colorPicker.setAttribute("value", "rgba(183, 61, 61, 1)"); await alphaSliderHandle.dragAndDrop({ x: 200, y: 0 }); - assert.strictEqual(await colorPicker.getAttribute("color"), "rgba(183, 61, 61, 0.83)", "Alpha value propely changed"); + assert.strictEqual(await colorPicker.getAttribute("value"), "rgba(183, 61, 61, 0.83)", "Alpha value propely changed"); assert.strictEqual(await stepInput.getAttribute("value"), "1", "Change event gets fired on alpha slider change"); }); @@ -73,11 +73,11 @@ describe("Color Picker general interaction", () => { const stepInput = await browser.$("#changeEventCounter"); await colorPicker.scrollIntoView(); - await colorPicker.setAttribute("color", "rgba(183, 61, 61, 0.83)"); + await colorPicker.setAttribute("value", "rgba(183, 61, 61, 0.83)"); await hueSliderHandle.dragAndDrop({ x: 200, y: 0 }); - assert.strictEqual(await colorPicker.getAttribute("color"), "rgba(182, 61, 184, 0.83)", "Color properly changed"); + assert.strictEqual(await colorPicker.getAttribute("value"), "rgba(182, 61, 184, 0.83)", "Color properly changed"); assert.strictEqual(await stepInput.getAttribute("value"), "2", "Change event gets fired on hue slider change"); }); @@ -85,19 +85,19 @@ describe("Color Picker general interaction", () => { const colorPicker = await browser.$("#cp3"); const hexInput = await colorPicker.shadow$(".ui5-color-picker-hex-input"); - await colorPicker.setProperty("color", "rgb(0, 255, 0)"); + await colorPicker.setProperty("value", "rgb(0, 255, 0)"); assert.strictEqual(await hexInput.getProperty("value"), "00ff00", "RGB value is parsed correctly"); - await colorPicker.setProperty("color", "rgba(255, 0, 255, 1)"); + await colorPicker.setProperty("value", "rgba(255, 0, 255, 1)"); assert.strictEqual(await hexInput.getProperty("value"), "ff00ff", "RGBA value is parsed correctly"); - await colorPicker.setProperty("color", "#fafafa"); + await colorPicker.setProperty("value", "#fafafa"); assert.strictEqual(await hexInput.getProperty("value"), "fafafa", "HEX value is parsed correctly"); - await colorPicker.setProperty("color", "#123"); + await colorPicker.setProperty("value", "#123"); assert.strictEqual(await hexInput.getProperty("value"), "112233", "HEX shorthand value is parsed correctly"); - await colorPicker.setProperty("color", "grey"); + await colorPicker.setProperty("value", "grey"); assert.strictEqual(await hexInput.getProperty("value"), "808080", "CSS values are parsed correctly"); }); @@ -110,7 +110,7 @@ describe("Color Picker general interaction", () => { await browser.keys("0854a0"); await browser.keys("Enter"); - const color = await colorPicker.getAttribute("color"); + const value = await colorPicker.getAttribute("value"); await hueSliderHandle.dragAndDrop({ x: 200, y: 0 }); @@ -118,7 +118,7 @@ describe("Color Picker general interaction", () => { await browser.keys("0854a0"); await browser.keys("Enter"); - assert.strictEqual(await colorPicker.getAttribute("color"), color, "Color is changed to the old color"); + assert.strictEqual(await colorPicker.getAttribute("value"), value, "Color is changed to the old color"); }); it("Hue value remains unchanged when user presses over the main color section", async () => { diff --git a/packages/playground/_stories/main/ColorPicker/ColorPicker.stories.ts b/packages/playground/_stories/main/ColorPicker/ColorPicker.stories.ts index a4fb809db068..71c8ed6a8b69 100644 --- a/packages/playground/_stories/main/ColorPicker/ColorPicker.stories.ts +++ b/packages/playground/_stories/main/ColorPicker/ColorPicker.stories.ts @@ -14,10 +14,10 @@ export default { } as Meta@@ -86,7 +86,7 @@ class="ui5-color-picker-rgb-input" disabled="{{inputsDisabled}}" accessible-name="{{blueInputLabel}}" - value="{{_color.b}}" + value="{{_value.b}}" >Group of states diff --git a/packages/main/test/specs/DatePicker.spec.js b/packages/main/test/specs/DatePicker.spec.js index 4fb1f80d6def..813464edc523 100644 --- a/packages/main/test/specs/DatePicker.spec.js +++ b/packages/main/test/specs/DatePicker.spec.js @@ -350,7 +350,7 @@ describe("Date Picker Tests", () => { assert.ok(await datepicker.isPickerOpen(), "datepicker is open"); }); - it("[Alt] + [UP] toggles the calendar", async () => { + it("[Alt] + [Up] toggles the calendar", async () => { datepicker.id = "#dp9"; assert.notOk(await datepicker.isPickerOpen(), "datepicker is closed"); @@ -366,7 +366,7 @@ describe("Date Picker Tests", () => { assert.notOk(await datepicker.isPickerOpen(), "datepicker is closed"); }); - it("[Alt] + [DOWN] toggles the calendar", async () => { + it("[Alt] + [Down] toggles the calendar", async () => { datepicker.id = "#dp11"; assert.notOk(await datepicker.isPickerOpen(), "datepicker is closed"); @@ -394,7 +394,7 @@ describe("Date Picker Tests", () => { await valueHelpIcon.click(); // close the datepicker }); - it("[SHIFT] + [F4] shows year picker after date picker is open", async () => { + it("[Shift] + [F4] shows year picker after date picker is open", async () => { datepicker.id = "#dp11"; const valueHelpIcon = await datepicker.getValueHelpIcon(); @@ -420,7 +420,7 @@ describe("Date Picker Tests", () => { }); - it("[SHIFT] + [F4] shows year picker after month picker is open", async () => { + it("[Shift] + [F4] shows year picker after month picker is open", async () => { datepicker.id = "#dp11"; const valueHelpIcon = await datepicker.getValueHelpIcon(); From 7f61f6d60741708d2f2c2fdb1ec2e7874222b510 Mon Sep 17 00:00:00 2001 From: ilhan orhanDate: Mon, 25 Mar 2024 19:09:16 +0200 Subject: [PATCH 19/60] Update docusaurus.config.ts --- packages/website/docusaurus.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/docusaurus.config.ts b/packages/website/docusaurus.config.ts index 998912429cf3..aa9ae783139c 100644 --- a/packages/website/docusaurus.config.ts +++ b/packages/website/docusaurus.config.ts @@ -7,7 +7,7 @@ import packageJson from "./package.json"; console.log(process.env.DEPLOYMENT_TYPE); // eslint-disable-line const LATEST_URL_PARTH = "/ui5-webcomponents/"; -const NIGHTLY_URL_PARTH = "/ui5-webcomponents/nightly/"; +const NIGHTLY_URL_PARTH = "/ui5-webcomponents/v2/"; const LATEST_DEPLOYMENT = process.env.DEPLOYMENT_TYPE === "latest"; const DEVELOPMENT_ENVIRONMENT = process.env.NODE_ENV === "development"; From 5bfa36d00ff438a2b15ccee2a0797f597145c6ab Mon Sep 17 00:00:00 2001 From: Peter Skelin Date: Mon, 25 Mar 2024 17:10:10 +0200 Subject: [PATCH 20/60] docs: add reset button in playground (#8531) --- packages/website/src/components/Editor/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/website/src/components/Editor/index.js b/packages/website/src/components/Editor/index.js index ae1def266ce7..3fce7f7aedc3 100644 --- a/packages/website/src/components/Editor/index.js +++ b/packages/website/src/components/Editor/index.js @@ -10,6 +10,7 @@ import { encodeToBase64, decodeFromBase64 } from "./share.js"; import clsx from "clsx"; import ShareIcon from "../../../local-cdn/local-cdn/icons/dist/v5/share-2.svg"; import { Splitter } from 'react-splitter-light'; +import ResetIcon from "../../../local-cdn/local-cdn/icons/dist/v5/reset.svg"; import DownloadIcon from "../../../local-cdn/local-cdn/icons/dist/v5/download-from-cloud.svg"; import EditIcon from "../../../local-cdn/local-cdn/icons/dist/v5/edit.svg"; import ActionIcon from "../../../local-cdn/local-cdn/icons/dist/v5/action.svg"; @@ -125,6 +126,12 @@ export default function Editor({html, js, css, mainFile = "main.js", canShare = return files; } + const reset = () => { + localStorage.clear("project"); + location.hash = ""; + location.reload(); + } + const download = () => { const files = getSampleFiles(); downloadSample(files); @@ -332,6 +339,14 @@ ${fixAssetPaths(js)}`, ? <> + +@@ -76,7 +76,7 @@ class="ui5-color-picker-rgb-input" disabled="{{inputsDisabled}}" accessible-name="{{greenInputLabel}}" - value="{{_color.g}}" + value="{{_value.g}}" >G B ; const Template: UI5StoryArgs = (args) => html` Picker `; export const Basic = Template.bind({}); Basic.args = { - color: "rgba(220, 208, 255, 1)", + value: "rgba(220, 208, 255, 1)", }; diff --git a/packages/website/docs/_samples/main/ColorPicker/Basic/sample.html b/packages/website/docs/_samples/main/ColorPicker/Basic/sample.html index b0c833a2206b..e3ff21bc4645 100644 --- a/packages/website/docs/_samples/main/ColorPicker/Basic/sample.html +++ b/packages/website/docs/_samples/main/ColorPicker/Basic/sample.html @@ -11,7 +11,7 @@ -Picker +Picker From 83ee0cc77bfc22e9eac68eda8af2cb8f98557e7e Mon Sep 17 00:00:00 2001 From: Nayden Naydenov <31909318+nnaydenow@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:00:11 +0200 Subject: [PATCH 28/60] refactor(tools): enable TypeScript as default (#8521) With this update, TypeScript is now enabled by default for the 'tools' package, along with cleanup for the configuration options. BREAKING CHANGE: JavaScript projects may not function properly with the tools package. Related to: #8461 --- packages/base/package-scripts.cjs | 6 +-- .../template/package-scripts.js | 1 - packages/fiori/package-scripts.cjs | 1 - .../icons-business-suite/package-scripts.cjs | 1 - packages/main/package-scripts.cjs | 1 - packages/theming/package-scripts.cjs | 4 +- packages/tools/components-package/nps.js | 27 +++++------- packages/tools/icons-collection/nps.js | 8 ++-- .../css-processor-components.mjs | 7 +--- .../css-processors/css-processor-themes.mjs | 7 +--- packages/tools/lib/css-processors/shared.mjs | 16 +------- .../tools/lib/generate-json-imports/i18n.js | 41 ++----------------- .../tools/lib/generate-json-imports/themes.js | 34 +-------------- packages/tools/lib/hbs2lit/src/compiler.js | 4 +- packages/tools/lib/hbs2lit/src/litVisitor2.js | 22 +++------- .../tools/lib/hbs2lit/src/svgProcessor.js | 5 +-- .../hbs2ui5/RenderTemplates/LitRenderer.js | 4 -- packages/tools/lib/hbs2ui5/index.js | 2 +- packages/tools/lib/i18n/defaults.js | 12 ++---- 19 files changed, 42 insertions(+), 161 deletions(-) diff --git a/packages/base/package-scripts.cjs b/packages/base/package-scripts.cjs index 5783ff7574dc..11b367b05fdc 100644 --- a/packages/base/package-scripts.cjs +++ b/packages/base/package-scripts.cjs @@ -15,8 +15,8 @@ const viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-p const scripts = { clean: "rimraf src/generated && rimraf dist && rimraf .port", lint: `eslint .`, - generate: "cross-env UI5_TS=true nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates", - prepare: "cross-env UI5_TS=true nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates typescript integrate.no-remaining-require", + generate: "nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates", + prepare: "nps clean integrate copy generateAssetParameters generateVersionInfo generateStyles generateTemplates typescript integrate.no-remaining-require", typescript: "tsc -b", integrate: { default: "nps integrate.copy-used-modules integrate.amd-to-es6 integrate.third-party", @@ -40,7 +40,7 @@ const scripts = { generateAssetParameters: `node "${assetParametersScript}"`, generateVersionInfo: `node "${versionScript}"`, generateStyles: `node "${stylesScript}"`, - generateTemplates: `mkdirp src/generated/templates && cross-env UI5_BASE=true UI5_TS=true node "${LIB}/hbs2ui5/index.js" -d test/elements -o src/generated/templates`, + generateTemplates: `mkdirp src/generated/templates && cross-env UI5_BASE=true node "${LIB}/hbs2ui5/index.js" -d test/elements -o src/generated/templates`, generateAPI: { default: "nps generateAPI.generateCEM generateAPI.validateCEM", generateCEM: `cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs" --dev`, diff --git a/packages/create-package/template/package-scripts.js b/packages/create-package/template/package-scripts.js index 5ffd5958540e..9cdebf1927a7 100644 --- a/packages/create-package/template/package-scripts.js +++ b/packages/create-package/template/package-scripts.js @@ -2,7 +2,6 @@ const getScripts = require("@ui5/webcomponents-tools/components-package/nps.js") const options = { port: 8080, - typescript: true, }; const scripts = getScripts(options); diff --git a/packages/fiori/package-scripts.cjs b/packages/fiori/package-scripts.cjs index d0d3ced336d7..605392e28a86 100644 --- a/packages/fiori/package-scripts.cjs +++ b/packages/fiori/package-scripts.cjs @@ -17,7 +17,6 @@ const options = { portStep: 2, dev: true, fioriPackage: true, - typescript: true, noWatchTS: true, illustrationsData: [ { diff --git a/packages/icons-business-suite/package-scripts.cjs b/packages/icons-business-suite/package-scripts.cjs index 4e495d819594..af644c7a7aff 100644 --- a/packages/icons-business-suite/package-scripts.cjs +++ b/packages/icons-business-suite/package-scripts.cjs @@ -3,7 +3,6 @@ const getScripts = require("@ui5/webcomponents-tools/icons-collection/nps.js"); const options = { collectionName: "SAP-icons-business-suite", versions: ["v1", "v2"], - typescript: true, }; const scripts = getScripts(options); diff --git a/packages/main/package-scripts.cjs b/packages/main/package-scripts.cjs index b0b5017282fc..1b3a58a91359 100644 --- a/packages/main/package-scripts.cjs +++ b/packages/main/package-scripts.cjs @@ -3,7 +3,6 @@ const getScripts = require("@ui5/webcomponents-tools/components-package/nps.js") const options = { port: 8080, portStep: 2, - typescript: true, noWatchTS: true, dev: true, }; diff --git a/packages/theming/package-scripts.cjs b/packages/theming/package-scripts.cjs index b83810bb2e8b..1aba6af5b642 100644 --- a/packages/theming/package-scripts.cjs +++ b/packages/theming/package-scripts.cjs @@ -10,9 +10,9 @@ const LIB = path.join(__dirname, `../tools/lib/`); module.exports = { scripts: { clean: "rimraf dist && rimraf src/generated", - generate: `cross-env UI5_TS=true nps build.postcss build.jsonImports`, + generate: "nps build.postcss build.jsonImports", build: { - default: `cross-env UI5_TS=true nps clean build.src build.postcss build.jsonImports build.typescript generateReport`, + default: "nps clean build.src build.postcss build.jsonImports build.typescript generateReport", src: `copy-and-watch "src/**/*.{json}" dist/`, typescript: "tsc", postcss: `node "${LIB}/css-processors/css-processor-themes.mjs"`, diff --git a/packages/tools/components-package/nps.js b/packages/tools/components-package/nps.js index bb558a95fa64..de355c544faa 100644 --- a/packages/tools/components-package/nps.js +++ b/packages/tools/components-package/nps.js @@ -12,22 +12,17 @@ const getScripts = (options) => { // The script creates the "src/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration const createIllustrationsLoadersScript = illustrationsData.map(illustrations => `node ${LIB}/generate-js-imports/illustrations.js ${illustrations.destinationPath} ${illustrations.dynamicImports.outputFile} ${illustrations.set} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.filterOut.join(" ")}`).join(" && "); - const tsOption = options.typescript; - const tsCommandOld = tsOption ? "tsc" : ""; - let tsWatchCommandStandalone = tsOption ? "tsc --watch" : ""; + let tsWatchCommandStandalone = "tsc --watch"; // this command is only used for standalone projects. monorepo projects get their watch from vite, so opt-out here if (options.noWatchTS) { tsWatchCommandStandalone = ""; } - const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : ""; - if (tsOption) { - try { - require("typescript"); - } catch(e) { - console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`); - process.exit(e.code); - } + try { + require("typescript"); + } catch(e) { + console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`); + process.exit(e.code); } let viteConfig; @@ -56,19 +51,19 @@ const getScripts = (options) => { lint: `eslint . ${eslintConfig}`, lintfix: `eslint . ${eslintConfig} --fix`, generate: { - default: `${tsCrossEnv} nps prepare.all`, + default: "nps prepare.all", all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"', styleRelated: "nps build.styles build.jsonImports build.jsImports", }, prepare: { - default: `${tsCrossEnv} nps clean prepare.all copy prepare.typescript generateAPI`, + default: "nps clean prepare.all copy prepare.typescript generateAPI", all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps build.illustrations"', styleRelated: "nps build.styles build.jsonImports build.jsImports", - typescript: tsCommandOld, + typescript: "tsc", }, build: { default: "nps prepare lint build.bundle", // build.bundle2 - templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`, + templates: `mkdirp src/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`, styles: { default: `concurrently "nps build.styles.themes" "nps build.styles.components" "nps build.styles.componentStyles"`, themes: `node "${LIB}/css-processors/css-processor-themes.mjs"`, @@ -100,7 +95,7 @@ const getScripts = (options) => { props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`, }, watch: { - default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.typescript" "nps watch.api" "nps watch.src" "nps watch.styles" "nps watch.i18n" "nps watch.props"`, + default: `concurrently "nps watch.templates" "nps watch.typescript" "nps watch.api" "nps watch.src" "nps watch.styles" "nps watch.i18n" "nps watch.props"`, devServer: 'concurrently "nps watch.default" "nps watch.bundle"', src: 'nps "copy.src --watch --safe --skip-initial-copy"', typescript: tsWatchCommandStandalone, diff --git a/packages/tools/icons-collection/nps.js b/packages/tools/icons-collection/nps.js index 39bab7a9d141..f719c99ff994 100644 --- a/packages/tools/icons-collection/nps.js +++ b/packages/tools/icons-collection/nps.js @@ -41,16 +41,14 @@ const copyIconAssetsCommand = (options) => { const getScripts = (options) => { const createJSImportsCmd = createIconImportsCommand(options); const copyAssetsCmd = copyIconAssetsCommand(options); - const tsCommand = options.typescript ? "tsc --build" : ""; - const tsCrossEnv = options.typescript ? "cross-env UI5_TS=true" : ""; const scripts = { clean: "rimraf dist && rimraf src/generated", copy: copyAssetsCmd, - generate: `${tsCrossEnv} nps clean copy build.i18n build.icons build.jsonImports copyjson`, + generate: "nps clean copy build.i18n build.icons build.jsonImports copyjson", copyjson: "copy-and-watch \"src/generated/**/*.json\" dist/generated/", build: { - default: `${tsCrossEnv} nps clean copy build.i18n typescript build.icons build.jsonImports`, + default: "nps clean copy build.i18n typescript build.icons build.jsonImports", i18n: { default: "nps build.i18n.defaultsjs build.i18n.json", defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`, @@ -62,7 +60,7 @@ const getScripts = (options) => { }, icons: createJSImportsCmd, }, - typescript: tsCommand, + typescript: "tsc --build", }; return scripts; diff --git a/packages/tools/lib/css-processors/css-processor-components.mjs b/packages/tools/lib/css-processors/css-processor-components.mjs index 7c0565fc3624..ad47d2ebb37f 100644 --- a/packages/tools/lib/css-processors/css-processor-components.mjs +++ b/packages/tools/lib/css-processors/css-processor-components.mjs @@ -7,9 +7,6 @@ import chokidar from "chokidar"; import scopeVariables from "./scope-variables.mjs"; import { writeFileIfChanged, getFileContent } from "./shared.mjs"; -const tsMode = process.env.UI5_TS === "true"; -const extension = tsMode ? ".css.ts" : ".css.js"; - const packageJSON = JSON.parse(fs.readFileSync("./package.json")) const inputFilesGlob = "src/themes/*.css"; const restArgs = process.argv.slice(2); @@ -27,8 +24,8 @@ let customPlugin = { writeFile(f.path, newText); // JS/TS - const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension); - const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`", true); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); + const jsContent = getFileContent(jsPath, packageJSON.name, "\`" + newText + "\`", true); writeFileIfChanged(jsPath, jsContent); }); }) diff --git a/packages/tools/lib/css-processors/css-processor-themes.mjs b/packages/tools/lib/css-processors/css-processor-themes.mjs index 8ec918a8c94a..7cae5c53ca9f 100644 --- a/packages/tools/lib/css-processors/css-processor-themes.mjs +++ b/packages/tools/lib/css-processors/css-processor-themes.mjs @@ -8,9 +8,6 @@ import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/ import { writeFileIfChanged, stripThemingBaseContent, getFileContent } from "./shared.mjs"; import scopeVariables from "./scope-variables.mjs"; -const tsMode = process.env.UI5_TS === "true"; -const extension = tsMode ? ".css.ts" : ".css.js"; - const packageJSON = JSON.parse(fs.readFileSync("./package.json")) let inputFiles = await globby("src/**/parameters-bundle.css"); @@ -50,8 +47,8 @@ let scopingPlugin = { writeFileIfChanged(jsonPath, JSON.stringify({_: data})); // JS/TS - const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", extension); - const jsContent = getFileContent(tsMode, jsPath, packageJSON.name, "\`" + newText + "\`"); + const jsPath = f.path.replace(/dist[\/\\]css/, "src/generated/").replace(".css", ".css.ts"); + const jsContent = getFileContent(jsPath, packageJSON.name, "\`" + newText + "\`"); writeFileIfChanged(jsPath, jsContent); }); }) diff --git a/packages/tools/lib/css-processors/shared.mjs b/packages/tools/lib/css-processors/shared.mjs index b19101eaab52..af78bb424c01 100644 --- a/packages/tools/lib/css-processors/shared.mjs +++ b/packages/tools/lib/css-processors/shared.mjs @@ -47,15 +47,7 @@ registerThemePropertiesLoader("${packageName}", "${DEFAULT_THEME}", async () => `; }; -const getFileContent = (tsMode, targetFile, packageName, css, includeDefaultTheme) => { - if (tsMode) { - return getTSContent(targetFile, packageName, css, includeDefaultTheme); - } - - return getJSContent(targetFile, packageName, css, includeDefaultTheme); -} - -const getTSContent = (targetFile, packageName, css, includeDefaultTheme) => { +const getFileContent = (targetFile, packageName, css, includeDefaultTheme) => { const typeImport = "import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";" const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; @@ -67,10 +59,4 @@ export default styleData; `; } -const getJSContent = (targetFile, packageName, css, includeDefaultTheme) => { - const defaultTheme = includeDefaultTheme ? getDefaultThemeCode(packageName) : ""; - - return `${defaultTheme}export default {packageName:"${packageName}",fileName:"${targetFile.substr(targetFile.lastIndexOf("themes"))}",content:${css}}` -} - export { writeFileIfChanged, stripThemingBaseContent, getFileContent} \ No newline at end of file diff --git a/packages/tools/lib/generate-json-imports/i18n.js b/packages/tools/lib/generate-json-imports/i18n.js index 74e8d1d1a14b..b020b55117ab 100644 --- a/packages/tools/lib/generate-json-imports/i18n.js +++ b/packages/tools/lib/generate-json-imports/i18n.js @@ -1,16 +1,12 @@ const fs = require("fs").promises; const path = require('path'); -const isTypeScript = process.env.UI5_TS; -const ext = isTypeScript ? 'ts' : 'js'; - const generate = async () => { const packageName = JSON.parse(await fs.readFile("package.json")).name; const inputFolder = path.normalize(process.argv[2]); - const outputFile = path.normalize(`${process.argv[3]}/i18n-static.${ext}`); - const outputFileDynamic = path.normalize(`${process.argv[3]}/i18n.${ext}`); + const outputFileDynamic = path.normalize(`${process.argv[3]}/i18n.ts`); // All languages present in the file system const files = await fs.readdir(inputFolder); @@ -19,46 +15,16 @@ const generate = async () => { return matches ? matches[1] : undefined; }).filter(key => !!key); - let contentStatic, contentDynamic; + let contentDynamic; // No i18n - just import dependencies, if any if (languages.length === 0) { - contentStatic = ""; contentDynamic = ""; // There is i18n - generate the full file } else { // Keys for the array - const languagesKeysString = languages.map(key => `"${key}": _${key},`).join("\n\t"); const languagesKeysStringArray = languages.map(key => `"${key}",`).join("\n\t"); - // Actual imports for json assets - const assetsImportsString = languages.map(key => `import _${key} from "../assets/i18n/messagebundle_${key}.json";`).join("\n"); - - // static imports - contentStatic = `// @ts-nocheck -import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registries/i18n.js"; - -${assetsImportsString} - -const bundleMap = { - ${languagesKeysString} -}; - -const fetchMessageBundle = async (localeId) => { - if (typeof bundleMap[localeId] === "object") { - // inlined from build - throw new Error("[i18n] Inlined JSON not supported with static imports of assets. Use dynamic imports of assets or configure JSON imports as URLs") - } - return (await fetch(bundleMap[localeId])).json() -} - -const localeIds = [${languagesKeysStringArray}]; - -localeIds.forEach(localeId => { - registerI18nLoader("${packageName}", localeId, fetchMessageBundle); -}); -`; - // Actual imports for json assets const dynamicImportsString = languages.map(key => ` case "${key}": return (await import(/* webpackChunkName: "${packageName.replace("@", "").replace("/", "-")}-messagebundle-${key}" */ "../assets/i18n/messagebundle_${key}.json")).default;`).join("\n"); @@ -91,9 +57,8 @@ import { registerI18nLoader } from "@ui5/webcomponents-base/dist/asset-registrie } - await fs.mkdir(path.dirname(outputFile), { recursive: true }); + await fs.mkdir(path.dirname(outputFileDynamic), { recursive: true }); return Promise.all([ - fs.writeFile(outputFile, contentStatic), fs.writeFile(outputFileDynamic, contentDynamic), ]); } diff --git a/packages/tools/lib/generate-json-imports/themes.js b/packages/tools/lib/generate-json-imports/themes.js index 4f83c25fd767..d2f94a32e4d8 100644 --- a/packages/tools/lib/generate-json-imports/themes.js +++ b/packages/tools/lib/generate-json-imports/themes.js @@ -2,13 +2,9 @@ const fs = require("fs").promises; const path = require('path'); const assets = require("../../assets-meta.js"); -const isTypeScript = process.env.UI5_TS; -const ext = isTypeScript ? 'ts' : 'js'; - const generate = async () => { const inputFolder = path.normalize(process.argv[2]); - const outputFile = path.normalize(`${process.argv[3]}/Themes-static.${ext}`); - const outputFileDynamic = path.normalize(`${process.argv[3]}/Themes.${ext}`); + const outputFileDynamic = path.normalize(`${process.argv[3]}/Themes.ts`); // All supported optional themes const allThemes = assets.themes.all; @@ -22,34 +18,9 @@ const generate = async () => { const packageName = JSON.parse(await fs.readFile("package.json")).name; - const importLines = themesOnFileSystem.map(theme => `import ${theme} from "../assets/themes/${theme}/parameters-bundle.css.json";`).join("\n"); - const themeUrlsByName = "{\n" + themesOnFileSystem.join(",\n") + "\n}"; const availableThemesArray = `[${themesOnFileSystem.map(theme => `"${theme}"`).join(", ")}]`; const dynamicImportLines = themesOnFileSystem.map(theme => `\t\tcase "${theme}": return (await import(/* webpackChunkName: "${packageName.replace("@", "").replace("/", "-")}-${theme.replace("_", "-")}-parameters-bundle" */"../assets/themes/${theme}/parameters-bundle.css.json")).default;`).join("\n"); - -// static imports file content - const contentStatic = `// @ts-nocheck -import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js"; - -${importLines} - -const themeUrlsByName = ${themeUrlsByName}; -const isInlined = obj => typeof (obj) === "object"; - -const loadThemeProperties = async (themeName) => { - if (typeof themeUrlsByName[themeName] === "object") { - // inlined from build - throw new Error("[themes] Inlined JSON not supported with static imports of assets. Use dynamic imports of assets or configure JSON imports as URLs"); - } - return (await fetch(themeUrlsByName[themeName])).json(); -}; - -${availableThemesArray} - .forEach(themeName => registerThemePropertiesLoader("${packageName}", themeName, loadThemeProperties)); -`; - - // dynamic imports file content const contentDynamic = `// @ts-nocheck import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js"; @@ -73,9 +44,8 @@ ${availableThemesArray} .forEach(themeName => registerThemePropertiesLoader("${packageName}", themeName, loadAndCheck)); `; - await fs.mkdir(path.dirname(outputFile), { recursive: true }); + await fs.mkdir(path.dirname(outputFileDynamic), { recursive: true }); return Promise.all([ - fs.writeFile(outputFile, contentStatic), fs.writeFile(outputFileDynamic, contentDynamic) ]); }; diff --git a/packages/tools/lib/hbs2lit/src/compiler.js b/packages/tools/lib/hbs2lit/src/compiler.js index 8b1740402aa6..5a46c7c963ff 100644 --- a/packages/tools/lib/hbs2lit/src/compiler.js +++ b/packages/tools/lib/hbs2lit/src/compiler.js @@ -17,12 +17,10 @@ const hbs2lit = async (file, componentName) => { sPreprocessed = removeWhiteSpaces(sPreprocessed); - const blockSignature = process.env.UI5_TS ? `this: ${componentName}` : "" - // icons hack if (sPreprocessed.startsWith("")) { return ` - function block0 (${blockSignature}) { + function block0 (this: ${componentName}) { return svg\`${sPreprocessed}\` }`; } diff --git a/packages/tools/lib/hbs2lit/src/litVisitor2.js b/packages/tools/lib/hbs2lit/src/litVisitor2.js index 557922bb135f..73837248da2c 100644 --- a/packages/tools/lib/hbs2lit/src/litVisitor2.js +++ b/packages/tools/lib/hbs2lit/src/litVisitor2.js @@ -37,8 +37,7 @@ function HTMLLitVisitor(componentName, debug) { this.blockLevel = 0; this.componentName = componentName const blockParametersDefinitionTS = [`this: ${componentName}`, "context: UI5Element", "tags: string[]", "suffix: string | undefined"]; - const blockParametersDefinitionJS = ["context", "tags", "suffix"]; - this.blockParametersDefinition = process.env.UI5_TS ? blockParametersDefinitionTS : blockParametersDefinitionJS; + this.blockParametersDefinition = blockParametersDefinitionTS; this.blockParametersUsage = ["this", "context", "tags", "suffix"]; this.paths = []; //contains all normalized relative paths this.debug = debug; @@ -110,11 +109,7 @@ HTMLLitVisitor.prototype.MustacheStatement = function(mustache) { if (isNodeValue && !mustache.escaped) { parsedCode = `\${unsafeHTML(${path})}`; } else if (hasCalculatingClasses) { - if (process.env.UI5_TS) { - parsedCode = `\${classMap(${path} as ClassMapValue)}`; - } else { - parsedCode = `\${classMap(${path})}`; - } + parsedCode = `\${classMap(${path} as ClassMapValue)}`; } else if (isStyleAttribute) { parsedCode = `\${styleMap(${path})}`; } else if (skipIfDefined){ @@ -180,8 +175,7 @@ function visitEachBlock(block) { visitSubExpression.call(this, block); const reapeatDirectiveParamsTS = "(item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number)"; - const reapeatDirectiveParamsJS = "(item, index) => item._id || index, (item, index)"; - const repleatDirectiveParams = process.env.UI5_TS ? reapeatDirectiveParamsTS : reapeatDirectiveParamsJS; + const repleatDirectiveParams = reapeatDirectiveParamsTS; this.blocks[this.currentKey()] += "${ repeat(" + normalizePath.call(this, block.params[0].original) + ", " + repleatDirectiveParams + " => "; this.paths.push(normalizePath.call(this, block.params[0].original)); this.blockLevel++; @@ -191,13 +185,9 @@ function visitEachBlock(block) { if (!this.blockParametersUsage.includes("index")) { // last item is not index, but an each block is processed, add the paramters for further nested blocks bParamAdded = true; - if (process.env.UI5_TS) { - this.blockParametersDefinition.push("item: any"); - this.blockParametersDefinition.push("index: number"); - } else { - this.blockParametersDefinition.push("item"); - this.blockParametersDefinition.push("index"); - } + this.blockParametersDefinition.push("item: any"); + this.blockParametersDefinition.push("index: number"); + this.blockParametersUsage.push("item"); this.blockParametersUsage.push("index"); } diff --git a/packages/tools/lib/hbs2lit/src/svgProcessor.js b/packages/tools/lib/hbs2lit/src/svgProcessor.js index 203ddc97fcca..032f058a4f67 100644 --- a/packages/tools/lib/hbs2lit/src/svgProcessor.js +++ b/packages/tools/lib/hbs2lit/src/svgProcessor.js @@ -48,13 +48,10 @@ function getSVGBlock(input, blockCounter) { const definitionTS = `\nfunction blockSVG${blockCounter} (this: any, context: UI5Element, tags: string[], suffix: string | undefined) { return svg\`${input}\`; };`; - const definitionJS = `\nfunction blockSVG${blockCounter} (context, tags, suffix) { - return svg\`${input}\`; - };`; return { usage: `\${blockSVG${blockCounter}.call(this, context, tags, suffix)}`, - definition: process.env.UI5_TS ? definitionTS : definitionJS, + definition: definitionTS, }; } diff --git a/packages/tools/lib/hbs2ui5/RenderTemplates/LitRenderer.js b/packages/tools/lib/hbs2ui5/RenderTemplates/LitRenderer.js index 8cfc97e79cab..77bcd62478e5 100644 --- a/packages/tools/lib/hbs2ui5/RenderTemplates/LitRenderer.js +++ b/packages/tools/lib/hbs2ui5/RenderTemplates/LitRenderer.js @@ -1,8 +1,4 @@ const tsImports = (controlName, hasTypes) => { - if (!process.env.UI5_TS) { - return ""; - } - const importPrefix = process.env.UI5_BASE ? "../../../" : "@ui5/webcomponents-base/dist/" return `import type UI5Element from "${importPrefix}UI5Element.js"; diff --git a/packages/tools/lib/hbs2ui5/index.js b/packages/tools/lib/hbs2ui5/index.js index da17a5a26018..7bb0a4b4d682 100644 --- a/packages/tools/lib/hbs2ui5/index.js +++ b/packages/tools/lib/hbs2ui5/index.js @@ -87,7 +87,7 @@ const writeRenderers = async (outputDir, controlName, fileContent) => { await fs.mkdir(outputDir, { recursive: true }); - const compiledFilePath = `${outputDir}${path.sep}${controlName}Template.lit.${process.env.UI5_TS ? "ts" : "js"}`; + const compiledFilePath = `${outputDir}${path.sep}${controlName}Template.lit.ts`; // strip DOS line endings because the break the source maps let fileContentUnix = fileContent.replace(/\r\n/g, "\n"); diff --git a/packages/tools/lib/i18n/defaults.js b/packages/tools/lib/i18n/defaults.js index 4daea2366bb7..0feca2d53a78 100644 --- a/packages/tools/lib/i18n/defaults.js +++ b/packages/tools/lib/i18n/defaults.js @@ -8,9 +8,8 @@ const generate = async () => { const messageBundle = path.normalize(`${process.argv[2]}/messagebundle.properties`); const messageBundleDefaultLanguage = path.normalize(`${process.argv[2]}/messagebundle_${defaultLanguage}.properties`); - const tsMode = process.env.UI5_TS === "true"; // In Typescript mode, we output .ts files and set the required types, otherwise - output pure .js files - const outputFile = path.normalize(`${process.argv[3]}/i18n-defaults.${tsMode ? "ts": "js"}`); + const outputFile = path.normalize(`${process.argv[3]}/i18n-defaults.ts`); if (!messageBundle || !outputFile) { return; @@ -31,7 +30,7 @@ const generate = async () => { // (2) as the messagebundle.properties file is always written in English, // it makes sense to consider the messagebundle.properties content only when the default language is "en". if (defaultLanguage === "en") { - defaultLanguageProperties = Object.assign({}, defaultLanguageProperties, properties); + defaultLanguageProperties = Object.assign({}, defaultLanguageProperties, properties); } /* @@ -47,10 +46,7 @@ const generate = async () => { let effectiveValue = defaultLanguageValue || value; effectiveValue = effectiveValue.replace(/\"/g, "\\\""); // escape double quotes in translations - if (tsMode) { - return `const ${key}: I18nText = {key: "${key}", defaultText: "${effectiveValue}"};`; - } - return `const ${key} = {key: "${key}", defaultText: "${effectiveValue}"};`; + return `const ${key}: I18nText = {key: "${key}", defaultText: "${effectiveValue}"};`; }; /* @@ -68,7 +64,7 @@ const generate = async () => { const texts = textKeys.map(prop => getTextInfo(prop, properties[prop], defaultLanguageProperties && defaultLanguageProperties[prop])).join(''); // tabs are intentionally mixed to have proper identation in the produced file - return `${tsMode ? `import { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js";` : ""} + return `import { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js"; ${texts} export {${textKeys.join()}};`; }; From 8f6a40fb2bf4233800f8b39d37e219344246df4a Mon Sep 17 00:00:00 2001 From: Boyan Rakilovski Date: Wed, 27 Mar 2024 15:12:55 +0200 Subject: [PATCH 29/60] refactor(ui5-color-palette): remove deprecated APIs (#8542) Removes the `openPopover` and `showAt` methods from the `ui5-color-palette-popover`. BREAKING CHANGE: The `openPopover` and `showAt` methods are removed in favor of `open` and `opener` properties. If you previously used the imperative API: ```js button.addEventListener("click", function(event) { colorPalettePopover.showAt(this); }); ``` Now the declarative API should be used instead: ```html Open ``` ```js button.addEventListener("click", function(event) { colorPalettePopover.open = !colorPalettePopover.open; }); ``` Related to: #8461 --- packages/main/src/ColorPalettePopover.ts | 25 ------------------ .../main/test/pages/ColorPalettePopover.html | 26 +++++++++---------- .../samples/ColorPalettePopover.sample.html | 20 +++++++------- .../ColorPalettePopover.stories.ts | 11 +++++--- .../main/ColorPalettePopover/Basic/main.js | 4 +-- .../ColorPalettePopover/Basic/sample.html | 2 +- .../ColorPalettePopover/DefaultColor/main.js | 4 +-- .../DefaultColor/sample.html | 1 + .../ColorPalettePopover/MoreColors/main.js | 4 +-- .../MoreColors/sample.html | 1 + 10 files changed, 39 insertions(+), 59 deletions(-) diff --git a/packages/main/src/ColorPalettePopover.ts b/packages/main/src/ColorPalettePopover.ts index 7f544212e1f8..7e32a63c5c0e 100644 --- a/packages/main/src/ColorPalettePopover.ts +++ b/packages/main/src/ColorPalettePopover.ts @@ -166,31 +166,6 @@ class ColorPalettePopover extends UI5Element { return this.shadowRoot!.querySelector ("[ui5-responsive-popover]")!; } - /** - * Shows the ColorPalettePopover. - * @param opener the element that the popover is shown at - * @public - * @deprecated The method is deprecated in favour of `open` and `opener` properties. - * @since 1.1.1 - */ - showAt(opener: HTMLElement): void { - console.warn("The method 'showAt' is deprecated and will be removed in future, use 'open' and 'opener' props instead."); // eslint-disable-line - this.open = true; - this.opener = opener; - } - - /** - * Shows the ColorPalettePopover. - * @param opener the element that the popover is shown at - * @public - * @since 1.0.0-rc.16 - * @deprecated The method is deprecated in favour of `open` and `opener` properties. - */ - openPopover(opener: HTMLElement): void { - console.warn("The method 'openPopover' is deprecated and will be removed in future, use 'open' and 'opener' props instead."); // eslint-disable-line - this.showAt(opener); - } - closePopover() { this.open = false; } diff --git a/packages/main/test/pages/ColorPalettePopover.html b/packages/main/test/pages/ColorPalettePopover.html index f93e5cc63b47..f1b798852e3f 100644 --- a/packages/main/test/pages/ColorPalettePopover.html +++ b/packages/main/test/pages/ColorPalettePopover.html @@ -14,7 +14,7 @@ Test case 1 - Default Color Button to be focused Open -+ @@ -31,7 +31,7 @@ Test case 2 - Default Color works Open -+ @@ -48,7 +48,7 @@ Test case 3 - Arrow Down to select displayed color Open -+ @@ -66,7 +66,7 @@ Test case 4 - Arrow Up focuses MoreColors button Open -+ @@ -83,7 +83,7 @@ Test case 5 - Tests navigation with recent colors Open -+ @@ -102,7 +102,7 @@ Open Press -+ @@ -170,7 +170,7 @@ show-recent-colors, show-more-colors and show-default-color Open -+ @@ -205,27 +205,27 @@ // Tests - default color btn should be on focus after open colorPaletteBtnTest.addEventListener("click", function(event) { - colorPalettePopoverTest.showAt(this); + colorPalettePopoverTest.open = !colorPalettePopoverTest.open; }); colorPaletteBtnTest2.addEventListener("click", function(event) { - colorPalettePopoverTest2.showAt(this) + colorPalettePopoverTest2.open = !colorPalettePopoverTest2.open; }); colorPaletteBtnTest3.addEventListener("click", function(event) { - colorPalettePopoverTest3.showAt(this); + colorPalettePopoverTest3.open = !colorPalettePopoverTest3.open; }); colorPaletteBtnTest4.addEventListener("click", function(event) { - colorPalettePopoverTest4.showAt(this); + colorPalettePopoverTest4.open = !colorPalettePopoverTest4.open; }); colorPaletteBtnTest5.addEventListener("click", function(event) { - colorPalettePopoverTest5.showAt(this); + colorPalettePopoverTest5.open = !colorPalettePopoverTest5.open; }); colorPaletteBtnTest6.addEventListener("click", function(event) { - colorPalettePopoverTest6.showAt(this); + colorPalettePopoverTest6.open = !colorPalettePopoverTest6.open; }); let openChangeCounter = 0; diff --git a/packages/main/test/samples/ColorPalettePopover.sample.html b/packages/main/test/samples/ColorPalettePopover.sample.html index 61e4dfa75bb0..9ed22a8d0f23 100644 --- a/packages/main/test/samples/ColorPalettePopover.sample.html +++ b/packages/main/test/samples/ColorPalettePopover.sample.html @@ -10,7 +10,7 @@ ColorPalettePopover
Color Palette Popover with recent colors, default color and more colors features
Open ColorPalettePopover -+ @@ -26,13 +26,13 @@ Color Palette Popover with recent colors, default color and more colors feat
@@ -58,7 +58,7 @@Open ColorPalettePopover -+ @@ -48,7 +48,7 @@ Color Palette Popover with recent colors, default color and more colors feat
Color Palette Popover with recent colors, default color and more colors feat
Color Palette Popover without any additional features
Open ColorPalettePopover -+ @@ -74,13 +74,13 @@ Color Palette Popover without any additional features
diff --git a/packages/playground/_stories/main/ColorPalettePopover/ColorPalettePopover.stories.ts b/packages/playground/_stories/main/ColorPalettePopover/ColorPalettePopover.stories.ts index 7e4638f61996..26a35415a3ab 100644 --- a/packages/playground/_stories/main/ColorPalettePopover/ColorPalettePopover.stories.ts +++ b/packages/playground/_stories/main/ColorPalettePopover/ColorPalettePopover.stories.ts @@ -16,6 +16,7 @@ export default { const Template: UI5StoryArgsOpen ColorPalettePopover -+ @@ -96,7 +96,7 @@ Color Palette Popover without any additional features
= (args) => html` = (args) => ht export const Basic = Template.bind({}); Basic.args = { id: "colorPalettePopover", + opener: "colorPaletteBtn", default: ` @@ -42,8 +44,8 @@ Basic.decorators = [ (story) => html` Open ColorPalettePopover ${story()} `, ]; @@ -60,6 +62,7 @@ export const DefaultColor = Template.bind({}); DefaultColor.storyName = "Default, Recent, and More Colors"; DefaultColor.args = { id: "colorPalettePopover", + opener: "colorPaletteBtn", defaultColor: "orange", showDefaultColor: true, showRecentColors: true, @@ -84,8 +87,8 @@ DefaultColor.decorators = [ (story) => html`Open ColorPalettePopover ${story()} `, ]; diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/Basic/main.js b/packages/website/docs/_samples/main/ColorPalettePopover/Basic/main.js index dcd3eaaa1bfd..96604d69cb55 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/Basic/main.js +++ b/packages/website/docs/_samples/main/ColorPalettePopover/Basic/main.js @@ -2,6 +2,6 @@ import "@ui5/webcomponents/dist/ColorPalettePopover.js"; import "@ui5/webcomponents/dist/ColorPaletteItem.js"; import "@ui5/webcomponents/dist/Button.js"; -colorPaletteBtn.addEventListener("click", function () { - colorPalettePopover.showAt(this); +colorPaletteBtn.addEventListener("click", () => { + colorPalettePopover.open = !colorPalettePopover.open; }); \ No newline at end of file diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/Basic/sample.html b/packages/website/docs/_samples/main/ColorPalettePopover/Basic/sample.html index f730f60f9204..f833a6583642 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/Basic/sample.html +++ b/packages/website/docs/_samples/main/ColorPalettePopover/Basic/sample.html @@ -13,7 +13,7 @@Open ColorPalettePopover -+ diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/main.js b/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/main.js index 662cb6bb9d08..c5604acbb5ff 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/main.js +++ b/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/main.js @@ -4,6 +4,6 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/features/ColorPaletteMoreColors.js" -colorPaletteBtn.addEventListener("click", function () { - colorPalettePopover.showAt(this); +colorPaletteBtn.addEventListener("click", () => { + colorPalettePopover.open = !colorPalettePopover.open; }); \ No newline at end of file diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/sample.html b/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/sample.html index 72d2bd162e96..31a6dd42d0c6 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/sample.html +++ b/packages/website/docs/_samples/main/ColorPalettePopover/DefaultColor/sample.html @@ -14,6 +14,7 @@ Open ColorPalettePopover diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/main.js b/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/main.js index 6d00b43a36cc..bf7ebd10b311 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/main.js +++ b/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/main.js @@ -5,6 +5,6 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/features/ColorPaletteMoreColors.js" -colorPaletteBtn.addEventListener("click", function () { - colorPalettePopover.showAt(this); +colorPaletteBtn.addEventListener("click", () => { + colorPalettePopover.open = !colorPalettePopover.open; }); \ No newline at end of file diff --git a/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/sample.html b/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/sample.html index e133699a86b3..86a129a25809 100644 --- a/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/sample.html +++ b/packages/website/docs/_samples/main/ColorPalettePopover/MoreColors/sample.html @@ -14,6 +14,7 @@ Open ColorPalettePopover Date: Wed, 27 Mar 2024 15:45:38 +0200 Subject: [PATCH 30/60] refactor(ui5-bar): move to `main` (#8548) Change the library of the `ui5-bar `component from `fiori` to `main`. BREAKING CHANGE: The `ui5-bar` component is now in `main` library. If you previously imported the `ui5-bar` from `fiori`: ```ts import "@ui5/webcomponents-fiori/dist/Bar.js; ``` Now, import the `ui5-bar` from `main`: ```ts import "@ui5/webcomponents/dist/Bar.js"; ``` Related to: https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/fiori/README.md | 1 - packages/fiori/src/bundle.esm.ts | 1 - packages/fiori/src/themes/base/sizes-parameters.css | 6 ------ packages/fiori/src/themes/sap_belize/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_belize_hcb/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_belize_hcw/parameters-bundle.css | 2 -- packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css | 2 -- packages/fiori/src/themes/sap_horizon/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_horizon_dark/parameters-bundle.css | 2 -- .../src/themes/sap_horizon_dark_exp/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_horizon_exp/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_horizon_hcb/parameters-bundle.css | 2 -- .../src/themes/sap_horizon_hcb_exp/parameters-bundle.css | 2 -- .../fiori/src/themes/sap_horizon_hcw/parameters-bundle.css | 2 -- .../src/themes/sap_horizon_hcw_exp/parameters-bundle.css | 2 -- packages/fiori/test/ssr/component-imports.js | 1 - packages/main/README.md | 1 + packages/{fiori => main}/src/Bar.hbs | 0 packages/{fiori => main}/src/Bar.ts | 2 +- packages/main/src/bundle.esm.ts | 1 + packages/{fiori => main}/src/themes/Bar.css | 0 packages/{fiori => main}/src/themes/base/Bar-parameters.css | 0 packages/main/src/themes/base/sizes-parameters.css | 3 +++ packages/main/src/themes/sap_belize/parameters-bundle.css | 1 + .../main/src/themes/sap_belize_hcb/parameters-bundle.css | 1 + .../main/src/themes/sap_belize_hcw/parameters-bundle.css | 1 + packages/main/src/themes/sap_fiori_3/parameters-bundle.css | 1 + .../main/src/themes/sap_fiori_3_dark/parameters-bundle.css | 1 + .../src/themes/sap_fiori_3_hcb/Bar-parameters.css | 0 .../main/src/themes/sap_fiori_3_hcb/parameters-bundle.css | 1 + .../src/themes/sap_fiori_3_hcw/Bar-parameters.css | 0 packages/main/src/themes/sap_horizon/parameters-bundle.css | 1 + .../main/src/themes/sap_horizon_dark/parameters-bundle.css | 1 + .../src/themes/sap_horizon_hcb/Bar-parameters.css | 0 .../main/src/themes/sap_horizon_hcb/parameters-bundle.css | 1 + .../src/themes/sap_horizon_hcw/Bar-parameters.css | 0 .../main/src/themes/sap_horizon_hcw/parameters-bundle.css | 1 + packages/{fiori => main}/src/types/BarDesign.ts | 0 packages/{fiori => main}/test/pages/Bar.html | 0 packages/{fiori => main}/test/pages/styles/Bar.css | 0 packages/{fiori => main}/test/samples/Bar.sample.html | 0 packages/main/test/ssr/component-imports.js | 1 + .../playground/_stories/{fiori => main}/Bar/Bar.stories.ts | 6 +++--- .../website/docs/_components_pages/{fiori => main}/Bar.mdx | 2 +- .../docs/_samples/{fiori => main}/Bar/Basic/Basic.md | 0 .../website/docs/_samples/{fiori => main}/Bar/Basic/main.js | 2 +- .../docs/_samples/{fiori => main}/Bar/Basic/sample.html | 0 50 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 packages/fiori/src/themes/base/sizes-parameters.css rename packages/{fiori => main}/src/Bar.hbs (100%) rename packages/{fiori => main}/src/Bar.ts (98%) rename packages/{fiori => main}/src/themes/Bar.css (100%) rename packages/{fiori => main}/src/themes/base/Bar-parameters.css (100%) rename packages/{fiori => main}/src/themes/sap_fiori_3_hcb/Bar-parameters.css (100%) rename packages/{fiori => main}/src/themes/sap_fiori_3_hcw/Bar-parameters.css (100%) rename packages/{fiori => main}/src/themes/sap_horizon_hcb/Bar-parameters.css (100%) rename packages/{fiori => main}/src/themes/sap_horizon_hcw/Bar-parameters.css (100%) rename packages/{fiori => main}/src/types/BarDesign.ts (100%) rename packages/{fiori => main}/test/pages/Bar.html (100%) rename packages/{fiori => main}/test/pages/styles/Bar.css (100%) rename packages/{fiori => main}/test/samples/Bar.sample.html (100%) rename packages/playground/_stories/{fiori => main}/Bar/Bar.stories.ts (86%) rename packages/website/docs/_components_pages/{fiori => main}/Bar.mdx (54%) rename packages/website/docs/_samples/{fiori => main}/Bar/Basic/Basic.md (100%) rename packages/website/docs/_samples/{fiori => main}/Bar/Basic/main.js (80%) rename packages/website/docs/_samples/{fiori => main}/Bar/Basic/sample.html (100%) diff --git a/packages/fiori/README.md b/packages/fiori/README.md index 7c047509c673..3872f6357a31 100644 --- a/packages/fiori/README.md +++ b/packages/fiori/README.md @@ -12,7 +12,6 @@ such as a common header (ShellBar). | Web Component | Tag name | Module import | |-------------------------------------------|--------------------------------|-----------------------------------------------------------------------| -| Bar | `ui5-bar` | `import "@ui5/webcomponents-fiori/dist/Bar.js";` | | Barcode Scanner Dialog | `ui5-barcode-scanner-dialog` | `import "@ui5/webcomponents-fiori/dist/BarcodeScannerDialog.js";` | | Dynamic Side Content | `ui5-dynamic-side-content` | `import "@ui5/webcomponents-fiori/dist/DynamicSideContent.js";` | | Flexible Column Layout | `ui5-flexible-column-layout` | `import "@ui5/webcomponents-fiori/dist/FlexibleColumnLayout.js";` | diff --git a/packages/fiori/src/bundle.esm.ts b/packages/fiori/src/bundle.esm.ts index d6cb5b6d4076..ee11684742f0 100644 --- a/packages/fiori/src/bundle.esm.ts +++ b/packages/fiori/src/bundle.esm.ts @@ -12,7 +12,6 @@ import "./features/CoPilotAnimation.js"; import "./illustrations/AllIllustrations.js"; // FIORI components -import Bar from "./Bar.js"; import BarcodeScannerDialog from "./BarcodeScannerDialog.js"; import DynamicSideContent from "./DynamicSideContent.js"; import FilterItem from "./FilterItem.js"; diff --git a/packages/fiori/src/themes/base/sizes-parameters.css b/packages/fiori/src/themes/base/sizes-parameters.css deleted file mode 100644 index f23c9f21a27c..000000000000 --- a/packages/fiori/src/themes/base/sizes-parameters.css +++ /dev/null @@ -1,6 +0,0 @@ -[data-ui5-compact-size], -.ui5-content-density-compact, -.sapUiSizeCompact { - --_ui5_bar_base_height: 2.5rem; - --_ui5_bar_subheader_height: 2.25rem; -} diff --git a/packages/fiori/src/themes/sap_belize/parameters-bundle.css b/packages/fiori/src/themes/sap_belize/parameters-bundle.css index d7ddadee3a99..c8db188af13e 100644 --- a/packages/fiori/src/themes/sap_belize/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_belize/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/MediaGallery-parameters.css"; @import "../base/MediaGalleryItem-parameters.css"; diff --git a/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css b/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css index 30004e7942cb..474d3e76b656 100644 --- a/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_belize_hcb/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css b/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css index 30004e7942cb..474d3e76b656 100644 --- a/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_belize_hcw/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css index 0ab99d77ccc5..136e065dfc44 100644 --- a/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_fiori_3/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css index 0ab99d77ccc5..136e065dfc44 100644 --- a/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_fiori_3_dark/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css index e2ee04a154ec..474d3e76b656 100644 --- a/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_fiori_3_hcb/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "./Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css b/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css index e2ee04a154ec..474d3e76b656 100644 --- a/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_fiori_3_hcw/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "./Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon/parameters-bundle.css index b9966910d906..6f02d69923a9 100644 --- a/packages/fiori/src/themes/sap_horizon/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_dark/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_dark/parameters-bundle.css index b9966910d906..6f02d69923a9 100644 --- a/packages/fiori/src/themes/sap_horizon_dark/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_dark/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_dark_exp/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_dark_exp/parameters-bundle.css index 17242073e914..e8ceaabfdb3e 100644 --- a/packages/fiori/src/themes/sap_horizon_dark_exp/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_dark_exp/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_exp/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_exp/parameters-bundle.css index 17242073e914..e8ceaabfdb3e 100644 --- a/packages/fiori/src/themes/sap_horizon_exp/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_exp/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "../base/FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "../base/MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcb/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_hcb/parameters-bundle.css index 884a94cf56ed..5c8f789a7ba1 100644 --- a/packages/fiori/src/themes/sap_horizon_hcb/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_hcb/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "./Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcb_exp/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_hcb_exp/parameters-bundle.css index 546625c59346..5c8f789a7ba1 100644 --- a/packages/fiori/src/themes/sap_horizon_hcb_exp/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_hcb_exp/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcw/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_hcw/parameters-bundle.css index 03b4a8cd7368..6ff9fe9f299d 100644 --- a/packages/fiori/src/themes/sap_horizon_hcw/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_hcw/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "./Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcw_exp/parameters-bundle.css b/packages/fiori/src/themes/sap_horizon_hcw_exp/parameters-bundle.css index 47d7c10d4bc8..6ff9fe9f299d 100644 --- a/packages/fiori/src/themes/sap_horizon_hcw_exp/parameters-bundle.css +++ b/packages/fiori/src/themes/sap_horizon_hcw_exp/parameters-bundle.css @@ -1,5 +1,3 @@ -@import "../base/sizes-parameters.css"; -@import "../base/Bar-parameters.css"; @import "./FlexibleColumnLayout-parameters.css"; @import "../base/IllustratedMessage-parameters.css"; @import "./MediaGallery-parameters.css"; diff --git a/packages/fiori/test/ssr/component-imports.js b/packages/fiori/test/ssr/component-imports.js index 6096e31c57b0..5e8cece9436c 100644 --- a/packages/fiori/test/ssr/component-imports.js +++ b/packages/fiori/test/ssr/component-imports.js @@ -1,4 +1,3 @@ -import Bar from "../../dist/Bar.js"; // zxing is using window // import BarcodeScannerDialog from "../../dist/BarcodeScannerDialog.js"; import DynamicSideContent from "../../dist/DynamicSideContent.js"; diff --git a/packages/main/README.md b/packages/main/README.md index 2e79efea7f49..a9264a37aee4 100644 --- a/packages/main/README.md +++ b/packages/main/README.md @@ -14,6 +14,7 @@ Provides general purpose UI building blocks such as buttons, labels, inputs and | Avatar | `ui5-avatar` | `import "@ui5/webcomponents/dist/Avatar.js";` | | Avatar Group | `ui5-avatar-group` | `import "@ui5/webcomponents/dist/AvatarGroup.js";` | | Badge | `ui5-badge` | `import "@ui5/webcomponents/dist/Badge.js";` | +| Bar | `ui5-bar` | `import "@ui5/webcomponents/dist/Bar.js";` | | Breadcrumbs | `ui5-breadcrumbs` | `import "@ui5/webcomponents/dist/Breadcrumbs.js";` | | Breadcrumbs Item | `ui5-breadcrumbs-item` | comes with `ui5-breadcrumbs` | | Badge | `ui5-badge` | `import "@ui5/webcomponents/dist/Badge.js";` | diff --git a/packages/fiori/src/Bar.hbs b/packages/main/src/Bar.hbs similarity index 100% rename from packages/fiori/src/Bar.hbs rename to packages/main/src/Bar.hbs diff --git a/packages/fiori/src/Bar.ts b/packages/main/src/Bar.ts similarity index 98% rename from packages/fiori/src/Bar.ts rename to packages/main/src/Bar.ts index cb25f48e10e7..0036daabd125 100644 --- a/packages/fiori/src/Bar.ts +++ b/packages/main/src/Bar.ts @@ -39,7 +39,7 @@ import BarCss from "./generated/themes/Bar.css.js"; * * ### ES6 Module Import * - * `import "@ui5/webcomponents-fiori/dist/Bar.js";` + * `import "@ui5/webcomponents/dist/Bar.js";` * @csspart bar - Used to style the wrapper of the content of the component * @constructor * @extends UI5Element diff --git a/packages/main/src/bundle.esm.ts b/packages/main/src/bundle.esm.ts index ea319d2dbf05..8f3836399b61 100644 --- a/packages/main/src/bundle.esm.ts +++ b/packages/main/src/bundle.esm.ts @@ -99,6 +99,7 @@ import * as defaultTexts from "./generated/i18n/i18n-defaults.js"; import Avatar from "./Avatar.js"; import AvatarGroup from "./AvatarGroup.js"; import Badge from "./Badge.js"; +import Bar from "./Bar.js"; import Breadcrumbs from "./Breadcrumbs.js"; import BusyIndicator from "./BusyIndicator.js"; import Button from "./Button.js"; diff --git a/packages/fiori/src/themes/Bar.css b/packages/main/src/themes/Bar.css similarity index 100% rename from packages/fiori/src/themes/Bar.css rename to packages/main/src/themes/Bar.css diff --git a/packages/fiori/src/themes/base/Bar-parameters.css b/packages/main/src/themes/base/Bar-parameters.css similarity index 100% rename from packages/fiori/src/themes/base/Bar-parameters.css rename to packages/main/src/themes/base/Bar-parameters.css diff --git a/packages/main/src/themes/base/sizes-parameters.css b/packages/main/src/themes/base/sizes-parameters.css index 15f9c9286d83..79984b42f0a6 100644 --- a/packages/main/src/themes/base/sizes-parameters.css +++ b/packages/main/src/themes/base/sizes-parameters.css @@ -153,6 +153,9 @@ [data-ui5-compact-size], .ui5-content-density-compact, .sapUiSizeCompact { + --_ui5_bar_base_height: 2.5rem; + --_ui5_bar_subheader_height: 2.25rem; + --_ui5_button_base_height: var(--sapElement_Compact_Height); --_ui5_button_base_padding: 0.4375rem; --_ui5_button_base_min_width: 2rem; diff --git a/packages/main/src/themes/sap_belize/parameters-bundle.css b/packages/main/src/themes/sap_belize/parameters-bundle.css index d3cb2d95c09f..7191125c99a7 100644 --- a/packages/main/src/themes/sap_belize/parameters-bundle.css +++ b/packages/main/src/themes/sap_belize/parameters-bundle.css @@ -1,6 +1,7 @@ @import "../base/Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "../base/Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "./BrowserScrollbar-parameters.css"; @import "./BusyIndicator-parameters.css"; @import "../base/CalendarLegend-parameters.css"; diff --git a/packages/main/src/themes/sap_belize_hcb/parameters-bundle.css b/packages/main/src/themes/sap_belize_hcb/parameters-bundle.css index 2b53e19db5b2..59624f688ef6 100644 --- a/packages/main/src/themes/sap_belize_hcb/parameters-bundle.css +++ b/packages/main/src/themes/sap_belize_hcb/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "./BrowserScrollbar-parameters.css"; @import "../base/BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/main/src/themes/sap_belize_hcw/parameters-bundle.css b/packages/main/src/themes/sap_belize_hcw/parameters-bundle.css index 901e372af10c..faee98322c2e 100644 --- a/packages/main/src/themes/sap_belize_hcw/parameters-bundle.css +++ b/packages/main/src/themes/sap_belize_hcw/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "./BrowserScrollbar-parameters.css"; @import "../base/BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/main/src/themes/sap_fiori_3/parameters-bundle.css b/packages/main/src/themes/sap_fiori_3/parameters-bundle.css index a1169eb56892..e923170baafc 100644 --- a/packages/main/src/themes/sap_fiori_3/parameters-bundle.css +++ b/packages/main/src/themes/sap_fiori_3/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "../base/Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "../base/BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/main/src/themes/sap_fiori_3_dark/parameters-bundle.css b/packages/main/src/themes/sap_fiori_3_dark/parameters-bundle.css index dc2dceac8209..546116c0da1a 100644 --- a/packages/main/src/themes/sap_fiori_3_dark/parameters-bundle.css +++ b/packages/main/src/themes/sap_fiori_3_dark/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "../base/BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3_hcb/Bar-parameters.css b/packages/main/src/themes/sap_fiori_3_hcb/Bar-parameters.css similarity index 100% rename from packages/fiori/src/themes/sap_fiori_3_hcb/Bar-parameters.css rename to packages/main/src/themes/sap_fiori_3_hcb/Bar-parameters.css diff --git a/packages/main/src/themes/sap_fiori_3_hcb/parameters-bundle.css b/packages/main/src/themes/sap_fiori_3_hcb/parameters-bundle.css index 8717ecd9f146..5e8733cfdd3a 100644 --- a/packages/main/src/themes/sap_fiori_3_hcb/parameters-bundle.css +++ b/packages/main/src/themes/sap_fiori_3_hcb/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "./Bar-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "../base/BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/fiori/src/themes/sap_fiori_3_hcw/Bar-parameters.css b/packages/main/src/themes/sap_fiori_3_hcw/Bar-parameters.css similarity index 100% rename from packages/fiori/src/themes/sap_fiori_3_hcw/Bar-parameters.css rename to packages/main/src/themes/sap_fiori_3_hcw/Bar-parameters.css diff --git a/packages/main/src/themes/sap_horizon/parameters-bundle.css b/packages/main/src/themes/sap_horizon/parameters-bundle.css index 09b28cbf2f1a..51a870edc6c7 100644 --- a/packages/main/src/themes/sap_horizon/parameters-bundle.css +++ b/packages/main/src/themes/sap_horizon/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "./AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "./Breadcrumbs-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "./BusyIndicator-parameters.css"; diff --git a/packages/main/src/themes/sap_horizon_dark/parameters-bundle.css b/packages/main/src/themes/sap_horizon_dark/parameters-bundle.css index fbe2a41bda90..8aa4a04755ac 100644 --- a/packages/main/src/themes/sap_horizon_dark/parameters-bundle.css +++ b/packages/main/src/themes/sap_horizon_dark/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../sap_horizon/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "./Breadcrumbs-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "./BusyIndicator-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcb/Bar-parameters.css b/packages/main/src/themes/sap_horizon_hcb/Bar-parameters.css similarity index 100% rename from packages/fiori/src/themes/sap_horizon_hcb/Bar-parameters.css rename to packages/main/src/themes/sap_horizon_hcb/Bar-parameters.css diff --git a/packages/main/src/themes/sap_horizon_hcb/parameters-bundle.css b/packages/main/src/themes/sap_horizon_hcb/parameters-bundle.css index 91d8b49a358d..5cd546bfc639 100644 --- a/packages/main/src/themes/sap_horizon_hcb/parameters-bundle.css +++ b/packages/main/src/themes/sap_horizon_hcb/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "./Bar-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "./BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/fiori/src/themes/sap_horizon_hcw/Bar-parameters.css b/packages/main/src/themes/sap_horizon_hcw/Bar-parameters.css similarity index 100% rename from packages/fiori/src/themes/sap_horizon_hcw/Bar-parameters.css rename to packages/main/src/themes/sap_horizon_hcw/Bar-parameters.css diff --git a/packages/main/src/themes/sap_horizon_hcw/parameters-bundle.css b/packages/main/src/themes/sap_horizon_hcw/parameters-bundle.css index 333596598abf..32685a0c2bcc 100644 --- a/packages/main/src/themes/sap_horizon_hcw/parameters-bundle.css +++ b/packages/main/src/themes/sap_horizon_hcw/parameters-bundle.css @@ -1,6 +1,7 @@ @import "./Avatar-parameters.css"; @import "../base/AvatarGroup-parameters.css"; @import "./Badge-parameters.css"; +@import "../base/Bar-parameters.css"; @import "../base/BrowserScrollbar-parameters.css"; @import "./BusyIndicator-parameters.css"; @import "./Button-parameters.css"; diff --git a/packages/fiori/src/types/BarDesign.ts b/packages/main/src/types/BarDesign.ts similarity index 100% rename from packages/fiori/src/types/BarDesign.ts rename to packages/main/src/types/BarDesign.ts diff --git a/packages/fiori/test/pages/Bar.html b/packages/main/test/pages/Bar.html similarity index 100% rename from packages/fiori/test/pages/Bar.html rename to packages/main/test/pages/Bar.html diff --git a/packages/fiori/test/pages/styles/Bar.css b/packages/main/test/pages/styles/Bar.css similarity index 100% rename from packages/fiori/test/pages/styles/Bar.css rename to packages/main/test/pages/styles/Bar.css diff --git a/packages/fiori/test/samples/Bar.sample.html b/packages/main/test/samples/Bar.sample.html similarity index 100% rename from packages/fiori/test/samples/Bar.sample.html rename to packages/main/test/samples/Bar.sample.html diff --git a/packages/main/test/ssr/component-imports.js b/packages/main/test/ssr/component-imports.js index 2d8412017afd..b624641070b1 100644 --- a/packages/main/test/ssr/component-imports.js +++ b/packages/main/test/ssr/component-imports.js @@ -1,6 +1,7 @@ import Avatar from "../../dist/Avatar.js"; import AvatarGroup from "../../dist/AvatarGroup.js"; import Badge from "../../dist/Badge.js"; +import Bar from "../../dist/Bar.js"; import Breadcrumbs from "../../dist/Breadcrumbs.js"; import BusyIndicator from "../../dist/BusyIndicator.js"; import Button from "../../dist/Button.js"; diff --git a/packages/playground/_stories/fiori/Bar/Bar.stories.ts b/packages/playground/_stories/main/Bar/Bar.stories.ts similarity index 86% rename from packages/playground/_stories/fiori/Bar/Bar.stories.ts rename to packages/playground/_stories/main/Bar/Bar.stories.ts index d91781ca999b..f36a85b019e8 100644 --- a/packages/playground/_stories/fiori/Bar/Bar.stories.ts +++ b/packages/playground/_stories/main/Bar/Bar.stories.ts @@ -6,11 +6,11 @@ import type { Meta, StoryFn } from "@storybook/web-components"; import argTypes from "./argTypes.js"; import type { StoryArgsSlots } from "./argTypes.js"; import type { UI5StoryArgs } from "../../../types.js"; -import type Bar from "@ui5/webcomponents-fiori/dist/Bar.js"; -import BarDesign from "@ui5/webcomponents-fiori/dist/types/BarDesign.js"; +import type Bar from "@ui5/webcomponents/dist/Bar.js"; +import BarDesign from "@ui5/webcomponents/dist/types/BarDesign.js"; export default { - title: "Fiori/Bar", + title: "Main/Bar", component: "Bar", argTypes, } as Meta ; diff --git a/packages/website/docs/_components_pages/fiori/Bar.mdx b/packages/website/docs/_components_pages/main/Bar.mdx similarity index 54% rename from packages/website/docs/_components_pages/fiori/Bar.mdx rename to packages/website/docs/_components_pages/main/Bar.mdx index c90d7c34601a..58c386c52075 100644 --- a/packages/website/docs/_components_pages/fiori/Bar.mdx +++ b/packages/website/docs/_components_pages/main/Bar.mdx @@ -1,4 +1,4 @@ -import Basic from "../../_samples/fiori/Bar/Basic/Basic.md"; +import Basic from "../../_samples/main/Bar/Basic/Basic.md"; <%COMPONENT_OVERVIEW%> diff --git a/packages/website/docs/_samples/fiori/Bar/Basic/Basic.md b/packages/website/docs/_samples/main/Bar/Basic/Basic.md similarity index 100% rename from packages/website/docs/_samples/fiori/Bar/Basic/Basic.md rename to packages/website/docs/_samples/main/Bar/Basic/Basic.md diff --git a/packages/website/docs/_samples/fiori/Bar/Basic/main.js b/packages/website/docs/_samples/main/Bar/Basic/main.js similarity index 80% rename from packages/website/docs/_samples/fiori/Bar/Basic/main.js rename to packages/website/docs/_samples/main/Bar/Basic/main.js index 8b7615726aba..f72934fcf486 100644 --- a/packages/website/docs/_samples/fiori/Bar/Basic/main.js +++ b/packages/website/docs/_samples/main/Bar/Basic/main.js @@ -1,5 +1,5 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/Label.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-icons/dist/home.js" import "@ui5/webcomponents-icons/dist/action-settings.js" diff --git a/packages/website/docs/_samples/fiori/Bar/Basic/sample.html b/packages/website/docs/_samples/main/Bar/Basic/sample.html similarity index 100% rename from packages/website/docs/_samples/fiori/Bar/Basic/sample.html rename to packages/website/docs/_samples/main/Bar/Basic/sample.html From 94bc1ffeebaba2985a24460ad26727d66e2e6199 Mon Sep 17 00:00:00 2001 From: Tsanislav Gatev Date: Wed, 27 Mar 2024 17:46:29 +0200 Subject: [PATCH 31/60] chore(ui5-bar): fix import in samples (#8555) --- .../docs/_samples/fiori/IllustratedMessage/WithDialog/main.js | 2 +- .../docs/_samples/fiori/MediaGallery/Interactive/main.js | 2 +- packages/website/docs/_samples/fiori/Page/Basic/main.js | 2 +- .../website/docs/_samples/fiori/Page/FloatingFooter/main.js | 2 +- packages/website/docs/_samples/fiori/Wizard/PageMode/main.js | 2 +- packages/website/docs/_samples/main/Dialog/BarInDialog/main.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/website/docs/_samples/fiori/IllustratedMessage/WithDialog/main.js b/packages/website/docs/_samples/fiori/IllustratedMessage/WithDialog/main.js index a3bdb766d0d8..12f34179c1b9 100644 --- a/packages/website/docs/_samples/fiori/IllustratedMessage/WithDialog/main.js +++ b/packages/website/docs/_samples/fiori/IllustratedMessage/WithDialog/main.js @@ -1,7 +1,7 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/Dialog.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-fiori/dist/IllustratedMessage.js"; import "@ui5/webcomponents-fiori/dist/illustrations/UnableToLoad.js"; diff --git a/packages/website/docs/_samples/fiori/MediaGallery/Interactive/main.js b/packages/website/docs/_samples/fiori/MediaGallery/Interactive/main.js index f13eedb26dd8..e19ba29dfaa5 100644 --- a/packages/website/docs/_samples/fiori/MediaGallery/Interactive/main.js +++ b/packages/website/docs/_samples/fiori/MediaGallery/Interactive/main.js @@ -3,7 +3,7 @@ import "@ui5/webcomponents/dist/Dialog.js"; import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/Title.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-fiori/dist/MediaGallery.js"; import "@ui5/webcomponents-fiori/dist/MediaGalleryItem.js"; diff --git a/packages/website/docs/_samples/fiori/Page/Basic/main.js b/packages/website/docs/_samples/fiori/Page/Basic/main.js index f65413251219..77431d6cfd23 100644 --- a/packages/website/docs/_samples/fiori/Page/Basic/main.js +++ b/packages/website/docs/_samples/fiori/Page/Basic/main.js @@ -1,7 +1,7 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/Label.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-fiori/dist/Page.js"; import "@ui5/webcomponents-icons/dist/home.js"; diff --git a/packages/website/docs/_samples/fiori/Page/FloatingFooter/main.js b/packages/website/docs/_samples/fiori/Page/FloatingFooter/main.js index 15bf63ec6653..1fb338d40a68 100644 --- a/packages/website/docs/_samples/fiori/Page/FloatingFooter/main.js +++ b/packages/website/docs/_samples/fiori/Page/FloatingFooter/main.js @@ -1,7 +1,7 @@ import "@ui5/webcomponents/dist/Button.js"; import "@ui5/webcomponents/dist/Label.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-fiori/dist/Page.js"; import "@ui5/webcomponents-icons/dist/home.js"; \ No newline at end of file diff --git a/packages/website/docs/_samples/fiori/Wizard/PageMode/main.js b/packages/website/docs/_samples/fiori/Wizard/PageMode/main.js index ed384ea23857..bd8aa8a111f3 100644 --- a/packages/website/docs/_samples/fiori/Wizard/PageMode/main.js +++ b/packages/website/docs/_samples/fiori/Wizard/PageMode/main.js @@ -11,7 +11,7 @@ import "@ui5/webcomponents/dist/Dialog.js"; import "@ui5/webcomponents-fiori/dist/Wizard.js"; import "@ui5/webcomponents-fiori/dist/WizardStep.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-icons/dist/product.js"; import "@ui5/webcomponents-icons/dist/hint.js"; diff --git a/packages/website/docs/_samples/main/Dialog/BarInDialog/main.js b/packages/website/docs/_samples/main/Dialog/BarInDialog/main.js index 60542b630748..33b5ab0412e3 100644 --- a/packages/website/docs/_samples/main/Dialog/BarInDialog/main.js +++ b/packages/website/docs/_samples/main/Dialog/BarInDialog/main.js @@ -2,7 +2,7 @@ import "@ui5/webcomponents/dist/Dialog.js"; import "@ui5/webcomponents/dist/Title.js"; import "@ui5/webcomponents/dist/Button.js"; -import "@ui5/webcomponents-fiori/dist/Bar.js"; +import "@ui5/webcomponents/dist/Bar.js"; import "@ui5/webcomponents-icons/dist/decline.js"; var dialogOpener = document.getElementById("dialogOpener"); From 37cb9d3d474cd500b8578dc77eb48de6f083155f Mon Sep 17 00:00:00 2001 From: kskondov Date: Thu, 28 Mar 2024 17:09:21 +0200 Subject: [PATCH 32/60] refactor(ui5-tab): rename `subTabs` slot to `items` (#8559) Renames 'subTabs' slot of ui5-tab to 'items'. BREAKING CHANGE: If you have previously used: ```html ``` Now use: ```html ``` Relates to https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/main/src/Tab.ts | 14 ++-- packages/main/src/TabContainer.hbs | 2 +- packages/main/src/TabContainer.ts | 22 +++--- packages/main/src/TabSeparator.ts | 2 +- packages/main/test/pages/TabContainer.html | 74 +++++++++---------- .../test/pages/TabContainerDragAndDrop.html | 10 +-- .../test/samples/TabContainer.sample.html | 36 ++++----- .../main/TabContainer/Tab/Tab.stories.ts | 14 ++-- .../main/TabContainer/TabContainer.stories.ts | 18 ++--- .../main/TabContainer/NestedTabs/sample.html | 18 ++--- 10 files changed, 105 insertions(+), 105 deletions(-) diff --git a/packages/main/src/Tab.ts b/packages/main/src/Tab.ts index 7a82c0ebabc2..a0228dfb9e70 100644 --- a/packages/main/src/Tab.ts +++ b/packages/main/src/Tab.ts @@ -180,7 +180,7 @@ class Tab extends UI5Element implements ITab, ITabbable { slots: false, }, }) - subTabs!: Array + items!: Array isInline?: boolean; forcedMixedMode?: boolean; @@ -224,15 +224,15 @@ class Tab extends UI5Element implements ITab, ITabbable { } get requiresExpandButton() { - return this.subTabs.length > 0 && this.isTopLevelTab && this.hasOwnContent; + return this.items.length > 0 && this.isTopLevelTab && this.hasOwnContent; } get isSingleClickArea() { - return this.subTabs.length > 0 && this.isTopLevelTab && !this.hasOwnContent; + return this.items.length > 0 && this.isTopLevelTab && !this.hasOwnContent; } get isTwoClickArea() { - return this.subTabs.length > 0 && this.isTopLevelTab && this.hasOwnContent; + return this.items.length > 0 && this.isTopLevelTab && this.hasOwnContent; } get isOnSelectedTabPath(): boolean { @@ -254,7 +254,7 @@ class Tab extends UI5Element implements ITab, ITabbable { /** * Returns the DOM reference of the tab that is placed in the header. * - * **Note:** Tabs, placed in the `subTabs` slot of other tabs are not shown in the header. Calling this method on such tabs will return `null`. + * **Note:** Tabs, placed in the `items` slot of other tabs are not shown in the header. Calling this method on such tabs will return `null`. * * **Note:** If you need a DOM ref to the tab content please use the `getDomRef` method. * @public @@ -309,7 +309,7 @@ class Tab extends UI5Element implements ITab, ITabbable { } get tabs(): Array { - return this.subTabs.filter((tab): tab is Tab => !tab.isSeparator); + return this.items.filter((tab): tab is Tab => !tab.isSeparator); } get ariaLabelledBy() { @@ -401,7 +401,7 @@ class Tab extends UI5Element implements ITab, ITabbable { } get _roleDescription() { - return this.subTabs.length > 0 ? Tab.i18nBundle.getText(TAB_SPLIT_ROLE_DESCRIPTION) : undefined; + return this.items.length > 0 ? Tab.i18nBundle.getText(TAB_SPLIT_ROLE_DESCRIPTION) : undefined; } get _ariaHasPopup() { diff --git a/packages/main/src/TabContainer.hbs b/packages/main/src/TabContainer.hbs index 8dacf9e9bff8..a65ae54eb93d 100644 --- a/packages/main/src/TabContainer.hbs +++ b/packages/main/src/TabContainer.hbs @@ -75,7 +75,7 @@ {{> contentArea}} {{/unless}} - {{#if hasSubTabs}} + {{#if hasItems}} {{accInvisibleText}} {{/if}} diff --git a/packages/main/src/TabContainer.ts b/packages/main/src/TabContainer.ts index 75168fd648f8..506c6c54dad7 100644 --- a/packages/main/src/TabContainer.ts +++ b/packages/main/src/TabContainer.ts @@ -79,7 +79,7 @@ interface ITab extends UI5Element { isSingleClickArea?: boolean; requiresExpandButton?: boolean; selected?: boolean; - subTabs?: Array ; + items?: Array ; tabs?: Array text?: string; hasOwnContent?: boolean; @@ -556,7 +556,7 @@ class TabContainer extends UI5Element { return false; }); - if (acceptedPlacement === MovePlacement.On && (closestPosition.element as Tab).realTabReference.subTabs.length) { + if (acceptedPlacement === MovePlacement.On && (closestPosition.element as Tab).realTabReference.items.length) { popoverTarget = closestPosition.element; } else if (!acceptedPlacement) { this.dropIndicatorDOM!.targetReference = null; @@ -791,8 +791,8 @@ class TabContainer extends UI5Element { if (item.hasAttribute("ui5-tab") || item.hasAttribute("ui5-tab-separator")) { item.forcedLevel = level; - if (item.subTabs) { - this._setIndentLevels(item.subTabs, level + 1); + if (item.items) { + this._setIndentLevels(item.items, level + 1); } } }); @@ -1298,10 +1298,10 @@ class TabContainer extends UI5Element { } if (isTabInStrip(targetOwner)) { - return targetOwner.realTabReference.subTabs; + return targetOwner.realTabReference.items; } - return targetOwner.subTabs; + return targetOwner.items; } _setPopoverItems(items: Array ) { @@ -1337,11 +1337,11 @@ class TabContainer extends UI5Element { } } - get hasSubTabs(): boolean { + get hasItems(): boolean { const tabs = this._getTabs(); for (let i = 0; i < tabs.length; i++) { - if (tabs[i].subTabs.length > 0) { + if (tabs[i].items.length > 0) { return true; } } @@ -1464,7 +1464,7 @@ class TabContainer extends UI5Element { } get tablistAriaDescribedById() { - return this.hasSubTabs ? `${this._id}-invisibleText` : undefined; + return this.hasItems ? `${this._id}-invisibleText` : undefined; } get shouldAnimate() { @@ -1493,8 +1493,8 @@ const getTab = (el: HTMLElement | null) => { const walk = (tabs: Array , callback: (_: ITab) => void) => { [...tabs].forEach(tab => { callback(tab); - if (tab.subTabs) { - walk(tab.subTabs, callback); + if (tab.items) { + walk(tab.items, callback); } }); }; diff --git a/packages/main/src/TabSeparator.ts b/packages/main/src/TabSeparator.ts index fab5ac4b39e1..ec12a7ed3dc3 100644 --- a/packages/main/src/TabSeparator.ts +++ b/packages/main/src/TabSeparator.ts @@ -56,7 +56,7 @@ class TabSeparator extends UI5Element implements ITab { /** * Returns the DOM reference of the separator that is placed in the header. * - * **Note:** Tabs and separators, placed in the `subTabs` slot of other tabs are not shown in the header. Calling this method on such tabs or separators will return `null`. + * **Note:** Tabs and separators, placed in the `items` slot of other tabs are not shown in the header. Calling this method on such tabs or separators will return `null`. * @public */ getTabInStripDomRef(): ITab | null { diff --git a/packages/main/test/pages/TabContainer.html b/packages/main/test/pages/TabContainer.html index d85d7691cda6..0f1f414c8826 100644 --- a/packages/main/test/pages/TabContainer.html +++ b/packages/main/test/pages/TabContainer.html @@ -35,17 +35,17 @@ Nested Tabs
Button 2 -+ Button 21 -+ - Button 211 + - - + + -@@ -54,20 +54,20 @@ Button 2121 Nested Tabs
+ Text for 2.2 - + Button 3.1 -+ - Button 3.1.1 - + @@ -76,23 +76,23 @@+ Button 3.1.2 Nested Tabs
Button 4 -- + + Button 41 -- + + Button 411 -- + + @@ -106,11 +106,11 @@ Button 4111 -- + + Button 41111 -+ Nested Tabs
Tab Content Tab Content Tab Content - Tab 10.1 Content - Tab 10.1.1 Content - - Tab Content - + Tab 10.1 Content + @@ -120,14 +120,14 @@Tab 10.1.1 Content + + Tab Content + Nested Tabs
- 1 - 1.1 +1 + -1.1 2 - 2.1 - 2.1.1 +2 + 2.1 + -2.1.1 2.2 +2.2 @@ -144,18 +144,18 @@ Text only End Overflow
- + - + Button 3 - - @@ -778,7 +778,7 @@text ++ text textText only Start And End Overflow Custom Overflow Buttons
Button 1 -+ @@ -876,8 +876,8 @@Button 1 Dynamically Insert Tab and Focus It
function walk(tabs, callback) { [...tabs].forEach(tab => { callback(tab); - if (tab.subTabs) { - walk(tab.subTabs, callback); + if (tab.items) { + walk(tab.items, callback); }}); }; diff --git a/packages/main/test/pages/TabContainerDragAndDrop.html b/packages/main/test/pages/TabContainerDragAndDrop.html index 1ee542de6fbd..ec402be9b008 100644 --- a/packages/main/test/pages/TabContainerDragAndDrop.html +++ b/packages/main/test/pages/TabContainerDragAndDrop.html @@ -20,18 +20,18 @@Drag and drop
`; }; @@ -36,16 +36,16 @@ Basic.tags = ["_hidden_"]; Basic.args = { text: "Products", default: `Products go here`, - subTabs: ` - + - + content Button 3 - - @@ -131,7 +131,7 @@text ++ text textDrag and drop
const newParent = source.element.parentElement; if (newParent.hasAttribute("ui5-tab")) { - source.element.slot = "subTabs"; + source.element.slot = "items"; } else { source.element.slot = ""; } diff --git a/packages/main/test/samples/TabContainer.sample.html b/packages/main/test/samples/TabContainer.sample.html index cf894ded75ac..eada22054d1f 100644 --- a/packages/main/test/samples/TabContainer.sample.html +++ b/packages/main/test/samples/TabContainer.sample.html @@ -316,26 +316,26 @@TabContainer with nested tabs
Products go here ... - + Computers go here ... - + Laptops go here ... -- + + -Work Stations go here ... -+ Game Stations go here ... Desktops go here ...- + + Smartphones go here ... -+ Tablets go here ... Phones go here ... @@ -343,7 +343,7 @@TabContainer with nested tabs
Orders go here ... - + @@ -356,26 +356,26 @@Order attachments go here ... TabContainer with nested tabs
Products go here ... - + Computers go here ... - + Laptops go here ... -- + + -Work Stations go here ... -+ Game Stations go here ... Desktops go here ...- + + Smartphones go here ... -+ Tablets go here ... Phones go here ... @@ -383,7 +383,7 @@TabContainer with nested tabs
Orders go here ... - + diff --git a/packages/playground/_stories/main/TabContainer/Tab/Tab.stories.ts b/packages/playground/_stories/main/TabContainer/Tab/Tab.stories.ts index ae383dab76b3..df15e903da7a 100644 --- a/packages/playground/_stories/main/TabContainer/Tab/Tab.stories.ts +++ b/packages/playground/_stories/main/TabContainer/Tab/Tab.stories.ts @@ -25,8 +25,8 @@ const Template: UI5StoryArgsOrder attachments go here ... = (args) => { ?selected="${ifDefined(args.selected)}" text="${ifDefined(args.text)}" > - ${unsafeHTML(args.default)} - ${unsafeHTML(args.subTabs)} + ${unsafeHTML(args.default)} + ${unsafeHTML(args.items)} + items: ` Computers go here ... - + Laptops go here ... -- + + Work Stations go here ... -+ Game Stations go here ... Desktops go here ... diff --git a/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts b/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts index 2c9c664d15ea..53ff91625adf 100644 --- a/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts +++ b/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts @@ -105,26 +105,26 @@ NestedTabs.args = {Products go here ... - + Computers go here ... - + Laptops go here ... -- + + -Work Stations go here ... -+ Game Stations go here ... Desktops go here ...- + + Smartphones go here ... -+ Tablets go here ... Phones go here ... @@ -132,7 +132,7 @@ NestedTabs.args = {Orders go here ... - + `, diff --git a/packages/website/docs/_samples/main/TabContainer/NestedTabs/sample.html b/packages/website/docs/_samples/main/TabContainer/NestedTabs/sample.html index 0c5b836fa77c..6b65eb946444 100644 --- a/packages/website/docs/_samples/main/TabContainer/NestedTabs/sample.html +++ b/packages/website/docs/_samples/main/TabContainer/NestedTabs/sample.html @@ -15,26 +15,26 @@Order attachments go here ... Products go here ... - + Computers go here ... - + Laptops go here ... -- + + -Work Stations go here ... -+ Game Stations go here ... Desktops go here ...- + + Smartphones go here ... -+ Tablets go here ... Phones go here ... @@ -42,7 +42,7 @@Orders go here ... - + From 3da1e47cd57addab037e7b637966571d2208441a Mon Sep 17 00:00:00 2001 From: kskondovOrder attachments go here ... Date: Thu, 28 Mar 2024 17:21:18 +0200 Subject: [PATCH 33/60] refactor(ui5-tabcontainer): rename `tabs-overflow-mode` to `overflow-mode` (#8565) Renames tabs-overflow-mode to overflow-mode BREAKING CHANGE: If you have previously used: ```html ``` Now use: ```html ``` Relates to https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/main/src/TabContainer.ts | 10 +++++----- .../src/types/{TabsOverflowMode.ts => OverflowMode.ts} | 4 ++-- packages/main/test/pages/TabContainer.html | 6 +++--- packages/main/test/pages/TabContainerDragAndDrop.html | 2 +- packages/main/test/samples/TabContainer.sample.html | 4 ++-- packages/main/test/specs/TabContainer.spec.js | 2 +- .../_stories/main/TabContainer/TabContainer.stories.ts | 2 +- .../main/TabContainer/TabContainer.mdx | 4 ++-- .../OverflowMode.md} | 0 .../{TabsOverflowMode => OverflowMode}/main.js | 0 .../{TabsOverflowMode => OverflowMode}/sample.html | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) rename packages/main/src/types/{TabsOverflowMode.ts => OverflowMode.ts} (86%) rename packages/website/docs/_samples/main/TabContainer/{TabsOverflowMode/TabsOverflowMode.md => OverflowMode/OverflowMode.md} (100%) rename packages/website/docs/_samples/main/TabContainer/{TabsOverflowMode => OverflowMode}/main.js (100%) rename packages/website/docs/_samples/main/TabContainer/{TabsOverflowMode => OverflowMode}/sample.html (94%) diff --git a/packages/main/src/TabContainer.ts b/packages/main/src/TabContainer.ts index 506c6c54dad7..27684276f519 100644 --- a/packages/main/src/TabContainer.ts +++ b/packages/main/src/TabContainer.ts @@ -54,7 +54,7 @@ import TabContainerTabsPlacement from "./types/TabContainerTabsPlacement.js"; import SemanticColor from "./types/SemanticColor.js"; import TabContainerBackgroundDesign from "./types/TabContainerBackgroundDesign.js"; import TabLayout from "./types/TabLayout.js"; -import TabsOverflowMode from "./types/TabsOverflowMode.js"; +import OverflowMode from "./types/OverflowMode.js"; import type { IButton } from "./Button.js"; // Templates @@ -226,7 +226,7 @@ class TabContainer extends UI5Element { * so that it's easier for the user to select a specific tab. * @default false * @public - * @deprecated Since the introduction of TabsOverflowMode, overflows will always be visible if there is not enough space for all tabs, + * @deprecated Since the introduction of OverflowMode, overflows will always be visible if there is not enough space for all tabs, * all hidden tabs are moved to a select list in the respective overflows and are accessible via the `overflowButton` and / or `startOverflowButton` slots. */ @property({ type: Boolean }) @@ -255,8 +255,8 @@ class TabContainer extends UI5Element { * @since 1.1.0 * @public */ - @property({ type: TabsOverflowMode, defaultValue: TabsOverflowMode.End }) - tabsOverflowMode!: `${TabsOverflowMode}`; + @property({ type: OverflowMode, defaultValue: OverflowMode.End }) + overflowMode!: `${OverflowMode}`; /** * Sets the background color of the Tab Container's header as `Solid`, `Transparent`, or `Translucent`. @@ -1206,7 +1206,7 @@ class TabContainer extends UI5Element { } get isModeStartAndEnd() { - return this.tabsOverflowMode === TabsOverflowMode.StartAndEnd; + return this.overflowMode === OverflowMode.StartAndEnd; } _updateOverflowCounters() { diff --git a/packages/main/src/types/TabsOverflowMode.ts b/packages/main/src/types/OverflowMode.ts similarity index 86% rename from packages/main/src/types/TabsOverflowMode.ts rename to packages/main/src/types/OverflowMode.ts index c181fce3c82e..f900e516b60b 100644 --- a/packages/main/src/types/TabsOverflowMode.ts +++ b/packages/main/src/types/OverflowMode.ts @@ -2,7 +2,7 @@ * Tabs overflow mode in TabContainer. * @public */ -enum TabsOverflowMode { +enum OverflowMode { /** * End type is used if there should be only one overflow with hidden the tabs at the end of the tab container. * @public @@ -16,4 +16,4 @@ enum TabsOverflowMode { StartAndEnd = "StartAndEnd", } -export default TabsOverflowMode; +export default OverflowMode; diff --git a/packages/main/test/pages/TabContainer.html b/packages/main/test/pages/TabContainer.html index 0f1f414c8826..13a0f49a6e8d 100644 --- a/packages/main/test/pages/TabContainer.html +++ b/packages/main/test/pages/TabContainer.html @@ -195,7 +195,7 @@ Text only End Overflow
Text only Start And End Overflow
-+ @@ -246,7 +246,7 @@ Tab Container
Tab Container Start And End Overflow
-+ @@ -704,7 +704,7 @@ Background design
Text only Start And End Overflow Custom Overflow Buttons
-+ Start End diff --git a/packages/main/test/pages/TabContainerDragAndDrop.html b/packages/main/test/pages/TabContainerDragAndDrop.html index ec402be9b008..942d5cec24dd 100644 --- a/packages/main/test/pages/TabContainerDragAndDrop.html +++ b/packages/main/test/pages/TabContainerDragAndDrop.html @@ -17,7 +17,7 @@ Drag and drop
-+ diff --git a/packages/main/test/samples/TabContainer.sample.html b/packages/main/test/samples/TabContainer.sample.html index eada22054d1f..4a2f066946ea 100644 --- a/packages/main/test/samples/TabContainer.sample.html +++ b/packages/main/test/samples/TabContainer.sample.html @@ -151,7 +151,7 @@ Text only End Overflow
Text only Start and End Overflow
-+ @@ -249,7 +249,7 @@ TabContainer with text and additional-text
- + diff --git a/packages/main/test/specs/TabContainer.spec.js b/packages/main/test/specs/TabContainer.spec.js index cb600862286a..991475e53357 100644 --- a/packages/main/test/specs/TabContainer.spec.js +++ b/packages/main/test/specs/TabContainer.spec.js @@ -137,7 +137,7 @@ describe("TabContainer general interaction", () => { it("tests start and end overflow behavior", async () => { - assert.strictEqual(await browser.$("#tabContainerStartAndEndOverflow").getAttribute("tabs-overflow-mode"), "StartAndEnd", "overflow mode is set to StartAndEnd"); + assert.strictEqual(await browser.$("#tabContainerStartAndEndOverflow").getAttribute("overflow-mode"), "StartAndEnd", "overflow mode is set to StartAndEnd"); // Resize await browser.setWindowSize(1000, 1080); diff --git a/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts b/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts index 53ff91625adf..ca54cee6674b 100644 --- a/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts +++ b/packages/playground/_stories/main/TabContainer/TabContainer.stories.ts @@ -19,7 +19,7 @@ const Template: UI5StoryArgs = (args) => { ?fixed="${ifDefined(args.fixed)}" ?collapsed="${ifDefined(args.collapsed)}" tab-layout="${ifDefined(args.tabLayout)}" - tabs-overflow-mode="${ifDefined(args.tabsOverflowMode)}" + overflow-mode="${ifDefined(args.overflowMode)}" header-background-design="${ifDefined(args.headerBackgroundDesign)}" content-background-design="${ifDefined(args.contentBackgroundDesign)}" tabs-placement="${ifDefined(args.tabsPlacement)}" diff --git a/packages/website/docs/_components_pages/main/TabContainer/TabContainer.mdx b/packages/website/docs/_components_pages/main/TabContainer/TabContainer.mdx index 7c183f851ce4..429257983161 100644 --- a/packages/website/docs/_components_pages/main/TabContainer/TabContainer.mdx +++ b/packages/website/docs/_components_pages/main/TabContainer/TabContainer.mdx @@ -5,7 +5,7 @@ slug: ../../TabContainer import Basic from "../../../_samples/main/TabContainer/Basic/Basic.md"; import TextOnlyTabs from "../../../_samples/main/TabContainer/TextOnlyTabs/TextOnlyTabs.md"; import TabLayout from "../../../_samples/main/TabContainer/TabLayout/TabLayout.md"; -import TabsOverflowMode from "../../../_samples/main/TabContainer/TabsOverflowMode/TabsOverflowMode.md"; +import OverflowMode from "../../../_samples/main/TabContainer/OverflowMode/OverflowMode.md"; import NestedTabs from "../../../_samples/main/TabContainer/NestedTabs/NestedTabs.md"; <%COMPONENT_OVERVIEW%> @@ -27,5 +27,5 @@ import NestedTabs from "../../../_samples/main/TabContainer/NestedTabs/NestedTab ### Tabs Overflow Mode - + diff --git a/packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/TabsOverflowMode.md b/packages/website/docs/_samples/main/TabContainer/OverflowMode/OverflowMode.md similarity index 100% rename from packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/TabsOverflowMode.md rename to packages/website/docs/_samples/main/TabContainer/OverflowMode/OverflowMode.md diff --git a/packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/main.js b/packages/website/docs/_samples/main/TabContainer/OverflowMode/main.js similarity index 100% rename from packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/main.js rename to packages/website/docs/_samples/main/TabContainer/OverflowMode/main.js diff --git a/packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/sample.html b/packages/website/docs/_samples/main/TabContainer/OverflowMode/sample.html similarity index 94% rename from packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/sample.html rename to packages/website/docs/_samples/main/TabContainer/OverflowMode/sample.html index 555338ebb162..b6f69fb02438 100644 --- a/packages/website/docs/_samples/main/TabContainer/TabsOverflowMode/sample.html +++ b/packages/website/docs/_samples/main/TabContainer/OverflowMode/sample.html @@ -9,7 +9,7 @@ - + @@ -36,7 +36,7 @@
-+ From d3e2ed141df6812c09206c187a47423947353fc4 Mon Sep 17 00:00:00 2001 From: kskondov Date: Thu, 28 Mar 2024 17:50:02 +0200 Subject: [PATCH 34/60] =?UTF-8?q?refactor(ui5-tabcontainer):=20remove=20Ta?= =?UTF-8?q?bContainerBackgroundDesign=20enume=E2=80=A6=20(#8570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes `TabContainerBackgroundDesign` enum in favour of `BackgroundDesign` enum. BREAKING CHANGE: If you previously imported `TabContainerBackgroundDesign`, use `BackgroundDesign` instead. Relates to https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/main/src/TabContainer.ts | 10 ++++---- .../src/types/TabContainerBackgroundDesign.ts | 25 ------------------- 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 packages/main/src/types/TabContainerBackgroundDesign.ts diff --git a/packages/main/src/TabContainer.ts b/packages/main/src/TabContainer.ts index 27684276f519..20b66112dc8f 100644 --- a/packages/main/src/TabContainer.ts +++ b/packages/main/src/TabContainer.ts @@ -52,7 +52,7 @@ import type CustomListItem from "./CustomListItem.js"; import ResponsivePopover from "./ResponsivePopover.js"; import TabContainerTabsPlacement from "./types/TabContainerTabsPlacement.js"; import SemanticColor from "./types/SemanticColor.js"; -import TabContainerBackgroundDesign from "./types/TabContainerBackgroundDesign.js"; +import BackgroundDesign from "./types/BackgroundDesign.js"; import TabLayout from "./types/TabLayout.js"; import OverflowMode from "./types/OverflowMode.js"; import type { IButton } from "./Button.js"; @@ -264,8 +264,8 @@ class TabContainer extends UI5Element { * @since 1.10.0 * @public */ - @property({ type: TabContainerBackgroundDesign, defaultValue: TabContainerBackgroundDesign.Solid }) - headerBackgroundDesign!: `${TabContainerBackgroundDesign}`; + @property({ type: BackgroundDesign, defaultValue: BackgroundDesign.Solid }) + headerBackgroundDesign!: `${BackgroundDesign}`; /** * Sets the background color of the Tab Container's content as `Solid`, `Transparent`, or `Translucent`. @@ -273,8 +273,8 @@ class TabContainer extends UI5Element { * @since 1.10.0 * @public */ - @property({ type: TabContainerBackgroundDesign, defaultValue: TabContainerBackgroundDesign.Solid }) - contentBackgroundDesign!: `${TabContainerBackgroundDesign}`; + @property({ type: BackgroundDesign, defaultValue: BackgroundDesign.Solid }) + contentBackgroundDesign!: `${BackgroundDesign}`; /** * Defines the placement of the tab strip relative to the actual tabs' content. diff --git a/packages/main/src/types/TabContainerBackgroundDesign.ts b/packages/main/src/types/TabContainerBackgroundDesign.ts deleted file mode 100644 index 32edfc74980b..000000000000 --- a/packages/main/src/types/TabContainerBackgroundDesign.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Background design for the header and content of TabContainer. - * @public - */ -enum TabContainerBackgroundDesign { - /** - * A Solid background color. - * @public - */ - Solid = "Solid", - - /** - * A Transparent background color. - * @public - */ - Transparent = "Transparent", - - /** - * A Translucent background color. - * @public - */ - Translucent = "Translucent", -} - -export default TabContainerBackgroundDesign; From c742654a05a52769685a9f4f2e0a0719e4dae770 Mon Sep 17 00:00:00 2001 From: Nayden Naydenov <31909318+nnaydenow@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:37:28 +0200 Subject: [PATCH 35/60] chore: enable tree tests (#8558) Co-authored-by: Nayden Naydenov --- packages/main/test/specs/Tree.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/test/specs/Tree.spec.js b/packages/main/test/specs/Tree.spec.js index 71b3d58de99a..86364b0adf71 100644 --- a/packages/main/test/specs/Tree.spec.js +++ b/packages/main/test/specs/Tree.spec.js @@ -195,7 +195,7 @@ describe("Tree slots", () => { await browser.url(`test/pages/Tree.html`); }); - it.only("items slot", async () => { + it("items slot", async () => { const treeItem = await browser.$("#treeItem"); const btn = await browser.$("#btn"); From 9db92d932210c0a3675c77e03155334d028acac9 Mon Sep 17 00:00:00 2001 From: ui5-webcomponents-bot Date: Thu, 28 Mar 2024 08:06:01 +0000 Subject: [PATCH 36/60] chore(release): publish v1.24.0-rc.3 [ci skip] --- CHANGELOG.md | 21 +++++++++++++++++++++ lerna.json | 2 +- packages/base/CHANGELOG.md | 11 +++++++++++ packages/base/package.json | 4 ++-- packages/create-package/CHANGELOG.md | 8 ++++++++ packages/create-package/package.json | 2 +- packages/fiori/CHANGELOG.md | 11 +++++++++++ packages/fiori/package.json | 12 ++++++------ packages/icons-business-suite/CHANGELOG.md | 8 ++++++++ packages/icons-business-suite/package.json | 6 +++--- packages/icons-tnt/CHANGELOG.md | 8 ++++++++ packages/icons-tnt/package.json | 6 +++--- packages/icons/CHANGELOG.md | 8 ++++++++ packages/icons/package.json | 6 +++--- packages/localization/CHANGELOG.md | 11 +++++++++++ packages/localization/package.json | 6 +++--- packages/main/CHANGELOG.md | 15 +++++++++++++++ packages/main/package.json | 16 ++++++++-------- packages/playground/CHANGELOG.md | 8 ++++++++ packages/playground/package.json | 2 +- packages/theming/CHANGELOG.md | 8 ++++++++ packages/theming/package.json | 6 +++--- packages/tools/CHANGELOG.md | 11 +++++++++++ packages/tools/package.json | 2 +- packages/website/CHANGELOG.md | 8 ++++++++ packages/website/package.json | 2 +- 26 files changed, 172 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88bfe69a97f9..06be4916cac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Bug Fixes + +* **ui5-avatar:** revise active state styles ([#8474](https://github.com/SAP/ui5-webcomponents/issues/8474)) ([3f9430c](https://github.com/SAP/ui5-webcomponents/commit/3f9430c64cfd349319b5f17ebc753ce0639a4ab8)), closes [#8309](https://github.com/SAP/ui5-webcomponents/issues/8309) +* **ui5-button:** fix focus in belize ([#8498](https://github.com/SAP/ui5-webcomponents/issues/8498)) ([483d942](https://github.com/SAP/ui5-webcomponents/commit/483d942c3ba6227bd56dead070fba2313c2d97c2)) +* **ui5-carousel:** Fixed paging indicator numbers in right-to-left (RTL) mode ([#8543](https://github.com/SAP/ui5-webcomponents/issues/8543)) ([c032c0c](https://github.com/SAP/ui5-webcomponents/commit/c032c0cadbe4f9fc2e3b642d0155830ffb52325a)) +* **ui5-file-uploader:** adjust mouse cursor style ([#8485](https://github.com/SAP/ui5-webcomponents/issues/8485)) ([37a2e0d](https://github.com/SAP/ui5-webcomponents/commit/37a2e0df5643b643915284d5b36084803104bd6e)), closes [#7794](https://github.com/SAP/ui5-webcomponents/issues/7794) +* **ui5-tabcontainer:** fix tab selection ([#8547](https://github.com/SAP/ui5-webcomponents/issues/8547)) ([5eaa835](https://github.com/SAP/ui5-webcomponents/commit/5eaa83574e98a251043b38efc34fc4477f79777c)) + + +### Features + +* **framework:** support sr, mk, cnr locales ([#8534](https://github.com/SAP/ui5-webcomponents/issues/8534)) ([5b410d6](https://github.com/SAP/ui5-webcomponents/commit/5b410d65267e79d4420b1a6d6788db6495abc962)), closes [#8163](https://github.com/SAP/ui5-webcomponents/issues/8163) +* **ui5-side-navigation:** make items customizable ([#8479](https://github.com/SAP/ui5-webcomponents/issues/8479)) ([95f6891](https://github.com/SAP/ui5-webcomponents/commit/95f68918c44055b8c005462b8ed083f7aecf61fb)) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) diff --git a/lerna.json b/lerna.json index ee8145372ffb..f11e56a9ca1d 100644 --- a/lerna.json +++ b/lerna.json @@ -13,7 +13,7 @@ "packages/website", "packages/create-package" ], - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "command": { "publish": { "allowBranch": "*", diff --git a/packages/base/CHANGELOG.md b/packages/base/CHANGELOG.md index cadb01549054..3b07d6adb1fe 100644 --- a/packages/base/CHANGELOG.md +++ b/packages/base/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Features + +* **framework:** support sr, mk, cnr locales ([#8534](https://github.com/SAP/ui5-webcomponents/issues/8534)) ([5b410d6](https://github.com/SAP/ui5-webcomponents/commit/5b410d65267e79d4420b1a6d6788db6495abc962)), closes [#8163](https://github.com/SAP/ui5-webcomponents/issues/8163) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) diff --git a/packages/base/package.json b/packages/base/package.json index e0b59091ac36..6f28796c1986 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-base", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.base", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -45,7 +45,7 @@ }, "devDependencies": { "@openui5/sap.ui.core": "1.120.5", - "@ui5/webcomponents-tools": "1.24.0-rc.2", + "@ui5/webcomponents-tools": "1.24.0-rc.3", "chromedriver": "^122.0.6", "clean-css": "^5.2.2", "copy-and-watch": "^0.1.5", diff --git a/packages/create-package/CHANGELOG.md b/packages/create-package/CHANGELOG.md index 117bed5ffbc5..4f1fc126b65b 100644 --- a/packages/create-package/CHANGELOG.md +++ b/packages/create-package/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/create-webcomponents-package + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/create-webcomponents-package diff --git a/packages/create-package/package.json b/packages/create-package/package.json index de3b957d7699..b36e8fb1a18c 100644 --- a/packages/create-package/package.json +++ b/packages/create-package/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/create-webcomponents-package", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: create package", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", diff --git a/packages/fiori/CHANGELOG.md b/packages/fiori/CHANGELOG.md index 7f7cdeda1e2f..2cb589decb9b 100644 --- a/packages/fiori/CHANGELOG.md +++ b/packages/fiori/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Features + +* **ui5-side-navigation:** make items customizable ([#8479](https://github.com/SAP/ui5-webcomponents/issues/8479)) ([95f6891](https://github.com/SAP/ui5-webcomponents/commit/95f68918c44055b8c005462b8ed083f7aecf61fb)) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) diff --git a/packages/fiori/package.json b/packages/fiori/package.json index edbde8949dc9..851dad156a82 100644 --- a/packages/fiori/package.json +++ b/packages/fiori/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-fiori", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.fiori", "ui5": { "webComponentsPackage": true @@ -46,14 +46,14 @@ "directory": "packages/fiori" }, "dependencies": { - "@ui5/webcomponents": "1.24.0-rc.2", - "@ui5/webcomponents-base": "1.24.0-rc.2", - "@ui5/webcomponents-icons": "1.24.0-rc.2", - "@ui5/webcomponents-theming": "1.24.0-rc.2", + "@ui5/webcomponents": "1.24.0-rc.3", + "@ui5/webcomponents-base": "1.24.0-rc.3", + "@ui5/webcomponents-icons": "1.24.0-rc.3", + "@ui5/webcomponents-theming": "1.24.0-rc.3", "@zxing/library": "^0.17.1" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2", + "@ui5/webcomponents-tools": "1.24.0-rc.3", "chromedriver": "^122.0.6" } } diff --git a/packages/icons-business-suite/CHANGELOG.md b/packages/icons-business-suite/CHANGELOG.md index 88235bdbab94..e8b0984d43f8 100644 --- a/packages/icons-business-suite/CHANGELOG.md +++ b/packages/icons-business-suite/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-icons-business-suite + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-icons-business-suite diff --git a/packages/icons-business-suite/package.json b/packages/icons-business-suite/package.json index 44c038c43e01..16b925169df1 100644 --- a/packages/icons-business-suite/package.json +++ b/packages/icons-business-suite/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-icons-business-suite", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: SAP Fiori Tools icon set", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -28,9 +28,9 @@ "directory": "packages/icons-business-suite" }, "dependencies": { - "@ui5/webcomponents-base": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2" + "@ui5/webcomponents-tools": "1.24.0-rc.3" } } diff --git a/packages/icons-tnt/CHANGELOG.md b/packages/icons-tnt/CHANGELOG.md index b5b62cfd066c..75c9e3f65e28 100644 --- a/packages/icons-tnt/CHANGELOG.md +++ b/packages/icons-tnt/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-icons-tnt + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-icons-tnt diff --git a/packages/icons-tnt/package.json b/packages/icons-tnt/package.json index f8b4b73786c7..0943c15b821d 100644 --- a/packages/icons-tnt/package.json +++ b/packages/icons-tnt/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-icons-tnt", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: SAP Fiori Tools icon set", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -28,9 +28,9 @@ "directory": "packages/icons-tnt" }, "dependencies": { - "@ui5/webcomponents-base": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2" + "@ui5/webcomponents-tools": "1.24.0-rc.3" } } diff --git a/packages/icons/CHANGELOG.md b/packages/icons/CHANGELOG.md index 79541f615e76..7197d12b99ed 100644 --- a/packages/icons/CHANGELOG.md +++ b/packages/icons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-icons + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-icons diff --git a/packages/icons/package.json b/packages/icons/package.json index 24436d93f411..fc9e00a4e344 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-icons", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.SAP-icons", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -28,9 +28,9 @@ "directory": "packages/icons" }, "dependencies": { - "@ui5/webcomponents-base": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2" + "@ui5/webcomponents-tools": "1.24.0-rc.3" } } diff --git a/packages/localization/CHANGELOG.md b/packages/localization/CHANGELOG.md index 67580f252db1..783888c1bdcb 100644 --- a/packages/localization/CHANGELOG.md +++ b/packages/localization/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Features + +* **framework:** support sr, mk, cnr locales ([#8534](https://github.com/SAP/ui5-webcomponents/issues/8534)) ([5b410d6](https://github.com/SAP/ui5-webcomponents/commit/5b410d65267e79d4420b1a6d6788db6495abc962)), closes [#8163](https://github.com/SAP/ui5-webcomponents/issues/8163) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-localization diff --git a/packages/localization/package.json b/packages/localization/package.json index 01d6ff13236b..4f28a03b6d93 100644 --- a/packages/localization/package.json +++ b/packages/localization/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-localization", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "Localization for UI5 Web Components", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -33,7 +33,7 @@ "@babel/generator": "^7.23.6", "@babel/parser": "^7.23.6", "@openui5/sap.ui.core": "1.120.5", - "@ui5/webcomponents-tools": "1.24.0-rc.2", + "@ui5/webcomponents-tools": "1.24.0-rc.3", "babel-plugin-amd-to-esm": "^2.0.3", "chromedriver": "^122.0.6", "estree-walk": "^2.2.0", @@ -42,6 +42,6 @@ }, "dependencies": { "@types/openui5": "^1.113.0", - "@ui5/webcomponents-base": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3" } } diff --git a/packages/main/CHANGELOG.md b/packages/main/CHANGELOG.md index a31738cef0d4..fc339aeb31fe 100644 --- a/packages/main/CHANGELOG.md +++ b/packages/main/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Bug Fixes + +* **ui5-avatar:** revise active state styles ([#8474](https://github.com/SAP/ui5-webcomponents/issues/8474)) ([3f9430c](https://github.com/SAP/ui5-webcomponents/commit/3f9430c64cfd349319b5f17ebc753ce0639a4ab8)), closes [#8309](https://github.com/SAP/ui5-webcomponents/issues/8309) +* **ui5-button:** fix focus in belize ([#8498](https://github.com/SAP/ui5-webcomponents/issues/8498)) ([483d942](https://github.com/SAP/ui5-webcomponents/commit/483d942c3ba6227bd56dead070fba2313c2d97c2)) +* **ui5-carousel:** Fixed paging indicator numbers in right-to-left (RTL) mode ([#8543](https://github.com/SAP/ui5-webcomponents/issues/8543)) ([c032c0c](https://github.com/SAP/ui5-webcomponents/commit/c032c0cadbe4f9fc2e3b642d0155830ffb52325a)) +* **ui5-file-uploader:** adjust mouse cursor style ([#8485](https://github.com/SAP/ui5-webcomponents/issues/8485)) ([37a2e0d](https://github.com/SAP/ui5-webcomponents/commit/37a2e0df5643b643915284d5b36084803104bd6e)), closes [#7794](https://github.com/SAP/ui5-webcomponents/issues/7794) +* **ui5-tabcontainer:** fix tab selection ([#8547](https://github.com/SAP/ui5-webcomponents/issues/8547)) ([5eaa835](https://github.com/SAP/ui5-webcomponents/commit/5eaa83574e98a251043b38efc34fc4477f79777c)) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) diff --git a/packages/main/package.json b/packages/main/package.json index 76c761f02b10..e0eb0581c51d 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.main", "ui5": { "webComponentsPackage": true @@ -48,15 +48,15 @@ "directory": "packages/main" }, "dependencies": { - "@ui5/webcomponents-base": "1.24.0-rc.2", - "@ui5/webcomponents-icons": "1.24.0-rc.2", - "@ui5/webcomponents-icons-business-suite": "1.24.0-rc.2", - "@ui5/webcomponents-icons-tnt": "1.24.0-rc.2", - "@ui5/webcomponents-localization": "1.24.0-rc.2", - "@ui5/webcomponents-theming": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3", + "@ui5/webcomponents-icons": "1.24.0-rc.3", + "@ui5/webcomponents-icons-business-suite": "1.24.0-rc.3", + "@ui5/webcomponents-icons-tnt": "1.24.0-rc.3", + "@ui5/webcomponents-localization": "1.24.0-rc.3", + "@ui5/webcomponents-theming": "1.24.0-rc.3" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2", + "@ui5/webcomponents-tools": "1.24.0-rc.3", "chromedriver": "^122.0.6" } } diff --git a/packages/playground/CHANGELOG.md b/packages/playground/CHANGELOG.md index 0f08bc6ffd2c..2e9cb16c8db0 100644 --- a/packages/playground/CHANGELOG.md +++ b/packages/playground/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-playground + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-playground diff --git a/packages/playground/package.json b/packages/playground/package.json index 7e881c451edc..56a98c4d9488 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,7 +1,7 @@ { "name": "@ui5/webcomponents-playground", "private": true, - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components Playground", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", diff --git a/packages/theming/CHANGELOG.md b/packages/theming/CHANGELOG.md index 5d81b1653e16..d64401a57c4a 100644 --- a/packages/theming/CHANGELOG.md +++ b/packages/theming/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-theming + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-theming diff --git a/packages/theming/package.json b/packages/theming/package.json index 063c384a7d6a..df312477377e 100644 --- a/packages/theming/package.json +++ b/packages/theming/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-theming", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.theming", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", @@ -31,10 +31,10 @@ }, "dependencies": { "@sap-theming/theming-base-content": "11.12.0", - "@ui5/webcomponents-base": "1.24.0-rc.2" + "@ui5/webcomponents-base": "1.24.0-rc.3" }, "devDependencies": { - "@ui5/webcomponents-tools": "1.24.0-rc.2", + "@ui5/webcomponents-tools": "1.24.0-rc.3", "globby": "^13.1.1", "json-beautify": "^1.1.1", "nps": "^5.10.0", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index 5ffaeab17cc2..cd6df4be51db 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + + +### Features + +* **framework:** support sr, mk, cnr locales ([#8534](https://github.com/SAP/ui5-webcomponents/issues/8534)) ([5b410d6](https://github.com/SAP/ui5-webcomponents/commit/5b410d65267e79d4420b1a6d6788db6495abc962)), closes [#8163](https://github.com/SAP/ui5-webcomponents/issues/8163) + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) **Note:** Version bump only for package @ui5/webcomponents-tools diff --git a/packages/tools/package.json b/packages/tools/package.json index 0e4e32beaf78..9a7b4409bf53 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-tools", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "description": "UI5 Web Components: webcomponents.tools", "author": "SAP SE (https://www.sap.com)", "license": "Apache-2.0", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index ec20359345a1..42fa257d6251 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.24.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.2...v1.24.0-rc.3) (2024-03-28) + +**Note:** Version bump only for package @ui5/webcomponents-website + + + + + # [1.24.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.24.0-rc.1...v1.24.0-rc.2) (2024-03-21) diff --git a/packages/website/package.json b/packages/website/package.json index 0753b67edbcf..dee2209cc242 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "@ui5/webcomponents-website", - "version": "1.24.0-rc.2", + "version": "1.24.0-rc.3", "private": true, "scripts": { "generate-local-cdn": "rimraf ./local-cdn && node ./build-scripts/local-cdn.mjs", From 13c9c58a737f79f535cf5383056c0e7d30b69b07 Mon Sep 17 00:00:00 2001 From: kskondov Date: Fri, 29 Mar 2024 13:56:15 +0200 Subject: [PATCH 37/60] refactor(ui5-tabcontainer): remove deprecated showOverflow property (#8568) Removes the deprecated showOverflow property. BREAKING CHANGE: The showOverflow property is removed. If previously you have used: ```html ``` now use the overflowButton slot: ```html ``` Relates to https://github.com/SAP/ui5-webcomponents/issues/8461 --- packages/main/src/TabContainer.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/main/src/TabContainer.ts b/packages/main/src/TabContainer.ts index 20b66112dc8f..1be9f409a262 100644 --- a/packages/main/src/TabContainer.ts +++ b/packages/main/src/TabContainer.ts @@ -219,19 +219,6 @@ class TabContainer extends UI5Element { @property({ type: Boolean }) collapsed!: boolean; - /** - * Defines whether the overflow select list is displayed. - * - * The overflow select list represents a list, where all tabs are displayed - * so that it's easier for the user to select a specific tab. - * @default false - * @public - * @deprecated Since the introduction of OverflowMode, overflows will always be visible if there is not enough space for all tabs, - * all hidden tabs are moved to a select list in the respective overflows and are accessible via the `overflowButton` and / or `startOverflowButton` slots. - */ - @property({ type: Boolean }) - showOverflow!: boolean; - /** * Defines the alignment of the content and the `additionalText` of a tab. * @@ -403,10 +390,6 @@ class TabContainer extends UI5Element { if (!this._animationRunning) { this._contentCollapsed = this.collapsed; } - - if (this.showOverflow) { - console.warn(`The "show-overflow" property is deprecated and will be removed in a future release.`); // eslint-disable-line - } } onAfterRendering() { From 18e2759687a3d8460cab14b1df8784f73735c0b4 Mon Sep 17 00:00:00 2001 From: Petar Dimov <32839090+dimovpetar@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:11:02 +0300 Subject: [PATCH 38/60] refactor(ui5-popover): rename property placementType to placement (#8596) Renames the `placementType` property of `ui5-popover`. Also renames the `PopoverPlacementType` enum to `PopoverPlacement`. BREAKING CHANGE: The `placementType` property and the `PopoverPlacementType` enum have been renamed. If you have previously used the `placementType` property and the `PopoverPlacementType` ```html Start End ``` ```js import PopoverPlacementType from "@ui5/webcomponents/dist/types/PopoverPlacementType.js"; ``` Now use `placement` instead: ```html ``` ```js import PopoverPlacementType from "@ui5/webcomponents/dist/types/PopoverPlacement.js"; ``` Related to https://github.com/SAP/ui5-webcomponents/issues/8461 --- .../NotificationOverflowActionsPopover.hbs | 2 +- packages/fiori/src/ShellBarPopover.hbs | 4 +- packages/fiori/src/WizardPopover.hbs | 2 +- .../test/pages/NotificationListGroupItem.html | 2 +- .../test/pages/NotificationListItem.html | 2 +- packages/fiori/test/pages/ShellBar.html | 6 +- .../NotificationListGroupItem.sample.html | 4 +- .../samples/NotificationListItem.sample.html | 4 +- .../test/samples/ProductSwitch.sample.html | 4 +- .../fiori/test/samples/ShellBar.sample.html | 4 +- packages/main/src/BreadcrumbsPopover.hbs | 2 +- packages/main/src/ColorPalettePopover.hbs | 2 +- packages/main/src/ComboBoxPopover.hbs | 4 +- packages/main/src/DatePickerPopover.hbs | 2 +- packages/main/src/FileUploaderPopover.hbs | 2 +- packages/main/src/InputPopover.hbs | 4 +- packages/main/src/Menu.hbs | 2 +- packages/main/src/Menu.ts | 4 +- packages/main/src/MultiComboBoxPopover.hbs | 4 +- packages/main/src/Popover.ts | 76 +++++++++---------- packages/main/src/SelectMenu.hbs | 2 +- packages/main/src/SelectPopover.hbs | 4 +- packages/main/src/TabContainerPopover.hbs | 2 +- packages/main/src/TextAreaPopover.hbs | 2 +- packages/main/src/TimePickerPopover.hbs | 4 +- packages/main/src/TokenizerPopover.hbs | 2 +- packages/main/src/Toolbar.ts | 2 +- packages/main/src/ToolbarPopover.hbs | 2 +- packages/main/src/themes/Menu.css | 2 +- packages/main/src/themes/Popover.css | 24 +++--- ...erPlacementType.ts => PopoverPlacement.ts} | 6 +- packages/main/test/pages/AvatarGroup.html | 4 +- packages/main/test/pages/Dialog.html | 4 +- packages/main/test/pages/Input_quickview.html | 4 +- packages/main/test/pages/List_test_page.html | 2 +- packages/main/test/pages/Popover.html | 46 +++++------ .../main/test/pages/PopoverArrowBounds.html | 14 ++-- packages/main/test/pages/Popups.html | 8 +- .../main/test/pages/ResponsivePopover.html | 2 +- .../main/test/samples/AvatarGroup.sample.html | 12 +-- .../NotificationListGroupItem.stories.ts | 2 +- .../NotificationListItem.stories.ts | 2 +- .../ProductSwitch/ProductSwitch.stories.ts | 2 +- .../fiori/ShellBar/ShellBar.stories.ts | 2 +- .../AvatarGroup/TemplateGroupWithPopover.ts | 2 +- .../TemplateIndividualWithPopover.ts | 4 +- .../_stories/main/Popover/Popover.stories.ts | 2 +- .../ResponsivePopover.stories.ts | 2 +- .../InShellBar/sample.html | 2 +- .../InShellBar/sample.html | 2 +- .../ProductSwitch/WithShellBar/sample.html | 2 +- .../fiori/ShellBar/Advanced/sample.html | 2 +- .../AvatarGroup/GroupWithPopover/sample.html | 2 +- .../IndividualWithPopover/sample.html | 4 +- .../main/Popover/Placement/sample.html | 4 +- .../ResponsivePopover/Placement/sample.html | 4 +- 56 files changed, 162 insertions(+), 162 deletions(-) rename packages/main/src/types/{PopoverPlacementType.ts => PopoverPlacement.ts} (82%) diff --git a/packages/fiori/src/NotificationOverflowActionsPopover.hbs b/packages/fiori/src/NotificationOverflowActionsPopover.hbs index e483f4a53b89..1c7af7a6cc80 100644 --- a/packages/fiori/src/NotificationOverflowActionsPopover.hbs +++ b/packages/fiori/src/NotificationOverflowActionsPopover.hbs @@ -1,6 +1,6 @@ diff --git a/packages/fiori/src/ShellBarPopover.hbs b/packages/fiori/src/ShellBarPopover.hbs index 4ce3bdd8039e..f997b3723039 100644 --- a/packages/fiori/src/ShellBarPopover.hbs +++ b/packages/fiori/src/ShellBarPopover.hbs @@ -1,6 +1,6 @@ @@ -12,7 +12,7 @@ - + - + ShellBar in Compact