UNPKG

iobroker.lovelace

Version:

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

5 lines 7.36 kB
export const __webpack_ids__=["65970"];export const __webpack_modules__={60370:function(e,t,i){var a=i(44249),n=i(72621),o=i(10445),s=i(57243),r=i(15093);(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:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"active",value:()=>!1},{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(i,"styles",this),s.iv`: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?s.dy`<span class="filled"></span>`:(0,n.Z)(i,"renderOutline",this,3)([])}},{kind:"method",key:"getContainerClasses",value:function(){return{...(0,n.Z)(i,"getContainerClasses",this,3)([]),active:this.active}}},{kind:"method",key:"renderPrimaryContent",value:function(){return s.dy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label">${this.label}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${this.renderTrailingIcon()} </span> `}},{kind:"method",key:"renderTrailingIcon",value:function(){return s.dy`<slot name="trailing-icon"></slot>`}}]}}),o.X)},74666:function(e,t,i){var a=i(44249),n=i(74763),o=i(15093);(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(44249),n=(i(9359),i(70104),i(57243)),o=i(15093),s=i(47194),r=i(5460),l=i(84674),c=i(3967),d=i(1617),h=i(5684),u=(i(60370),i(74666),i(28008)),p=e([r]);r=(p.then?(await p)():p)[0];(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 n.dy` <ha-chip-set class="ha-scrollbar"> ${(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 n.dy` <ha-assist-chip filled @action="${this._handleAction}" .actionHandler="${(0,c.K)({hasHold:(0,h._)(e.hold_action),hasDoubleClick:(0,h._)(e.double_tap_action)})}" .config="${e}" tabindex="0" .label="${i}"> ${!1!==e.show_icon?n.dy` <state-badge title="${(0,l.$)(this.hass,e)}" .hass="${this.hass}" .stateObj="${t}" .overrideIcon="${e.icon}" .overrideImage="${e.image}" .stateColor="${!0}" slot="icon"></state-badge> `:""} </ha-assist-chip> `}))} </ha-chip-set> `}},{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[u.$c,n.iv`.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(e){t(e)}}))},46667:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiButtonsHeaderFooter:()=>u});var n=i(44249),o=(i(9359),i(70104),i(57243)),s=i(35359),r=i(15093),l=i(73850),c=i(29401),d=i(34807),h=e([d]);d=(h.then?(await h)():h)[0];let u=(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={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 o.dy` ${"footer"===this.type?o.dy`<li class="divider footer" role="separator"></li>`:""} <hui-buttons-base .hass="${this.hass}" .configEntities="${this._configEntities}" class="${(0,s.$)({footer:"footer"===this.type,header:"header"===this.type})}"></hui-buttons-base> ${"header"===this.type?o.dy`<li class="divider header" role="separator"></li>`:""} `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`.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(e){a(e)}}))}}; //# sourceMappingURL=65970.2dda70e913b77f1c.js.map