iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 7.39 kB
JavaScript
export const __webpack_ids__=["87395"];export const __webpack_modules__={87707:function(e,t,i){i.d(t,{Q:()=>a});const a=e=>!(!e.detail.selected||"property"!==e.detail.source)&&(e.currentTarget.selected=!1,!0)},13928:function(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>l});var a=i(44249),n=i(15093),s=i(5111),o=i(37583);let l=(0,a.Z)([(0,n.Mo)("ha-icon-next")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"path",value:()=>"rtl"===s.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}]}}),o.HaSvgIcon)},95076:function(e,t,i){var a=i(44249),n=i(57243),s=i(15093);i(37583);(0,a.Z)([(0,s.Mo)("ha-tip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"method",key:"render",value:function(){return this.hass?n.dy` <ha-svg-icon .path="${"M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z"}"></ha-svg-icon> <span class="prefix">${this.hass.localize("ui.panel.config.tips.tip")}</span> <span class="text"><slot></slot></span> `:n.Ld}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block;text-align:center}.text{direction:var(--direction);margin-left:2px;margin-inline-start:2px;margin-inline-end:initial;color:var(--secondary-text-color)}.prefix{font-weight:500}`}]}}),n.oi)},21940:function(e,t,i){i.r(t);var a=i(44249),n=(i(9359),i(56475),i(70104),i(2060),i(57243)),s=i(15093),o=i(27486),l=i(36522),r=i(87707),h=i(1416),c=i(73729),d=(i(13928),i(7285),i(95076),i(14473)),p=i(58839),u=i(68418),g=i(30511),m=i(28008),_=i(73192);const f={local:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",community:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z",homeassistant:g.mdiHomeAssistant};(0,a.Z)([(0,s.Mo)("ha-dialog-new-automation")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_opened",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_mode",value:()=>"automation"},{kind:"field",decorators:[(0,s.SB)()],key:"blueprints",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._opened=!0,this._mode=e?.mode||"automation",(0,p.wc)(this.hass,this._mode).then((e=>{this.blueprints=e}))}},{kind:"method",key:"closeDialog",value:function(){return this._opened&&(0,l.B)(this,"dialog-closed",{dialog:this.localName}),this._opened=!1,!0}},{kind:"field",key:"_processedBlueprints",value(){return(0,o.Z)((e=>{if(!e)return[];return Object.entries(e).filter((e=>!("error"in e[1]))).map((([e,t])=>{const i=(0,p.E2)(t);return{...t.metadata,sourceType:i,path:e}})).sort(((e,t)=>(0,h.$K)(e.name,t.name,this.hass.locale.language)))}))}},{kind:"method",key:"render",value:function(){if(!this._opened)return n.Ld;const e=this._processedBlueprints(this.blueprints);return n.dy` <ha-dialog open hideActions ="${this.closeDialog}" .heading="${(0,c.i)(this.hass,this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.header`))}"> <mwc-list innerRole="listbox" itemRoles="option" innerAriaLabel="${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.header`)}" rootTabbable dialogInitialFocus> <ha-list-item hasmeta twoline graphic="icon" -selected="${this._blank}"> <ha-svg-icon slot="graphic" .path="${"M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"}"></ha-svg-icon> ${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_empty`)} <span slot="secondary"> ${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_empty_description`)} </span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> <li divider role="separator"></li> ${e.map((e=>n.dy` <ha-list-item hasmeta twoline graphic="icon" -selected="${this._blueprint}" .path="${e.path}"> <ha-svg-icon slot="graphic" .path="${f[e.sourceType]}"></ha-svg-icon> ${e.name} <span slot="secondary"> ${e.author?this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.blueprint_source.author`,{author:e.author}):this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.blueprint_source.${e.sourceType}`)} </span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> `))} ${0===e.length?n.dy` <a href="${(0,_.R)(this.hass,"/get-blueprints")}" target="_blank" rel="noreferrer noopener" class="item"> <ha-list-item hasmeta twoline graphic="icon"> <ha-svg-icon slot="graphic" .path="${"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}"></ha-svg-icon> ${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_blueprint`)} <span slot="secondary"> ${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_blueprint_description`)} </span> <ha-svg-icon slot="meta" path="${"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"}"></ha-svg-icon> </ha-list-item> </a> `:n.dy` <ha-tip .hass="${this.hass}"> <a href="${(0,_.R)(this.hass,"/get-blueprints")}" target="_blank" rel="noreferrer noopener"> ${this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.discover_blueprint_tip`)} </a> </ha-tip> `} </mwc-list> </ha-dialog> `}},{kind:"method",key:"_blueprint",value:async function(e){if(!(0,r.Q)(e))return;const t=e.currentTarget.path;"script"===this._mode?(0,u.rg)({use_blueprint:{path:t}}):(0,d.Ip)({use_blueprint:{path:t}})}},{kind:"method",key:"_blank",value:async function(e){(0,r.Q)(e)&&("script"===this._mode?(0,u.rg)():(0,d.Ip)())}},{kind:"get",static:!0,key:"styles",value:function(){return[m.Qx,m.yu,n.iv`ha-dialog{--dialog-content-padding:0;--mdc-dialog-max-height:60vh} all and (min-width:550px){ha-dialog{--mdc-dialog-min-width:500px}}ha-icon-next{width:24px}ha-tip{margin-top:8px;margin-bottom:4px}a.item{text-decoration:unset}`]}}]}}),n.oi)}};
//# sourceMappingURL=87395.24534520f5727a72.js.map