UNPKG

@securecall/client-component

Version:

SecureCall Core Web Component

31 lines (26 loc) 2.55 kB
'use strict'; var index = require('./index-DcU5riY9.js'); var logger = require('./logger-MkCqSOk_.js'); const securecallRequestSecureCss = ":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 SecurecallRequestSecure = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.secureFieldResetEvent = index.createEvent(this, "secureFieldResetEvent"); } fieldName; config; secureFieldResetEvent; log = new logger.Logger('SecurecallRequestSecure'); handleClick(ev) { ev.preventDefault(); this.log.debug("handleClick: field", this.fieldName, "clicked"); this.config.valid = false; this.secureFieldResetEvent.emit(this.fieldName); } render() { return (index.h(index.Host, { key: '19c03033ea68d8e9c8cd76cd4019f6b2c351c723' }, index.h("div", { key: 'b177eb2e8580ccfb278f346bfc91f33eb24c304f', class: "field-container" }, index.h("label", { key: '0631170c01df76dc3dbe3a2732941a1674ae9fa0', class: "custom-label", htmlFor: this.fieldName }, this.config["label"], ": ", this.config.active), index.h("input", { key: 'b420fcf15ebcc6a0a84019b3b99bd471cd1bde79', type: "text", class: `custom-input ${this.config.active ? 'active' : 'inactive'}`, id: this.fieldName, readOnly: true, placeholder: this.config.value }), index.h("div", { key: 'a649497776c0cf4b4ad58d39d2591b244391cc65', class: this.config.valid ? 'field-valid' : 'field-invalid', onClick: (ev) => this.handleClick(ev) })))); } }; SecurecallRequestSecure.style = securecallRequestSecureCss; exports.securecall_request_secure = SecurecallRequestSecure; //# sourceMappingURL=securecall-request-secure.entry.cjs.js.map