UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

1 lines 1.28 kB
function n(n){return Array.isArray(n)?n:Array.from(n)}function t(n){return u(n,"dir","ltr")}function r(n){return u(n,"theme","light")}function u(n,t,r,u=!1){const o=`[${t}]`,i=u?function(n,t=this){return function t(r){return r&&r!==document&&r!==window?r.closest(n)||t(r.getRootNode().host):null}(t)}(o,n):n.closest(o);return i?i.getAttribute(t):r}function o(n){n&&("function"==typeof n.setFocus?n.setFocus():n.focus())}function i(n,t,r){const u=`[slot="${t}"]`;return(null==r?void 0:r.all)?function(n,t,r){let u=Array.from(n.querySelectorAll(t));u=r&&!1===r.direct?u:u.filter((t=>t.parentElement===n));const o=null==r?void 0:r.selector;return o?u.map((n=>Array.from(n.querySelectorAll(o)))).reduce(((n,t)=>[...n,...t]),[]).filter((n=>!!n)):u}(n,u,r):function(n,t,r){let u=n.querySelector(t);u=r&&!1===r.direct||(null==u?void 0:u.parentElement)===n?u:null;const o=null==r?void 0:r.selector;return o?u.querySelector(o):u}(n,u,r)}function c(n,t){return Array.from(n.children).filter((n=>n.matches(t)))}function e(n,t){const r=null==n?void 0:n.getAttribute(t);return r&&document.getElementById(r)||null}function l(n,t){return n.contains(t)}function s(n,t,r){return"string"==typeof t&&""!==t?t:""===t?n[r]:void 0}export{r as a,u as b,i as c,e as d,c as e,o as f,t as g,l as h,n,s}