@arcgis/core 6.0.0-next.42 → 6.0.0-next.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Basemap.js +1 -1
- package/Graphic.js +1 -1
- package/Ground.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +1 -0
- package/analysis/ElevationProfileAnalysis.d.ts +15 -0
- package/analysis/LineOfSightAnalysis.d.ts +6 -1
- package/analysis/ShadowCastAnalysis.d.ts +18 -22
- package/analysis/ShadowCastAnalysis.js +1 -1
- package/analysis/ViewshedAnalysis.d.ts +6 -1
- package/applications/Components/analysisUtils.d.ts +6 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2f54e4feb554c1a7b9c4.js → 02debe67e6fef9d88bdd.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd046399e05e759e0bc2.js → 035204000954973b0ebc.js} +1 -1
- package/assets/esri/core/workers/chunks/05225506fdba0c827407.js +1 -0
- package/assets/esri/core/workers/chunks/{4c73c493dabe949c2512.js → 077b755688346e0dc8d3.js} +1 -1
- package/assets/esri/core/workers/chunks/0c1d8e0c2eae21f97fc0.js +1 -0
- package/assets/esri/core/workers/chunks/105865a4d8cb4ddf8a8a.js +1 -0
- package/assets/esri/core/workers/chunks/{afe3e89737fb45189a99.js → 14ed0c34b910eba3434e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f67b37253d6d05d1e339.js → 14ef986665b4a1f6ccdc.js} +1 -1
- package/assets/esri/core/workers/chunks/158cbf4075d3eca83a6a.js +1 -0
- package/assets/esri/core/workers/chunks/{a03f15f2cbc3fed291c2.js → 15f2b27b8edc0d53e399.js} +1 -1
- package/assets/esri/core/workers/chunks/181d24ced5ef6b1f959b.js +1 -0
- package/assets/esri/core/workers/chunks/18dbee576b7b9dbe69fb.js +1 -0
- package/assets/esri/core/workers/chunks/1aebb8fe0692058bf2fb.js +1 -0
- package/assets/esri/core/workers/chunks/1cdb55d9a5ab1a5e3f08.js +1 -0
- package/assets/esri/core/workers/chunks/{cf2e5f827cea7d7319ce.js → 1e5c5029b0653047a769.js} +1 -1
- package/assets/esri/core/workers/chunks/20db6e844708d3e71437.js +1 -0
- package/assets/esri/core/workers/chunks/21a4c3d8265aca775616.js +1 -0
- package/assets/esri/core/workers/chunks/23fff0505e02fd364909.js +1 -0
- package/assets/esri/core/workers/chunks/286e3e050b29e6158e6f.js +1 -0
- package/assets/esri/core/workers/chunks/29ef9d357e30082d267a.js +1 -0
- package/assets/esri/core/workers/chunks/29feef121b0916fb90bf.js +1 -0
- package/assets/esri/core/workers/chunks/2ef91e8da260454f46d8.js +1 -0
- package/assets/esri/core/workers/chunks/32b9bedd4bb0504f0b1d.js +1 -0
- package/assets/esri/core/workers/chunks/{279089a6a3f08022c678.js → 361d620b3f91868b1490.js} +1 -1
- package/assets/esri/core/workers/chunks/37c16e20f022ca27cdae.js +1 -0
- package/assets/esri/core/workers/chunks/380aefa522dfeccb8c65.js +1 -0
- package/assets/esri/core/workers/chunks/394ae3199c78a94c6a2a.js +1 -0
- package/assets/esri/core/workers/chunks/{fdd2b35388f9fe42b623.js → 3a90b6eafa92f1a68ac5.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a65fc1a2931230fe994.js → 3bb1e06861cd0563ed9f.js} +1 -1
- package/assets/esri/core/workers/chunks/3f92afa58c895bf87e62.js +1 -0
- package/assets/esri/core/workers/chunks/422784ceae0d511868a0.js +1 -0
- package/assets/esri/core/workers/chunks/44782e8318dc47cb08a0.js +1 -0
- package/assets/esri/core/workers/chunks/{5882f349f3771868e67f.js → 4521f72ab0ea872e5d7c.js} +1 -1
- package/assets/esri/core/workers/chunks/45b5a61c4e9fbd9ca0b3.js +1 -0
- package/assets/esri/core/workers/chunks/47af220003adfca2167e.js +1 -0
- package/assets/esri/core/workers/chunks/487500443a6037d3599f.js +1 -0
- package/assets/esri/core/workers/chunks/4a4fab74442c3d914505.js +1 -0
- package/assets/esri/core/workers/chunks/4a8903fb1a5d30a68df9.js +1 -0
- package/assets/esri/core/workers/chunks/4d818b231e6d1fa73cc5.js +1 -0
- package/assets/esri/core/workers/chunks/{e0cf6e1e21d0ee739009.js → 4e03aa5518d46a36661c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a614bac5db42c6263f8.js → 4fe10650ba3cd30aa9a2.js} +1 -1
- package/assets/esri/core/workers/chunks/50b8b1cce0a5f77c8372.js +1 -0
- package/assets/esri/core/workers/chunks/5470a29a69010c8361c4.js +1 -0
- package/assets/esri/core/workers/chunks/564d7f2e58fbc16853c0.js +1 -0
- package/assets/esri/core/workers/chunks/5c2e79f2ca401741bf3e.js +1 -0
- package/assets/esri/core/workers/chunks/5c9ab86bec07264dc9f2.js +1 -0
- package/assets/esri/core/workers/chunks/{04d55ed51e8b2683c4b4.js → 5d908a823b324bafda1e.js} +1 -1
- package/assets/esri/core/workers/chunks/5e6d6676a5c47c0e132a.js +1 -0
- package/assets/esri/core/workers/chunks/5fd4d3cb3c9350131a59.js +1 -0
- package/assets/esri/core/workers/chunks/60637f38159e9bf68d4e.js +1 -0
- package/assets/esri/core/workers/chunks/69b73251257088ce7099.js +1 -0
- package/assets/esri/core/workers/chunks/6cd17c3a254a0b5c2476.js +1 -0
- package/assets/esri/core/workers/chunks/{06102715e9a8f218e07c.js → 6f3732e7ba2d031ba789.js} +1 -1
- package/assets/esri/core/workers/chunks/7191ab31fa040a7c561e.js +1 -0
- package/assets/esri/core/workers/chunks/71ba848c3352ea3ff96f.js +1 -0
- package/assets/esri/core/workers/chunks/76dc8e3264a456f33e61.js +1 -0
- package/assets/esri/core/workers/chunks/77d80b6d65d761214a7c.js +1 -0
- package/assets/esri/core/workers/chunks/{e2430bc3a1edeb5c3266.js → 78a69594c82d37aecbfb.js} +1 -1
- package/assets/esri/core/workers/chunks/{787c1a8bda7d745633f2.js → 81b9894e81cce3490984.js} +1 -1
- package/assets/esri/core/workers/chunks/85cd525705eec6803dd3.js +1 -0
- package/assets/esri/core/workers/chunks/863f04cacdc843d3f208.js +1 -0
- package/assets/esri/core/workers/chunks/8766832c7253557da8fe.js +1 -0
- package/assets/esri/core/workers/chunks/87992070008812f8ae6f.js +1 -0
- package/assets/esri/core/workers/chunks/892fd2c3533ce46a9258.js +1 -0
- package/assets/esri/core/workers/chunks/89b9d716d96135d4f057.js +1 -0
- package/assets/esri/core/workers/chunks/{4b2d392ad8e381bfd6b3.js → 89e9ebc8d5c1022cb265.js} +1 -1
- package/assets/esri/core/workers/chunks/8b38798ac6d774185238.js +1 -0
- package/assets/esri/core/workers/chunks/8b53369cace136ed1329.js +1 -0
- package/assets/esri/core/workers/chunks/8ba4f5e1912edf397947.js +1 -0
- package/assets/esri/core/workers/chunks/{987424121cf30b0f3c50.js → 8d3e92a3367a3ddc02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/8e7a3b1b088c160f4db7.js +1 -0
- package/assets/esri/core/workers/chunks/8f4fba4d2339c91c8b3f.js +1 -0
- package/assets/esri/core/workers/chunks/{45aaefbdffe5e15dfb24.js → 919a6aedf38e9631ee09.js} +1 -1
- package/assets/esri/core/workers/chunks/{487c46d5245cfb35c4bb.js → 921917e53bac82693ec8.js} +1 -1
- package/assets/esri/core/workers/chunks/92809b209b68abcb97ee.js +1 -0
- package/assets/esri/core/workers/chunks/{beccbfff549902733c4e.js → 9869c696e6321c8db0a9.js} +1 -1
- package/assets/esri/core/workers/chunks/98957dba728c93506e50.js +1 -0
- package/assets/esri/core/workers/chunks/99ffb839407cb3c26ad8.js +1 -0
- package/assets/esri/core/workers/chunks/9b517c8d26a86dedb921.js +1 -0
- package/assets/esri/core/workers/chunks/{cb2329d1ea72ce5cc057.js → 9c3f56f22e9baa80a387.js} +1 -1
- package/assets/esri/core/workers/chunks/{1860104c2b33f68785dd.js → 9d0976f5979c4f9154dc.js} +1 -1
- package/assets/esri/core/workers/chunks/9fe1812aad6e566aea31.js +1 -0
- package/assets/esri/core/workers/chunks/a1602995ef96beb7df29.js +1 -0
- package/assets/esri/core/workers/chunks/{dff845574c0037a1dca6.js → a332e31165b65a6fb92e.js} +1 -1
- package/assets/esri/core/workers/chunks/a553478664a688f32488.js +1 -0
- package/assets/esri/core/workers/chunks/a7937b06f4b0860c7671.js +1 -0
- package/assets/esri/core/workers/chunks/{1980fd7ae1617ef4d19d.js → a95186214f1206efd8ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{853563c66ecf58d53d36.js → ab60e8fbe0f92340616a.js} +1 -1
- package/assets/esri/core/workers/chunks/acea0946049136578354.js +1 -0
- package/assets/esri/core/workers/chunks/{342a97974a78007b25e0.js → ad94f54b4c88b3a047bc.js} +1 -1
- package/assets/esri/core/workers/chunks/ae29fec228e70a93ced1.js +1 -0
- package/assets/esri/core/workers/chunks/ae6dc159be974ca0e8da.js +1 -0
- package/assets/esri/core/workers/chunks/ae70972bf88d586fd453.js +1 -0
- package/assets/esri/core/workers/chunks/b021fa4654ede1d04279.js +1 -0
- package/assets/esri/core/workers/chunks/b03f32f02858244c6cd0.js +1 -0
- package/assets/esri/core/workers/chunks/b2d922ecc2c4899dbee1.js +1 -0
- package/assets/esri/core/workers/chunks/b42e50ec6b819f669400.js +1 -0
- package/assets/esri/core/workers/chunks/b6a82775b83d20599635.js +1 -0
- package/assets/esri/core/workers/chunks/b6d365b9198b74b05338.js +1 -0
- package/assets/esri/core/workers/chunks/{48c6230b8a6d3a8a7906.js → bc21241bc9acb83d1b1c.js} +1 -1
- package/assets/esri/core/workers/chunks/bd02d927b0b4991b61c5.js +1 -0
- package/assets/esri/core/workers/chunks/bdf1c4c038d556527483.js +1 -0
- package/assets/esri/core/workers/chunks/c1273f14a5ef3d81de0d.js +1 -0
- package/assets/esri/core/workers/chunks/c752f1e732bb019f657d.js +1 -0
- package/assets/esri/core/workers/chunks/{3f74c61359b4bd6dcf00.js → c7f49493bd548d5dc1e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{36bafcc29ac133a05558.js → c86d3af148b28ded5875.js} +10 -10
- package/assets/esri/core/workers/chunks/{692f0093c444fcc752b5.js → cadd60fa4370284c7ae3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d5e251cddd41d643510c.js → cb62326b6526cde429c1.js} +1 -1
- package/assets/esri/core/workers/chunks/cd8304b1db83d48c57db.js +1 -0
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
- package/assets/esri/core/workers/chunks/d00dd961a5b79f563123.js +1 -0
- package/assets/esri/core/workers/chunks/d893c3bb093104d3db95.js +1 -0
- package/assets/esri/core/workers/chunks/d8fb1d9da16492574a11.js +1 -0
- package/assets/esri/core/workers/chunks/{520f499d79fa71f262c7.js → dd7e4c94a88452425750.js} +1 -1
- package/assets/esri/core/workers/chunks/ddb4689624d091922471.js +1 -0
- package/assets/esri/core/workers/chunks/df32a3fe81d60f0d7462.js +1 -0
- package/assets/esri/core/workers/chunks/dfc6b33f51dc81f3a7be.js +1 -0
- package/assets/esri/core/workers/chunks/e55934eb4a17a5b24c94.js +1 -0
- package/assets/esri/core/workers/chunks/{5473409fee59db80f87d.js → e5bdfef7c2cc5354be52.js} +1 -1
- package/assets/esri/core/workers/chunks/e8cdec961e9cff1cb73b.js +1 -0
- package/assets/esri/core/workers/chunks/{446d172834f8675f1202.js → eaf720dfdf6ceca31249.js} +1 -1
- package/assets/esri/core/workers/chunks/ef274db3fa260eadf371.js +1 -0
- package/assets/esri/core/workers/chunks/efca82a4dc494f57380b.js +1 -0
- package/assets/esri/core/workers/chunks/f05990e6fb378e2e1a3b.js +1 -0
- package/assets/esri/core/workers/chunks/f0fc89cdf50a40913c02.js +1 -0
- package/assets/esri/core/workers/chunks/{8b5dcc4282772bf6b675.js → f11eaab5354cc6aa9569.js} +1 -1
- package/assets/esri/core/workers/chunks/f1c2f7c7ce4bd4096eb0.js +1 -0
- package/assets/esri/core/workers/chunks/f4e63c5f82b8c2bbfacb.js +1 -0
- package/assets/esri/core/workers/chunks/f86ff791a10c802879ec.js +1 -0
- package/assets/esri/core/workers/chunks/{7452b5ae971a9ff2e6e9.js → fdffefd7de540272a8a6.js} +1 -1
- package/assets/esri/core/workers/chunks/fe0248af95d3f37e099e.js +1 -0
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/Collection.js +1 -1
- package/core/LRUCache.js +1 -1
- package/core/MapUtils.js +1 -1
- package/core/Version.js +1 -1
- package/core/asyncUtils.js +1 -1
- package/core/fontUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/writeUtils.js +1 -1
- package/core/sql.js +1 -1
- package/core/urlUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/support/webMercatorUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +5 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +6 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.d.ts +53 -0
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/ViewshedLayer.d.ts +6 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/effects/jsonUtils.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/graphics/sources/support/uploads.js +1 -1
- package/layers/knowledgeGraph/cypherUtils.js +1 -1
- package/layers/mixins/refresh.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/parquet.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/support/ClientSideConnection.js +1 -1
- package/layers/support/ElevationSampler.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/SpriteSource.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/infoFor3D.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/linkChart/utils.js +1 -1
- package/networks/support/Circuit.js +1 -1
- package/networks/support/CircuitSection.js +1 -1
- package/package.json +2 -2
- package/portal/Portal.js +1 -1
- package/portal/PortalItemResource.js +1 -1
- package/portal/PortalQueryParams.js +1 -1
- package/renderers/HeatmapRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/rest/query/operations/queryAttachments.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/types.d.ts +15 -11
- package/symbols/support/previewSymbol3D.js +1 -1
- package/tables/support/templateUtils.js +1 -1
- package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/TileManager.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileSourceData.js +2 -0
- package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
- package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +4 -4
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/support/TileStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/2d/tiling/TileStrategy.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/images/generateTextures.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/TextureCollection.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFill.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +2 -2
- package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/interactive/sketch/normalizedPoint.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldElevation.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldOrientation.js +1 -1
- package/views/interactive/tooltip/fields/TooltipFieldSize.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass/CompassViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/Expand/ExpandViewModel.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Locate/LocateViewModel.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom/ZoomViewModel.js +1 -1
- package/widgets/support/AnalysisViewModelMixin.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +0 -1
- package/assets/esri/core/workers/chunks/0696fa44a04b99738d7b.js +0 -1
- package/assets/esri/core/workers/chunks/091ec4fe83038f3558f4.js +0 -1
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +0 -1
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +0 -1
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +0 -1
- package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +0 -1
- package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +0 -1
- package/assets/esri/core/workers/chunks/1380cec385426673f294.js +0 -1
- package/assets/esri/core/workers/chunks/1b24a40c0fa197014873.js +0 -1
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +0 -1
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +0 -1
- package/assets/esri/core/workers/chunks/1f76f6dcdae9f55389cb.js +0 -1
- package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +0 -1
- package/assets/esri/core/workers/chunks/247617c0dbae2386ab3b.js +0 -1
- package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +0 -1
- package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +0 -1
- package/assets/esri/core/workers/chunks/2853606099602f73d379.js +0 -1
- package/assets/esri/core/workers/chunks/28ed020d9995b6577be5.js +0 -1
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +0 -1
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +0 -1
- package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +0 -1
- package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +0 -1
- package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +0 -1
- package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +0 -1
- package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +0 -1
- package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +0 -1
- package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +0 -1
- package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +0 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +0 -1
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +0 -1
- package/assets/esri/core/workers/chunks/60c8eedd06080edab3e3.js +0 -1
- package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +0 -1
- package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +0 -1
- package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +0 -1
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +0 -1
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +0 -1
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +0 -1
- package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +0 -1
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +0 -1
- package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +0 -1
- package/assets/esri/core/workers/chunks/6f2e7e663229b223b4df.js +0 -1
- package/assets/esri/core/workers/chunks/7390af96250e89194332.js +0 -1
- package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +0 -1
- package/assets/esri/core/workers/chunks/7e0ed6e8f7b77e43f628.js +0 -1
- package/assets/esri/core/workers/chunks/832c887fdc5af4c08cf2.js +0 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +0 -1
- package/assets/esri/core/workers/chunks/8502274806ea52308822.js +0 -1
- package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +0 -1
- package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +0 -1
- package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +0 -1
- package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +0 -1
- package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +0 -1
- package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +0 -1
- package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +0 -1
- package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +0 -1
- package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +0 -1
- package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +0 -1
- package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +0 -1
- package/assets/esri/core/workers/chunks/a18c3cbe505a19d29569.js +0 -1
- package/assets/esri/core/workers/chunks/a422a801e55fa125546e.js +0 -1
- package/assets/esri/core/workers/chunks/a5f17e9a025ac2b6e1bf.js +0 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +0 -1
- package/assets/esri/core/workers/chunks/a91dc05a6a609d04ed04.js +0 -1
- package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +0 -1
- package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +0 -1
- package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +0 -1
- package/assets/esri/core/workers/chunks/acf4737ba509cbd73cce.js +0 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +0 -1
- package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +0 -1
- package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +0 -1
- package/assets/esri/core/workers/chunks/c0eb27263f608dc3684b.js +0 -1
- package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +0 -1
- package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +0 -1
- package/assets/esri/core/workers/chunks/c8057b47c7c6c02a0bda.js +0 -1
- package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +0 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +0 -1
- package/assets/esri/core/workers/chunks/d4c8673ca65df874a7ce.js +0 -1
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +0 -1
- package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +0 -1
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +0 -1
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +0 -1
- package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +0 -1
- package/assets/esri/core/workers/chunks/f190a3124d6d03417d73.js +0 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +0 -1
- package/assets/esri/core/workers/chunks/f6bd7b52745b82ba73dc.js +0 -1
- package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +0 -1
- package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +0 -1
- package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +0 -1
- package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +0 -1
- package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +0 -2
- package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +0 -2
- /package/views/2d/engine/vectorTiles/{Feature.js → PbfFeature.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecateUnnecessaryViewModel as t}from"../../core/deprecate.js";import{EventedAccessor as n}from"../../core/Evented.js";import{makeHandle as r}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{removeMaybe as a}from"../../core/maybe.js";import{when as o,initial as s,watch as c,on as l,syncAndInitial as u}from"../../core/reactiveUtils.js";import{schedule as d}from"../../core/scheduling.js";import{truncateLocalTime as f,isValidDate as p,resetUTCDate as m,offsetDate as h}from"../../core/timeUtils.js";import{property as g,subclass as _}from"../../core/accessorSupport/decorators.js";import v from"../../views/3d/environment/SunLighting.js";import y from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as b}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as x,sliderPosToDateTime as S,getSeasonFromDate as C,getNorthernHemisphereSeason as w,getSeasonDate as T,calculatePlaySpeed as E}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as D}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as O,getSunriseAndSunsetTimes as k}from"../support/timeWidgetUtils.js";let A=class extends n{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import{deprecateUnnecessaryViewModel as t}from"../../core/deprecate.js";import{EventedAccessor as n}from"../../core/Evented.js";import{makeHandle as r}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{removeMaybe as a}from"../../core/maybe.js";import{when as o,initial as s,watch as c,on as l,syncAndInitial as u}from"../../core/reactiveUtils.js";import{schedule as d}from"../../core/scheduling.js";import{truncateLocalTime as f,isValidDate as p,resetUTCDate as m,offsetDate as h}from"../../core/timeUtils.js";import{property as g,subclass as _}from"../../core/accessorSupport/decorators.js";import v from"../../views/3d/environment/SunLighting.js";import y from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as b}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as x,sliderPosToDateTime as S,getSeasonFromDate as C,getNorthernHemisphereSeason as w,getSeasonDate as T,calculatePlaySpeed as E}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as D}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as O,getSunriseAndSunsetTimes as k}from"../support/timeWidgetUtils.js";let A=class extends n{constructor(e){let{suppressDeprecationWarning:n,...r}=e??{};super(r),this.view=null,this.timeSliderViewModel=new D({suppressDeprecationWarning:!0,min:0,max:1439,values:[0],labelFormatFunction:O,inputFormatFunction:O}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null,n||t(i.getLogger(this),`Daylight`,`arcgis-daylight`,{version:`4.34`})}initialize(){this.addHandles([o(()=>this.view,e=>e.when(()=>this._updateLighting()),s),c(()=>{let e=this._lighting;return e?.type===`sun`?e.date:null},e=>this._scheduleLightingUpdate(e)),l(()=>this._lighting,`timezone-will-change`,e=>this._timezoneWillChange(e),{onListenerAdd:()=>this._timezoneWillChange(null)}),c(()=>this.view?.stationary===!0,()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()},s),c(()=>{let e=this.timeSliderViewModel;return{vm:e,state:e.state,sliderPosition:this.timeSliderPosition}},({vm:e,state:t,sliderPosition:n})=>{t===`ready`&&e.setValue(0,n)}),c(()=>this.timeSliderViewModel?.utcOffset,e=>{e!=null&&(this.utcOffset=e)}),c(()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel}),({utcOffset:e,sliderViewModel:t})=>{t&&(t.utcOffset=e)},u),c(()=>this.timeSliderViewModel.timezonePickerOpen,()=>this.stopPlaying()),c(()=>this.timeSliderViewModel.values,e=>this._setTimeSliderPosition(e?.[0]??0,{forceLightingUpdate:!1}))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return this.view==null||this.view.type===`3d`}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(e){e!==this.utcOffset&&this._lighting!=null&&this._lighting.type!==`virtual`&&(this._lighting.displayUTCOffset=e,this._updateLighting())}get localDate(){return f(this._lightingDateDisplay)}set localDate(e){this.view?.ready?p(e)&&e.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=m(this._lightingDateDisplay,e)):i.getLogger(this).error(`The localDate property cannot be set before the view and the widget are ready.`)}get timeSliderPosition(){return x(this._lightingDateDisplay)}set timeSliderPosition(e){!this.view?.ready||this.timeSliderViewModel?.state!==`ready`?i.getLogger(this).error(`The timeSliderPosition property cannot be set before the view and the widget are ready.`):this._setTimeSliderPosition(e,{forceLightingUpdate:!0})}_setTimeSliderPosition(e,t){Math.abs(e-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._onUserDateTimeChange(),t.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=S(this._lightingDateDisplay,e))}_timezoneFromCamera(e,t){if(t==null||!e.cameraTrackingEnabled)return 0;let n=b([t.longitude,t.latitude]);return n==null?0:Math.round(n.hours+n.minutes/60+n.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(e){let t=this._lighting;t&&(t.directShadowsEnabled=e)}get sunLightingEnabled(){return this._lightingType===`sun`}set sunLightingEnabled(e){let t=this._environment;if(e===this._get(`sunLightingEnabled`)||t==null)return;let n=t.lighting,r=this._oldLighting;this._oldLighting=n;let i={directShadowsEnabled:n.directShadowsEnabled,cameraTrackingEnabled:n.cameraTrackingEnabled,globalIllumination:n.globalIllumination},a=e?`sun`:`virtual`,o;o=r!=null&&r.type===a?r:e?new v:new y,o.set(i),t.lighting=o,e||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(e){this.playingState!==e&&(this._set(`playingState`,e),e!==`none`&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._onUserDateTimeChange()))}get dayPlaying(){return this.playingState===`day`}set dayPlaying(e){e?this.playingState=`day`:this.dayPlaying&&(this.playingState=`none`)}get yearPlaying(){return this.playingState===`year`}set yearPlaying(e){e?this.playingState=`year`:this.yearPlaying&&(this.playingState=`none`)}get currentSeason(){return C(this.localDate,this._currentHemisphere)}set currentSeason(e){this.stopPlaying(),this._onUserDateTimeChange();let t=w(e,this._currentHemisphere);this.localDate=T(this.localDate,t,0)}get _currentHemisphere(){let e=this.view?.camera?.position?.latitude;return e==null||e>=0?0:1}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return h(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,`hours`)}set _lightingDateDisplay(e){let t=this._lighting;if(t==null||!this.sunLightingEnabled||t.type===`virtual`||!p(e))return;let n=t.date,r=h(e,-this._cachedDisplayUTCOffset,`hours`);r.getTime()!==n.getTime()&&(t.date=r,this._updateLighting())}stopPlaying(){this.playingState=`none`}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}onDateChange(e){this.dayPlaying=!1,this.localDate=e,this._onUserDateTimeChange()}_updateLighting(e){let t=Date.now();this._lastLightingUpdate=t;let{view:n}=this,r=this._lighting;if(n==null||r==null||r.type===`virtual`)return;e??=r.date;let i=r.displayUTCOffset??this._timezoneFromCamera(r,n.camera?.position);this._cachedLightingDateUTC.getTime()!==e.getTime()&&(this._cachedLightingDateUTC=new Date(e)),this._cachedDisplayUTCOffset!==i&&(this._cachedDisplayUTCOffset=i)}_timezoneWillChange(e){let t=this._lighting;if(t==null||t.type===`virtual`||!t.cameraTrackingEnabled)return;let n;if(e)n=e.timezoneOffset;else{if(t.displayUTCOffset!=null)return;n=v.calculateTimezoneOffset(t.positionTimezoneInfo)}t.displayUTCOffset=n,this._scheduleLightingUpdate()}_scheduleLightingUpdate(e){if(e&&(this._lightingUpdateHandle=a(this._lightingUpdateHandle),!p(e))||this._lightingUpdateHandle)return;let t=Date.now()-this._lastLightingUpdate,n=this.lightingUpdateInterval-t,i=null,o=()=>{this._updateLighting(e),this._lightingUpdateHandle===i&&(this._lightingUpdateHandle=null)};if(n<=0)this._lightingUpdateHandle=i=d(o);else{let e=setTimeout(o,n);this._lightingUpdateHandle=i=r(()=>clearTimeout(e))}}_cancelLightingUpdate(){this._lightingUpdateHandle=a(this._lightingUpdateHandle)}_play(){let e=this._lighting;if(e==null||!this.sunLightingEnabled||e.type===`virtual`)return;let t=e.date;if(this.dayPlaying||this.yearPlaying){let n=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();let r=E(this._sunrise,this._sunset,t)*this.playSpeedMultiplier/100*n;if(r>0){let n=new Date(t.getTime()+r),i=e.displayUTCOffset??0;((n.getUTCHours()+i)%24+24)%24<((t.getUTCHours()+i)%24+24)%24&&(n=new Date(t.getTime()+r-864e5)),e.date=n}}else if(n>1e3){this._lastTime=Date.now();let n=(t.getUTCMonth()+1)%12,r=new Date(t);r.setUTCMonth(n),e.date=r}requestAnimationFrame(()=>this._play())}}_updateSunriseAndSunset(){let e=this._lighting;if(e==null||e.type===`virtual`||!this.sunLightingEnabled)return;let t=this.view?.camera?.position;if(t==null)return;let{latitude:n,longitude:r}=t,{date:i,displayUTCOffset:a}=e,o=k(i,n,r,a??0);o&&(this._sunrise=new Date(o.sunrise),this._sunset=new Date(o.sunset))}_onUserDateTimeChange(){this.emit(`user-date-time-change`,{})}};e([g()],A.prototype,`view`,void 0),e([g({type:D,nonNullable:!0})],A.prototype,`timeSliderViewModel`,void 0),e([g()],A.prototype,`isSupported`,null),e([g()],A.prototype,`lightingUpdateInterval`,void 0),e([g()],A.prototype,`utcOffset`,null),e([g({type:Date})],A.prototype,`localDate`,null),e([g()],A.prototype,`timeSliderPosition`,null),e([g()],A.prototype,`directShadowsEnabled`,null),e([g()],A.prototype,`sunLightingEnabled`,null),e([g({type:[`none`,`day`,`year`],value:`none`})],A.prototype,`playingState`,null),e([g()],A.prototype,`dayPlaying`,null),e([g()],A.prototype,`yearPlaying`,null),e([g()],A.prototype,`playSpeedMultiplier`,void 0),e([g()],A.prototype,`currentSeason`,null),e([g()],A.prototype,`_lastTime`,void 0),e([g()],A.prototype,`_sunrise`,void 0),e([g()],A.prototype,`_sunset`,void 0),e([g()],A.prototype,`_cachedLightingDateUTC`,void 0),e([g()],A.prototype,`_cachedDisplayUTCOffset`,void 0),e([g()],A.prototype,`_currentHemisphere`,null),e([g()],A.prototype,`_environment`,null),e([g()],A.prototype,`_lighting`,null),e([g()],A.prototype,`_lightingType`,null),e([g()],A.prototype,`_lightingDateDisplay`,null),A=e([_(`esri.widgets.Daylight.DaylightViewModel`)],A);const j=A;export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementLengthUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import{SnappingManager as p}from"../../views/interactive/snapping/SnappingManager.js";import m from"../../views/interactive/snapping/SnappingOptions.js";import{isSupported as h,loadGeometryOperators as g,DistanceMeasurement2DTool as _}from"./DistanceMeasurement2DTool.js";import{InteractiveToolViewModelMixin as v}from"../support/InteractiveToolViewModelMixin.js";let y=class extends v(t){constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementLengthUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import{SnappingManager as p}from"../../views/interactive/snapping/SnappingManager.js";import m from"../../views/interactive/snapping/SnappingOptions.js";import{isSupported as h,loadGeometryOperators as g,DistanceMeasurement2DTool as _}from"./DistanceMeasurement2DTool.js";import{InteractiveToolViewModelMixin as v}from"../support/InteractiveToolViewModelMixin.js";let y=class extends v(t){constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this.supportedViewType=`2d`,this.unsupportedErrorMessage=`DistanceMeasurement2DViewModel is only supported in 2D views.`,this._snappingManager=null,this.snappingOptions=new m,t||n(r.getLogger(this),`Distance Measurement 2D`,`arcgis-distance-measurement-2d`,{version:`5.2`})}initialize(){this.addHandles([a(()=>this.view?.spatialReference,()=>this.clear()),a(()=>this.unit,e=>{this.tool&&(this.tool.unit=e)},o),a(()=>this.view,e=>{this._snappingManager=i(this._snappingManager),e&&(this._snappingManager=new p({view:e,options:this.snappingOptions}))},s),a(()=>this.snappingOptions,e=>{this._snappingManager&&e&&(this._snappingManager.options=e)})])}destroy(){this._snappingManager=i(this._snappingManager)}get measurement(){return this.tool?.measurement??null}get measurementLabel(){return this.tool?.measurementLabel??null}get state(){return this.disabled||this.view==null||!h(this.view?.spatialReference)?`disabled`:this.tool!=null&&this.measurement?this.tool.active?`measuring`:`measured`:`ready`}get unit(){return this._validateUnit(this.defaultUnit)}set unit(e){this._overrideIfSome(`unit`,this._validateUnit(e))}get unitOptions(){return l}set unitOptions(e){this._overrideIfSome(`unitOptions`,this._validateUnits(e))}get view(){return super.view}set view(e){super.view=e}async start(){let{view:e}=this;e&&(await c(()=>e.ready),await g(e.spatialReference)),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new _({snappingManager:this._snappingManager,unit:this.unit,view:this.view,visible:this.visible})}_validateUnit(e){let{unitOptions:t,defaultUnit:n}=this;return e!=null&&t.includes(e)?e:t.includes(n)?n:t.length>0?t[0]:n}_validateUnits(e){if(e==null)return[];let t=e.filter(e=>l.includes(e));return t.length===0?l.slice():t}};e([u()],y.prototype,`_snappingManager`,void 0),e([u(f)],y.prototype,`defaultUnit`,void 0),e([u({readOnly:!0})],y.prototype,`measurement`,null),e([u({readOnly:!0})],y.prototype,`measurementLabel`,null),e([u({type:m,nonNullable:!0})],y.prototype,`snappingOptions`,void 0),e([u({readOnly:!0})],y.prototype,`state`,null),e([u({type:String})],y.prototype,`unit`,null),e([u({type:[String]})],y.prototype,`unitOptions`,null),y=e([d(`esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DViewModel`)],y);const b=y;export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as n}from"../../../core/arrayUtils.js";import{abortHandle as r}from"../../../core/handleUtils.js";import{debounce as i}from"../../../core/promiseUtils.js";import a from"../../../core/ReactiveMap.js";import{whenOnce as o,when as s
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as n}from"../../../core/arrayUtils.js";import{abortHandle as r}from"../../../core/handleUtils.js";import{debounce as i}from"../../../core/promiseUtils.js";import a from"../../../core/ReactiveMap.js";import{whenOnce as o,when as s}from"../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../core/support/UpdatingHandles.js";import d from"../../../layers/GraphicsLayer.js";import{isSceneLayer as f}from"../../../layers/support/layerUtils.js";import{updateGraphicSymbolWhenRequired as p,swapForEditingSession as m}from"../../../views/draw/support/editingSessionUtils.js";import h from"../../../views/interactive/sketch/SketchOptions.js";import{getVisualVariablesForLayer as g,setVisualVariablesAndElevationInfoForUpdate as _,visualVariableInteractiveUpdate as v,getSizeVariableAttribute as y,getRotationVariableAttribute as b}from"../workflowUtils.js";import x from"../../Sketch/SketchViewModel.js";const S=Symbol();let C=class extends t{constructor(e){super(e),this.features=[],this.onGeometriesUpdated=()=>{},this.onVisualVariableAttributesUpdated=()=>{},this.sketchOptions=new h,this.snappingManager=null,this.sourceLayer=null,this.view=null,this.viewModel=null,this.useLegacyCreateTools=!1,this._nextUpdateSubset=[],this._sketchGraphicsMap=new a,this._sketchLayer=null,this._updatingHandles=new u,this._updateSymbolsDebounced=i(e=>Promise.all(this.sketchGraphics.map(t=>p(t,e)))),this._visualVariableAttributes=new Map,this._visualVariablesForLayer=null}async initialize(){this._visualVariablesForLayer=g(this.sourceLayer),this._nextUpdateSubset=this.features,this._initializeSketchGraphics(),this._initializeSketchLayer(),await this._updatingHandles.addPromise(this._initializeSketchViewModel())}destroy(){let{_sketchLayer:e,view:t}=this;t?.destroyed||t?.map.remove(e),this._updatingHandles.destroy(),e.destroy(),this.viewModel.destroy()}get defaultUpdateOptions(){let e=this.sourceLayer;return{multipleSelectionEnabled:!1,reshapeOptions:{enableCreateCurveFromStraightEdge:!f(e)&&e.capabilities?.data.supportsTrueCurve}}}set defaultUpdateOptions(e){this._set(`defaultUpdateOptions`,e)}get sketchGraphics(){return Array.from(this._sketchGraphicsMap.values())}get updating(){return this._updatingHandles.updating||this.viewModel?.updating===!0}async enter(){await this.startUpdatingFeatures(this._nextUpdateSubset)}async exit(){this._completeCurrentOperation()}notifyAttributesChanged(e,t){let n=this._sketchGraphicsMap.get(e);if(!n)return;let r=this.view.scale,i=this._updatingHandles;for(let{fieldName:a,value:o}of t){if(n.getAttribute(a)===o||typeof o!=`number`)continue;n.setAttribute(a,o);let t=this._visualVariableAttributes.get(e);t?.size!=null&&t.size.field===a&&!t.size.isUpdatingInteractively&&t.size.setInitialValue(o),t?.rotation!=null&&t.rotation.field===a&&!t.rotation.isUpdatingInteractively&&t.rotation.setInitialValue(o),i.consumePromise(this._updateSymbolsDebounced(r))}}async startUpdatingFeatures(e){let{onGeometriesUpdated:t,onVisualVariableAttributesUpdated:i,_sketchGraphicsMap:a,_sketchLayer:c,sourceLayer:l,view:u,viewModel:d}=this,f=e.map(e=>a.get(e)).filter(n),p={...this.defaultUpdateOptions};this._completeCurrentOperation();let m=null;if(e.length===1){let t=e[0],n=this._visualVariableAttributes.get(t);(n?.rotation||n?.size)&&(await _({graphic:f[0],sketchLayer:c,sketchViewModel:d,sourceLayer:l,visualVariables:n}),l.geometryType===`point`&&(p.enableRotation=n.rotation!=null,p.enableScaling=n.size!=null,m=async e=>{let r=e.graphics[0];v(u,r,e,n)&&(i?.([{feature:t,attributes:r.attributes}],e),this._updatingHandles.consumePromise(this._updateSymbolsDebounced(u.type===`2d`?u.scale:null)))}))}else p.tool=`move`;let h=()=>d.update(f,p),g=d.on(`update`,i=>{if(i.state===`complete`){let e=new AbortController,t=r(e);this.addHandles(t,S),this._updatingHandles.consumePromise(o(()=>u.activeTool===null,e.signal).then(async()=>{e.signal.aborted||(e.abort(),await h())}));return}let s=e.map(e=>{let t=a.get(e);return t?{feature:e,geometry:t.geometry}:null}).filter(n);t(s,i),m?.(i)});await h();let y=s(()=>u.activeTool!=null&&u.activeTool!==d.activeComponent,()=>d.cancel());this._nextUpdateSubset=this.features,this.addHandles([g,y],S),d.addHandles(y),d.addHandles(g)}_completeCurrentOperation(){this.removeHandles(S),this.viewModel.complete()}_initializeSketchGraphics(){let{features:e,_sketchGraphicsMap:t,sourceLayer:n,_visualVariableAttributes:r}=this,i=this._visualVariablesForLayer,a=i.rotation?.field,o=i.size?.field,s={rotation:a?n.getField(a):null,size:o?n.getField(o):null},c=!!(s.rotation||s.size);for(let n of e)t.set(n,n.clone()),c&&r.set(n,w(i,s))}_initializeSketchLayer(){let{view:e}=this,t=new d({elevationInfo:this.sourceLayer.elevationInfo,internal:!0,listMode:`hide`,title:`SketchController layer`});this._sketchLayer=t,e.map.add(t),this._updatingHandles.consumePromise(e.whenLayerView(t))}async _initializeSketchViewModel(){let{defaultUpdateOptions:e,sketchOptions:t,snappingManager:n,useLegacyCreateTools:r,view:i,_sketchGraphicsMap:a,_sketchLayer:o}=this,s=Array.from(a.entries()),c=new x({allowDeleteKey:!1,defaultUpdateOptions:e,layer:o,sketchOptions:t,snappingManager:n,useLegacyCreateTools:r,updateOnGraphicClick:!1,cancelUpdateOnClickAway:!1,view:i});this.viewModel=c,await this._updateSymbolsDebounced(i.type===`2d`?i.scale:null),i.type===`2d`&&this._updatingHandles.add(()=>i.scale,e=>this._updatingHandles.consumePromise(this._updateSymbolsDebounced(e))),this.addHandles(await Promise.all(s.map(([e,t])=>m(o,i,e,t))))}};e([c()],C.prototype,`defaultUpdateOptions`,null),e([c()],C.prototype,`features`,void 0),e([c()],C.prototype,`onGeometriesUpdated`,void 0),e([c()],C.prototype,`onVisualVariableAttributesUpdated`,void 0),e([c()],C.prototype,`sketchGraphics`,null),e([c()],C.prototype,`sketchOptions`,void 0),e([c()],C.prototype,`snappingManager`,void 0),e([c()],C.prototype,`sourceLayer`,void 0),e([c()],C.prototype,`updating`,null),e([c()],C.prototype,`view`,void 0),e([c()],C.prototype,`viewModel`,void 0),e([c()],C.prototype,`useLegacyCreateTools`,void 0),e([c()],C.prototype,`_nextUpdateSubset`,void 0),e([c()],C.prototype,`_sketchGraphicsMap`,void 0),e([c()],C.prototype,`_sketchLayer`,void 0),e([c()],C.prototype,`_visualVariablesForLayer`,void 0),C=e([l(`esri.widgets.Editor.support.SketchController`)],C);function w({rotation:e,size:t},n){return{rotation:e?b(e,n.rotation):null,size:t?y(t,n.size):null}}export{C as SketchController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Color.js";import{deprecated as n,esriurl as r}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import{handlesGroup as a}from"../../core/handleUtils.js";import has from"../../core/has.js";import o from"../../core/Logger.js";import{memoize as s}from"../../core/memoize.js";import{watch as c,syncAndInitial as l,sync as u}from"../../core/reactiveUtils.js";import{generateUUID as d}from"../../core/uuid.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Point.js";import{getConfig as h}from"./support/constants.js";import{binaryFindClosest as g}from"./support/profileUtils.js";import{convertSamples as _,convertStatistics as v}from"./support/unitUtils.js";let y=class extends i{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Color.js";import{deprecated as n,esriurl as r}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import{handlesGroup as a}from"../../core/handleUtils.js";import has from"../../core/has.js";import o from"../../core/Logger.js";import{memoize as s}from"../../core/memoize.js";import{watch as c,syncAndInitial as l,sync as u}from"../../core/reactiveUtils.js";import{generateUUID as d}from"../../core/uuid.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Point.js";import{getConfig as h}from"./support/constants.js";import{binaryFindClosest as g}from"./support/profileUtils.js";import{convertSamples as _,convertStatistics as v}from"./support/unitUtils.js";let y=class extends i{constructor(e){let{isDefaultLine:i,...a}=e??{};super(a),this.type=null,this.id=d(),this.title=null,this.color=new t(`#000000`),this.visible=!0,this._getSamplesMemoized=s((e,t)=>_(e,t)),this._getStatisticsMemoized=s((e,t)=>v(e,t)),this.viewVisualizationEnabled=!0,this.result=null,this.effectiveUnits=null,this.numSamplesForPreview=30,this.numSamplesPerChunk=200,this.chartFillEnabled=!0,this.chartStrokeWidth=1.5,this.chartStrokeOffsetY=0,this._viewModel=null,has(`esri-deprecation-warnings`)&&!i&&n(o.getLogger(this),`This class is deprecated. Use the Elevation Profile component or the elevation profile analysis directly instead.`,{see:[`Elevation Profile component reference: ${r}arcgis-elevation-profile/`,`Esri's move to web components: ${r}components-transition-plan/`],replacement:`ElevationProfileAnalysis or <arcgis-elevation-profile></arcgis-elevation-profile>`,warnOnce:!0})}get progress(){return this.result!=null&&this.visible?this.result.progress:0}get samples(){return this._getSamplesMemoized(this.result,this.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.result,this.effectiveUnits)}get hoveredPoint(){let e=this._viewModel?.hoveredChartPosition;return e==null?null:this._getPoint(e)}get available(){return!0}get hasZ(){let e=this.result;return e!=null&&e.hasZ}get minDemResolution(){return h().defaultDemResolution}queryElevation(){throw Error(`not implemented`)}attach(e){return this._viewModel=e,a([c(()=>e.effectiveUnits,e=>{this.effectiveUnits=e},l),c(()=>[e.input],()=>this._onChange(),u)])}toggleVisibility(e){this.visible=e===void 0?!this.visible:e}_onChange(){this.emit(`change`)}_getPoint(e){let{samples:t,result:n}=this;if(t==null||n==null)return null;let r=t.length;if(r===0)return null;let i=e*t[r-1].distance,a=g(t,i,e=>e.distance);if(a==null)return null;let{x:o,y:s,z:c}=a;return c==null?null:new m({x:o,y:s,z:c,spatialReference:n.spatialReference})}};e([f({nonNullable:!0})],y.prototype,`id`,void 0),e([f()],y.prototype,`title`,void 0),e([f({type:t,nonNullable:!0})],y.prototype,`color`,void 0),e([f({nonNullable:!0})],y.prototype,`visible`,void 0),e([f({readOnly:!0})],y.prototype,`progress`,null),e([f({readOnly:!0})],y.prototype,`samples`,null),e([f({readOnly:!0})],y.prototype,`statistics`,null),e([f()],y.prototype,`hoveredPoint`,null),e([f()],y.prototype,`viewVisualizationEnabled`,void 0),e([f()],y.prototype,`available`,null),e([f()],y.prototype,`result`,void 0),e([f()],y.prototype,`effectiveUnits`,void 0),e([f()],y.prototype,`numSamplesForPreview`,void 0),e([f()],y.prototype,`numSamplesPerChunk`,void 0),e([f()],y.prototype,`chartFillEnabled`,void 0),e([f()],y.prototype,`chartStrokeWidth`,void 0),e([f()],y.prototype,`chartStrokeOffsetY`,void 0),e([f({readOnly:!0})],y.prototype,`hasZ`,null),e([f({readOnly:!0})],y.prototype,`minDemResolution`,null),e([f()],y.prototype,`_viewModel`,void 0),y=e([p(`esri.widgets.ElevationProfile.ElevationProfileLine`)],y);const b=y;export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import n from"../../core/Accessor.js";import{isSome as r,min as i}from"../../core/arrayUtils.js";import a from"../../core/Collection.js";import{referenceSetter as o}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import c from"../../core/Logger.js";import{LRUCache as l}from"../../core/LRUCache.js";import{destroyMaybe as u}from"../../core/maybe.js";import{memoize as d}from"../../core/memoize.js";import{watch as f,syncAndInitial as p}from"../../core/reactiveUtils.js";import{adaptiveLengthUnit as m,adaptiveVerticalLengthUnit as h,measurementLengthUnits as g}from"../../core/units.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{ElevationQueryTileCache as y}from"../../layers/support/ElevationQueryTileCache.js";import{defaultUnitPropertyMetadata as b}from"../../properties/defaultUnit.js";import{ElevationProfileController as x}from"./ElevationProfileController.js";import S from"./ElevationProfileLineGround.js";import{ElevationProfileLineCollection as C}from"./elevationProfileLineTypes.js";import{ElevationProfileTool as w}from"./ElevationProfileTool.js";import{isPolyline as T,isValidInputPath as E}from"./support/geometryUtils.js";import{isProfileGenerationError as D}from"./support/ProfileGenerationError.js";import{createProfileQueue as O}from"./support/profileUtils.js";import{getBoundsInMeters as k,mergeStatistics as A}from"./support/statisticsUtils.js";let j=class extends n{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import n from"../../core/Accessor.js";import{isSome as r,min as i}from"../../core/arrayUtils.js";import a from"../../core/Collection.js";import{referenceSetter as o}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import c from"../../core/Logger.js";import{LRUCache as l}from"../../core/LRUCache.js";import{destroyMaybe as u}from"../../core/maybe.js";import{memoize as d}from"../../core/memoize.js";import{watch as f,syncAndInitial as p}from"../../core/reactiveUtils.js";import{adaptiveLengthUnit as m,adaptiveVerticalLengthUnit as h,measurementLengthUnits as g}from"../../core/units.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{ElevationQueryTileCache as y}from"../../layers/support/ElevationQueryTileCache.js";import{defaultUnitPropertyMetadata as b}from"../../properties/defaultUnit.js";import{ElevationProfileController as x}from"./ElevationProfileController.js";import S from"./ElevationProfileLineGround.js";import{ElevationProfileLineCollection as C}from"./elevationProfileLineTypes.js";import{ElevationProfileTool as w}from"./ElevationProfileTool.js";import{isPolyline as T,isValidInputPath as E}from"./support/geometryUtils.js";import{isProfileGenerationError as D}from"./support/ProfileGenerationError.js";import{createProfileQueue as O}from"./support/profileUtils.js";import{getBoundsInMeters as k,mergeStatistics as A}from"./support/statisticsUtils.js";let j=class extends n{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.view=null,this.input=null,this._getEffectiveUnitsMemoized=d((e,t)=>({distance:e,elevation:t})),this.hoveredChartPosition=null,this.uniformChartScaling=!1,this.defaultUnit=null,this.queue=null,this._currentTileCache=null,this.error=null,this._defaultProfileLineGround=new S({isDefaultLine:!0}),this._userUnitOptions=null,this._userUnit=null,t||s(c.getLogger(this),`Elevation Profile`,`arcgis-elevation-profile`,{version:`5.0`}),e?.profiles||(this.profiles=new a([this._defaultProfileLineGround]))}initialize(){this.addHandles(f(()=>this.view,e=>{if(e==null){c.getLogger(this).warnOnce(`no view. Widget will be disabled until a view is provided.`);return}this.removeHandles(M);let t=e.type===`3d`?e.resourceController:void 0;this.queue?.destroy(),this.queue=O(t?.scheduler);let n=t?.addUpdatingObject(this);n&&this.addHandles(n,M)},p)),this.tool=new w({viewModel:this}),this._controller=new x({viewModel:this})}destroy(){this._defaultProfileLineGround=u(this._defaultProfileLineGround),this._controller=u(this._controller),this._currentTileCache=u(this._currentTileCache),this.tool=u(this.tool),this.queue=u(this.queue)}get profiles(){return this._get(`profiles`)}set profiles(e){let t=this._get(`profiles`),n=e??new a;this._set(`profiles`,o(n,t))}get state(){let e=this.view;return e!=null&&e.ready?this.tool.state:`disabled`}get progress(){let e=0,t=0;for(let n of this.visibleProfiles)e++,t+=n.progress;return e>0?t/e:0}set unitOptions(e){this._userUnitOptions=e,this._set(`unitOptions`,this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(e){this._userUnit=e?this._findSelectableUnit(e,this._userUnit):null,this.notifyChange(`unit`)}get unit(){return this._userUnit?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}get effectiveUnits(){let e=k(this.visibleProfiles.map(e=>e.result)),t=m(e.maxDistance,`meters`,this.unit),n=h(e.maxElevation,`meters`,this.unit);return this._getEffectiveUnitsMemoized(t,n)}get highlightEnabled(){return this.tool.highlightEnabled}set highlightEnabled(e){this.tool.highlightEnabled=e}get hasVertices(){let e=this.input?.geometry;return T(e)&&e.paths.reduce((e,t)=>e+t.length,0)>0}get hoveredPoints(){return this.input==null||!this.visible||!this.tool.editable?[]:this.visibleProfiles.map(e=>{let t=e.hoveredPoint;return t==null?null:{hoveredPoint:t,color:e.color}}).filter(r)}get statistics(){return A(this.visibleProfiles.map(e=>e.statistics))}get chartData(){if(this.input==null)return null;let{effectiveUnits:e,progress:t,statistics:n,visibleProfiles:r,uniformChartScaling:i}=this,a=r.filter(e=>e.hasZ).map(e=>({id:e.id,type:e.type,title:e.title,color:e.color,samples:e.samples,progress:e.progress,chartFillEnabled:e.chartFillEnabled,chartStrokeWidth:e.chartStrokeWidth,chartStrokeOffsetY:e.chartStrokeOffsetY,viewVisualizationEnabled:e.viewVisualizationEnabled}));return a.length===0?null:{lines:a,effectiveUnits:e,statistics:n,refined:t===1,dynamicElevationRange:r.some(e=>e.type===`view`),uniformScaling:i}}get visibleProfiles(){return this.profiles.toArray().filter(e=>e.available&&e.visible)}get minDemResolutions(){let e=[];for(let{minDemResolution:t}of this.visibleProfiles)t!=null&&e.push(t);return e}get minDemResolution(){return i(this.minDemResolutions)}get errorState(){let e=this.input?.geometry;if(!E(e))return`no-valid-input`;if(this.error!=null){if(D(this.error))switch(this.error.cause){case`too-complex`:return`too-complex`;case`invalid-geometry`:return`invalid-geometry`;case`invalid-elevation-info`:return`invalid-elevation-info`;case`elevation-query-error`:return`no-valid-input`}return`unknown-error`}return this.visibleProfiles.length===0?`no-visible-profiles`:this.chartData==null&&this.progress===1?`refined-but-no-chart-data`:`none`}get tileCache(){this._currentTileCache=u(this._currentTileCache);let e=this.view;if(e!=null&&e?.type===`3d`){let t=e.groundView?.elevationQueryCache;if(t!=null)return t}return this._currentTileCache??=new y(new l(20971520)),this._currentTileCache}get visible(){return this.tool.visible}set visible(e){this.tool.visible=e}get selectAvailable(){for(let e of this.view?.map?.allLayers??[])if(e.type===`graphics`&&!e.internal&&e.graphics.some(e=>e.geometry?.type===`polyline`)||`geometryType`in e&&e.geometryType===`polyline`)return!0;return!!this.view?.graphics?.some(e=>e.geometry?.type===`polyline`)}get inputIsSketched(){return this.tool.interaction.isSketchedGraphic(this.input)}get elevationProvider(){let e=this.view;return e!=null&&e.type===`3d`?e.elevationProvider:null}get updating(){let{progress:e}=this,t=!!this.queue?.updating;return e>0&&e<1||t||this.tool.interaction.updating||this.tool.view.updating}start(e){this.tool.interaction.start(e)}stop(){this.tool.interaction.stop()}cancel(){this.tool.interaction.cancel()}clear(){this.tool.interaction.clear()}_findSelectableUnit(e,t){let n=this.unitOptions;return e!=null&&n.includes(e)?e:t?this._findSelectableUnit(t):n[0]}_filteredOrAllUnits(e){let t=(e??[]).filter(e=>g.includes(e));return t.length===0?g.slice():t}};e([_()],j.prototype,`view`,void 0),e([_({type:t})],j.prototype,`input`,void 0),e([_({type:C,nonNullable:!0})],j.prototype,`profiles`,null),e([_({readOnly:!0})],j.prototype,`state`,null),e([_({readOnly:!0})],j.prototype,`progress`,null),e([_()],j.prototype,`unitOptions`,null),e([_()],j.prototype,`unit`,null),e([_({readOnly:!0})],j.prototype,`effectiveUnits`,null),e([_()],j.prototype,`hoveredChartPosition`,void 0),e([_()],j.prototype,`uniformChartScaling`,void 0),e([_()],j.prototype,`highlightEnabled`,null),e([_({readOnly:!0})],j.prototype,`hoveredPoints`,null),e([_({readOnly:!0})],j.prototype,`statistics`,null),e([_()],j.prototype,`chartData`,null),e([_()],j.prototype,`visibleProfiles`,null),e([_()],j.prototype,`minDemResolutions`,null),e([_({readOnly:!0})],j.prototype,`minDemResolution`,null),e([_({readOnly:!0})],j.prototype,`errorState`,null),e([_(b)],j.prototype,`defaultUnit`,void 0),e([_()],j.prototype,`queue`,void 0),e([_()],j.prototype,`tileCache`,null),e([_()],j.prototype,`tool`,void 0),e([_()],j.prototype,`visible`,null),e([_()],j.prototype,`error`,void 0),e([_()],j.prototype,`selectAvailable`,null),e([_()],j.prototype,`inputIsSketched`,null),e([_()],j.prototype,`elevationProvider`,null),e([_()],j.prototype,`updating`,null),e([_()],j.prototype,`_defaultProfileLineGround`,void 0),e([_()],j.prototype,`_userUnitOptions`,void 0),e([_()],j.prototype,`_controller`,void 0),e([_()],j.prototype,`_userUnit`,void 0),j=e([v(`esri.widgets.ElevationProfile.ElevationProfileViewModel`)],j);const M=Symbol(`updating-object`),N=j;export{N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{on as i,when as a,pausable as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";let l=class extends t{constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{on as i,when as a,pausable as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";let l=class extends t{constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this._viewpointHandle=null,this.group=null,t||n(r.getLogger(this),`Expand`,`arcgis-expand`,{version:`5.0`})}initialize(){this.addHandles(i(()=>this.view?.ui,`expand`,e=>{let{target:t}=e;t&&t!==this&&t.expanded&&t.group&&t.group===this.group&&this._collapse()}))}destroy(){this._viewpointHandle=null,this.view=null}set autoCollapse(e){this._set(`autoCollapse`,e),this._watchViewpoint()}set expanded(e){let t=!!e;this._set(`expanded`,t);let n=this.view?.ui;n&&n.emit(`expand`,{target:this}),this._viewpointHandleChange(t)}get state(){return this.view?.ready?`ready`:`disabled`}set view(e){this._get(`view`)!==e&&(this._set(`view`,e),e&&a(()=>e.ready,()=>{this.view===e&&this._watchViewpoint()},{once:!0,initial:!0}))}_viewpointHandleChange(e){this._viewpointHandle&&(e?a(()=>this.view?.stationary,()=>this._viewpointHandle?.resume(),{once:!0,initial:!0}):this._viewpointHandle.pause())}_watchViewpoint(){let e=`viewpoint`;this.removeHandles(e),this._viewpointHandle=null;let{autoCollapse:t,view:n}=this;if(!n||!t)return;let r=o(()=>n.type===`3d`?n.camera:n.viewpoint,()=>this._collapse());this.addHandles(r,e),this._viewpointHandle=r}_collapse(){this.expanded=!1}};e([s({value:!1})],l.prototype,`autoCollapse`,null),e([s({value:!1})],l.prototype,`expanded`,null),e([s()],l.prototype,`group`,void 0),e([s({readOnly:!0})],l.prototype,`state`,null),e([s({value:null})],l.prototype,`view`,null),l=e([c(`esri.widgets.Expand.ExpandViewModel`)],l);const u=l;export{u as default};
|
package/widgets/Expand.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import{makeHandle as n}from"../core/handleUtils.js";import r from"../core/Logger.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import l from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{messageBundle as f,tsx as p,isWidget as m,hasDomNode as h}from"./support/widget.js";const g=`esri-expand`,_={base:g,toggle:`${g}__toggle`,popoverContent:`${g}__popover-content`,panel:`${g}__panel`,panelContent:`${g}__panel-content`,sheet:`${g}__sheet`,contentContainer:`${g}__content-container`,icon:`esri-collapse__icon`,iconFlip:`esri-collapse__icon-flip`,iconNumber:`${g}__icon-number`},v=`chevrons-left`,y=`chevrons-right`,b=Symbol(`scheduleRender-override-handle`);let x=class extends c{constructor(e){super(e),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip=``,this.content=``,this.expandTooltip=``,this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode=`auto`,this.placement=null,this.viewModel=new l({suppressDeprecationWarning:!0}),this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&e.key===`Escape`&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e},t(r.getLogger(this),`Expand`,`arcgis-expand`,{version:`4.34`})}initialize(){this.addHandles(i(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),a))}loadDependencies(){return u({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),sheet:()=>import(`@esri/calcite-components/dist/components/calcite-sheet`)})}get expandTitle(){let{expanded:e,messagesCommon:t,collapseTooltip:n,expandTooltip:r}=this;return(e?n||t?.collapse:r||t?.expand)??``}get _displaySheet(){switch(this.mode){case`drawer`:return!0;case`auto`:return this.viewModel.view?.widthBreakpoint===`xsmall`;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return y}set collapseIcon(e){this._overrideIfSome(`collapseIcon`,e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return typeof this.content==`object`&&`icon`in this.content&&this.content.icon?this.content.icon:v}set expandIcon(e){this._overrideIfSome(`expandIcon`,e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return typeof this.content==`object`&&`label`in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){let{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:n},label:r,placement:i}=this;return p(`div`,{class:this.classes(_.base,d.widget)},this._renderToggle(),e?p(`calcite-sheet`,{class:_.sheet,height:`l`,label:r,open:n,position:`block-end`,topLayerDisabled:this.topLayerDisabled,onCalciteSheetClose:this._handleSheetClose,onkeydown:this._handleKeyDown},p(`calcite-panel`,{class:_.panel,closable:!0,closed:!n,heading:r,onCalcitePanelClose:this._handlePanelClose,onkeydown:this._handleKeyDown},p(`div`,{class:_.panelContent},this._renderContent()))):t?p(`calcite-popover`,{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:r,open:n,overlayPositioning:`fixed`,placement:i??this._getPlacement(),referenceElement:t,topLayerDisabled:this.topLayerDisabled,onCalcitePopoverClose:this._handlePopoverClose,onkeydown:this._handleKeyDown},p(`div`,{class:_.popoverContent},this._renderContent())):null)}_getPlacement(){let{container:e,view:t}=this,n=e&&t?t.ui.getPosition(e):null;if(!n||n===`manual`)return`auto`;let[r,i]=n.split(
|
|
2
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import{makeHandle as n}from"../core/handleUtils.js";import r from"../core/Logger.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import l from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{messageBundle as f,tsx as p,isWidget as m,hasDomNode as h}from"./support/widget.js";const g=`esri-expand`,_={base:g,toggle:`${g}__toggle`,popoverContent:`${g}__popover-content`,panel:`${g}__panel`,panelContent:`${g}__panel-content`,sheet:`${g}__sheet`,contentContainer:`${g}__content-container`,icon:`esri-collapse__icon`,iconFlip:`esri-collapse__icon-flip`,iconNumber:`${g}__icon-number`},v=`chevrons-left`,y=`chevrons-right`,b=Symbol(`scheduleRender-override-handle`);let x=class extends c{constructor(e){super(e),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip=``,this.content=``,this.expandTooltip=``,this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode=`auto`,this.placement=null,this.viewModel=new l({suppressDeprecationWarning:!0}),this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&e.key===`Escape`&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e},t(r.getLogger(this),`Expand`,`arcgis-expand`,{version:`4.34`})}initialize(){this.addHandles(i(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),a))}loadDependencies(){return u({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),sheet:()=>import(`@esri/calcite-components/dist/components/calcite-sheet`)})}get expandTitle(){let{expanded:e,messagesCommon:t,collapseTooltip:n,expandTooltip:r}=this;return(e?n||t?.collapse:r||t?.expand)??``}get _displaySheet(){switch(this.mode){case`drawer`:return!0;case`auto`:return this.viewModel.view?.widthBreakpoint===`xsmall`;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return y}set collapseIcon(e){this._overrideIfSome(`collapseIcon`,e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return typeof this.content==`object`&&`icon`in this.content&&this.content.icon?this.content.icon:v}set expandIcon(e){this._overrideIfSome(`expandIcon`,e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return typeof this.content==`object`&&`label`in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){let{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:n},label:r,placement:i}=this;return p(`div`,{class:this.classes(_.base,d.widget)},this._renderToggle(),e?p(`calcite-sheet`,{class:_.sheet,height:`l`,label:r,open:n,position:`block-end`,topLayerDisabled:this.topLayerDisabled,onCalciteSheetClose:this._handleSheetClose,onkeydown:this._handleKeyDown},p(`calcite-panel`,{class:_.panel,closable:!0,closed:!n,heading:r,onCalcitePanelClose:this._handlePanelClose,onkeydown:this._handleKeyDown},p(`div`,{class:_.panelContent},this._renderContent()))):t?p(`calcite-popover`,{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:r,open:n,overlayPositioning:`fixed`,placement:i??this._getPlacement(),referenceElement:t,topLayerDisabled:this.topLayerDisabled,onCalcitePopoverClose:this._handlePopoverClose,onkeydown:this._handleKeyDown},p(`div`,{class:_.popoverContent},this._renderContent())):null)}_getPlacement(){let{container:e,view:t}=this,n=e&&t?t.ui.getPosition(e):null;if(!n||n===`manual`)return`auto`;let[r,i]=n.split(`-`,2);return`${i===`right`?`left`:`right`}-${r===`bottom`?`end`:`start`}`}_willCloseOnEsc(e){let{closeOnEsc:t}=this;return typeof t==`function`?t(e):t}_renderBadgeNumber(){let{expanded:e,iconNumber:t}=this;return t&&!e?p(`span`,{class:_.iconNumber,key:`expand__icon-number`},t):null}_renderToggleButton(){let{expanded:e,expandTitle:t,expandIcon:n,collapseIcon:r}=this,i=e?r:n,a=i===v||i===y;return p(`calcite-action`,{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:d.widgetButton,text:t,title:t,onclick:this.toggle},i?p(`calcite-icon`,{class:this.classes(_.icon,a&&_.iconFlip),icon:i,scale:`s`}):null)}_renderToggle(){return p(`div`,{class:_.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){let{content:e}=this;return typeof e==`string`?p(`div`,{class:_.contentContainer,innerHTML:e,key:`content__string`}):m(e)?p(`div`,{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(b),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(b),this._overwriteChildScheduleRender(e))},class:_.contentContainer,key:`content__widget`},e.render()):e instanceof HTMLElement?p(`div`,{afterCreate:this._attachToNode,bind:e,class:_.contentContainer,key:`content__html-element`}):h(e)?p(`div`,{afterCreate:this._attachToNode,bind:e.domNode,class:_.contentContainer,key:`content__node`}):null}_overwriteChildScheduleRender(e){let t=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(n(()=>e.scheduleRender=t),b)}_attachToNode(e){let t=this;e.appendChild(t)}};e([o({readOnly:!0})],x.prototype,`expandTitle`,null),e([o()],x.prototype,`_toggleActionEl`,void 0),e([o()],x.prototype,`_displaySheet`,null),e([o()],x.prototype,`autoCollapse`,null),e([o()],x.prototype,`closeOnEsc`,void 0),e([o()],x.prototype,`collapseIcon`,null),e([o()],x.prototype,`collapseTooltip`,void 0),e([o()],x.prototype,`content`,void 0),e([o()],x.prototype,`expanded`,null),e([o()],x.prototype,`expandIcon`,null),e([o()],x.prototype,`expandTooltip`,void 0),e([o()],x.prototype,`focusTrapDisabled`,void 0),e([o()],x.prototype,`group`,null),e([o()],x.prototype,`icon`,null),e([o()],x.prototype,`iconNumber`,void 0),e([o()],x.prototype,`label`,null),e([o(),f(`esri/widgets/Expand/t9n/Expand`)],x.prototype,`messages`,void 0),e([o(),f(`esri/t9n/common`)],x.prototype,`messagesCommon`,void 0),e([o()],x.prototype,`mode`,void 0),e([o()],x.prototype,`placement`,void 0),e([o()],x.prototype,`view`,null),e([o({type:l})],x.prototype,`viewModel`,void 0),x=e([s(`esri.widgets.Expand`)],x);const S=x;export{S as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{prefersReducedMotion as n}from"../../core/a11yUtils.js";import{watch as r,initial as i}from"../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../core/accessorSupport/decorators.js";import{shouldOpenInNewTab as s}from"../../popup/support/featureUtils.js";import{getColorsFromRenderer as c}from"../../renderers/support/utils.js";import{isDarkMode as l}from"../../support/modeUtils.js";import u from"../Widget.js";import d from"./FeatureMedia/FeatureMediaViewModel.js";import f from"./support/FeatureElementInfo.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import{tsx as m,isRTL as h,messageBundle as g}from"../support/widget.js";const _=`esri-feature-media`,v={base:_,mediaContainer:`${_}__container`,mediaItemContainer:`${_}__item-container`,mediaItem:`${_}__item`,mediaItemText:`${_}__item-text`,mediaItemTitle:`${_}__item-title`,mediaItemCaption:`${_}__item-caption`,mediaNavigation:`${_}__item-navigation`,mediaPagination:`${_}__pagination`,mediaPaginationText:`${_}__pagination-text`,mediaChart:`${_}__chart`,mediaPaginationButton:`${_}__pagination-button`,mediaPaginationIcon:`${_}__pagination-icon`,mediaChartRendered:`${_}__chart--rendered`},y=`category`,b=`value`;let x=class extends u{constructor(e){super(e),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new d,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{let{destroyed:t,viewModel:n}=this;if(t||!n||!e)return;let{createRoot:r}=await import(`../support/chartUtilsAm5.js`),i=await r(e);this._chartRootMap.set(e,i),await this._renderChart({mediaInfo:n.activeMediaInfo,root:i})}}initialize(){this._featureElementInfo=new f,this.addHandles([r(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),i),r(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),i)])}loadDependencies(){return p({icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return m(`div`,{bind:this,class:v.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){let{formattedMediaInfoCount:e,activeMediaInfoIndex:n}=this.viewModel,r=this._renderMediaText();return e?m(`div`,{class:v.mediaContainer,key:`media-element-container`},this._renderMediaInfo(),m(`div`,{class:v.mediaNavigation},r,e>1?m(`div`,{class:v.mediaPagination},this._renderMediaPageButton(`previous`),m(`span`,{class:v.mediaPaginationText},t(this.messages.pageText,{index:n+1,total:e})),this._renderMediaPageButton(`next`)):null)):null}_renderMediaText(){let{activeMediaInfo:e}=this.viewModel;if(!e)return null;let t=e&&e.title?m(`div`,{class:v.mediaItemTitle,innerHTML:e.title,key:`media-title`}):null,n=e&&e.caption?m(`div`,{class:v.mediaItemCaption,innerHTML:e.caption,key:`media-caption`}):null;return t||n?m(`div`,{class:v.mediaItemText,key:`media-text`},t,n):null}_renderImageMediaInfo(e){if(!e.value)return null;let{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:n,formattedMediaInfoCount:r}=this.viewModel,{value:i,refreshInterval:a,altText:o,title:c,type:l}=e,{sourceURL:u,linkURL:d}=i,f=s(d??void 0)?`_blank`:`_self`,p=f===`_blank`?`noreferrer`:``,h=a?t:null,g=h?h.timestamp:0,_=h?h.sourceURL:u,v=m(`img`,{alt:o||c,key:`media-${l}-${n}-${r}-${g}`,src:_??void 0});return(d?m(`a`,{href:d,rel:p,target:f,title:c},v):null)??v}_renderChartMediaInfo(e){let{activeMediaInfoIndex:t,formattedMediaInfoCount:n}=this.viewModel;return m(`div`,{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:v.mediaChart,key:`media-${e.type}-${t}-${n}`})}_renderMediaInfoType(){let{activeMediaInfo:e}=this.viewModel;return e?e.type===`image`?this._renderImageMediaInfo(e):e.type.includes(`chart`)?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){let{activeMediaInfo:e}=this.viewModel;return e?m(`div`,{class:v.mediaItemContainer,key:`media-container`},m(`div`,{class:v.mediaItem,key:`media-item-container`},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;let t=e===`previous`,n=t?this.messages.previous:this.messages.next,r=t?`chevron-left`:`chevron-right`,i=t?`media-previous`:`media-next`,a=t?this._previous:this._next;return m(`button`,{"aria-label":n,bind:this,class:v.mediaPaginationButton,key:i,tabIndex:0,title:n,type:`button`,onclick:a},m(`calcite-icon`,{class:v.mediaPaginationIcon,icon:r,scale:`s`}))}_setupFeatureElementInfo(){let{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;let{graphic:e,layer:t}=this.viewModel;return e?.isAggregate&&t?.featureReduction&&`renderer`in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){let{colorAm5:t}=await import(`./FeatureMedia/chartCommon.js`),n=new Map;return e.forEach(e=>{e.color&&n.set(e,t(e.color.toCss(!0)))}),n}async _getRendererColors(){let{colorAm5:e}=await import(`./FeatureMedia/chartCommon.js`),t=new Map,n=this._getRenderer();if(!n)return t;let r=await c(n);return r.delete(`default`),Array.from(r.values()).every(e=>e?.length===1)&&Array.from(r.keys()).forEach(n=>{let i=r.get(n)?.[0]?.toCss(!0);i&&t.set(n,e(i))}),t}_handleMediaKeyup(e){let{key:t}=e;t===`ArrowLeft`&&(e.stopPropagation(),this.viewModel.previous()),t===`ArrowRight`&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return this.viewModel?!!this.viewModel.abilities.chartAnimation&&!n():!1}_getChartAnimationMS(){return this._canAnimateChart()?250:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?500:0}async _renderChart(e){let{root:t,mediaInfo:n}=e,{value:r,type:i}=n,{ResponsiveThemeAm5:a,DarkThemeAm5:o,AnimatedThemeAm5:s,ColorSetAm5:c,ThemeAm5:u,esriChartColorSet:d}=await import(`./FeatureMedia/chartCommon.js`),f=u.new(t);f.rule(`ColorSet`).set(`colors`,d),f.rule(`ColorSet`).set(`reuse`,!0);let p=[a.new(t),f];l(this.container)&&p.push(o.new(t)),this._canAnimateChart()&&p.push(s.new(t)),t.setThemes(p);let m=await this._getRendererColors(),h=await this._getSeriesColors(r.series),g=c.new(t,{}),_=h.get(r.series[0]),v=_?{lineSettings:{stroke:_}}:void 0,x=r.series.map((e,t)=>{let n=h.get(e)||m.get(e.fieldName)||g.getIndex(t);return{[y]:e.tooltip,[b]:e.value,columnSettings:{fill:n,stroke:n},...v}}).filter(e=>i!==`pie-chart`||e.value!=null&&e.value>0);await(i===`pie-chart`?this._createPieChart(e,x):this._createXYChart(e,x))}_getDirection(){return h(this.container)?`rtl`:`ltr`}async _customizeChartTooltip(e,t=`horizontal`){let{colorAm5:n}=await import(`./FeatureMedia/chartCommon.js`);e.setAll({pointerOrientation:t}),e.get(`background`)?.setAll({stroke:n(`rgba(50, 50, 50, 1)`)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:`wrap`,maxWidth:200})}async _createPieChart(e,t){let{TooltipAm5:n}=await import(`./FeatureMedia/chartCommon.js`),{PieChartAm5:r,PieSeriesAm5:i}=await import(`./FeatureMedia/pieChart.js`),{mediaInfo:a,root:o}=e,{title:s}=a,c=a?.altText||a?.title||``,l=o.container.children.push(r.new(o,{ariaLabel:c,focusable:!0,paddingBottom:5,paddingTop:5,paddingLeft:5,paddingRight:5})),u=`{category}: {valuePercentTotal.formatNumber('0.00')}%
|
|
3
|
-
({value})`,d=n.new(o,{labelText:u}),f=l.series.push(i.new(o,{name:s,valueField:b,categoryField:y,tooltip:d}));f.ticks.template.set(`forceHidden`,!0),f.labels.template.set(`forceHidden`,!0),f.slices.template.states.create(`active`,{shiftRadius:5}),await this._customizeChartTooltip(d),f.slices.template.setAll({ariaLabel:u,focusable:!0,templateField:`columnSettings`}),f.data.setAll(t),await f.appear(this._getChartSeriesAnimationMS()),await l.appear(this._getChartAnimationMS()),l.root.dom.classList.toggle(v.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,ColumnSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{mediaInfo:u,root:d}=t,{value:f,title:p}=u;e.setAll({wheelX:`panX`,wheelY:`zoomX`});let m=e.xAxes.push(a.new(d,{renderer:o.new(d,{inversed:h(this.container)}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.yAxes.push(s.new(d,{renderer:c.new(d,{inside:!1}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=`{categoryX}`,v=r.new(d,{labelText:_}),x=e.series.push(l.new(d,{name:p,xAxis:m,yAxis:g,valueYField:b,categoryXField:y,tooltip:v}));await this._customizeChartTooltip(v),x.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:`columnSettings`}),f.series.length>15&&e.set(`scrollbarX`,i.new(d,{orientation:`horizontal`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,ColumnSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{mediaInfo:u,root:d}=t,{value:f,title:p}=u;e.setAll({wheelX:`panY`,wheelY:`zoomY`});let m=e.yAxes.push(a.new(d,{renderer:c.new(d,{inversed:!0}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.xAxes.push(s.new(d,{renderer:o.new(d,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=`{categoryY}`,v=r.new(d,{labelText:_}),x=e.series.push(l.new(d,{name:p,xAxis:g,yAxis:m,valueXField:b,categoryYField:y,tooltip:v}));await this._customizeChartTooltip(v,`vertical`),x.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:`columnSettings`}),f.series.length>15&&e.set(`scrollbarY`,i.new(d,{orientation:`vertical`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,LineSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{root:u,mediaInfo:d}=t,{value:f,title:p}=d;e.setAll({wheelX:`panX`,wheelY:`zoomX`});let m=e.xAxes.push(a.new(u,{renderer:o.new(u,{inversed:h(this.container)}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.yAxes.push(s.new(u,{renderer:c.new(u,{inside:!1}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=n[0]?.lineSettings?.stroke,v=r.new(u,{getFillFromSprite:!_,labelText:`{categoryX}`});_&&v.get(`background`)?.setAll({fill:_});let x=e.series.push(l.new(u,{name:p,xAxis:m,yAxis:g,valueYField:b,categoryXField:y,tooltip:v}));x.strokes.template.setAll({templateField:`lineSettings`}),await this._customizeChartTooltip(v,`vertical`),f.series.length>15&&e.set(`scrollbarX`,i.new(u,{orientation:`horizontal`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){let{XYChartAm5:n,XYCursorAm5:r}=await import(`./FeatureMedia/xyChart.js`),{root:i,mediaInfo:a}=e,{type:o}=a,s=a?.altText||a?.title||``,c=i.container.children.push(n.new(i,{ariaLabel:s,focusable:!0,panX:!0,panY:!0}));c.set(`cursor`,r.new(i,{})),o===`column-chart`&&await this._createColumnChart(c,e,t),o===`bar-chart`&&await this._createBarChart(c,e,t),o===`line-chart`&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(v.mediaChartRendered,!0)}_clearMediaRefreshTimer(){let{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){let t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();let{activeMediaInfo:e}=this.viewModel;e?.type===`image`&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){let{refreshInterval:t,value:n}=e,r=t*6e4;this._updateMediaInfoTimestamp(n.sourceURL);let i=setInterval(()=>{this._updateMediaInfoTimestamp(n.sourceURL)},r);this._refreshTimer=i}_getImageSource(e,t){let n=e.includes(`?`)?`&`:`?`,[r,i=``]=e.split(
|
|
3
|
+
({value})`,d=n.new(o,{labelText:u}),f=l.series.push(i.new(o,{name:s,valueField:b,categoryField:y,tooltip:d}));f.ticks.template.set(`forceHidden`,!0),f.labels.template.set(`forceHidden`,!0),f.slices.template.states.create(`active`,{shiftRadius:5}),await this._customizeChartTooltip(d),f.slices.template.setAll({ariaLabel:u,focusable:!0,templateField:`columnSettings`}),f.data.setAll(t),await f.appear(this._getChartSeriesAnimationMS()),await l.appear(this._getChartAnimationMS()),l.root.dom.classList.toggle(v.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,ColumnSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{mediaInfo:u,root:d}=t,{value:f,title:p}=u;e.setAll({wheelX:`panX`,wheelY:`zoomX`});let m=e.xAxes.push(a.new(d,{renderer:o.new(d,{inversed:h(this.container)}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.yAxes.push(s.new(d,{renderer:c.new(d,{inside:!1}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=`{categoryX}`,v=r.new(d,{labelText:_}),x=e.series.push(l.new(d,{name:p,xAxis:m,yAxis:g,valueYField:b,categoryXField:y,tooltip:v}));await this._customizeChartTooltip(v),x.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:`columnSettings`}),f.series.length>15&&e.set(`scrollbarX`,i.new(d,{orientation:`horizontal`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,ColumnSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{mediaInfo:u,root:d}=t,{value:f,title:p}=u;e.setAll({wheelX:`panY`,wheelY:`zoomY`});let m=e.yAxes.push(a.new(d,{renderer:c.new(d,{inversed:!0}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.xAxes.push(s.new(d,{renderer:o.new(d,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=`{categoryY}`,v=r.new(d,{labelText:_}),x=e.series.push(l.new(d,{name:p,xAxis:g,yAxis:m,valueXField:b,categoryYField:y,tooltip:v}));await this._customizeChartTooltip(v,`vertical`),x.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:`columnSettings`}),f.series.length>15&&e.set(`scrollbarY`,i.new(d,{orientation:`vertical`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,n){let{TooltipAm5:r,ScrollbarAm5:i}=await import(`./FeatureMedia/chartCommon.js`),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:s,AxisRendererYAm5:c,LineSeriesAm5:l}=await import(`./FeatureMedia/xyChart.js`),{root:u,mediaInfo:d}=t,{value:f,title:p}=d;e.setAll({wheelX:`panX`,wheelY:`zoomX`});let m=e.xAxes.push(a.new(u,{renderer:o.new(u,{inversed:h(this.container)}),categoryField:y}));m.get(`renderer`).labels.template.setAll({forceHidden:!0});let g=e.yAxes.push(s.new(u,{renderer:c.new(u,{inside:!1}),min:this._getMinSeriesValue(f.series)}));g.get(`renderer`).labels.template.setAll({direction:this._getDirection()});let _=n[0]?.lineSettings?.stroke,v=r.new(u,{getFillFromSprite:!_,labelText:`{categoryX}`});_&&v.get(`background`)?.setAll({fill:_});let x=e.series.push(l.new(u,{name:p,xAxis:m,yAxis:g,valueYField:b,categoryXField:y,tooltip:v}));x.strokes.template.setAll({templateField:`lineSettings`}),await this._customizeChartTooltip(v,`vertical`),f.series.length>15&&e.set(`scrollbarX`,i.new(u,{orientation:`horizontal`})),m.data.setAll(n),x.data.setAll(n),await x.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){let{XYChartAm5:n,XYCursorAm5:r}=await import(`./FeatureMedia/xyChart.js`),{root:i,mediaInfo:a}=e,{type:o}=a,s=a?.altText||a?.title||``,c=i.container.children.push(n.new(i,{ariaLabel:s,focusable:!0,panX:!0,panY:!0}));c.set(`cursor`,r.new(i,{})),o===`column-chart`&&await this._createColumnChart(c,e,t),o===`bar-chart`&&await this._createBarChart(c,e,t),o===`line-chart`&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(v.mediaChartRendered,!0)}_clearMediaRefreshTimer(){let{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){let t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();let{activeMediaInfo:e}=this.viewModel;e?.type===`image`&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){let{refreshInterval:t,value:n}=e,r=t*6e4;this._updateMediaInfoTimestamp(n.sourceURL);let i=setInterval(()=>{this._updateMediaInfoTimestamp(n.sourceURL)},r);this._refreshTimer=i}_getImageSource(e,t){let n=e.includes(`?`)?`&`:`?`,[r,i=``]=e.split(`#`,2);return`${r}${n}timestamp=${t}${i?`#`:``}${i}`}};e([a()],x.prototype,`_refreshIntervalInfo`,void 0),e([a()],x.prototype,`attributes`,null),e([a()],x.prototype,`activeMediaInfoIndex`,null),e([a()],x.prototype,`description`,null),e([a()],x.prototype,`fieldInfoMap`,null),e([a()],x.prototype,`layer`,null),e([a()],x.prototype,`mediaInfos`,null),e([a()],x.prototype,`popupTemplate`,null),e([a()],x.prototype,`relatedInfos`,null),e([a()],x.prototype,`title`,null),e([a({type:d})],x.prototype,`viewModel`,void 0),e([a(),g(`esri/widgets/Feature/t9n/Feature`)],x.prototype,`messages`,void 0),x=e([o(`esri.widgets.Feature.FeatureMedia`)],x);export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{deprecatedModule as s}from"../../core/deprecate.js";import{IdentifiableMixin as c}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as u}from"../../core/maybe.js";import{eachAlways as d,isAbortError as f,throwIfAborted as p}from"../../core/promiseUtils.js";import{watch as m,initial as h,when as ee,on as g}from"../../core/reactiveUtils.js";import{throttle as _}from"../../core/throttle.js";import{property as v,cast as y,subclass as b}from"../../core/accessorSupport/decorators.js";import x from"../../geometry/Point.js";import S from"../../geometry/SpatialReference.js";import C from"../../popup/content/TextContent.js";import{compileExpressionInfos as w,formatArcadeValue as te}from"../../popup/support/arcadeFeatureUtils.js";import{preLayerQueryCallback as ne,preRequestCallback as re,createFieldInfoMap as ie,getAllFieldInfos as T,getSourceLayer as E,querySourceLayer as D,queryUpdatedFeature as O,isRelatableFeatureSupportedLayer as k,isAssociatedFeatureSupportedLayer as A,substituteFieldsInLinksAndAttributes as j,isExpressionField as M,isRelatedField as N,formatEditInfo as P,graphicCallback as F,formatAttributes as I}from"../../popup/support/featureUtils.js";import{queryLayerInfos as L,queryRelatedFeatures as R,setRelatedFeatures as z,getRelatedFieldInfo as B,createRelatedInfo as V,updateRelatedInfo as H}from"../../popup/support/relatedFeatureUtils.js";import{system as U}from"../../time/constants.js";import W from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import G from"./FeatureContent/FeatureContentViewModel.js";import K from"./FeatureExpression/FeatureExpressionViewModel.js";import q from"./FeatureFields/FeatureFieldsViewModel.js";import J from"./FeatureMedia/FeatureMediaViewModel.js";import ae from"./FeatureRelationship/FeatureRelationshipViewModel.js";import oe from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var Y;const X=`content-view-models`,Z=`relationship-view-models`,Q={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let $=class extends c(r){static{Y=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...Q},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title=``,this.view=null,this._graphicChangedThrottled=_(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=_(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),e?.suppressDeprecationWarning||s(l.getLogger(this),`esri.widgets.Feature.FeatureViewModel`,{version:`5.2`,replacement:`Use the Feature (Next) component or the @arcgis/core/popup/FeatureModel module instead.`,warnOnce:!0}),this.addHandles([m(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),h),ee(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=u(this._graphicChangedTask),this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new n(ne,re)}get _effectivePopupTemplate(){return this.graphic==null?null:this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)}get _fieldInfoMap(){return ie(T(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return E(this.graphic)}castAbilities(e){return{...Q,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??U}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r,_associationVMAbortController:i}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished||!!i}setActiveMedia(e,t){let n=this.contentViewModels[e];n instanceof J&&n.setActiveMedia(t)}nextMedia(e){let t=this.contentViewModels[e];t instanceof J&&t.next()}previousMedia(e){let t=this.contentViewModels[e];t instanceof J&&t.previous()}async updateGeometry(){let{graphic:e,spatialReference:t,_sourceLayer:n}=this;await n?.load();let r=n?.objectIdField;if(!r||!e||!n)return;let i=e?.attributes?.[r];if(i==null)return;let a=[i];if(!e.geometry){let r=(await D({layer:n,graphic:e,outFields:[],objectIds:a,returnGeometry:!0,spatialReference:t}))?.geometry;r&&(e.geometry=r)}}_clear(){this._set(`title`,``),this._set(`content`,null),this._set(`formattedAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._graphicChangedTask=u(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_sourceLayer:n,_effectivePopupTemplate:r}=this,i=this.spatialReference;await O({graphic:t,popupTemplate:r,layer:n,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await d([this._getContent(),this._getTitle()]),[,{value:s}]=await d([this._checkForRelatedFeatures({signal:e}),w(r?.expressionInfos,t)]);return{expressionInfos:s,content:a,title:o}}catch(e){throw f(e)||(this._error=e,l.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e,t){if(e.type===`attachments`)return this._compileAttachments(e,t);if(e.type===`custom`)return this._compileCustom(e,t);if(e.type===`fields`)return this._compileFields(e,t);if(e.type===`media`)return this._compileMedia(e,t);if(e.type===`text`)return this._compileText(e,t);if(e.type===`expression`)return this._compileExpression(e,t);if(e.type===`relationship`)return this._compileRelationship(e,t);if(e.type===`utility-network-associations`)return this._compileUtilityNetworkAssociation(e,t)}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(i):typeof e==`string`?this._compileText(new C({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(Z),this.removeHandles(X),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`contentViewModels`,[])}_matchesFeature(e,t){let n=e?.graphic?.getObjectId(),r=t?.getObjectId();return n!=null&&r!=null&&n===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:n}){let{view:r,spatialReference:i,timeZone:a}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new Y({abilities:{relationshipContent:!1},map:n,view:r,spatialReference:i,timeZone:a,graphic:t,suppressDeprecationWarning:!0}))}),e.forEach(n=>{t?.find(e=>this._matchesFeature(n,e))||e.remove(n)})}_setExpressionContentVM(e,t){let n=this.formattedAttributes,{contentElement:r,contentElementViewModel:i}=e,a=r?.type;i&&a&&(a===`fields`&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:t,formattedAttributes:n}),i.set(this._createFieldsVMParams(r,t))),a===`media`&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:t,formattedAttributes:n}),i.set(this._createMediaVMParams(r,t))),a===`text`&&i.set(this._createTextVMParams(r)))}_compileRelationship(e,t){let{displayCount:n,orderByFields:r,relationshipId:i,title:a,description:o}=e,{_sourceLayer:s,graphic:c,map:l}=this;if(!k(s))return;let u=new ae({displayCount:n,graphic:c,orderByFields:r,relationshipId:i,layer:s,map:l,...this._compileTitleAndDesc({title:a,description:o})});return this.contentViewModels[t]=u,this.addHandles(g(()=>u.relatedFeatures,`change`,()=>this._setRelatedFeaturesViewModels(u)),Z),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,n){let{view:r,spatialReference:i,timeZone:a}=this;e.forEach((n,r)=>{let i=t.get(r);i?n.forEach(t=>{i.find(e=>this._matchesGlobalFeature(t,e))||(n.remove(t),n.length===0&&e.delete(r))}):(n.removeAll(),e.delete(r))}),t.forEach((t,s)=>{let c=e.get(s)||new o;t?.filter(Boolean).forEach((e,t)=>{if(!c.some(t=>this._matchesGlobalFeature(t,e))){let{association:o,feature:s,terminalName:l,title:u}=e;c.add({title:u,association:o,featureViewModel:new Y({abilities:{utilityNetworkAssociationsContent:!1},map:n,view:r,spatialReference:i,timeZone:a,graphic:s,suppressDeprecationWarning:!0}),terminalName:l},t)}}),e.set(s,c)})}_compileUtilityNetworkAssociation(e,t){let{displayCount:n,title:r,description:i,associationTypes:a}=e,{_sourceLayer:o,graphic:s,map:c}=this;if(!A(o))return;let l=new oe({graphic:s,displayCount:n,associationTypes:a,layer:o,map:c,...this._compileTitleAndDesc({title:r,description:i})});return this.contentViewModels[t]=l,this.addHandles([m(()=>l.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(l.associationViewModels,l.associationFeatures,l.map))],`association-view-models`),e}_compileExpression(e,t){let{expressionInfo:n}=e,{graphic:r,map:i,spatialReference:a,view:o,location:s}=this,c=new K({expressionInfo:n,graphic:r,interceptor:Y.interceptor,map:i,spatialReference:a,view:o,location:s});return this.contentViewModels[t]=c,this.addHandles(m(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),h),X),e}_compileAttachments(e,t){let{graphic:n}=this,{description:r,title:i,orderByFields:a,attachmentKeywords:o,attachmentTypes:s}=e;return this.contentViewModels[t]=new W({attachmentKeywords:o,attachmentTypes:s,graphic:n,orderByFields:a,...this._compileTitleAndDesc({title:i,description:r})}),e}_compileCustom(e,t){let{graphic:n}=this,{creator:r,destroyer:i}=e;return this.contentViewModels[t]=new G({graphic:n,creator:r,destroyer:i}),e}_compileTitleAndDesc({title:e,description:t}){let{_fieldInfoMap:n,_sourceLayer:r,graphic:i,formattedAttributes:a}=this,o=i?.attributes,s=this._expressionAttributes,c=a.global;return{title:j({attributes:o,fieldInfoMap:n,globalAttributes:c,expressionAttributes:s,layer:r,text:e}),description:j({attributes:o,fieldInfoMap:n,globalAttributes:c,expressionAttributes:s,layer:r,text:t})}}_createFieldsVMParams(e,t){let n=this._effectivePopupTemplate,r=this.formattedAttributes,i={...r?.global,...r?.content[t]},a=!!e?.fieldInfos,o=(e?.fieldInfos||n?.fieldInfos)?.filter(({fieldName:e})=>!!e&&(M(e)||N(e)||i.hasOwnProperty(e))),s=n?.expressionInfos,{description:c,title:l}=e;return{attributes:i,expressionInfos:s,fieldInfos:o,isContentFieldInfos:a,graphic:this.graphic,layer:this._sourceLayer,...this._compileTitleAndDesc({title:l,description:c})}}_compileFields(e,t){let n=e.clone(),r=new q(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=r,n.fieldInfos=r.formattedFieldInfos.slice(),n}_createMediaVMParams(e,t){let{abilities:n,graphic:r,_fieldInfoMap:i,_effectivePopupTemplate:a,relatedInfos:o,_sourceLayer:s,_expressionAttributes:c}=this,l=this.formattedAttributes,u=r?.attributes??{},{description:d,mediaInfos:f,title:p}=e;return{abilities:{chartAnimation:n.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:u,graphic:r,layer:s,fieldInfoMap:i,formattedAttributes:{...l?.global,...l?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:a,relatedInfos:o,...this._compileTitleAndDesc({title:p,description:d})}}_compileMedia(e,t){let n=e.clone(),r=new J(this._createMediaVMParams(e,t));return n.mediaInfos=r.formattedMediaInfos.slice(),this.contentViewModels[t]=r,n}_createTextVMParams(e){let{graphic:t,_fieldInfoMap:n,_sourceLayer:r,_expressionAttributes:i}=this;if(e&&e.text){let a=t?.attributes??{},o=this.formattedAttributes?.global??{};e.text=j({attributes:a,fieldInfoMap:n,globalAttributes:o,expressionAttributes:i,layer:r,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){let n=e.clone();return this.contentViewModels[t]=new G(this._createTextVMParams(n)),n}_compileLastEditInfo(){let{_effectivePopupTemplate:e,_sourceLayer:t,graphic:n,timeZone:r}=this;if(!e)return;let{lastEditInfoEnabled:i}=e,a=t?.editFieldsInfo;if(i&&a)return P(a,n?.attributes,r,t)}_compileTitle(e){let{_fieldInfoMap:t,_sourceLayer:n,graphic:r,_expressionAttributes:i}=this,a=r?.attributes??{},o=this.formattedAttributes?.global??{};return j({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:i,layer:n,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:s,location:c}=this;try{if(!i)return;let l;if(n!=null){let e=[];for(let[t,l]of n.expressions.entries())l==null?e.push(Promise.resolve([t,void 0])):e.push(l.evaluate({graphic:i,interceptor:Y.interceptor,location:c,map:a,options:{signal:r},spatialReference:s,view:o}).then(e=>[t,typeof e==`string`?te(e):e]).catch(()=>[t,void 0]));l=Object.fromEntries(await Promise.all(e)),p(r)}this._expressionAttributes=l,this._graphicExpressionAttributes={...i.attributes,...l},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`title`,this._compileTitle(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){f(e)||(this._error=e,l.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_sourceLayer:o,_fieldInfoMap:s,_graphicExpressionAttributes:c,timeZone:l}=this;n.content[t]=I({attributes:{...c,...e.attributes},fieldInfoMap:s,fieldInfos:r?.fieldInfos,graphic:i,layer:o,relatedInfos:a,timeZone:l})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_sourceLayer:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this;n.content[t]=I({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:a,relatedInfos:i,timeZone:c})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_sourceLayer:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=t?.fieldInfos,l={global:I({attributes:o,fieldInfoMap:a,fieldInfos:c,graphic:n,layer:i,relatedInfos:r,timeZone:s}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,T(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r,_sourceLayer:i}=this;r.clear();let a=i?.associatedLayer==null?i:await i?.associatedLayer.load(n);if(!a||!e||!t.filter(e=>!!e.fieldName&&N(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await L({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await R({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{z(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=B(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||V(i,t);o&&(H({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([v()],$.prototype,`_error`,void 0),e([v()],$.prototype,`_graphicChangedTask`,void 0),e([v()],$.prototype,`_evaluateExpressionAttributesTask`,void 0),e([v()],$.prototype,`_associationVMAbortController`,void 0),e([v({readOnly:!0})],$.prototype,`_effectivePopupTemplate`,null),e([v({readOnly:!0})],$.prototype,`_fieldInfoMap`,null),e([v({readOnly:!0})],$.prototype,`_sourceLayer`,null),e([v()],$.prototype,`abilities`,void 0),e([y(`abilities`)],$.prototype,`castAbilities`,null),e([v({readOnly:!0})],$.prototype,`content`,void 0),e([v({readOnly:!0})],$.prototype,`contentViewModels`,void 0),e([v()],$.prototype,`description`,void 0),e([v({type:Boolean})],$.prototype,`defaultPopupTemplateEnabled`,void 0),e([v({readOnly:!0})],$.prototype,`isFeatureFromTable`,null),e([v({readOnly:!0})],$.prototype,`state`,null),e([v({readOnly:!0})],$.prototype,`formattedAttributes`,void 0),e([v({type:t})],$.prototype,`graphic`,void 0),e([v({readOnly:!0})],$.prototype,`lastEditInfo`,void 0),e([v({type:x})],$.prototype,`location`,void 0),e([v({readOnly:!0})],$.prototype,`relatedInfos`,void 0),e([v({type:S})],$.prototype,`spatialReference`,null),e([v()],$.prototype,`timeZone`,null),e([v({readOnly:!0})],$.prototype,`title`,void 0),e([v()],$.prototype,`map`,null),e([v({readOnly:!0})],$.prototype,`waitingForContent`,null),e([v()],$.prototype,`view`,void 0),$=Y=e([b(`esri.widgets.Feature.FeatureViewModel`)],$);export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as n}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{deprecatedModule as s}from"../../core/deprecate.js";import{IdentifiableMixin as c}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as u}from"../../core/maybe.js";import{eachAlways as d,isAbortError as f,throwIfAborted as p}from"../../core/promiseUtils.js";import{watch as m,initial as h,when as ee,on as g}from"../../core/reactiveUtils.js";import{throttle as _}from"../../core/throttle.js";import{property as v,cast as y,subclass as b}from"../../core/accessorSupport/decorators.js";import x from"../../geometry/Point.js";import S from"../../geometry/SpatialReference.js";import C from"../../popup/content/TextContent.js";import{compileExpressionInfos as w,formatArcadeValue as te}from"../../popup/support/arcadeFeatureUtils.js";import{preLayerQueryCallback as ne,preRequestCallback as re,createFieldInfoMap as ie,getAllFieldInfos as T,getSourceLayer as E,querySourceLayer as D,queryUpdatedFeature as O,isRelatableFeatureSupportedLayer as k,isAssociatedFeatureSupportedLayer as A,substituteFieldsInLinksAndAttributes as j,isExpressionField as M,isRelatedField as N,formatEditInfo as P,graphicCallback as F,formatAttributes as I}from"../../popup/support/featureUtils.js";import{queryLayerInfos as L,queryRelatedFeatures as R,setRelatedFeatures as z,getRelatedFieldInfo as B,createRelatedInfo as V,updateRelatedInfo as H}from"../../popup/support/relatedFeatureUtils.js";import{system as U}from"../../time/constants.js";import W from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import G from"./FeatureContent/FeatureContentViewModel.js";import K from"./FeatureExpression/FeatureExpressionViewModel.js";import q from"./FeatureFields/FeatureFieldsViewModel.js";import J from"./FeatureMedia/FeatureMediaViewModel.js";import ae from"./FeatureRelationship/FeatureRelationshipViewModel.js";import oe from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var Y;const X=`content-view-models`,Z=`relationship-view-models`,Q={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let $=class extends c(r){static{Y=this}constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...Q},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title=``,this.view=null,this._graphicChangedThrottled=_(this._graphicChanged,()=>this.notifyChange(`waitingForContent`),1,this),this._isAllowedContentType=e=>{let{abilities:t}=this;return e.type===`attachments`&&!!t.attachmentsContent||e.type===`custom`&&!!t.customContent||e.type===`fields`&&!!t.fieldsContent||e.type===`media`&&!!t.mediaContent||e.type===`text`&&!!t.textContent||e.type===`expression`&&!!t.expressionContent||e.type===`relationship`&&!!t.relationshipContent||e.type===`utility-network-associations`&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=_(this._evaluateExpressionAttributes,()=>this.notifyChange(`waitingForContent`),1,this),t||s(l.getLogger(this),`esri.widgets.Feature.FeatureViewModel`,{version:`5.2`,replacement:`Use the Feature (Next) component or the @arcgis/core/popup/FeatureModel module instead.`,warnOnce:!0}),this.addHandles([m(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),h),ee(()=>{if(!this._graphicChangedTask?.finished||this._graphicChangedTask.value==null)return null;let e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has(`view-scale`)?this.view?.scale:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.start:null,t?.has(`view-time-extent`)?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=u(this._graphicChangedTask),this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new n(ne,re)}get _effectivePopupTemplate(){return this.graphic==null?null:this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)}get _fieldInfoMap(){return ie(T(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return E(this.graphic)}castAbilities(e){return{...Q,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?`error`:this.waitingForContent?`loading`:`ready`:`disabled`}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get timeZone(){return this.view?.timeZone??U}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get map(){return this.view?.map||null}set map(e){this._override(`map`,e)}get waitingForContent(){let{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:n,_evaluateExpressionAttributesTask:r,_associationVMAbortController:i}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||n!=null&&!n.finished||r!=null&&!r.finished||!!i}setActiveMedia(e,t){let n=this.contentViewModels[e];n instanceof J&&n.setActiveMedia(t)}nextMedia(e){let t=this.contentViewModels[e];t instanceof J&&t.next()}previousMedia(e){let t=this.contentViewModels[e];t instanceof J&&t.previous()}async updateGeometry(){let{graphic:e,spatialReference:t,_sourceLayer:n}=this;await n?.load();let r=n?.objectIdField;if(!r||!e||!n)return;let i=e?.attributes?.[r];if(i==null)return;let a=[i];if(!e.geometry){let r=(await D({layer:n,graphic:e,outFields:[],objectIds:a,returnGeometry:!0,spatialReference:t}))?.geometry;r&&(e.geometry=r)}}_clear(){this._set(`title`,``),this._set(`content`,null),this._set(`formattedAttributes`,null)}_graphicChanged(){this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._graphicChangedTask=u(this._graphicChangedTask),this._graphicChangedTask=a(async e=>{this._error=null,this._clear();let{graphic:t}=this;try{if(!t)return null;let{_sourceLayer:n,_effectivePopupTemplate:r}=this,i=this.spatialReference;await O({graphic:t,popupTemplate:r,layer:n,spatialReference:i},{signal:e});let[{value:a},{value:o}]=await d([this._getContent(),this._getTitle()]),[,{value:s}]=await d([this._checkForRelatedFeatures({signal:e}),w(r?.expressionInfos,t)]);return{expressionInfos:s,content:a,title:o}}catch(e){throw f(e)||(this._error=e,l.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:t,popupTemplate:this._effectivePopupTemplate})),e}})}_compileContentElement(e,t){if(e.type===`attachments`)return this._compileAttachments(e,t);if(e.type===`custom`)return this._compileCustom(e,t);if(e.type===`fields`)return this._compileFields(e,t);if(e.type===`media`)return this._compileMedia(e,t);if(e.type===`text`)return this._compileText(e,t);if(e.type===`expression`)return this._compileExpression(e,t);if(e.type===`relationship`)return this._compileRelationship(e,t);if(e.type===`utility-network-associations`)return this._compileUtilityNetworkAssociation(e,t)}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(i):typeof e==`string`?this._compileText(new C({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(Z),this.removeHandles(X),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`contentViewModels`,[])}_matchesFeature(e,t){let n=e?.graphic?.getObjectId(),r=t?.getObjectId();return n!=null&&r!=null&&n===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:n}){let{view:r,spatialReference:i,timeZone:a}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new Y({abilities:{relationshipContent:!1},map:n,view:r,spatialReference:i,timeZone:a,graphic:t,suppressDeprecationWarning:!0}))}),e.forEach(n=>{t?.find(e=>this._matchesFeature(n,e))||e.remove(n)})}_setExpressionContentVM(e,t){let n=this.formattedAttributes,{contentElement:r,contentElementViewModel:i}=e,a=r?.type;i&&a&&(a===`fields`&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:t,formattedAttributes:n}),i.set(this._createFieldsVMParams(r,t))),a===`media`&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:t,formattedAttributes:n}),i.set(this._createMediaVMParams(r,t))),a===`text`&&i.set(this._createTextVMParams(r)))}_compileRelationship(e,t){let{displayCount:n,orderByFields:r,relationshipId:i,title:a,description:o}=e,{_sourceLayer:s,graphic:c,map:l}=this;if(!k(s))return;let u=new ae({displayCount:n,graphic:c,orderByFields:r,relationshipId:i,layer:s,map:l,...this._compileTitleAndDesc({title:a,description:o})});return this.contentViewModels[t]=u,this.addHandles(g(()=>u.relatedFeatures,`change`,()=>this._setRelatedFeaturesViewModels(u)),Z),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,n){let{view:r,spatialReference:i,timeZone:a}=this;e.forEach((n,r)=>{let i=t.get(r);i?n.forEach(t=>{i.find(e=>this._matchesGlobalFeature(t,e))||(n.remove(t),n.length===0&&e.delete(r))}):(n.removeAll(),e.delete(r))}),t.forEach((t,s)=>{let c=e.get(s)||new o;t?.filter(Boolean).forEach((e,t)=>{if(!c.some(t=>this._matchesGlobalFeature(t,e))){let{association:o,feature:s,terminalName:l,title:u}=e;c.add({title:u,association:o,featureViewModel:new Y({abilities:{utilityNetworkAssociationsContent:!1},map:n,view:r,spatialReference:i,timeZone:a,graphic:s,suppressDeprecationWarning:!0}),terminalName:l},t)}}),e.set(s,c)})}_compileUtilityNetworkAssociation(e,t){let{displayCount:n,title:r,description:i,associationTypes:a}=e,{_sourceLayer:o,graphic:s,map:c}=this;if(!A(o))return;let l=new oe({graphic:s,displayCount:n,associationTypes:a,layer:o,map:c,...this._compileTitleAndDesc({title:r,description:i})});return this.contentViewModels[t]=l,this.addHandles([m(()=>l.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(l.associationViewModels,l.associationFeatures,l.map))],`association-view-models`),e}_compileExpression(e,t){let{expressionInfo:n}=e,{graphic:r,map:i,spatialReference:a,view:o,location:s}=this,c=new K({expressionInfo:n,graphic:r,interceptor:Y.interceptor,map:i,spatialReference:a,view:o,location:s});return this.contentViewModels[t]=c,this.addHandles(m(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),h),X),e}_compileAttachments(e,t){let{graphic:n}=this,{description:r,title:i,orderByFields:a,attachmentKeywords:o,attachmentTypes:s}=e;return this.contentViewModels[t]=new W({attachmentKeywords:o,attachmentTypes:s,graphic:n,orderByFields:a,...this._compileTitleAndDesc({title:i,description:r})}),e}_compileCustom(e,t){let{graphic:n}=this,{creator:r,destroyer:i}=e;return this.contentViewModels[t]=new G({graphic:n,creator:r,destroyer:i}),e}_compileTitleAndDesc({title:e,description:t}){let{_fieldInfoMap:n,_sourceLayer:r,graphic:i,formattedAttributes:a}=this,o=i?.attributes,s=this._expressionAttributes,c=a.global;return{title:j({attributes:o,fieldInfoMap:n,globalAttributes:c,expressionAttributes:s,layer:r,text:e}),description:j({attributes:o,fieldInfoMap:n,globalAttributes:c,expressionAttributes:s,layer:r,text:t})}}_createFieldsVMParams(e,t){let n=this._effectivePopupTemplate,r=this.formattedAttributes,i={...r?.global,...r?.content[t]},a=!!e?.fieldInfos,o=(e?.fieldInfos||n?.fieldInfos)?.filter(({fieldName:e})=>!!e&&(M(e)||N(e)||i.hasOwnProperty(e))),s=n?.expressionInfos,{description:c,title:l}=e;return{attributes:i,expressionInfos:s,fieldInfos:o,isContentFieldInfos:a,graphic:this.graphic,layer:this._sourceLayer,...this._compileTitleAndDesc({title:l,description:c})}}_compileFields(e,t){let n=e.clone(),r=new q(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=r,n.fieldInfos=r.formattedFieldInfos.slice(),n}_createMediaVMParams(e,t){let{abilities:n,graphic:r,_fieldInfoMap:i,_effectivePopupTemplate:a,relatedInfos:o,_sourceLayer:s,_expressionAttributes:c}=this,l=this.formattedAttributes,u=r?.attributes??{},{description:d,mediaInfos:f,title:p}=e;return{abilities:{chartAnimation:n.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:u,graphic:r,layer:s,fieldInfoMap:i,formattedAttributes:{...l?.global,...l?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:a,relatedInfos:o,...this._compileTitleAndDesc({title:p,description:d})}}_compileMedia(e,t){let n=e.clone(),r=new J(this._createMediaVMParams(e,t));return n.mediaInfos=r.formattedMediaInfos.slice(),this.contentViewModels[t]=r,n}_createTextVMParams(e){let{graphic:t,_fieldInfoMap:n,_sourceLayer:r,_expressionAttributes:i}=this;if(e&&e.text){let a=t?.attributes??{},o=this.formattedAttributes?.global??{};e.text=j({attributes:a,fieldInfoMap:n,globalAttributes:o,expressionAttributes:i,layer:r,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){let n=e.clone();return this.contentViewModels[t]=new G(this._createTextVMParams(n)),n}_compileLastEditInfo(){let{_effectivePopupTemplate:e,_sourceLayer:t,graphic:n,timeZone:r}=this;if(!e)return;let{lastEditInfoEnabled:i}=e,a=t?.editFieldsInfo;if(i&&a)return P(a,n?.attributes,r,t)}_compileTitle(e){let{_fieldInfoMap:t,_sourceLayer:n,graphic:r,_expressionAttributes:i}=this,a=r?.attributes??{},o=this.formattedAttributes?.global??{};return j({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:i,layer:n,text:e})}async _getTitle(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`title`,value:e?.title,event:{graphic:t}}):null}async _getContent(){let{_effectivePopupTemplate:e,graphic:t}=this;return t?F({type:`content`,value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:n}){this._evaluateExpressionAttributesTask=u(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=a(async r=>{let{graphic:i,map:a,view:o,spatialReference:s,location:c}=this;try{if(!i)return;let l;if(n!=null){let e=[];for(let[t,l]of n.expressions.entries())l==null?e.push(Promise.resolve([t,void 0])):e.push(l.evaluate({graphic:i,interceptor:Y.interceptor,location:c,map:a,options:{signal:r},spatialReference:s,view:o}).then(e=>[t,typeof e==`string`?te(e):e]).catch(()=>[t,void 0]));l=Object.fromEntries(await Promise.all(e)),p(r)}this._expressionAttributes=l,this._graphicExpressionAttributes={...i.attributes,...l},this._set(`formattedAttributes`,this._createFormattedAttributes(t)),this._set(`title`,this._compileTitle(e)),this._set(`lastEditInfo`,this._compileLastEditInfo()||null),this._set(`content`,this._compileContent(t)||null)}catch(e){f(e)||(this._error=e,l.getLogger(this).error(`error`,`The popupTemplate could not be displayed for this feature.`,{error:e,graphic:i,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){let{_effectivePopupTemplate:r,graphic:i,relatedInfos:a,_sourceLayer:o,_fieldInfoMap:s,_graphicExpressionAttributes:c,timeZone:l}=this;n.content[t]=I({attributes:{...c,...e.attributes},fieldInfoMap:s,fieldInfos:r?.fieldInfos,graphic:i,layer:o,relatedInfos:a,timeZone:l})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:n}){if(e.fieldInfos){let{graphic:r,relatedInfos:i,_sourceLayer:a,_fieldInfoMap:o,_graphicExpressionAttributes:s,timeZone:c}=this;n.content[t]=I({attributes:{...s,...e.attributes},fieldInfoMap:o,fieldInfos:e.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:a,relatedInfos:i,timeZone:c})}}_createFormattedAttributes(e){let{_effectivePopupTemplate:t,graphic:n,relatedInfos:r,_sourceLayer:i,_fieldInfoMap:a,_graphicExpressionAttributes:o,timeZone:s}=this,c=t?.fieldInfos,l={global:I({attributes:o,fieldInfoMap:a,fieldInfos:c,graphic:n,layer:i,relatedInfos:r,timeZone:s}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{e.type===`fields`&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l}),e.type===`media`&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){let{graphic:t,_effectivePopupTemplate:n}=this;return this._queryRelatedInfos(t,T(n),e)}async _queryRelatedInfos(e,t,n){let{relatedInfos:r,_sourceLayer:i}=this;r.clear();let a=i?.associatedLayer==null?i:await i?.associatedLayer.load(n);if(!a||!e||!t.filter(e=>!!e.fieldName&&N(e.fieldName))?.length)return;t.forEach(e=>this._configureRelatedInfo(e,a));let o=await L({relatedInfos:r,layer:a},n);Object.keys(o).forEach(e=>{let t=r.get(e.toString()),n=o[e]?.value;t&&n&&(t.layerInfo=n.data)});let s=await R({graphic:e,relatedInfos:r,layer:a},n);Object.keys(s).forEach(e=>{z(s[e]?.value,r.get(e.toString()))})}_configureRelatedInfo(e,t){let{relatedInfos:n}=this,r=B(e.fieldName||``);if(!r)return;let{layerId:i,fieldName:a}=r;if(!i)return;let o=n.get(i.toString())||V(i,t);o&&(H({relatedInfo:o,fieldName:a,fieldInfo:e}),this.relatedInfos.set(i,o))}};e([v()],$.prototype,`_error`,void 0),e([v()],$.prototype,`_graphicChangedTask`,void 0),e([v()],$.prototype,`_evaluateExpressionAttributesTask`,void 0),e([v()],$.prototype,`_associationVMAbortController`,void 0),e([v({readOnly:!0})],$.prototype,`_effectivePopupTemplate`,null),e([v({readOnly:!0})],$.prototype,`_fieldInfoMap`,null),e([v({readOnly:!0})],$.prototype,`_sourceLayer`,null),e([v()],$.prototype,`abilities`,void 0),e([y(`abilities`)],$.prototype,`castAbilities`,null),e([v({readOnly:!0})],$.prototype,`content`,void 0),e([v({readOnly:!0})],$.prototype,`contentViewModels`,void 0),e([v()],$.prototype,`description`,void 0),e([v({type:Boolean})],$.prototype,`defaultPopupTemplateEnabled`,void 0),e([v({readOnly:!0})],$.prototype,`isFeatureFromTable`,null),e([v({readOnly:!0})],$.prototype,`state`,null),e([v({readOnly:!0})],$.prototype,`formattedAttributes`,void 0),e([v({type:t})],$.prototype,`graphic`,void 0),e([v({readOnly:!0})],$.prototype,`lastEditInfo`,void 0),e([v({type:x})],$.prototype,`location`,void 0),e([v({readOnly:!0})],$.prototype,`relatedInfos`,void 0),e([v({type:S})],$.prototype,`spatialReference`,null),e([v()],$.prototype,`timeZone`,null),e([v({readOnly:!0})],$.prototype,`title`,void 0),e([v()],$.prototype,`map`,null),e([v({readOnly:!0})],$.prototype,`waitingForContent`,null),e([v()],$.prototype,`view`,void 0),$=Y=e([b(`esri.widgets.Feature.FeatureViewModel`)],$);export{$ as default};
|
package/widgets/Feature.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as n}from"../intl.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o}from"../core/reactiveUtils.js";import{property as s,cast as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../geometry/Point.js";import d from"./Widget.js";import f from"./Feature/FeatureAttachments.js";import p from"./Feature/FeatureContent.js";import m from"./Feature/FeatureExpression.js";import h from"./Feature/FeatureFields.js";import g from"./Feature/FeatureMedia.js";import _ from"./Feature/FeatureRelationship.js";import v from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as b}from"./Feature/resources.js";import{FeatureContentMixin as x}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as S}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{tsx as T,messageBundle as E}from"./support/widget.js";const D={title:!0,content:!0,lastEditedInfo:!0};let O=class extends x(d){constructor(e){super(
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as n}from"../intl.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o}from"../core/reactiveUtils.js";import{property as s,cast as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../geometry/Point.js";import d from"./Widget.js";import f from"./Feature/FeatureAttachments.js";import p from"./Feature/FeatureContent.js";import m from"./Feature/FeatureExpression.js";import h from"./Feature/FeatureFields.js";import g from"./Feature/FeatureMedia.js";import _ from"./Feature/FeatureRelationship.js";import v from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as b}from"./Feature/resources.js";import{FeatureContentMixin as x}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as S}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{tsx as T,messageBundle as E}from"./support/widget.js";const D={title:!0,content:!0,lastEditedInfo:!0};let O=class extends x(d){constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this._contentWidgets=[],this.flowType=`feature`,this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...D},this.viewModel=new y({suppressDeprecationWarning:!0}),t!==!0&&(this.announceDeprecation=()=>{r(i.getLogger(this),`Feature`,`arcgis-feature`,{version:`4.34`})})}initialize(){this.addHandles(a(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),o))}loadDependencies(){return S({notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return`polygon`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...D,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){let{state:e}=this.viewModel,t=T(`div`,{class:b.container,key:`container`},this._renderTitle(),e===`error`?this._renderError():e===`loading`?this._renderLoading():this._renderContentContainer());return T(`div`,{class:this.classes(b.base,C.widget)},t)}_renderError(){let{messagesCommon:e,messages:t,visibleElements:n}=this;return T(`calcite-notice`,{icon:`exclamation-mark-circle`,kind:`danger`,open:!0,scale:`s`},n.title?T(`div`,{key:`error-title`,slot:`title`},e.errorMessage):null,T(`div`,{key:`error-message`,slot:`message`},t.loadingError))}_renderLoading(){return T(`div`,{class:b.loadingSpinnerContainer,key:`loading-container`},T(`calcite-loader`,{inline:!0,label:``}))}_renderContentContainer(){let{visibleElements:e}=this;return e.content?T(`div`,{class:b.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){let{visibleElements:e,title:t}=this;return e.title?T(w,{class:b.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){let e=this.viewModel.content,t=`content`;if(!e)return null;if(Array.isArray(e))return e.length?T(`div`,{class:b.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e==`string`){let e=this._contentWidgets[0];return!e||e.destroyed?null:T(`div`,{class:this.classes(b.contentNode,b.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){let{visibleElements:n}=this;if(typeof n.content!=`boolean`&&!n.content?.[e.type])return null;switch(e.type){case`attachments`:return this._renderAttachments(t);case`custom`:return this._renderCustom(e,t);case`fields`:return this._renderFields(t);case`media`:return this._renderMedia(t);case`text`:return this._renderText(e,t);case`expression`:return this._renderExpression(t);case`relationship`:return this._renderRelationship(t);case`utility-network-associations`:return this._renderAssociation(t);default:return null}}_renderAttachments(e){let t=this._contentWidgets[e];if(!t||t.destroyed)return null;let{state:n,attachmentInfos:r}=t.viewModel;return n===`loading`||r.length>0?T(`div`,{class:this.classes(b.contentElement),key:this._buildKey(`attachments-element`,e)},t.render()):null}_renderRelationship(e){let t=this._contentWidgets[e];return!t||t.destroyed||!this.flowItems?null:T(`div`,{class:b.contentElement,key:this._buildKey(`relationship-element`,e)},t.render())}_renderAssociation(e){let t=this._contentWidgets[e];return!t||t.destroyed||!this.flowItems?null:T(`div`,{class:b.contentElement,key:this._buildKey(`utility-network-association-element`,e)},t.render())}_renderExpression(e){let t=this._contentWidgets[e];return!t||t.destroyed||!t.viewModel.contentElement?null:T(`div`,{class:b.contentElement,key:this._buildKey(`expression-element`,e)},t.render())}_renderCustom(e,t){let{creator:n}=e,r=this._contentWidgets[t];return!r||r.destroyed?null:n?T(`div`,{class:b.contentElement,key:this._buildKey(`custom-element`,t)},r.render()):null}_renderFields(e){let t=this._contentWidgets[e];return!t||t.destroyed?null:T(`div`,{class:b.contentElement,key:this._buildKey(`fields-element`,e)},t.render())}_renderMedia(e){let t=this._contentWidgets[e];return!t||t.destroyed?null:T(`div`,{class:b.contentElement,key:this._buildKey(`media-element`,e)},t.render())}_renderLastEditInfo(){let{visibleElements:e,messages:t}=this,{lastEditInfo:r}=this.viewModel;if(!r||!e.lastEditedInfo)return null;let{date:i,user:a}=r,o=r.type===`edit`?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,s=n(o,{date:i,user:a});return T(`div`,{class:this.classes(b.lastEditedInfo,b.contentElement),key:`edit-info-element`},s)}_renderText(e,t){let n=e.text,r=this._contentWidgets[t];return!r||r.destroyed?null:n?T(`div`,{class:this.classes(b.contentElement,b.text),key:this._buildKey(`text-element`,t)},r.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||`0`}-${t.join(`-`)}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();let{headingLevel:e,visibleElements:t,flowItems:n,viewModel:r}=this,i=r?.content,{contentViewModels:a}=r;if(Array.isArray(i))i.forEach((i,o)=>{if(i.type===`attachments`&&(this._contentWidgets[o]=new f({displayType:i.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:a[o]})),i.type===`fields`&&(this._contentWidgets[o]=new h({viewModel:a[o]})),i.type===`media`&&(this._contentWidgets[o]=new g({viewModel:a[o]})),i.type===`text`&&(this._contentWidgets[o]=new p({viewModel:a[o]})),i.type===`custom`&&(this._contentWidgets[o]=new p({viewModel:a[o]})),i.type===`expression`&&(this._contentWidgets[o]=new m({viewModel:a[o]})),i.type===`relationship`){let e=new _({flowItems:n,featureVisibleElements:t,viewModel:a[o]});this._contentWidgets[o]=e}if(i.type===`utility-network-associations`){let e=new v({flowItems:n,onSelectAssociationType:async e=>{let{viewModel:i,listType:a,title:o}=e;if(!n)return;i.activeAssociationType=a;let{default:s}=await import(`./Feature/FeatureUtilityNetworkAssociationList.js`),c=new s({viewModel:i,parentFeatureViewModel:r,listType:a,title:o,featureVisibleElements:t,description:r.title,flowItems:n});n.push(c)},parentFeatureViewModel:r,featureVisibleElements:t,viewModel:a[o]});this._contentWidgets[o]=e}},this);else{let e=a[0];e&&!e.destroyed&&(this._contentWidgets[0]=new p({viewModel:e}))}this.scheduleRender()}};e([s()],O.prototype,`flowType`,void 0),e([s({type:t})],O.prototype,`graphic`,null),e([s()],O.prototype,`defaultPopupTemplateEnabled`,null),e([s()],O.prototype,`flowItems`,void 0),e([s()],O.prototype,`headingLevel`,void 0),e([s({readOnly:!0})],O.prototype,`isTable`,null),e([s()],O.prototype,`icon`,null),e([s()],O.prototype,`label`,null),e([s({type:u})],O.prototype,`location`,null),e([s(),E(`esri/widgets/Feature/t9n/Feature`)],O.prototype,`messages`,void 0),e([s(),E(`esri/t9n/common`)],O.prototype,`messagesCommon`,void 0),e([s()],O.prototype,`spatialReference`,null),e([s()],O.prototype,`timeZone`,null),e([s({readOnly:!0})],O.prototype,`title`,null),e([s()],O.prototype,`visibleElements`,void 0),e([c(`visibleElements`)],O.prototype,`castVisibleElements`,null),e([s()],O.prototype,`map`,null),e([s()],O.prototype,`view`,null),e([s({type:y})],O.prototype,`viewModel`,void 0),O=e([l(`esri.widgets.Feature`)],O);export{O as default};
|