mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix render modifiers - public to protected (#6753)
This commit is contained in:
parent
0d75fe6b81
commit
a3f680d80c
@ -21,7 +21,7 @@ interface State {
|
|||||||
class HassioAnsiToHtml extends LitElement {
|
class HassioAnsiToHtml extends LitElement {
|
||||||
@property() public content!: string;
|
@property() public content!: string;
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`${this._parseTextToColoredPre(this.content)}`;
|
return html`${this._parseTextToColoredPre(this.content)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
|
import "@material/mwc-list/mwc-list-item";
|
||||||
import { mdiDotsVertical } from "@mdi/js";
|
import { mdiDotsVertical } from "@mdi/js";
|
||||||
import { safeDump } from "js-yaml";
|
import { safeDump } from "js-yaml";
|
||||||
import memoizeOne from "memoize-one";
|
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@ -14,7 +13,11 @@ import {
|
|||||||
property,
|
property,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
|
import memoizeOne from "memoize-one";
|
||||||
|
import "../../../src/components/ha-button-menu";
|
||||||
|
import "../../../src/components/ha-card";
|
||||||
|
import "../../../src/components/ha-settings-row";
|
||||||
|
import { fetchHassioHardwareInfo } from "../../../src/data/hassio/hardware";
|
||||||
import {
|
import {
|
||||||
changeHostOptions,
|
changeHostOptions,
|
||||||
configSyncOS,
|
configSyncOS,
|
||||||
@ -25,26 +28,21 @@ import {
|
|||||||
shutdownHost,
|
shutdownHost,
|
||||||
updateOS,
|
updateOS,
|
||||||
} from "../../../src/data/hassio/host";
|
} from "../../../src/data/hassio/host";
|
||||||
import { fetchHassioHardwareInfo } from "../../../src/data/hassio/hardware";
|
|
||||||
import {
|
import {
|
||||||
fetchNetworkInfo,
|
fetchNetworkInfo,
|
||||||
NetworkInfo,
|
NetworkInfo,
|
||||||
} from "../../../src/data/hassio/network";
|
} from "../../../src/data/hassio/network";
|
||||||
import { HassioInfo } from "../../../src/data/hassio/supervisor";
|
import { HassioInfo } from "../../../src/data/hassio/supervisor";
|
||||||
import { hassioStyle } from "../resources/hassio-style";
|
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
|
||||||
import { HomeAssistant } from "../../../src/types";
|
|
||||||
import {
|
import {
|
||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
showPromptDialog,
|
showPromptDialog,
|
||||||
} from "../../../src/dialogs/generic/show-dialog-box";
|
} from "../../../src/dialogs/generic/show-dialog-box";
|
||||||
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
|
import { HomeAssistant } from "../../../src/types";
|
||||||
import { showHassioMarkdownDialog } from "../dialogs/markdown/show-dialog-hassio-markdown";
|
import { showHassioMarkdownDialog } from "../dialogs/markdown/show-dialog-hassio-markdown";
|
||||||
import { showNetworkDialog } from "../dialogs/network/show-dialog-network";
|
import { showNetworkDialog } from "../dialogs/network/show-dialog-network";
|
||||||
|
import { hassioStyle } from "../resources/hassio-style";
|
||||||
import "../../../src/components/ha-button-menu";
|
|
||||||
import "../../../src/components/ha-card";
|
|
||||||
import "../../../src/components/ha-settings-row";
|
|
||||||
|
|
||||||
@customElement("hassio-host-info")
|
@customElement("hassio-host-info")
|
||||||
class HassioHostInfo extends LitElement {
|
class HassioHostInfo extends LitElement {
|
||||||
@ -58,7 +56,7 @@ class HassioHostInfo extends LitElement {
|
|||||||
|
|
||||||
@internalProperty() public _networkInfo?: NetworkInfo;
|
@internalProperty() public _networkInfo?: NetworkInfo;
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
const primaryIpAddress = this.hostInfo.features.includes("network")
|
const primaryIpAddress = this.hostInfo.features.includes("network")
|
||||||
? this._primaryIpAddress(this._networkInfo!)
|
? this._primaryIpAddress(this._networkInfo!)
|
||||||
: "";
|
: "";
|
||||||
|
@ -8,11 +8,10 @@ import {
|
|||||||
property,
|
property,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
|
import "../../../src/components/ha-card";
|
||||||
|
import "../../../src/components/ha-settings-row";
|
||||||
|
import "../../../src/components/ha-switch";
|
||||||
import { HassioHostInfo as HassioHostInfoType } from "../../../src/data/hassio/host";
|
import { HassioHostInfo as HassioHostInfoType } from "../../../src/data/hassio/host";
|
||||||
import { hassioStyle } from "../resources/hassio-style";
|
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
|
||||||
import { HomeAssistant } from "../../../src/types";
|
|
||||||
import {
|
import {
|
||||||
HassioSupervisorInfo as HassioSupervisorInfoType,
|
HassioSupervisorInfo as HassioSupervisorInfoType,
|
||||||
reloadSupervisor,
|
reloadSupervisor,
|
||||||
@ -24,10 +23,9 @@ import {
|
|||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../../src/dialogs/generic/show-dialog-box";
|
} from "../../../src/dialogs/generic/show-dialog-box";
|
||||||
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
import "../../../src/components/ha-card";
|
import { HomeAssistant } from "../../../src/types";
|
||||||
import "../../../src/components/ha-settings-row";
|
import { hassioStyle } from "../resources/hassio-style";
|
||||||
import "../../../src/components/ha-switch";
|
|
||||||
|
|
||||||
@customElement("hassio-supervisor-info")
|
@customElement("hassio-supervisor-info")
|
||||||
class HassioSupervisorInfo extends LitElement {
|
class HassioSupervisorInfo extends LitElement {
|
||||||
@ -37,7 +35,7 @@ class HassioSupervisorInfo extends LitElement {
|
|||||||
|
|
||||||
@property() public hostInfo!: HassioHostInfoType;
|
@property() public hostInfo!: HassioHostInfoType;
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
<ha-card header="Supervisor">
|
<ha-card header="Supervisor">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
|
@ -69,7 +69,7 @@ class HassioSupervisorLog extends LitElement {
|
|||||||
await this._loadData();
|
await this._loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
${this._error ? html` <div class="errors">${this._error}</div> ` : ""}
|
${this._error ? html` <div class="errors">${this._error}</div> ` : ""}
|
||||||
|
@ -12,8 +12,8 @@ import {
|
|||||||
HassioHostInfo,
|
HassioHostInfo,
|
||||||
} from "../../../src/data/hassio/host";
|
} from "../../../src/data/hassio/host";
|
||||||
import {
|
import {
|
||||||
HassioSupervisorInfo,
|
|
||||||
HassioInfo,
|
HassioInfo,
|
||||||
|
HassioSupervisorInfo,
|
||||||
} from "../../../src/data/hassio/supervisor";
|
} from "../../../src/data/hassio/supervisor";
|
||||||
import "../../../src/layouts/hass-tabs-subpage";
|
import "../../../src/layouts/hass-tabs-subpage";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
@ -40,7 +40,7 @@ class HassioSystem extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo;
|
@property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo;
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
<hass-tabs-subpage
|
<hass-tabs-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import {
|
|
||||||
LitElement,
|
|
||||||
TemplateResult,
|
|
||||||
property,
|
|
||||||
svg,
|
|
||||||
html,
|
|
||||||
customElement,
|
|
||||||
unsafeCSS,
|
|
||||||
SVGTemplateResult,
|
|
||||||
css,
|
|
||||||
} from "lit-element";
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import progressStyles from "@material/circular-progress/dist/mdc.circular-progress.min.css";
|
import progressStyles from "@material/circular-progress/dist/mdc.circular-progress.min.css";
|
||||||
|
import {
|
||||||
|
css,
|
||||||
|
customElement,
|
||||||
|
html,
|
||||||
|
LitElement,
|
||||||
|
property,
|
||||||
|
svg,
|
||||||
|
SVGTemplateResult,
|
||||||
|
TemplateResult,
|
||||||
|
unsafeCSS,
|
||||||
|
} from "lit-element";
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
import { classMap } from "lit-html/directives/class-map";
|
||||||
|
|
||||||
@customElement("ha-circular-progress")
|
@customElement("ha-circular-progress")
|
||||||
@ -24,7 +24,7 @@ export class HaCircularProgress extends LitElement {
|
|||||||
@property()
|
@property()
|
||||||
public size: "small" | "medium" | "large" = "medium";
|
public size: "small" | "medium" | "large" = "medium";
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult {
|
||||||
let indeterminatePart: SVGTemplateResult;
|
let indeterminatePart: SVGTemplateResult;
|
||||||
|
|
||||||
if (this.size === "small") {
|
if (this.size === "small") {
|
||||||
|
@ -15,7 +15,7 @@ export class HaConditionAction extends LitElement implements ActionElement {
|
|||||||
return { condition: "state" };
|
return { condition: "state" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
return html`
|
return html`
|
||||||
<ha-automation-condition-editor
|
<ha-automation-condition-editor
|
||||||
.condition=${this.action}
|
.condition=${this.action}
|
||||||
|
@ -16,7 +16,7 @@ export class HaDelayAction extends LitElement implements ActionElement {
|
|||||||
return { delay: "" };
|
return { delay: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
const { delay } = this.action;
|
const { delay } = this.action;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
|
import "@polymer/paper-input/paper-textarea";
|
||||||
import { customElement, html, LitElement, property } from "lit-element";
|
import { customElement, html, LitElement, property } from "lit-element";
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
import "../../../../../components/entity/ha-entity-picker";
|
import "../../../../../components/entity/ha-entity-picker";
|
||||||
import "@polymer/paper-input/paper-textarea";
|
|
||||||
import { NumericStateCondition } from "../../../../../data/automation";
|
import { NumericStateCondition } from "../../../../../data/automation";
|
||||||
import { HomeAssistant } from "../../../../../types";
|
import { HomeAssistant } from "../../../../../types";
|
||||||
import { handleChangeEvent } from "../ha-automation-condition-row";
|
import { handleChangeEvent } from "../ha-automation-condition-row";
|
||||||
@ -19,7 +19,7 @@ export default class HaNumericStateCondition extends LitElement {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
const { value_template, entity_id, below, above } = this.condition;
|
const { value_template, entity_id, below, above } = this.condition;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
|
@ -19,7 +19,7 @@ export class HaEventTrigger extends LitElement implements TriggerElement {
|
|||||||
return { event_type: "", event_data: {} };
|
return { event_type: "", event_data: {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
const { event_type, event_data } = this.trigger;
|
const { event_type, event_data } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<paper-input
|
<paper-input
|
||||||
|
@ -18,7 +18,7 @@ export default class HaHassTrigger extends LitElement {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
const { event } = this.trigger;
|
const { event } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<label id="eventlabel">
|
<label id="eventlabel">
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
|
import "@polymer/paper-input/paper-textarea";
|
||||||
import { customElement, html, LitElement, property } from "lit-element";
|
import { customElement, html, LitElement, property } from "lit-element";
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
import "../../../../../components/entity/ha-entity-picker";
|
import "../../../../../components/entity/ha-entity-picker";
|
||||||
import "@polymer/paper-input/paper-textarea";
|
|
||||||
import { ForDict, NumericStateTrigger } from "../../../../../data/automation";
|
import { ForDict, NumericStateTrigger } from "../../../../../data/automation";
|
||||||
import { HomeAssistant } from "../../../../../types";
|
import { HomeAssistant } from "../../../../../types";
|
||||||
import { handleChangeEvent } from "../ha-automation-trigger-row";
|
import { handleChangeEvent } from "../ha-automation-trigger-row";
|
||||||
@ -19,7 +19,7 @@ export default class HaNumericStateTrigger extends LitElement {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
protected render() {
|
||||||
const { value_template, entity_id, below, above } = this.trigger;
|
const { value_template, entity_id, below, above } = this.trigger;
|
||||||
let trgFor = this.trigger.for;
|
let trgFor = this.trigger.for;
|
||||||
|
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../../layouts/ha-app-layout";
|
|
||||||
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 "../../components/ha-icon-button";
|
|
||||||
import "../../components/ha-circular-progress";
|
|
||||||
import { safeDump, safeLoad } from "js-yaml";
|
import { safeDump, safeLoad } from "js-yaml";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
customElement,
|
customElement,
|
||||||
html,
|
html,
|
||||||
|
internalProperty,
|
||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
internalProperty,
|
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
import { classMap } from "lit-html/directives/class-map";
|
||||||
|
import { array, assert, object, optional, string, type } from "superstruct";
|
||||||
import { computeRTL } from "../../common/util/compute_rtl";
|
import { computeRTL } from "../../common/util/compute_rtl";
|
||||||
|
import "../../components/ha-circular-progress";
|
||||||
import "../../components/ha-code-editor";
|
import "../../components/ha-code-editor";
|
||||||
import type { HaCodeEditor } from "../../components/ha-code-editor";
|
import type { HaCodeEditor } from "../../components/ha-code-editor";
|
||||||
import "../../components/ha-icon";
|
import "../../components/ha-icon";
|
||||||
|
import "../../components/ha-icon-button";
|
||||||
import type { LovelaceConfig } from "../../data/lovelace";
|
import type { LovelaceConfig } from "../../data/lovelace";
|
||||||
import {
|
import {
|
||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../dialogs/generic/show-dialog-box";
|
} from "../../dialogs/generic/show-dialog-box";
|
||||||
|
import "../../layouts/ha-app-layout";
|
||||||
import { haStyle } from "../../resources/styles";
|
import { haStyle } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import type { Lovelace } from "./types";
|
import type { Lovelace } from "./types";
|
||||||
import { optional, array, string, object, type, assert } from "superstruct";
|
|
||||||
|
|
||||||
const lovelaceStruct = type({
|
const lovelaceStruct = type({
|
||||||
title: optional(string()),
|
title: optional(string()),
|
||||||
@ -49,7 +49,7 @@ class LovelaceFullConfigEditor extends LitElement {
|
|||||||
|
|
||||||
private _generation = 1;
|
private _generation = 1;
|
||||||
|
|
||||||
public render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
<ha-app-layout>
|
<ha-app-layout>
|
||||||
<app-header slot="header">
|
<app-header slot="header">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user