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.
 
 

10 lines
4.6 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","./observers"],function(k,f,n){function l(){"undefined"!==typeof customElements&&["calcite-tabs"].forEach(a=>{switch(a){case "calcite-tabs":customElements.get(a)||customElements.define(a,m)}})}const m=f.proxyCustomElement(class extends f.H{constructor(){super();this.__registerHost();this.__attachShadow();this.mutationObserver=n.createObserver("mutation",a=>{for(const c of a)a=c.target,"CALCITE-TAB-NAV"!==a.nodeName&&"CALCITE-TAB-TITLE"!==a.nodeName&&"CALCITE-TAB"!==
a.nodeName||this.updateItems()});this.layout="inline";this.position="top";this.scale="m";this.bordered=!1;this.titles=[];this.tabs=[]}handleInheritableProps(){this.updateItems()}connectedCallback(){this.mutationObserver.observe(this.el,{childList:!0});this.updateItems()}async componentWillLoad(){this.updateItems()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){return f.h(f.Fragment,{key:"3298379f9625744b770c10f0f86fc1b2bc990cad"},f.h("slot",{key:"fd0be78d348a01b701d58f37663d392ee04ca6a9",
name:"title-group"}),f.h("section",{key:"31212d582a0e6367ed38d250c1acc39cad3fa987"},f.h("slot",{key:"179bdacefed784c60dd000101e606d5e678d93c9"})))}calciteInternalTabTitleRegister(a){this.titles=[...this.titles,a.target];this.registryHandler();a.stopPropagation()}calciteTabTitleUnregister(a){this.titles=this.titles.filter(c=>c!==a.detail);this.registryHandler();a.stopPropagation()}calciteInternalTabRegister(a){this.tabs=[...this.tabs,a.target];this.registryHandler();a.stopPropagation()}calciteTabUnregister(a){this.tabs=
this.tabs.filter(c=>c!==a.detail);this.registryHandler();a.stopPropagation()}updateItems(){const {position:a,scale:c}=this,b=this.el.querySelector("calcite-tab-nav");b&&(b.position=a,b.scale=c);Array.from(this.el.querySelectorAll("calcite-tab")).forEach(d=>{d.parentElement===this.el&&(d.scale=c)});Array.from(this.el.querySelectorAll("calcite-tab-nav \x3e calcite-tab-title")).forEach(d=>{d.position=a;d.scale=c})}async registryHandler(){let a,c;if(this.tabs.some(b=>b.tab)||this.titles.some(b=>b.tab))a=
this.tabs.sort((b,d)=>b.tab.localeCompare(d.tab)).map(b=>b.id),c=this.titles.sort((b,d)=>b.tab.localeCompare(d.tab)).map(b=>b.id);else{const b=await Promise.all(this.tabs.map(e=>e.getTabIndex())),d=await Promise.all(this.titles.map(e=>e.getTabIndex()));a=b.reduce((e,g,h)=>{e[g]=this.tabs[h].id;return e},[]);c=d.reduce((e,g,h)=>{e[g]=this.titles[h].id;return e},[])}this.tabs.forEach(b=>b.updateAriaInfo(a,c));this.titles.forEach(b=>b.updateAriaInfo(a,c))}get el(){return this}static get watchers(){return{position:["handleInheritableProps"],
scale:["handleInheritableProps"]}}static get style(){return":host{display:flex;flex-direction:column}:host([bordered]){box-shadow:inset 0 1px 0 var(--calcite-color-border-1);background-color:var(--calcite-color-foreground-1)}:host([bordered]) section{border-width:1px;border-style:solid;border-color:var(--calcite-color-border-1)}:host([bordered][position\x3dbottom]){box-shadow:inset 0 1px 0 var(--calcite-color-border-1), inset 0 -1px 0 var(--calcite-color-border-1)}:host([bordered]:not([position\x3dbottom])) ::slotted(calcite-tab-nav){margin-block-end:-1px}:host([bordered][scale\x3ds]) section{padding:0.75rem}:host([bordered][scale\x3dm]) section{padding:0.5rem}:host([bordered][scale\x3dl]) section{padding:1rem}:host([position\x3dbottom]){flex-direction:column-reverse}section{display:flex;flex-grow:1;overflow:hidden;border-block-start-width:1px;border-block-start-color:var(--calcite-color-border-1);border-block-start-style:solid}:host([position\x3dbottom]) section{flex-direction:column-reverse;border-block-start-width:0px;border-block-end-width:1px;border-block-end-color:var(--calcite-color-border-1)}:host([position\x3dbottom]:not([bordered])) section{border-block-end-style:solid}@media (forced-colors: active){:host([bordered]) section{border-block-start-width:0px;border-block-end-width:1px}:host([position\x3dbottom][bordered]) section{border-block-start-width:1px;border-block-end-width:0px}}:host([hidden]){display:none}[hidden]{display:none}"}},
[1,"calcite-tabs",{layout:[513],position:[513],scale:[513],bordered:[4],titles:[32],tabs:[32]},[[0,"calciteInternalTabTitleRegister","calciteInternalTabTitleRegister"],[16,"calciteTabTitleUnregister","calciteTabTitleUnregister"],[0,"calciteInternalTabRegister","calciteInternalTabRegister"],[16,"calciteTabUnregister","calciteTabUnregister"]],{position:["handleInheritableProps"],scale:["handleInheritableProps"]}]);l();k.Tabs=m;k.defineCustomElement=l});