iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 3.75 kB
JavaScript
export const __rspack_esm_id=25897;export const __rspack_esm_ids=[25897];export const __webpack_modules__={86616(e,o,a){a.d(o,{j:()=>i});var t=a(83938);const i=async(e,o,a,i)=>{let s={type:o};const r=await(0,t.l)(o);if(r&&r.getStubConfig){const o=await r.getStubConfig(e,a,i);s={...s,...o}}return s}},59152(e,o,a){a.a(e,async function(e,t){try{a.r(o),a.d(o,{HuiCreateDialogHeaderFooter:()=>_});a(18111),a(61701);var i=a(62826),s=a(5124),r=a(22441),n=a(1087),c=a(18350),d=(a(93444),a(72554)),l=a(14503),p=a(78468),h=a(86616),g=e([c,d]);[c,d]=g.then?(await g)():g;class _ extends s.WF{async showDialog(e){this._params=e,this._open=!0}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params?s.qy` <ha-dialog .open="${this._open}" header-title="${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}"> <div class="elements"> ${p.o.map((e,o)=>s.qy` <ha-card role="button" tabindex="0" aria-labelledby="${"card-name-"+o}" outlined .type="${e.type}" ="${this._handleHeaderFooterPicked}" ="${this._handleHeaderFooterPicked}" ?autofocus="${0===o}"> <ha-svg-icon .path="${e.icon}"></ha-svg-icon> <div .id="${"card-name-"+o}" role="none presentation"> ${this.hass.localize(`ui.panel.lovelace.editor.header-footer.types.${e.type}.name`)} </div> </ha-card> `)} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" ="${this._cancel}"> ${this.hass.localize("ui.common.cancel")} </ha-button> </ha-dialog-footer> </ha-dialog> `:s.s6}async _handleHeaderFooterPicked(e){if(e instanceof KeyboardEvent&&"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key)return;const o=e.currentTarget.type;let a={type:o};this.hass&&(a=await(0,h.j)(this.hass,o,this._params?.entities||[],[])),this._params.pickHeaderFooter(a),this.closeDialog()}_ignoreKeydown(e){e.stopPropagation()}_cancel(e){e&&e.stopPropagation(),this.closeDialog()}static get styles(){return[l.nA,s.AH`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,r.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_params",void 0),(0,i.Cg)([(0,r.wk)()],_.prototype,"_open",void 0),_=(0,i.Cg)([(0,r.EM)("hui-dialog-create-headerfooter")],_),t()}catch(e){t(e)}})},78468(e,o,a){a.d(o,{o:()=>t});const t=[{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"}]}};