From f40f4a263ad5270a6e744ee2ffbb6fdde0130135 Mon Sep 17 00:00:00 2001 From: Nia Peeva Date: Fri, 24 Nov 2023 21:55:53 +0200 Subject: [PATCH 1/2] docs(ui5-message-strip): improve documentation --- packages/main/src/MessageStrip.ts | 36 ++++--------------- packages/main/src/types/MessageStripDesign.ts | 8 ----- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/packages/main/src/MessageStrip.ts b/packages/main/src/MessageStrip.ts index ff880f5f3cea..0ef3a9d2db1c 100644 --- a/packages/main/src/MessageStrip.ts +++ b/packages/main/src/MessageStrip.ts @@ -15,6 +15,7 @@ import "@ui5/webcomponents-icons/dist/error.js"; import "@ui5/webcomponents-icons/dist/alert.js"; import MessageStripDesign from "./types/MessageStripDesign.js"; import MessageStripTemplate from "./generated/templates/MessageStripTemplate.lit.js"; +import type { IIcon } from "./Interfaces.js"; import Icon from "./Icon.js"; import Button from "./Button.js"; import { @@ -73,12 +74,10 @@ type DesignTypeAnnouncemnt = Record; * import "@ui5/webcomponents/dist/MessageStrip"; * * @constructor - * @author SAP SE - * @alias sap.ui.webc.main.MessageStrip - * @extends sap.ui.webc.base.UI5Element - * @tagname ui5-message-strip + * @extends UI5Element * @public * @since 0.9.0 + * @slot {Node[]} default - Defines the text of the component.

Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. */ @customElement({ tag: "ui5-message-strip", @@ -92,7 +91,6 @@ type DesignTypeAnnouncemnt = Record; * Fired when the close button is pressed either with a * click/tap or by using the Enter or Space key. * - * @event sap.ui.webc.main.MessageStrip#close * @public */ @event("close") @@ -101,9 +99,7 @@ class MessageStrip extends UI5Element { /** * Defines the component type. * - * @type {sap.ui.webc.main.types.MessageStripDesign} - * @name sap.ui.webc.main.MessageStrip.prototype.design - * @defaultvalue "Information" + * @default "Information" * @public * @since 1.0.0-rc.15 */ @@ -117,9 +113,7 @@ class MessageStrip extends UI5Element { * Defines whether the MessageStrip will show an icon in the beginning. * You can directly provide an icon with the icon slot. Otherwise, the default icon for the type will be used. * - * @type {boolean} - * @name sap.ui.webc.main.MessageStrip.prototype.hideIcon - * @defaultvalue false + * @default false * @public * @since 1.0.0-rc.15 */ @@ -129,25 +123,12 @@ class MessageStrip extends UI5Element { /** * Defines whether the MessageStrip renders close button. * - * @type {boolean} - * @name sap.ui.webc.main.MessageStrip.prototype.hideCloseButton - * @defaultvalue false + * @default false * @public */ @property({ type: Boolean }) hideCloseButton!: boolean; - /** - * Defines the text of the component. - *

- * Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. - * - * @type {Node[]} - * @name sap.ui.webc.main.MessageStrip.prototype.default - * @slot - * @public - */ - /** * Defines the content to be displayed as graphical element within the component. *

@@ -157,13 +138,10 @@ class MessageStrip extends UI5Element { * * See all the available icons in the Icon Explorer. * - * @type {sap.ui.webc.main.IIcon} - * @name sap.ui.webc.main.MessageStrip.prototype.icon - * @slot * @public */ @slot() - icon!: Array; + icon!: Array; static i18nBundle: I18nBundle; diff --git a/packages/main/src/types/MessageStripDesign.ts b/packages/main/src/types/MessageStripDesign.ts index 8f8bcabdd76f..f02a21972e53 100644 --- a/packages/main/src/types/MessageStripDesign.ts +++ b/packages/main/src/types/MessageStripDesign.ts @@ -1,38 +1,30 @@ /** * MessageStrip designs. * - * @readonly - * @enum {string} * @public - * @author SAP SE - * @alias sap.ui.webc.main.types.MessageStripDesign */ enum MessageStripDesign { /** * Message should be just an information * @public - * @type {Information} */ Information = "Information", /** * Message is a success message * @public - * @type {Positive} */ Positive = "Positive", /** * Message is an error * @public - * @type {Negative} */ Negative = "Negative", /** * Message is a warning * @public - * @type {Warning} */ Warning = "Warning", } From da0ac718ec59fdb71aa42d519f034c334d489bbc Mon Sep 17 00:00:00 2001 From: Nia Peeva Date: Mon, 27 Nov 2023 10:23:34 +0200 Subject: [PATCH 2/2] docs(ui5-message-strip): reflect review comments --- packages/main/src/MessageStrip.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/main/src/MessageStrip.ts b/packages/main/src/MessageStrip.ts index 0ef3a9d2db1c..e944128e9d4d 100644 --- a/packages/main/src/MessageStrip.ts +++ b/packages/main/src/MessageStrip.ts @@ -77,7 +77,10 @@ type DesignTypeAnnouncemnt = Record; * @extends UI5Element * @public * @since 0.9.0 - * @slot {Node[]} default - Defines the text of the component.

Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. + * @slot {Node[]} default + * Defines the text of the component. + *

+ * Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design. */ @customElement({ tag: "ui5-message-strip",