UNPKG

@securecall/client-component

Version:

SecureCall Core Web Component

51 lines (46 loc) 2.48 kB
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-XmE3deEH.js'; import { L as Logger } from './p-CgjdSc_8.js'; const securecallResponseButtonCss = ":host{display:block;text-align:center;margin-top:1rem}.response-button{padding:0.75rem 1.5rem;background-color:var(--theme-button-color, #007bff);color:var(--theme-primary-color, #fff);border:none;border-radius:4px;cursor:pointer;font-size:1rem;width:fit-content}.response-button:disabled{background-color:var(--theme-button-color-disabled, #ccc);cursor:not-allowed}.response-button:hover:not(:disabled){background-color:var(--theme-button-color-hover, #0056b3)}"; const SecurecallResponseButton$1 = /*@__PURE__*/ proxyCustomElement(class SecurecallResponseButton extends H { constructor() { super(); this.__registerHost(); this.__attachShadow(); this.responseButtonEvent = createEvent(this, "responseButtonEvent"); } fieldName; label; action = "retryClearCVV"; responseButtonEvent; log = Logger('SecurecallResponseButton'); handleClick() { this.log.debug("handleClick: field", this.fieldName, "clicked"); this.responseButtonEvent.emit(this.action); } render() { return (h(Host, { key: 'f816c5ae1509e330f91f2f5d3e70b008d1243bdb' }, h("div", { key: '39350d41d8c67e62020a5618ae3f369a1aabe243', class: "response-field-container" }, h("button", { key: '73fbc0e4c7136f4f8cdbe73312d7d4554f8880cc', type: "button", class: "response-button", onClick: () => this.handleClick() }, this.label)))); } static get style() { return securecallResponseButtonCss; } }, [257, "securecall-response-button", { "fieldName": [1, "field-name"], "label": [1], "action": [1] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["securecall-response-button"]; components.forEach(tagName => { switch (tagName) { case "securecall-response-button": if (!customElements.get(tagName)) { customElements.define(tagName, SecurecallResponseButton$1); } break; } }); } const SecurecallResponseButton = SecurecallResponseButton$1; const defineCustomElement = defineCustomElement$1; export { SecurecallResponseButton, defineCustomElement }; //# sourceMappingURL=securecall-response-button.js.map //# sourceMappingURL=securecall-response-button.js.map