iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 14.7 kB
JavaScript
export const __webpack_ids__=["9113"];export const __webpack_modules__={51784:function(e,t,i){i.d(t,{dJ:()=>u,zB:()=>p});var a=i(44249),o=i(72621),n=i(67840),d=i(88854),l=i(57243),s=i(15093);let r;n.A.addInitializer((async e=>{await e.updateComplete;const t=e;t.dialog.prepend(t.scrim),t.scrim.style.inset=0,t.scrim.style.zIndex=0;const{getOpenAnimation:i,getCloseAnimation:a}=t;t.getOpenAnimation=()=>{const e=i.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e},t.getCloseAnimation=()=>{const e=a.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e}}));(0,a.Z)([(0,s.Mo)("ha-md-dialog")],(function(e,t){class a extends t{constructor(){super(),e(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),r||(r=i.e("73854").then(i.bind(i,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:()=>!1},{kind:"field",key:"_polyfillDialogRegistered",value:()=>!1},{kind:"method",key:"_handleOpen",value:async function(e){if(e.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const t=this.shadowRoot?.querySelector("dialog");(await r).default.registerDialog(t),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=e,new Promise(((i,a)=>{t.onload=()=>i(),t.onerror=()=>a(new Error(`Stylesheet failed to load: ${e}`)),this.shadowRoot?.appendChild(t)}))}},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){e.preventDefault();const t=this.shadowRoot?.querySelector("dialog .container");void 0!==this.animate&&t?.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2})}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(a,"styles",this),l.iv`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px} all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`]}}]}}),n.A);const c={...d.I,dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]},h={...d.G,dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]},u=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?c:d.I,p=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?h:d.G},34326:function(e,t,i){var a=i(44249),o=i(57243),n=i(15093);i(23334),i(83166);(0,a.Z)([(0,n.Mo)("ha-password-field")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"value",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"placeholder",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"minLength",value:()=>-1},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"maxLength",value:()=>-1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"helper",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"validateOnInitialRender",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"validationMessage",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autoValidate",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"pattern",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"size",value:()=>null},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"helperPersistent",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"charCounter",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"endAligned",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"prefix",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"suffix",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"name",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"input-mode"})],key:"inputMode",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"readOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:String})],key:"autocapitalize",value:()=>""},{kind:"field",decorators:[(0,n.SB)()],key:"_unmaskedPassword",value:()=>!1},{kind:"field",decorators:[(0,n.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"render",value:function(){return o.dy`<ha-textfield .invalid="${this.invalid}" .errorMessage="${this.errorMessage}" .icon="${this.icon}" .iconTrailing="${this.iconTrailing}" .autocomplete="${this.autocomplete}" .autocorrect="${this.autocorrect}" .inputSpellcheck="${this.inputSpellcheck}" .value="${this.value}" .placeholder="${this.placeholder}" .label="${this.label}" .disabled="${this.disabled}" .required="${this.required}" .minLength="${this.minLength}" .maxLength="${this.maxLength}" .outlined="${this.outlined}" .helper="${this.helper}" .validateOnInitialRender="${this.validateOnInitialRender}" .validationMessage="${this.validationMessage}" .autoValidate="${this.autoValidate}" .pattern="${this.pattern}" .size="${this.size}" .helperPersistent="${this.helperPersistent}" .charCounter="${this.charCounter}" .endAligned="${this.endAligned}" .prefix="${this.prefix}" .name="${this.name}" .inputMode="${this.inputMode}" .readOnly="${this.readOnly}" .autocapitalize="${this.autocapitalize}" .type="${this._unmaskedPassword?"text":"password"}" .suffix="${o.dy`<div style="width:24px"></div>`}" ="${this._handleInputEvent}" ="${this._handleChangeEvent}"></ha-textfield> <ha-icon-button .label="${this.hass?.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password")||(this._unmaskedPassword?"Hide password":"Show password")}" ="${this._toggleUnmaskedPassword}" .path="${this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}"></ha-icon-button>`}},{kind:"method",key:"focus",value:function(){this._textField.focus()}},{kind:"method",key:"checkValidity",value:function(){return this._textField.checkValidity()}},{kind:"method",key:"reportValidity",value:function(){return this._textField.reportValidity()}},{kind:"method",key:"setCustomValidity",value:function(e){return this._textField.setCustomValidity(e)}},{kind:"method",key:"layout",value:function(){return this._textField.layout()}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleInputEvent",value:function(e){this.value=e.target.value}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleChangeEvent",value:function(e){this.value=e.target.value,this._reDispatchEvent(e)}},{kind:"method",key:"_reDispatchEvent",value:function(e){const t=new Event(e.type,e);this.dispatchEvent(t)}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:block;position:relative}ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`}]}}),o.oi)},75639:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var o=i(44249),n=i(57243),d=i(15093),l=i(36522),s=(i(95198),i(23334),i(13928),i(51784),i(19993),i(74633),i(37583),i(34326),i(99426),i(26779)),r=i(28008),c=i(9807),h=e([s,c]);[s,c]=h.then?(await h)():h;const u="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";(0,o.Z)([(0,d.Mo)("ha-dialog-download-decrypted-backup")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_opened",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,d.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_encryptionKey",value:()=>""},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value:()=>""},{kind:"method",key:"showDialog",value:function(e){this._opened=!0,this._params=e}},{kind:"method",key:"closeDialog",value:function(){return this._dialog?.close(),!0}},{kind:"method",key:"_dialogClosed",value:function(){this._opened&&(0,l.B)(this,"dialog-closed",{dialog:this.localName}),this._opened=!1,this._params=void 0,this._encryptionKey="",this._error=""}},{kind:"method",key:"render",value:function(){return this._opened&&this._params?n.dy` <ha-md-dialog open ="${this._dialogClosed}" disable-cancel-action> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" ="${this.closeDialog}" .label="${this.hass.localize("ui.common.close")}" .path="${u}"></ha-icon-button> <span slot="title"> ${this.hass.localize("ui.panel.config.backup.dialogs.download.title")} </span> </ha-dialog-header> <div slot="content"> <p> ${this.hass.localize("ui.panel.config.backup.dialogs.download.description")} </p> <p> ${this.hass.localize("ui.panel.config.backup.dialogs.download.download_backup_encrypted",{download_it_encrypted:n.dy`<button class="link" ="${this._downloadEncrypted}"> ${this.hass.localize("ui.panel.config.backup.dialogs.download.download_it_encrypted")} </button>`})} </p> <ha-password-field .label="${this.hass.localize("ui.panel.config.backup.dialogs.download.encryption_key")}" ="${this._keyChanged}"></ha-password-field> ${this._error?n.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:n.Ld} </div> <div slot="actions"> <ha-button ="${this._cancel}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button ="${this._submit}"> ${this.hass.localize("ui.panel.config.backup.dialogs.download.download")} </ha-button> </div> </ha-md-dialog> `:n.Ld}},{kind:"method",key:"_cancel",value:function(){this.closeDialog()}},{kind:"method",key:"_submit",value:async function(){if(""!==this._encryptionKey)try{await(0,s.fi)(this.hass,this._params.backup.backup_id,this._agentId,this._encryptionKey),(0,c.W)(this.hass,this._params.backup.backup_id,this._agentId,this._encryptionKey),this.closeDialog()}catch(e){"password_incorrect"===e?.code?this._error=this.hass.localize("ui.panel.config.backup.dialogs.download.incorrect_encryption_key"):"decrypt_not_supported"===e?.code?this._error=this.hass.localize("ui.panel.config.backup.dialogs.download.decryption_not_supported"):alert(e.message)}}},{kind:"method",key:"_keyChanged",value:function(e){this._encryptionKey=e.currentTarget.value,this._error=""}},{kind:"get",key:"_agentId",value:function(){return this._params?.agentId?this._params.agentId:(0,s.OT)(Object.keys(this._params.backup.agents))}},{kind:"method",key:"_downloadEncrypted",value:async function(){(0,c.W)(this.hass,this._params.backup.backup_id,this._agentId),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,r.yu,n.iv`ha-md-dialog{--dialog-content-padding:8px 24px;max-width:500px} all and (max-width:450px),all and (max-height:500px){ha-md-dialog{max-width:none}div[slot=content]{margin-top:0}}button.link{background:0 0;border:none;padding:0;font-size:14px;color:var(--primary-color);text-decoration:underline;cursor:pointer}`]}}]}}),n.oi);a()}catch(e){a(e)}}))}};
//# sourceMappingURL=9113.306982ae4974d377.js.map