From d2194d55f9f6de15cdede6ebee95e2a959fe57fc Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:02:15 +0200 Subject: [PATCH] Rename ha-button-menu-new into ha-md-button-menu (#22016) * ha-button-menu-new => ha-md-button-menu * linting --- ...utton-menu-new.ts => ha-md-button-menu.ts} | 6 +- .../{ha-menu-item.ts => ha-md-menu-item.ts} | 6 +- src/components/ha-menu.ts | 4 +- src/layouts/hass-tabs-subpage-data-table.ts | 48 ++++--- .../config/automation/ha-automation-picker.ts | 122 +++++++++--------- .../devices/ha-config-devices-dashboard.ts | 44 +++---- .../config/entities/ha-config-entities.ts | 44 +++---- .../config/helpers/ha-config-helpers.ts | 42 +++--- .../ha-config-integration-page.ts | 56 ++++---- src/panels/config/scene/ha-scene-dashboard.ts | 64 ++++----- src/panels/config/script/ha-script-picker.ts | 64 ++++----- 11 files changed, 253 insertions(+), 247 deletions(-) rename src/components/{ha-button-menu-new.ts => ha-md-button-menu.ts} (94%) rename src/components/{ha-menu-item.ts => ha-md-menu-item.ts} (92%) diff --git a/src/components/ha-button-menu-new.ts b/src/components/ha-md-button-menu.ts similarity index 94% rename from src/components/ha-button-menu-new.ts rename to src/components/ha-md-button-menu.ts index 3ec12b11081a..a9445e0c219e 100644 --- a/src/components/ha-button-menu-new.ts +++ b/src/components/ha-md-button-menu.ts @@ -6,8 +6,8 @@ import type { HaIconButton } from "./ha-icon-button"; import "./ha-menu"; import type { HaMenu } from "./ha-menu"; -@customElement("ha-button-menu-new") -export class HaButtonMenuNew extends LitElement { +@customElement("ha-md-button-menu") +export class HaMdButtonMenu extends LitElement { protected readonly [FOCUS_TARGET]; @property({ type: Boolean }) public disabled = false; @@ -84,6 +84,6 @@ export class HaButtonMenuNew extends LitElement { declare global { interface HTMLElementTagNameMap { - "ha-button-menu-new": HaButtonMenuNew; + "ha-md-button-menu": HaMdButtonMenu; } } diff --git a/src/components/ha-menu-item.ts b/src/components/ha-md-menu-item.ts similarity index 92% rename from src/components/ha-menu-item.ts rename to src/components/ha-md-menu-item.ts index 2f2914859640..a8a7579f414a 100644 --- a/src/components/ha-menu-item.ts +++ b/src/components/ha-md-menu-item.ts @@ -2,8 +2,8 @@ import { MdMenuItem } from "@material/web/menu/menu-item"; import { css } from "lit"; import { customElement, property } from "lit/decorators"; -@customElement("ha-menu-item") -export class HaMenuItem extends MdMenuItem { +@customElement("ha-md-menu-item") +export class HaMdMenuItem extends MdMenuItem { @property({ attribute: false }) clickAction?: (item?: HTMLElement) => void; static override styles = [ @@ -41,6 +41,6 @@ export class HaMenuItem extends MdMenuItem { declare global { interface HTMLElementTagNameMap { - "ha-menu-item": HaMenuItem; + "ha-md-menu-item": HaMdMenuItem; } } diff --git a/src/components/ha-menu.ts b/src/components/ha-menu.ts index 06e1de186329..053d012163c8 100644 --- a/src/components/ha-menu.ts +++ b/src/components/ha-menu.ts @@ -6,7 +6,7 @@ import { } from "@material/web/menu/internal/controllers/shared"; import { css } from "lit"; import { customElement } from "lit/decorators"; -import type { HaMenuItem } from "./ha-menu-item"; +import type { HaMdMenuItem } from "./ha-md-menu-item"; @customElement("ha-menu") export class HaMenu extends MdMenu { @@ -22,7 +22,7 @@ export class HaMenu extends MdMenu { ) { return; } - (ev.detail.initiator as HaMenuItem).clickAction?.(ev.detail.initiator); + (ev.detail.initiator as HaMdMenuItem).clickAction?.(ev.detail.initiator); } static override styles = [ diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 8d88db443a58..0dc42d781386 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -35,10 +35,10 @@ import type { HaDataTable, SortingDirection, } from "../components/data-table/ha-data-table"; -import "../components/ha-button-menu-new"; +import "../components/ha-md-button-menu"; import "../components/ha-dialog"; import { HaMenu } from "../components/ha-menu"; -import "../components/ha-menu-item"; +import "../components/ha-md-menu-item"; import "../components/search-input-outlined"; import type { HomeAssistant, Route } from "../types"; import "./hass-tabs-subpage"; @@ -330,7 +330,7 @@ export class HaTabsSubpageDataTable extends LitElement { "ui.components.subpage-data-table.exit_selection_mode" )} > - + - +
${localize("ui.components.subpage-data-table.select_all")}
-
- + +
${localize( "ui.components.subpage-data-table.select_none" )}
-
+ - @@ -368,8 +374,8 @@ export class HaTabsSubpageDataTable extends LitElement { "ui.components.subpage-data-table.close_select_mode" )} - -
+ +

