iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 6.56 kB
JavaScript
export const __webpack_ids__=["73644"];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),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];(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,l.K)({hasHold:(0,u._)(e.hold_action),hasDoubleClick:(0,u._)(e.double_tap_action)})}" .config="${e}" tabindex="0" .label="${i}"> ${!1!==e.show_icon?n.dy` <state-badge title="${(0,c.$)(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[h.$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)}}))},58574:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiButtonsRow:()=>h});var n=i(44249),o=(i(9359),i(70104),i(57243)),s=i(15093),r=i(73358),c=i(73850),l=i(29401),d=i(34807),u=e([d]);d=(u.then?(await u)():u)[0];let h=(0,n.Z)([(0,s.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,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_configEntities",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._configEntities=(0,l.A)(e.entities).map((e=>({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 o.dy` <hui-buttons-base .hass="${this.hass}" .configEntities="${this._configEntities}"></hui-buttons-base> `}}]}}),o.oi);a()}catch(e){a(e)}}))}};
//# sourceMappingURL=73644.9579811b25d80d22.js.map