iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 6.96 kB
JavaScript
webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["73644"],{60370:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(19423),i(47021),i(10445)),o=i(57243),r=i(50778);let c,l,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,o.iv)(c||(c=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,o.dy)(l||(l=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,o.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,o.dy)(u||(u=h`<slot name="trailing-icon"></slot>`))}}]}}),s.X)},74666:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(74763)),s=i(50778);(0,a.Z)([(0,s.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,{$:()=>s});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 s=(e,t)=>{if(null===t.title)return"";if(t.title)return t.title;let i="",s="";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 o=t.tap_action?n(e,i,t.tap_action,!1):"",r=t.hold_action?n(e,i,t.hold_action,!0):"";return s=o+(o&&r?"\n":"")+r,s}},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)),s=i(50778),o=i(47194),r=i(5460),c=i(84674),l=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,g,y,m=e=>e;(0,a.Z)([(0,s.Mo)("hui-buttons-base")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.SB)()],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"configEntities",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)(f||(f=m` <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,o.C)(t):"";return(0,n.dy)(v||(v=m` <ha-assist-chip filled @action="${0}" .actionHandler="${0}" .config="${0}" tabindex="0" .label="${0}"> ${0} </ha-assist-chip> `),this._handleAction,(0,l.K)({hasHold:(0,u._)(e.hold_action),hasDoubleClick:(0,u._)(e.double_tap_action)}),e,i,!1!==e.show_icon?(0,n.dy)(g||(g=m` <state-badge title="${0}" .hass="${0}" .stateObj="${0}" .overrideIcon="${0}" .overrideImage="${0}" .stateColor="${0}" slot="icon"></state-badge> `),(0,c.$)(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)(y||(y=m`.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)}}))},58574:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiButtonsRow:()=>f});var n=i(61701),s=(i(71695),i(9359),i(70104),i(19423),i(47021),i(57243)),o=i(50778),r=i(73358),c=i(73850),l=i(29401),d=i(34807),u=e([d]);d=(u.then?(await u)():u)[0];let h,p=e=>e,f=(0,n.Z)([(0,o.Mo)("hui-buttons-row")],(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,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_configEntities",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._configEntities=(0,l.A)(e.entities).map((e=>Object.assign({tap_action:{action:e.entity&&r.Kk.has((0,c.M)(e.entity))?"toggle":"more-info"},hold_action:{action:"more-info"}},e)))}},{kind:"method",key:"render",value:function(){return(0,s.dy)(h||(h=p` <hui-buttons-base .hass="${0}" .configEntities="${0}"></hui-buttons-base> `),this.hass,this._configEntities)}}]}}),s.oi);a()}catch(h){a(h)}}))}}]);
//# sourceMappingURL=73644.9f163cb1b8e7ff67.js.map
;(self.