@arcgis/portal-components 5.0.0-next.116 → 5.0.0-next.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{K5L3YOUF.js → 33NBHV55.js} +2 -2
- package/dist/cdn/{KDVM6C5Q.js → AD6C7BMM.js} +2 -2
- package/dist/cdn/{ALYGRC36.js → BUCQ4NBB.js} +1 -1
- package/dist/cdn/{4FHRCQHI.js → CG2WH3D5.js} +2 -2
- package/dist/cdn/{AWPRSWV5.js → DMDITQLW.js} +2 -2
- package/dist/cdn/{KX2HU3FG.js → LFFZFASW.js} +2 -2
- package/dist/cdn/{DSKYNH53.js → MSFCQWVT.js} +2 -2
- package/dist/cdn/{FF6MYDIX.js → QD263FJ3.js} +1 -1
- package/dist/cdn/{VKIXAGE5.js → S6JS75GH.js} +2 -2
- package/dist/cdn/{U6LXGT66.js → X5O3EPPN.js} +2 -2
- package/dist/cdn/{QR7HHI5E.js → XKDMRQBF.js} +2 -2
- package/dist/cdn/{Y6SYGSC7.js → YJDURQHU.js} +2 -2
- package/dist/cdn/{CN3O3UDI.js → ZLDSL6TA.js} +2 -2
- package/dist/cdn/{7QTESPYS.js → ZTCP4LUP.js} +2 -2
- package/dist/cdn/{36UVYLRL.js → ZUT2TJI2.js} +1 -1
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/docs/api.json +327 -315
- package/dist/docs/docs.json +50 -50
- package/dist/docs/vscode.html-custom-data.json +6 -6
- package/dist/docs/web-types.json +7 -7
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/lumina.d.ts +6 -6
- package/dist/types/preact.d.ts +6 -6
- package/dist/types/react.d.ts +6 -6
- package/dist/types/stencil.d.ts +6 -6
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as R}from"./U6LXGT66.js";import"./4FHRCQHI.js";import{F as c,G as d,H as S,I as F,J as V,N as M,h as C,j as l,t as y}from"./FF6MYDIX.js";export default $arcgis.t(([T,I,b,x,P,g,h,N,m,u,w,v,D,O,G,z,j,k,W,B,J])=>{var U=C`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`,L=class{constructor(e){this.outerRing=[[180,-90],[-180,-90],[-180,90],[180,90],[180,-90]],this.map=e}init(){this.maskSymbol=new k({color:[0,0,0,.5],outline:{color:[128,128,128,.5],width:"0px"}}),this.maskLayer=new v({id:"maskLayer "}),this.overlapLayer=new v({id:"overlapLayer"}),this.map?.add(this.maskLayer),this.map?.add(this.overlapLayer)}hide(){this.maskLayer.visible=!1}show(){this.maskLayer.visible=!0}add(e,t){let i=this.buildGraphic(e,t);if(i)return i.graphic&&this.maskLayer?.add(i.graphic),i}update(e,t,i){i?this.remove(null,i):this.clear();let a=this.buildGraphic(e,t);if(a)return a.graphic&&this.maskLayer?.add(a.graphic),a}clear(){this.maskLayer?.removeAll()}remove(e,t){!e&&!t||(t&&!e&&(e=this.maskLayer?.graphics.getItemAt(t)),e&&this.maskLayer?.remove(e))}buildGraphic(e,t=this.maskSymbol){let i={};if(!e)return i;if(e.type==="extent"&&e.xmax===e.xmin){let o=new h({rings:[this.outerRing]});return i.graphic=new u({geometry:o,symbol:t}),i}e=this.toWGS84(e);let a,s;if(e.type==="extent"){let o=this.checkPolyOverlap(e);o?(a=o?.ring?.reverse(),s=o?.oring?.reverse()):a=[[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],[e.xmin,e.ymax]]}let r=[];e.xmin===e.xmax?r=[this.outerRing]:r=[this.outerRing,a?.reverse()||[[]]];let n=new h({rings:r});return s&&(i.overlap=s),i.graphic=new u({geometry:n,symbol:t}),i}checkPolyOverlap(e){let t={};if(e.xmax<=e.xmin){let i=[[e.xmin,e.ymin],[180,e.ymin],[180,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin]],a=[[-180,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax],[-180,e.ymax],[-180,e.ymin]],s=180-Math.abs(e.xmax),r=180-Math.abs(e.xmin);return s>r?(t.ring=a,t.oring=i):(t.ring=i,t.oring=a),t}else return}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}};function q(p){if(!p)return;let e=b.assetsPath;e.endsWith("/")||(e+="/"),p?.firstElementChild?.insertAdjacentHTML("beforebegin",`<link rel="stylesheet" href="${e}esri/themes/light/main.css" />`)}var $=class extends S{constructor(){super(...arguments),this.polygonSymbol=new k({style:"solid",color:new I([227,139,79,0]),outline:{color:new I([65,105,255]),width:0}}),this.dlOverlapSymbol=new k({style:"solid",color:[255,0,0,.5],outline:{color:[65,105,255],width:0}}),this.messages=R(),this.searchContainer=c(),this.mapContainer=c(),this.topCoordField=c(),this.bottomCoordField=c(),this.leftCoordField=c(),this.rightCoordField=c(),this.minLatLabel="",this.maxLatLabel="",this.minLngLabel="",this.maxLngLabel="",this.ymax="0",this.ymin="0",this.xmin="0",this.xmax="0",this.isDrawStart=!1,this.loading=!0,this.active=!1,this.contentOnly=!1,this.isArea=!1,this.arcgisExtentPickerChange=y(),this.arcgisExtentPickerClose=y(),this.arcgisExtentPickerSave=y()}static{this.properties={ymax:16,ymin:16,xmin:16,xmax:16,isDrawStart:16,loading:16,featureExtent:16,initialValue:16,active:5,extentValue:0,itemId:1,portal:0,extentService:1,contentOnly:5,isArea:5}}static{this.styles=U}getExtent(){return this.getExtentValue()}async load(){if(this.itemId){if(this.portal){let t=this.portal.url.replace("/sharing/rest/","");t!==b.portalUrl&&(b.portalUrl=t)}let e=new Intl.NumberFormat(w.getLocale(),{minimumFractionDigits:1,maximumFractionDigits:1});this.minLatLabel=e.format(-90),this.maxLatLabel=e.format(90),this.minLngLabel=e.format(-180),this.maxLngLabel=e.format(180),this.item=new z({id:this.itemId,portal:this.portal}),await this.item.load()}if(this.portal&&(this.orgExtent=this.portal.defaultExtent?.toJSON()),this.portal?.region){let e=this.portal.region,t=await j(`${this.portal.url.replace("/sharing/rest/","")}/sharing/rest/portals/self?region=${e}&default=true&f=pjson`,{responseType:"json"});this.orgRegionExtent=t.data.defaultExtent}}async loaded(){q(this.el.shadowRoot),await this.initMap()}convertToNumber(e){return this.parseNumber(e)}setFeatureExtent(e){let t;e.spatialReference.isGeographic?t=new x({xmax:e.xmax,xmin:e.xmin,ymax:e.ymax,ymin:e.ymin,spatialReference:{wkid:4326}}):t=this.toWGS84(e),this.featureExtent?(this.featureExtent.xmin=Math.min(t.xmin,this.featureExtent.xmin),this.featureExtent.ymin=Math.min(t.ymin,this.featureExtent.ymin),this.featureExtent.xmax=Math.max(t.xmax,this.featureExtent.xmax),this.featureExtent.ymax=Math.max(t.ymax,this.featureExtent.ymax)):this.featureExtent=t}async initMap(){let e=new G({basemap:"streets-vector"});if(this.extentService){let t=new O({url:this.extentService}),i=new T({baseLayers:[t],id:"org_basemap"});e.basemap=i}if(this.mask=new L(e),this.mask.init(),this.dateLineLayer=new v({id:"dateLineLayer"}),e.add(this.dateLineLayer),this.areasLayer=new v({id:"areaGraphics"}),e.add(this.areasLayer),this.item?.type==="Feature Service"||this.item?.type==="Map Service"){let t=await D.fromPortalItem({portalItem:this.item});t.visible=!1,e.add(t),t.when(i=>{if("layers"in i)for(let a=0;a<i.layers.length;a++)i.layers.getItemAt(a).queryExtent().then(s=>{s.extent&&this.setFeatureExtent(s.extent)});else i.queryExtent().then(a=>{a.extent&&this.setFeatureExtent(a.extent)})})}this.view=new W({map:e,popup:{dockEnabled:!0,dockOptions:{buttonEnabled:!1,breakpoint:!1,position:"bottom-center"}},zoom:2,center:[0,0],container:this.mapContainer.value}),this.view.when(async()=>{if(this.basemapExtent=this.getBasemapExtent(),this.itemExtent=this.item?.extent,this.extentValue?.xmax!==void 0&&this.extentValue?.xmin!==void 0&&this.extentValue?.ymax!==void 0&&this.extentValue?.ymin!==void 0)this.ymin=this.extentValue?.ymin||"0",this.ymax=this.extentValue?.ymax||"0",this.xmax=this.extentValue?.xmax||"0",this.xmin=this.extentValue?.xmin||"0",this.handleInputChange(),this.initialValue=this.currentExtent;else if(this.itemExtent)await this.drawExtent(this.itemExtent),this.initialValue=this.itemExtent;else if(this.featureExtent)await this.drawExtent(this.featureExtent),this.initialValue=this.featureExtent;else if(this.portal?.defaultExtent){let t=this.portal.defaultExtent.toJSON();await this.drawExtent(t),this.initialValue=t}this.initSearchWidget(),this.loading=!1})}getBasemapExtent(){try{let e,t,i,a;if(this.view?.map?.basemap?.hasOwnProperty("baseLayers")){let s=this.view.map.basemap.baseLayers;if(s.length>0){for(let r of s){let n=r.fullExtent||{xmin:0,ymin:0,xmax:0,ymax:0};e=e!==void 0&&e>n?.xmin?e:n.xmin,i=i!==void 0&&i>n?.ymin?i:n.ymin,t=t!==void 0&&t<n.xmax?t:n.xmax,a=a!==void 0&&a<n.ymax?a:n.ymax}return new x({xmin:e,xmax:t,ymin:i,ymax:a,spatialReference:this.view.spatialReference})}}return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}catch{return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}}async drawExtent(e){if(!e||!e.xmin&&e.xmin!==0||!e.xmax&&e.xmax!==0||!e.ymin&&e.ymin!==0||!e.ymax&&e.ymax!==0)return;let t=new h;t.spatialReference=e.spatialReference,t.addRing([new g({x:e.xmin,y:e.ymin}),new g({x:e.xmin,y:e.ymax}),new g({x:e.xmax,y:e.ymax}),new g({x:e.xmax,y:e.ymin}),new g({x:e.xmin,y:e.ymin})]),await this.addInitialExtentPicker({geometry:t})}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}formatNum(e){return w.formatNumber(e,{minimumFractionDigits:6,maximumFractionDigits:6})}strippedInvalidChars(e){let t=Array.from({length:10},(i,a)=>a.toString()).join("");return Array.from(e).filter(i=>t.includes(i)||i==="."||i==="-").join("")}parseNumber(e){let t=e.replace(",",".");return t=this.strippedInvalidChars(t),parseFloat(t)}async startupSketching(e,t){if(e&&(e=this.toMap(e)),this.sketchViewModel=new J({updateOnGraphicClick:!1,layer:this.areasLayer,view:this.view,polygonSymbol:this.polygonSymbol}),this.clearAllGraphics(),!t)if(e){e.type==="extent"&&(e=h.fromExtent(e)),this.currentExtent=this.toWGS84(e?.extent?.toJSON()),this.ymax=this.formatNum(this.currentExtent.ymax),this.ymin=this.formatNum(this.currentExtent.ymin),this.xmin=this.formatNum(this.currentExtent.xmin),this.xmax=this.formatNum(this.currentExtent.xmax),this.arcgisExtentPickerChange.emit(this.getExtentValue()),e=P.intersect(e,this.basemapExtent);let i=new u({symbol:this.polygonSymbol,geometry:e});i.geometry&&(this.fallbackExtent=i.geometry.extent,this.areasLayer?.add(i),this.mask?.clear(),this.mask?.update(i.geometry.extent),await this.zoomTo(),setTimeout(async()=>{try{i.layer&&await this.sketchViewModel?.update([i],{tool:"transform",enableRotation:!1,toggleToolOnClick:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!1}})}catch{}},0))}else this.sketchViewModel.create("rectangle");this.addSketchListeners()}addSketchListeners(){this.sketchViewModel?.on("update",async e=>{if(!e.toolEventInfo)return;let t=e?.graphics?.[0]?.geometry?.extent,i=t&&this.mask?.update(t);if(e.toolEventInfo.type==="scale-stop"||e.toolEventInfo.type==="move-stop"){let a,s=parseFloat(`${t?.xmax??"0"}`).toFixed(6),r=parseFloat(`${t?.xmin??"0"}`).toFixed(6),n=parseFloat(`${t?.ymax??"0"}`).toFixed(6),o=parseFloat(`${t?.ymin??"0"}`).toFixed(6);if(s===r||n===o?(a=t,s===r&&(a.xmax+=1),n===o&&(a.ymax+=1)):a=e?.graphics?.[0]?.geometry?.extent,i?.overlap){let E=i.graphic?.geometry,A=new h({rings:[E?.rings[1]]});await this.addInitialExtentPicker({geometry:A.extent})}else await this.startupSketching(a);this.isDrawStart=!1}else if(this.dateLineLayer?.removeAll(),i?.overlap){let a=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol});this.dateLineLayer?.add(a)}}),this.sketchViewModel?.on("create",async e=>{if(this.dateLineLayer?.removeAll(),!e.graphic)return;this.mask?.clear();let t=e?.graphic?.geometry?.extent,i=this.mask?.add(t);if(i?.overlap?(this.remainderPoly=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol}),this.dateLineLayer?.add(this.remainderPoly)):this.remainderPoly=null,e.state==="complete"){let a,s=e.graphic?.geometry?.extent?.xmin||0,r=e.graphic?.geometry?.extent?.xmax||0,n=e.graphic?.geometry?.extent?.ymin||0,o=e.graphic?.geometry?.extent?.ymax||0;if(s===r||n===o)s===r&&(r=r+1),n===o&&(o=o+1),a=new x({xmin:s,xmax:r,ymin:n,ymax:o,spatialReference:e.graphic?.geometry?.extent?.spatialReference});else{let E=i?.graphic?.geometry;a=new h({rings:[E?.rings[1]]}).extent}this.remainderPoly?await this.addInitialExtentPicker({geometry:a}):await this.startupSketching(a),this.isDrawStart=!1,this.mapContainer.value.focus()}})}async addInitialExtentPicker(e){if(!e.geometry){await this.startupSketching(null,!0);return}let t=this.toMap(e.geometry);await this.startupSketching(t)}async zoomTo(){if(this.areasLayer?.graphics){let e;if(this.areasLayer.graphics.forEach(i=>{let a=i?.geometry?.extent;e=e?e.union(a):a}),!e)return;let t=this.toMap(x.fromJSON(e.toJSON()).expand(1.35));t&&await this.view?.goTo(t)}}clearAllGraphics(){this.sketchViewModel?.cancel(),this.view?.map?.layers?.forEach(e=>{e.type==="graphics"&&e.removeAll()})}toMap(e){return this.view&&m.canProject(e,this.view)?m.project(e,this.view.spatialReference):e}initSearchWidget(){let e=new B({view:this.view,popupEnabled:!1,resultGraphicEnabled:!1,container:this.searchContainer.value}),t=e.viewModel;e.viewModel.allSources.on("change",()=>{t.allSources.forEach(i=>{i.zoomScale=null})}),e.on("select-result",i=>{this.startupSketching(i.result.extent)})}getExtentValue(){return{extent:{ymin:this.normalizeDecimal(this.ymin),ymax:this.normalizeDecimal(this.ymax),xmin:this.normalizeDecimal(this.xmin),xmax:this.normalizeDecimal(this.xmax)}}}handleInputChange(){let e=this.parseNumber(this.ymin),t=this.parseNumber(this.ymax),i=this.parseNumber(this.xmin),a=this.parseNumber(this.xmax),s=new x({spatialReference:{wkid:4326},xmin:i,xmax:a,ymin:e,ymax:t});this.currentExtent=s,this.drawExtent(s)}handleSave(){if(!this.topCoordField.value.isValid()){this.topCoordField.value.setFocus();return}if(!this.bottomCoordField.value.isValid()){this.bottomCoordField.value.setFocus();return}if(!this.leftCoordField.value.isValid()){this.leftCoordField.value.setFocus();return}if(!this.rightCoordField.value.isValid()){this.rightCoordField.value.setFocus();return}this.arcgisExtentPickerSave.emit(this.getExtentValue())}normalizeDecimal(e){return e.replace(",",".")}formatLongitudeError(e){return e.replace("${minLng}",this.minLngLabel).replace("${maxLng}",this.maxLngLabel)}formatLatitudeError(e){return e.replace("${minLat}",this.minLatLabel).replace("${maxLat}",this.maxLatLabel)}async timeout(e){return await new Promise(t=>setTimeout(t,e))}renderModal(){return l`<calcite-dialog class="extent-picker-modal" role=dialog scale=l outside-close-disabled .open=${this.active} placement=cover @calciteDialogClose=${()=>{this.arcgisExtentPickerClose.emit()}} style=${V({"--calcite-dialog-content-space":"0"})} .heading=${this.isArea?this.messages.setArea:this.messages.setExtent} heading-level=3><div class="extent-picker-content">${this.renderContent()}</div>${this.initialValue&&l`<calcite-button appearance=outline slot=footer-start icon-start=reset @click=${async()=>{if(this.initialValue){let e=+this.ymin===f(this.initialValue.ymin)&&+this.ymax===f(this.initialValue.ymax);+this.xmin===f(this.initialValue.xmin)&&+this.xmax===f(this.initialValue.xmax)&&e&&(this.ymin="0",this.ymax="0",this.xmin="0",this.xmax="0",await this.timeout(100)),this.drawExtent(this.initialValue)}}}>${this.messages.revert}</calcite-button>`||""}<calcite-button appearance=outline slot=footer-end @click=${()=>this.arcgisExtentPickerClose.emit()}>${this.messages.cancel}</calcite-button><calcite-button slot=footer-end @click=${async()=>this.handleSave()}>${this.messages.save}</calcite-button></calcite-dialog>`}renderContent(){let e=!!(this.portal&&!this.portal.id),t=!!(this.orgExtent&&!e),i=!!(this.orgRegionExtent&&!e),a=!!this.featureExtent;return l`<div class="side-panel">${!(!t&&!i&&!a)&&l`<div>${this.isArea?this.messages.areaBasedOn:this.messages.extentBasedOn}</div>${t&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgExtent)}}>${this.messages.orgExtent}</calcite-button>`||""}${i&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgRegionExtent)}}>${this.messages.orgRegion}</calcite-button>`||""}${a&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=feature-layer @click=${()=>{this.drawExtent(this.featureExtent)}}>${this.messages.currentFeatures}</calcite-button>`||""}`||""}<div class="use-location-header">${this.messages.useLocation}</div><div class="search-container"><div ${d(this.searchContainer)}></div></div><div><div class="use-location-header">${this.isArea?this.messages.drawAreaTitle:this.messages.drawExtentTitle}</div><calcite-action .text=${(this.isArea?this.messages.drawArea:this.messages.drawExtent)||""} text-enabled icon=rectangle-plus .active=${this.isDrawStart} .indicator=${this.isDrawStart} @click=${async()=>{this.isDrawStart=!this.isDrawStart,this.isDrawStart?(this.sketchViewModel||await this.startupSketching(),this.clearAllGraphics(),this.sketchViewModel?.create("rectangle")):(this.sketchViewModel?.cancel(),this.startupSketching(this.fallbackExtent))}}></calcite-action></div><div class="coordinates-section"><calcite-accordion appearance=transparent icon-position=start scale=l><calcite-accordion-item .heading=${this.messages.coordinates}><p>${this.messages.coordinatesDescription}</p><arcgis-portal-extent-picker-coord-field input-id=top-coord .label=${this.messages.top} .value=${this.strippedInvalidChars(this.ymax)} .errorMessage=${this.formatLatitudeError(this.messages.invalidTop||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymax=s.detail;let r=this.bottomCoordField.value.checkRelatedField();r&&(this.ymin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.topGreaterThanBottom} .validateRelated=${s=>s>this.convertToNumber(this.ymin)} ${d(this.topCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=bottom-coord .label=${this.messages.bottom} .value=${this.strippedInvalidChars(this.ymin)} .errorMessage=${this.formatLatitudeError(this.messages.invalidBottom||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymin=s.detail;let r=this.topCoordField.value.checkRelatedField();r&&(this.ymax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.bottomLessThanTop} .validateRelated=${s=>s<this.convertToNumber(this.ymax)} ${d(this.bottomCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=left-coord .label=${this.messages.left} .value=${this.strippedInvalidChars(this.xmin)} .errorMessage=${this.formatLongitudeError(this.messages.invalidLeft||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmin=s.detail;let r=this.rightCoordField.value.checkRelatedField();r&&(this.xmax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.leftLessThanRight} .validateRelated=${s=>s<this.convertToNumber(this.xmax)} ${d(this.leftCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=right-coord .label=${this.messages.right} .value=${this.strippedInvalidChars(this.xmax)} .errorMessage=${this.formatLongitudeError(this.messages.invalidRight||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmax=s.detail;let r=this.leftCoordField.value.checkRelatedField();r&&(this.xmin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.rightGreaterThanLeft} .validateRelated=${s=>s>this.convertToNumber(this.xmin)} ${d(this.rightCoordField)}></arcgis-portal-extent-picker-coord-field></calcite-accordion-item></calcite-accordion></div></div><div class="map-panel">${this.loading&&l`<calcite-loader class="map-loader" label="Loading the application"></calcite-loader>`||""}<div class=${F({"map-container":!0,"map-container--loaded":!this.loading})} ${d(this.mapContainer)}></div></div>`}render(){return this.contentOnly?l`<div class="extent-picker-content">${this.renderContent()}</div>`:this.renderModal()}};function f(p){return Math.round(p*1e6)/1e6}M("arcgis-portal-extent-picker",$);return $},"Basemap","Color","config","geometry/Extent","geometry/geometryEngine","geometry/Point","geometry/Polygon","geometry/SpatialReference","geometry/support/webMercatorUtils","Graphic","intl","layers/GraphicsLayer","layers/Layer","layers/TileLayer","Map","portal/PortalItem","request","symbols/SimpleFillSymbol","views/MapView","widgets/Search","widgets/Sketch/SketchViewModel")
|
|
3
|
+
v5.0.0-next.118 */
|
|
4
|
+
import{a as R}from"./X5O3EPPN.js";import"./CG2WH3D5.js";import{F as c,G as d,H as S,I as F,J as V,N as M,h as C,j as l,t as y}from"./QD263FJ3.js";export default $arcgis.t(([T,I,b,x,P,g,h,N,m,u,w,v,D,O,G,z,j,k,W,B,J])=>{var U=C`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`,L=class{constructor(e){this.outerRing=[[180,-90],[-180,-90],[-180,90],[180,90],[180,-90]],this.map=e}init(){this.maskSymbol=new k({color:[0,0,0,.5],outline:{color:[128,128,128,.5],width:"0px"}}),this.maskLayer=new v({id:"maskLayer "}),this.overlapLayer=new v({id:"overlapLayer"}),this.map?.add(this.maskLayer),this.map?.add(this.overlapLayer)}hide(){this.maskLayer.visible=!1}show(){this.maskLayer.visible=!0}add(e,t){let i=this.buildGraphic(e,t);if(i)return i.graphic&&this.maskLayer?.add(i.graphic),i}update(e,t,i){i?this.remove(null,i):this.clear();let a=this.buildGraphic(e,t);if(a)return a.graphic&&this.maskLayer?.add(a.graphic),a}clear(){this.maskLayer?.removeAll()}remove(e,t){!e&&!t||(t&&!e&&(e=this.maskLayer?.graphics.getItemAt(t)),e&&this.maskLayer?.remove(e))}buildGraphic(e,t=this.maskSymbol){let i={};if(!e)return i;if(e.type==="extent"&&e.xmax===e.xmin){let o=new h({rings:[this.outerRing]});return i.graphic=new u({geometry:o,symbol:t}),i}e=this.toWGS84(e);let a,s;if(e.type==="extent"){let o=this.checkPolyOverlap(e);o?(a=o?.ring?.reverse(),s=o?.oring?.reverse()):a=[[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],[e.xmin,e.ymax]]}let r=[];e.xmin===e.xmax?r=[this.outerRing]:r=[this.outerRing,a?.reverse()||[[]]];let n=new h({rings:r});return s&&(i.overlap=s),i.graphic=new u({geometry:n,symbol:t}),i}checkPolyOverlap(e){let t={};if(e.xmax<=e.xmin){let i=[[e.xmin,e.ymin],[180,e.ymin],[180,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin]],a=[[-180,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax],[-180,e.ymax],[-180,e.ymin]],s=180-Math.abs(e.xmax),r=180-Math.abs(e.xmin);return s>r?(t.ring=a,t.oring=i):(t.ring=i,t.oring=a),t}else return}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}};function q(p){if(!p)return;let e=b.assetsPath;e.endsWith("/")||(e+="/"),p?.firstElementChild?.insertAdjacentHTML("beforebegin",`<link rel="stylesheet" href="${e}esri/themes/light/main.css" />`)}var $=class extends S{constructor(){super(...arguments),this.polygonSymbol=new k({style:"solid",color:new I([227,139,79,0]),outline:{color:new I([65,105,255]),width:0}}),this.dlOverlapSymbol=new k({style:"solid",color:[255,0,0,.5],outline:{color:[65,105,255],width:0}}),this.messages=R(),this.searchContainer=c(),this.mapContainer=c(),this.topCoordField=c(),this.bottomCoordField=c(),this.leftCoordField=c(),this.rightCoordField=c(),this.minLatLabel="",this.maxLatLabel="",this.minLngLabel="",this.maxLngLabel="",this.ymax="0",this.ymin="0",this.xmin="0",this.xmax="0",this.isDrawStart=!1,this.loading=!0,this.active=!1,this.contentOnly=!1,this.isArea=!1,this.arcgisExtentPickerChange=y(),this.arcgisExtentPickerClose=y(),this.arcgisExtentPickerSave=y()}static{this.properties={ymax:16,ymin:16,xmin:16,xmax:16,isDrawStart:16,loading:16,featureExtent:16,initialValue:16,active:5,extentValue:0,itemId:1,portal:0,extentService:1,contentOnly:5,isArea:5}}static{this.styles=U}getExtent(){return this.getExtentValue()}async load(){if(this.itemId){if(this.portal){let t=this.portal.url.replace("/sharing/rest/","");t!==b.portalUrl&&(b.portalUrl=t)}let e=new Intl.NumberFormat(w.getLocale(),{minimumFractionDigits:1,maximumFractionDigits:1});this.minLatLabel=e.format(-90),this.maxLatLabel=e.format(90),this.minLngLabel=e.format(-180),this.maxLngLabel=e.format(180),this.item=new z({id:this.itemId,portal:this.portal}),await this.item.load()}if(this.portal&&(this.orgExtent=this.portal.defaultExtent?.toJSON()),this.portal?.region){let e=this.portal.region,t=await j(`${this.portal.url.replace("/sharing/rest/","")}/sharing/rest/portals/self?region=${e}&default=true&f=pjson`,{responseType:"json"});this.orgRegionExtent=t.data.defaultExtent}}async loaded(){q(this.el.shadowRoot),await this.initMap()}convertToNumber(e){return this.parseNumber(e)}setFeatureExtent(e){let t;e.spatialReference.isGeographic?t=new x({xmax:e.xmax,xmin:e.xmin,ymax:e.ymax,ymin:e.ymin,spatialReference:{wkid:4326}}):t=this.toWGS84(e),this.featureExtent?(this.featureExtent.xmin=Math.min(t.xmin,this.featureExtent.xmin),this.featureExtent.ymin=Math.min(t.ymin,this.featureExtent.ymin),this.featureExtent.xmax=Math.max(t.xmax,this.featureExtent.xmax),this.featureExtent.ymax=Math.max(t.ymax,this.featureExtent.ymax)):this.featureExtent=t}async initMap(){let e=new G({basemap:"streets-vector"});if(this.extentService){let t=new O({url:this.extentService}),i=new T({baseLayers:[t],id:"org_basemap"});e.basemap=i}if(this.mask=new L(e),this.mask.init(),this.dateLineLayer=new v({id:"dateLineLayer"}),e.add(this.dateLineLayer),this.areasLayer=new v({id:"areaGraphics"}),e.add(this.areasLayer),this.item?.type==="Feature Service"||this.item?.type==="Map Service"){let t=await D.fromPortalItem({portalItem:this.item});t.visible=!1,e.add(t),t.when(i=>{if("layers"in i)for(let a=0;a<i.layers.length;a++)i.layers.getItemAt(a).queryExtent().then(s=>{s.extent&&this.setFeatureExtent(s.extent)});else i.queryExtent().then(a=>{a.extent&&this.setFeatureExtent(a.extent)})})}this.view=new W({map:e,popup:{dockEnabled:!0,dockOptions:{buttonEnabled:!1,breakpoint:!1,position:"bottom-center"}},zoom:2,center:[0,0],container:this.mapContainer.value}),this.view.when(async()=>{if(this.basemapExtent=this.getBasemapExtent(),this.itemExtent=this.item?.extent,this.extentValue?.xmax!==void 0&&this.extentValue?.xmin!==void 0&&this.extentValue?.ymax!==void 0&&this.extentValue?.ymin!==void 0)this.ymin=this.extentValue?.ymin||"0",this.ymax=this.extentValue?.ymax||"0",this.xmax=this.extentValue?.xmax||"0",this.xmin=this.extentValue?.xmin||"0",this.handleInputChange(),this.initialValue=this.currentExtent;else if(this.itemExtent)await this.drawExtent(this.itemExtent),this.initialValue=this.itemExtent;else if(this.featureExtent)await this.drawExtent(this.featureExtent),this.initialValue=this.featureExtent;else if(this.portal?.defaultExtent){let t=this.portal.defaultExtent.toJSON();await this.drawExtent(t),this.initialValue=t}this.initSearchWidget(),this.loading=!1})}getBasemapExtent(){try{let e,t,i,a;if(this.view?.map?.basemap?.hasOwnProperty("baseLayers")){let s=this.view.map.basemap.baseLayers;if(s.length>0){for(let r of s){let n=r.fullExtent||{xmin:0,ymin:0,xmax:0,ymax:0};e=e!==void 0&&e>n?.xmin?e:n.xmin,i=i!==void 0&&i>n?.ymin?i:n.ymin,t=t!==void 0&&t<n.xmax?t:n.xmax,a=a!==void 0&&a<n.ymax?a:n.ymax}return new x({xmin:e,xmax:t,ymin:i,ymax:a,spatialReference:this.view.spatialReference})}}return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}catch{return new x({ymin:-90,ymax:90,xmin:-180,xmax:180,spatialReference:{wkid:4326}})}}async drawExtent(e){if(!e||!e.xmin&&e.xmin!==0||!e.xmax&&e.xmax!==0||!e.ymin&&e.ymin!==0||!e.ymax&&e.ymax!==0)return;let t=new h;t.spatialReference=e.spatialReference,t.addRing([new g({x:e.xmin,y:e.ymin}),new g({x:e.xmin,y:e.ymax}),new g({x:e.xmax,y:e.ymax}),new g({x:e.xmax,y:e.ymin}),new g({x:e.xmin,y:e.ymin})]),await this.addInitialExtentPicker({geometry:t})}toWGS84(e){let t=new N({wkid:4326});return m.canProject(e,t)?m.project(e,t):e}formatNum(e){return w.formatNumber(e,{minimumFractionDigits:6,maximumFractionDigits:6})}strippedInvalidChars(e){let t=Array.from({length:10},(i,a)=>a.toString()).join("");return Array.from(e).filter(i=>t.includes(i)||i==="."||i==="-").join("")}parseNumber(e){let t=e.replace(",",".");return t=this.strippedInvalidChars(t),parseFloat(t)}async startupSketching(e,t){if(e&&(e=this.toMap(e)),this.sketchViewModel=new J({updateOnGraphicClick:!1,layer:this.areasLayer,view:this.view,polygonSymbol:this.polygonSymbol}),this.clearAllGraphics(),!t)if(e){e.type==="extent"&&(e=h.fromExtent(e)),this.currentExtent=this.toWGS84(e?.extent?.toJSON()),this.ymax=this.formatNum(this.currentExtent.ymax),this.ymin=this.formatNum(this.currentExtent.ymin),this.xmin=this.formatNum(this.currentExtent.xmin),this.xmax=this.formatNum(this.currentExtent.xmax),this.arcgisExtentPickerChange.emit(this.getExtentValue()),e=P.intersect(e,this.basemapExtent);let i=new u({symbol:this.polygonSymbol,geometry:e});i.geometry&&(this.fallbackExtent=i.geometry.extent,this.areasLayer?.add(i),this.mask?.clear(),this.mask?.update(i.geometry.extent),await this.zoomTo(),setTimeout(async()=>{try{i.layer&&await this.sketchViewModel?.update([i],{tool:"transform",enableRotation:!1,toggleToolOnClick:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!1}})}catch{}},0))}else this.sketchViewModel.create("rectangle");this.addSketchListeners()}addSketchListeners(){this.sketchViewModel?.on("update",async e=>{if(!e.toolEventInfo)return;let t=e?.graphics?.[0]?.geometry?.extent,i=t&&this.mask?.update(t);if(e.toolEventInfo.type==="scale-stop"||e.toolEventInfo.type==="move-stop"){let a,s=parseFloat(`${t?.xmax??"0"}`).toFixed(6),r=parseFloat(`${t?.xmin??"0"}`).toFixed(6),n=parseFloat(`${t?.ymax??"0"}`).toFixed(6),o=parseFloat(`${t?.ymin??"0"}`).toFixed(6);if(s===r||n===o?(a=t,s===r&&(a.xmax+=1),n===o&&(a.ymax+=1)):a=e?.graphics?.[0]?.geometry?.extent,i?.overlap){let E=i.graphic?.geometry,A=new h({rings:[E?.rings[1]]});await this.addInitialExtentPicker({geometry:A.extent})}else await this.startupSketching(a);this.isDrawStart=!1}else if(this.dateLineLayer?.removeAll(),i?.overlap){let a=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol});this.dateLineLayer?.add(a)}}),this.sketchViewModel?.on("create",async e=>{if(this.dateLineLayer?.removeAll(),!e.graphic)return;this.mask?.clear();let t=e?.graphic?.geometry?.extent,i=this.mask?.add(t);if(i?.overlap?(this.remainderPoly=new u({geometry:new h({rings:[i.overlap]}),symbol:this.dlOverlapSymbol}),this.dateLineLayer?.add(this.remainderPoly)):this.remainderPoly=null,e.state==="complete"){let a,s=e.graphic?.geometry?.extent?.xmin||0,r=e.graphic?.geometry?.extent?.xmax||0,n=e.graphic?.geometry?.extent?.ymin||0,o=e.graphic?.geometry?.extent?.ymax||0;if(s===r||n===o)s===r&&(r=r+1),n===o&&(o=o+1),a=new x({xmin:s,xmax:r,ymin:n,ymax:o,spatialReference:e.graphic?.geometry?.extent?.spatialReference});else{let E=i?.graphic?.geometry;a=new h({rings:[E?.rings[1]]}).extent}this.remainderPoly?await this.addInitialExtentPicker({geometry:a}):await this.startupSketching(a),this.isDrawStart=!1,this.mapContainer.value.focus()}})}async addInitialExtentPicker(e){if(!e.geometry){await this.startupSketching(null,!0);return}let t=this.toMap(e.geometry);await this.startupSketching(t)}async zoomTo(){if(this.areasLayer?.graphics){let e;if(this.areasLayer.graphics.forEach(i=>{let a=i?.geometry?.extent;e=e?e.union(a):a}),!e)return;let t=this.toMap(x.fromJSON(e.toJSON()).expand(1.35));t&&await this.view?.goTo(t)}}clearAllGraphics(){this.sketchViewModel?.cancel(),this.view?.map?.layers?.forEach(e=>{e.type==="graphics"&&e.removeAll()})}toMap(e){return this.view&&m.canProject(e,this.view)?m.project(e,this.view.spatialReference):e}initSearchWidget(){let e=new B({view:this.view,popupEnabled:!1,resultGraphicEnabled:!1,container:this.searchContainer.value}),t=e.viewModel;e.viewModel.allSources.on("change",()=>{t.allSources.forEach(i=>{i.zoomScale=null})}),e.on("select-result",i=>{this.startupSketching(i.result.extent)})}getExtentValue(){return{extent:{ymin:this.normalizeDecimal(this.ymin),ymax:this.normalizeDecimal(this.ymax),xmin:this.normalizeDecimal(this.xmin),xmax:this.normalizeDecimal(this.xmax)}}}handleInputChange(){let e=this.parseNumber(this.ymin),t=this.parseNumber(this.ymax),i=this.parseNumber(this.xmin),a=this.parseNumber(this.xmax),s=new x({spatialReference:{wkid:4326},xmin:i,xmax:a,ymin:e,ymax:t});this.currentExtent=s,this.drawExtent(s)}handleSave(){if(!this.topCoordField.value.isValid()){this.topCoordField.value.setFocus();return}if(!this.bottomCoordField.value.isValid()){this.bottomCoordField.value.setFocus();return}if(!this.leftCoordField.value.isValid()){this.leftCoordField.value.setFocus();return}if(!this.rightCoordField.value.isValid()){this.rightCoordField.value.setFocus();return}this.arcgisExtentPickerSave.emit(this.getExtentValue())}normalizeDecimal(e){return e.replace(",",".")}formatLongitudeError(e){return e.replace("${minLng}",this.minLngLabel).replace("${maxLng}",this.maxLngLabel)}formatLatitudeError(e){return e.replace("${minLat}",this.minLatLabel).replace("${maxLat}",this.maxLatLabel)}async timeout(e){return await new Promise(t=>setTimeout(t,e))}renderModal(){return l`<calcite-dialog class="extent-picker-modal" role=dialog scale=l outside-close-disabled .open=${this.active} placement=cover @calciteDialogClose=${()=>{this.arcgisExtentPickerClose.emit()}} style=${V({"--calcite-dialog-content-space":"0"})} .heading=${this.isArea?this.messages.setArea:this.messages.setExtent} heading-level=3><div class="extent-picker-content">${this.renderContent()}</div>${this.initialValue&&l`<calcite-button appearance=outline slot=footer-start icon-start=reset @click=${async()=>{if(this.initialValue){let e=+this.ymin===f(this.initialValue.ymin)&&+this.ymax===f(this.initialValue.ymax);+this.xmin===f(this.initialValue.xmin)&&+this.xmax===f(this.initialValue.xmax)&&e&&(this.ymin="0",this.ymax="0",this.xmin="0",this.xmax="0",await this.timeout(100)),this.drawExtent(this.initialValue)}}}>${this.messages.revert}</calcite-button>`||""}<calcite-button appearance=outline slot=footer-end @click=${()=>this.arcgisExtentPickerClose.emit()}>${this.messages.cancel}</calcite-button><calcite-button slot=footer-end @click=${async()=>this.handleSave()}>${this.messages.save}</calcite-button></calcite-dialog>`}renderContent(){let e=!!(this.portal&&!this.portal.id),t=!!(this.orgExtent&&!e),i=!!(this.orgRegionExtent&&!e),a=!!this.featureExtent;return l`<div class="side-panel">${!(!t&&!i&&!a)&&l`<div>${this.isArea?this.messages.areaBasedOn:this.messages.extentBasedOn}</div>${t&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgExtent)}}>${this.messages.orgExtent}</calcite-button>`||""}${i&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${()=>{this.drawExtent(this.orgRegionExtent)}}>${this.messages.orgRegion}</calcite-button>`||""}${a&&l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=feature-layer @click=${()=>{this.drawExtent(this.featureExtent)}}>${this.messages.currentFeatures}</calcite-button>`||""}`||""}<div class="use-location-header">${this.messages.useLocation}</div><div class="search-container"><div ${d(this.searchContainer)}></div></div><div><div class="use-location-header">${this.isArea?this.messages.drawAreaTitle:this.messages.drawExtentTitle}</div><calcite-action .text=${(this.isArea?this.messages.drawArea:this.messages.drawExtent)||""} text-enabled icon=rectangle-plus .active=${this.isDrawStart} .indicator=${this.isDrawStart} @click=${async()=>{this.isDrawStart=!this.isDrawStart,this.isDrawStart?(this.sketchViewModel||await this.startupSketching(),this.clearAllGraphics(),this.sketchViewModel?.create("rectangle")):(this.sketchViewModel?.cancel(),this.startupSketching(this.fallbackExtent))}}></calcite-action></div><div class="coordinates-section"><calcite-accordion appearance=transparent icon-position=start scale=l><calcite-accordion-item .heading=${this.messages.coordinates}><p>${this.messages.coordinatesDescription}</p><arcgis-portal-extent-picker-coord-field input-id=top-coord .label=${this.messages.top} .value=${this.strippedInvalidChars(this.ymax)} .errorMessage=${this.formatLatitudeError(this.messages.invalidTop||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymax=s.detail;let r=this.bottomCoordField.value.checkRelatedField();r&&(this.ymin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.topGreaterThanBottom} .validateRelated=${s=>s>this.convertToNumber(this.ymin)} ${d(this.topCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=bottom-coord .label=${this.messages.bottom} .value=${this.strippedInvalidChars(this.ymin)} .errorMessage=${this.formatLatitudeError(this.messages.invalidBottom||"")} min=-90 max=90 @arcgisCoordChange=${s=>{this.ymin=s.detail;let r=this.topCoordField.value.checkRelatedField();r&&(this.ymax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.bottomLessThanTop} .validateRelated=${s=>s<this.convertToNumber(this.ymax)} ${d(this.bottomCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=left-coord .label=${this.messages.left} .value=${this.strippedInvalidChars(this.xmin)} .errorMessage=${this.formatLongitudeError(this.messages.invalidLeft||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmin=s.detail;let r=this.rightCoordField.value.checkRelatedField();r&&(this.xmax=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.leftLessThanRight} .validateRelated=${s=>s<this.convertToNumber(this.xmax)} ${d(this.leftCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=right-coord .label=${this.messages.right} .value=${this.strippedInvalidChars(this.xmax)} .errorMessage=${this.formatLongitudeError(this.messages.invalidRight||"")} min=-180 max=180 @arcgisCoordChange=${s=>{this.xmax=s.detail;let r=this.leftCoordField.value.checkRelatedField();r&&(this.xmin=r),this.handleInputChange()}} .relatedErrorMessage=${this.messages.rightGreaterThanLeft} .validateRelated=${s=>s>this.convertToNumber(this.xmin)} ${d(this.rightCoordField)}></arcgis-portal-extent-picker-coord-field></calcite-accordion-item></calcite-accordion></div></div><div class="map-panel">${this.loading&&l`<calcite-loader class="map-loader" label="Loading the application"></calcite-loader>`||""}<div class=${F({"map-container":!0,"map-container--loaded":!this.loading})} ${d(this.mapContainer)}></div></div>`}render(){return this.contentOnly?l`<div class="extent-picker-content">${this.renderContent()}</div>`:this.renderModal()}};function f(p){return Math.round(p*1e6)/1e6}M("arcgis-portal-extent-picker",$);return $},"Basemap","Color","config","geometry/Extent","geometry/geometryEngine","geometry/Point","geometry/Polygon","geometry/SpatialReference","geometry/support/webMercatorUtils","Graphic","intl","layers/GraphicsLayer","layers/Layer","layers/TileLayer","Map","portal/PortalItem","request","symbols/SimpleFillSymbol","views/MapView","widgets/Search","widgets/Sketch/SketchViewModel")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
3
|
+
v5.0.0-next.118 */
|
|
4
4
|
export default $arcgis.t(([c,{once:l}])=>{var D=(t,e,r)=>{let a=d(t,e,r);return a=m(r,a),a},d=(t,e,r)=>{let a=r.classificationMetadata.defaultValue,s=structuredClone(t)??{[e]:a};return s[e]??=a,s},$=(t,e)=>t&&Object.fromEntries(Object.entries(t).filter(([r])=>e.get(r)?.enabled!==!1)),m=(t,e)=>{let r=structuredClone(e);return Object.entries(t.attributes).forEach(([a,s])=>{if(r?.[a])return;let{uiElement:o,defaultValue:n}=s;switch(o){case"date":r&&(r[a]=p(s));break;case"multi-select":case"multi-grouped-select-nested":n&&r&&(r[a]=[n]);break;case"checkbox":n&&r&&(r[a]=n==="true");break;case"single-select":case"text":n&&r&&(r[a]=n);break}}),r?.fgi||delete r?.fgiOptions,r},p=t=>{let e=new Date,{type:r,defaultDateTimeline:a,defaultDateTimelineUnits:s}=t;if(r==="date"&&a&&s)switch(s.toLowerCase()){case"years":e.setFullYear(e.getFullYear()+a);break;case"months":e.setMonth(e.getMonth()+a);break;case"days":e.setDate(e.getDate()+a);break}let o=(e.getMonth()+1).toString(),n=e.getDate().toString();return`${e.getFullYear()}-${o.length===1?`0${o}`:o}-${n.length===1?`0${n}`:n}`},k=(t,e,r)=>{let a=e?.createdUser,s=e?.createdDate;return e={[r]:t,...a?{createdUser:a}:{},...s?{createdDate:s}:{}},e},U=async t=>{try{if(!t)return!1;t.loaded||await t.load();let e=t.portal.user??await l(()=>t?.portal.user);if(!e)return!1;let r=e.privileges.includes("portal:admin:updateItems");return i(t,e)||g(t,e)||r||t.access==="shared"&&await f(t,e)}catch(e){return console.error(e),!1}};function i(t,e){return t.owner===e.username}function g(t,e){let r=t.owner,a=t.itemControl==="admin",s=["esri_livingatlas","esri_demographics","esri_boundaries"];return t.portal?.isPortal&&!i(t,e)&&a&&r?.includes("esri_")&&!s.includes(r)?!1:a}var f=async(t,e)=>{let r=t.portal.restUrl,a=(await h(e,r)).result??[],s=(await b(t,r)).result??[];return a?.some(o=>s?.some(n=>o.id===n.id&&o.capabilities.includes("updateitemcontrol")))},h=async(t,e)=>{let r=`${e}/community/users/${t.username}`;try{return{result:(await c(r,{query:{f:"json"},responseType:"json"})).data?.groups??[]}}catch{return{error:{code:"unhandledError"}}}},b=async(t,e)=>{let r=t.id,a=`${e}/content/items/${r}/groups`;try{let s=await c(a,{query:{f:"json",method:"post"},responseType:"json"}),o=s.data?.admin??[],n=s.data?.member??[],u=s.data?.other??[];return{result:[...o,...n,...u]}}catch{return{error:{code:"unhandledError"}}}},j=(t,e)=>{let r=Date.now(),a=t?.portal.user?.username??"",{createdUser:s=a,createdDate:o=r}=e??{};return{createdUser:s,createdDate:o,lastEditedUser:a,lastEditedDate:r}};return{a:D,b:$,c:m,d:k,e:U,f:j}},"request","core/reactiveUtils")
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{M as t,w as e}from"./
|
|
3
|
+
v5.0.0-next.118 */
|
|
4
|
+
import{M as t,w as e}from"./QD263FJ3.js";var i=e(t,{"arcgis-portal-classification-banner":[()=>import("./YJDURQHU.js"),"autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./XKDMRQBF.js"),"autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./MSFCQWVT.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./ZLDSL6TA.js"),"attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./ZTCP4LUP.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./S6JS75GH.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./AD6C7BMM.js"),"config:,fieldNames:,layer:,mapView:,options:"]});i({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,t)
|
package/dist/chunks/common.js
CHANGED
|
@@ -2,7 +2,7 @@ import i from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as l } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.118 */
|
|
6
6
|
const U = (t, e, s) => {
|
|
7
7
|
let r = d(
|
|
8
8
|
t,
|
|
@@ -6,7 +6,7 @@ import L from "@arcgis/core/request.js";
|
|
|
6
6
|
import * as v from "@arcgis/core/core/sql.js";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.118 */
|
|
10
10
|
var b = /* @__PURE__ */ ((e) => (e.expression = "expression/", e.raster = "Raster.", e.relationship = "relationships/", e))(b || {});
|
|
11
11
|
const H = ["feature"];
|
|
12
12
|
function z(e) {
|
|
@@ -6,7 +6,7 @@ import { makeAccessorController as C } from "@arcgis/lumina/controllers/accessor
|
|
|
6
6
|
import { Task as v } from "@lit/task";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.118 */
|
|
10
10
|
var w = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (i, a, s, t) => {
|
|
11
11
|
for (var r = t > 1 ? void 0 : t ? g(a, s) : a, l = i.length - 1, c; l >= 0; l--)
|
|
12
12
|
(c = i[l]) && (r = (t ? c(a, s, r) : c(r)) || r);
|
package/dist/chunks/requests.js
CHANGED
|
@@ -2,7 +2,7 @@ import n from "@arcgis/core/request.js";
|
|
|
2
2
|
import { once as c } from "@arcgis/core/core/reactiveUtils.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.118 */
|
|
6
6
|
async function f(s, t) {
|
|
7
7
|
const i = `${s}/portals/self/classification/classificationSchema`, e = {};
|
|
8
8
|
try {
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
|
|
|
3
3
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
6
|
-
v5.0.0-next.
|
|
6
|
+
v5.0.0-next.118 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.0.0-next/portal-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
|
|
8
8
|
t.t = s;
|
|
9
9
|
t.o = r;
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeT9nController as o } from "@arcgis/lumina/controllers";
|
|
|
2
2
|
import { g as t } from "./runtime.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.118 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -6,7 +6,7 @@ import { css as h, html as s } from "lit";
|
|
|
6
6
|
import { rethrowError as o } from "@arcgis/toolkit/log";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.118 */
|
|
10
10
|
const m = h`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`;
|
|
11
11
|
class p extends l {
|
|
12
12
|
constructor() {
|
|
@@ -13,7 +13,7 @@ import { watch as _ } from "@arcgis/core/core/reactiveUtils.js";
|
|
|
13
13
|
import { r as D } from "../../chunks/requests.js";
|
|
14
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
15
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
16
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.118 */
|
|
17
17
|
async function T({
|
|
18
18
|
portalClassificationSchema: a,
|
|
19
19
|
itemClassification: t
|
|
@@ -7,7 +7,7 @@ import { u as d, r as v } from "../../chunks/requests.js";
|
|
|
7
7
|
import { g as h } from "../../chunks/common.js";
|
|
8
8
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
9
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
10
|
+
v5.0.0-next.118 */
|
|
11
11
|
const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`;
|
|
12
12
|
class C extends n {
|
|
13
13
|
constructor() {
|
|
@@ -5,7 +5,7 @@ import { css as d, html as i } from "lit";
|
|
|
5
5
|
import { u as h } from "../../chunks/useT9n.js";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.118 */
|
|
9
9
|
const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
10
10
|
function l(n, e) {
|
|
11
11
|
return n.uiElement === e;
|
|
@@ -26,7 +26,7 @@ import { createRef as d, ref as x } from "lit/directives/ref.js";
|
|
|
26
26
|
import { u as B } from "../../chunks/useT9n.js";
|
|
27
27
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
28
28
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
29
|
-
v5.0.0-next.
|
|
29
|
+
v5.0.0-next.118 */
|
|
30
30
|
const W = F`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`;
|
|
31
31
|
class J {
|
|
32
32
|
constructor(t) {
|
|
@@ -5,7 +5,7 @@ import { css as h, html as o } from "lit";
|
|
|
5
5
|
import { useDirection as m } from "@arcgis/lumina/controllers";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.118 */
|
|
9
9
|
const g = h`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-status-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-color-status-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`;
|
|
10
10
|
class v extends u {
|
|
11
11
|
constructor() {
|
|
@@ -13,7 +13,7 @@ import { u as V } from "../../chunks/useT9n.js";
|
|
|
13
13
|
import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
14
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
15
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
16
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.118 */
|
|
17
17
|
const n = /* @__PURE__ */ new Map();
|
|
18
18
|
n.set("oid", "key");
|
|
19
19
|
n.set("guid", "key");
|