UNPKG

iobroker.lovelace

Version:

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

1 lines 2.83 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[48285],{90476:function(t,n,i){i.a(t,async function(t,o){try{i.r(n),i.d(n,{HuiEmptyStateCard:function(){return C}});i(18111),i(61701),i(3362),i(62953);var a=i(40445),e=i(5124),c=i(67576),s=i(6412),r=i(89784),h=i(63672),l=i(78870),d=(i(76776),i(18350)),g=(i(47680),i(22064)),p=t([d]);d=(p.then?(await p)():p)[0];let u,f,y,_,v,m,$,b,x=t=>t;class C extends e.WF{static async getConfigElement(){return await i.e(15718).then(i.bind(i,8293)),document.createElement("hui-empty-state-card-editor")}static getStubConfig(){return{type:"empty-state",title:"Welcome Home",content:"This is an empty state card."}}getCardSize(){return 2}setConfig(t){this._config=t}render(){var t,n;return this.hass&&this._config?(0,e.qy)(u||(u=x` <ha-card class="${0}"> <div class="container"> ${0} ${0} ${0} ${0} </div> </ha-card> `),(0,s.H)({"content-only":null!==(t=this._config.content_only)&&void 0!==t&&t}),this._config.icon?(0,e.qy)(f||(f=x` <ha-icon class="card-icon" .icon="${0}" style="${0}"></ha-icon> `),this._config.icon,(0,r.W)({color:this._config.icon_color?(0,l.MP)(this._config.icon_color):void 0})):e.s6,this._config.title?(0,e.qy)(y||(y=x`<h1>${0}</h1>`),this._config.title):e.s6,this._config.content?(0,e.qy)(_||(_=x`<p>${0}</p>`),this._config.content):e.s6,null!==(n=this._config.buttons)&&void 0!==n&&n.length?(0,e.qy)(v||(v=x` <div class="buttons"> ${0} </div> `),this._config.buttons.map((t,n)=>(0,e.qy)(m||(m=x` <ha-button .index="${0}" @click="${0}" appearance="${0}" variant="${0}"> ${0} ${0} </ha-button> `),n,this._handleButtonAction,(0,h.J)(t.appearance),(0,h.J)(t.variant),t.icon?(0,e.qy)($||($=x`<ha-icon slot="start" .icon="${0}"></ha-icon>`),t.icon):e.s6,t.text))):e.s6):e.s6}_handleButtonAction(t){var n;const i=t.currentTarget.index,o=null===(n=this._config)||void 0===n||null===(n=n.buttons)||void 0===n?void 0:n[i];this.hass&&o&&(0,g.$)(this,this.hass,{tap_action:o.tap_action},"tap")}}C.styles=(0,e.AH)(b||(b=x`:host{display:block;height:100%}ha-card{height:100%}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;padding:var(--ha-space-8) var(--ha-space-4);box-sizing:border-box;gap:var(--ha-space-4);max-width:640px;margin:0 auto}.card-icon{--mdc-icon-size:var(--ha-space-16);color:var(--secondary-text-color)}h1{margin:0;font-size:var(--ha-font-size-xl);font-weight:500}p{margin:0;color:var(--secondary-text-color)}.buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--ha-space-2)}.content-only{background:0 0;box-shadow:none;border:none}`)),(0,a.Cg)([(0,c.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,c.wk)()],C.prototype,"_config",void 0),C=(0,a.Cg)([(0,c.EM)("hui-empty-state-card")],C),o()}catch(u){o(u)}})}}]);