mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Update for other editors
This commit is contained in:
parent
1290336cc5
commit
14de223ffc
@ -1,6 +1,10 @@
|
|||||||
import { css } from "lit";
|
import { css } from "lit";
|
||||||
|
|
||||||
export const configElementStyle = css`
|
export const configElementStyle = css`
|
||||||
|
.card-config {
|
||||||
|
/* Cancels overlapping Margins for HAForm + Card Config options */
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
ha-switch {
|
ha-switch {
|
||||||
padding: 16px 6px;
|
padding: 16px 6px;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
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, assign, object, optional, string } from "superstruct";
|
||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||||
import { ActionConfig } from "../../../../data/lovelace";
|
import { ActionConfig } from "../../../../data/lovelace";
|
||||||
import { HomeAssistant } from "../../../../types";
|
import { HomeAssistant } from "../../../../types";
|
||||||
@ -9,9 +9,9 @@ import "../../components/hui-action-editor";
|
|||||||
import "../../components/hui-theme-select-editor";
|
import "../../components/hui-theme-select-editor";
|
||||||
import { LovelaceCardEditor } from "../../types";
|
import { LovelaceCardEditor } from "../../types";
|
||||||
import { actionConfigStruct } from "../structs/action-struct";
|
import { actionConfigStruct } from "../structs/action-struct";
|
||||||
|
import { baseLovelaceCardConfig } from "../structs/base-card-struct";
|
||||||
import { EditorTarget } from "../types";
|
import { EditorTarget } from "../types";
|
||||||
import { configElementStyle } from "./config-elements-style";
|
import { configElementStyle } from "./config-elements-style";
|
||||||
import { baseLovelaceCardConfig } from "../structs/base-card-struct";
|
|
||||||
|
|
||||||
const cardConfigStruct = assign(
|
const cardConfigStruct = assign(
|
||||||
baseLovelaceCardConfig,
|
baseLovelaceCardConfig,
|
||||||
@ -78,32 +78,30 @@ export class HuiPictureCardEditor
|
|||||||
.configValue=${"theme"}
|
.configValue=${"theme"}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></hui-theme-select-editor>
|
></hui-theme-select-editor>
|
||||||
<div class="side-by-side">
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label="${this.hass.localize(
|
||||||
.label="${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.tap_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.tap_action"
|
)} (${this.hass.localize(
|
||||||
)} (${this.hass.localize(
|
"ui.panel.lovelace.editor.card.config.optional"
|
||||||
"ui.panel.lovelace.editor.card.config.optional"
|
)})"
|
||||||
)})"
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._tap_action}
|
||||||
.config=${this._tap_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"tap_action"}
|
||||||
.configValue=${"tap_action"}
|
@value-changed=${this._valueChanged}
|
||||||
@value-changed=${this._valueChanged}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label="${this.hass.localize(
|
||||||
.label="${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.hold_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.hold_action"
|
)} (${this.hass.localize(
|
||||||
)} (${this.hass.localize(
|
"ui.panel.lovelace.editor.card.config.optional"
|
||||||
"ui.panel.lovelace.editor.card.config.optional"
|
)})"
|
||||||
)})"
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._hold_action}
|
||||||
.config=${this._hold_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"hold_action"}
|
||||||
.configValue=${"hold_action"}
|
@value-changed=${this._valueChanged}
|
||||||
@value-changed=${this._valueChanged}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -108,32 +108,30 @@ export class HuiPictureEntityCardEditor
|
|||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></ha-form>
|
||||||
<div class="card-config">
|
<div class="card-config">
|
||||||
<div class="side-by-side">
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label="${this.hass.localize(
|
||||||
.label="${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.tap_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.tap_action"
|
)} (${this.hass.localize(
|
||||||
)} (${this.hass.localize(
|
"ui.panel.lovelace.editor.card.config.optional"
|
||||||
"ui.panel.lovelace.editor.card.config.optional"
|
)})"
|
||||||
)})"
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._tap_action}
|
||||||
.config=${this._tap_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"tap_action"}
|
||||||
.configValue=${"tap_action"}
|
@value-changed=${this._changed}
|
||||||
@value-changed=${this._changed}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label="${this.hass.localize(
|
||||||
.label="${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.hold_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.hold_action"
|
)} (${this.hass.localize(
|
||||||
)} (${this.hass.localize(
|
"ui.panel.lovelace.editor.card.config.optional"
|
||||||
"ui.panel.lovelace.editor.card.config.optional"
|
)})"
|
||||||
)})"
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._hold_action}
|
||||||
.config=${this._hold_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"hold_action"}
|
||||||
.configValue=${"hold_action"}
|
@value-changed=${this._changed}
|
||||||
@value-changed=${this._changed}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import "../../components/hui-action-editor";
|
|
||||||
import "../../../../components/ha-form/ha-form";
|
|
||||||
import { CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { array, assert, assign, object, optional, string } from "superstruct";
|
import { array, assert, assign, object, optional, string } from "superstruct";
|
||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||||
|
import "../../../../components/ha-form/ha-form";
|
||||||
import type { HaFormSchema } from "../../../../components/ha-form/types";
|
import type { HaFormSchema } from "../../../../components/ha-form/types";
|
||||||
import type { ActionConfig } from "../../../../data/lovelace";
|
import type { ActionConfig } from "../../../../data/lovelace";
|
||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
import type { PictureGlanceCardConfig } from "../../cards/types";
|
import type { PictureGlanceCardConfig } from "../../cards/types";
|
||||||
|
import "../../components/hui-action-editor";
|
||||||
import "../../components/hui-entity-editor";
|
import "../../components/hui-entity-editor";
|
||||||
import type { EntityConfig } from "../../entity-rows/types";
|
import type { EntityConfig } from "../../entity-rows/types";
|
||||||
import type { LovelaceCardEditor } from "../../types";
|
import type { LovelaceCardEditor } from "../../types";
|
||||||
@ -96,28 +96,26 @@ export class HuiPictureGlanceCardEditor
|
|||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
></ha-form>
|
></ha-form>
|
||||||
<div class="card-config">
|
<div class="card-config">
|
||||||
<div class="side-by-side">
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label=${this.hass.localize(
|
||||||
.label=${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.tap_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.tap_action"
|
)}
|
||||||
)}
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._tap_action}
|
||||||
.config=${this._tap_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"tap_action"}
|
||||||
.configValue=${"tap_action"}
|
@value-changed=${this._valueChanged}
|
||||||
@value-changed=${this._valueChanged}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
<hui-action-editor
|
||||||
<hui-action-editor
|
.label=${this.hass.localize(
|
||||||
.label=${this.hass.localize(
|
"ui.panel.lovelace.editor.card.generic.hold_action"
|
||||||
"ui.panel.lovelace.editor.card.generic.hold_action"
|
)}
|
||||||
)}
|
.hass=${this.hass}
|
||||||
.hass=${this.hass}
|
.config=${this._hold_action}
|
||||||
.config=${this._hold_action}
|
.actions=${actions}
|
||||||
.actions=${actions}
|
.configValue=${"hold_action"}
|
||||||
.configValue=${"hold_action"}
|
@value-changed=${this._valueChanged}
|
||||||
@value-changed=${this._valueChanged}
|
></hui-action-editor>
|
||||||
></hui-action-editor>
|
|
||||||
</div>
|
|
||||||
<hui-entity-editor
|
<hui-entity-editor
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.entities=${this._configEntities}
|
.entities=${this._configEntities}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user