iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 4.72 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["58705"],{95612:function(e,t,a){a.a(e,(async function(e,t){try{var s=a(61701),i=(a(71695),a(40251),a(47021),a(57243)),r=a(50778),o=a(36522),n=a(29095),d=(a(99426),a(54977),a(83166),a(28008)),l=a(94616),c=a(37013),u=e([n]);n=(u.then?(await u)():u)[0];let h,y,k,f,v=e=>e;(0,s.Z)([(0,r.Mo)("cloud-forgot-password-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"localize",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"translation-key-panel"})],key:"translationKeyPanel",value(){return"config.cloud.forgot_password"}},{kind:"field",decorators:[(0,r.Cb)()],key:"email",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"card-less"})],key:"cardLess",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_inProgress",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.IO)("#email",!0)],key:"emailField",value:void 0},{kind:"method",key:"render",value:function(){return this.cardLess?this._renderContent():(0,i.dy)(h||(h=v` <ha-card outlined .header="${0}"> ${0} </ha-card> `),this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`),this._renderContent())}},{kind:"method",key:"_renderContent",value:function(){var e;return(0,i.dy)(y||(y=v` <div class="card-content"> <p> ${0} </p> ${0} <ha-textfield autofocus id="email" label="${0}" .value="${0}" type="email" required .disabled="${0}" ="${0}" .validationMessage="${0}"></ha-textfield> </div> <div class="card-actions"> <ha-progress-button ="${0}" .progress="${0}"> ${0} </ha-progress-button> </div> `),this.localize(`ui.panel.${this.translationKeyPanel}.instructions`),this._error?(0,i.dy)(k||(k=v`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):i.Ld,this.localize(`ui.panel.${this.translationKeyPanel}.email`),null!==(e=this.email)&&void 0!==e?e:"",this._inProgress,this._keyDown,this.localize(`ui.panel.${this.translationKeyPanel}.email_error_msg`),this._handleEmailPasswordReset,this._inProgress,this.localize(`ui.panel.${this.translationKeyPanel}.send_reset_email`))}},{kind:"method",key:"_keyDown",value:function(e){"Enter"===e.key&&this._handleEmailPasswordReset()}},{kind:"field",key:"_resetPassword",value(){return async e=>{this._inProgress=!0;try{this.hass?await(0,l.u_)(this.hass,e):await(0,c.cG)(e),(0,o.B)(this,"cloud-email-changed",{value:e}),this._inProgress=!1,(0,o.B)(this,"cloud-done",{flashMessage:this.localize(`ui.panel.${this.translationKeyPanel}.check_your_email`)})}catch(t){this._inProgress=!1;"usernotfound"===(t&&t.body&&t.body.code)&&e!==e.toLowerCase()?await this._resetPassword(e.toLowerCase()):this._error=t&&t.body&&t.body.message?t.body.message:"Unknown error"}}}},{kind:"method",key:"_handleEmailPasswordReset",value:async function(){const e=this.emailField,t=e.value;e.reportValidity()?(this._inProgress=!0,this._resetPassword(t)):e.focus()}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,(0,i.iv)(f||(f=v`ha-card{max-width:600px;margin:0 auto;margin-top:24px}h1{margin:0}ha-textfield{width:100%}.card-actions{display:flex;justify-content:flex-end;align-items:center}`))]}}]}}),i.oi);t()}catch(h){t(h)}}))},10685:function(e,t,a){a.a(e,(async function(e,s){try{a.r(t),a.d(t,{CloudForgotPassword:()=>y});var i=a(61701),r=(a(71695),a(47021),a(57243)),o=a(50778),n=a(95612),d=(a(87979),a(28008)),l=e([n]);n=(l.then?(await l)():l)[0];let c,u,h=e=>e,y=(0,i.Z)([(0,o.Mo)("cloud-forgot-password")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"email",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_requestInProgress",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,r.dy)(c||(c=h` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <div class="content"> <cloud-forgot-password-card .hass="${0}" .localize="${0}" .email="${0}"></cloud-forgot-password-card> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.cloud.forgot_password.title"),this.hass,this.hass.localize,this.email)}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,(0,r.iv)(u||(u=h`.content{padding-bottom:24px}`))]}}]}}),r.oi);s()}catch(c){s(c)}}))}}]);
//# sourceMappingURL=58705.3f9b56033d22f9a5.js.map