UNPKG

@securecall/client-component

Version:

SecureCall Core Web Component

96 lines (95 loc) 4 kB
import { Host, h } from "@stencil/core"; import { Logger } from "../../utils/logger"; export class SecurecallRequestSecure { fieldName; config; secureFieldResetEvent; log = 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 (h(Host, { key: '6c1684c01d4984c7cd27d7fbb3fe8892c2880036' }, h("div", { key: '0e967520c9d92f479f49222bebf20271fb42f221', class: "field-container" }, h("label", { key: '69b04cd792a1c2b882910ad9e765cccbe76bc664', class: "custom-label", htmlFor: this.fieldName }, this.config["label"], ": ", this.config.active), h("input", { key: '30dd1112269f7fb99a587544c5f49bdc28c1cbbb', type: "text", class: `custom-input ${this.config.active ? 'active' : 'inactive'}`, id: this.fieldName, readOnly: true, placeholder: this.config.value }), h("div", { key: '16565d6b1ee2853cd0494b198103b2e761970650', class: { validity: true, valid: this.config.valid }, onClick: (ev) => this.handleClick(ev) })))); } static get is() { return "securecall-request-secure"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["securecall-request-secure.css"] }; } static get styleUrls() { return { "$": ["securecall-request-secure.css"] }; } static get properties() { return { "fieldName": { "type": "string", "attribute": "field-name", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "getter": false, "setter": false, "reflect": false }, "config": { "type": "unknown", "attribute": "config", "mutable": false, "complexType": { "original": "IRequestField", "resolved": "{ label?: string; hidden?: boolean; value?: string; max?: number; min?: number; placeholder?: string; readOnly?: boolean; order?: number; component?: string; valid?: boolean; possibleValues?: Record<string, string>; mapping?: string; externalMapping?: string; active?: boolean; hideRelatedFields?: Record<string, object>; secure?: boolean; optional?: boolean; }", "references": { "IRequestField": { "location": "import", "path": "../../interfaces/configuration", "id": "src/interfaces/configuration.ts::IRequestField" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "getter": false, "setter": false } }; } static get events() { return [{ "method": "secureFieldResetEvent", "name": "secureFieldResetEvent", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "string", "resolved": "string", "references": {} } }]; } } //# sourceMappingURL=securecall-request-secure.js.map