mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-10 03:19:44 +00:00
Fix floor details area picker (#27827)
This commit is contained in:
@@ -87,6 +87,8 @@ export class HaAreaPicker extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public required = false;
|
@property({ type: Boolean }) public required = false;
|
||||||
|
|
||||||
|
@property({ attribute: "add-button-label" }) public addButtonLabel?: string;
|
||||||
|
|
||||||
@query("ha-generic-picker") private _picker?: HaGenericPicker;
|
@query("ha-generic-picker") private _picker?: HaGenericPicker;
|
||||||
|
|
||||||
public async open() {
|
public async open() {
|
||||||
@@ -375,6 +377,7 @@ export class HaAreaPicker extends LitElement {
|
|||||||
.getItems=${this._getItems}
|
.getItems=${this._getItems}
|
||||||
.getAdditionalItems=${this._getAdditionalItems}
|
.getAdditionalItems=${this._getAdditionalItems}
|
||||||
.valueRenderer=${valueRenderer}
|
.valueRenderer=${valueRenderer}
|
||||||
|
.addButtonLabel=${this.addButtonLabel}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
>
|
>
|
||||||
</ha-generic-picker>
|
</ha-generic-picker>
|
||||||
|
|||||||
@@ -8,24 +8,24 @@ import { fireEvent } from "../../../common/dom/fire_event";
|
|||||||
import "../../../components/chips/ha-chip-set";
|
import "../../../components/chips/ha-chip-set";
|
||||||
import "../../../components/chips/ha-input-chip";
|
import "../../../components/chips/ha-input-chip";
|
||||||
import "../../../components/ha-alert";
|
import "../../../components/ha-alert";
|
||||||
import "../../../components/ha-button";
|
|
||||||
import "../../../components/ha-aliases-editor";
|
import "../../../components/ha-aliases-editor";
|
||||||
|
import "../../../components/ha-area-picker";
|
||||||
|
import "../../../components/ha-button";
|
||||||
import { createCloseHeading } from "../../../components/ha-dialog";
|
import { createCloseHeading } from "../../../components/ha-dialog";
|
||||||
import "../../../components/ha-icon-picker";
|
import "../../../components/ha-icon-picker";
|
||||||
import "../../../components/ha-picture-upload";
|
import "../../../components/ha-picture-upload";
|
||||||
import "../../../components/ha-settings-row";
|
import "../../../components/ha-settings-row";
|
||||||
import "../../../components/ha-svg-icon";
|
import "../../../components/ha-svg-icon";
|
||||||
import "../../../components/ha-textfield";
|
import "../../../components/ha-textfield";
|
||||||
import "../../../components/ha-area-picker";
|
import { updateAreaRegistryEntry } from "../../../data/area_registry";
|
||||||
import type {
|
import type {
|
||||||
FloorRegistryEntry,
|
FloorRegistryEntry,
|
||||||
FloorRegistryEntryMutableParams,
|
FloorRegistryEntryMutableParams,
|
||||||
} from "../../../data/floor_registry";
|
} from "../../../data/floor_registry";
|
||||||
import { haStyle, haStyleDialog } from "../../../resources/styles";
|
import { haStyle, haStyleDialog } from "../../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../../types";
|
import type { HomeAssistant } from "../../../types";
|
||||||
import type { FloorRegistryDetailDialogParams } from "./show-dialog-floor-registry-detail";
|
|
||||||
import { showAreaRegistryDetailDialog } from "./show-dialog-area-registry-detail";
|
import { showAreaRegistryDetailDialog } from "./show-dialog-area-registry-detail";
|
||||||
import { updateAreaRegistryEntry } from "../../../data/area_registry";
|
import type { FloorRegistryDetailDialogParams } from "./show-dialog-floor-registry-detail";
|
||||||
|
|
||||||
class DialogFloorDetail extends LitElement {
|
class DialogFloorDetail extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
@@ -168,11 +168,6 @@ class DialogFloorDetail extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p class="description">
|
|
||||||
${this.hass.localize(
|
|
||||||
"ui.panel.config.floors.editor.areas_description"
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
${areas.length
|
${areas.length
|
||||||
? html`<ha-chip-set>
|
? html`<ha-chip-set>
|
||||||
${repeat(
|
${repeat(
|
||||||
@@ -197,13 +192,17 @@ class DialogFloorDetail extends LitElement {
|
|||||||
</ha-input-chip>`
|
</ha-input-chip>`
|
||||||
)}
|
)}
|
||||||
</ha-chip-set>`
|
</ha-chip-set>`
|
||||||
: nothing}
|
: html`<p class="description">
|
||||||
|
${this.hass.localize(
|
||||||
|
"ui.panel.config.floors.editor.areas_description"
|
||||||
|
)}
|
||||||
|
</p>`}
|
||||||
<ha-area-picker
|
<ha-area-picker
|
||||||
no-add
|
no-add
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@value-changed=${this._addArea}
|
@value-changed=${this._addArea}
|
||||||
.excludeAreas=${areas.map((a) => a.area_id)}
|
.excludeAreas=${areas.map((a) => a.area_id)}
|
||||||
.label=${this.hass.localize(
|
.addButtonLabel=${this.hass.localize(
|
||||||
"ui.panel.config.floors.editor.add_area"
|
"ui.panel.config.floors.editor.add_area"
|
||||||
)}
|
)}
|
||||||
></ha-area-picker>
|
></ha-area-picker>
|
||||||
|
|||||||
Reference in New Issue
Block a user