UNPKG

iobroker.lovelace

Version:

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

5 lines 7.82 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["65970"],{60370:function(e,t,i){var a=i(61701),n=i(72621),o=(i(71695),i(19423),i(47021),i(10445)),s=i(57243),r=i(50778);let l,c,d,u,h=e=>e;(0,a.Z)([(0,r.Mo)("ha-assist-chip")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"filled",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"active",value(){return!1}},{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(i,"styles",this),(0,s.iv)(l||(l=h`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var( --ha-assist-chip-container-shape, 16px );--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:Roboto,sans-serif}`))]}},{kind:"method",key:"renderOutline",value:function(){return this.filled?(0,s.dy)(c||(c=h`<span class="filled"></span>`)):(0,n.Z)(i,"renderOutline",this,3)([])}},{kind:"method",key:"getContainerClasses",value:function(){return Object.assign(Object.assign({},(0,n.Z)(i,"getContainerClasses",this,3)([])),{},{active:this.active})}},{kind:"method",key:"renderPrimaryContent",value:function(){return(0,s.dy)(d||(d=h` <span class="leading icon" aria-hidden="true"> ${0} </span> <span class="label">${0}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${0} </span> `),this.renderLeadingIcon(),this.label,this.renderTrailingIcon())}},{kind:"method",key:"renderTrailingIcon",value:function(){return(0,s.dy)(u||(u=h`<slot name="trailing-icon"></slot>`))}}]}}),o.X)},74666:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(74763)),o=i(50778);(0,a.Z)([(0,o.Mo)("ha-chip-set")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[]}}),n.l)},84674:function(e,t,i){i.d(t,{$:()=>o});var a=i(47194);function n(e,t,i,a){if(!i||!i.action||"none"===i.action)return"";let n=a?e.localize("ui.panel.lovelace.cards.picture-elements.hold"):e.localize("ui.panel.lovelace.cards.picture-elements.tap");switch(i.action){case"navigate":n+=` ${e.localize("ui.panel.lovelace.cards.picture-elements.navigate_to",{location:i.navigation_path})}`;break;case"url":n+=` ${e.localize("ui.panel.lovelace.cards.picture-elements.url",{url_path:i.url_path})}`;break;case"toggle":n+=` ${e.localize("ui.panel.lovelace.cards.picture-elements.toggle",{name:t})}`;break;case"call-service":n+=`${e.localize("ui.panel.lovelace.cards.picture-elements.perform_action",{name:i.service})}`;break;case"more-info":n+=`${e.localize("ui.panel.lovelace.cards.picture-elements.more_info",{name:t})}`}return n}const o=(e,t)=>{if(null===t.title)return"";if(t.title)return t.title;let i="",o="";if(t.entity&&(i=t.entity in e.states?(0,a.C)(e.states[t.entity]):t.entity),!t.tap_action&&!t.hold_action)return i;const s=t.tap_action?n(e,i,t.tap_action,!1):"",r=t.hold_action?n(e,i,t.hold_action,!0):"";return o=s+(s&&r?"\n":"")+r,o}},34807:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(9359),i(70104),i(47021),i(57243)),o=i(50778),s=i(47194),r=i(5460),l=i(84674),c=i(3967),d=i(1617),u=i(5684),h=(i(60370),i(74666),i(28008)),p=e([r]);r=(p.then?(await p)():p)[0];let f,v,y,b,g=e=>e;(0,a.Z)([(0,o.Mo)("hui-buttons-base")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.SB)()],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"configEntities",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)(f||(f=g` <ha-chip-set class="ha-scrollbar"> ${0} </ha-chip-set> `),(this.configEntities||[]).map((e=>{const t=this.hass.states[e.entity],i=e.show_name&&t||e.name&&!1!==e.show_name?e.name||(0,s.C)(t):"";return(0,n.dy)(v||(v=g` <ha-assist-chip filled @action="${0}" .actionHandler="${0}" .config="${0}" tabindex="0" .label="${0}"> ${0} </ha-assist-chip> `),this._handleAction,(0,c.K)({hasHold:(0,u._)(e.hold_action),hasDoubleClick:(0,u._)(e.double_tap_action)}),e,i,!1!==e.show_icon?(0,n.dy)(y||(y=g` <state-badge title="${0}" .hass="${0}" .stateObj="${0}" .overrideIcon="${0}" .overrideImage="${0}" .stateColor="${0}" slot="icon"></state-badge> `),(0,l.$)(this.hass,e),this.hass,t,e.icon,e.image,!0):"")})))}},{kind:"method",key:"_handleAction",value:function(e){const t=e.currentTarget.config;(0,d.G)(this,this.hass,t,e.detail.action)}},{kind:"get",static:!0,key:"styles",value:function(){return[h.$c,(0,n.iv)(b||(b=g`.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}}`))]}}]}}),n.oi);t()}catch(f){t(f)}}))},46667:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiButtonsHeaderFooter:()=>b});var n=i(61701),o=(i(71695),i(9359),i(70104),i(19423),i(47021),i(57243)),s=i(35359),r=i(50778),l=i(73850),c=i(29401),d=i(34807),u=e([d]);d=(u.then?(await u)():u)[0];let h,p,f,v,y=e=>e,b=(0,n.Z)([(0,r.Mo)("hui-buttons-header-footer")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",static:!0,key:"getStubConfig",value:function(){return{entities:[]}}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"type",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_configEntities",value:void 0},{kind:"method",key:"getCardSize",value:function(){return 3}},{kind:"method",key:"setConfig",value:function(e){this._configEntities=(0,c.A)(e.entities).map((e=>{const t=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},e);return"scene"===(0,l.M)(e.entity)&&(t.tap_action={action:"call-service",service:"scene.turn_on",target:{entity_id:t.entity}}),t}))}},{kind:"method",key:"render",value:function(){return(0,o.dy)(h||(h=y` ${0} <hui-buttons-base .hass="${0}" .configEntities="${0}" class="${0}"></hui-buttons-base> ${0} `),"footer"===this.type?(0,o.dy)(p||(p=y`<li class="divider footer" role="separator"></li>`)):"",this.hass,this._configEntities,(0,s.$)({footer:"footer"===this.type,header:"header"===this.type}),"header"===this.type?(0,o.dy)(f||(f=y`<li class="divider header" role="separator"></li>`)):"")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(v||(v=y`.divider{height:0;margin:16px 0;list-style-type:none;border:none;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:var(--divider-color)}.divider.header{margin-top:0}hui-buttons-base.footer{--padding-bottom:16px}hui-buttons-base.header{--padding-top:16px}`))}}]}}),o.oi);a()}catch(h){a(h)}}))}}]); //# sourceMappingURL=65970.ef5cebebb0245d38.js.map