UNPKG

iobroker.lovelace

Version:

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

8 lines 14 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["20309"],{95198:function(e,i,t){var a=t(61701),n=(t(71695),t(47021),t(57243)),o=t(50778);let s,d,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-dialog-header")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,n.dy)(s||(s=l` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,n.iv)(d||(d=l`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}`))]}}]}}),n.oi)},73729:function(e,i,t){t.d(i,{i:()=>m});var a=t(61701),n=t(72621),o=(t(22152),t(71695),t(47021),t(74966)),s=t(51408),d=t(57243),l=t(50778),r=t(76525);t(23334);let c,h,p,g=e=>e;const u=["button","ha-list-item"],m=(e,i)=>{var t;return(0,d.dy)(c||(c=g` <div class="header_title"> <ha-icon-button .label="${0}" .path="${0}" dialogAction="close" class="header_button"></ha-icon-button> <span>${0}</span> </div> `),null!==(t=null==e?void 0:e.localize("ui.common.close"))&&void 0!==t?t:"Close","M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",i)};(0,a.Z)([(0,l.Mo)("ha-dialog")],(function(e,i){class t extends i{constructor(...i){super(...i),e(this)}}return{F:t,d:[{kind:"field",key:r.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,i){var t;null===(t=this.contentElement)||void 0===t||t.scrollTo(e,i)}},{kind:"method",key:"renderHeading",value:function(){return(0,d.dy)(h||(h=g`<slot name="heading"> ${0} </slot>`),(0,n.Z)(t,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,n.Z)(t,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,u].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(t,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,d.iv)(p||(p=g`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var( --dialog-scroll-divider-color, var(--divider-color) );z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`))]}}]}}),o.M)},17170:function(e,i,t){t.a(e,(async function(e,a){try{t.r(i),t.d(i,{HaSpinner:()=>g});var n=t(61701),o=t(72621),s=(t(71695),t(47021),t(97677)),d=t(43580),l=t(57243),r=t(50778),c=e([s]);s=(c.then?(await c)():c)[0];let h,p=e=>e,g=(0,n.Z)([(0,r.Mo)("ha-spinner")],(function(e,i){class t extends i{constructor(...i){super(...i),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(t,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[d.Z,(0,l.iv)(h||(h=p`:host{--indicator-color:var( --ha-spinner-indicator-color, var(--primary-color) );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),s.Z);a()}catch(h){a(h)}}))},95249:function(e,i,t){t.a(e,(async function(e,a){try{t.r(i),t.d(i,{HuiCreateDialogCard:()=>T});var n=t(58814),o=t(61701),s=(t(52247),t(19083),t(71695),t(9359),t(70104),t(40251),t(61006),t(47021),t(56820),t(99619),t(57243)),d=t(50778),l=t(67064),r=t(35359),c=t(20552),h=t(27486),p=t(36522),g=t(73850),u=t(47194),m=(t(73729),t(95198),t(54305)),v=t(28008),f=t(20526),x=t(27353),k=t(2593),b=t(3054),_=t(71971),y=t(77711),w=t(53380),C=e([b,_]);[b,_]=C.then?(await C)():C;const $=["cards","title"];let L,z,E,I,S,Z=e=>e;const P="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";let T=(0,o.Z)([(0,d.Mo)("hui-dialog-create-card")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_containerConfig",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_selectedEntities",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_currTabIndex",value(){return 0}},{kind:"field",decorators:[(0,d.SB)()],key:"_narrow",value(){return!1}},{kind:"method",key:"showDialog",value:async function(e){this._params=e,this._narrow=matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches;const i=(0,k.an)(e.lovelaceConfig,e.path);if("strategy"in i)throw new Error("Can't edit strategy");this._containerConfig=i}},{kind:"method",key:"closeDialog",value:function(){return this._params=void 0,this._currTabIndex=0,this._selectedEntities=[],(0,p.B)(this,"dialog-closed",{dialog:this.localName}),!0}},{kind:"method",key:"render",value:function(){if(!this._params)return s.Ld;const e=this._containerConfig.title?this.hass.localize("ui.panel.lovelace.editor.edit_card.pick_card_title",{name:`"${this._containerConfig.title}"`}):this.hass.localize("ui.panel.lovelace.editor.edit_card.pick_card");return(0,s.dy)(L||(L=Z` <ha-dialog open scrimClickAction @keydown="${0}" @closed="${0}" .heading="${0}" class="${0}"> <ha-dialog-header show-border slot="heading"> <ha-icon-button slot="navigationIcon" dialogAction="cancel" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title"> ${0} </span> <mwc-tab-bar .activeIndex="${0}" @MDCTabBar:activated="${0}"> <mwc-tab .label="${0}" dialogInitialFocus="${0}"></mwc-tab> <mwc-tab .label="${0}"></mwc-tab> </mwc-tab-bar> </ha-dialog-header> ${0} <div slot="primaryAction"> <mwc-button @click="${0}"> ${0} </mwc-button> ${0} </div> </ha-dialog> `),this._ignoreKeydown,this._cancel,e,(0,r.$)({table:1===this._currTabIndex}),this.hass.localize("ui.common.close"),P,e,this._currTabIndex,this._handleTabChanged,this.hass.localize("ui.panel.lovelace.editor.cardpicker.by_card"),(0,c.o)(this._narrow?"":void 0),this.hass.localize("ui.panel.lovelace.editor.cardpicker.by_entity"),(0,l.F)(0===this._currTabIndex?(0,s.dy)(z||(z=Z` <hui-card-picker dialogInitialFocus="${0}" .suggestedCards="${0}" .lovelace="${0}" .hass="${0}" @config-changed="${0}"></hui-card-picker> `),(0,c.o)(this._narrow?void 0:""),this._params.suggestedCards,this._params.lovelaceConfig,this.hass,this._handleCardPicked):(0,s.dy)(E||(E=Z` <hui-entity-picker-table no-label-float .hass="${0}" narrow .entities="${0}" @selected-changed="${0}"></hui-entity-picker-table> `),this.hass,this._allEntities(this.hass.states),this._handleSelectedChanged)),this._cancel,this.hass.localize("ui.common.cancel"),this._selectedEntities.length?(0,s.dy)(I||(I=Z` <mwc-button @click="${0}"> ${0} </mwc-button> `),this._suggestCards,this.hass.localize("ui.common.continue")):"")}},{kind:"method",key:"_ignoreKeydown",value:function(e){e.stopPropagation()}},{kind:"get",static:!0,key:"styles",value:function(){return[v.yu,(0,s.iv)(S||(S=Z`@media all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-max-height:100%;height:100%}}@media all and (min-width:850px){ha-dialog{--mdc-dialog-min-width:845px}}ha-dialog{--mdc-dialog-max-width:845px;--dialog-content-padding:0 24px 20px 24px;--dialog-z-index:6}ha-dialog.table{--dialog-content-padding:0}@media (min-width:1200px){ha-dialog{--mdc-dialog-max-width:calc(100vw - 32px);--mdc-dialog-min-width:1000px}}hui-card-picker{--card-picker-search-shape:0;--card-picker-search-margin:-2px -24px 0}hui-entity-picker-table{display:block;height:calc(100vh - 198px);--mdc-shape-small:0}@media all and (max-width:450px),all and (max-height:500px){hui-entity-picker-table{height:calc(100vh - 158px)}}`))]}},{kind:"method",key:"_handleCardPicked",value:function(e){const i=e.detail.config;this._params.entities&&this._params.entities.length&&(Object.keys(i).includes("entities")?i.entities=this._params.entities:Object.keys(i).includes("entity")&&(i.entity=this._params.entities[0]));const t=this._params.lovelaceConfig,a=this._params.path,n=this._params.saveConfig,o=2===a.length?(0,k.an)(t,a):void 0;(0,y.x)(this,{lovelaceConfig:t,saveCardConfig:async e=>{const i=(0,x.Z0)(t,a,e);await n(i)},cardConfig:i,sectionConfig:o,isNew:!0}),this.closeDialog()}},{kind:"method",key:"_handleTabChanged",value:function(e){e.detail.index!==this._currTabIndex&&(this._currTabIndex=e.detail.index,this._selectedEntities=[])}},{kind:"method",key:"_handleSelectedChanged",value:function(e){this._selectedEntities=e.detail.selectedEntities}},{kind:"method",key:"_cancel",value:function(e){e&&e.stopPropagation(),this.closeDialog()}},{kind:"method",key:"_suggestCards",value:function(){const e=(0,f.VG)(this.hass.states,this._selectedEntities,{});let i={};const{viewIndex:t,sectionIndex:a}=(0,k.jb)(this._params.path);if(void 0!==a){const e=(0,k.an)(this._params.lovelaceConfig,[t,a]);if(!(0,m.N)(e)){const{cards:t,title:a}=e;i=(0,n.Z)(e,$)}}const o=(0,f.lY)(this._selectedEntities,i);(0,w.f)(this,{lovelaceConfig:this._params.lovelaceConfig,saveConfig:this._params.saveConfig,path:this._params.path,entities:this._selectedEntities,cardConfig:e,sectionConfig:o}),this.closeDialog()}},{kind:"field",key:"_allEntities",value(){return(0,h.Z)((e=>Object.keys(e).map((e=>{const i=this.hass.states[e];return{icon:"",entity_id:e,stateObj:i,name:(0,u.C)(i),domain:(0,g.M)(e),last_changed:i.last_changed}}))))}}]}}),s.oi);a()}catch($){a($)}}))},53380:function(e,i,t){t.d(i,{f:()=>o});t(71695),t(40251),t(47021);var a=t(36522);const n=()=>Promise.all([t.e("35671"),t.e("2142"),t.e("29570"),t.e("65505"),t.e("8795"),t.e("71588"),t.e("92139"),t.e("32146"),t.e("31241"),t.e("47399"),t.e("68581"),t.e("63055"),t.e("70147"),t.e("44251"),t.e("65005"),t.e("60487"),t.e("1466"),t.e("38326"),t.e("80809"),t.e("70639"),t.e("92368"),t.e("39043"),t.e("37457"),t.e("80312"),t.e("96827")]).then(t.bind(t,22958)),o=(e,i)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:n,dialogParams:i})}}}]); //# sourceMappingURL=20309.7e0827dd4cb30cb4.js.map