mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Use ha-ripple in ha-md-list-item (#27889)
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import { ListItemEl } from "@material/web/list/internal/listitem/list-item";
|
import { ListItemEl } from "@material/web/list/internal/listitem/list-item";
|
||||||
import { styles } from "@material/web/list/internal/listitem/list-item-styles";
|
import { styles } from "@material/web/list/internal/listitem/list-item-styles";
|
||||||
import { css } from "lit";
|
import { css, html, nothing, type TemplateResult } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
|
import "./ha-ripple";
|
||||||
|
|
||||||
export const haMdListStyles = [
|
export const haMdListStyles = [
|
||||||
styles,
|
styles,
|
||||||
@@ -25,6 +26,18 @@ export const haMdListStyles = [
|
|||||||
@customElement("ha-md-list-item")
|
@customElement("ha-md-list-item")
|
||||||
export class HaMdListItem extends ListItemEl {
|
export class HaMdListItem extends ListItemEl {
|
||||||
static override styles = haMdListStyles;
|
static override styles = haMdListStyles;
|
||||||
|
|
||||||
|
protected renderRipple(): TemplateResult | typeof nothing {
|
||||||
|
if (this.type === "text") {
|
||||||
|
return nothing;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html`<ha-ripple
|
||||||
|
part="ripple"
|
||||||
|
for="item"
|
||||||
|
?disabled=${this.disabled && this.type !== "link"}
|
||||||
|
></ha-ripple>`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
Reference in New Issue
Block a user