UNPKG

@microblink/blinkinput-in-browser-sdk

Version:

A simple barcode scanning library for WebAssembly-enabled browsers.

44 lines (38 loc) 1.83 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-38220d97.js'); const generic_helpers = require('./generic.helpers-6161629f.js'); const mbButtonClassicCss = ":host{box-sizing:border-box;display:block}:host a{display:block;margin:0;padding:0;width:100%;height:32px;line-height:32px;color:var(--mb-component-button-classic-text-color);background:var(--mb-component-button-classic-background);text-align:center;text-decoration:none;font-family:var(--mb-font-family);font-size:var(--mb-component-button-classic-font-size);font-weight:var(--mb-component-button-classic-font-weight)}:host a:hover,:host a:active,:host a:focus{cursor:pointer}:host(.disabled){opacity:0.5}:host(.disabled) a{cursor:default}"; let MbButtonClassic = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.buttonClick = index.createEvent(this, "buttonClick", 7); /** * Set to 'true' if button should be disabled, and if click events should not be triggered. */ this.disabled = false; /** * Set to 'true' if default event should be prevented. */ this.preventDefault = false; } handleClick(ev) { if (this.preventDefault) { ev.preventDefault(); } if (this.disabled) { ev.stopPropagation(); return; } this.buttonClick.emit(ev); } connectedCallback() { generic_helpers.setWebComponentParts(this.hostEl); } render() { return (index.h(index.Host, { className: generic_helpers.classNames({ disabled: this.disabled }), onClick: (ev) => this.handleClick(ev) }, index.h("a", { href: "javascript:void(0)" }, index.h("slot", null)))); } get hostEl() { return index.getElement(this); } }; MbButtonClassic.style = mbButtonClassicCss; exports.mb_button_classic = MbButtonClassic;