123456 |
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,l){function i(e){try{u(n.next(e))}catch(e){l(e)}}function a(e){try{u(n["throw"](e))}catch(e){l(e)}}function u(e){e.done?r(e.value):o(e.value).then(i,a)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},n,o,l,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return u([e,t])}}function u(i){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(l=i[0]&2?o["return"]:i[0]?o["throw"]||((l=o["return"])&&l.call(o),0):o.next)&&!(l=l.call(o,i[1])).done)return l;if(o=0,l)i=[i[0]&2,l.value];switch(i[0]){case 0:case 1:l=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(l=r.trys,l=l.length>0&&l[l.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!l||i[1]>l[0]&&i[1]<l[3])){r.label=i[1];break}if(i[0]===6&&r.label<l[1]){r.label=l[1];l=i;break}if(l&&r.label<l[2]){r.label=l[2];r.ops.push(i);break}if(l[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];o=0}finally{n=l=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,l;n<o;n++){if(l||!(n in t)){if(!l)l=Array.prototype.slice.call(t,0,n);l[n]=t[n]}}return e.concat(l||Array.prototype.slice.call(t))};
- /*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.82
- */import{g as guid}from"./guid-b4461004.js";var autoTheme="calcite-theme-auto";var darkTheme="calcite-theme-dark";var lightTheme="calcite-theme-light";var CSS_UTILITY={autoTheme:autoTheme,darkTheme:darkTheme,lightTheme:lightTheme,rtl:"calcite--rtl"};var TEXT={loading:"Loading"};function ensureId(e){if(!e){return""}return e.id=e.id||"".concat(e.tagName.toLowerCase(),"-").concat(guid())}function nodeListToArray(e){return Array.isArray(e)?e:Array.from(e)}function getThemeName(e){var t=closestElementCrossShadowBoundary(e,".".concat(CSS_UTILITY.darkTheme,", .").concat(CSS_UTILITY.lightTheme));return(t===null||t===void 0?void 0:t.classList.contains("calcite-theme-dark"))?"dark":"light"}function getElementDir(e){var t="dir";var r="[".concat(t,"]");var n=closestElementCrossShadowBoundary(e,r);return n?n.getAttribute(t):"ltr"}function getElementProp(e,t,r){var n="[".concat(t,"]");var o=e.closest(n);return o?o.getAttribute(t):r}function getRootNode(e){return e.getRootNode()}function getHost(e){return e.host||null}function queryElementsRoots(e,t){function r(e,n){if(!e){return n}if(e.assignedSlot){e=e.assignedSlot}var o=getRootNode(e);var l=Array.from(o.querySelectorAll(t));var i=l.filter((function(e){return!n.includes(e)}));n=__spreadArray(__spreadArray([],n,true),i,true);var a=getHost(o);return a?r(a,n):n}return r(e,[])}function queryElementRoots(e,t){var r=t.selector,n=t.id;function o(e){if(!e){return null}if(e.assignedSlot){e=e.assignedSlot}var t=getRootNode(e);var l=n?"getElementById"in t?t.getElementById(n):null:r?t.querySelector(r):null;var i=getHost(t);return l?l:i?o(i):null}return o(e)}function closestElementCrossShadowBoundary(e,t){function r(e){return e?e.closest(t)||r(getHost(getRootNode(e))):null}return r(e)}function isCalciteFocusable(e){return typeof(e===null||e===void 0?void 0:e.setFocus)==="function"}function focusElement(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!e){return[2]}return[2,isCalciteFocusable(e)?e.setFocus():e.focus()]}))}))}var defaultSlotSelector=":not([slot])";function getSlotted(e,t,r){if(t&&!Array.isArray(t)&&typeof t!=="string"){r=t;t=null}var n=t?Array.isArray(t)?t.map((function(e){return'[slot="'.concat(e,'"]')})).join(","):'[slot="'.concat(t,'"]'):defaultSlotSelector;if(r===null||r===void 0?void 0:r.all){return queryMultiple(e,n,r)}return querySingle(e,n,r)}function getDirectChildren(e,t){return e?Array.from(e.children||[]).filter((function(e){return e===null||e===void 0?void 0:e.matches(t)})):[]}function queryMultiple(e,t,r){var n=t===defaultSlotSelector?getDirectChildren(e,defaultSlotSelector):Array.from(e.querySelectorAll(t));n=r&&r.direct===false?n:n.filter((function(t){return t.parentElement===e}));n=(r===null||r===void 0?void 0:r.matches)?n.filter((function(e){return e===null||e===void 0?void 0:e.matches(r.matches)})):n;var o=r===null||r===void 0?void 0:r.selector;return o?n.map((function(e){return Array.from(e.querySelectorAll(o))})).reduce((function(e,t){return __spreadArray(__spreadArray([],e,true),t,true)}),[]).filter((function(e){return!!e})):n}function querySingle(e,t,r){var n=t===defaultSlotSelector?getDirectChildren(e,defaultSlotSelector)[0]||null:e.querySelector(t);n=r&&r.direct===false?n:(n===null||n===void 0?void 0:n.parentElement)===e?n:null;n=(r===null||r===void 0?void 0:r.matches)?(n===null||n===void 0?void 0:n.matches(r.matches))?n:null:n;var o=r===null||r===void 0?void 0:r.selector;return o?n===null||n===void 0?void 0:n.querySelector(o):n}function filterDirectChildren(e,t){return Array.from(e.children).filter((function(e){return e.matches(t)}))}function setRequestedIcon(e,t,r){if(typeof t==="string"&&t!==""){return t}else if(t===""){return e[r]}}function intersects(e,t){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)}function toAriaBoolean(e){return(!!e).toString()}export{CSS_UTILITY as C,TEXT as T,getElementDir as a,getThemeName as b,closestElementCrossShadowBoundary as c,getElementProp as d,ensureId as e,focusElement as f,getSlotted as g,queryElementsRoots as h,isCalciteFocusable as i,intersects as j,filterDirectChildren as k,nodeListToArray as n,queryElementRoots as q,setRequestedIcon as s,toAriaBoolean as t};
|