Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(ui5-panel): improve documentation #7924

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 16 additions & 54 deletions packages/main/src/Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ import panelCss from "./generated/themes/Panel.css.js";
* clockwise/counter-clockwise.</li>
* </ul>
*
* <h3>CSS Shadow Parts</h3>
*
* <ui5-link target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.
* <br>
* The <code>ui5-panel</code> exposes the following CSS Shadow Parts:
* <ul>
* <li>header - Used to style the wrapper of the header</li>
* <li>content - Used to style the wrapper of the content</li>
* </ul>
*
* <h3>Keyboard Handling</h3>
*
* <h4>Fast Navigation</h4>
Expand All @@ -86,11 +76,11 @@ import panelCss from "./generated/themes/Panel.css.js";
* <code>import "@ui5/webcomponents/dist/Panel";</code>
*
* @constructor
* @author SAP SE
* @alias sap.ui.webc.main.Panel
* @extends sap.ui.webc.base.UI5Element
* @tagname ui5-panel
* @extends UI5Element
* @public
* @slot {Node[]} default - Defines the content of the component. The content is visible only when the component is expanded.
* @csspart header - Used to style the wrapper of the header.
* @csspart content - Used to style the wrapper of the content.
*/
@customElement({
tag: "ui5-panel",
Expand All @@ -104,7 +94,6 @@ import panelCss from "./generated/themes/Panel.css.js";
/**
* Fired when the component is expanded/collapsed by user interaction.
*
* @event sap.ui.webc.main.Panel#toggle
* @public
*/
@event("toggle")
Expand All @@ -115,9 +104,7 @@ class Panel extends UI5Element {
* <br><br>
* <b>Note:</b> This property is overridden by the <code>header</code> slot.
*
* @type {string}
* @name sap.ui.webc.main.Panel.prototype.headerText
* @defaultvalue ""
* @default ""
* @public
*/
@property()
Expand All @@ -127,9 +114,7 @@ class Panel extends UI5Element {
* Determines whether the component is in a fixed state that is not
* expandable/collapsible by user interaction.
*
* @type {boolean}
* @name sap.ui.webc.main.Panel.prototype.fixed
* @defaultvalue false
* @default false
* @public
*/
@property({ type: Boolean })
Expand All @@ -138,9 +123,7 @@ class Panel extends UI5Element {
/**
* Indicates whether the component is collapsed and only the header is displayed.
*
* @type {boolean}
* @name sap.ui.webc.main.Panel.prototype.collapsed
* @defaultvalue false
* @default false
* @public
*/
@property({ type: Boolean })
Expand All @@ -149,9 +132,7 @@ class Panel extends UI5Element {
/**
* Indicates whether the transition between the expanded and the collapsed state of the component is animated. By default the animation is enabled.
*
* @type {boolean}
* @name sap.ui.webc.main.Panel.prototype.noAnimation
* @defaultvalue false
* @default false
* @public
* @since 1.0.0-rc.16
*/
Expand All @@ -163,9 +144,7 @@ class Panel extends UI5Element {
* Depending on the usage, you can change the role from the default <code>Form</code>
* to <code>Region</code> or <code>Complementary</code>.
*
* @type {sap.ui.webc.main.types.PanelAccessibleRole}
* @name sap.ui.webc.main.Panel.prototype.accessibleRole
* @defaultvalue "Form"
* @default "Form"
* @public
*/
@property({ type: PanelAccessibleRole, defaultValue: PanelAccessibleRole.Form })
Expand All @@ -176,9 +155,8 @@ class Panel extends UI5Element {
* set by the <code>headerText</code>.
* <br><br>
* Available options are: <code>"H6"</code> to <code>"H1"</code>.
* @type {sap.ui.webc.main.types.TitleLevel}
* @name sap.ui.webc.main.Panel.prototype.headerLevel
* @defaultvalue "H2"
*
* @default "H2"
* @public
*/
@property({ type: TitleLevel, defaultValue: TitleLevel.H2 })
Expand All @@ -187,9 +165,7 @@ class Panel extends UI5Element {
/**
* Defines the accessible ARIA name of the component.
*
* @type {string}
* @name sap.ui.webc.main.Panel.prototype.accessibleName
* @defaultvalue ""
* @default ""
* @public
* @since 1.0.0-rc.15
*/
Expand All @@ -201,9 +177,8 @@ class Panel extends UI5Element {
* If stickyHeader is set to true, then whenever you scroll the content or
* the application, the header of the panel will be always visible and
* a solid color will be used for its design.
* @type {boolean}
* @name sap.ui.webc.main.Panel.prototype.stickyHeader
* @defaultvalue false
*
* @default false
* @public
* @since 1.16.0-rc.1
*/
Expand All @@ -214,8 +189,8 @@ class Panel extends UI5Element {
* When set to <code>true</code>, the <code>accessibleName</code> property will be
* applied not only on the panel root itself, but on its toggle button too.
* <b>Note:</b> This property only has effect if <code>accessibleName</code> is set and a header slot is provided.
* @type {boolean}
* @defaultvalue false
*
* @default false
* @private
*/
@property({ type: Boolean })
Expand All @@ -238,24 +213,11 @@ class Panel extends UI5Element {
* <br><br>
* <b>Note:</b> When a header is provided, the <code>headerText</code> property is ignored.
*
* @type {HTMLElement[]}
* @name sap.ui.webc.main.Panel.prototype.header
* @slot
* @public
*/
@slot()
header!: Array<HTMLElement>;

/**
* Defines the content of the component.
* The content is visible only when the component is expanded.
*
* @type {Node[]}
* @name sap.ui.webc.main.Panel.prototype.default
* @slot
* @public
*/

static i18nBundle: I18nBundle;

onBeforeRendering() {
Expand Down
7 changes: 0 additions & 7 deletions packages/main/src/types/PanelAccessibleRole.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
/**
* Panel accessible roles.
*
* @readonly
* @enum {string}
* @public
* @author SAP SE
* @alias sap.ui.webc.main.types.PanelAccessibleRole
*/
enum PanelAccessibleRole {

/**
* Represents the ARIA role "complementary".
* A section of the page, designed to be complementary to the main content at a similar level in the DOM hierarchy.
* @public
* @type {Complementary}
*/
Complementary = "Complementary",

/**
* Represents the ARIA role "Form".
* A landmark region that contains a collection of items and objects that, as a whole, create a form.
* @public
* @type {Form}
*/
Form = "Form",

/**
* Represents the ARIA role "Region".
* A section of a page, that is important enough to be included in a page summary or table of contents.
* @public
* @type {Region}
*/
Region = "Region",
}
Expand Down