mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Fix attribute picker suffix (#7348)
This commit is contained in:
parent
12d73fe90d
commit
d2dd1a43dd
@ -1,3 +1,4 @@
|
|||||||
|
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light";
|
import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light";
|
||||||
@ -16,8 +17,9 @@ import {
|
|||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
import { PolymerChangedEvent } from "../../polymer-types";
|
import { PolymerChangedEvent } from "../../polymer-types";
|
||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import "../ha-icon-button";
|
import "../ha-svg-icon";
|
||||||
import "./state-badge";
|
import "./state-badge";
|
||||||
|
import "@material/mwc-icon-button/mwc-icon-button";
|
||||||
|
|
||||||
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
||||||
|
|
||||||
@ -98,33 +100,35 @@ class HaEntityAttributePicker extends LitElement {
|
|||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
>
|
>
|
||||||
|
<div class="suffix" slot="suffix">
|
||||||
${this.value
|
${this.value
|
||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<mwc-icon-button
|
||||||
aria-label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.components.entity.entity-picker.clear"
|
"ui.components.entity.entity-picker.clear"
|
||||||
)}
|
)}
|
||||||
slot="suffix"
|
|
||||||
class="clear-button"
|
class="clear-button"
|
||||||
icon="hass:close"
|
tabindex="-1"
|
||||||
@click=${this._clearValue}
|
@click=${this._clearValue}
|
||||||
no-ripple
|
no-ripple
|
||||||
>
|
>
|
||||||
Clear
|
<ha-svg-icon .path=${mdiClose}></ha-svg-icon>
|
||||||
</ha-icon-button>
|
</mwc-icon-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
<ha-icon-button
|
<mwc-icon-button
|
||||||
aria-label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.components.entity.entity-attribute-picker.show_attributes"
|
"ui.components.entity.entity-attribute-picker.show_attributes"
|
||||||
)}
|
)}
|
||||||
slot="suffix"
|
|
||||||
class="toggle-button"
|
class="toggle-button"
|
||||||
.icon=${this._opened ? "hass:menu-up" : "hass:menu-down"}
|
tabindex="-1"
|
||||||
>
|
>
|
||||||
Toggle
|
<ha-svg-icon
|
||||||
</ha-icon-button>
|
.path=${this._opened ? mdiMenuUp : mdiMenuDown}
|
||||||
|
></ha-svg-icon>
|
||||||
|
</mwc-icon-button>
|
||||||
|
</div>
|
||||||
</paper-input>
|
</paper-input>
|
||||||
</vaadin-combo-box-light>
|
</vaadin-combo-box-light>
|
||||||
`;
|
`;
|
||||||
@ -160,7 +164,10 @@ class HaEntityAttributePicker extends LitElement {
|
|||||||
|
|
||||||
static get styles(): CSSResult {
|
static get styles(): CSSResult {
|
||||||
return css`
|
return css`
|
||||||
paper-input > ha-icon-button {
|
.suffix {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
mwc-icon-button {
|
||||||
--mdc-icon-button-size: 24px;
|
--mdc-icon-button-size: 24px;
|
||||||
padding: 0px 2px;
|
padding: 0px 2px;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user