((LitElement) => {
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;
class LovelaceMultilineTextInput extends LitElement {
static get properties() {
return {
_hass: {},
_config: {},
stateObj: {},
state: {}
}
}
static get styles() {
return css`
.flex {
display: flex;
align-items: center;
justify-content: space-evenly;
}
.button {
cursor: pointer;
padding: 16px;
opacity: 1;
transition: opacity 0.5s linear;
}
.textarea {
background: inherit;
border: inherit;
border-left: 1px solid var(--primary-color);
border-bottom: 1px solid var(--primary-color);
box-shadow: none;
color: inherit; /*var(--primary-color)*/;
font: inherit;
font-size: 16px;
height: auto;
letter-spacing: inherit;
line-height: inherit;
margin-top: 20px;
outline: none;
padding-left: 5px;
padding-bottom: 5px;
min-height: 80px;
overflow-y: auto;
word-wrap: break-word;
width: 100%;
word-spacing: inherit;
}
.text-center {
text-align: center;
}
.text-bold {
font-weight: bold;
}
.text-italic {
font-style: italic;
}
.text-left {
float: left;
}
.text-red {
color: red;
}
.text-right {
float: right;
}
.text-small {
font-size: 11px;
}
.hidden {
display: none;
}
.position-absolute {
position: absolute;
}
.opacity-0 {
opacity: 0 !important;
}
.invisible {
visibility: hidden;
}
.button-disabled {
cursor: auto;
pointer-events: none;
}
#serviceMessage {
padding: 5px;
background-color: var(--primary-background-color);
border: 1px solid var(--primary-color);
border-radius: 3px;
opacity: 1;
transition: opacity 0.5s linear;
}
`;
}
updated() {
let _this = this;
this.updateComplete.then(() => {
let new_state = _this.getState();
// only overwrite if state has changed since last overwrite
if(_this.state.last_updated_text === null || new_state !== _this.state.last_updated_text) {
_this.setText(new_state, true);
}
});
}
render() {
return this.stateObj ? html`