@arcgis/core 5.1.0-next.66 → 5.1.0-next.67

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.
Files changed (70) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{97e15e66e55d9149fd48.js → 2e1aecdf59ad3421bbad.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{224461c1d9755966d0b6.js → 2f8ed1e7c1b10cb30972.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +1 -0
  5. package/assets/esri/core/workers/chunks/{0d650b0d090a425c9c18.js → 4fd1bf82939e3bb9bc03.js} +1 -1
  6. package/assets/esri/core/workers/chunks/684ea7f75a7a5fb52cde.js +1 -0
  7. package/assets/esri/core/workers/chunks/{e0df7554b1679168663d.js → 6c40b3c2b9071edb758d.js} +1 -1
  8. package/assets/esri/core/workers/chunks/6ef3b8d67b498d655a99.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3464a38e758c687a28d4.js → 7d73472696ec76458758.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4141a3a93732996601e8.js → a8ef9ed9b59de95f2b23.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{deddf6ae4498a3d0d0e5.js → abd5c1d4b7b91d9ea1eb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{eab1b45ab5a802e29f8c.js → af007ec833ab49e4c958.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{468c70e5fdb61dfaad80.js → afea4a4b072c329d3749.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{bcb8a25438c66815e37a.js → b5648a0b92cf1a2c81ad.js} +1 -1
  15. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +1 -0
  16. package/assets/esri/core/workers/chunks/{62a2da0ffc67f98445c1.js → e268e5be096392c2e69b.js} +1 -1
  17. package/chunks/GaussianSplat.glsl.js +8 -10
  18. package/config.js +1 -1
  19. package/interfaces.d.ts +0 -7
  20. package/kernel.js +1 -1
  21. package/layers/OrientedImageryLayer.js +1 -1
  22. package/layers/mixins/ArcGISImageService.js +1 -1
  23. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  24. package/layers/orientedImagery/core/utils.js +1 -1
  25. package/layers/raster/datasets/MRFRaster.js +1 -1
  26. package/layers/raster/functions/changeDetectionUtils.js +1 -1
  27. package/layers/support/ExportImageServiceParameters.js +1 -1
  28. package/networks/UnitIdentifierManager.d.ts +61 -0
  29. package/networks/UnitIdentifierManager.js +1 -1
  30. package/networks/UtilityNetwork.d.ts +0 -60
  31. package/networks/UtilityNetwork.js +1 -1
  32. package/package.json +2 -2
  33. package/popup/Features.d.ts +8 -28
  34. package/popup/Features.js +1 -1
  35. package/popup/actionUtils.js +2 -0
  36. package/popup/actions.js +2 -0
  37. package/popup/types.d.ts +11 -0
  38. package/rest/featureService/types.d.ts +1 -1
  39. package/support/revision.js +1 -1
  40. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  41. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  42. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  43. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  44. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  45. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  46. package/views/3d/layers/graphics/QueryEngineContext.js +1 -1
  47. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  48. package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
  49. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  50. package/views/analysis/ExclusiveOperationManager.js +1 -1
  51. package/views/interactive/sketch/SketchOptions.d.ts +34 -0
  52. package/widgets/Editor.js +1 -1
  53. package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.d.ts +8 -1
  54. package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.js +1 -1
  55. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  56. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  57. package/widgets/FeatureTable.d.ts +13 -0
  58. package/widgets/FeatureTable.js +1 -1
  59. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  60. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  61. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  62. package/widgets/OrientedImageryViewer.js +1 -1
  63. package/widgets/Popup/actionUtils.js +1 -1
  64. package/widgets/Sketch/VisibleElements.js +1 -1
  65. package/widgets/Sketch.js +1 -1
  66. package/assets/esri/core/workers/chunks/62d96b012c2d6f601863.js +0 -1
  67. package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +0 -1
  68. package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +0 -1
  69. package/assets/esri/core/workers/chunks/ed60b5eaa5765bfcb99c.js +0 -1
  70. /package/assets/esri/core/workers/chunks/{4141a3a93732996601e8.js.LICENSE.txt → a8ef9ed9b59de95f2b23.js.LICENSE.txt} +0 -0
@@ -12,7 +12,6 @@ import type TerminalConfiguration from "./support/TerminalConfiguration.js";
12
12
  import type TraceJobInfo from "./support/TraceJobInfo.js";
13
13
  import type Association from "../rest/networks/support/Association.js";
14
14
  import type AssociationGeometriesResult from "../rest/networks/support/AssociationGeometriesResult.js";
15
- import type NetworkElement from "../rest/networks/support/NetworkElement.js";
16
15
  import type TraceResult from "../rest/networks/support/TraceResult.js";
17
16
  import type { AbortOptions } from "../core/promiseUtils.js";
18
17
  import type { RequestOptions } from "../request/types.js";
@@ -240,42 +239,6 @@ export default class UtilityNetwork extends Network {
240
239
  * })
241
240
  */
242
241
  generateAddAssociations(associations: Association[]): ServiceEdits;
243
- /**
244
- * Returns [ServiceEdits](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/types/#ServiceEdits) to combine [network elements](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/NetworkElement/)
245
- * in a telecom domain network via the `applyEdits` method on the [FeatureService](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/) class.
246
- *
247
- * The objects being combined must have consecutive unit IDs, exist in the same table and unit container,
248
- * and have the same attribute values.
249
- *
250
- * @param networkElements - The network elements to combine in a telecom domain network.
251
- * @returns `ServiceEdits` for combining network elements in a telecom domain network.
252
- * @beta
253
- * @since 4.34
254
- * @example
255
- * const networkElementA = new NetworkElement({
256
- * globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",
257
- * networkSourceId: 20,
258
- * });
259
- *
260
- * const networkElementB = new NetworkElement({
261
- * globalId: "{74100804-E229-49b8-8CDC-9B5D3EF03EDA}",
262
- * networkSourceId: 20,
263
- * });
264
- *
265
- * const networkElementC = new NetworkElement({
266
- * globalId: "{39B856DC-AFE4-4c02-B433-A9361ACD91CF}",
267
- * networkSourceId: 20,
268
- * });
269
- *
270
- * const serviceEdits = utilityNetwork.generateCombineNetworkElements([
271
- * networkElementA,
272
- * networkElementB,
273
- * networkElementC,
274
- * ]);
275
- *
276
- * await featureService.applyEdits([serviceEdits]);
277
- */
278
- generateCombineNetworkElements(networkElements: NetworkElement[]): ServiceEdits;
279
242
  /**
280
243
  * Returns [ServiceEdits](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/types/#ServiceEdits) which are used to delete an [Association](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/Association/) via the `applyEdits` method on the [FeatureService](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/) class.
281
244
  *
@@ -299,29 +262,6 @@ export default class UtilityNetwork extends Network {
299
262
  * })
300
263
  */
301
264
  generateDeleteAssociations(associations: Association[]): ServiceEdits;
302
- /**
303
- * Returns [ServiceEdits](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/types/#ServiceEdits) to divide a grouped [network element](https://developers.arcgis.com/javascript/latest/references/core/rest/networks/support/NetworkElement/)
304
- * in a telecom domain network into two or more grouped elements via the `applyEdits` method on the [FeatureService](https://developers.arcgis.com/javascript/latest/references/core/rest/featureService/FeatureService/) class.
305
- *
306
- * @param networkElement - The grouped network element in a telecom
307
- * domain network to divide into two or more grouped elements.
308
- * @param numUnits - Describes how the unit identifiers of the grouped object should be divided.
309
- * Each number in this array describes the number of units to assign an object resulting from the division.
310
- * E.g., to divide one object with 6 units into an object with 5 units and another object with 1 unit, specify [5, 1].
311
- * @returns `ServiceEdits` for dividing a network element in a telecom domain network.
312
- * @beta
313
- * @since 4.34
314
- * @example
315
- * const networkElement = new NetworkElement({
316
- * globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",
317
- * networkSourceId: 20,
318
- * });
319
- *
320
- * const serviceEdits = utilityNetwork.generateDivideNetworkElements(networkElement, [2, 3, 4]);
321
- *
322
- * await featureService.applyEdits([serviceEdits]);
323
- */
324
- generateDivideNetworkElements(networkElement: NetworkElement, numUnits: number[]): ServiceEdits;
325
265
  /**
326
266
  * Returns a [CircuitManager](https://developers.arcgis.com/javascript/latest/references/core/networks/CircuitManager/) for the utility network's telecom domain network, if one exists.
327
267
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import{unique as r}from"../core/arrayUtils.js";import s from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as n}from"../core/accessorSupport/decorators.js";import l from"../layers/FeatureLayer.js";import{queryAllJSON as u}from"../layers/support/featureQueryAll.js";import d from"./Network.js";import m from"./RulesTable.js";import c from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as y}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import p from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as w,nullGuid as I,associationTypeKebabDict as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as g}from"./support/utils.js";import T from"../rest/networks/support/TelecomNetworkElement.js";import k from"../rest/support/Query.js";let S=class extends d{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new l({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>p.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer??e.origin??e.layer??null;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?p.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new m({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return o(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>g(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:m,toLastUnit:c,associationType:h,isContentVisible:p,percentAlong:f,globalId:I}=y(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:w[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[f]:e.percentAlong,[I]:e.globalId}}),y=e.associationType.includes("connectivity");return e.fromNetworkElement instanceof T&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit,y&&(r.attributes[i]=1)),e.toNetworkElement instanceof T&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[c]=e.toNetworkElement?.lastUnit,y&&(r.attributes[d]=1)),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}generateCombineNetworkElements(e){return{id:this._ensureSingleSourceIdAsValidLayerId(e),combineGroupedObjects:[{globalIds:e.map(e=>e.globalId)}]}}generateDivideNetworkElements(e,t){return{id:this._ensureSingleSourceIdAsValidLayerId([e]),divideGroupedObjects:[{globalId:e.globalId,numUnits:t}]}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),w=s.get("VIATERMINALID"),I=r.attributes[o.name],b=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[w.name]}],T={ruleType:I,creationDate:b};for(const k of[0,1,2]){if(5!==I&&2===k)continue;const e=g[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new k({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await u(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??I,associationType:b.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}_ensureSingleSourceIdAsValidLayerId(e){const t=r(e.map(e=>e.networkSourceId));if(t.length>1)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");const o=t[0],i=this.getLayerIdBySourceId(o);if(null==i)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");return i}};e([a({readOnly:!0})],S.prototype,"_rulesLayer",null),e([a({type:[c],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],S.prototype,"sharedNamedTraceConfigurations",void 0),e([a({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],S.prototype,"type",void 0),e([a({readOnly:!0})],S.prototype,"serviceTerritoryFeatureLayerId",null),e([a({readOnly:!0})],S.prototype,"networkSystemLayers",null),e([a({readOnly:!0})],S.prototype,"terminalConfigurations",null),e([a({readOnly:!0})],S.prototype,"domainNetworkNames",null),e([a({readOnly:!0})],S.prototype,"hasTelecomNetwork",null),e([a({readOnly:!0,json:{read:!1}})],S.prototype,"associationsTable",null),S=e([n("esri.networks.UtilityNetwork")],S);const N=S;export{N as default};
2
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{watch as s}from"../core/reactiveUtils.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import a from"../layers/FeatureLayer.js";import{queryAllJSON as n}from"../layers/support/featureQueryAll.js";import l from"./Network.js";import u from"./RulesTable.js";import d from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as m}from"./support/networkFieldUtils.js";import c from"./support/NetworkSystemLayers.js";import y from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as h,nullGuid as p,associationTypeKebabDict as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as w}from"./support/utils.js";import I from"../rest/networks/support/TelecomNetworkElement.js";import g from"../rest/support/Query.js";let T=class extends l{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(s(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new a({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new c({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>y.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer??e.origin??e.layer??null;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?y.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new u({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:s}=await import("./CircuitManager.js");return r(this._circuitManagerMap,e,()=>new s({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>w(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:c,toLastUnit:y,associationType:f,isContentVisible:p,percentAlong:b,globalId:w}=m(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[f]:h[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[b]:e.percentAlong,[w]:e.globalId}}),m=e.associationType.includes("connectivity");return e.fromNetworkElement instanceof I&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit,m&&(r.attributes[i]=1)),e.toNetworkElement instanceof I&&(r.attributes[c]=e.toNetworkElement?.firstUnit,r.attributes[y]=e.toNetworkElement?.lastUnit,m&&(r.attributes[d]=1)),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),f=s.get("VIANETWORKSOURCEID"),h=s.get("VIAASSETGROUP"),p=s.get("VIAASSETTYPE"),b=s.get("VIATERMINALID"),w=r.attributes[o.name],I=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[f.name],assetGroupId:r.attributes[h.name],assetTypeId:r.attributes[p.name],terminalId:r.attributes[b.name]}],T={ruleType:w,creationDate:I};for(const k of[0,1,2]){if(5!==w&&2===k)continue;const e=g[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new g({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await n(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??p,associationType:b.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}};e([o({readOnly:!0})],T.prototype,"_rulesLayer",null),e([o({type:[d],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],T.prototype,"sharedNamedTraceConfigurations",void 0),e([o({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],T.prototype,"type",void 0),e([o({readOnly:!0})],T.prototype,"serviceTerritoryFeatureLayerId",null),e([o({readOnly:!0})],T.prototype,"networkSystemLayers",null),e([o({readOnly:!0})],T.prototype,"terminalConfigurations",null),e([o({readOnly:!0})],T.prototype,"domainNetworkNames",null),e([o({readOnly:!0})],T.prototype,"hasTelecomNetwork",null),e([o({readOnly:!0,json:{read:!1}})],T.prototype,"associationsTable",null),T=e([i("esri.networks.UtilityNetwork")],T);const k=T;export{k as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.66",
3
+ "version": "5.1.0-next.67",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
21
  "@amcharts/amcharts5": "~5.17.1",
22
- "@arcgis/toolkit": "^5.1.0-next.68",
22
+ "@arcgis/toolkit": "^5.1.0-next.69",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.0.2",
25
25
  "@vaadin/grid": "~25.1.0",
@@ -8,11 +8,10 @@ import type FeatureAbilities from "./support/FeatureAbilities.js";
8
8
  import type { EventedAccessor } from "../core/Evented.js";
9
9
  import type { ScreenPoint } from "../core/types.js";
10
10
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
11
- import type { State, FetchFeaturesOptions } from "./types.js";
11
+ import type { FetchFeaturesOptions, InitialDisplayOptions, PopupAction, State } from "./types.js";
12
12
  import type { TimeZone } from "../time/types.js";
13
13
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
14
14
  import type { FetchPopupFeaturesResult } from "../views/types.js";
15
- import type { ActionEvent, InitialDisplayOptions, PopupAction } from "../widgets/Popup/types.js";
16
15
  import type { GoTo, GoToProperties } from "../widgets/support/GoTo.js";
17
16
  import type { GoToParameters } from "../widgets/support/types.js";
18
17
  import type { ActionToggleProperties } from "../support/actions/ActionToggle.js";
@@ -21,7 +20,7 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
21
20
  import type { FeatureAbilitiesProperties } from "./support/FeatureAbilities.js";
22
21
  import type { PointProperties } from "../geometry/Point.js";
23
22
 
24
- export interface FeaturesProperties extends GoToProperties, Partial<Pick<Features, "activeFeature" | "browseClusterEnabled" | "content" | "defaultPopupTemplateEnabled" | "featurePage" | "features" | "featuresPerPage" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "promises" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
23
+ export interface FeaturesProperties extends GoToProperties, Partial<Pick<Features, "activeFeature" | "browseClusterEnabled" | "clusterFeatures" | "content" | "defaultPopupTemplateEnabled" | "featurePage" | "features" | "featuresPerPage" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "promises" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
25
24
  /**
26
25
  * [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) objects.
27
26
  * Each action may be executed by clicking the icon or image symbolizing them.
@@ -32,9 +31,6 @@ export interface FeaturesProperties extends GoToProperties, Partial<Pick<Feature
32
31
  * [PopupTemplate.overwriteActions](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/).
33
32
  * The order of each action is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/).
34
33
  *
35
- * The [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#event-trigger-action) event fires each time an action is clicked.
36
- *
37
- * @see [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#event-trigger-action)
38
34
  * @see [Sample - Popup actions](https://developers.arcgis.com/javascript/latest/sample-code/popup-actions/)
39
35
  * @example
40
36
  * ```js
@@ -96,19 +92,6 @@ export interface FeaturesProperties extends GoToProperties, Partial<Pick<Feature
96
92
  timeZone?: TimeZone | null;
97
93
  }
98
94
 
99
- export interface FeaturesEvents {
100
- /**
101
- * Fires after the user clicks on an [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) in the action bar. This
102
- * event may be used to define a custom function to execute when particular
103
- * actions are clicked. See the example below for details of how this works.
104
- *
105
- * @see [actions](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#actions)
106
- * @see [PopupTemplate.actions](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#actions)
107
- * @see [open](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#open)
108
- */
109
- "trigger-action": ActionEvent;
110
- }
111
-
112
95
  /**
113
96
  * Provides reactive state and behavior for the [Features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/) component, including fetching and paging popup features, tracking selection, and coordinating highlighting and actions.
114
97
  *
@@ -118,12 +101,6 @@ export interface FeaturesEvents {
118
101
  * @see [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
119
102
  */
120
103
  export default class Features extends FeaturesSuperclass {
121
- /**
122
- * @deprecated
123
- * Do not directly reference this property.
124
- * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
125
- */
126
- "@eventTypes": FeaturesEvents;
127
104
  constructor(properties?: FeaturesProperties);
128
105
  /**
129
106
  * [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) objects.
@@ -135,9 +112,6 @@ export default class Features extends FeaturesSuperclass {
135
112
  * [PopupTemplate.overwriteActions](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/).
136
113
  * The order of each action is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/).
137
114
  *
138
- * The [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#event-trigger-action) event fires each time an action is clicked.
139
- *
140
- * @see [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#event-trigger-action)
141
115
  * @see [Sample - Popup actions](https://developers.arcgis.com/javascript/latest/sample-code/popup-actions/)
142
116
  * @example
143
117
  * ```js
@@ -184,6 +158,12 @@ export default class Features extends FeaturesSuperclass {
184
158
  * ```
185
159
  */
186
160
  accessor browseClusterEnabled: boolean;
161
+ /**
162
+ * The features returned when browsing members of a selected cluster.
163
+ * This state is separate from [features](https://developers.arcgis.com/javascript/latest/references/core/popup/Features/#features), which continues to represent
164
+ * the primary popup feature set.
165
+ */
166
+ accessor clusterFeatures: Graphic[] | null | undefined;
187
167
  /**
188
168
  * The information to display. When this property is set, this content may
189
169
  * only be static and cannot use fields to set content templates. To set a template
package/popup/Features.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import{isSome as i}from"../core/arrayUtils.js";import s from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import o from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as a,isAbortError as l}from"../core/promiseUtils.js";import u from"../core/ReactiveSet.js";import{watch as h,when as c,sync as p}from"../core/reactiveUtils.js";import{addMany as d}from"../core/SetUtils.js";import{property as g,subclass as m}from"../core/accessorSupport/decorators.js";import f from"../geometry/Point.js";import{initializeProjection as y,project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as w}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as C}from"../layers/LayerConstants.js";import b from"./Feature.js";import I from"./support/FeatureAbilities.js";import P from"../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as A}from"../symbols/support/symbolUtils.js";import{system as L}from"../time/constants.js";import{highlightsSupported as j}from"../views/support/layerViewUtils.js";import{ActionsCollection as x,zoomToClusteredFeatures as E,browseClusteredFeatures as R,zoomToFeature as O}from"../widgets/Popup/actions.js";import{isClusterFeature as U,removeClusteredFeaturesForBrowsing as S,displayClusterExtent as T,browseAggregateFeatures as B,getSelectedTarget as M}from"../widgets/Popup/actionUtils.js";import{GoTo as H}from"../widgets/support/GoTo.js";const G="location-scale-handle",V=()=>[O.clone()],D=()=>[E.clone(),R.clone()];let Z=null;function z(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let N=class extends(H(r)){constructor(e){super(e),this._pendingPromises=new u,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this.actions=new x,this.activeFeature=null,this.browseClusterEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.selectedClusterBoundaryFeature=new t({symbol:new P({outline:{width:1.5,color:"cyan"},style:"none"})}),this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),c(()=>!this.waitingForResult,()=>this._waitingForResultChange(),p),h(()=>this.view?.scale,()=>this._viewScaleChange()),c(()=>!this.open,()=>this.browseClusterEnabled=!1),h(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._clearBrowsedClusterGraphics(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new x;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:r,includeDefaultActions:o,selectedFeature:n}=this,a=o?s.concat(t):t,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(r)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(a)??a;return h?.filter(i).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new x;return e.removeAll(),e.addMany(U(this.selectedFeature)?D():V()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=w(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),d(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??L}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){S(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?U(t)?(await T(this),await B(this)):o.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):o.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:s}=this,r=i&&e.length;"list"!==this.initialDisplayMode?r&&t&&-1===s?this.selectedFeatureIndex=0:r&&-1!==s||(this.selectedFeatureIndex=e.length?0:-1):(!r||r&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=M(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:r}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:r}}).catch(e=>{l(e)||o.getLogger(this).error(e)}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(U(this.selectedFeature))return this.browseClusterEnabled=!1,this.open=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureItems:r}=this;if(null==i)return;const o=((i-1)*s+t)%t,n=o+s;r.slice(o,n).forEach((t,i)=>{t&&(t.graphic??=e[o+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),U(e))return;return e.symbol=await A(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=v(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await A(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,s=this.view,r=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??new I;if(U(t[0])||(this.browseClusterEnabled=!1),!t?.length)return void this._destroyFeatureItems();const u=i.slice(),h=[];t.forEach((t,i)=>{if(!t)return;const c=u.findIndex(e=>e?.graphic===t);if(-1!==c){const e=u[c];u.splice(c,1),e.abilities=l,h[i]=e}else{const u=new b({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:a,map:o,view:s,timeZone:n});h[i]=u}}),u.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await s.when();const r=e?.spatialReference;return r&&i?(await y(r,i,null,t),s.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=n(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===s&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(G),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{l(e)||o.getLogger(this).error(e)})),c(()=>!this.open,()=>{this.removeHandles(G)},{once:!0})],G);const{pendingFeatures:s}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:s}}async _locationUpdate(e,t){const{spatialReference:i}=this,s=this.selectedFeature?.geometry?.type,r=this.location??e;if(s&&"mesh"!==s&&i&&r&&this.selectedFeature){if("point"===s){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let s=e.geometry;const o=this._getHighlightLayer(e),n=e.getObjectId();if(!o||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===o.uid);if(!e||!("queryFeatures"in e))return;const r=e.createQuery();r.outSpatialReference=i,r.objectIds=[n],r.returnGeometry=!0;const{features:a}=await e.queryFeatures(r,t);s=a[0]?.geometry}if(!s||"mesh"===s.type)return;s=_(s,i),Z??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=Z;if(!a.execute(s,r)){const t=l.getNearestCoordinate(s,r).coordinate??r;this.selectedFeature===e&&(this.location=t)}}catch(n){l(n)||o.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=v(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||C:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:s,view:r,open:o}=this;if(!r||!s||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(r,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&j(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([g()],N.prototype,"_fetchFeaturesController",void 0),e([g({type:x})],N.prototype,"actions",void 0),e([g({readOnly:!0})],N.prototype,"active",null),e([g()],N.prototype,"activeFeature",void 0),e([g({readOnly:!0})],N.prototype,"allActions",null),e([g()],N.prototype,"browseClusterEnabled",void 0),e([g({value:null})],N.prototype,"content",null),e([g({type:x,readOnly:!0})],N.prototype,"defaultActions",null),e([g({type:Boolean})],N.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],N.prototype,"featureCount",null),e([g()],N.prototype,"featurePage",void 0),e([g({value:[]})],N.prototype,"features",null),e([g()],N.prototype,"featuresPerPage",void 0),e([g()],N.prototype,"featureMenuOpen",void 0),e([g({type:I})],N.prototype,"featureItemAbilities",void 0),e([g({readOnly:!0})],N.prototype,"featureItems",void 0),e([g()],N.prototype,"heading",void 0),e([g()],N.prototype,"highlightEnabled",void 0),e([g()],N.prototype,"includeDefaultActions",void 0),e([g({value:"feature"})],N.prototype,"initialDisplayMode",null),e([g({type:f})],N.prototype,"location",null),e([g()],N.prototype,"map",null),e([g()],N.prototype,"open",void 0),e([g({readOnly:!0})],N.prototype,"pendingPromisesCount",null),e([g({readOnly:!0})],N.prototype,"promiseCount",null),e([g()],N.prototype,"promises",null),e([g({readOnly:!0})],N.prototype,"selectedClusterBoundaryFeature",void 0),e([g({value:null,readOnly:!0})],N.prototype,"selectedFeature",null),e([g({value:-1})],N.prototype,"selectedFeatureIndex",null),e([g({readOnly:!0})],N.prototype,"selectedFeatureItem",null),e([g({type:F})],N.prototype,"spatialReference",null),e([g({readOnly:!0})],N.prototype,"state",null),e([g()],N.prototype,"timeZone",null),e([g()],N.prototype,"updateLocationEnabled",void 0),e([g()],N.prototype,"view",void 0),e([g({readOnly:!0})],N.prototype,"waitingForContents",null),e([g({readOnly:!0})],N.prototype,"waitingForResult",null),e([g()],N.prototype,"zoomFactor",void 0),N=e([m("esri.popup.Features")],N);const W=N;export{W as default};
2
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import{isSome as i}from"../core/arrayUtils.js";import s from"../core/Error.js";import{EventedAccessor as r}from"../core/Evented.js";import o from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as a,isAbortError as l}from"../core/promiseUtils.js";import u from"../core/ReactiveSet.js";import{watch as h,when as c,sync as p}from"../core/reactiveUtils.js";import{addMany as d}from"../core/SetUtils.js";import{property as g,subclass as m}from"../core/accessorSupport/decorators.js";import f from"../geometry/Point.js";import{initializeProjection as y,project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as w}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as C}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as b,zoomToClusteredFeatures as I,browseClusteredFeatures as P,zoomToFeature as A}from"./actions.js";import{isClusterFeature as L,updateClusterFeaturesForPopupFeatures as j,displayClusterExtent as x,getSelectedTarget as E}from"./actionUtils.js";import R from"./Feature.js";import O from"./support/FeatureAbilities.js";import B from"../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as U}from"../symbols/support/symbolUtils.js";import{system as S}from"../time/constants.js";import{highlightsSupported as T}from"../views/support/layerViewUtils.js";import{GoTo as M}from"../widgets/support/GoTo.js";const H="location-scale-handle",G=()=>[A.clone()],V=()=>[I.clone(),P.clone()];let D=null;function Z(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let z=class extends(M(r)){constructor(e){super(e),this._pendingPromises=new u,this._fetchFeaturesController=null,this._centerAtLocationController=null,this._locationUpdateController=null,this._clusterBrowsingController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this.actions=new b,this.activeFeature=null,this.browseClusterEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.selectedClusterBoundaryFeature=new t({symbol:new B({outline:{width:1.5,color:"cyan"},style:"none"})}),this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async e=>{this._cancelLocationUpdate();const t=new AbortController,{signal:i}=t;this._locationUpdateController=t,await this._locationUpdate(e,{signal:i}).catch(()=>{}).finally(()=>{this._locationUpdateController===t&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([h(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),h(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),h(()=>this.location,e=>this._locationChange(e)),h(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),h(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),h(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),h(()=>this.featureItems,()=>this._featureItemsChange()),h(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),c(()=>!this.waitingForResult,()=>this._waitingForResultChange(),p),h(()=>this.view?.scale,()=>this._viewScaleChange()),c(()=>!this.open,()=>this.browseClusterEnabled=!1),h(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelLocationUpdate(),this._cancelFetchingFeatures(),this._cancelCenterAtLocation(),this._cancelClusterBrowsing(),this._clearBrowsedClusterGraphics(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new b;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:r,includeDefaultActions:o,selectedFeature:n}=this,a=o?s.concat(t):t,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(r)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(a)??a;return h?.filter(i).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new b;return e.removeAll(),e.addMany(L(this.selectedFeature)?V():G()),e}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=w(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._get("promises")!==e&&(this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),d(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??S}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(!!this._fetchFeaturesController||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],clusterFeatures:null,content:null,heading:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){this._cancelClusterBrowsing(),j(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;if("2d"!==e?.type)return void o.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t);if(!L(t))return void o.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t);this._cancelClusterBrowsing();const i=new AbortController,{signal:s}=i;this._clusterBrowsingController=i;try{await Promise.allSettled([x(this,{signal:s}),j(this,{signal:s})])}finally{this._clusterBrowsingController===i&&(this._clusterBrowsingController=null)}}async handleViewClick(e){return this._fetchFeaturesAndOpen(e)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:s}=this,r=i&&e.length;"list"!==this.initialDisplayMode?r&&t&&-1===s?this.selectedFeatureIndex=0:r&&-1!==s||(this.selectedFeatureIndex=e.length?0:-1):(!r||r&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=E(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:r}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:r}}).catch(e=>{l(e)||o.getLogger(this).error(e)}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(L(this.selectedFeature))return this.browseClusterEnabled=!1,this.open=!1,void this.clear();this.browseClusterEnabled&&(this.clusterFeatures=null)}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureItems:r}=this;if(null==i)return;const o=((i-1)*s+t)%t,n=o+s;r.slice(o,n).forEach((t,i)=>{t&&(t.graphic??=e[o+i])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),L(e))return;return e.symbol=await U(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=C(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await U(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await import("../geometry/operators/labelPointOperator.js");return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,s=this.view,r=this.spatialReference,o=this.map,n=this.timeZone,a=this.location,l=this.featureItemAbilities??new O;if(L(t[0])||(this.browseClusterEnabled=!1),!t?.length)return void this._destroyFeatureItems();const u=i.slice(),h=[];t.forEach((t,i)=>{if(!t)return;const c=u.findIndex(e=>e?.graphic===t);if(-1!==c){const e=u[c];u.splice(c,1),e.abilities=l,h[i]=e}else{const u=new R({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:a,map:o,view:s,timeZone:n});h[i]=u}}),u.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",h)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await s.when();const r=e?.spatialReference;return r&&i?(await y(r,i,null,t),s.toScreen(e)):null}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFetchingFeatures(){this._fetchFeaturesController=n(this._fetchFeaturesController)}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch(()=>{}).finally(()=>{this._fetchFeaturesController===s&&(this._fetchFeaturesController=null)}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e;this.removeHandles(H),this.addHandles([h(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(e=>{l(e)||o.getLogger(this).error(e)})),c(()=>!this.open,()=>{this.removeHandles(H)},{once:!0})],H);const{pendingFeatures:s}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});return{location:t??void 0,promises:s}}async _locationUpdate(e,t){const{spatialReference:i}=this,s=this.selectedFeature?.geometry?.type,r=this.location??e;if(s&&"mesh"!==s&&i&&r&&this.selectedFeature){if("point"===s){const e=await import("../geometry/operators/labelPointOperator.js");return void(this.location=e.execute(this.selectedFeature.geometry))}try{const e=this.selectedFeature;let s=e.geometry;const o=this._getHighlightLayer(e),n=e.getObjectId();if(!o||!this.view)return;if(n){const e=this.view?.allLayerViews.find(e=>e.layer.uid===o.uid);if(!e||!("queryFeatures"in e))return;const r=e.createQuery();r.outSpatialReference=i,r.objectIds=[n],r.returnGeometry=!0;const{features:a}=await e.queryFeatures(r,t);s=a[0]?.geometry}if(!s||"mesh"===s.type)return;s=_(s,i),D??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[a,l]=D;if(!a.execute(s,r)){const t=l.getNearestCoordinate(s,r).coordinate??r;this.selectedFeature===e&&(this.location=t)}}catch(n){l(n)||o.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}_cancelClusterBrowsing(){this._clusterBrowsingController=n(this._clusterBrowsingController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=C(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||v:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:s,view:r,open:o}=this;if(!r||!s||!o)return;const n=this._getHighlightLayer(i);if(!n)return;const a=this._getHighlightLayerView(r,n);if(!a)return;this._highlightPromises[e]=a;const l=await a;if(!(l&&T(l)&&this._highlightPromises[e]===a&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter(e=>!t.includes(e));i?.length&&(this.features=t.concat(i))}};e([g()],z.prototype,"_fetchFeaturesController",void 0),e([g({type:b})],z.prototype,"actions",void 0),e([g({readOnly:!0})],z.prototype,"active",null),e([g()],z.prototype,"activeFeature",void 0),e([g({readOnly:!0})],z.prototype,"allActions",null),e([g()],z.prototype,"browseClusterEnabled",void 0),e([g({value:null})],z.prototype,"content",null),e([g({type:b,readOnly:!0})],z.prototype,"defaultActions",null),e([g({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],z.prototype,"featureCount",null),e([g()],z.prototype,"featurePage",void 0),e([g({value:[]})],z.prototype,"features",null),e([g()],z.prototype,"clusterFeatures",void 0),e([g()],z.prototype,"featuresPerPage",void 0),e([g()],z.prototype,"featureMenuOpen",void 0),e([g({type:O})],z.prototype,"featureItemAbilities",void 0),e([g({readOnly:!0})],z.prototype,"featureItems",void 0),e([g()],z.prototype,"heading",void 0),e([g()],z.prototype,"highlightEnabled",void 0),e([g()],z.prototype,"includeDefaultActions",void 0),e([g({value:"feature"})],z.prototype,"initialDisplayMode",null),e([g({type:f})],z.prototype,"location",null),e([g()],z.prototype,"map",null),e([g()],z.prototype,"open",void 0),e([g({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([g({readOnly:!0})],z.prototype,"promiseCount",null),e([g()],z.prototype,"promises",null),e([g({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([g({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([g({value:-1})],z.prototype,"selectedFeatureIndex",null),e([g({readOnly:!0})],z.prototype,"selectedFeatureItem",null),e([g({type:F})],z.prototype,"spatialReference",null),e([g({readOnly:!0})],z.prototype,"state",null),e([g()],z.prototype,"timeZone",null),e([g()],z.prototype,"updateLocationEnabled",void 0),e([g()],z.prototype,"view",void 0),e([g({readOnly:!0})],z.prototype,"waitingForContents",null),e([g({readOnly:!0})],z.prototype,"waitingForResult",null),e([g()],z.prototype,"zoomFactor",void 0),z=e([m("esri.popup.Features")],z);const N=z;export{N as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{getGraphicLayer as e}from"../graphic/graphicOriginUtils.js";import{zoomToClusteredFeatures as t,browseClusteredFeatures as r}from"./actions.js";function n(e){const{selectedFeature:t,location:r,view:n}=e;return n?t??r??null:null}function a(t){if(!t)return!1;const r=e(t);return t.isAggregate&&"cluster"===r?.featureReduction?.type}async function i(e,t){if(t?.signal?.aborted)return;const{view:r,selectedFeature:n}=e;if(!r||!n)return;const[a,i]=await c(r,n),{extent:u}=await a.queryExtent(i,t);t?.signal?.aborted||(e.selectedClusterBoundaryFeature.geometry=u,r.graphics.add(e.selectedClusterBoundaryFeature))}async function u(e,r){const{browseClusterEnabled:n,selectedFeature:a,view:i}=e;if(!n||!i||!a)return s(!1),void(e.clusterFeatures=null);if(r?.signal?.aborted)return;s(!0);const[u,l]=await c(i,a),{features:o}=await u.queryFeatures(l,r);if(r?.signal?.aborted)return;const d=a.getObjectId();e.clusterFeatures=o?.filter(e=>(e!==a&&(null==d||e.getObjectId()!==d))??[]),t.active=!1,t.disabled=!1}function s(e){r.active=e,r.disabled=e,r.value=e}async function c(t,r){const n=e(r),a=await t.whenLayerView(n),i=a.createQuery(),u=r.getObjectId();return i.aggregateIds=null!=u?[u]:[],[a,i]}export{i as displayClusterExtent,n as getSelectedTarget,a as isClusterFeature,u as updateClusterFeaturesForPopupFeatures};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import e from"../core/Collection.js";import t from"../support/actions/ActionBase.js";import o from"../support/actions/ActionButton.js";import s from"../support/actions/ActionToggle.js";import{legacyIcon as a}from"../widgets/support/legacyIcon.js";const n=e.ofType({key:"type",defaultKeyValue:"button",base:t,typeMap:{button:o,toggle:s}}),i=new o({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"})._internalSetClassName(a.zoomInMagnifyingGlass),l=new o({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}"})._internalSetClassName(a.zoomInMagnifyingGlass),r=new s({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",value:!1})._internalSetClassName(a.table);export{n as ActionsCollection,r as browseClusteredFeatures,l as zoomToClusteredFeatures,i as zoomToFeature};
package/popup/types.d.ts CHANGED
@@ -4,6 +4,8 @@ import type Field from "../layers/support/Field.js";
4
4
  import type Relationship from "../layers/support/Relationship.js";
5
5
  import type Content from "./content/Content.js";
6
6
  import type StatisticDefinition from "../rest/support/StatisticDefinition.js";
7
+ import type ActionButton from "../support/actions/ActionButton.js";
8
+ import type ActionToggle from "../support/actions/ActionToggle.js";
7
9
  import type MapView from "../views/MapView.js";
8
10
  import type SceneView from "../views/SceneView.js";
9
11
  import type { ScreenPoint } from "../core/types.js";
@@ -12,6 +14,15 @@ import type { ClickEvent } from "../views/input/types.js";
12
14
  /** @since 5.0 */
13
15
  export type Alignment = PopupPositionValue | (() => PopupPositionValue);
14
16
 
17
+ /** @since 5.1 */
18
+ export type PopupAction = ActionButton | ActionToggle;
19
+
20
+ /** @since 5.1 */
21
+ export type InitialDisplayOptions = "list" | "feature";
22
+
23
+ /** @since 5.1 */
24
+ export interface PopupOpenOptions {}
25
+
15
26
  /** @since 5.0 */
16
27
  export interface DockOptions {
17
28
  /** Indicates whether the dock button is enabled. */
@@ -526,7 +526,7 @@ export interface DivideGroupedObjectsEdit {
526
526
 
527
527
  /**
528
528
  * Results returned from the [UtilityNetwork.generateAddAssociations()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#generateAddAssociations), [UtilityNetwork.generateDeleteAssociations()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#generateDeleteAssociations),
529
- * [UtilityNetwork.generateCombineNetworkElements()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#generateCombineNetworkElements), and [UtilityNetwork.generateDivideNetworkElements()](https://developers.arcgis.com/javascript/latest/references/core/networks/UtilityNetwork/#generateDivideNetworkElements).
529
+ * [UnitIdentifierManager.generateCombineNetworkElements()](https://developers.arcgis.com/javascript/latest/references/core/networks/UnitIdentifierManager/#generateCombineNetworkElements), and [UnitIdentifierManager.generateDivideNetworkElements()](https://developers.arcgis.com/javascript/latest/references/core/networks/UnitIdentifierManager/#generateDivideNetworkElements).
530
530
  *
531
531
  * @since 4.29
532
532
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const b="20260409",c="2467f96e49f949d1b82c6b40fb9969bc91aa5151";export{b as buildDate,c as commitHash};
2
+ const c="20260410",e="857fc7806a81c82fe7ce3192cfeaa4151358e02c";export{c as buildDate,e as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as d}from"../../../analysis/ExclusiveOperationManager.js";import u from"../../../../widgets/Sketch/SketchViewModel.js";function y(e){return"polygon"===e?.type}let w=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new p({color:null,outline:null}),this._operationManager=new d,this._updatingHandles=new c}initialize(){this._sketchViewModel=new u({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape():this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new p({color:i(e,.3),outline:new m({color:e,width:2})})},n)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=e=>{const i="state"in e?e.state:"active",s="graphic"in e?e.graphic:e.graphics?.at(0);switch(i){case"start":case"active":{const e=s?.geometry;"polygon"===e?.type&&(this._analysis.geometry=e);break}case"cancel":case"complete":t.stop(),this.reshape()}},n=this._sketchViewModel.on(["create","undo","redo"],o);t.handles.push(n,s(()=>{n.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?a(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(r(this._sketchViewModel.create("polygon")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._areaSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(r(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=y(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],w.prototype,"_sketchViewModel",void 0),e([l()],w.prototype,"measurementViewData",void 0),e([l()],w.prototype,"state",null),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),w=e([h("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool")],w);export{w as AreaMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as a,isAborted as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as d}from"../../../analysis/ExclusiveOperationManager.js";import u from"../../../../widgets/Sketch/SketchViewModel.js";function y(e){return"polygon"===e?.type}let w=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new p({color:null,outline:null}),this._operationManager=new d,this._updatingHandles=new c}initialize(){this._sketchViewModel=new u({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&a(this.reshape()):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new p({color:i(e,.3),outline:new m({color:e,width:2})})},n)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=e=>{const i="state"in e?e.state:"active",s="graphic"in e?e.graphic:e.graphics?.at(0);switch(i){case"start":case"active":{const e=s?.geometry;"polygon"===e?.type&&(this._analysis.geometry=e);break}case"cancel":case"complete":t.stop(),this.reshape()}},n=this._sketchViewModel.on(["create","undo","redo"],o);t.handles.push(n,s(()=>{n.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?r(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(a(this._sketchViewModel.create("polygon")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._areaSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(a(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=y(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),r(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],w.prototype,"_sketchViewModel",void 0),e([l()],w.prototype,"measurementViewData",void 0),e([l()],w.prototype,"state",null),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),w=e([h("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool")],w);export{w as AreaMeasurementTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as m}from"../../../analysis/ExclusiveOperationManager.js";import d from"../../../../widgets/Sketch/SketchViewModel.js";function u(e){return"polyline"===e?.type}let y=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new p({color:null,width:0}),this._operationManager=new m,this._updatingHandles=new c}initialize(){this._sketchViewModel=new d({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape():this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new p({color:i(e,.3),width:2})},n)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polyline"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),this.reshape()}});t.handles.push(o,s(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?a(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(r(this._sketchViewModel.create("polyline")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._lineSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(r(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=u(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],y.prototype,"_sketchViewModel",void 0),e([l()],y.prototype,"measurementViewData",void 0),e([l()],y.prototype,"state",null),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"view",void 0),y=e([h("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool")],y);export{y as DistanceMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as a,isAborted as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as m}from"../../../analysis/ExclusiveOperationManager.js";import d from"../../../../widgets/Sketch/SketchViewModel.js";function u(e){return"polyline"===e?.type}let y=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new p({color:null,width:0}),this._operationManager=new m,this._updatingHandles=new c}initialize(){this._sketchViewModel=new d({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&a(this.reshape()):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new p({color:i(e,.3),width:2})},n)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polyline"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),this.reshape()}});t.handles.push(o,s(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?r(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(a(this._sketchViewModel.create("polyline")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._lineSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(a(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=u(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),r(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],y.prototype,"_sketchViewModel",void 0),e([l()],y.prototype,"measurementViewData",void 0),e([l()],y.prototype,"state",null),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"view",void 0),y=e([h("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool")],y);export{y as DistanceMeasurementTool};