iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 11.9 kB
JavaScript
export const __webpack_ids__=["34482"];export const __webpack_modules__={96814:function(e,i,t){t(9359),t(31526),e.exports=function e(i){return Object.freeze(i),Object.getOwnPropertyNames(i).forEach((function(t){!i.hasOwnProperty(t)||null===i[t]||"object"!=typeof i[t]&&"function"!=typeof i[t]||Object.isFrozen(i[t])||e(i[t])})),i}},59826:function(e,i,t){var n=t(44249),a=t(31622),o=t(57243),s=t(15093),r=t(22344);(0,n.Z)([(0,s.Mo)("ha-button")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[r.W,o.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`]}]}}),a.Button)},62037:function(e,i,t){t.a(e,(async function(e,n){try{t.d(i,{Do:()=>b,Z6:()=>y,l$:()=>_});t(92519),t(42179),t(89256),t(24931),t(88463),t(57449),t(19814);var a=t(28113),o=t(49e3),s=(t(3613),t(49025),t(3709)),r=t(49461),d=t(27526),l=t(88374),h=t(59913),c=t(40598),g=t(53251),u=t(50625),m=t(40249),p=e([a,o,s,r,d,l,h,c,g,u]);[a,o,s,r,d,l,h,c,g,u]=p.then?(await p)():p;const f=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),v={"alarm-panel":()=>Promise.all([t.e("46379"),t.e("84269")]).then(t.bind(t,40036)),area:()=>Promise.all([t.e("79931"),t.e("37910")]).then(t.bind(t,82820)),calendar:()=>Promise.all([t.e("41103"),t.e("49016"),t.e("78018"),t.e("45898"),t.e("49312")]).then(t.bind(t,18377)),conditional:()=>t.e("8715").then(t.bind(t,22194)),"empty-state":()=>t.e("18248").then(t.bind(t,98962)),"energy-compare":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("15590")]).then(t.bind(t,54586)),"energy-carbon-consumed-gauge":()=>Promise.all([t.e("99287"),t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("32654")]).then(t.bind(t,67790)),"energy-date-selection":()=>Promise.all([t.e("46379"),t.e("3134"),t.e("28612"),t.e("12767"),t.e("11012"),t.e("72743"),t.e("27232"),t.e("62058")]).then(t.bind(t,23893)),"energy-devices-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("87593"),t.e("87969")]).then(t.bind(t,18709)),"energy-devices-detail-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("41163"),t.e("72743"),t.e("87593"),t.e("63697")]).then(t.bind(t,36681)),"energy-distribution":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("16160")]).then(t.bind(t,93892)),"energy-gas-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("41163"),t.e("72743"),t.e("87593"),t.e("61217")]).then(t.bind(t,74257)),"energy-water-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("41163"),t.e("72743"),t.e("87593"),t.e("19764")]).then(t.bind(t,52081)),"energy-grid-neutrality-gauge":()=>Promise.all([t.e("99287"),t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("90564")]).then(t.bind(t,4117)),"energy-solar-consumed-gauge":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("84464")]).then(t.bind(t,33637)),"energy-self-sufficiency-gauge":()=>Promise.all([t.e("99287"),t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("43752")]).then(t.bind(t,70477)),"energy-solar-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("41163"),t.e("72743"),t.e("87593"),t.e("85745")]).then(t.bind(t,63)),"energy-sources-table":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("66018"),t.e("72743"),t.e("21483")]).then(t.bind(t,74549)),"energy-usage-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("41163"),t.e("72743"),t.e("87593"),t.e("51171")]).then(t.bind(t,32672)),"energy-sankey":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("50382"),t.e("3707"),t.e("72743"),t.e("87593"),t.e("64409")]).then(t.bind(t,10782)),"entity-filter":()=>t.e("94369").then(t.bind(t,91308)),error:()=>t.e("37269").then(t.bind(t,53257)),gauge:()=>t.e("40389").then(t.bind(t,10188)),"history-graph":()=>Promise.all([t.e("50382"),t.e("77535"),t.e("87593"),t.e("6473"),t.e("34815")]).then(t.bind(t,26799)),"horizontal-stack":()=>t.e("94618").then(t.bind(t,41023)),humidifier:()=>t.e("6892").then(t.bind(t,18344)),iframe:()=>t.e("47473").then(t.bind(t,28528)),logbook:()=>Promise.all([t.e("65499"),t.e("3098")]).then(t.bind(t,18573)),map:()=>Promise.all([t.e("35637"),t.e("49554"),t.e("13740")]).then(t.bind(t,11823)),markdown:()=>Promise.all([t.e("2981"),t.e("34172")]).then(t.bind(t,91713)),clock:()=>t.e("64153").then(t.bind(t,91502)),"media-control":()=>Promise.all([t.e("24061"),t.e("59105")]).then(t.bind(t,78793)),"picture-elements":()=>Promise.all([t.e("79931"),t.e("3371"),t.e("10745"),t.e("71683")]).then(t.bind(t,31221)),"picture-entity":()=>Promise.all([t.e("79931"),t.e("14517")]).then(t.bind(t,54529)),"picture-glance":()=>Promise.all([t.e("79931"),t.e("99457")]).then(t.bind(t,57733)),picture:()=>t.e("23339").then(t.bind(t,69773)),"plant-status":()=>t.e("63519").then(t.bind(t,84255)),"recovery-mode":()=>Promise.all([t.e("5080"),t.e("50408"),t.e("837"),t.e("31664"),t.e("39124")]).then(t.bind(t,34713)),"todo-list":()=>Promise.all([t.e("46379"),t.e("41258"),t.e("2981"),t.e("81119")]).then(t.bind(t,33841)),"shopping-list":()=>Promise.all([t.e("46379"),t.e("41258"),t.e("2981"),t.e("81119"),t.e("91480")]).then(t.bind(t,28081)),starting:()=>t.e("32197").then(t.bind(t,50957)),"statistics-graph":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("51062")]).then(t.bind(t,56615)),statistic:()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("72743"),t.e("92692")]).then(t.bind(t,98578)),"vertical-stack":()=>t.e("13157").then(t.bind(t,73753))},_=e=>(0,m.Xm)("card",e,f,v,void 0,void 0),y=e=>(0,m.Tw)("card",e,f,v,void 0,void 0),b=e=>(0,m.ED)(e,"card",f,v);n()}catch(e){n(e)}}))},64830:function(e,i,t){t.d(i,{Q:()=>s,t:()=>o});var n=t(40249);const a={picture:()=>t.e("64167").then(t.bind(t,75142)),buttons:()=>Promise.all([t.e("59821"),t.e("65970")]).then(t.bind(t,46667)),graph:()=>t.e("87828").then(t.bind(t,43403))},o=e=>(0,n.Tw)("header-footer",e,void 0,a,void 0,void 0),s=e=>(0,n.ED)(e,"header-footer",void 0,a)},22958:function(e,i,t){t.a(e,(async function(e,n){try{t.r(i),t.d(i,{HuiDialogSuggestCard:()=>b});var a=t(44249),o=(t(9359),t(70104),t(96814)),s=t.n(o),r=t(57243),d=t(15093),l=t(36522),h=(t(64889),t(17170)),c=t(10571),g=t(28008),u=t(58885),m=t(80373),p=t(27353),f=t(2593),v=t(11734),_=t(41391),y=e([h,m,v]);[h,m,v]=y.then?(await y)():y;let b=(0,a.Z)([(0,d.Mo)("hui-dialog-suggest-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:"_cardConfig",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_sectionConfig",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_saving",value:()=>!1},{kind:"field",decorators:[(0,d.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._cardConfig=e.cardConfig,this._sectionConfig=e.sectionConfig,Object.isFrozen(this._cardConfig)||(this._cardConfig=s()(this._cardConfig)),Object.isFrozen(this._sectionConfig)||(this._sectionConfig=s()(this._sectionConfig)),this._yamlEditor&&this._yamlEditor.setValue(this._cardConfig)}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._cardConfig=void 0,(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"get",key:"_viewSupportsSection",value:function(){if(!this._params?.lovelaceConfig||!this._params?.path)return!1;const{viewIndex:e}=(0,f.jb)(this._params.path),i=this._params.lovelaceConfig.views[e];return!(0,c.s)(i)&&"sections"===i.type}},{kind:"method",key:"_renderPreview",value:function(){return this._sectionConfig&&this._viewSupportsSection?r.dy` <div class="element-preview"> <hui-section .hass="${this.hass}" .config="${this._sectionConfig}" preview></hui-section> </div> `:this._cardConfig?r.dy` <div class="element-preview"> ${this._cardConfig.map((e=>r.dy` <hui-card .hass="${this.hass}" .config="${e}" preview></hui-card> `))} </div> `:r.Ld}},{kind:"method",key:"render",value:function(){return this._params?r.dy` <ha-dialog open scrimClickAction ="${this.closeDialog}" .heading="${this.hass.localize("ui.panel.lovelace.editor.suggest_card.header")}"> <div> ${this._renderPreview()} ${this._params.yaml&&this._cardConfig?r.dy` <div class="editor"> <ha-yaml-editor .hass="${this.hass}" .defaultValue="${this._cardConfig}"></ha-yaml-editor> </div> `:r.Ld} </div> <mwc-button slot="secondaryAction" ="${this.closeDialog}" dialogInitialFocus> ${this._params.yaml?this.hass.localize("ui.common.close"):this.hass.localize("ui.common.cancel")} </mwc-button> ${this._params.yaml?r.Ld:r.dy` ${this._sectionConfig&&this._viewSupportsSection?r.Ld:r.dy` <mwc-button slot="primaryAction" ="${this._pickCard}"> ${this.hass.localize("ui.panel.lovelace.editor.suggest_card.create_own")} </mwc-button> `} <mwc-button slot="primaryAction" .disabled="${this._saving}" ="${this._save}"> ${this._saving?r.dy` <ha-spinner aria-label="Saving" size="small"></ha-spinner> `:this.hass.localize("ui.panel.lovelace.editor.suggest_card.add")} </mwc-button> `} </ha-dialog> `:r.Ld}},{kind:"get",static:!0,key:"styles",value:function(){return[g.yu,r.iv` all and (max-width:450px),all and (max-height:500px){ha-dialog{max-height:100%;height:100%}} all and (min-width:850px){ha-dialog{width:845px}}ha-dialog{max-width:845px;--dialog-z-index:6}.hidden{display:none}.element-preview{position:relative}hui-card,hui-section{padding-top:8px;margin:4px auto;max-width:390px;display:block;width:100%}.editor{padding-top:16px}`]}},{kind:"method",key:"_pickCard",value:function(){this._params?.lovelaceConfig&&this._params?.path&&this._params?.saveConfig&&((0,_.F)(this,{lovelaceConfig:this._params.lovelaceConfig,saveConfig:this._params.saveConfig,path:this._params.path,entities:this._params.entities}),this.closeDialog())}},{kind:"method",key:"_computeNewConfig",value:function(e,i){if(!this._viewSupportsSection)return(0,p.BN)(e,i,this._cardConfig);const{viewIndex:t,sectionIndex:n}=(0,f.jb)(i);if(void 0===n){const i=this._sectionConfig??{type:"grid",cards:this._cardConfig};return(0,p.qG)(e,t,i)}const a=this._sectionConfig?this._sectionConfig.cards||[]:this._cardConfig;return(0,p.BN)(e,[t,n],a)}},{kind:"method",key:"_save",value:async function(){if(!(this._params?.lovelaceConfig&&this._params?.path&&this._params?.saveConfig&&this._cardConfig))return;this._saving=!0;const e=this._computeNewConfig(this._params.lovelaceConfig,this._params.path);await this._params.saveConfig(e),this._saving=!1,(0,u.f)(this,this.hass),this.closeDialog()}}]}}),r.oi);n()}catch(e){n(e)}}))},58885:function(e,i,t){t.d(i,{f:()=>a});var n=t(72473);const a=(e,i)=>(0,n.C)(e,{message:i.localize("ui.common.successfully_saved")})},30338:function(e,i,t){var n=t(97934),a=t(71998),o=t(4576),s=t(36760);e.exports=function(e,i){i&&"string"==typeof e||a(e);var t=s(e);return o(a(void 0!==t?n(t,e):e))}},25677:function(e,i,t){var n=t(40810),a=t(97934),o=t(63983),s=t(71998),r=t(4576),d=t(30338),l=t(79995),h=t(14181),c=t(92288),g=l((function(){for(var e,i,t=this.iterator,n=this.mapper;;){if(i=this.inner)try{if(!(e=s(a(i.next,i.iterator))).done)return e.value;this.inner=null}catch(e){h(t,"throw",e)}if(e=s(a(this.next,t)),this.done=!!e.done)return;try{this.inner=d(n(e.value,this.counter++),!1)}catch(e){h(t,"throw",e)}}}));n({target:"Iterator",proto:!0,real:!0,forced:c},{flatMap:function(e){return s(this),o(e),new g(r(this),{mapper:e,inner:null})}})}};
//# sourceMappingURL=34482.36f824303be59f3d.js.map