mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-12 04:20:28 +00:00
Improve styling of ZHA manage device dialog (#27556)
This commit is contained in:
committed by
GitHub
parent
904a083f61
commit
80b92b9813
@@ -6,6 +6,7 @@ import { showConfirmationDialog } from "../../dialogs/generic/show-dialog-box";
|
|||||||
import "./ha-progress-button";
|
import "./ha-progress-button";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
|
import type { Appearance } from "../ha-button";
|
||||||
|
|
||||||
@customElement("ha-call-service-button")
|
@customElement("ha-call-service-button")
|
||||||
class HaCallServiceButton extends LitElement {
|
class HaCallServiceButton extends LitElement {
|
||||||
@@ -25,12 +26,14 @@ class HaCallServiceButton extends LitElement {
|
|||||||
|
|
||||||
@property() public confirmation?;
|
@property() public confirmation?;
|
||||||
|
|
||||||
|
@property() public appearance: Appearance = "plain";
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
.progress=${this.progress}
|
.progress=${this.progress}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
appearance="plain"
|
.appearance=${this.appearance}
|
||||||
@click=${this._buttonTapped}
|
@click=${this._buttonTapped}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -220,6 +220,9 @@ class DialogZHAManageZigbeeDevice extends LitElement {
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--ha-space-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 600px) and (min-height: 501px) {
|
@media all and (min-width: 600px) and (min-height: 501px) {
|
||||||
|
|||||||
@@ -117,15 +117,6 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
></ha-textfield>
|
></ha-textfield>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<ha-progress-button
|
|
||||||
@click=${this._onGetZigbeeAttributeClick}
|
|
||||||
.progress=${this._readingAttribute}
|
|
||||||
.disabled=${this._readingAttribute}
|
|
||||||
>
|
|
||||||
${this.hass!.localize(
|
|
||||||
"ui.panel.config.zha.cluster_attributes.read_zigbee_attribute"
|
|
||||||
)}
|
|
||||||
</ha-progress-button>
|
|
||||||
<ha-call-service-button
|
<ha-call-service-button
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
domain="zha"
|
domain="zha"
|
||||||
@@ -136,6 +127,15 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
"ui.panel.config.zha.cluster_attributes.write_zigbee_attribute"
|
"ui.panel.config.zha.cluster_attributes.write_zigbee_attribute"
|
||||||
)}
|
)}
|
||||||
</ha-call-service-button>
|
</ha-call-service-button>
|
||||||
|
<ha-progress-button
|
||||||
|
@click=${this._onGetZigbeeAttributeClick}
|
||||||
|
.progress=${this._readingAttribute}
|
||||||
|
.disabled=${this._readingAttribute}
|
||||||
|
>
|
||||||
|
${this.hass!.localize(
|
||||||
|
"ui.panel.config.zha.cluster_attributes.read_zigbee_attribute"
|
||||||
|
)}
|
||||||
|
</ha-progress-button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -230,6 +230,10 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
css`
|
css`
|
||||||
|
ha-card {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
ha-select {
|
ha-select {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
@@ -263,6 +267,12 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
.header {
|
.header {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: var(--ha-space-1);
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
service="issue_zigbee_cluster_command"
|
service="issue_zigbee_cluster_command"
|
||||||
.data=${this._issueClusterCommandServiceData}
|
.data=${this._issueClusterCommandServiceData}
|
||||||
.disabled=${!this._canIssueCommand}
|
.disabled=${!this._canIssueCommand}
|
||||||
|
appearance="accent"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zha.cluster_commands.issue_zigbee_command"
|
"ui.panel.config.zha.cluster_commands.issue_zigbee_command"
|
||||||
@@ -187,6 +188,10 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
css`
|
css`
|
||||||
|
ha-card {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
ha-select {
|
ha-select {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
@@ -239,6 +244,11 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
padding-inline-start: initial;
|
padding-inline-start: initial;
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,15 @@ export class ZHADeviceBindingControl extends LitElement {
|
|||||||
</ha-select>
|
</ha-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
|
<ha-progress-button
|
||||||
|
@click=${this._onUnbindDevicesClick}
|
||||||
|
.disabled=${!(this._deviceToBind && this.device) ||
|
||||||
|
this._bindingOperationInProgress}
|
||||||
|
variant="danger"
|
||||||
|
appearance="plain"
|
||||||
|
>
|
||||||
|
${this.hass!.localize("ui.panel.config.zha.device_binding.unbind")}
|
||||||
|
</ha-progress-button>
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
@click=${this._onBindDevicesClick}
|
@click=${this._onBindDevicesClick}
|
||||||
.disabled=${!(this._deviceToBind && this.device) ||
|
.disabled=${!(this._deviceToBind && this.device) ||
|
||||||
@@ -67,13 +76,6 @@ export class ZHADeviceBindingControl extends LitElement {
|
|||||||
>
|
>
|
||||||
${this.hass!.localize("ui.panel.config.zha.device_binding.bind")}
|
${this.hass!.localize("ui.panel.config.zha.device_binding.bind")}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
<ha-progress-button
|
|
||||||
@click=${this._onUnbindDevicesClick}
|
|
||||||
.disabled=${!(this._deviceToBind && this.device) ||
|
|
||||||
this._bindingOperationInProgress}
|
|
||||||
>
|
|
||||||
${this.hass!.localize("ui.panel.config.zha.device_binding.unbind")}
|
|
||||||
</ha-progress-button>
|
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`;
|
`;
|
||||||
@@ -133,6 +135,10 @@ export class ZHADeviceBindingControl extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding-top: var(--ha-space-2);
|
||||||
|
}
|
||||||
|
|
||||||
.command-picker {
|
.command-picker {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
@@ -145,6 +151,11 @@ export class ZHADeviceBindingControl extends LitElement {
|
|||||||
.header {
|
.header {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: var(--ha-space-1);
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,23 +85,24 @@ export class ZHAGroupBindingControl extends LitElement {
|
|||||||
></zha-clusters-data-table>
|
></zha-clusters-data-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<ha-progress-button
|
|
||||||
@click=${this._onBindGroupClick}
|
|
||||||
.disabled=${!this._canBind || this._bindingOperationInProgress}
|
|
||||||
>
|
|
||||||
${this.hass!.localize(
|
|
||||||
"ui.panel.config.zha.group_binding.bind_button_label"
|
|
||||||
)}
|
|
||||||
</ha-progress-button>
|
|
||||||
|
|
||||||
<ha-progress-button
|
<ha-progress-button
|
||||||
@click=${this._onUnbindGroupClick}
|
@click=${this._onUnbindGroupClick}
|
||||||
.disabled=${!this._canBind || this._bindingOperationInProgress}
|
.disabled=${!this._canBind || this._bindingOperationInProgress}
|
||||||
|
variant="danger"
|
||||||
|
appearance="plain"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zha.group_binding.unbind_button_label"
|
"ui.panel.config.zha.group_binding.unbind_button_label"
|
||||||
)}
|
)}
|
||||||
</ha-progress-button>
|
</ha-progress-button>
|
||||||
|
<ha-progress-button
|
||||||
|
@click=${this._onBindGroupClick}
|
||||||
|
.disabled=${!this._canBind || this._bindingOperationInProgress}
|
||||||
|
>
|
||||||
|
${this.hass!.localize(
|
||||||
|
"ui.panel.config.zha.group_binding.bind_button_label"
|
||||||
|
)}
|
||||||
|
</ha-progress-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
</ha-config-section>
|
</ha-config-section>
|
||||||
@@ -205,6 +206,10 @@ export class ZHAGroupBindingControl extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding-top: var(--ha-space-2);
|
||||||
|
}
|
||||||
|
|
||||||
.command-picker {
|
.command-picker {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
@@ -225,6 +230,12 @@ export class ZHAGroupBindingControl extends LitElement {
|
|||||||
.sectionHeader {
|
.sectionHeader {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: var(--ha-space-1);
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user