mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Avoid generic entity row with control to open more info (#25068)
This commit is contained in:
parent
7e0f293d1f
commit
65dae09a49
@ -4,6 +4,7 @@ import { customElement, property } from "lit/decorators";
|
|||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
import { ifDefined } from "lit/directives/if-defined";
|
import { ifDefined } from "lit/directives/if-defined";
|
||||||
import { DOMAINS_INPUT_ROW } from "../../../common/const";
|
import { DOMAINS_INPUT_ROW } from "../../../common/const";
|
||||||
|
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
||||||
import { toggleAttribute } from "../../../common/dom/toggle_attribute";
|
import { toggleAttribute } from "../../../common/dom/toggle_attribute";
|
||||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
import { computeStateName } from "../../../common/entity/compute_state_name";
|
||||||
@ -152,19 +153,12 @@ export class HuiGenericEntityRow extends LitElement {
|
|||||||
</div>`
|
</div>`
|
||||||
: nothing}
|
: nothing}
|
||||||
${(this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain))
|
${(this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain))
|
||||||
? html`<div
|
? html`
|
||||||
class="text-content value ${classMap({
|
<div class="text-content value">
|
||||||
pointer,
|
<div class="state"><slot></slot></div>
|
||||||
})}"
|
</div>
|
||||||
@action=${this._handleAction}
|
`
|
||||||
.actionHandler=${actionHandler({
|
: html`<slot @action=${stopPropagation}></slot>`}
|
||||||
hasHold: hasAction(this.config!.hold_action),
|
|
||||||
hasDoubleClick: hasAction(this.config!.double_tap_action),
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<div class="state"><slot></slot></div>
|
|
||||||
</div>`
|
|
||||||
: html`<slot></slot>`}
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user