atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 664 B
JavaScript
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call(document.querySelectorAll(t));function n(t,e){const n=t||{};e=e?"string"==typeof e?document.querySelector(e):e:document.body;let o="div";n.tag&&(o=n.tag);const r=document.createElement(o);for(const t in n)null!=n[t]&&("klass"===t?r.setAttribute("class",n.klass):"tag"===t||("styles"===t?l(r,n.styles):"text"===t?r.textContent=n.text:"html"===t?r.innerHTML=n.html:r.setAttribute(t,n[t])));return e.appendChild(r),r}const o=t=>t?.parentNode?.removeChild(t),l=(t,e)=>{for(const n in e)t.style[n]=e[n]};export{t as $,e as $$,n as ad,o as del,l as setStyles};