UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines • 2.08 kB
import{getSlotted as e,setSlotted as t}from"../../private/slots.js";import{Color as n}from"@scandit/web-datacapture-core";import{css as r}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";import{html as i}from"@scandit/web-datacapture-core/build/js/private/utils/html.js";const a=`barcode-icon`,o=`.container`,s=`.icon-text`,c=`.text`;function l(){return i`<div class="container"><div class="icon-text"><slot name="${a}"></slot><div class="text">Text</div></div></div>`}function u(){return r`:host{--background-color:#0000;--text-color:#000;--top-left-corner-radius:0px;--top-right-corner-radius:0px;--bottom-left-corner-radius:0px;--bottom-right-corner-radius:0px;--text-size:16px}.container{align-items:center;background-color:var(--background-color);border-radius:var(--top-left-corner-radius) var(--top-right-corner-radius) var(--bottom-right-corner-radius) var(--bottom-left-corner-radius);display:flex;flex-direction:row;justify-content:center;overflow:hidden;padding:.75rem;transition:.3s ease}.container.highlighted{opacity:.75}.icon-text{align-items:center;display:flex;gap:.5rem}.text{color:var(--text-color);font-size:var(--text-size);font-weight:600;width:100%}`}function d(t){return e(t,a)}function f(e,n){t(e,a,n)}function p(e,t){let r=e.style.getPropertyValue(`--background-color`);return r===``?t:n.fromHex(r)}function m(e,t){e.style.setProperty(`--background-color`,`#${t.toJSON()}`)}function h(e,t){let r=e.style.getPropertyValue(`--text-color`);return r===``?t:n.fromHex(r)}function g(e,t){e.style.setProperty(`--text-color`,`#${t.toJSON()}`)}function _(e){return Number.parseFloat(e.style.getPropertyValue(`--text-size`))}function v(e,t){e.style.setProperty(`--text-size`,`${t}px`)}function y(e){return e.textContent??``}function b(e,t){e.textContent=t}export{o as CONTAINER_SELECTOR,s as ICON_TEXT_SELECTOR,c as TEXT_SELECTOR,u as createStyles,l as createTemplate,p as getBackgroundColor,d as getIcon,y as getText,h as getTextColor,_ as getTextSize,m as setBackgroundColor,b as setText,g as setTextColor,v as setTextSize,f as updateIcon};