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.
 
 

12 lines
4.8 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","./interactive","./loadable"],function(g,e,d,f,h){function l(){"undefined"!==typeof customElements&&["calcite-chip-group"].forEach(a=>{switch(a){case "calcite-chip-group":customElements.get(a)||customElements.define(a,m)}})}const m=e.proxyCustomElement(class extends e.H{constructor(){super();this.__registerHost();this.__attachShadow();this.calciteChipGroupSelect=e.createEvent(this,"calciteChipGroupSelect",6);this.items=[];this.updateItems=a=>{const b=
this.slotRefEl?.assignedElements({flatten:!0}).filter(c=>c?.matches("calcite-chip"));this.items=a?d.slotChangeGetAssignedElements(a):b;1>this.items?.length||(this.items?.forEach(c=>{c.interactive=!0;c.scale=this.scale;c.selectionMode=this.selectionMode;c.parentChipGroup=this.el}),this.setSelectedItems(!1))};this.updateSelectedItems=()=>{this.selectedItems=this.items?.filter(a=>a.selected)};this.setSelectedItems=(a,b)=>{b&&this.items?.forEach(c=>{const k=b===c;switch(this.selectionMode){case "multiple":k&&
(c.selected=!c.selected);break;case "single":c.selected=k?!c.selected:!1;break;case "single-persist":c.selected=!!k}});this.updateSelectedItems();a&&this.calciteChipGroupSelect.emit()};this.disabled=!1;this.label=void 0;this.scale="m";this.selectionMode="none";this.selectedItems=[]}onSelectionModeChange(){this.updateItems()}connectedCallback(){f.connectInteractive(this)}componentDidRender(){f.disconnectInteractive(this);f.updateHostInteraction(this)}componentDidLoad(){h.setComponentLoaded(this)}async componentWillLoad(){h.setUpLoadableComponent(this)}calciteInternalChipKeyEventListener(a){if(a.composedPath().includes(this.el)){const b=
this.items?.filter(c=>!c.disabled);switch(a.detail.key){case "ArrowRight":d.focusElementInGroup(b,a.detail.target,"next");break;case "ArrowLeft":d.focusElementInGroup(b,a.detail.target,"previous");break;case "Home":d.focusElementInGroup(b,a.detail.target,"first");break;case "End":d.focusElementInGroup(b,a.detail.target,"last")}}a.stopPropagation()}calciteChipCloseListener(a){const b=a.target;this.items?.includes(b)&&(0<this.items?.indexOf(b)?d.focusElementInGroup(this.items,b,"previous"):0===this.items?.indexOf(b)?
d.focusElementInGroup(this.items,b,"next"):d.focusElementInGroup(this.items,b,"first"));this.items=this.items?.filter(c=>c!==b);a.stopPropagation()}calciteChipSelectListener(a){a.composedPath().includes(this.el)&&this.setSelectedItems(!0,a.target);a.stopPropagation()}calciteInternalChipSelectListener(a){a.composedPath().includes(this.el)&&this.setSelectedItems(!1,a.target);a.stopPropagation()}calciteInternalSyncSelectedChips(a){a.composedPath().includes(this.el)&&(this.updateSelectedItems(),"single"===
this.selectionMode&&1<this.selectedItems.length&&this.setSelectedItems(!1,a.target));a.stopPropagation()}async setFocus(){await h.componentFocusable(this);if(!this.disabled)return(this.selectedItems[0]||this.items[0])?.setFocus()}render(){const a="none"===this.selectionMode||"multiple"===this.selectionMode?"group":"radiogroup",{disabled:b}=this;return e.h(f.InteractiveContainer,{key:"341dd9e8f25d4d358ea6e33740d8b851a5fa0e9d",disabled:b},e.h("div",{key:"66c9eaa00b7ca0c602f94a017f5b6ef6afc3bd93","aria-disabled":d.toAriaBoolean(b),
"aria-label":this.label,class:"container",role:a},e.h("slot",{key:"9611ab9bbadf169969834f1e39a29b79ad7ca68b",onSlotchange:this.updateItems,ref:c=>this.slotRefEl=c})))}get el(){return this}static get watchers(){return{selectionMode:["onSelectionModeChange"]}}static get style(){return":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.container{display:flex;inline-size:100%;flex-wrap:wrap;gap:0.5rem}::slotted(calcite-chip){flex:none}:host([scale\x3ds]) .container{gap:0.25rem}:host([scale\x3dl]) .container{gap:0.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}"}},
[1,"calcite-chip-group",{disabled:[516],label:[1],scale:[513],selectionMode:[513,"selection-mode"],selectedItems:[1040],setFocus:[64]},[[0,"calciteInternalChipKeyEvent","calciteInternalChipKeyEventListener"],[0,"calciteChipClose","calciteChipCloseListener"],[0,"calciteChipSelect","calciteChipSelectListener"],[0,"calciteInternalChipSelect","calciteInternalChipSelectListener"],[0,"calciteInternalSyncSelectedChips","calciteInternalSyncSelectedChips"]],{selectionMode:["onSelectionModeChange"]}]);l();
g.CalciteChipGroup=m;g.defineCustomElement=l;Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});