mirror of
https://github.com/material-components/material-web.git
synced 2024-11-11 06:10:17 +03:00
feat: Add supplementary text support.
PiperOrigin-RevId: 420353595
This commit is contained in:
parent
3acf905a3d
commit
bbf0901380
@ -67,7 +67,8 @@ export class ListItem extends LitElement {
|
||||
/** @soyTemplate */
|
||||
protected getRenderClasses(): ClassInfo {
|
||||
return {
|
||||
'md3-list-item--with-one-line': true,
|
||||
'md3-list-item--with-one-line': this.supportingText === '',
|
||||
'md3-list-item--with-two-lines': this.supportingText !== '',
|
||||
'md3-list-item--with-leading-icon': !!this.leadingIcon,
|
||||
'md3-list-item--with-leading-avatar': !!this.leadingAvatar,
|
||||
'md3-list-item--with-leading-thumbnail': !!this.leadingThumbnail,
|
||||
@ -90,9 +91,17 @@ export class ListItem extends LitElement {
|
||||
--><span class="md3-list-item__label"><!--
|
||||
--><slot @slotchange=${this.handleSlotChange}></slot><!--
|
||||
--></span><!--
|
||||
-->${this.supportingText !== '' ? this.renderSupportingText() : ''}<!--
|
||||
--></div>`;
|
||||
}
|
||||
|
||||
/** @soyTemplate */
|
||||
protected renderSupportingText(): TemplateResult {
|
||||
return html`<span class="md3-list-item__supporting-text"><!--
|
||||
-->${this.supportingText}<!--
|
||||
--></span>`;
|
||||
}
|
||||
|
||||
/** @soyTemplate */
|
||||
protected renderEnd(): TemplateResult {
|
||||
return html`<div class="md3-list-item__end"><!--
|
||||
|
Loading…
Reference in New Issue
Block a user