UNPKG

@securecall/client-component

Version:

SecureCall Core Web Component

2 lines 2.1 kB
import{r as e,c as i,h as t,H as c}from"./p-KxdoBBDC.js";import{L as r}from"./p-By6Qn8nU.js";const a=":host{display:block}.field-container{display:grid;grid-template-columns:10em 1fr 20px;align-items:center;gap:1rem}.custom-label{color:var(--theme-primary-color);text-align:right;align-items:center;font-weight:bold;gap:0.5rem}.custom-input,.custom-input.active,.custom-input.inactive{padding:0.2rem;border-radius:4px;font-size:1rem;border:1px solid var(--theme-secondary-color)}.custom-input.active{background-color:var(--theme-input-active-background)}.custom-input.inactive{background-color:var(--theme-input-inactive-background)}input:read-only{pointer-events:none}.field-invalid{background-color:var(--theme-primary-color);-webkit-mask:var(--icon-reset);mask:var(--icon-reset);height:1.0rem;width:1.0rem;cursor:pointer;pointer-events:auto}.field-valid{background-color:var(--theme-primary-color);-webkit-mask:var(--icon-valid);mask:var(--icon-valid);height:1.0rem;width:1.0rem;cursor:pointer;pointer-events:auto}";const o=class{constructor(t){e(this,t);this.secureFieldResetEvent=i(this,"secureFieldResetEvent")}fieldName;config;secureFieldResetEvent;log=new r("SecurecallRequestSecure");handleClick(e){e.preventDefault();this.log.debug("handleClick: field",this.fieldName,"clicked");this.config.valid=false;this.secureFieldResetEvent.emit(this.fieldName)}render(){return t(c,{key:"19c03033ea68d8e9c8cd76cd4019f6b2c351c723"},t("div",{key:"b177eb2e8580ccfb278f346bfc91f33eb24c304f",class:"field-container"},t("label",{key:"0631170c01df76dc3dbe3a2732941a1674ae9fa0",class:"custom-label",htmlFor:this.fieldName},this.config["label"],": ",this.config.active),t("input",{key:"b420fcf15ebcc6a0a84019b3b99bd471cd1bde79",type:"text",class:`custom-input ${this.config.active?"active":"inactive"}`,id:this.fieldName,readOnly:true,placeholder:this.config.value}),t("div",{key:"a649497776c0cf4b4ad58d39d2591b244391cc65",class:this.config.valid?"field-valid":"field-invalid",onClick:e=>this.handleClick(e)})))}};o.style=a;export{o as securecall_request_secure}; //# sourceMappingURL=p-c20af3da.entry.js.map