mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 14:27:20 +00:00
Convert inputs (#11907)
* Convert inputs * Update dialog-thingtalk.ts * imports
This commit is contained in:
parent
7c94ced303
commit
8e51878b6d
@ -1,5 +1,4 @@
|
|||||||
import { mdiFolderUpload } from "@mdi/js";
|
import { mdiFolderUpload } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input-container";
|
|
||||||
import { html, LitElement, TemplateResult } from "lit";
|
import { html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
|
@ -41,7 +41,7 @@ export class HaDateInput extends LitElement {
|
|||||||
return html`<ha-textfield
|
return html`<ha-textfield
|
||||||
.label=${this.label}
|
.label=${this.label}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
iconTrailing="calendar"
|
iconTrailing
|
||||||
@click=${this._openDialog}
|
@click=${this._openDialog}
|
||||||
.value=${this.value
|
.value=${this.value
|
||||||
? formatDateNumeric(new Date(this.value), this.locale)
|
? formatDateNumeric(new Date(this.value), this.locale)
|
||||||
|
@ -9,6 +9,12 @@ export class HaTextField extends TextFieldBase {
|
|||||||
|
|
||||||
@property({ attribute: "error-message" }) public errorMessage?: string;
|
@property({ attribute: "error-message" }) public errorMessage?: string;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
@property({ type: Boolean }) public icon?: boolean;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
@property({ type: Boolean }) public iconTrailing?: boolean;
|
||||||
|
|
||||||
override updated(changedProperties: PropertyValues) {
|
override updated(changedProperties: PropertyValues) {
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
if (
|
if (
|
||||||
@ -53,6 +59,11 @@ export class HaTextField extends TextFieldBase {
|
|||||||
padding-right: var(--text-field-suffix-padding-right, 0px);
|
padding-right: var(--text-field-suffix-padding-right, 0px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mdc-text-field:not(.mdc-text-field--disabled)
|
||||||
|
.mdc-text-field__affix--suffix {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
.mdc-text-field__icon {
|
.mdc-text-field__icon {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class SearchInput extends LitElement {
|
|||||||
.autofocus=${this.autofocus}
|
.autofocus=${this.autofocus}
|
||||||
.label=${this.label || "Search"}
|
.label=${this.label || "Search"}
|
||||||
.value=${this.filter || ""}
|
.value=${this.filter || ""}
|
||||||
.icon=${true}
|
icon
|
||||||
.iconTrailing=${this.filter || this.suffix}
|
.iconTrailing=${this.filter || this.suffix}
|
||||||
@input=${this._filterInputChanged}
|
@input=${this._filterInputChanged}
|
||||||
>
|
>
|
||||||
|
@ -162,7 +162,7 @@ export class QuickBar extends LitElement {
|
|||||||
"ui.dialogs.quick-bar.filter_placeholder"
|
"ui.dialogs.quick-bar.filter_placeholder"
|
||||||
)}
|
)}
|
||||||
.value=${this._commandMode ? `>${this._search}` : this._search}
|
.value=${this._commandMode ? `>${this._search}` : this._search}
|
||||||
.icon=${true}
|
icon
|
||||||
.iconTrailing=${this._search !== undefined || this._narrow}
|
.iconTrailing=${this._search !== undefined || this._narrow}
|
||||||
@input=${this._handleSearchChange}
|
@input=${this._handleSearchChange}
|
||||||
@keydown=${this._handleInputKeyDown}
|
@keydown=${this._handleInputKeyDown}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/* eslint-disable lit/prefer-static-styles */
|
/* eslint-disable lit/prefer-static-styles */
|
||||||
|
import "@material/mwc-button/mwc-button";
|
||||||
import { mdiMicrophone } from "@mdi/js";
|
import { mdiMicrophone } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
@ -10,12 +9,16 @@ import {
|
|||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state, query } from "lit/decorators";
|
import { customElement, property, query, state } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
import { SpeechRecognition } from "../../common/dom/speech-recognition";
|
import { SpeechRecognition } from "../../common/dom/speech-recognition";
|
||||||
import { uid } from "../../common/util/uid";
|
import { uid } from "../../common/util/uid";
|
||||||
|
import "../../components/ha-dialog";
|
||||||
|
import type { HaDialog } from "../../components/ha-dialog";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
|
import "../../components/ha-textfield";
|
||||||
|
import type { HaTextField } from "../../components/ha-textfield";
|
||||||
import {
|
import {
|
||||||
AgentInfo,
|
AgentInfo,
|
||||||
getAgentInfo,
|
getAgentInfo,
|
||||||
@ -24,9 +27,6 @@ import {
|
|||||||
} from "../../data/conversation";
|
} from "../../data/conversation";
|
||||||
import { haStyleDialog } from "../../resources/styles";
|
import { haStyleDialog } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import "../../components/ha-dialog";
|
|
||||||
import type { HaDialog } from "../../components/ha-dialog";
|
|
||||||
import "@material/mwc-button/mwc-button";
|
|
||||||
|
|
||||||
interface Message {
|
interface Message {
|
||||||
who: string;
|
who: string;
|
||||||
@ -127,18 +127,19 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="input" slot="primaryAction">
|
<div class="input" slot="primaryAction">
|
||||||
<paper-input
|
<ha-textfield
|
||||||
@keyup=${this._handleKeyUp}
|
@keyup=${this._handleKeyUp}
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
`ui.dialogs.voice_command.${
|
`ui.dialogs.voice_command.${
|
||||||
SpeechRecognition ? "label_voice" : "label"
|
SpeechRecognition ? "label_voice" : "label"
|
||||||
}`
|
}`
|
||||||
)}
|
)}
|
||||||
autofocus
|
dialogInitialFocus
|
||||||
|
iconTrailing
|
||||||
>
|
>
|
||||||
${SpeechRecognition
|
${SpeechRecognition
|
||||||
? html`
|
? html`
|
||||||
<span suffix="" slot="suffix">
|
<span slot="trailingIcon">
|
||||||
${this.results
|
${this.results
|
||||||
? html`
|
? html`
|
||||||
<div class="bouncer">
|
<div class="bouncer">
|
||||||
@ -155,7 +156,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
</span>
|
</span>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
${this._agentInfo && this._agentInfo.attribution
|
${this._agentInfo && this._agentInfo.attribution
|
||||||
? html`
|
? html`
|
||||||
<a
|
<a
|
||||||
@ -195,7 +196,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleKeyUp(ev: KeyboardEvent) {
|
private _handleKeyUp(ev: KeyboardEvent) {
|
||||||
const input = ev.target as PaperInputElement;
|
const input = ev.target as HaTextField;
|
||||||
if (ev.keyCode === 13 && input.value) {
|
if (ev.keyCode === 13 && input.value) {
|
||||||
this._processText(input.value);
|
this._processText(input.value);
|
||||||
input.value = "";
|
input.value = "";
|
||||||
@ -327,6 +328,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
css`
|
css`
|
||||||
ha-icon-button {
|
ha-icon-button {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
|
margin-right: -24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-icon-button[active] {
|
ha-icon-button[active] {
|
||||||
@ -338,7 +340,9 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
--secondary-action-button-flex: 0;
|
--secondary-action-button-flex: 0;
|
||||||
--mdc-dialog-max-width: 450px;
|
--mdc-dialog-max-width: 450px;
|
||||||
}
|
}
|
||||||
|
ha-textfield {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
a.button {
|
a.button {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@ -406,7 +410,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
.double-bounce1,
|
.double-bounce1,
|
||||||
.double-bounce2 {
|
.double-bounce2 {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import "@polymer/paper-input/paper-textarea";
|
|
||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import "../../../components/entity/ha-entity-toggle";
|
import "../../../components/entity/ha-entity-toggle";
|
||||||
@ -11,6 +10,7 @@ import "../../../components/ha-circular-progress";
|
|||||||
import "../../../components/ha-markdown";
|
import "../../../components/ha-markdown";
|
||||||
import "../../../components/ha-selector/ha-selector";
|
import "../../../components/ha-selector/ha-selector";
|
||||||
import "../../../components/ha-settings-row";
|
import "../../../components/ha-settings-row";
|
||||||
|
import "../../../components/ha-textfield";
|
||||||
import {
|
import {
|
||||||
BlueprintAutomationConfig,
|
BlueprintAutomationConfig,
|
||||||
triggerAutomationActions,
|
triggerAutomationActions,
|
||||||
@ -38,6 +38,8 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
|
|
||||||
@state() private _blueprints?: Blueprints;
|
@state() private _blueprints?: Blueprints;
|
||||||
|
|
||||||
|
@state() private _showDescription = false;
|
||||||
|
|
||||||
protected firstUpdated(changedProps) {
|
protected firstUpdated(changedProps) {
|
||||||
super.firstUpdated(changedProps);
|
super.firstUpdated(changedProps);
|
||||||
this._getBlueprints();
|
this._getBlueprints();
|
||||||
@ -50,6 +52,17 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
return this._blueprints[this.config.use_blueprint.path];
|
return this._blueprints[this.config.use_blueprint.path];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected willUpdate(changedProps: PropertyValues): void {
|
||||||
|
super.willUpdate(changedProps);
|
||||||
|
if (
|
||||||
|
!this._showDescription &&
|
||||||
|
changedProps.has("config") &&
|
||||||
|
this.config.description
|
||||||
|
) {
|
||||||
|
this._showDescription = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
const blueprint = this._blueprint;
|
const blueprint = this._blueprint;
|
||||||
return html`
|
return html`
|
||||||
@ -64,16 +77,18 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
</span>
|
</span>
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<paper-input
|
<ha-textfield
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.alias"
|
"ui.panel.config.automation.editor.alias"
|
||||||
)}
|
)}
|
||||||
name="alias"
|
name="alias"
|
||||||
.value=${this.config.alias}
|
.value=${this.config.alias || ""}
|
||||||
@value-changed=${this._valueChanged}
|
@change=${this._valueChanged}
|
||||||
>
|
>
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
<paper-textarea
|
${this._showDescription
|
||||||
|
? html`
|
||||||
|
<ha-textarea
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.description.label"
|
"ui.panel.config.automation.editor.description.label"
|
||||||
)}
|
)}
|
||||||
@ -81,9 +96,20 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
"ui.panel.config.automation.editor.description.placeholder"
|
"ui.panel.config.automation.editor.description.placeholder"
|
||||||
)}
|
)}
|
||||||
name="description"
|
name="description"
|
||||||
.value=${this.config.description}
|
autogrow
|
||||||
@value-changed=${this._valueChanged}
|
.value=${this.config.description || ""}
|
||||||
></paper-textarea>
|
@change=${this._valueChanged}
|
||||||
|
></ha-textarea>
|
||||||
|
`
|
||||||
|
: html`
|
||||||
|
<div class="link-button-row">
|
||||||
|
<button class="link" @click=${this._addDescription}>
|
||||||
|
${this.hass.localize(
|
||||||
|
"ui.panel.config.automation.editor.description.add"
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`}
|
||||||
</div>
|
</div>
|
||||||
${this.stateObj
|
${this.stateObj
|
||||||
? html`
|
? html`
|
||||||
@ -173,15 +199,14 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
value?.default}
|
value?.default}
|
||||||
@value-changed=${this._inputChanged}
|
@value-changed=${this._inputChanged}
|
||||||
></ha-selector>`
|
></ha-selector>`
|
||||||
: html`<paper-input
|
: html`<ha-textfield
|
||||||
.key=${key}
|
.key=${key}
|
||||||
required
|
required
|
||||||
.value=${(this.config.use_blueprint.input &&
|
.value=${(this.config.use_blueprint.input &&
|
||||||
this.config.use_blueprint.input[key]) ??
|
this.config.use_blueprint.input[key]) ??
|
||||||
value?.default}
|
value?.default}
|
||||||
@value-changed=${this._inputChanged}
|
@input=${this._inputChanged}
|
||||||
no-label-float
|
></ha-textfield>`}
|
||||||
></paper-input>`}
|
|
||||||
</ha-settings-row>`
|
</ha-settings-row>`
|
||||||
)
|
)
|
||||||
: html`<p class="padding">
|
: html`<p class="padding">
|
||||||
@ -221,7 +246,7 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const target = ev.target as any;
|
const target = ev.target as any;
|
||||||
const key = target.key;
|
const key = target.key;
|
||||||
const value = ev.detail.value;
|
const value = ev.detail?.value || target.value;
|
||||||
if (
|
if (
|
||||||
(this.config.use_blueprint.input &&
|
(this.config.use_blueprint.input &&
|
||||||
this.config.use_blueprint.input[key] === value) ||
|
this.config.use_blueprint.input[key] === value) ||
|
||||||
@ -262,6 +287,10 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _addDescription() {
|
||||||
|
this._showDescription = true;
|
||||||
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
@ -273,9 +302,16 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
.padding {
|
.padding {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
.link-button-row {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
.blueprint-picker-container {
|
.blueprint-picker-container {
|
||||||
padding: 0 16px 16px;
|
padding: 0 16px 16px;
|
||||||
}
|
}
|
||||||
|
ha-textarea,
|
||||||
|
ha-textfield {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
h3 {
|
h3 {
|
||||||
margin: 16px;
|
margin: 16px;
|
||||||
}
|
}
|
||||||
@ -292,9 +328,7 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
--paper-time-input-justify-content: flex-end;
|
--paper-time-input-justify-content: flex-end;
|
||||||
border-top: 1px solid var(--divider-color);
|
border-top: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
:host(:not([narrow])) ha-settings-row paper-input {
|
:host(:not([narrow])) ha-settings-row ha-textfield,
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
:host(:not([narrow])) ha-settings-row ha-selector {
|
:host(:not([narrow])) ha-settings-row ha-selector {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, state, query } from "lit/decorators";
|
import { customElement, property, query, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||||
import "../../../../components/ha-circular-progress";
|
import "../../../../components/ha-circular-progress";
|
||||||
|
import "../../../../components/ha-dialog";
|
||||||
|
import "../../../../components/ha-textfield";
|
||||||
|
import type { HaTextField } from "../../../../components/ha-textfield";
|
||||||
import type { AutomationConfig } from "../../../../data/automation";
|
import type { AutomationConfig } from "../../../../data/automation";
|
||||||
import { convertThingTalk } from "../../../../data/cloud";
|
import { convertThingTalk } from "../../../../data/cloud";
|
||||||
import { haStyle, haStyleDialog } from "../../../../resources/styles";
|
import { haStyle, haStyleDialog } from "../../../../resources/styles";
|
||||||
@ -12,7 +13,6 @@ import type { HomeAssistant } from "../../../../types";
|
|||||||
import "./ha-thingtalk-placeholders";
|
import "./ha-thingtalk-placeholders";
|
||||||
import type { PlaceholderValues } from "./ha-thingtalk-placeholders";
|
import type { PlaceholderValues } from "./ha-thingtalk-placeholders";
|
||||||
import type { ThingtalkDialogParams } from "./show-dialog-thingtalk";
|
import type { ThingtalkDialogParams } from "./show-dialog-thingtalk";
|
||||||
import "../../../../components/ha-dialog";
|
|
||||||
|
|
||||||
export interface Placeholder {
|
export interface Placeholder {
|
||||||
name: string;
|
name: string;
|
||||||
@ -38,7 +38,7 @@ class DialogThingtalk extends LitElement {
|
|||||||
|
|
||||||
@state() private _placeholders?: PlaceholderContainer;
|
@state() private _placeholders?: PlaceholderContainer;
|
||||||
|
|
||||||
@query("#input") private _input?: PaperInputElement;
|
@query("#input") private _input?: HaTextField;
|
||||||
|
|
||||||
private _value?: string;
|
private _value?: string;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class DialogThingtalk extends LitElement {
|
|||||||
this._placeholders = undefined;
|
this._placeholders = undefined;
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
if (this._input) {
|
if (this._input) {
|
||||||
this._input.value = null;
|
this._input.value = "";
|
||||||
}
|
}
|
||||||
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
||||||
}
|
}
|
||||||
@ -127,13 +127,13 @@ class DialogThingtalk extends LitElement {
|
|||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<paper-input
|
<ha-textfield
|
||||||
id="input"
|
id="input"
|
||||||
label="What should this automation do?"
|
label="What should this automation do?"
|
||||||
.value=${this._value}
|
.value=${this._value}
|
||||||
autofocus
|
autofocus
|
||||||
@keyup=${this._handleKeyUp}
|
@keyup=${this._handleKeyUp}
|
||||||
></paper-input>
|
></ha-textfield>
|
||||||
<a
|
<a
|
||||||
href="https://almond.stanford.edu/"
|
href="https://almond.stanford.edu/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -88,7 +88,7 @@ export class HaWebhookTrigger extends LitElement {
|
|||||||
.helper=${this.hass.localize(
|
.helper=${this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.triggers.type.webhook.webhook_id_helper"
|
"ui.panel.config.automation.editor.triggers.type.webhook.webhook_id_helper"
|
||||||
)}
|
)}
|
||||||
.iconTrailing=${true}
|
iconTrailing
|
||||||
.value=${webhookId || ""}
|
.value=${webhookId || ""}
|
||||||
@input=${this._valueChanged}
|
@input=${this._valueChanged}
|
||||||
>
|
>
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
import { css, CSSResultGroup, html, LitElement } from "lit";
|
||||||
import { state } from "lit/decorators";
|
import { query, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||||
|
import { copyToClipboard } from "../../../../common/util/copy-clipboard";
|
||||||
|
import type { HaTextField } from "../../../../components/ha-textfield";
|
||||||
|
import "../../../../components/ha-textfield";
|
||||||
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
|
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
|
||||||
import { haStyle } from "../../../../resources/styles";
|
import { haStyle, haStyleDialog } from "../../../../resources/styles";
|
||||||
import { HomeAssistant } from "../../../../types";
|
import { HomeAssistant } from "../../../../types";
|
||||||
import { documentationUrl } from "../../../../util/documentation-url";
|
import { documentationUrl } from "../../../../util/documentation-url";
|
||||||
import { WebhookDialogParams } from "./show-dialog-manage-cloudhook";
|
import { WebhookDialogParams } from "./show-dialog-manage-cloudhook";
|
||||||
@ -17,6 +18,8 @@ export class DialogManageCloudhook extends LitElement {
|
|||||||
|
|
||||||
@state() private _params?: WebhookDialogParams;
|
@state() private _params?: WebhookDialogParams;
|
||||||
|
|
||||||
|
@query("ha-textfield") _input!: HaTextField;
|
||||||
|
|
||||||
public showDialog(params: WebhookDialogParams) {
|
public showDialog(params: WebhookDialogParams) {
|
||||||
this._params = params;
|
this._params = params;
|
||||||
}
|
}
|
||||||
@ -53,12 +56,12 @@ export class DialogManageCloudhook extends LitElement {
|
|||||||
"ui.panel.config.cloud.dialog_cloudhook.available_at"
|
"ui.panel.config.cloud.dialog_cloudhook.available_at"
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<paper-input
|
<ha-textfield
|
||||||
label=${inputLabel}
|
.label=${inputLabel}
|
||||||
value=${cloudhook.cloudhook_url}
|
.value=${cloudhook.cloudhook_url}
|
||||||
@click=${this._copyClipboard}
|
@click=${this._copyClipboard}
|
||||||
@blur=${this._restoreLabel}
|
@blur=${this._restoreLabel}
|
||||||
></paper-input>
|
></ha-textfield>
|
||||||
<p>
|
<p>
|
||||||
${cloudhook.managed
|
${cloudhook.managed
|
||||||
? html`
|
? html`
|
||||||
@ -98,10 +101,6 @@ export class DialogManageCloudhook extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private get _paperInput(): PaperInputElement {
|
|
||||||
return this.shadowRoot!.querySelector("paper-input")!;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _disableWebhook() {
|
private async _disableWebhook() {
|
||||||
showConfirmationDialog(this, {
|
showConfirmationDialog(this, {
|
||||||
text: this.hass!.localize(
|
text: this.hass!.localize(
|
||||||
@ -117,14 +116,10 @@ export class DialogManageCloudhook extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _copyClipboard(ev: FocusEvent) {
|
private _copyClipboard(ev: FocusEvent) {
|
||||||
// paper-input -> iron-input -> input
|
const textField = ev.currentTarget as HaTextField;
|
||||||
const paperInput = ev.currentTarget as PaperInputElement;
|
|
||||||
const input = (paperInput.inputElement as any)
|
|
||||||
.inputElement as HTMLInputElement;
|
|
||||||
input.setSelectionRange(0, input.value.length);
|
|
||||||
try {
|
try {
|
||||||
document.execCommand("copy");
|
copyToClipboard(textField.value);
|
||||||
paperInput.label = this.hass!.localize(
|
textField.label = this.hass!.localize(
|
||||||
"ui.panel.config.cloud.dialog_cloudhook.copied_to_clipboard"
|
"ui.panel.config.cloud.dialog_cloudhook.copied_to_clipboard"
|
||||||
);
|
);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
@ -133,18 +128,19 @@ export class DialogManageCloudhook extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _restoreLabel() {
|
private _restoreLabel() {
|
||||||
this._paperInput.label = inputLabel;
|
this._input.label = inputLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return [
|
return [
|
||||||
haStyle,
|
haStyle,
|
||||||
|
haStyleDialog,
|
||||||
css`
|
css`
|
||||||
ha-dialog {
|
ha-dialog {
|
||||||
width: 650px;
|
width: 650px;
|
||||||
}
|
}
|
||||||
paper-input {
|
ha-textfield {
|
||||||
margin-top: -8px;
|
display: block;
|
||||||
}
|
}
|
||||||
button.link {
|
button.link {
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
|
@ -19,6 +19,7 @@ import "../../../../components/entity/ha-statistic-picker";
|
|||||||
import "../../../../components/entity/ha-entity-picker";
|
import "../../../../components/entity/ha-entity-picker";
|
||||||
import "../../../../components/ha-radio";
|
import "../../../../components/ha-radio";
|
||||||
import "../../../../components/ha-formfield";
|
import "../../../../components/ha-formfield";
|
||||||
|
import "../../../../components/ha-textfield";
|
||||||
import type { HaRadio } from "../../../../components/ha-radio";
|
import type { HaRadio } from "../../../../components/ha-radio";
|
||||||
|
|
||||||
@customElement("dialog-energy-gas-settings")
|
@customElement("dialog-energy-gas-settings")
|
||||||
@ -188,20 +189,19 @@ export class DialogEnergyGasSettings
|
|||||||
></ha-radio>
|
></ha-radio>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
${this._costs === "number"
|
${this._costs === "number"
|
||||||
? html`<paper-input
|
? html`<ha-textfield
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
`ui.panel.config.energy.gas.dialog.cost_number_input`,
|
`ui.panel.config.energy.gas.dialog.cost_number_input`,
|
||||||
{ unit }
|
{ unit }
|
||||||
)}
|
)}
|
||||||
no-label-float
|
|
||||||
class="price-options"
|
class="price-options"
|
||||||
step=".01"
|
step=".01"
|
||||||
type="number"
|
type="number"
|
||||||
.value=${this._source.number_energy_price}
|
.value=${this._source.number_energy_price}
|
||||||
@value-changed=${this._numberPriceChanged}
|
@change=${this._numberPriceChanged}
|
||||||
|
.suffix=${`${this.hass.config.currency}/${unit}`}
|
||||||
>
|
>
|
||||||
<span slot="suffix">${this.hass.config.currency}/${unit}</span>
|
</ha-textfield>`
|
||||||
</paper-input>`
|
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
<mwc-button @click=${this.closeDialog} slot="secondaryAction">
|
<mwc-button @click=${this.closeDialog} slot="secondaryAction">
|
||||||
@ -223,10 +223,10 @@ export class DialogEnergyGasSettings
|
|||||||
this._costs = input.value as any;
|
this._costs = input.value as any;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _numberPriceChanged(ev: CustomEvent) {
|
private _numberPriceChanged(ev) {
|
||||||
this._source = {
|
this._source = {
|
||||||
...this._source!,
|
...this._source!,
|
||||||
number_energy_price: Number(ev.detail.value),
|
number_energy_price: Number(ev.target.value),
|
||||||
entity_energy_price: null,
|
entity_energy_price: null,
|
||||||
stat_cost: null,
|
stat_cost: null,
|
||||||
};
|
};
|
||||||
@ -295,13 +295,10 @@ export class DialogEnergyGasSettings
|
|||||||
ha-formfield {
|
ha-formfield {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
ha-statistic-picker {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.price-options {
|
.price-options {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 52px;
|
padding-left: 52px;
|
||||||
margin-top: -16px;
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
@ -190,24 +190,21 @@ export class DialogEnergyGridFlowSettings
|
|||||||
></ha-radio>
|
></ha-radio>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
${this._costs === "number"
|
${this._costs === "number"
|
||||||
? html`<paper-input
|
? html`<ha-textfield
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_input`
|
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_input`
|
||||||
)}
|
)}
|
||||||
no-label-float
|
|
||||||
class="price-options"
|
class="price-options"
|
||||||
step=".01"
|
step=".01"
|
||||||
type="number"
|
type="number"
|
||||||
.value=${this._source.number_energy_price}
|
.value=${this._source.number_energy_price}
|
||||||
@value-changed=${this._numberPriceChanged}
|
.suffix=${this.hass.localize(
|
||||||
>
|
|
||||||
<span slot="suffix"
|
|
||||||
>${this.hass.localize(
|
|
||||||
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_suffix`,
|
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_suffix`,
|
||||||
{ currency: this.hass.config.currency }
|
{ currency: this.hass.config.currency }
|
||||||
)}</span
|
)}
|
||||||
|
@change=${this._numberPriceChanged}
|
||||||
>
|
>
|
||||||
</paper-input>`
|
</ha-textfield>`
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
<mwc-button @click=${this.closeDialog} slot="secondaryAction">
|
<mwc-button @click=${this.closeDialog} slot="secondaryAction">
|
||||||
@ -302,13 +299,10 @@ export class DialogEnergyGridFlowSettings
|
|||||||
ha-formfield {
|
ha-formfield {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
ha-statistic-picker {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.price-options {
|
.price-options {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 52px;
|
padding-left: 52px;
|
||||||
margin-top: -16px;
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import "@material/mwc-button/mwc-button";
|
import "@material/mwc-button/mwc-button";
|
||||||
import { mdiAlertCircle, mdiCheckCircle, mdiQrcodeScan } from "@mdi/js";
|
import { mdiAlertCircle, mdiCheckCircle, mdiQrcodeScan } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
|
||||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, query, state } from "lit/decorators";
|
import { customElement, property, query, state } from "lit/decorators";
|
||||||
@ -11,28 +9,30 @@ import { HaCheckbox } from "../../../../../components/ha-checkbox";
|
|||||||
import "../../../../../components/ha-circular-progress";
|
import "../../../../../components/ha-circular-progress";
|
||||||
import { createCloseHeading } from "../../../../../components/ha-dialog";
|
import { createCloseHeading } from "../../../../../components/ha-dialog";
|
||||||
import "../../../../../components/ha-formfield";
|
import "../../../../../components/ha-formfield";
|
||||||
|
import "../../../../../components/ha-qr-scanner";
|
||||||
import "../../../../../components/ha-radio";
|
import "../../../../../components/ha-radio";
|
||||||
import "../../../../../components/ha-switch";
|
import "../../../../../components/ha-switch";
|
||||||
|
import "../../../../../components/ha-textfield";
|
||||||
|
import type { HaTextField } from "../../../../../components/ha-textfield";
|
||||||
import {
|
import {
|
||||||
zwaveGrantSecurityClasses,
|
|
||||||
InclusionStrategy,
|
InclusionStrategy,
|
||||||
MINIMUM_QR_STRING_LENGTH,
|
MINIMUM_QR_STRING_LENGTH,
|
||||||
zwaveParseQrCode,
|
PlannedProvisioningEntry,
|
||||||
provisionZwaveSmartStartNode,
|
provisionZwaveSmartStartNode,
|
||||||
QRProvisioningInformation,
|
QRProvisioningInformation,
|
||||||
RequestedGrant,
|
RequestedGrant,
|
||||||
SecurityClass,
|
SecurityClass,
|
||||||
stopZwaveInclusion,
|
stopZwaveInclusion,
|
||||||
subscribeAddZwaveNode,
|
subscribeAddZwaveNode,
|
||||||
|
ZWaveFeature,
|
||||||
|
zwaveGrantSecurityClasses,
|
||||||
|
zwaveParseQrCode,
|
||||||
zwaveSupportsFeature,
|
zwaveSupportsFeature,
|
||||||
zwaveValidateDskAndEnterPin,
|
zwaveValidateDskAndEnterPin,
|
||||||
ZWaveFeature,
|
|
||||||
PlannedProvisioningEntry,
|
|
||||||
} from "../../../../../data/zwave_js";
|
} from "../../../../../data/zwave_js";
|
||||||
import { haStyle, haStyleDialog } from "../../../../../resources/styles";
|
import { haStyle, haStyleDialog } from "../../../../../resources/styles";
|
||||||
import { HomeAssistant } from "../../../../../types";
|
import { HomeAssistant } from "../../../../../types";
|
||||||
import { ZWaveJSAddNodeDialogParams } from "./show-dialog-zwave_js-add-node";
|
import { ZWaveJSAddNodeDialogParams } from "./show-dialog-zwave_js-add-node";
|
||||||
import "../../../../../components/ha-qr-scanner";
|
|
||||||
|
|
||||||
export interface ZWaveJSAddNodeDevice {
|
export interface ZWaveJSAddNodeDevice {
|
||||||
id: string;
|
id: string;
|
||||||
@ -98,7 +98,7 @@ class DialogZWaveJSAddNode extends LitElement {
|
|||||||
this._startInclusion();
|
this._startInclusion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@query("#pin-input") private _pinInput?: PaperInputElement;
|
@query("#pin-input") private _pinInput?: HaTextField;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this._entryId) {
|
if (!this._entryId) {
|
||||||
@ -202,12 +202,11 @@ class DialogZWaveJSAddNode extends LitElement {
|
|||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<paper-input
|
<ha-textfield
|
||||||
label="PIN"
|
label="PIN"
|
||||||
id="pin-input"
|
id="pin-input"
|
||||||
@keyup=${this._handlePinKeyUp}
|
@keyup=${this._handlePinKeyUp}
|
||||||
no-label-float
|
></ha-textfield>
|
||||||
></paper-input>
|
|
||||||
${this._dsk}
|
${this._dsk}
|
||||||
</div>
|
</div>
|
||||||
<mwc-button
|
<mwc-button
|
||||||
@ -814,6 +813,9 @@ class DialogZWaveJSAddNode extends LitElement {
|
|||||||
width: 68px;
|
width: 68px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
}
|
}
|
||||||
|
ha-textfield {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.secondary {
|
.secondary {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import "../../../../../components/ha-select";
|
|||||||
import "../../../../../components/ha-settings-row";
|
import "../../../../../components/ha-settings-row";
|
||||||
import "../../../../../components/ha-svg-icon";
|
import "../../../../../components/ha-svg-icon";
|
||||||
import "../../../../../components/ha-switch";
|
import "../../../../../components/ha-switch";
|
||||||
|
import "../../../../../components/ha-textfield";
|
||||||
import {
|
import {
|
||||||
computeDeviceName,
|
computeDeviceName,
|
||||||
DeviceRegistryEntry,
|
DeviceRegistryEntry,
|
||||||
@ -265,7 +266,7 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
if (item.configuration_value_type === "manual_entry") {
|
if (item.configuration_value_type === "manual_entry") {
|
||||||
return html`${labelAndDescription}
|
return html`${labelAndDescription}
|
||||||
<paper-input
|
<ha-textfield
|
||||||
type="number"
|
type="number"
|
||||||
.value=${item.value}
|
.value=${item.value}
|
||||||
.min=${item.metadata.min}
|
.min=${item.metadata.min}
|
||||||
@ -274,12 +275,12 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
|
|||||||
.propertyKey=${item.property_key}
|
.propertyKey=${item.property_key}
|
||||||
.key=${id}
|
.key=${id}
|
||||||
.disabled=${!item.metadata.writeable}
|
.disabled=${!item.metadata.writeable}
|
||||||
@value-changed=${this._numericInputChanged}
|
@input=${this._numericInputChanged}
|
||||||
>
|
>
|
||||||
${item.metadata.unit
|
${item.metadata.unit
|
||||||
? html`<span slot="suffix">${item.metadata.unit}</span>`
|
? html`<span slot="suffix">${item.metadata.unit}</span>`
|
||||||
: ""}
|
: ""}
|
||||||
</paper-input> `;
|
</ha-textfield>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.configuration_value_type === "enumerated") {
|
if (item.configuration_value_type === "enumerated") {
|
||||||
@ -492,7 +493,7 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
|
|||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:not([narrow])) ha-settings-row paper-input {
|
:host(:not([narrow])) ha-settings-row ha-textfield {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
@ -186,9 +186,7 @@ export class HaBlueprintScriptEditor extends LitElement {
|
|||||||
--paper-time-input-justify-content: flex-end;
|
--paper-time-input-justify-content: flex-end;
|
||||||
border-top: 1px solid var(--divider-color);
|
border-top: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
:host(:not([narrow])) ha-settings-row paper-input {
|
:host(:not([narrow])) ha-settings-row ha-textfield,
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
:host(:not([narrow])) ha-settings-row ha-selector {
|
:host(:not([narrow])) ha-settings-row ha-selector {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { mdiClose } from "@mdi/js";
|
import { mdiClose } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { EditorTarget } from "../editor/types";
|
import { EditorTarget } from "../editor/types";
|
||||||
|
import "../../../components/ha-textfield";
|
||||||
|
|
||||||
@customElement("hui-input-list-editor")
|
@customElement("hui-input-list-editor")
|
||||||
export class HuiInputListEditor extends LitElement {
|
export class HuiInputListEditor extends LitElement {
|
||||||
@ -23,30 +23,31 @@ export class HuiInputListEditor extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
${this.value.map(
|
${this.value.map(
|
||||||
(listEntry, index) => html`
|
(listEntry, index) => html`
|
||||||
<paper-input
|
<ha-textfield
|
||||||
label=${this.inputLabel}
|
.label=${this.inputLabel}
|
||||||
.value=${listEntry}
|
.value=${listEntry}
|
||||||
.configValue=${"entry"}
|
.configValue=${"entry"}
|
||||||
.index=${index}
|
.index=${index}
|
||||||
@value-changed=${this._valueChanged}
|
@input=${this._valueChanged}
|
||||||
@blur=${this._consolidateEntries}
|
@blur=${this._consolidateEntries}
|
||||||
@keydown=${this._handleKeyDown}
|
@keydown=${this._handleKeyDown}
|
||||||
|
iconTrailing
|
||||||
><ha-icon-button
|
><ha-icon-button
|
||||||
slot="suffix"
|
slot="trailingIcon"
|
||||||
class="clear-button"
|
class="clear-button"
|
||||||
.path=${mdiClose}
|
.path=${mdiClose}
|
||||||
no-ripple
|
no-ripple
|
||||||
@click=${this._removeEntry}
|
@click=${this._removeEntry}
|
||||||
.label=${this.hass!.localize("ui.common.clear")}
|
.label=${this.hass!.localize("ui.common.clear")}
|
||||||
>Clear</ha-icon-button
|
|
||||||
></paper-input
|
|
||||||
>
|
>
|
||||||
|
</ha-icon-button>
|
||||||
|
</ha-textfield>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
<paper-input
|
<ha-textfield
|
||||||
label=${this.inputLabel}
|
.label=${this.inputLabel}
|
||||||
@change=${this._addEntry}
|
@change=${this._addEntry}
|
||||||
></paper-input>
|
></ha-textfield>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,10 +104,12 @@ export class HuiInputListEditor extends LitElement {
|
|||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return css`
|
return css`
|
||||||
ha-icon-button {
|
ha-icon-button {
|
||||||
--mdc-icon-button-size: 24px;
|
margin-right: -24px;
|
||||||
padding: 2px;
|
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
ha-textfield {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import "../../../../components/ha-form/ha-form";
|
import "../../../../components/ha-form/ha-form";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import {
|
import {
|
||||||
@ -24,7 +23,7 @@ import { EntityConfig } from "../../entity-rows/types";
|
|||||||
import { LovelaceCardEditor } from "../../types";
|
import { LovelaceCardEditor } from "../../types";
|
||||||
import { processEditorEntities } from "../process-editor-entities";
|
import { processEditorEntities } from "../process-editor-entities";
|
||||||
import { entitiesConfigStruct } from "../structs/entities-struct";
|
import { entitiesConfigStruct } from "../structs/entities-struct";
|
||||||
import { EditorTarget, EntitiesEditorEvent } from "../types";
|
import { EntitiesEditorEvent } from "../types";
|
||||||
import { configElementStyle } from "./config-elements-style";
|
import { configElementStyle } from "./config-elements-style";
|
||||||
import { baseLovelaceCardConfig } from "../structs/base-card-struct";
|
import { baseLovelaceCardConfig } from "../structs/base-card-struct";
|
||||||
import { HaFormSchema } from "../../../../components/ha-form/types";
|
import { HaFormSchema } from "../../../../components/ha-form/types";
|
||||||
@ -127,10 +126,6 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor {
|
|||||||
if (!this._config || !this.hass) {
|
if (!this._config || !this.hass) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const target = ev.target! as EditorTarget;
|
|
||||||
if (!target.configValue) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const value = ev.detail.value;
|
const value = ev.detail.value;
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { assert, object, optional, string, assign } from "superstruct";
|
import { assert, object, optional, string, assign } from "superstruct";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user