UNPKG

iobroker.lovelace

Version:

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

1 lines 4.01 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[25897],{86616:function(e,t,o){o.d(t,{j:function(){return i}});o(3362);var a=o(83938);const i=async(e,t,o,i)=>{let n={type:t};const s=await(0,a.l)(t);if(s&&s.getStubConfig){const t=await s.getStubConfig(e,o,i);n=Object.assign(Object.assign({},n),t)}return n}},59152:function(e,t,o){o.a(e,async function(e,a){try{o.r(t),o.d(t,{HuiCreateDialogHeaderFooter:function(){return _}});o(18111),o(61701),o(3362),o(62953);var i=o(40445),n=o(5124),s=o(67576),r=o(1087),c=o(18350),l=(o(93444),o(72554)),d=o(14503),h=o(78468),p=o(86616),g=e([c,l]);[c,l]=g.then?(await g)():g;let u,y,C,f=e=>e;class _ extends n.WF{async showDialog(e){this._params=e,this._open=!0}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,(0,r.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params?(0,n.qy)(u||(u=f` <ha-dialog .open="${0}" header-title="${0}" @keydown="${0}" @closed="${0}"> <div class="elements"> ${0} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.lovelace.editor.header-footer.choose_header_footer",{type:this.hass.localize(`ui.panel.lovelace.editor.header-footer.${this._params.type}`)}),this._ignoreKeydown,this._dialogClosed,h.o.map((e,t)=>(0,n.qy)(y||(y=f` <ha-card role="button" tabindex="0" aria-labelledby="${0}" outlined .type="${0}" @click="${0}" @keyDown="${0}" ?autofocus="${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> <div .id="${0}" role="none presentation"> ${0} </div> </ha-card> `),"card-name-"+t,e.type,this._handleHeaderFooterPicked,this._handleHeaderFooterPicked,0===t,e.icon,"card-name-"+t,this.hass.localize(`ui.panel.lovelace.editor.header-footer.types.${e.type}.name`))),this._cancel,this.hass.localize("ui.common.cancel")):n.s6}async _handleHeaderFooterPicked(e){if(e instanceof KeyboardEvent&&"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key)return;const t=e.currentTarget.type;let o={type:t};var a;this.hass&&(o=await(0,p.j)(this.hass,t,(null===(a=this._params)||void 0===a?void 0:a.entities)||[],[]));this._params.pickHeaderFooter(o),this.closeDialog()}_ignoreKeydown(e){e.stopPropagation()}_cancel(e){e&&e.stopPropagation(),this.closeDialog()}static get styles(){return[d.nA,(0,n.AH)(C||(C=f`ha-dialog{--dialog-content-padding:2px 24px 20px 24px;--dialog-z-index:6}.elements{display:flex;flex-wrap:wrap}.spinner,ha-card{width:calc(50% - 8px);text-align:center;margin:4px}ha-card{box-sizing:border-box;padding:8px;color:var(--secondary-text-color);font-size:var(--ha-font-size-l);cursor:pointer}ha-svg-icon{padding-bottom:4px;--mdc-icon-size:38px}`))]}constructor(...e){super(...e),this._open=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_params",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_open",void 0),_=(0,i.Cg)([(0,s.EM)("hui-dialog-create-headerfooter")],_),a()}catch(u){a(u)}})},78468:function(e,t,o){o.d(t,{o:function(){return a}});const a=[{type:"graph",icon:"M4 19V20H22V22H2V2H4V17C7 17 10 15 12.1 11.4C15.1 6.4 18.4 4 22 4V6C19.2 6 16.5 8.1 13.9 12.5C11.3 16.6 7.7 19 4 19Z"},{type:"buttons",icon:"M13 5C15.21 5 17 6.79 17 9C17 10.5 16.2 11.77 15 12.46V11.24C15.61 10.69 16 9.89 16 9C16 7.34 14.66 6 13 6S10 7.34 10 9C10 9.89 10.39 10.69 11 11.24V12.46C9.8 11.77 9 10.5 9 9C9 6.79 10.79 5 13 5M20 20.5C19.97 21.32 19.32 21.97 18.5 22H13C12.62 22 12.26 21.85 12 21.57L8 17.37L8.74 16.6C8.93 16.39 9.2 16.28 9.5 16.28H9.7L12 18V9C12 8.45 12.45 8 13 8S14 8.45 14 9V13.47L15.21 13.6L19.15 15.79C19.68 16.03 20 16.56 20 17.14V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.11 2.9 14 4 14H8V12L4 12L4 4H20L20 12H18V14H20V13.96L20.04 14C21.13 14 22 13.09 22 12V4C22 2.9 21.11 2 20 2Z"},{type:"picture",icon:"M20,5A2,2 0 0,1 22,7V17A2,2 0 0,1 20,19H4C2.89,19 2,18.1 2,17V7C2,5.89 2.89,5 4,5H20M5,16H19L14.5,10L11,14.5L8.5,11.5L5,16Z"}]}}]);