mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Do not display no areas in entity pickers (#25317)
This commit is contained in:
parent
fb3a59272d
commit
4ec5fbc9a4
@ -314,9 +314,7 @@ export class HaEntityComboBox extends LitElement {
|
||||
...hass!.states[entityId],
|
||||
label: "",
|
||||
primary: primary,
|
||||
secondary:
|
||||
secondary ||
|
||||
this.hass.localize("ui.components.device-picker.no_area"),
|
||||
secondary: secondary,
|
||||
translated_domain: translatedDomain,
|
||||
sorting_label: [deviceName, entityName].filter(Boolean).join("-"),
|
||||
entity_name: entityName || deviceName,
|
||||
|
@ -162,10 +162,7 @@ export class HaEntityPicker extends LitElement {
|
||||
slot="start"
|
||||
></state-badge>
|
||||
<span slot="headline">${primary}</span>
|
||||
<span slot="supporting-text">
|
||||
${secondary ||
|
||||
this.hass.localize("ui.components.device-picker.no_area")}
|
||||
</span>
|
||||
<span slot="supporting-text">${secondary}</span>
|
||||
${showClearIcon
|
||||
? html`<ha-icon-button
|
||||
class="clear"
|
||||
|
@ -358,6 +358,7 @@ export class QuickBar extends LitElement {
|
||||
private _renderDeviceItem(item: DeviceItem, index?: number) {
|
||||
return html`
|
||||
<ha-md-list-item
|
||||
class="two-line"
|
||||
.item=${item}
|
||||
index=${ifDefined(index)}
|
||||
tabindex="0"
|
||||
@ -376,6 +377,7 @@ export class QuickBar extends LitElement {
|
||||
|
||||
return html`
|
||||
<ha-md-list-item
|
||||
class=${showEntityId ? "three-line" : "two-line"}
|
||||
.item=${item}
|
||||
index=${ifDefined(index)}
|
||||
tabindex="0"
|
||||
@ -621,9 +623,7 @@ export class QuickBar extends LitElement {
|
||||
|
||||
const entityItem = {
|
||||
primaryText: primary,
|
||||
altText:
|
||||
secondary ||
|
||||
this.hass.localize("ui.components.device-picker.no_area"),
|
||||
altText: secondary,
|
||||
icon: html`
|
||||
<ha-state-icon
|
||||
.hass=${this.hass}
|
||||
@ -1021,6 +1021,23 @@ export class QuickBar extends LitElement {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Fixed height for items because we are use virtualizer */
|
||||
ha-md-list-item.two-line {
|
||||
--md-list-item-one-line-container-height: 64px;
|
||||
--md-list-item-two-line-container-height: 64px;
|
||||
--md-list-item-top-space: 8px;
|
||||
--md-list-item-bottom-space: 8px;
|
||||
}
|
||||
|
||||
ha-md-list-item.three-line {
|
||||
width: 100%;
|
||||
--md-list-item-one-line-container-height: 72px;
|
||||
--md-list-item-two-line-container-height: 72px;
|
||||
--md-list-item-three-line-container-height: 72px;
|
||||
--md-list-item-top-space: 8px;
|
||||
--md-list-item-bottom-space: 8px;
|
||||
}
|
||||
|
||||
ha-tip {
|
||||
padding: 20px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user