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.selected", {
selected: this.selected || "0",
@@ -476,27 +482,27 @@ export class HaTabsSubpageDataTable extends LitElement {
${Object.entries(this.columns).map(([id, column]) =>
column.groupable
? html`
-