${localize("ui.components.subpage-data-table.selected", { selected: this.selected || "0", @@ -476,27 +482,27 @@ export class HaTabsSubpageDataTable extends LitElement { ${Object.entries(this.columns).map(([id, column]) => column.groupable ? html` - ${column.title || column.label} - + ` : nothing )} - ${localize("ui.components.subpage-data-table.dont_group_by")} - + - @@ -505,8 +511,8 @@ export class HaTabsSubpageDataTable extends LitElement { .path=${mdiUnfoldLessHorizontal} > ${localize("ui.components.subpage-data-table.collapse_all_groups")} - - + @@ -515,13 +521,13 @@ export class HaTabsSubpageDataTable extends LitElement { .path=${mdiUnfoldMoreHorizontal} > ${localize("ui.components.subpage-data-table.expand_all_groups")} - + ${Object.entries(this.columns).map(([id, column]) => column.sortable ? html` - + ` : nothing )} @@ -893,7 +899,7 @@ export class HaTabsSubpageDataTable extends LitElement { #sort-by-anchor, #group-by-anchor, - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } `; diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index e86e7ed568da..58a1d574d92a 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -67,8 +67,8 @@ import "../../../components/ha-icon-button"; import "../../../components/ha-icon-overflow-menu"; import "../../../components/ha-menu"; import type { HaMenu } from "../../../components/ha-menu"; -import "../../../components/ha-menu-item"; -import type { HaMenuItem } from "../../../components/ha-menu-item"; +import "../../../components/ha-md-menu-item"; +import type { HaMdMenuItem } from "../../../components/ha-md-menu-item"; import "../../../components/ha-sub-menu"; import "../../../components/ha-svg-icon"; import { createAreaRegistryEntry } from "../../../data/area_registry"; @@ -403,7 +403,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { protected render(): TemplateResult { const categoryItems = html`${this._categories?.map( (category) => - html` @@ -411,21 +411,21 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { ? html`` : html``}

${category.name}
- ` + ` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" )}
-
+ - +
${this.hass.localize("ui.panel.config.category.editor.add")}
-
`; + `; const labelItems = html`${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; @@ -437,7 +437,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { this._selected.some((entityId) => this.hass.entities[entityId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")} -
`; const areaItems = html`${Object.values(this.hass.areas).map( (area) => - html` @@ -477,23 +477,23 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { .path=${mdiTextureBox} >`}
${area.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" )}
-
+ - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" )}
-
`; + `; const areasInOverflow = (this._sizeController.value && this._sizeController.value < 900) || @@ -633,7 +633,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { > ${ !this.narrow - ? html` + ? html` ${categoryItems} - + ${labelsInOverflow ? nothing - : html` + : html` ${labelItems} - `} + `} ${areasInOverflow ? nothing - : html` + : html` ${areaItems} - `}` + `}` : nothing } - + ${ this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.move_category" @@ -719,7 +719,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${categoryItems} ` : nothing @@ -727,7 +727,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { ${ this.narrow || labelsInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" @@ -737,7 +737,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${labelItems} ` : nothing @@ -745,7 +745,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { ${ this.narrow || areasInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.move_area" @@ -755,20 +755,20 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${areaItems} ` : nothing } - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.enable" )}
-
- + + - - + + ${ !this.automations.length ? html`
@@ -827,7 +827,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { - + ${this.hass.localize("ui.panel.config.automation.editor.show_info")}
- + - +
${this.hass.localize( "ui.panel.config.automation.picker.show_settings" )}
-
- + +
${this.hass.localize( `ui.panel.config.automation.picker.${this._overflowAutomation?.category ? "edit_category" : "assign_category"}` )}
-
- + +
${this.hass.localize("ui.panel.config.automation.editor.run")}
-
- + +
${this.hass.localize( "ui.panel.config.automation.editor.show_trace" )}
-
+ - +
${this.hass.localize("ui.panel.config.automation.picker.duplicate")}
-
- + + - - + +
${this.hass.localize("ui.panel.config.automation.picker.delete")}
-
+ `; } @@ -1056,13 +1056,13 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { this._applyFilters(); } - private _showInfo = (item: HaMenuItem) => { + private _showInfo = (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; fireEvent(this, "hass-more-info", { entityId: automation.entity_id }); }; - private _showSettings = (item: HaMenuItem) => { + private _showSettings = (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1072,14 +1072,14 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { }); }; - private _runActions = (item: HaMenuItem) => { + private _runActions = (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; triggerAutomationActions(this.hass, automation.entity_id); }; - private _editCategory = (item: HaMenuItem) => { + private _editCategory = (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1103,7 +1103,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { }); }; - private _showTrace = (item: HaMenuItem) => { + private _showTrace = (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1120,7 +1120,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { ); }; - private _toggle = async (item: HaMenuItem): Promise => { + private _toggle = async (item: HaMdMenuItem): Promise => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1130,7 +1130,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { }); }; - private _deleteConfirm = async (item: HaMenuItem) => { + private _deleteConfirm = async (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1167,7 +1167,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { } } - private _duplicate = async (item: HaMenuItem) => { + private _duplicate = async (item: HaMdMenuItem) => { const automation = ((item.parentElement as HaMenu)!.anchorElement as any)! .automation; @@ -1455,7 +1455,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label { diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index a4744166fde3..9abe711e797f 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -54,7 +54,7 @@ import "../../../components/ha-filter-integrations"; import "../../../components/ha-filter-labels"; import "../../../components/ha-filter-states"; import "../../../components/ha-icon-button"; -import "../../../components/ha-menu-item"; +import "../../../components/ha-md-menu-item"; import "../../../components/ha-sub-menu"; import { createAreaRegistryEntry } from "../../../data/area_registry"; import { ConfigEntry, sortConfigEntries } from "../../../data/config_entries"; @@ -629,7 +629,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { const areaItems = html`${Object.values(this.hass.areas).map( (area) => - html` @@ -640,23 +640,23 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { .path=${mdiTextureBox} >`}
${area.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" )}
-
+ - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" )}
-
`; + `; const labelItems = html`${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; @@ -668,7 +668,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { this._selected.some((deviceId) => this.hass.devices[deviceId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")} -
`; return html` @@ -802,7 +802,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { > ${!this.narrow - ? html` + ? html` ${labelItems} - + ${areasInOverflow ? nothing - : html` + : html` ${areaItems} - `}` + `}` : nothing} ${this.narrow || areasInOverflow - ? html` + ? html` ${this.narrow ? html``} ${this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" @@ -865,12 +865,12 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${labelItems} ` : nothing} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.move_area" @@ -880,10 +880,10 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${areaItems} - ` + ` : nothing} `; @@ -1100,7 +1100,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label { diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index e1fe064d2c85..5d3f69aaf0eb 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -60,7 +60,7 @@ import "../../../components/ha-filter-labels"; import "../../../components/ha-filter-states"; import "../../../components/ha-icon"; import "../../../components/ha-icon-button"; -import "../../../components/ha-menu-item"; +import "../../../components/ha-md-menu-item"; import "../../../components/ha-sub-menu"; import "../../../components/ha-svg-icon"; import { ConfigEntry, getConfigEntries } from "../../../data/config_entries"; @@ -700,7 +700,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { this._selected.some((entityId) => this.hass.entities[entityId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")} -
`; return html` @@ -782,7 +782,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { ${ !this.narrow - ? html` + ? html` ${labelItems} - ` + ` : nothing } - + ${ this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" )}
-
+ ${labelItems} ` : nothing } - +
${this.hass.localize( "ui.panel.config.entities.picker.enable_selected.button" )}
-
- + + - + - + - - + + - + - + - + -
+ ${ Array.isArray(this._filters.config_entry) && this._filters.config_entry?.length @@ -1454,7 +1454,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label { diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 48b6cfd461e2..24a20c8fe9a7 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -479,7 +479,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { const categoryItems = html`${this._categories?.map( (category) => - html` @@ -487,21 +487,21 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { ? html`` : html``}
${category.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" )}
-
+ - +
${this.hass.localize("ui.panel.config.category.editor.add")}
-
`; + `; const labelItems = html`${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; const selected = this._selected.every((entityId) => @@ -512,7 +512,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { this._selected.some((entityId) => this.hass.entities[entityId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")}
-
`; + `; const labelsInOverflow = (this._sizeController.value && this._sizeController.value < 700) || (!this._sizeController.value && this.hass.dockedSidebar === "docked"); @@ -637,7 +637,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { > ${!this.narrow - ? html` + ? html` ${categoryItems} - + ${labelsInOverflow ? nothing - : html` + : html` ${labelItems} - `}` + `}` : nothing} ${this.narrow || labelsInOverflow ? html` - + ${ this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.move_category" @@ -708,7 +708,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${categoryItems} ` : nothing @@ -716,7 +716,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { ${ this.narrow || this.hass.dockedSidebar === "docked" ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" @@ -726,12 +726,12 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${labelItems} ` : nothing } - ` + ` : nothing} ` : ""} - + ${item.supports_options && stateText - ? html` + ? html` ${this.hass.localize( "ui.panel.config.integrations.config_entry.configure" )} - ` + ` : ""} ${item.disabled_by && devices.length ? html` - - + ` : ""} ${item.disabled_by && services.length - ? html` - ` + ` : ""} ${item.disabled_by && entities.length ? html` - - + ` : ""} ${!item.disabled_by && @@ -866,27 +866,27 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { item.supports_unload && item.source !== "system" ? html` - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.reload" )} - + ` : nothing} - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.rename" )} - + ${this._diagnosticHandler && item.state === "loaded" ? html` - + ` : ""} ${!item.disabled_by && item.supports_reconfigure && item.source !== "system" ? html` - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.reconfigure" )} - + ` : nothing} - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.system_options" )} - + ${item.disabled_by === "user" ? html` - + ${this.hass.localize("ui.common.enable")} - + ` : item.source !== "system" ? html` - ${this.hass.localize("ui.common.disable")} - + ` : nothing} ${item.source !== "system" ? html` - + + ` : nothing} - + `; } diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index ebb46d16e551..3f936f626b97 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -58,7 +58,7 @@ import "../../../components/ha-filter-floor-areas"; import "../../../components/ha-filter-labels"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-overflow-menu"; -import "../../../components/ha-menu-item"; +import "../../../components/ha-md-menu-item"; import "../../../components/ha-state-icon"; import "../../../components/ha-sub-menu"; import "../../../components/ha-svg-icon"; @@ -423,7 +423,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { protected render(): TemplateResult { const categoryItems = html`${this._categories?.map( (category) => - html` @@ -431,21 +431,21 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { ? html`` : html``}
${category.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" )}
-
+ - +
${this.hass.localize("ui.panel.config.category.editor.add")}
-
`; + `; const labelItems = html` ${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; @@ -457,7 +457,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { this._selected.some((entityId) => this.hass.entities[entityId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")} -
`; const areaItems = html`${Object.values(this.hass.areas).map( (area) => - html` @@ -497,23 +497,23 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { .path=${mdiTextureBox} >`}
${area.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" )}
-
+ - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" )}
-
`; + `; const areasInOverflow = (this._sizeController.value && this._sizeController.value < 900) || @@ -637,7 +637,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { > ${!this.narrow - ? html` + ? html` ${categoryItems} - + ${labelsInOverflow ? nothing - : html` + : html` ${labelItems} - `} + `} ${areasInOverflow ? nothing - : html` + : html` ${areaItems} - `}` + `}` : nothing} ${this.narrow || areasInOverflow ? html` - + ${ this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.move_category" @@ -724,7 +724,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${categoryItems} ` : nothing @@ -732,7 +732,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { ${ this.narrow || labelsInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" @@ -742,7 +742,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${labelItems} ` : nothing @@ -750,7 +750,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { ${ this.narrow || areasInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.move_area" @@ -760,12 +760,12 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${areaItems} ` : nothing } - ` + ` : nothing} ${!this.scenes.length ? html`
@@ -1204,7 +1204,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label { diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index df26ed94b054..aa8d50daa9fa 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -59,7 +59,7 @@ import "../../../components/ha-filter-floor-areas"; import "../../../components/ha-filter-labels"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-overflow-menu"; -import "../../../components/ha-menu-item"; +import "../../../components/ha-md-menu-item"; import "../../../components/ha-sub-menu"; import "../../../components/ha-svg-icon"; import { createAreaRegistryEntry } from "../../../data/area_registry"; @@ -413,7 +413,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { protected render(): TemplateResult { const categoryItems = html`${this._categories?.map( (category) => - html` @@ -421,20 +421,20 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { ? html`` : html``}
${category.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" )} -
- +
${this.hass.localize("ui.panel.config.category.editor.add")}
-
`; + `; const labelItems = html`${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; @@ -446,7 +446,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { this._selected.some((entityId) => this.hass.entities[entityId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")} -
`; const areaItems = html`${Object.values(this.hass.areas).map( (area) => - html` @@ -486,23 +486,23 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { .path=${mdiTextureBox} >`}
${area.name}
-
` + ` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" )}
-
+ - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" )}
-
`; + `; const areasInOverflow = (this._sizeController.value && this._sizeController.value < 900) || @@ -635,7 +635,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { > ${!this.narrow - ? html` + ? html` ${categoryItems} - + ${labelsInOverflow ? nothing - : html` + : html` ${labelItems} - `} + `} ${areasInOverflow ? nothing - : html` + : html` ${areaItems} - `}` + `}` : nothing} ${this.narrow || areasInOverflow ? html` - + ${ this.narrow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.move_category" @@ -722,7 +722,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${categoryItems} ` : nothing @@ -730,7 +730,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { ${ this.narrow || labelsInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.add_label" @@ -740,7 +740,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${labelItems} ` : nothing @@ -748,7 +748,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { ${ this.narrow || areasInOverflow ? html` - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.move_area" @@ -758,12 +758,12 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { slot="end" .path=${mdiChevronRight} > - + ${areaItems} ` : nothing } - ` + ` : nothing} ${!this.scripts.length ? html`
@@ -1295,7 +1295,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-button-menu-new ha-assist-chip { + ha-md-button-menu ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label {