UNPKG

iobroker.lovelace

Version:

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

1 lines 3.67 kB
export const __rspack_esm_id=50777;export const __rspack_esm_ids=[50777];export const __webpack_modules__={27722(t,e,a){a.d(e,{d:()=>o});var i=a(28978);function n(t,e,a,i){if(!a||!a.action||"none"===a.action)return"";let n=i?t.localize("ui.panel.lovelace.cards.picture-elements.hold"):t.localize("ui.panel.lovelace.cards.picture-elements.tap");switch(a.action){case"navigate":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.navigate_to",{location:a.navigation_path})}`;break;case"url":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.url",{url_path:a.url_path})}`;break;case"toggle":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.toggle",{name:e})}`;break;case"call-service":n+=`${t.localize("ui.panel.lovelace.cards.picture-elements.perform_action",{name:a.service})}`;break;case"more-info":n+=`${t.localize("ui.panel.lovelace.cards.picture-elements.more_info",{name:e})}`}return n}const o=(t,e)=>{if(null===e.title)return"";if(e.title)return e.title;let a="";if(e.entity&&(a=e.entity in t.states?(0,i.u)(t.states[e.entity]):e.entity),!e.tap_action&&!e.hold_action)return a;const o=e.tap_action?n(t,a,e.tap_action,!1):"",s=e.hold_action?n(t,a,e.hold_action,!0):"";return o+(o&&s?"\n":"")+s}},96314(t,e,a){a.a(t,async function(t,e){try{a(18111),a(61701);var i=a(62826),n=a(5124),o=a(22441),s=a(28978),c=a(74281),l=a(27722),r=a(19037),h=a(22064),p=a(97176),d=(a(34296),a(5745),a(14503)),u=t([c]);c=(u.then?(await u)():u)[0];class g extends n.WF{render(){return n.qy` <ha-chip-set class="ha-scrollbar"> ${(this.configEntities||[]).map(t=>{const e=this.hass.states[t.entity],a=t.show_name&&e||t.name&&!1!==t.show_name?t.name||(0,s.u)(e):"";return n.qy` <ha-assist-chip filled @action="${this._handleAction}" .actionHandler="${(0,r.T)({hasHold:(0,p.h)(t.hold_action),hasDoubleClick:(0,p.h)(t.double_tap_action)})}" .config="${t}" tabindex="0" .label="${a}"> ${!1!==t.show_icon?n.qy` <state-badge title="${(0,l.d)(this.hass,t)}" .hass="${this.hass}" .stateObj="${e}" .overrideIcon="${t.icon}" .overrideImage="${t.image}" .stateColor="${!0}" slot="icon"></state-badge> `:""} </ha-assist-chip> `})} </ha-chip-set> `}_handleAction(t){(0,h.$)(this,this.hass,t.currentTarget.config,t.detail.action)}static get styles(){return[d.dp,n.AH`.ha-scrollbar{padding:12px;padding-top:var(--padding-top,8px);padding-bottom:var(--padding-bottom,8px);width:100%;overflow-x:auto;overflow-y:hidden;white-space:nowrap;box-sizing:border-box;display:flex;flex-wrap:wrap}state-badge{display:inline-flex;line-height:inherit;color:var(--secondary-text-color);align-items:center;justify-content:center}@media all and (max-width:450px),all and (max-height:500px){.ha-scrollbar{flex-wrap:nowrap}}`]}}(0,i.Cg)([(0,o.wk)()],g.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"configEntities",void 0),g=(0,i.Cg)([(0,o.EM)("hui-buttons-base")],g),e()}catch(t){e(t)}})},65728(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HuiButtonsRow:()=>d});a(18111),a(61701);var n=a(62826),o=a(5124),s=a(22441),c=a(46190),l=a(71727),r=a(20939),h=a(96314),p=t([h]);h=(p.then?(await p)():p)[0];class d extends o.WF{static getStubConfig(){return{entities:[]}}setConfig(t){this._configEntities=(0,r.L)(t.entities).map(t=>({tap_action:{action:t.entity&&c.FD.has((0,l.m)(t.entity))?"toggle":"more-info"},hold_action:{action:"more-info"},...t}))}render(){return o.qy` <hui-buttons-base .hass="${this.hass}" .configEntities="${this._configEntities}"></hui-buttons-base> `}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,n.Cg)([(0,s.wk)()],d.prototype,"_configEntities",void 0),d=(0,n.Cg)([(0,s.EM)("hui-buttons-row")],d),i()}catch(t){i(t)}})}};