UNPKG

@seznam/szn-select

Version:

Accessible HTML selectbox with customizable UI. Based on web components and easy to integrate with various frameworks like React or Angular.

1 lines 1.78 kB
"use strict";!function(){var e="data-szn-select--loader-urls--",n=["package","es2016","es3","bundle-elements-es2016","bundle-elements-es3","bundle-full-ce","bundle-full-es2016","bundle-full-es3"],t=function(e){var n={ELEMENT_ES2016:"es2016",ELEMENT_ES3:"es3",ELEMENTS_ES2016:"bundle-elements.es2016",ELEMENTS_ES3:"bundle-elements.es3",ALL_CE:"bundle-full.ce",ALL_ES2016:"bundle-full.es2016",ALL_ES3:"bundle-full.es3"},t="https://cdn.jsdelivr.net/npm/@seznam/szn-select@1.x/";return function(s,l){if("undefined"==typeof self)throw new Error("The loader can only be used at the client-side");if(e.SznElements&&e.SznElements["szn-tethered"]&&e.SznElements["szn-select"])return null;var r=function(s){var l,r=navigator.userAgent.match(/ Firefox\/(\d+)/),c=r&&parseInt(r[1],10),u=(!c||c>52)&&e.Proxy&&Array.prototype.includes,E=e.SznElements&&e.SznElements.init&&e.SznElements.injectStyles,a=E&&e.SznElements["szn-tethered"]?u?n.ELEMENT_ES2016:n.ELEMENT_ES3:E?u?n.ELEMENTS_ES2016:n.ELEMENTS_ES3:e.customElements?n.ALL_CE:u?n.ALL_ES2016:n.ALL_ES3;return s[a]||(l=s.package||t,(/\/$/.test(l)?l:"".concat(l,"/"))+"szn-select.".concat(a,".min.js"))}(s),c=document.createElement("script");return c.async=l,c.defer=l,c.src=r,c}}(self),s=document.currentScript||document.querySelector("[".concat(e).concat(n.join("],[".concat(e)),"]"))||{attributes:[]},l=t(function(e){for(var n={},t=e.attributes,s=t.length-1;s>=0;s--){var l=t[s];if(/^data-szn-select--loader-urls--/.test(l.name)){var r=l.name.substring(30).split("-"),c=r.length>1?"".concat(r.slice(0,-1).join("-"),".").concat(r[r.length-1]):r[0];n[c]=l.value}}return n}(s),s.async);l&&(-1===["interactive","complete"].indexOf(document.readyState)?document.write(l.outerHTML):(document.head||document.querySelector("head")).appendChild(l))}();