@arcgis/map-components 5.0.0-next.165 → 5.0.0-next.167
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/3AYU4UID.js +2 -0
- package/dist/cdn/{IEH4OYWP.js → GD77B4TN.js} +1 -1
- package/dist/cdn/W464NEUQ.js +2 -0
- package/dist/cdn/{SAGJDTGS.js → X474EDKF.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-basemap-gallery-item/customElement.js +1 -1
- package/dist/components/arcgis-directions/customElement.d.ts +32 -1
- package/dist/components/arcgis-directions/customElement.js +30 -8
- package/dist/components/arcgis-utility-network-trace-location/customElement.js +7 -7
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +19 -17
- package/dist/components/types.d.ts +2 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/AC3NQPKC.js +0 -2
- package/dist/cdn/CXJGKZ7S.js +0 -2
package/dist/loader.js
CHANGED
|
@@ -20,7 +20,7 @@ const s = t(e, {
|
|
|
20
20
|
"arcgis-coordinate-conversion": [() => import("./components/arcgis-coordinate-conversion/customElement.js"), "autoDestroyDisabled,conversions:,currentLocation:,expanded,formats:,goToOverride:,headingLevel,hideCaptureButton,hideExpandButton,hideInputButton,hideSettingsButton,icon,label,locationSymbol:,messages:,mode,multipleConversionsDisabled,orientation,referenceElement,state:,storageDisabled,storageType,view:;destroy,reverseConvert"],
|
|
21
21
|
"arcgis-daylight": [() => import("./components/arcgis-daylight/customElement.js"), "autoDestroyDisabled,currentSeason,dateOrSeason,dayPlaying,headingLevel,hideDatePicker,hideHeader,hidePlayButtons,hideShadowsToggle,hideSunLightingToggle,hideTimezone,icon,label,localDate,messages:,playSpeedMultiplier,referenceElement,timeSliderPosition,timeSliderSteps,utcOffset,view:,yearPlaying;destroy"],
|
|
22
22
|
"arcgis-directional-pad": [() => import("./components/arcgis-directional-pad/customElement.js"), "autoDestroyDisabled,disabled,hideDirectionalButtons,icon,label,messageOverrides:,messages:,referenceElement,showRotationResetButton,showRotationSlider,state:,view:,visualScale;destroy"],
|
|
23
|
-
"arcgis-directions": [() => import("./components/arcgis-directions/customElement.js"), "apiKey,autoDestroyDisabled,goToOverride:,headingLevel,hideLayerDetails,hideSaveAsButton,hideSaveButton,icon,label,lastRoute:,layer:,maxStops,referenceElement,routeLayerItemId,searchProperties:,state:,unit,useDefaultRouteLayer,view:;destroy,getDirections,save,saveAs,zoomToRoute"],
|
|
23
|
+
"arcgis-directions": [() => import("./components/arcgis-directions/customElement.js"), "apiKey,autoDestroyDisabled,autoSolveOnEditActive,goToOverride:,headingLevel,hideLayerDetails,hidePrintButton,hideSaveAsButton,hideSaveButton,icon,label,lastRoute:,layer:,maxStops,referenceElement,routeLayerItemId,searchProperties:,state:,unit,useDefaultRouteLayer,view:;destroy,getDirections,save,saveAs,zoomToRoute;startEditing,stopEditing"],
|
|
24
24
|
"arcgis-direct-line-measurement-3d": [() => import("./components/arcgis-direct-line-measurement-3d/customElement.js"), "analysis:,autoDestroyDisabled,hideStartButton,hideUnitSelect,hideVisualization,icon,label,messages:,referenceElement,state:,unit,unitOptions:,view:;clear,destroy,start"],
|
|
25
25
|
"arcgis-distance-measurement-2d": [() => import("./components/arcgis-distance-measurement-2d/customElement.js"), "analysis:,autoDestroyDisabled,hideStartButton,hideUnitSelect,hideVisualization,icon,label,messages:,referenceElement,snappingOptions:,state:,unit,unitOptions:,view:;clear,destroy,start"],
|
|
26
26
|
"arcgis-editor": [() => import("./components/arcgis-editor/customElement.js"), "activeWorkflow:,autoDestroyDisabled,headingLevel,hideCreateFeaturesSection,hideEditFeaturesSection,hideLabelsToggle,hideMergeButton,hideSettingsMenu,hideSketch,hideSnappingControlsElementsEnabledToggle,hideSnappingControlsElementsFeatureEnabledToggle,hideSnappingControlsElementsLayerList,hideSnappingControlsElementsSelfEnabledToggle,hideSplitButton,hideTooltipsToggle,hideUndoRedoButtons,hideZoomToButton,icon,label,labelOptions:,layerInfos:,referenceElement,showSnappingControlsElementsHeader,snappingOptions:,state:,supportingWidgetDefaults:,syncViewSelection,tooltipOptions:,view:;cancelWorkflow,deleteFeatureFromWorkflow,destroy,startCreateFeaturesWorkflowAtFeatureCreation,startCreateFeaturesWorkflowAtFeatureTypeSelection,startUpdateWorkflowAtFeatureEdit,startUpdateWorkflowAtFeatureSelection,startUpdateWorkflowAtMultipleFeatureSelection;cancelSelectionTool"],
|
package/dist/types/lumina.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ interface LuminaArcgisDirectionalPad extends Partial<Pick<ArcgisDirectionalPad,
|
|
|
199
199
|
onarcgisReady?: EventHandler<ArcgisDirectionalPad["arcgisReady"]>;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
interface LuminaArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, h.JSX.HTMLAttributes<ArcgisDirections> {
|
|
202
|
+
interface LuminaArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "autoSolveOnEditActive" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hidePrintButton" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, h.JSX.HTMLAttributes<ArcgisDirections> {
|
|
203
203
|
onarcgisPropertyChange?: EventHandler<ArcgisDirections["arcgisPropertyChange"]>;
|
|
204
204
|
onarcgisReady?: EventHandler<ArcgisDirections["arcgisReady"]>;
|
|
205
205
|
}
|
package/dist/types/preact.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ interface PreactArcgisDirectionalPad extends Partial<Pick<ArcgisDirectionalPad,
|
|
|
200
200
|
onarcgisReady?: EventHandler<ArcgisDirectionalPad["arcgisReady"]>;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
interface PreactArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, HTMLAttributes<ArcgisDirections> {
|
|
203
|
+
interface PreactArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "autoSolveOnEditActive" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hidePrintButton" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, HTMLAttributes<ArcgisDirections> {
|
|
204
204
|
onarcgisPropertyChange?: EventHandler<ArcgisDirections["arcgisPropertyChange"]>;
|
|
205
205
|
onarcgisReady?: EventHandler<ArcgisDirections["arcgisReady"]>;
|
|
206
206
|
}
|
package/dist/types/react.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ interface ReactArcgisDirectionalPad extends Partial<Pick<ArcgisDirectionalPad, "
|
|
|
200
200
|
onarcgisReady?: EventHandler<ArcgisDirectionalPad["arcgisReady"]>;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
interface ReactArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, HTMLProps<ArcgisDirections> {
|
|
203
|
+
interface ReactArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "autoSolveOnEditActive" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hidePrintButton" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, HTMLProps<ArcgisDirections> {
|
|
204
204
|
onarcgisPropertyChange?: EventHandler<ArcgisDirections["arcgisPropertyChange"]>;
|
|
205
205
|
onarcgisReady?: EventHandler<ArcgisDirections["arcgisReady"]>;
|
|
206
206
|
}
|
package/dist/types/stencil.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ interface StencilArcgisDirectionalPad extends Partial<Pick<ArcgisDirectionalPad,
|
|
|
200
200
|
onArcgisReady?: EventHandler<ArcgisDirectionalPad["arcgisReady"]>;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
interface StencilArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, StencilJsx.HTMLAttributes<ArcgisDirections> {
|
|
203
|
+
interface StencilArcgisDirections extends Partial<Pick<ArcgisDirections, "apiKey" | "autoDestroyDisabled" | "autoSolveOnEditActive" | "goToOverride" | "headingLevel" | "hideLayerDetails" | "hidePrintButton" | "hideSaveAsButton" | "hideSaveButton" | "label" | "layer" | "maxStops" | "referenceElement" | "routeLayerItemId" | "searchProperties" | "unit" | "useDefaultRouteLayer" | "view">>, ArcgisDirectionsSetterTypes, StencilJsx.HTMLAttributes<ArcgisDirections> {
|
|
204
204
|
onArcgisPropertyChange?: EventHandler<ArcgisDirections["arcgisPropertyChange"]>;
|
|
205
205
|
onArcgisReady?: EventHandler<ArcgisDirections["arcgisReady"]>;
|
|
206
206
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/map-components",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.167",
|
|
4
4
|
"description": "ArcGIS Map Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"2D",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"lit": "^3.3.0",
|
|
47
47
|
"lodash-es": "^4.17.23",
|
|
48
48
|
"tslib": "^2.8.1",
|
|
49
|
-
"@arcgis/
|
|
50
|
-
"@arcgis/
|
|
51
|
-
"@arcgis/toolkit": "5.0.0-next.
|
|
49
|
+
"@arcgis/lumina": "5.0.0-next.167",
|
|
50
|
+
"@arcgis/common-components": "5.0.0-next.167",
|
|
51
|
+
"@arcgis/toolkit": "5.0.0-next.167"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@arcgis/core": "^5.0.0-next",
|
package/dist/cdn/AC3NQPKC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./GYSZA7D4.js";import"./MATFNQVX.js";import{a as $}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{N as m,O as b,U as v,a as _,b as i,p as d,r as g,s as f,x as o}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([{queryAllJSON:L},C,,h,,R,{r:p}])=>{var T=_`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features{height:100%}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;padding:0 var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{padding:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading .results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading .results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{padding:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs) var(--calcite-spacing-md);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,w={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935},y=class extends b{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=$({blocking:!0}),this._elementsWithoutLayer=[],this._featuresFromSelectedLayer=[],this._layerIdToFeatures=new Map,this._layerIdToLayer=new Map,this._subtypeCodeToFeatures=new Map,this._sourceIdToElements=new Map,this._unLayers=[],this._compareByFeatureTitle=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0}),this._compareByLayerTitle=([,e],[,t])=>{let s=e[0].feature.layer,a=t[0].feature.layer,l=s?.title??"",c=a?.title??"";return l.localeCompare(c,void 0,{numeric:!0})},this._queryFeaturesOnLayer=async([e,t])=>{let s=this.utilityNetwork?.getLayerIdBySourceId(e),a=this._getLayerByLayerId(s);if(s==null||!a){this._elementsWithoutLayer.push(...t);return}let l=a.createQuery();l.gdbVersion=this.utilityNetwork?.gdbVersion,l.objectIds=t.map(r=>r.objectId),l.outFields=["*"];let{features:c}=R.fromJSON(await L(a,l)),n=await Promise.all(c.map(async r=>{r.layer=a.type==="subtype-group"?a.findSublayerForFeature(r):a,r.origin=r.layer;let u=r.layer;if(r.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(r.popupTemplate=u.createPopupTemplate()),u&&"getFeatureTitle"in u){let F=await u.getFeatureTitle(r)||p(r);return{feature:r,label:F}}return{feature:r,label:p(r)}}));a.type==="subtype-group"?n.forEach(r=>this._addOrCreateMapValue(this._subtypeCodeToFeatures,r.feature.layer.subtypeCode,r)):this._layerIdToFeatures.set(s,n)},this._aggregateGeometryRefChange=e=>{e&&(this._aggregatedGeometryComponentElement=e)},this._featuresRefChange=e=>{e&&(this._featuresComponentElement=e)},this.aggregatedGeometryGraphicsColor=new C([255,255,0,.6]),this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=o(),this.arcgisHideGraphicsChange=o(),this.arcgisSelectedLayerChange=o(),this.arcgisSelectedResultTypeChange=o(),this.arcgisTraceResultFeaturesReady=o(),this._renderLayerListItem=([,e])=>{if(!e.length)return null;let t=e[0].feature.layer,s=t?.title||this._messages.unknown;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this._setSelectedLayerAndFeatures(t)}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${e.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`},this._renderFeatureListItem=e=>{let{feature:t,label:s}=e;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this.selectedFeature=t}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={aggregatedGeometryGraphicsColor:0,hideFeatureResults:5,featuresFromSelectedLayer:32,isElementsSelected:5,layers:0,messageOverrides:0,referenceElement:1,selectedFeature:0,selectedLayer:0,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=T}get featuresFromSelectedLayer(){return this._featuresFromSelectedLayer.map(({feature:e})=>e)}clearAggregatedGeometryGraphics(){this._aggregatedGeometryComponentElement?.destroy()}async destroy(){this._layerIdToFeatures.clear(),this._subtypeCodeToFeatures.clear(),this._sourceIdToElements.clear(),this._aggregatedGeometryComponentElement?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this._setSourceIdToElements(),this._loadDependencies().then(()=>this._queryTraceResultsFeatures()).then(()=>this._loadProjectOperator()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("selectedLayer")&&this.arcgisSelectedLayerChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1),(e.has("layers")||e.has("utilityNetwork"))&&this._loadDependencies()}loaded(){this.utilityNetwork||d("warn",this,g("utilityNetwork")),this.layers.length===0&&d("warn",this,f("layers")),this.view||d("warn",this,g("view"))}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_addOrCreateMapValue(e,t,s){let a=e.get(t);a==null?e.set(t,[s]):a.push(s)}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:s}=this;if(t.get(e))return t.get(e);let a=s.find(l=>"layerId"in l&&l.layerId===e);return a&&t.set(e,a),a}_handleHideGraphicsChange(e){e.stopPropagation(),this.arcgisHideGraphicsChange.emit(e.detail)}async _loadDependencies(){let{layers:e,utilityNetwork:t}=this;if(!t)return;t.loaded||(this.state="loading",await t.load()),this._unLayers=e.filter(a=>t.isUtilityLayer(a));let s=this._unLayers.filter(a=>!a.loaded).map(a=>a.load());s.length>0&&(this.state="loading",await Promise.allSettled(s))}async _loadProjectOperator(){let{aggregatedGeometry:e}=this.traceResult;e&&!h.isLoaded()&&await h.load()}async _queryTraceResultsFeatures(){let e=Array.from(this._sourceIdToElements.entries());if(!e.length)return;this.state="loading";let t=e.map(this._queryFeaturesOnLayer);(await Promise.allSettled(t)).forEach((l,c)=>{if(l.status==="rejected"){let[n]=e[c];d("error",this,`Failed to query features for source ${n}. Reason: ${l.reason}`)}});let s=Array.from(this._layerIdToFeatures.values()),a=Array.from(this._subtypeCodeToFeatures.values());this.traceResultFeatures=s.concat(a).flat().map(({feature:l})=>l)}_setSelectedLayerAndFeatures(e){let t;if(!e)t=[];else if(e.type==="subtype-sublayer"){let{subtypeCode:s}=e;t=this._subtypeCodeToFeatures.get(s)??[]}else{let{layerId:s}=e;t=this._layerIdToFeatures.get(s)??[]}this._featuresFromSelectedLayer=t.sort(this._compareByFeatureTitle),this.selectedLayer=e}_setSourceIdToElements(){this.traceResult.elements?.forEach(e=>this._addOrCreateMapValue(this._sourceIdToElements,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this._renderErrorLanding(e);if(!t)return this._renderNoTraceLanding();let{elements:s,globalFunctionResults:a,aggregatedGeometry:l}=t;if(!s.length&&!a.length&&!l)return this._renderNoResultsLanding();if(this.state==="loading")return this._renderGettingResults();if(this.selectedFeature){let n=this._featuresComponentElement,r=n?.selectedFeature?[n.selectedFeature]:[this.selectedFeature];return i`<arcgis-features .referenceElement=${this.referenceElement} .features=${r} .view=${this.view} open .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} @arcgisClose=${()=>this.selectedFeature=void 0} .autoDestroyDisabled=${this.autoDestroyDisabled} ${m(this._featuresRefChange)}></arcgis-features>`}let c=s.length>0&&!a.length&&!l;return this.hideFeatureResults&&c?this._renderFeaturesAreHidden():i`<calcite-flow>${c?null:i`<calcite-flow-item .selected=${!this.isElementsSelected}>${this._renderLanding(t)}</calcite-flow-item>`}<calcite-flow-item .heading=${this._messages.headings.features} .description=${this._messages.headings.totalFeatures.replace("{number}",this.traceResultFeatures.length.toString())} .selected=${(c||this.isElementsSelected)&&!this.selectedLayer} @calciteFlowItemBack=${()=>this.isElementsSelected=!1}>${this._renderLayerList()}</calcite-flow-item><calcite-flow-item .heading=${this.selectedLayer?.title??void 0} .description=${this._messages.headings.totalFeatures.replace("{number}",this._featuresFromSelectedLayer.length.toString())} .selected=${!!this.selectedLayer} @calciteFlowItemBack=${()=>this.selectedLayer=void 0}>${this._renderFeaturesList()}</calcite-flow-item></calcite-flow>`}_renderGettingResults(){return i`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}_renderLanding(e){let{elements:t,globalFunctionResults:s,aggregatedGeometry:a}=e;return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${a!=null?this._renderAggregatedGeometry(a):null}${a!=null&&!t.length?this._renderNoSelectableResults():null}${t.length>0?this.hideFeatureResults?this._renderFeaturesAreHidden():this._renderElementsResults():null}${s.length>0?this._renderFunctionsResults(s):null}</calcite-panel>`}_renderAggregatedGeometry(e){return i`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${this.aggregatedGeometryGraphicsColor} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} .autoDestroyDisabled=${this.autoDestroyDisabled} ${m(this._aggregateGeometryRefChange)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${this._messages.labels.aggregatedGeometryGraphicsColor} .color=${this.aggregatedGeometryGraphicsColor.toCss()}></calcite-swatch><calcite-popover .heading=${this._messages.headings.setColor} .label=${this._messages.headings.setColor} reference-element=geometry-color-swatch closable><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${this.aggregatedGeometryGraphicsColor} @calciteColorPickerChange=${t=>{let s=t.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(s)}}></calcite-color-picker></calcite-popover></div>`}_renderFeaturesAreHidden(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div></calcite-panel>`}_renderNoSelectableResults(){return i`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}_renderElementsResults(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${this._messages.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${this._messages.labels.numFeatures} scale=s slot=content-end>${this.traceResultFeatures.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}_renderFunctionsResults(e){return i`<div class="functions-heading">${this._messages.headings.functions}</div><calcite-table .caption=${this._messages.labels.functionResults}>${e.filter(t=>t.networkAttributeName!=null&&t.result!=null).map(t=>i`<calcite-table-row><calcite-table-cell>${t.networkAttributeName}</calcite-table-cell><calcite-table-cell>${t.result}</calcite-table-cell></calcite-table-row>`)}</calcite-table>`}_renderLayerList(){let e=Array.from(this._layerIdToFeatures.entries()),t=Array.from(this._subtypeCodeToFeatures.entries()),s=e.concat(t).sort(this._compareByLayerTitle).map(this._renderLayerListItem);return this._elementsWithoutLayer.length>0&&s.push(this._renderUnknownListItem()),i`<calcite-list .label=${this._messages.labels.traceResultElementsByLayer} .loading=${this.state==="loading"}>${s}</calcite-list>`}_renderUnknownListItem(){return i`<calcite-list-item .label=${this._messages.unknown}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${this._elementsWithoutLayer.length}</calcite-chip></calcite-list-item>`}_renderFeaturesList(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}>${this._featuresFromSelectedLayer.map(this._renderFeatureListItem)}</calcite-list>`}_renderTraceResultsHeading(){return i`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?i`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderErrorLanding(e){let t=e.message;switch(e.details?.raw?.extendedCode){case w.dirtyAreasDiscovered:t=this._messages.traceErrors.dirtyAreasDiscovered;break;case w.noValidControllers:t=this._messages.traceErrors.noValidControllers;break}return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.traceFailedHeading}</div><div class="no-results-description">${this._messages.traceFailedDescription}</div><div class="no-results-description">${t}</div></div></calcite-panel>`}_renderNoResultsLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div></calcite-panel>`}_renderNoTraceLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div></calcite-panel>`}};v("arcgis-utility-network-trace-results",y);return y},"applications/Components/featureUtils","Color","core/Error","geometry/operators/shapePreservingProjectOperator","Graphic","rest/support/FeatureSet",a)
|
package/dist/cdn/CXJGKZ7S.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as v}from"./CAYSZWRK.js";import"./UFWKXIL5.js";import"./KCQB4NNK.js";import"./ZNBKMZP7.js";import{O as T,U as _,a as L,b as g,p as c,x as f}from"./MQTZFCXF.js";import"./ALDX5YZO.js";export default $arcgis.t(([S,y,u,x,I,P,b,w])=>{var C=L`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`,k=class extends T{constructor(){super(...arguments),this.messages=v({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=f(),this.arcgisTraceLocationSelectEnd=f(),this.arcgisTraceLocationSelectStart=f()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,flagLayer:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=C}async destroy(){this._resetAfterSketch(!1),await this.manager.destroy()}async load(){u.isLoaded()||await u.load()}_createPolyline(t,e){return new x({hasZ:!1,hasM:!0,paths:t,spatialReference:new I({wkid:e})})}_calculatePercentAlong(t,e){let r=t.spatialReference,a=this._createPolyline(t.paths,r.wkid),n=e.x-.5,o=e.x+.5,s=e.y-.5,i=e.y+.5,l=[[[n,s],[o,i]]],h=this._createPolyline(l,e.spatialReference.wkid),d=u.execute(h,r);if(!d)return c("error",this,"Unable to project flag geometry to source geometry spatial reference."),.5;let p=S.execute(a,d);if(p.length>0){let A=y.execute(a,{unit:"feet"}),m;return p[0].paths[0][0][0]===a.paths[0][0][0]?m=y.execute(p[0],{unit:"feet"}):m=y.execute(p[1],{unit:"feet"}),m/A}return c("warn",this,"Unable to cut the source geometry with the flag geometry."),.5}async _ensureNecessaryAttributes(t){let e=(t.layer?.type,t.layer),r=e.fieldsIndex?.get("assetgroup")??!1,a=e.fieldsIndex?.get("assetgroup")?.name??"assetgroup",n=e.fieldsIndex?.get("assettype")??!1,o=e.fieldsIndex?.get("assettype")?.name??"assettype",s=t.getGlobalId(),i=t.getObjectId(),l=r?!!t.getAttribute(a):!0,h=n?!!t.getAttribute(o):!0;if(s&&i&&l&&h)return t;let d=e.createQuery();return d.objectIds=[i],(await e.queryFeatures(d))?.features[0]||null}async _ensureNecessaryAttributesAndGenerateTraceLocation(t,e){let{view:r}=this;if(!r||t.length===0){c("error",this,"`view` is unavailable or there are no results to process.");return}let a=t[0],n=t.map(i=>{let l=i,h=l.graphic;return h.origin=l.layer,h}),o=this.afterHitTest?await this.afterHitTest(n).catch(()=>(this._resetAfterSketch(!0),null)):a.graphic;if(!o){c("error",this,"No graphic available from hit test results.");return}let s=await this._ensureNecessaryAttributes(o);if(!s){c("error",this,"Unable to ensure necessary attributes on the selected graphic.");return}await this._generateTraceLocation(s,e)}_createFlagSymbol(){let{traceLocationType:t}=this,e=[244,21,21,.6],r=[21,244,21,.6];return t==="stopping-point"?new w({color:e,style:"x",size:12,outline:{color:e,width:2}}):t==="barrier"?new w({color:e,style:"square",size:12,outline:{color:e,width:0}}):new w({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_addFlagGraphic(t,e,r){let{flagLayer:a,view:n}=this;if(!a||!n)return c("error",this,"The properties `flagLayer` and `view` are required but either one or both are missing."),null;let o=e.geometry?.type;if(this.traceLocations?.some(l=>l.traceLocation.globalId===t)&&o!=="polyline")return c("warn",this,"A flag with the same globalId already exists."),null;let s=this._createFlagSymbol(),i=new P({geometry:r,symbol:s,attributes:e.attributes});return a.add(i),i}async _generateItemTitle(t){let{messages:e}=this,r=(t.layer?.type,t.layer);return("getFeatureTitle"in r?await r.getFeatureTitle(t):null)||t?.getObjectId()?.toString()||e.labels.unknown}async _generateFlagInfo(t,e){let{traceLocationType:r,utilityNetwork:a}=this,n=t.getGlobalId()??"",o=t.geometry?.type,s=await this._generateItemTitle(t);if(o==="point"||o==="polygon"){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(o==="polyline"){let i=this._calculatePercentAlong(t.geometry,e);return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,percentAlong:i}),flagProperties:{title:s,expanded:!1},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(!o){let i=a?.getTerminalConfiguration(t),l=i?i.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:i??void 0,selectedTerminals:i?new Set([l]):void 0},spatialProperties:{mapPoint:e}}}return null}async _generateTraceLocation(t,e){let{traceLocations:r}=this,a=t.getGlobalId()??"",n=t.geometry?.type,o=await this._generateFlagInfo(t,e);if(!o){c("error",this,"Unable to generate flag info for trace location.");return}let s=r?.filter(i=>i.spatialProperties.mapGraphic?.getGlobalId()===a)??[];if(s.length===0||n==="polyline"){if(n==="polyline"&&s.length>0&&s.some(l=>Math.abs(l.traceLocation.percentAlong-o.traceLocation.percentAlong)<=this.spatialTolerance)){c("warn",this,"A flag with the same globalId already exists within tolerance.");return}let i=this._addFlagGraphic(a,t,e);if(!i){c("warn",this,"Unable to add flag graphic.");return}o.spatialProperties.flagGraphic=i,r?.add(o);return}c("warn",this,"A flag with the same globalId already exists.")}async _hitTest(t){let{view:e,utilityNetwork:r}=this;if(!e||!r)return c("error",this,"Either `utilityNetwork` or `view` is unavailable for hit test."),!0;let a=t.graphic?.geometry,n=this.view?.toScreen(a);if(!n)return c("warn",this,"No screen point available for hit test."),!1;let o=(await e.hitTest(n,{include:this.filterLayers})).results.filter(s=>s.type==="graphic"&&s?.layer&&s.graphic);return o.length===0?(c("info",this,"No usable hit test results found."),!1):(await this._ensureNecessaryAttributesAndGenerateTraceLocation(o,a),this._resetAfterSketch(!0),!0)}_resetAfterSketch(t=!1){let{view:e}=this;if(!e){c("error",this,"View is not available to reset after sketch.");return}this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default"),t&&this.arcgisTraceLocationSelectEnd.emit()}_handleSketchComplete(t){let{sketchViewModel:e,view:r}=this;if(!e||!r){c("error",this,"Either `sketchViewModel` or `view` is not available in sketch complete handler.");return}if(t.state==="complete"&&t.graphic){e.layer.remove(t.graphic),this._hitTest(t).then(a=>{a?this._resetAfterSketch():this._initiateHitTest()});return}t.state==="cancel"&&this._resetAfterSketch(!0)}async _initiateHitTest(){let{view:t,sketchViewModel:e}=this;if(!t||!e){c("error",this,"Cannot initiate hit test; either `view` or `sketchViewModel` not found.");return}this._clickHandler?.remove(),this._clickHandler=e.on("create",this._handleSketchComplete.bind(this)),"acquireCursor"in t&&t.acquireCursor("crosshair"),this.sketchViewModel?.create("point")}async _handleAddButtonClick(){let{view:t,sketchViewModel:e}=this;if(!(t&&e)){c("error",this,"Cannot add trace location; `view` not found.");return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>e.cancel()}).defaultPrevented||await this._initiateHitTest()}_handleClearButtonClick(){let{flagLayer:t,traceLocations:e}=this;e?.forEach(r=>{r.spatialProperties.flagGraphic&&t&&t.remove(r.spatialProperties.flagGraphic)}),e?.removeAll()}renderAddLocationBlock(){let{traceLocationType:t,messages:e,traceLocations:r}=this,a=t==="starting-point"?e.types.startingPoint:t==="barrier"?e.types.barrier:e.types.stoppingPoint,n=a.heading,o=a.description,s=a.buttonText;return g`<calcite-block .heading=${n} .label=${n} expanded .description=${o}>${r?.length?g`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${e.buttons.clear}</calcite-button>`:null}<arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${t}></arcgis-utility-network-trace-location-list><div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${s} @click=${()=>this._handleAddButtonClick()}>${s}</calcite-button></div></calcite-block>`}render(){return g`<div class="root">${this.renderAddLocationBlock()}</div>`}};_("arcgis-utility-network-trace-location",k);return k},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/Polyline","geometry/SpatialReference","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol")
|