mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Use ha-state-icon for add from target entity icon (#28551)
This commit is contained in:
@@ -20,13 +20,13 @@ import { computeAreaName } from "../../../../common/entity/compute_area_name";
|
|||||||
import { computeDeviceName } from "../../../../common/entity/compute_device_name";
|
import { computeDeviceName } from "../../../../common/entity/compute_device_name";
|
||||||
import { computeEntityNameList } from "../../../../common/entity/compute_entity_name_display";
|
import { computeEntityNameList } from "../../../../common/entity/compute_entity_name_display";
|
||||||
import { stringCompare } from "../../../../common/string/compare";
|
import { stringCompare } from "../../../../common/string/compare";
|
||||||
import "../../../../components/entity/state-badge";
|
|
||||||
import "../../../../components/ha-floor-icon";
|
import "../../../../components/ha-floor-icon";
|
||||||
import "../../../../components/ha-icon";
|
import "../../../../components/ha-icon";
|
||||||
import "../../../../components/ha-icon-next";
|
import "../../../../components/ha-icon-next";
|
||||||
import "../../../../components/ha-md-list";
|
import "../../../../components/ha-md-list";
|
||||||
import "../../../../components/ha-md-list-item";
|
import "../../../../components/ha-md-list-item";
|
||||||
import "../../../../components/ha-section-title";
|
import "../../../../components/ha-section-title";
|
||||||
|
import "../../../../components/ha-state-icon";
|
||||||
import "../../../../components/ha-svg-icon";
|
import "../../../../components/ha-svg-icon";
|
||||||
import {
|
import {
|
||||||
getAreasNestedInFloors,
|
getAreasNestedInFloors,
|
||||||
@@ -779,11 +779,11 @@ export default class HaAutomationAddFromTarget extends LitElement {
|
|||||||
|
|
||||||
private _renderEntityIcon =
|
private _renderEntityIcon =
|
||||||
(stateObj: HassEntity) => (slot: string | undefined) =>
|
(stateObj: HassEntity) => (slot: string | undefined) =>
|
||||||
html`<state-badge
|
html`<ha-state-icon
|
||||||
|
.hass=${this.hass}
|
||||||
slot=${ifDefined(slot)}
|
slot=${ifDefined(slot)}
|
||||||
.stateObj=${stateObj}
|
.stateObj=${stateObj}
|
||||||
.hass=${this.hass}
|
></ha-state-icon>`;
|
||||||
></state-badge>`;
|
|
||||||
|
|
||||||
private _renderItem(
|
private _renderItem(
|
||||||
label: string,
|
label: string,
|
||||||
@@ -1435,6 +1435,7 @@ export default class HaAutomationAddFromTarget extends LitElement {
|
|||||||
|
|
||||||
ha-svg-icon,
|
ha-svg-icon,
|
||||||
ha-icon,
|
ha-icon,
|
||||||
|
ha-state-icon,
|
||||||
ha-floor-icon {
|
ha-floor-icon {
|
||||||
padding: var(--ha-space-1);
|
padding: var(--ha-space-1);
|
||||||
color: var(--ha-color-on-neutral-quiet);
|
color: var(--ha-color-on-neutral-quiet);
|
||||||
@@ -1459,13 +1460,6 @@ export default class HaAutomationAddFromTarget extends LitElement {
|
|||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
wa-tree-item[selected],
|
|
||||||
wa-tree-item[selected] > ha-svg-icon,
|
|
||||||
wa-tree-item[selected] > ha-icon,
|
|
||||||
wa-tree-item[selected] > ha-floor-icon {
|
|
||||||
color: var(--ha-color-on-primary-normal);
|
|
||||||
}
|
|
||||||
|
|
||||||
wa-tree-item[selected]::part(item):hover {
|
wa-tree-item[selected]::part(item):hover {
|
||||||
background-color: var(--ha-color-fill-primary-normal-hover);
|
background-color: var(--ha-color-fill-primary-normal-hover);
|
||||||
}
|
}
|
||||||
@@ -1490,6 +1484,11 @@ export default class HaAutomationAddFromTarget extends LitElement {
|
|||||||
--icon-primary-color: var(--ha-color-on-primary-normal);
|
--icon-primary-color: var(--ha-color-on-primary-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wa-tree-item[selected],
|
||||||
|
wa-tree-item[selected] > ha-svg-icon,
|
||||||
|
wa-tree-item[selected] > ha-icon,
|
||||||
|
wa-tree-item[selected] > ha-state-icon,
|
||||||
|
wa-tree-item[selected] > ha-floor-icon,
|
||||||
ha-md-list-item.selected ha-icon,
|
ha-md-list-item.selected ha-icon,
|
||||||
ha-md-list-item.selected ha-svg-icon {
|
ha-md-list-item.selected ha-svg-icon {
|
||||||
color: var(--ha-color-on-primary-normal);
|
color: var(--ha-color-on-primary-normal);
|
||||||
|
|||||||
Reference in New Issue
Block a user