homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/947.ee78OLAUVLs.js

2 lines
8.9 KiB
JavaScript
Raw Normal View History

2025-01-10 21:08:35 -08:00
export const id=947;export const ids=[947];export const modules={20947:(e,i,t)=>{t.r(i),t.d(i,{HaFormString:()=>r});var d=t(309),n=t(5095),a=t(95260),o=t(18394);t(54371),t(51520);const l=["password","secret","token"];let r=(0,d.Z)([(0,a.Mo)("ha-form-string")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"localize",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"localizeBaseKey",value:()=>"ui.components.selectors.text"},{kind:"field",decorators:[(0,a.Cb)()],key:"schema",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"data",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.SB)()],key:"unmaskedPassword",value:()=>!1},{kind:"field",decorators:[(0,a.IO)("ha-textfield")],key:"_input",value:void 0},{kind:"method",key:"focus",value:function(){this._input&&this._input.focus()}},{kind:"method",key:"render",value:function(){var e,i;return n.dy` <ha-textfield .type="${this.isPassword?this.unmaskedPassword?"text":"password":this.stringType}" .label="${this.label}" .value="${this.data||""}" .helper="${this.helper}" helperPersistent .disabled="${this.disabled}" .required="${this.schema.required}" .autoValidate="${this.schema.required}" .name="${this.schema.name}" .autocomplete="${this.schema.autocomplete}" .suffix="${this.isPassword?n.dy`<div style="width:24px"></div>`:null===(e=this.schema.description)||void 0===e?void 0:e.suffix}" .validationMessage="${this.schema.required?null===(i=this.localize)||void 0===i?void 0:i.call(this,"ui.common.error_required"):void 0}" @input="${this._valueChanged}" @change="${this._valueChanged}"></ha-textfield> ${this.renderIcon()} `}},{kind:"method",key:"renderIcon",value:function(){var e;return this.isPassword?n.dy` <ha-icon-button toggles .label="${null===(e=this.localize)||void 0===e?void 0:e.call(this,`${this.localizeBaseKey}.${this.unmaskedPassword?"hide_password":"show_password"}`)}" @click="${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> `:n.Ld}},{kind:"method",key:"updated",value:function(e){e.has("schema")&&this.toggleAttribute("own-margin",!!this.schema.required)}},{kind:"method",key:"toggleUnmaskedPassword",value:function(){this.unmaskedPassword=!this.unmaskedPassword}},{kind:"method",key:"_valueChanged",value:function(e){let i=e.target.value;this.data!==i&&(""!==i||this.schema.required||(i=void 0),(0,o.B)(this,"value-changed",{value:i}))}},{kind:"get",key:"stringType",value:function(){if(this.schema.format){if(["email","url"].includes(this.schema.format))return this.schema.format;if("fqdnurl"===this.schema.format)return"url"}return"text"}},{kind:"get",key:"isPassword",value:function(){return l.some((e=>this.schema.name.includes(e)))}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`:host{display:block;position:relative}:host([own-margin]){margin-bottom:5px}ha-textfield{display:block}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-siz
//# sourceMappingURL=947.ee78OLAUVLs.js.map