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-textarea): improve documentation #7913

Merged
merged 3 commits into from
Nov 27, 2023
Merged
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
83 changes: 20 additions & 63 deletions packages/main/src/TextArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,14 @@ type ExceededText = {
* When empty, it can hold a placeholder similar to a <code>ui5-input</code>.
* You can define the rows of the <code>ui5-textarea</code> and also determine specific behavior when handling long texts.
*
* <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-textarea</code> exposes the following CSS Shadow Parts:
* <ul>
* <li>textarea - Used to style the native textarea</li>
* </ul>
*
* <h3>ES6 Module Import</h3>
*
* <code>import "@ui5/webcomponents/dist/TextArea";</code>
*
* @constructor
* @author SAP SE
* @alias sap.ui.webc.main.TextArea
* @extends sap.ui.webc.base.UI5Element
* @tagname ui5-textarea
* @extends UI5Element
* @public
* @csspart textarea - Used to style the native textarea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove CSS Shadow parts section since the textarea css part is declared here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*/
@customElement({
tag: "ui5-textarea",
Expand All @@ -99,7 +88,6 @@ type ExceededText = {
/**
* Fired when the text has changed and the focus leaves the component.
*
* @event sap.ui.webc.main.TextArea#change
* @public
*/
@event("change")
Expand All @@ -108,7 +96,6 @@ type ExceededText = {
* Fired when the value of the component changes at each keystroke or when
* something is pasted.
*
* @event sap.ui.webc.main.TextArea#input
* @since 1.0.0-rc.5
* @public
*/
Expand All @@ -118,11 +105,9 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Defines the value of the component.
*
* @type {string}
* @name sap.ui.webc.main.TextArea.prototype.value
* @formEvents change input
* @formProperty
* @defaultvalue ""
* @default ""
* @public
*/
@property()
Expand All @@ -132,9 +117,7 @@ class TextArea extends UI5Element implements IFormElement {
* <br><br>
* <b>Note:</b> A disabled component is completely noninteractive.
*
* @type {boolean}
* @name sap.ui.webc.main.TextArea.prototype.disabled
* @defaultvalue false
* @default false
* @public
*/
@property({ type: Boolean })
Expand All @@ -145,19 +128,15 @@ class TextArea extends UI5Element implements IFormElement {
* <b>Note:</b> A read-only component is not editable,
* but still provides visual feedback upon user interaction.
*
* @type {boolean}
* @name sap.ui.webc.main.TextArea.prototype.readonly
* @defaultvalue false
* @default false
* @public
*/
@property({ type: Boolean })
readonly!: boolean;
/**
* Defines whether the component is required.
*
* @type {boolean}
* @name sap.ui.webc.main.TextArea.prototype.required
* @defaultvalue false
* @default false
* @public
* @since 1.0.0-rc.3
*/
Expand All @@ -167,9 +146,7 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Defines a short hint intended to aid the user with data entry when the component has no value.
*
* @type {string}
* @name sap.ui.webc.main.TextArea.prototype.placeholder
* @defaultvalue ""
* @default ""
* @public
*/
@property()
Expand All @@ -182,9 +159,8 @@ class TextArea extends UI5Element implements IFormElement {
* <b>Note:</b> If <code>maxlength</code> property is set,
* the component turns into "Warning" state once the characters exceeds the limit.
* In this case, only the "Error" state is considered and can be applied.
* @type {sap.ui.webc.base.types.ValueState}
* @name sap.ui.webc.main.TextArea.prototype.valueState
* @defaultvalue "None"
*
* @default "None"
* @since 1.0.0-rc.7
* @public
*/
Expand All @@ -201,9 +177,7 @@ class TextArea extends UI5Element implements IFormElement {
* <li>The CSS <code>height</code> property wins over the <code>rows</code> property, if both are set.</li>
* </ul>
*
* @type {sap.ui.webc.base.types.Integer}
* @name sap.ui.webc.main.TextArea.prototype.rows
* @defaultvalue 0
* @default 0
* @public
*/
@property({ validator: Integer, defaultValue: 0 })
Expand All @@ -212,9 +186,7 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Defines the maximum number of characters that the <code>value</code> can have.
*
* @type {sap.ui.webc.base.types.Integer}
* @name sap.ui.webc.main.TextArea.prototype.maxlength
* @defaultValue null
* @default null
* @public
*/
@property({ validator: Integer, defaultValue: null })
Expand All @@ -229,10 +201,7 @@ class TextArea extends UI5Element implements IFormElement {
* If set to <code>true</code> the characters exceeding the <code>maxlength</code> value are selected on
* paste and the counter below the component displays their number.
*
* @type {boolean}
* @name sap.ui.webc.main.TextArea.prototype.showExceededText

* @defaultvalue false
* @default false
* @public
*/
@property({ type: Boolean })
Expand All @@ -241,9 +210,8 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Enables the component to automatically grow and shrink dynamically with its content.
* <br><br>
* @type {boolean}
* @name sap.ui.webc.main.TextArea.prototype.growing
* @defaultvalue false
*
* @default false
* @public
*/
@property({ type: Boolean })
Expand All @@ -252,9 +220,7 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Defines the maximum number of lines that the component can grow.
*
* @type {sap.ui.webc.base.types.Integer}
* @name sap.ui.webc.main.TextArea.prototype.growingMaxLines
* @defaultvalue 0
* @default 0
* @public
*/
@property({ validator: Integer, defaultValue: 0 })
Expand All @@ -272,9 +238,7 @@ class TextArea extends UI5Element implements IFormElement {
* will be created inside the component so that it can be submitted as
* part of an HTML form. Do not use this property unless you need to submit a form.
*
* @type {string}
* @name sap.ui.webc.main.TextArea.prototype.name
* @defaultvalue ""
* @default ""
* @public
*/
@property()
Expand All @@ -283,8 +247,7 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Defines the accessible ARIA name of the component.
*
* @type {string}
* @name sap.ui.webc.main.TextArea.prototype.accessibleName
* @default ""
* @public
* @since 1.0.0-rc.15
*/
Expand All @@ -294,9 +257,7 @@ class TextArea extends UI5Element implements IFormElement {
/**
* Receives id(or many ids) of the elements that label the textarea.
*
* @type {string}
* @name sap.ui.webc.main.TextArea.prototype.accessibleNameRef
* @defaultvalue ""
* @default ""
* @public
* @since 1.0.0-rc.15
*/
Expand Down Expand Up @@ -342,20 +303,16 @@ class TextArea extends UI5Element implements IFormElement {
* <br><br>
* <b>Note:</b> The <code>valueStateMessage</code> would be displayed if the component has
* <code>valueState</code> of type <code>Information</code>, <code>Warning</code> or <code>Error</code>.
* @type {HTMLElement[]}
* @name sap.ui.webc.main.TextArea.prototype.valueStateMessage
*
* @since 1.0.0-rc.7
* @slot
* @public
*/
@slot()
valueStateMessage!: Array<HTMLElement>;
/**
* The slot is used to render native <code>input</code> HTML element within Light DOM to enable form submit,
* when <code>name</code> property is set.
* @type {HTMLElement[]}
* @name sa.ui.webc.main.TextArea.prototype.formSupport
* @slot
*
* @private
*/
@slot()
Expand Down
Loading