More granular control for row interaction catching and cursor (#10971)

This commit is contained in:
Philip Allgaier
2021-12-20 10:27:43 +01:00
committed by GitHub
parent 2f9c088091
commit 25ff5fef14
3 changed files with 23 additions and 7 deletions

View File

@@ -33,6 +33,13 @@ class HuiGenericEntityRow extends LitElement {
@property({ type: Boolean }) public hideName = false;
// Allows to control if this row should capture the user interaction, e.g. with its
// toggle switch, button or input field. Some domains dynamically decide what to show
// => static determination will not work => the caller has to pass the desired value in.
// Same applies for custom components that want to override the default behavior.
// Default behavior is controlled by DOMAINS_INPUT_ROW.
@property({ type: Boolean }) public catchInteraction?;
protected render(): TemplateResult {
if (!this.hass || !this.config) {
return html``;
@@ -147,7 +154,7 @@ class HuiGenericEntityRow extends LitElement {
: ""}
</div>`
: html``}
${!DOMAINS_INPUT_ROW.includes(domain)
${this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain)
? html` <div
class="text-content ${classMap({
pointer,