mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-23 08:09:27 +00:00
Compare commits
1 Commits
sidebar-de
...
update-sta
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2aeea10fc1 |
@@ -87,7 +87,7 @@ export class HaForm extends LitElement implements HaFormElement {
|
|||||||
.value=${getValue(this.data, item)}
|
.value=${getValue(this.data, item)}
|
||||||
.label=${this._computeLabel(item)}
|
.label=${this._computeLabel(item)}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
.required=${item.required || false}
|
.required=${item.required}
|
||||||
></ha-selector>`
|
></ha-selector>`
|
||||||
: dynamicElement(`ha-form-${item.type}`, {
|
: dynamicElement(`ha-form-${item.type}`, {
|
||||||
schema: item,
|
schema: item,
|
||||||
|
@@ -18,7 +18,6 @@ import { toggleAttribute } from "../common/dom/toggle_attribute";
|
|||||||
import { showNotificationDrawer } from "../dialogs/notifications/show-notification-drawer";
|
import { showNotificationDrawer } from "../dialogs/notifications/show-notification-drawer";
|
||||||
import type { HomeAssistant, Route } from "../types";
|
import type { HomeAssistant, Route } from "../types";
|
||||||
import "./partial-panel-resolver";
|
import "./partial-panel-resolver";
|
||||||
import "../panels/developer-tools/ha-panel-developer-tools";
|
|
||||||
|
|
||||||
const NON_SWIPABLE_PANELS = ["map"];
|
const NON_SWIPABLE_PANELS = ["map"];
|
||||||
|
|
||||||
@@ -46,8 +45,6 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public narrow!: boolean;
|
@property({ type: Boolean }) public narrow!: boolean;
|
||||||
|
|
||||||
@property({ type: Boolean }) public showDevToolsDrawer?: boolean;
|
|
||||||
|
|
||||||
@state() private _sidebarEditMode = false;
|
@state() private _sidebarEditMode = false;
|
||||||
|
|
||||||
@state() private _externalSidebar = false;
|
@state() private _externalSidebar = false;
|
||||||
@@ -83,7 +80,7 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
responsive-width="0"
|
responsive-width="0"
|
||||||
>
|
>
|
||||||
<app-drawer
|
<app-drawer
|
||||||
id="sidebarDrawer"
|
id="drawer"
|
||||||
align="start"
|
align="start"
|
||||||
slot="drawer"
|
slot="drawer"
|
||||||
.disableSwipe=${disableSwipe}
|
.disableSwipe=${disableSwipe}
|
||||||
@@ -101,18 +98,6 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
></ha-sidebar>
|
></ha-sidebar>
|
||||||
</app-drawer>
|
</app-drawer>
|
||||||
|
|
||||||
<app-drawer
|
|
||||||
id="devToolsDrawer"
|
|
||||||
align="end"
|
|
||||||
slot="drawer"
|
|
||||||
.disableSwipe=${true}
|
|
||||||
.swipeOpen=${false}
|
|
||||||
.persistent=${true}
|
|
||||||
.opened=${this.showDevToolsDrawer}
|
|
||||||
>
|
|
||||||
<div>test</div>
|
|
||||||
</app-drawer>
|
|
||||||
|
|
||||||
<partial-panel-resolver
|
<partial-panel-resolver
|
||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
.hass=${hass}
|
.hass=${hass}
|
||||||
@@ -140,7 +125,7 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
|
|
||||||
if (this._sidebarEditMode) {
|
if (this._sidebarEditMode) {
|
||||||
if (this._sidebarNarrow) {
|
if (this._sidebarNarrow) {
|
||||||
this.sidebarDrawer.open();
|
this.drawer.open();
|
||||||
} else {
|
} else {
|
||||||
fireEvent(this, "hass-dock-sidebar", {
|
fireEvent(this, "hass-dock-sidebar", {
|
||||||
dock: "docked",
|
dock: "docked",
|
||||||
@@ -162,10 +147,10 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._sidebarNarrow) {
|
if (this._sidebarNarrow) {
|
||||||
if (this.sidebarDrawer.opened) {
|
if (this.drawer.opened) {
|
||||||
this.sidebarDrawer.close();
|
this.drawer.close();
|
||||||
} else {
|
} else {
|
||||||
this.sidebarDrawer.open();
|
this.drawer.open();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fireEvent(this, "hass-dock-sidebar", {
|
fireEvent(this, "hass-dock-sidebar", {
|
||||||
@@ -192,14 +177,14 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (changedProps.has("route") && this._sidebarNarrow) {
|
if (changedProps.has("route") && this._sidebarNarrow) {
|
||||||
this.sidebarDrawer.close();
|
this.drawer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
||||||
|
|
||||||
// Make app-drawer adjust to a potential LTR/RTL change
|
// Make app-drawer adjust to a potential LTR/RTL change
|
||||||
if (oldHass && oldHass.language !== this.hass!.language) {
|
if (oldHass && oldHass.language !== this.hass!.language) {
|
||||||
this.sidebarDrawer._resetPosition();
|
this.drawer._resetPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,8 +192,8 @@ export class HomeAssistantMain extends LitElement {
|
|||||||
return this.narrow || this.hass.dockedSidebar === "always_hidden";
|
return this.narrow || this.hass.dockedSidebar === "always_hidden";
|
||||||
}
|
}
|
||||||
|
|
||||||
private get sidebarDrawer(): AppDrawerElement {
|
private get drawer(): AppDrawerElement {
|
||||||
return this.shadowRoot!.querySelector("#sidebarDrawer")!;
|
return this.shadowRoot!.querySelector("app-drawer")!;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get appLayout(): AppDrawerLayoutElement {
|
private get appLayout(): AppDrawerLayoutElement {
|
||||||
|
@@ -5,7 +5,7 @@ import { navigate } from "../common/navigate";
|
|||||||
import { getStorageDefaultPanelUrlPath } from "../data/panel";
|
import { getStorageDefaultPanelUrlPath } from "../data/panel";
|
||||||
import "../resources/custom-card-support";
|
import "../resources/custom-card-support";
|
||||||
import { HassElement } from "../state/hass-element";
|
import { HassElement } from "../state/hass-element";
|
||||||
import ShortcutsMixin from "../state/shortcuts-mixin";
|
import QuickBarMixin from "../state/quick-bar-mixin";
|
||||||
import { HomeAssistant, Route } from "../types";
|
import { HomeAssistant, Route } from "../types";
|
||||||
import { storeState } from "../util/ha-pref-storage";
|
import { storeState } from "../util/ha-pref-storage";
|
||||||
import {
|
import {
|
||||||
@@ -29,7 +29,7 @@ const panelUrl = (path: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@customElement("home-assistant")
|
@customElement("home-assistant")
|
||||||
export class HomeAssistantAppEl extends ShortcutsMixin(HassElement) {
|
export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
|
||||||
@state() private _route: Route;
|
@state() private _route: Route;
|
||||||
|
|
||||||
private _panelUrl: string;
|
private _panelUrl: string;
|
||||||
@@ -85,16 +85,6 @@ export class HomeAssistantAppEl extends ShortcutsMixin(HassElement) {
|
|||||||
storeState(this.hass!);
|
storeState(this.hass!);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addEventListener("dev-tools-toggle", () => {
|
|
||||||
const main = this.shadowRoot?.querySelector("home-assistant-main");
|
|
||||||
|
|
||||||
if (!main) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
main.showDevToolsDrawer = !main.showDevToolsDrawer;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Navigation
|
// Navigation
|
||||||
const updateRoute = (path = curPath()) => {
|
const updateRoute = (path = curPath()) => {
|
||||||
if (this._route && path === this._route.path) {
|
if (this._route && path === this._route.path) {
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
import "../../../../../components/ha-form/ha-form";
|
import { css, html, LitElement } from "lit";
|
||||||
import { html, LitElement } from "lit";
|
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
import { HaFormSchema } from "../../../../../components/ha-form/types";
|
import "../../../../../components/entity/ha-entity-picker";
|
||||||
|
import type { HaRadio } from "../../../../../components/ha-radio";
|
||||||
import type { GeoLocationTrigger } from "../../../../../data/automation";
|
import type { GeoLocationTrigger } from "../../../../../data/automation";
|
||||||
import type { HomeAssistant } from "../../../../../types";
|
import type { HomeAssistant } from "../../../../../types";
|
||||||
import type { LocalizeFunc } from "../../../../../common/translations/localize";
|
import { handleChangeEvent } from "../ha-automation-trigger-row";
|
||||||
|
|
||||||
|
const includeDomains = ["zone"];
|
||||||
|
|
||||||
@customElement("ha-automation-trigger-geo_location")
|
@customElement("ha-automation-trigger-geo_location")
|
||||||
export class HaGeolocationTrigger extends LitElement {
|
export class HaGeolocationTrigger extends LitElement {
|
||||||
@@ -14,30 +15,6 @@ export class HaGeolocationTrigger extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public trigger!: GeoLocationTrigger;
|
@property({ attribute: false }) public trigger!: GeoLocationTrigger;
|
||||||
|
|
||||||
private _schema = memoizeOne((localize: LocalizeFunc) => [
|
|
||||||
{ name: "source", selector: { text: {} } },
|
|
||||||
{ name: "zone", selector: { entity: { domain: "zone" } } },
|
|
||||||
{
|
|
||||||
name: "event",
|
|
||||||
type: "select",
|
|
||||||
required: true,
|
|
||||||
options: [
|
|
||||||
[
|
|
||||||
"enter",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.geo_location.enter"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"leave",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.geo_location.leave"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
public static get defaultConfig() {
|
public static get defaultConfig() {
|
||||||
return {
|
return {
|
||||||
source: "",
|
source: "",
|
||||||
@@ -47,27 +24,86 @@ export class HaGeolocationTrigger extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
const { source, zone, event } = this.trigger;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-form
|
<paper-input
|
||||||
.schema=${this._schema(this.hass.localize)}
|
.label=${this.hass.localize(
|
||||||
.data=${this.trigger}
|
"ui.panel.config.automation.editor.triggers.type.geo_location.source"
|
||||||
.hass=${this.hass}
|
)}
|
||||||
.computeLabel=${this._computeLabelCallback}
|
name="source"
|
||||||
|
.value=${source}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></paper-input>
|
||||||
|
<ha-entity-picker
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.geo_location.zone"
|
||||||
|
)}
|
||||||
|
.value=${zone}
|
||||||
|
@value-changed=${this._zonePicked}
|
||||||
|
.hass=${this.hass}
|
||||||
|
allow-custom-entity
|
||||||
|
.includeDomains=${includeDomains}
|
||||||
|
></ha-entity-picker>
|
||||||
|
<label>
|
||||||
|
${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.geo_location.event"
|
||||||
|
)}
|
||||||
|
<ha-formfield
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.geo_location.enter"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="enter"
|
||||||
|
.checked=${event === "enter"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
<ha-formfield
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.geo_location.leave"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="leave"
|
||||||
|
.checked=${event === "leave"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
</label>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _valueChanged(ev: CustomEvent): void {
|
||||||
ev.stopPropagation();
|
handleChangeEvent(this, ev);
|
||||||
const newTrigger = ev.detail.value;
|
|
||||||
fireEvent(this, "value-changed", { value: newTrigger });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeLabelCallback = (schema: HaFormSchema): string =>
|
private _zonePicked(ev: CustomEvent) {
|
||||||
this.hass.localize(
|
ev.stopPropagation();
|
||||||
`ui.panel.config.automation.editor.triggers.type.geo_location.${schema.name}`
|
fireEvent(this, "value-changed", {
|
||||||
);
|
value: { ...this.trigger, zone: ev.detail.value },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private _radioGroupPicked(ev: CustomEvent) {
|
||||||
|
ev.stopPropagation();
|
||||||
|
fireEvent(this, "value-changed", {
|
||||||
|
value: {
|
||||||
|
...this.trigger,
|
||||||
|
event: (ev.target as HaRadio).value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
import "../../../../../components/ha-form/ha-form";
|
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
|
import type { HaRadio } from "../../../../../components/ha-radio";
|
||||||
import type { HassTrigger } from "../../../../../data/automation";
|
import type { HassTrigger } from "../../../../../data/automation";
|
||||||
import type { HomeAssistant } from "../../../../../types";
|
import type { HomeAssistant } from "../../../../../types";
|
||||||
import type { HaFormSchema } from "../../../../../components/ha-form/types";
|
import "../../../../../components/ha-formfield";
|
||||||
import type { LocalizeFunc } from "../../../../../common/translations/localize";
|
import "../../../../../components/ha-radio";
|
||||||
|
|
||||||
@customElement("ha-automation-trigger-homeassistant")
|
@customElement("ha-automation-trigger-homeassistant")
|
||||||
export class HaHassTrigger extends LitElement {
|
export class HaHassTrigger extends LitElement {
|
||||||
@@ -14,28 +13,6 @@ export class HaHassTrigger extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public trigger!: HassTrigger;
|
@property({ attribute: false }) public trigger!: HassTrigger;
|
||||||
|
|
||||||
private _schema = memoizeOne((localize: LocalizeFunc) => [
|
|
||||||
{
|
|
||||||
name: "event",
|
|
||||||
type: "select",
|
|
||||||
required: true,
|
|
||||||
options: [
|
|
||||||
[
|
|
||||||
"start",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.homeassistant.start"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"shutdown",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.homeassistant.shutdown"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
public static get defaultConfig() {
|
public static get defaultConfig() {
|
||||||
return {
|
return {
|
||||||
event: "start" as HassTrigger["event"],
|
event: "start" as HassTrigger["event"],
|
||||||
@@ -43,28 +20,50 @@ export class HaHassTrigger extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
const { event } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<ha-form
|
<label id="eventlabel">
|
||||||
.schema=${this._schema(this.hass.localize)}
|
${this.hass.localize(
|
||||||
.data=${this.trigger}
|
"ui.panel.config.automation.editor.triggers.type.homeassistant.event"
|
||||||
.hass=${this.hass}
|
)}
|
||||||
.computeLabel=${this._computeLabelCallback}
|
<ha-formfield
|
||||||
@value-changed=${this._valueChanged}
|
.label=${this.hass.localize(
|
||||||
></ha-form>
|
"ui.panel.config.automation.editor.triggers.type.homeassistant.start"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="start"
|
||||||
|
.checked=${event === "start"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
<ha-formfield
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.homeassistant.shutdown"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="shutdown"
|
||||||
|
.checked=${event === "shutdown"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
</label>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _radioGroupPicked(ev) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const newTrigger = ev.detail.value;
|
fireEvent(this, "value-changed", {
|
||||||
fireEvent(this, "value-changed", { value: newTrigger });
|
value: {
|
||||||
|
...this.trigger,
|
||||||
|
event: (ev.target as HaRadio).value,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeLabelCallback = (schema: HaFormSchema): string =>
|
|
||||||
this.hass.localize(
|
|
||||||
`ui.panel.config.automation.editor.triggers.type.geo_location.${schema.name}`
|
|
||||||
);
|
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
label {
|
label {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@@ -1,15 +1,12 @@
|
|||||||
|
import "@polymer/paper-input/paper-input";
|
||||||
import { html, LitElement } from "lit";
|
import { html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
|
||||||
import type { HaFormSchema } from "../../../../../components/ha-form/types";
|
|
||||||
import { MqttTrigger } from "../../../../../data/automation";
|
import { MqttTrigger } from "../../../../../data/automation";
|
||||||
import { HomeAssistant } from "../../../../../types";
|
import { HomeAssistant } from "../../../../../types";
|
||||||
import type { TriggerElement } from "../ha-automation-trigger-row";
|
import {
|
||||||
|
handleChangeEvent,
|
||||||
const SCHEMA: HaFormSchema[] = [
|
TriggerElement,
|
||||||
{ name: "topic", required: true, selector: { text: {} } },
|
} from "../ha-automation-trigger-row";
|
||||||
{ name: "payload", selector: { text: {} } },
|
|
||||||
];
|
|
||||||
|
|
||||||
@customElement("ha-automation-trigger-mqtt")
|
@customElement("ha-automation-trigger-mqtt")
|
||||||
export class HaMQTTTrigger extends LitElement implements TriggerElement {
|
export class HaMQTTTrigger extends LitElement implements TriggerElement {
|
||||||
@@ -22,27 +19,30 @@ export class HaMQTTTrigger extends LitElement implements TriggerElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
const { topic, payload } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<ha-form
|
<paper-input
|
||||||
.schema=${SCHEMA}
|
.label=${this.hass.localize(
|
||||||
.data=${this.trigger}
|
"ui.panel.config.automation.editor.triggers.type.mqtt.topic"
|
||||||
.hass=${this.hass}
|
)}
|
||||||
.computeLabel=${this._computeLabelCallback}
|
name="topic"
|
||||||
|
.value=${topic}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></paper-input>
|
||||||
|
<paper-input
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.mqtt.payload"
|
||||||
|
)}
|
||||||
|
name="payload"
|
||||||
|
.value=${payload}
|
||||||
|
@value-changed=${this._valueChanged}
|
||||||
|
></paper-input>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _valueChanged(ev: CustomEvent): void {
|
||||||
ev.stopPropagation();
|
handleChangeEvent(this, ev);
|
||||||
const newTrigger = ev.detail.value;
|
|
||||||
fireEvent(this, "value-changed", { value: newTrigger });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeLabelCallback = (schema: HaFormSchema): string =>
|
|
||||||
this.hass.localize(
|
|
||||||
`ui.panel.config.automation.editor.triggers.type.mqtt.${schema.name}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@@ -91,7 +91,7 @@ export class HaStateTrigger extends LitElement implements TriggerElement {
|
|||||||
protected render() {
|
protected render() {
|
||||||
const trgFor = createDurationData(this.trigger.for);
|
const trgFor = createDurationData(this.trigger.for);
|
||||||
|
|
||||||
const data = { ...this.trigger, ...{ for: trgFor } };
|
const data = { ...this.trigger, for: trgFor };
|
||||||
const schema = this._schema(this.trigger.entity_id);
|
const schema = this._schema(this.trigger.entity_id);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
import { html, LitElement } from "lit";
|
import "@polymer/paper-input/paper-input";
|
||||||
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../../common/dom/fire_event";
|
||||||
|
import "../../../../../components/ha-radio";
|
||||||
|
import "../../../../../components/ha-formfield";
|
||||||
|
import type { HaRadio } from "../../../../../components/ha-radio";
|
||||||
import type { SunTrigger } from "../../../../../data/automation";
|
import type { SunTrigger } from "../../../../../data/automation";
|
||||||
import type { HomeAssistant } from "../../../../../types";
|
import type { HomeAssistant } from "../../../../../types";
|
||||||
import type { TriggerElement } from "../ha-automation-trigger-row";
|
import {
|
||||||
import type { HaFormSchema } from "../../../../../components/ha-form/types";
|
handleChangeEvent,
|
||||||
import type { LocalizeFunc } from "../../../../../common/translations/localize";
|
TriggerElement,
|
||||||
|
} from "../ha-automation-trigger-row";
|
||||||
|
|
||||||
@customElement("ha-automation-trigger-sun")
|
@customElement("ha-automation-trigger-sun")
|
||||||
export class HaSunTrigger extends LitElement implements TriggerElement {
|
export class HaSunTrigger extends LitElement implements TriggerElement {
|
||||||
@@ -14,29 +18,6 @@ export class HaSunTrigger extends LitElement implements TriggerElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public trigger!: SunTrigger;
|
@property({ attribute: false }) public trigger!: SunTrigger;
|
||||||
|
|
||||||
private _schema = memoizeOne((localize: LocalizeFunc) => [
|
|
||||||
{
|
|
||||||
name: "event",
|
|
||||||
type: "select",
|
|
||||||
required: true,
|
|
||||||
options: [
|
|
||||||
[
|
|
||||||
"sunrise",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.sun.sunrise"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"sunset",
|
|
||||||
localize(
|
|
||||||
"ui.panel.config.automation.editor.triggers.type.sun.sunset"
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{ name: "offset", selector: { text: {} } },
|
|
||||||
]);
|
|
||||||
|
|
||||||
public static get defaultConfig() {
|
public static get defaultConfig() {
|
||||||
return {
|
return {
|
||||||
event: "sunrise" as SunTrigger["event"],
|
event: "sunrise" as SunTrigger["event"],
|
||||||
@@ -45,27 +26,69 @@ export class HaSunTrigger extends LitElement implements TriggerElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
const { offset, event } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<ha-form
|
<label>
|
||||||
.schema=${this._schema(this.hass.localize)}
|
${this.hass.localize(
|
||||||
.data=${this.trigger}
|
"ui.panel.config.automation.editor.triggers.type.sun.event"
|
||||||
.hass=${this.hass}
|
)}
|
||||||
.computeLabel=${this._computeLabelCallback}
|
<ha-formfield
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.sun.sunrise"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="sunrise"
|
||||||
|
.checked=${event === "sunrise"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
<ha-formfield
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.sun.sunset"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-radio
|
||||||
|
name="event"
|
||||||
|
value="sunset"
|
||||||
|
.checked=${event === "sunset"}
|
||||||
|
@change=${this._radioGroupPicked}
|
||||||
|
></ha-radio>
|
||||||
|
</ha-formfield>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<paper-input
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.sun.offset"
|
||||||
|
)}
|
||||||
|
name="offset"
|
||||||
|
.value=${offset}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></paper-input>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _valueChanged(ev: CustomEvent): void {
|
||||||
ev.stopPropagation();
|
handleChangeEvent(this, ev);
|
||||||
const newTrigger = ev.detail.value;
|
|
||||||
fireEvent(this, "value-changed", { value: newTrigger });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeLabelCallback = (schema: HaFormSchema): string =>
|
private _radioGroupPicked(ev) {
|
||||||
this.hass.localize(
|
ev.stopPropagation();
|
||||||
`ui.panel.config.automation.editor.triggers.type.sun.${schema.name}`
|
fireEvent(this, "value-changed", {
|
||||||
);
|
value: {
|
||||||
|
...this.trigger,
|
||||||
|
event: (ev.target as HaRadio).value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@@ -1,16 +1,12 @@
|
|||||||
|
import "@polymer/paper-input/paper-input";
|
||||||
import { html, LitElement } from "lit";
|
import { html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../../common/dom/fire_event";
|
import { TimePatternTrigger } from "../../../../../data/automation";
|
||||||
import type { HaFormSchema } from "../../../../../components/ha-form/types";
|
import { HomeAssistant } from "../../../../../types";
|
||||||
import type { TimePatternTrigger } from "../../../../../data/automation";
|
import {
|
||||||
import type { HomeAssistant } from "../../../../../types";
|
handleChangeEvent,
|
||||||
import type { TriggerElement } from "../ha-automation-trigger-row";
|
TriggerElement,
|
||||||
|
} from "../ha-automation-trigger-row";
|
||||||
const SCHEMA: HaFormSchema[] = [
|
|
||||||
{ name: "hours", selector: { text: {} } },
|
|
||||||
{ name: "minutes", selector: { text: {} } },
|
|
||||||
{ name: "seconds", selector: { text: {} } },
|
|
||||||
];
|
|
||||||
|
|
||||||
@customElement("ha-automation-trigger-time_pattern")
|
@customElement("ha-automation-trigger-time_pattern")
|
||||||
export class HaTimePatternTrigger extends LitElement implements TriggerElement {
|
export class HaTimePatternTrigger extends LitElement implements TriggerElement {
|
||||||
@@ -23,27 +19,38 @@ export class HaTimePatternTrigger extends LitElement implements TriggerElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
const { hours, minutes, seconds } = this.trigger;
|
||||||
return html`
|
return html`
|
||||||
<ha-form
|
<paper-input
|
||||||
.hass=${this.hass}
|
.label=${this.hass.localize(
|
||||||
.schema=${SCHEMA}
|
"ui.panel.config.automation.editor.triggers.type.time_pattern.hours"
|
||||||
.data=${this.trigger}
|
)}
|
||||||
.computeLabel=${this._computeLabelCallback}
|
name="hours"
|
||||||
|
.value=${hours}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></paper-input>
|
||||||
|
<paper-input
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.time_pattern.minutes"
|
||||||
|
)}
|
||||||
|
name="minutes"
|
||||||
|
.value=${minutes}
|
||||||
|
@value-changed=${this._valueChanged}
|
||||||
|
></paper-input>
|
||||||
|
<paper-input
|
||||||
|
.label=${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.triggers.type.time_pattern.seconds"
|
||||||
|
)}
|
||||||
|
name="seconds"
|
||||||
|
.value=${seconds}
|
||||||
|
@value-changed=${this._valueChanged}
|
||||||
|
></paper-input>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _valueChanged(ev: CustomEvent): void {
|
private _valueChanged(ev: CustomEvent): void {
|
||||||
ev.stopPropagation();
|
handleChangeEvent(this, ev);
|
||||||
const newTrigger = ev.detail.value;
|
|
||||||
fireEvent(this, "value-changed", { value: newTrigger });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _computeLabelCallback = (schema: HaFormSchema): string =>
|
|
||||||
this.hass.localize(
|
|
||||||
`ui.panel.config.automation.editor.triggers.type.time_pattern.${schema.name}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@@ -276,153 +276,137 @@ class HUIRoot extends LitElement {
|
|||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this._showButtonMenu
|
<ha-button-menu corner="BOTTOM_START">
|
||||||
? html`
|
<ha-icon-button
|
||||||
<ha-button-menu corner="BOTTOM_START">
|
slot="trigger"
|
||||||
<ha-icon-button
|
.label=${this.hass!.localize(
|
||||||
slot="trigger"
|
"ui.panel.lovelace.editor.menu.open"
|
||||||
|
)}
|
||||||
|
.path=${mdiDotsVertical}
|
||||||
|
></ha-icon-button>
|
||||||
|
${this.narrow &&
|
||||||
|
this._conversation(this.hass.config.components)
|
||||||
|
? html`
|
||||||
|
<mwc-list-item
|
||||||
.label=${this.hass!.localize(
|
.label=${this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.menu.open"
|
"ui.panel.lovelace.menu.start_conversation"
|
||||||
)}
|
)}
|
||||||
.path=${mdiDotsVertical}
|
graphic="icon"
|
||||||
></ha-icon-button>
|
@request-selected=${this._showVoiceCommandDialog}
|
||||||
${this.narrow &&
|
>
|
||||||
this._conversation(this.hass.config.components)
|
<span
|
||||||
? html`
|
>${this.hass!.localize(
|
||||||
<mwc-list-item
|
"ui.panel.lovelace.menu.start_conversation"
|
||||||
.label=${this.hass!.localize(
|
)}</span
|
||||||
"ui.panel.lovelace.menu.start_conversation"
|
>
|
||||||
)}
|
<ha-svg-icon
|
||||||
graphic="icon"
|
slot="graphic"
|
||||||
@request-selected=${this
|
.path=${mdiMicrophone}
|
||||||
._showVoiceCommandDialog}
|
></ha-svg-icon>
|
||||||
>
|
</mwc-list-item>
|
||||||
<span
|
`
|
||||||
>${this.hass!.localize(
|
: ""}
|
||||||
"ui.panel.lovelace.menu.start_conversation"
|
${this._yamlMode
|
||||||
)}</span
|
? html`
|
||||||
>
|
<mwc-list-item
|
||||||
<ha-svg-icon
|
aria-label=${this.hass!.localize(
|
||||||
slot="graphic"
|
"ui.common.refresh"
|
||||||
.path=${mdiMicrophone}
|
)}
|
||||||
></ha-svg-icon>
|
graphic="icon"
|
||||||
</mwc-list-item>
|
@request-selected=${this._handleRefresh}
|
||||||
`
|
>
|
||||||
: ""}
|
<span
|
||||||
${this._yamlMode
|
>${this.hass!.localize("ui.common.refresh")}</span
|
||||||
? html`
|
>
|
||||||
<mwc-list-item
|
<ha-svg-icon
|
||||||
aria-label=${this.hass!.localize(
|
slot="graphic"
|
||||||
"ui.common.refresh"
|
.path=${mdiRefresh}
|
||||||
)}
|
></ha-svg-icon>
|
||||||
graphic="icon"
|
</mwc-list-item>
|
||||||
@request-selected=${this._handleRefresh}
|
<mwc-list-item
|
||||||
>
|
aria-label=${this.hass!.localize(
|
||||||
<span
|
"ui.panel.lovelace.unused_entities.title"
|
||||||
>${this.hass!.localize(
|
)}
|
||||||
"ui.common.refresh"
|
graphic="icon"
|
||||||
)}</span
|
@request-selected=${this._handleUnusedEntities}
|
||||||
>
|
>
|
||||||
<ha-svg-icon
|
<span
|
||||||
slot="graphic"
|
>${this.hass!.localize(
|
||||||
.path=${mdiRefresh}
|
"ui.panel.lovelace.unused_entities.title"
|
||||||
></ha-svg-icon>
|
)}</span
|
||||||
</mwc-list-item>
|
>
|
||||||
<mwc-list-item
|
<ha-svg-icon
|
||||||
aria-label=${this.hass!.localize(
|
slot="graphic"
|
||||||
"ui.panel.lovelace.unused_entities.title"
|
.path=${mdiShape}
|
||||||
)}
|
></ha-svg-icon>
|
||||||
graphic="icon"
|
</mwc-list-item>
|
||||||
@request-selected=${this
|
`
|
||||||
._handleUnusedEntities}
|
: ""}
|
||||||
>
|
${(this.hass.panels.lovelace?.config as LovelacePanelConfig)
|
||||||
<span
|
?.mode === "yaml"
|
||||||
>${this.hass!.localize(
|
? html`
|
||||||
"ui.panel.lovelace.unused_entities.title"
|
<mwc-list-item
|
||||||
)}</span
|
graphic="icon"
|
||||||
>
|
aria-label=${this.hass!.localize(
|
||||||
<ha-svg-icon
|
"ui.panel.lovelace.menu.reload_resources"
|
||||||
slot="graphic"
|
)}
|
||||||
.path=${mdiShape}
|
@request-selected=${this._handleReloadResources}
|
||||||
></ha-svg-icon>
|
>
|
||||||
</mwc-list-item>
|
${this.hass!.localize(
|
||||||
`
|
"ui.panel.lovelace.menu.reload_resources"
|
||||||
: ""}
|
)}
|
||||||
${(
|
<ha-svg-icon
|
||||||
this.hass.panels.lovelace
|
slot="graphic"
|
||||||
?.config as LovelacePanelConfig
|
.path=${mdiRefresh}
|
||||||
)?.mode === "yaml"
|
></ha-svg-icon>
|
||||||
? html`
|
</mwc-list-item>
|
||||||
<mwc-list-item
|
`
|
||||||
graphic="icon"
|
: ""}
|
||||||
aria-label=${this.hass!.localize(
|
${this.hass!.user?.is_admin && !this.hass!.config.safe_mode
|
||||||
"ui.panel.lovelace.menu.reload_resources"
|
? html`
|
||||||
)}
|
<mwc-list-item
|
||||||
@request-selected=${this
|
graphic="icon"
|
||||||
._handleReloadResources}
|
aria-label=${this.hass!.localize(
|
||||||
>
|
"ui.panel.lovelace.menu.configure_ui"
|
||||||
${this.hass!.localize(
|
)}
|
||||||
"ui.panel.lovelace.menu.reload_resources"
|
@request-selected=${this._handleEnableEditMode}
|
||||||
)}
|
>
|
||||||
<ha-svg-icon
|
${this.hass!.localize(
|
||||||
slot="graphic"
|
"ui.panel.lovelace.menu.configure_ui"
|
||||||
.path=${mdiRefresh}
|
)}
|
||||||
></ha-svg-icon>
|
<ha-svg-icon
|
||||||
</mwc-list-item>
|
slot="graphic"
|
||||||
`
|
.path=${mdiPencil}
|
||||||
: ""}
|
></ha-svg-icon>
|
||||||
${this.hass!.user?.is_admin &&
|
</mwc-list-item>
|
||||||
!this.hass!.config.safe_mode
|
`
|
||||||
? html`
|
: ""}
|
||||||
<mwc-list-item
|
${this._editMode
|
||||||
graphic="icon"
|
? html`
|
||||||
aria-label=${this.hass!.localize(
|
<a
|
||||||
"ui.panel.lovelace.menu.configure_ui"
|
href=${documentationUrl(this.hass, "/lovelace/")}
|
||||||
)}
|
rel="noreferrer"
|
||||||
@request-selected=${this
|
class="menu-link"
|
||||||
._handleEnableEditMode}
|
target="_blank"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
<mwc-list-item
|
||||||
"ui.panel.lovelace.menu.configure_ui"
|
graphic="icon"
|
||||||
)}
|
aria-label=${this.hass!.localize(
|
||||||
<ha-svg-icon
|
"ui.panel.lovelace.menu.help"
|
||||||
slot="graphic"
|
)}
|
||||||
.path=${mdiPencil}
|
>
|
||||||
></ha-svg-icon>
|
${this.hass!.localize(
|
||||||
</mwc-list-item>
|
"ui.panel.lovelace.menu.help"
|
||||||
`
|
)}
|
||||||
: ""}
|
<ha-svg-icon
|
||||||
${this._editMode
|
slot="graphic"
|
||||||
? html`
|
.path=${mdiHelp}
|
||||||
<a
|
></ha-svg-icon>
|
||||||
href=${documentationUrl(
|
</mwc-list-item>
|
||||||
this.hass,
|
</a>
|
||||||
"/lovelace/"
|
`
|
||||||
)}
|
: ""}
|
||||||
rel="noreferrer"
|
</ha-button-menu>
|
||||||
class="menu-link"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<mwc-list-item
|
|
||||||
graphic="icon"
|
|
||||||
aria-label=${this.hass!.localize(
|
|
||||||
"ui.panel.lovelace.menu.help"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
${this.hass!.localize(
|
|
||||||
"ui.panel.lovelace.menu.help"
|
|
||||||
)}
|
|
||||||
<ha-svg-icon
|
|
||||||
slot="graphic"
|
|
||||||
.path=${mdiHelp}
|
|
||||||
></ha-svg-icon>
|
|
||||||
</mwc-list-item>
|
|
||||||
</a>
|
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
</ha-button-menu>
|
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
</app-toolbar>
|
</app-toolbar>
|
||||||
`}
|
`}
|
||||||
${this._editMode
|
${this._editMode
|
||||||
@@ -637,17 +621,6 @@ class HUIRoot extends LitElement {
|
|||||||
return this.shadowRoot!.getElementById("view") as HTMLDivElement;
|
return this.shadowRoot!.getElementById("view") as HTMLDivElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get _showButtonMenu(): boolean {
|
|
||||||
return (
|
|
||||||
(this.narrow && this._conversation(this.hass.config.components)) ||
|
|
||||||
this._editMode ||
|
|
||||||
(this.hass!.user?.is_admin && !this.hass!.config.safe_mode) ||
|
|
||||||
(this.hass.panels.lovelace?.config as LovelacePanelConfig)?.mode ===
|
|
||||||
"yaml" ||
|
|
||||||
this._yamlMode
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _handleRefresh(ev: CustomEvent<RequestSelectedDetail>): void {
|
private _handleRefresh(ev: CustomEvent<RequestSelectedDetail>): void {
|
||||||
if (!shouldHandleRequestSelectedEvent(ev)) {
|
if (!shouldHandleRequestSelectedEvent(ev)) {
|
||||||
return;
|
return;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import type { PropertyValues } from "lit";
|
import type { PropertyValues } from "lit";
|
||||||
import tinykeys from "tinykeys";
|
import tinykeys from "tinykeys";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
|
||||||
import {
|
import {
|
||||||
QuickBarParams,
|
QuickBarParams,
|
||||||
showQuickBar,
|
showQuickBar,
|
||||||
@@ -13,7 +12,6 @@ declare global {
|
|||||||
interface HASSDomEvents {
|
interface HASSDomEvents {
|
||||||
"hass-quick-bar": QuickBarParams;
|
"hass-quick-bar": QuickBarParams;
|
||||||
"hass-enable-shortcuts": HomeAssistant["enableShortcuts"];
|
"hass-enable-shortcuts": HomeAssistant["enableShortcuts"];
|
||||||
"dev-tools-toggle": never;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +32,6 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
|
|||||||
tinykeys(window, {
|
tinykeys(window, {
|
||||||
e: (ev) => this._showQuickBar(ev),
|
e: (ev) => this._showQuickBar(ev),
|
||||||
c: (ev) => this._showQuickBar(ev, true),
|
c: (ev) => this._showQuickBar(ev, true),
|
||||||
d: () => this._toggleDeveloperToolsSidebar(),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,13 +51,6 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _toggleDeveloperToolsSidebar(): void {
|
|
||||||
localStorage.showDeveloperTools =
|
|
||||||
localStorage.showDeveloperTools !== "true";
|
|
||||||
fireEvent(this, "dev-tools-toggle");
|
|
||||||
this.requestUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
private _canOverrideAlphanumericInput(e: KeyboardEvent) {
|
private _canOverrideAlphanumericInput(e: KeyboardEvent) {
|
||||||
const el = e.composedPath()[0] as any;
|
const el = e.composedPath()[0] as any;
|
||||||
|
|
Reference in New Issue
Block a user