Skip to content

Commit 95e00fd

Browse files
authored
fix(ui5-li): move default slot documentation from class to property level (#11898)
The default slot documentation was moved from the class-level JSDoc comments to the actual slot property declaration for better clarity and consistency. This change improves documentation structure while maintaining the same functional behavior - the slot is still defined with `type: Node` and `"default": true`, which ensures that text content changes will properly trigger component invalidation as expected for Node-type slots. Relates to #11825
1 parent b284112 commit 95e00fd

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

packages/main/src/ListItemStandard.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ type ExpandableTextTemplate = (this: ListItemStandard, params: ExpandableTextTem
4242
* @csspart delete-button - Used to style the button rendered when the list item is in delete mode
4343
* @csspart radio - Used to style the radio button rendered when the list item is in single selection mode
4444
* @csspart checkbox - Used to style the checkbox rendered when the list item is in multiple selection mode
45-
* @slot {Node[]} default - Defines the custom formatted text of the component.
46-
*
47-
* **Note:** For optimal text wrapping and a consistent layout, it is strongly recommended to use the `text` property.
48-
*
49-
* Use the `default` slot only when custom formatting with HTML elements (e.g., `<b>`, `<i>`) is required.
50-
* Be aware that wrapping (via `wrappingType="Normal"`) may not function correctly with custom HTML content in the `default` slot.
51-
*
52-
* If both `text` and `default` slot are used, the `text` property takes precedence.
5345
* @constructor
5446
* @extends ListItem
5547
* @public
@@ -176,6 +168,20 @@ class ListItemStandard extends ListItem implements IAccessibleListItem {
176168
@property({ noAttribute: true })
177169
expandableTextTemplate?: ExpandableTextTemplate;
178170

171+
/**
172+
* Defines the custom formatted text of the component.
173+
*
174+
* **Note:** For optimal text wrapping and a consistent layout, it is strongly recommended to use the `text` property.
175+
*
176+
* Use the `default` slot only when custom formatting with HTML elements (e.g., `<b>`, `<i>`) is required.
177+
* Be aware that wrapping (via `wrappingType="Normal"`) may not function correctly with custom HTML content in the `default` slot.
178+
*
179+
* If both `text` and `default` slot are used, the `text` property takes precedence.
180+
* @public
181+
*/
182+
@slot({ type: Node, "default": true })
183+
content!: Array<Node>;
184+
179185
/**
180186
* **Note:** While the slot allows option for setting custom avatar, to match the
181187
* design guidelines, please use the `ui5-avatar` with it's default size - S.
@@ -198,7 +204,7 @@ class ListItemStandard extends ListItem implements IAccessibleListItem {
198204
// If feature is already loaded (preloaded by the user via importing ListItemStandardExpandableText.js), the template is already available
199205
if (ListItemStandard.ExpandableTextTemplate) {
200206
this.expandableTextTemplate = ListItemStandard.ExpandableTextTemplate;
201-
// If feature is not preloaded, load the template dynamically
207+
// If feature is not preloaded, load the template dynamically
202208
} else {
203209
import("./features/ListItemStandardExpandableTextTemplate.js").then(module => {
204210
this.expandableTextTemplate = module.default;

0 commit comments

Comments
 (0)