mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +00:00
static styles (#2533)
This commit is contained in:
parent
a2816800e8
commit
334c4fe90f
@ -1,18 +1,18 @@
|
|||||||
import "@polymer/app-layout/app-header/app-header";
|
import "@polymer/app-layout/app-header/app-header";
|
||||||
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-icon-button/paper-icon-button";
|
import "@polymer/paper-icon-button/paper-icon-button";
|
||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
import { HASSDomEvent } from "../../../common/dom/fire_event";
|
import { HASSDomEvent } from "../../../common/dom/fire_event";
|
||||||
import { Cluster } from "../../../data/zha";
|
import { Cluster } from "../../../data/zha";
|
||||||
import "../../../layouts/ha-app-layout";
|
import "../../../layouts/ha-app-layout";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import {
|
import {
|
||||||
ZHAClusterSelectedParams,
|
ZHAClusterSelectedParams,
|
||||||
@ -27,8 +27,6 @@ import "./zha-node";
|
|||||||
export class HaConfigZha extends LitElement {
|
export class HaConfigZha extends LitElement {
|
||||||
public hass?: HomeAssistant;
|
public hass?: HomeAssistant;
|
||||||
public isWide?: boolean;
|
public isWide?: boolean;
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
private _selectedNode?: HassEntity;
|
private _selectedNode?: HassEntity;
|
||||||
private _selectedCluster?: Cluster;
|
private _selectedCluster?: Cluster;
|
||||||
private _selectedEntity?: HassEntity;
|
private _selectedEntity?: HassEntity;
|
||||||
@ -45,7 +43,6 @@ export class HaConfigZha extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<ha-app-layout>
|
<ha-app-layout>
|
||||||
<app-header slot="header">
|
<app-header slot="header">
|
||||||
<app-toolbar>
|
<app-toolbar>
|
||||||
@ -114,24 +111,8 @@ export class HaConfigZha extends LitElement {
|
|||||||
this._selectedEntity = selectedEntityEvent.detail.entity;
|
this._selectedEntity = selectedEntityEvent.detail.entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [haStyle];
|
||||||
this._haStyle = document.importNode(
|
|
||||||
(document.getElementById("ha-style")!
|
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (!this._ironFlex) {
|
|
||||||
this._ironFlex = document.importNode(
|
|
||||||
(document.getElementById("iron-flex")!
|
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _onBackTapped(): void {
|
private _onBackTapped(): void {
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-button/paper-button";
|
import "@polymer/paper-button/paper-button";
|
||||||
import "@polymer/paper-card/paper-card";
|
import "@polymer/paper-card/paper-card";
|
||||||
@ -20,7 +21,7 @@ import {
|
|||||||
readAttributeValue,
|
readAttributeValue,
|
||||||
ZHADeviceEntity,
|
ZHADeviceEntity,
|
||||||
} from "../../../data/zha";
|
} from "../../../data/zha";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import {
|
import {
|
||||||
@ -36,8 +37,6 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
public selectedNode?: HassEntity;
|
public selectedNode?: HassEntity;
|
||||||
public selectedEntity?: ZHADeviceEntity;
|
public selectedEntity?: ZHADeviceEntity;
|
||||||
public selectedCluster?: Cluster;
|
public selectedCluster?: Cluster;
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
private _attributes: Attribute[];
|
private _attributes: Attribute[];
|
||||||
private _selectedAttributeIndex: number;
|
private _selectedAttributeIndex: number;
|
||||||
private _attributeValue?: any;
|
private _attributeValue?: any;
|
||||||
@ -80,7 +79,6 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<ha-config-section .isWide="${this.isWide}">
|
<ha-config-section .isWide="${this.isWide}">
|
||||||
<div style="position: relative" slot="header">
|
<div style="position: relative" slot="header">
|
||||||
<span>Cluster Attributes</span>
|
<span>Cluster Attributes</span>
|
||||||
@ -254,24 +252,18 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
this._attributeValue = "";
|
this._attributeValue = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
.flex {
|
||||||
true
|
-ms-flex: 1 1 0.000000001px;
|
||||||
);
|
-webkit-flex: 1;
|
||||||
}
|
flex: 1;
|
||||||
if (!this._ironFlex) {
|
-webkit-flex-basis: 0.000000001px;
|
||||||
this._ironFlex = document.importNode(
|
flex-basis: 0.000000001px;
|
||||||
(document.getElementById("iron-flex")!
|
}
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
@ -287,8 +279,15 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.attribute-picker {
|
.attribute-picker {
|
||||||
@apply --layout-horizontal;
|
display: -ms-flexbox;
|
||||||
@apply --layout-center-center;
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -316,7 +315,8 @@ export class ZHAClusterAttributes extends LitElement {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
`;
|
`,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-card/paper-card";
|
import "@polymer/paper-card/paper-card";
|
||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
@ -16,7 +17,7 @@ import {
|
|||||||
fetchCommandsForCluster,
|
fetchCommandsForCluster,
|
||||||
ZHADeviceEntity,
|
ZHADeviceEntity,
|
||||||
} from "../../../data/zha";
|
} from "../../../data/zha";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import {
|
import {
|
||||||
@ -32,8 +33,6 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
public selectedEntity?: ZHADeviceEntity;
|
public selectedEntity?: ZHADeviceEntity;
|
||||||
public selectedCluster?: Cluster;
|
public selectedCluster?: Cluster;
|
||||||
private _showHelp: boolean;
|
private _showHelp: boolean;
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
private _commands: Command[];
|
private _commands: Command[];
|
||||||
private _selectedCommandIndex: number;
|
private _selectedCommandIndex: number;
|
||||||
private _manufacturerCodeOverride?: number;
|
private _manufacturerCodeOverride?: number;
|
||||||
@ -72,7 +71,6 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<ha-config-section .isWide="${this.isWide}">
|
<ha-config-section .isWide="${this.isWide}">
|
||||||
<div class="sectionHeader" slot="header">
|
<div class="sectionHeader" slot="header">
|
||||||
<span>Cluster Commands</span>
|
<span>Cluster Commands</span>
|
||||||
@ -198,24 +196,18 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
this._issueClusterCommandServiceData = this._computeIssueClusterCommandServiceData();
|
this._issueClusterCommandServiceData = this._computeIssueClusterCommandServiceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
.flex {
|
||||||
true
|
-ms-flex: 1 1 0.000000001px;
|
||||||
);
|
-webkit-flex: 1;
|
||||||
}
|
flex: 1;
|
||||||
if (!this._ironFlex) {
|
-webkit-flex-basis: 0.000000001px;
|
||||||
this._ironFlex = document.importNode(
|
flex-basis: 0.000000001px;
|
||||||
(document.getElementById("iron-flex")!
|
}
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
@ -231,8 +223,15 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.command-picker {
|
.command-picker {
|
||||||
@apply --layout-horizontal;
|
display: -ms-flexbox;
|
||||||
@apply --layout-center-center;
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -269,7 +268,8 @@ export class ZHAClusterCommands extends LitElement {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
`;
|
`,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-card/paper-card";
|
import "@polymer/paper-card/paper-card";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
@ -15,7 +16,7 @@ import {
|
|||||||
fetchClustersForZhaNode,
|
fetchClustersForZhaNode,
|
||||||
ZHADeviceEntity,
|
ZHADeviceEntity,
|
||||||
} from "../../../data/zha";
|
} from "../../../data/zha";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import { ItemSelectedEvent } from "./types";
|
import { ItemSelectedEvent } from "./types";
|
||||||
@ -40,8 +41,6 @@ export class ZHAClusters extends LitElement {
|
|||||||
public selectedEntity?: ZHADeviceEntity;
|
public selectedEntity?: ZHADeviceEntity;
|
||||||
private _selectedClusterIndex: number;
|
private _selectedClusterIndex: number;
|
||||||
private _clusters: Cluster[];
|
private _clusters: Cluster[];
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -75,7 +74,6 @@ export class ZHAClusters extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this._renderStyle()}
|
|
||||||
<div class="node-picker">
|
<div class="node-picker">
|
||||||
<paper-dropdown-menu label="Clusters" class="flex">
|
<paper-dropdown-menu label="Clusters" class="flex">
|
||||||
<paper-listbox
|
<paper-listbox
|
||||||
@ -122,27 +120,28 @@ export class ZHAClusters extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
.flex {
|
||||||
true
|
-ms-flex: 1 1 0.000000001px;
|
||||||
);
|
-webkit-flex: 1;
|
||||||
}
|
flex: 1;
|
||||||
if (!this._ironFlex) {
|
-webkit-flex-basis: 0.000000001px;
|
||||||
this._ironFlex = document.importNode(
|
flex-basis: 0.000000001px;
|
||||||
(document.getElementById("iron-flex")!
|
}
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.node-picker {
|
.node-picker {
|
||||||
@apply --layout-horizontal;
|
display: -ms-flexbox;
|
||||||
@apply --layout-center-center;
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -151,8 +150,8 @@ export class ZHAClusters extends LitElement {
|
|||||||
color: grey;
|
color: grey;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
</style>
|
`,
|
||||||
`;
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-button/paper-button";
|
import "@polymer/paper-button/paper-button";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
@ -12,7 +13,7 @@ import "@polymer/paper-listbox/paper-listbox";
|
|||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { fetchEntitiesForZhaNode } from "../../../data/zha";
|
import { fetchEntitiesForZhaNode } from "../../../data/zha";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { ItemSelectedEvent } from "./types";
|
import { ItemSelectedEvent } from "./types";
|
||||||
|
|
||||||
@ -31,8 +32,6 @@ export class ZHAEntities extends LitElement {
|
|||||||
public selectedNode?: HassEntity;
|
public selectedNode?: HassEntity;
|
||||||
private _selectedEntityIndex: number;
|
private _selectedEntityIndex: number;
|
||||||
private _entities: HassEntity[];
|
private _entities: HassEntity[];
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -64,7 +63,6 @@ export class ZHAEntities extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this._renderStyle()}
|
|
||||||
<div class="node-picker">
|
<div class="node-picker">
|
||||||
<paper-dropdown-menu label="Entities" class="flex">
|
<paper-dropdown-menu label="Entities" class="flex">
|
||||||
<paper-listbox
|
<paper-listbox
|
||||||
@ -125,27 +123,28 @@ export class ZHAEntities extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
.flex {
|
||||||
true
|
-ms-flex: 1 1 0.000000001px;
|
||||||
);
|
-webkit-flex: 1;
|
||||||
}
|
flex: 1;
|
||||||
if (!this._ironFlex) {
|
-webkit-flex-basis: 0.000000001px;
|
||||||
this._ironFlex = document.importNode(
|
flex-basis: 0.000000001px;
|
||||||
(document.getElementById("iron-flex")!
|
}
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.node-picker {
|
.node-picker {
|
||||||
@apply --layout-horizontal;
|
display: -ms-flexbox;
|
||||||
@apply --layout-center-center;
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -163,8 +162,8 @@ export class ZHAEntities extends LitElement {
|
|||||||
color: grey;
|
color: grey;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
</style>
|
`,
|
||||||
`;
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-button/paper-button";
|
import "@polymer/paper-button/paper-button";
|
||||||
import "@polymer/paper-card/paper-card";
|
import "@polymer/paper-card/paper-card";
|
||||||
import "@polymer/paper-icon-button/paper-icon-button";
|
import "@polymer/paper-icon-button/paper-icon-button";
|
||||||
import "../../../components/buttons/ha-call-service-button";
|
import "../../../components/buttons/ha-call-service-button";
|
||||||
import "../../../components/ha-service-description";
|
import "../../../components/ha-service-description";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
|
|
||||||
@ -18,8 +19,6 @@ export class ZHANetwork extends LitElement {
|
|||||||
public hass?: HomeAssistant;
|
public hass?: HomeAssistant;
|
||||||
public isWide?: boolean;
|
public isWide?: boolean;
|
||||||
private _showHelp: boolean;
|
private _showHelp: boolean;
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -36,7 +35,6 @@ export class ZHANetwork extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<ha-config-section .isWide="${this.isWide}">
|
<ha-config-section .isWide="${this.isWide}">
|
||||||
<div style="position: relative" slot="header">
|
<div style="position: relative" slot="header">
|
||||||
<span>Network Management</span>
|
<span>Network Management</span>
|
||||||
@ -71,24 +69,10 @@ export class ZHANetwork extends LitElement {
|
|||||||
this._showHelp = !this._showHelp;
|
this._showHelp = !this._showHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (!this._ironFlex) {
|
|
||||||
this._ironFlex = document.importNode(
|
|
||||||
(document.getElementById("iron-flex")!
|
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
@ -119,7 +103,8 @@ export class ZHANetwork extends LitElement {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
`;
|
`,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import {
|
import {
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
PropertyDeclarations,
|
PropertyDeclarations,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "@polymer/paper-button/paper-button";
|
import "@polymer/paper-button/paper-button";
|
||||||
import "@polymer/paper-card/paper-card";
|
import "@polymer/paper-card/paper-card";
|
||||||
@ -16,7 +17,7 @@ import computeStateName from "../../../common/entity/compute_state_name";
|
|||||||
import sortByName from "../../../common/entity/states_sort_by_name";
|
import sortByName from "../../../common/entity/states_sort_by_name";
|
||||||
import "../../../components/buttons/ha-call-service-button";
|
import "../../../components/buttons/ha-call-service-button";
|
||||||
import "../../../components/ha-service-description";
|
import "../../../components/ha-service-description";
|
||||||
import "../../../resources/ha-style";
|
import { haStyle } from "../../../resources/ha-style";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import {
|
import {
|
||||||
@ -45,8 +46,6 @@ export class ZHANode extends LitElement {
|
|||||||
private _selectedNode?: HassEntity;
|
private _selectedNode?: HassEntity;
|
||||||
private _selectedEntity?: HassEntity;
|
private _selectedEntity?: HassEntity;
|
||||||
private _serviceData?: {};
|
private _serviceData?: {};
|
||||||
private _haStyle?: DocumentFragment;
|
|
||||||
private _ironFlex?: DocumentFragment;
|
|
||||||
private _nodes: HassEntity[];
|
private _nodes: HassEntity[];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -71,7 +70,6 @@ export class ZHANode extends LitElement {
|
|||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
this._nodes = this._computeNodes(this.hass);
|
this._nodes = this._computeNodes(this.hass);
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<ha-config-section .isWide="${this.isWide}">
|
<ha-config-section .isWide="${this.isWide}">
|
||||||
<div class="sectionHeader" slot="header">
|
<div class="sectionHeader" slot="header">
|
||||||
<span>Node Management</span>
|
<span>Node Management</span>
|
||||||
@ -242,24 +240,18 @@ export class ZHANode extends LitElement {
|
|||||||
this._selectedEntity = entitySelectedEvent.detail.entity;
|
this._selectedEntity = entitySelectedEvent.detail.entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
if (!this._haStyle) {
|
return [
|
||||||
this._haStyle = document.importNode(
|
haStyle,
|
||||||
(document.getElementById("ha-style")!
|
css`
|
||||||
.children[0] as HTMLTemplateElement).content,
|
.flex {
|
||||||
true
|
-ms-flex: 1 1 0.000000001px;
|
||||||
);
|
-webkit-flex: 1;
|
||||||
}
|
flex: 1;
|
||||||
if (!this._ironFlex) {
|
-webkit-flex-basis: 0.000000001px;
|
||||||
this._ironFlex = document.importNode(
|
flex-basis: 0.000000001px;
|
||||||
(document.getElementById("iron-flex")!
|
}
|
||||||
.children[0] as HTMLTemplateElement).content,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return html`
|
|
||||||
${this._ironFlex} ${this._haStyle}
|
|
||||||
<style>
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
@ -289,8 +281,15 @@ export class ZHANode extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.node-picker {
|
.node-picker {
|
||||||
@apply --layout-horizontal;
|
display: -ms-flexbox;
|
||||||
@apply --layout-center-center;
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
padding-left: 28px;
|
padding-left: 28px;
|
||||||
padding-right: 28px;
|
padding-right: 28px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -311,8 +310,8 @@ export class ZHANode extends LitElement {
|
|||||||
right: 0;
|
right: 0;
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
</style>
|
`,
|
||||||
`;
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user