Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

8 lines
2.2 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define(["exports","./componentsUtils","./dom","./action-group","./action-menu"],function(k,p,r,l,t){const q=b=>b.reduce((c,a)=>c+a,0)/b.length,u=({width:b,actionWidth:c,layout:a,height:d,actionHeight:f,groupCount:e})=>Math.floor((("horizontal"===a?b:d)-2*e)/("horizontal"===a?c:f)),m=b=>Array.from(b.querySelectorAll("calcite-action")).filter(c=>c.closest("calcite-action-menu")?c.slot===t.SLOTS.trigger:!0),v=({tooltip:b,referenceElement:c,expanded:a,ref:d})=>{b&&(b.referenceElement=!a&&c?c:null);d&&
d(c);return c};k.ExpandToggle=({expanded:b,expandText:c,collapseText:a,toggle:d,el:f,position:e,tooltip:g,ref:h,scale:n})=>{const w="rtl"===r.getElementDir(f);c=b?a:c;a=["chevrons-left","chevrons-right"];w&&a.reverse();f=(e="end"===(e||f.closest("calcite-shell-panel")?.position||"start"))?a[1]:a[0];e=e?a[0]:a[1];return p.h("calcite-action",{icon:b?f:e,onClick:d,scale:n,text:c,textEnabled:b,title:b||g?null:c,ref:x=>v({tooltip:g,referenceElement:x,expanded:b,ref:h})})};k.geActionDimensions=b=>{b=b.filter(a=>
a.slot!==l.SLOTS.menuActions);const c=b?.length;return{actionWidth:c?q(b.map(a=>a.clientWidth||0)):0,actionHeight:c?q(b.map(a=>a.clientHeight||0)):0}};k.getOverflowCount=({layout:b,actionCount:c,actionWidth:a,width:d,actionHeight:f,height:e,groupCount:g})=>Math.max(c-u({width:d,actionWidth:a,layout:b,height:e,actionHeight:f,groupCount:g}),0);k.overflowActions=({actionGroups:b,expanded:c,overflowCount:a})=>{let d=a;b.reverse().forEach(f=>{let e=0;const g=m(f).reverse();g.forEach(h=>{h.slot===l.SLOTS.menuActions&&
(h.removeAttribute("slot"),h.textEnabled=c)});0<d&&g.some(h=>{1<g.filter(n=>!n.slot).length&&2<g.length&&!h.closest("calcite-action-menu")&&(h.textEnabled=!0,h.setAttribute("slot",l.SLOTS.menuActions),e++,1<e&&d--);return 1>d});p.forceUpdate(f)})};k.overflowActionsDebounceInMs=150;k.queryActions=m;k.toggleChildActionText=function({el:b,expanded:c}){m(b).filter(a=>a.slot!==l.SLOTS.menuActions).forEach(a=>a.textEnabled=c);b.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(a=>a.expanded=
c)}});