UNPKG

@securecall/client-component

Version:

SecureCall Core Web Component

53 lines (48 loc) 2.54 kB
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-0D76SiW-.js'; import { L as Logger } from './p-By6Qn8nU.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(registerHost) { super(); if (registerHost !== false) { this.__registerHost(); } this.__attachShadow(); this.responseButtonEvent = createEvent(this, "responseButtonEvent"); } fieldName; label; action = "retryClearCVV"; responseButtonEvent; log = new Logger('SecurecallResponseButton'); handleClick() { this.log.debug("handleClick: field", this.fieldName, "clicked"); this.responseButtonEvent.emit(this.action); } render() { return (h(Host, { key: '659031854eadfac8ae6a8ad7f71b07b1b4ecb711' }, h("div", { key: 'a75ccbe98bb8a695e38d0f1882e07be31f92d92b', class: "response-field-container" }, h("button", { key: '748b63c60e416fcf13a9c398ab69e087520c7d7d', 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