) {
+ this._lineCount = Number(ev.detail.value);
}
static get styles(): CSSResultGroup {
@@ -148,6 +140,9 @@ class DownloadLogsDialog extends LitElement {
align-items: center;
gap: var(--ha-space-2);
}
+ ha-select {
+ width: 100%;
+ }
`,
];
}
diff --git a/src/panels/lovelace/editor/select-dashboard/hui-dialog-select-dashboard.ts b/src/panels/lovelace/editor/select-dashboard/hui-dialog-select-dashboard.ts
index d08aa45dc3..93b3f14e33 100644
--- a/src/panels/lovelace/editor/select-dashboard/hui-dialog-select-dashboard.ts
+++ b/src/panels/lovelace/editor/select-dashboard/hui-dialog-select-dashboard.ts
@@ -4,18 +4,17 @@ import { customElement, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-button";
import "../../../../components/ha-dialog-footer";
-import "../../../../components/ha-wa-dialog";
-import "../../../../components/ha-md-select";
-import "../../../../components/ha-md-select-option";
+import "../../../../components/ha-select";
import "../../../../components/ha-spinner";
+import "../../../../components/ha-wa-dialog";
import type { LovelaceConfig } from "../../../../data/lovelace/config/types";
import type { LovelaceDashboard } from "../../../../data/lovelace/dashboard";
import { fetchDashboards } from "../../../../data/lovelace/dashboard";
import { getDefaultPanelUrlPath } from "../../../../data/panel";
-import { haStyleDialog } from "../../../../resources/styles";
-import type { HomeAssistant } from "../../../../types";
-import type { SelectDashboardDialogParams } from "./show-select-dashboard-dialog";
import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box";
+import { haStyleDialog } from "../../../../resources/styles";
+import type { HomeAssistant, ValueChangedEvent } from "../../../../types";
+import type { SelectDashboardDialogParams } from "./show-select-dashboard-dialog";
@customElement("hui-dialog-select-dashboard")
export class HuiDialogSelectDashboard extends LitElement {
@@ -77,26 +76,22 @@ export class HuiDialogSelectDashboard extends LitElement {
>
${this._dashboards && !this._saving
? html`
-
- ${this._dashboards.map(
- (dashboard) => html`
- ${dashboard.title}
- `
- )}
-
+ .options=${this._dashboards.map((dashboard) => ({
+ value: dashboard.url_path,
+ label: dashboard.title,
+ disabled:
+ dashboard.mode !== "storage" ||
+ dashboard.url_path === this._fromUrlPath ||
+ (dashboard.url_path === "lovelace" &&
+ this._fromUrlPath === null),
+ }))}
+ >
`
: html`
@@ -167,8 +162,8 @@ export class HuiDialogSelectDashboard extends LitElement {
}
}
- private async _dashboardChanged(ev) {
- const urlPath: string = ev.target.value;
+ private async _dashboardChanged(ev: ValueChangedEvent) {
+ const urlPath = ev.detail.value;
if (urlPath === this._toUrlPath) {
return;
}
@@ -188,7 +183,7 @@ export class HuiDialogSelectDashboard extends LitElement {
return [
haStyleDialog,
css`
- ha-md-select {
+ ha-select {
width: 100%;
}
.loading {