UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 2.95 kB
export const __webpack_ids__=["91773"];export const __webpack_modules__={27447:function(e,a,i){i.r(a),i.d(a,{PanelView:()=>h});var t=i(44249),d=i(72621),r=i(57243),o=i(15093),s=i(35359),n=i(36522),l=i(20172);let c=!1,h=(0,t.Z)(null,(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"isStrategy",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"cards",value:()=>[]},{kind:"field",decorators:[(0,o.SB)()],key:"_card",value:void 0},{kind:"method",key:"setConfig",value:function(e){}},{kind:"method",key:"willUpdate",value:function(e){if((0,d.Z)(t,"willUpdate",this,3)([e]),this.lovelace?.editMode&&!c&&(c=!0,Promise.all([i.e("41103"),i.e("39341")]).then(i.bind(i,70419))),e.has("cards")&&this._createCard(),!e.has("lovelace"))return;const a=e.get("lovelace");(!e.has("cards")&&a?.config!==this.lovelace?.config||a&&a?.editMode!==this.lovelace?.editMode)&&this._createCard()}},{kind:"method",key:"render",value:function(){return r.dy` ${this.cards.length>1?r.dy`<hui-warning> ${this.hass.localize("ui.panel.lovelace.editor.view.panel_mode.warning_multiple_cards")} </hui-warning>`:""} ${this._card} ${this.lovelace?.editMode&&0===this.cards.length?r.dy` <ha-fab .label="${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")}" extended @click="${this._addCard}" class="${(0,s.$)({rtl:(0,l.HE)(this.hass)})}"> <ha-svg-icon slot="icon" .path="${"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}"></ha-svg-icon> </ha-fab> `:""} `}},{kind:"method",key:"_addCard",value:function(){(0,n.B)(this,"ll-create-card")}},{kind:"method",key:"_createCard",value:function(){if(0===this.cards.length)return void(this._card=void 0);const e=this.cards[0];if(e.layout="panel",this.isStrategy||!this.lovelace?.editMode)return e.preview=!1,void(this._card=e);const a=document.createElement("hui-card-options");a.hass=this.hass,a.lovelace=this.lovelace,a.path=[this.index,0],a.hidePosition=!0,e.preview=!0,a.appendChild(e),this._card=a}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`:host{display:block;height:100%;--restore-card-border-radius:var(--ha-card-border-radius, 12px);--restore-card-border-width:var(--ha-card-border-width, 1px);--restore-card-box-shadow:var(--ha-card-box-shadow, none)}*{--ha-card-border-radius:0;--ha-card-border-width:0;--ha-card-box-shadow:none}ha-fab{position:fixed;right:calc(16px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;float:var(--float-end);inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial}`}]}}),r.oi);customElements.define("hui-panel-view",h)}}; //# sourceMappingURL=91773.a86733781515d452.js.map