@arcgis/core 4.34.0-next.65 → 4.34.0-next.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.js +1 -1
- package/WebDocument2D.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0814676e4bac81f96140.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 09dbb3e200ef8d514eb3.js} +2 -2
- package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
- package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
- package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
- package/assets/esri/core/workers/chunks/144bfd64daf103a06734.js +1 -0
- package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → 170ec7fb070c63230c81.js} +1 -1
- package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
- package/assets/esri/core/workers/chunks/1ada9e6cdd6792e3847a.js +1 -0
- package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
- package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
- package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
- package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
- package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
- package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
- package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 39d69afc9da9db0c75ab.js} +1 -1
- package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
- package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
- package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
- package/assets/esri/core/workers/chunks/5185c63fecc5f493e142.js +1 -0
- package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
- package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
- package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 5b84eba4a28e25b6d5c0.js} +1 -1
- package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
- package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
- package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
- package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
- package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
- package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
- package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → 70dc7ec6474f0801bc04.js} +1 -1
- package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
- package/assets/esri/core/workers/chunks/80b0c88a76bd523a406a.js +1 -0
- package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
- package/assets/esri/core/workers/chunks/837830e1cf712d4243a5.js +1 -0
- package/assets/esri/core/workers/chunks/87fb5d755860057da164.js +1 -0
- package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 8a104b35708a492bd614.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
- package/assets/esri/core/workers/chunks/8e2558b14be70b273ce4.js +1 -0
- package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 90491262b6d6a126c32f.js} +1 -1
- package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +1 -0
- package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
- package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e3c09c3524654830b14.js → a634764dec5404f4a1d7.js} +1 -1
- package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
- package/assets/esri/core/workers/chunks/aa970a547c60c43d6c7f.js +1 -0
- package/assets/esri/core/workers/chunks/ab727ed4417b7dd94ce9.js +1 -0
- package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → ad3ebd4f05cc673140f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
- package/assets/esri/core/workers/chunks/b052d3ef5493eedb44a5.js +1 -0
- package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
- package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
- package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
- package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → cad03967e132a28512c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
- package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
- package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
- package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
- package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
- package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed1272e7681e561d843f.js +1 -0
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
- package/assets/esri/core/workers/chunks/efea3e82cec476d486e0.js +1 -0
- package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
- package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → f9385d7fb5ff20f7b252.js} +1 -1
- package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
- package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
- package/chunks/GlowComposition.glsl.js +3 -3
- package/chunks/RibbonLine.glsl.js +2 -2
- package/config.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/support/centroid.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/graphic/AggregateGraphicOrigin.js +1 -1
- package/graphic/BuildingGraphicOrigin.js +1 -1
- package/graphic/CSVGraphicOrigin.js +1 -1
- package/graphic/CatalogGraphicOrigin.js +1 -1
- package/graphic/FeatureGraphicOrigin.js +1 -1
- package/graphic/GeoJSONGraphicOrigin.js +1 -1
- package/graphic/GeoRSSGraphicOrigin.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +1 -1
- package/graphic/ImageryTileGraphicOrigin.js +1 -1
- package/graphic/KMLGraphicOrigin.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/graphic/MapImageGraphicOrigin.js +1 -1
- package/graphic/MapNotesGraphicOrigin.js +1 -1
- package/graphic/OGCFeatureGraphicOrigin.js +1 -1
- package/graphic/OrientedImageryGraphicOrigin.js +1 -1
- package/graphic/ParquetGraphicOrigin.js +1 -1
- package/graphic/PointCloudGraphicOrigin.js +1 -1
- package/graphic/SceneGraphicOrigin.js +1 -1
- package/graphic/StreamGraphicOrigin.js +1 -1
- package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
- package/graphic/TileGraphicOrigin.js +1 -1
- package/graphic/TrackGraphicOrigin.js +1 -1
- package/graphic/VectorTileGraphicOrigin.js +1 -1
- package/graphic/VoxelGraphicOrigin.js +1 -1
- package/graphic/WCSGraphicOrigin.js +1 -1
- package/graphic/WFSGraphicOrigin.js +1 -1
- package/graphic/getIdFieldsProvider.js +5 -0
- package/graphic/getSliceableContainer.js +5 -0
- package/graphic/graphicOrigins.d.ts +0 -2
- package/graphic/graphicOrigins.js +1 -1
- package/interfaces.d.ts +172 -244
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/TemporalLayer.js +1 -1
- package/layers/mixins/TemporalSceneLayer.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/FeatureFilter.js +1 -1
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/TrackInfo.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/IdentifyParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImageParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/support/timeUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/renderUtils.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/time/TimeInterval.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Intersector.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
- package/views/draw/support/createUtils.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/webdoc/support/timeProperties.js +1 -1
- package/webdoc/widgets/TimeSlider.js +1 -1
- package/webmap/InitialViewProperties.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
- package/TimeExtent.d.ts +0 -4
- package/TimeExtent.js +0 -5
- package/TimeInterval.d.ts +0 -4
- package/TimeInterval.js +0 -5
- package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
- package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
- package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
- package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
- package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
- package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +0 -1
- package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
- package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
- package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
- package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
- package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
- package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
- package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
- package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
- package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
- package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
- package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
- package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
- package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
- package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
- package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
- package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
- package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
- package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
- package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
- package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
- package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
- package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
- package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
- package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
- package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
- package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
- package/assets/esri/core/workers/chunks/eadac757f74470b89a36.js +0 -1
- package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
- package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
- package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
- package/chunks/TimeExtent.js +0 -5
- package/chunks/TimeInterval.js +0 -5
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as o}from"../../core/object.js";import{property as
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as o}from"../../core/object.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{Integer as s,Null as i}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import{timeUnitKebabDictionary as m}from"../../portal/timeUnitKebabDictionary.js";import a from"../../time/TimeExtent.js";import c from"../../time/TimeInterval.js";var d;let T=d=class extends e{constructor(t){super(t),this.currentTimeExtent=null,this.fullTimeExtent=null,this.loop=!1,this.numStops=null,this.numThumbs=null,this.stopDelay=null,this.stopInterval=null,this.stops=null}readCurrentTimeExtent(t){return t?a.fromArray(t):void 0}writeCurrentTimeExtent(t,e,r){t&&o(r,t.toArray(),e)}readFullTimeExtent(t,e){const r=e.properties;if(!r)return;const o=null!=r.endTime?new Date(r.endTime):null,p=null!=r.startTime?new Date(r.startTime):null;return new a({start:p,end:o})}writeFullTimeExtent(t,e){if(!t)return;const r=e.properties=e.properties||{},o=t.end,p=t.start;o&&(r.endTime=null!=o?o.getTime():null),p&&(r.startTime=null!=p?p.getTime():null)}readStopInterval(t,e,r){return t?c.fromJSON({value:t.interval,unit:t.units},r):null}writeStopInterval(t,e,r,p){if(!t)return;const s=t.toJSON(p);o("properties.timeStopInterval",{interval:s.value,units:s.unit},e)}readStops(t){return t?.length?t.map(t=>new Date(t)):null}writeStops(t,e,r){t?.length&&o(r,t.map(t=>t.getTime()),e)}clone(){return new d(r({currentTimeExtent:this.currentTimeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:this.numStops,numThumbs:this.numThumbs,stopDelay:this.stopDelay,stopInterval:this.stopInterval,stops:this.stops}))}};t([p({type:a,json:{type:[[s,i]],read:{source:"properties.currentTimeExtent"},write:{target:"properties.currentTimeExtent"}}})],T.prototype,"currentTimeExtent",void 0),t([n("currentTimeExtent")],T.prototype,"readCurrentTimeExtent",null),t([u("currentTimeExtent")],T.prototype,"writeCurrentTimeExtent",null),t([p({type:a,json:{read:{source:["properties.endTime","properties.startTime"]},write:{target:{"properties.endTime":{type:Number},"properties.startTime":{type:Number}}}}})],T.prototype,"fullTimeExtent",void 0),t([n("fullTimeExtent")],T.prototype,"readFullTimeExtent",null),t([u("fullTimeExtent")],T.prototype,"writeFullTimeExtent",null),t([p({type:Boolean,nonNullable:!0,json:{default:!1,read:{source:"properties.loop"},write:{target:"properties.loop"}}})],T.prototype,"loop",void 0),t([p({type:s,json:{read:{source:"properties.numberOfStops"},write:{target:"properties.numberOfStops",overridePolicy(){const t=!!this.stopInterval,e=!!this.stops?.length,r=!(t||e);return{enabled:r,isRequired:r}}}}})],T.prototype,"numStops",void 0),t([p({type:[1,2],nonNullable:!0,json:{type:s,read:{source:"properties.thumbCount"},write:{target:"properties.thumbCount",isRequired:!0}}})],T.prototype,"numThumbs",void 0),t([p({type:Number,nonNullable:!0,json:{read:{source:"properties.thumbMovingRate"},write:{target:"properties.thumbMovingRate",isRequired:!0}}})],T.prototype,"stopDelay",void 0),t([p({type:c,json:{read:{source:"properties.timeStopInterval"},write:{target:{"properties.timeStopInterval.interval":{type:Number},"properties.timeStopInterval.units":{type:m.jsonValues.filter(t=>"esriTimeUnitsUnknown"!==t)}},overridePolicy(){const t=null!=this.numStops,e=!!this.stops?.length;return{enabled:!e,isRequired:!(t||e)}}}}})],T.prototype,"stopInterval",void 0),t([n("stopInterval")],T.prototype,"readStopInterval",null),t([u("stopInterval")],T.prototype,"writeStopInterval",null),t([p({type:[Date],json:{type:[s],read:{source:"properties.stops"},write:{target:"properties.stops",overridePolicy(){return{isRequired:null==this.numStops&&!this.stopInterval}}}}})],T.prototype,"stops",void 0),t([n("stops")],T.prototype,"readStops",null),t([u("stops")],T.prototype,"writeStops",null),T=d=t([l("esri.webdoc.widgets.TimeSlider")],T);const y=T;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import t from"../Viewpoint.js";import e from"../core/Accessor.js";import{ClonableMixin as r}from"../core/Clonable.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import s from"../geometry/SpatialReference.js";import{system as n}from"../time/constants.js";import
|
|
5
|
+
import{__decorate as o}from"tslib";import t from"../Viewpoint.js";import e from"../core/Accessor.js";import{ClonableMixin as r}from"../core/Clonable.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import s from"../geometry/SpatialReference.js";import{system as n}from"../time/constants.js";import m from"../time/TimeExtent.js";import c from"../webdoc/RangeInfo.js";import a from"./background/ColorBackground.js";let l=class extends(r(e)){constructor(o){super(o),this.background=null,this.rangeInfo=null,this.spatialReference=null,this.timeExtent=null,this.timeZone=n,this.viewpoint=null}};o([i({type:a})],l.prototype,"background",void 0),o([i({type:c})],l.prototype,"rangeInfo",void 0),o([i({type:s})],l.prototype,"spatialReference",void 0),o([i({type:m})],l.prototype,"timeExtent",void 0),o([i({nonNullable:!0})],l.prototype,"timeZone",void 0),o([i({type:t})],l.prototype,"viewpoint",void 0),l=o([p("esri.webmap.InitialViewProperties")],l);const f=l;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as a,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as o,formatImperialArea as m,formatMetricArea as l,formatImperialLength as p,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/Point.js";import f from"../../geometry/Polygon.js";import g from"../../geometry/Polyline.js";import{e as _}from"../../chunks/areaOperator.js";import{e as w,l as b}from"../../chunks/geodeticAreaOperator.js";import{e as L,l as j}from"../../chunks/geodeticDensifyOperator.js";import{e as S,l as A}from"../../chunks/geodeticLengthOperator.js";import{e as k}from"../../chunks/lengthOperator.js";import{e as G}from"../../chunks/simplifyOperator.js";import{isSupported as x,geodesicDensify as M,geodesicLengths as q,geodesicAreas as C}from"../../geometry/support/geodesicUtils.js";import O from"../../layers/GraphicsLayer.js";import H from"../../symbols/Font.js";import R from"../../symbols/SimpleFillSymbol.js";import U from"../../symbols/SimpleLineSymbol.js";import T from"../../symbols/SimpleMarkerSymbol.js";import z from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as D}from"../../views/2d/interactive/SnappingVisualizer2D.js";import P from"../../views/draw/Draw.js";import{createCoordinateHelper as E}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as V,screenToMap as F,dragManipulatedObject as W}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as I}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as B}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as J}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as K}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as N}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Q}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as X}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as Y}from"../../intl/messages.js";import{onLocaleChange as Z}from"../../intl/locale.js";const $=1e5;let ee=class extends B{constructor(e){super(e),this._measurementLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){Y("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new P({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([Z(async()=>{this.messages=await Y("esri/core/t9n/Units")}),a(()=>[this.unit,this.messages],()=>{this._updateGraphics()},n),a(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),X(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=s(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=s(this._measurementLayer),this._manipulatorLayer=s(this._manipulatorLayer),this._snappingLayer=s(this._snappingLayer),this._updatingHandles=s(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new N({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new K(new J("point",E(!1,!1,this.view.spatialReference)),2),visualizer:new D(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new y({x:i,y:s,spatialReference:t}),n=te(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=K.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=V(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=Q({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(F(this.view)).next(t=>{if("start"===t.action){const r=new y(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(W({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new y({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=re(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:s,fillGeometry:a,outlineGeometry:n}=e;this._set("measurement",s);const o=s?ae(this.messages,s,this.unit):null;if(this._set("measurementLabel",o),!a&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new R({color:r(h.accentColor,.3),outline:null})}),l=new t({symbol:new U({color:h.accentColor,width:2})}),p=new t({symbol:new z({color:h.textColor,font:new H({size:14,family:"sans-serif"}),haloColor:r(i(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=a,l.geometry=n,p.geometry=a?.centroid,p.symbol.text=o?.area??""}};function te(e,i,s){const a=8,n={style:"circle",color:r(i.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new T({...n,size:a}),m=new T({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new I({view:i,layer:s,graphic:l,focusedSymbol:m})}function re(e,t){if(2===e.length){const r=new g({paths:[e],spatialReference:t});let i;return i=t.isGeographic?x(t)?M(r,$):L(r,$,{unit:"meters"}):t.isWebMercator?L(r,$,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new g({paths:[e],spatialReference:t}),i=new f({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(x(t)){if(n=M(r,$),o=M(i,$),o=G(o),!o)return null;s=q([r],"meters")[0],a=C([o],"square-meters")[0]}else{if(n=L(r,$,{unit:"meters"}),o=L(i,$,{unit:"meters"}),o=G(o),!o)return null;s=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=L(r,$,{unit:"meters"}),o=L(i,$,{unit:"meters"}),o=G(o),!o)return null;s=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else{if(n=r,o=G(i),!o)return null;s=k(r,{unit:"meters"}),a=_(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function ie(e){return null!=e}async function se(e){(e?.isGeographic&&!x(e)||e?.isWebMercator)&&await Promise.all([b(),j(),A()])}function ae(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=l(e,s,"square-meters");break;case"imperial":i.area=m(e,s,"square-meters");break;default:{const t=u(s,"square-meters",r);i.area=o(e,t,r);break}}const n=ne(r);if(n)switch(n){case"metric":i.perimeter=c(e,a,"meters");break;case"imperial":i.perimeter=p(e,a,"meters");break;default:{const t=u(a,"meters",n);i.perimeter=o(e,t,n);break}}else i.perimeter="";return i}function ne(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([h()],ee.prototype,"_drawActive",void 0),e([h({readOnly:!0})],ee.prototype,"cursor",null),e([h({value:!0})],ee.prototype,"editable",null),e([h({readOnly:!0})],ee.prototype,"measurement",void 0),e([h({readOnly:!0})],ee.prototype,"measurementLabel",void 0),e([h()],ee.prototype,"messages",void 0),e([h({constructOnly:!0})],ee.prototype,"snappingManager",void 0),e([h()],ee.prototype,"unit",void 0),e([h()],ee.prototype,"updating",null),e([h({constructOnly:!0})],ee.prototype,"view",void 0),ee=e([d("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],ee);export{ee as AreaMeasurement2DTool,re as createAreaMeasurementInfo2D,ae as createAreaMeasurementLabel,ie as isSupported,se as loadGeometryOperators};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as s}from"../../core/colorUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as o,formatImperialArea as m,formatMetricArea as l,formatImperialLength as p,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/Point.js";import f from"../../geometry/Polygon.js";import g from"../../geometry/Polyline.js";import{e as _}from"../../chunks/areaOperator.js";import{e as w,l as b}from"../../chunks/geodeticAreaOperator.js";import{e as j,l as L}from"../../chunks/geodeticDensifyOperator.js";import{e as S,l as A}from"../../chunks/geodeticLengthOperator.js";import{e as k}from"../../chunks/lengthOperator.js";import{e as G}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as x}from"../../geometry/support/centroid.js";import{isSupported as M,geodesicDensify as q,geodesicLengths as O,geodesicAreas as C}from"../../geometry/support/geodesicUtils.js";import H from"../../layers/GraphicsLayer.js";import R from"../../symbols/Font.js";import U from"../../symbols/SimpleFillSymbol.js";import T from"../../symbols/SimpleLineSymbol.js";import z from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as P}from"../../views/2d/interactive/SnappingVisualizer2D.js";import E from"../../views/draw/Draw.js";import{createCoordinateHelper as V}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as F,screenToMap as W,dragManipulatedObject as I}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as B}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as J}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as N}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as K}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Q}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as Y}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as Z}from"../../intl/messages.js";import{onLocaleChange as $}from"../../intl/locale.js";const ee=1e5;let te=class extends J{constructor(e){super(e),this._measurementLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){Z("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new E({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([$(async()=>{this.messages=await Z("esri/core/t9n/Units")}),a(()=>[this.unit,this.messages],()=>{this._updateGraphics()},n),a(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),Y(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=i(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=i(this._measurementLayer),this._manipulatorLayer=i(this._manipulatorLayer),this._snappingLayer=i(this._snappingLayer),this._updatingHandles=i(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Q({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new K(new N("point",V(!1,!1,this.view.spatialReference)),2),visualizer:new P(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[s,i]=e[r],a=new y({x:s,y:i,spatialReference:t}),n=re(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=K.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=F(n,(e,t,r,s)=>{const i=this._getSnappingContext(s),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=X({snappingContext:i,snappingManager:a,updatingHandles:n});t.next(W(this.view)).next(t=>{if("start"===t.action){const r=new y(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(I({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[s,i],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,s=this._vertices[r],[i,a]=e[r];s.coord[0]===i&&s.coord[1]===a||(s.coord=[i,a],s.manipulator.graphic.geometry=new y({x:i,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:i,fillGeometry:a,outlineGeometry:n}=e;this._set("measurement",i);const o=i?ne(this.messages,i,this.unit):null;if(this._set("measurementLabel",o),!a&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new U({color:r(h.accentColor,.3),outline:null})}),l=new t({symbol:new T({color:h.accentColor,width:2})}),p=new t({symbol:new D({color:h.textColor,font:new R({size:14,family:"sans-serif"}),haloColor:r(s(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=a,l.geometry=n;const d=a?x(a):null,v=d?y.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function re(e,s,i){const a=8,n={style:"circle",color:r(s.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new z({...n,size:a}),m=new z({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new B({view:s,layer:i,graphic:l,focusedSymbol:m})}function se(e,t){if(2===e.length){const r=new g({paths:[e],spatialReference:t});let s;return s=t.isGeographic?M(t)?q(r,ee):j(r,ee,{unit:"meters"}):t.isWebMercator?j(r,ee,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:s}}e.push(e[0]);const r=new g({paths:[e],spatialReference:t}),s=new f({rings:[e],spatialReference:t});let i,a,n=null,o=null;if(t.isGeographic)if(M(t)){if(n=q(r,ee),o=q(s,ee),o=G(o),!o)return null;i=O([r],"meters")[0],a=C([o],"square-meters")[0]}else{if(n=j(r,ee,{unit:"meters"}),o=j(s,ee,{unit:"meters"}),o=G(o),!o)return null;i=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=j(r,ee,{unit:"meters"}),o=j(s,ee,{unit:"meters"}),o=G(o),!o)return null;i=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else{if(n=r,o=G(s),!o)return null;i=k(r,{unit:"meters"}),a=_(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:i},fillGeometry:o,outlineGeometry:n}}function ie(e){return null!=e}async function ae(e){(e?.isGeographic&&!M(e)||e?.isWebMercator)&&await Promise.all([b(),L(),A()])}function ne(e,t,r){if(!t||!e)return null;const s={area:null,perimeter:null},{area:i,perimeter:a}=t;switch(r){case"metric":s.area=l(e,i,"square-meters");break;case"imperial":s.area=m(e,i,"square-meters");break;default:{const t=u(i,"square-meters",r);s.area=o(e,t,r);break}}const n=oe(r);if(n)switch(n){case"metric":s.perimeter=c(e,a,"meters");break;case"imperial":s.perimeter=p(e,a,"meters");break;default:{const t=u(a,"meters",n);s.perimeter=o(e,t,n);break}}else s.perimeter="";return s}function oe(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([h()],te.prototype,"_drawActive",void 0),e([h({readOnly:!0})],te.prototype,"cursor",null),e([h({value:!0})],te.prototype,"editable",null),e([h({readOnly:!0})],te.prototype,"measurement",void 0),e([h({readOnly:!0})],te.prototype,"measurementLabel",void 0),e([h()],te.prototype,"messages",void 0),e([h({constructOnly:!0})],te.prototype,"snappingManager",void 0),e([h()],te.prototype,"unit",void 0),e([h()],te.prototype,"updating",null),e([h({constructOnly:!0})],te.prototype,"view",void 0),te=e([d("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],te);export{te as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ie as isSupported,ae as loadGeometryOperators};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import{T as b}from"../../../chunks/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import b from"../../../time/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(o,{activeLayerInfo:e,
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(o,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[i.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(i.service,r),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},l("div",{class:i.serviceCaptionText},e.title)),l("div",{class:i.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(o,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],p.prototype,"activeLayerInfos",void 0),e([s()],p.prototype,"headingLevel",void 0),e([s()],p.prototype,"layout",void 0),e([s(),a("esri/widgets/Legend/t9n/Legend")],p.prototype,"messages",void 0),e([s(),a("esri/t9n/common")],p.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"view",void 0),p=e([t("esri.widgets.Legend.styles.card.CardView")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import o from"./SizeRamp.js";import n from"./UnivariateAboveAndBelowRamp.js";import c from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as p}from"../support/relationshipUtils.js";import{getLegendElementTitle as h}from"../support/utils.js";import{attachToNode as m,isImageryStretchedLegend as d,getTitle as y}from"../../support/styleUtils.js";import{Heading as g,incrementHeadingLevel as f}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as u}from"../../../support/jsxFactory.js";var v;let b=v=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=h(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?u("div",null,u(g,{class:a.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),u(g,{class:a.layerCaption,level:f(this.headingLevel)},s)):s?u(g,{class:a.layerCaption,level:this.headingLevel},s):null;return u("section",{"aria-labelledby":this.key,class:a.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return u(o,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return u(l,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return p(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return u("div",{afterCreate:m,bind:this.legendElement.preview,class:a.pieChartRampPreview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return u(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return u(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[a.symbolRow],r={[a.labelContainer]:!i&&!t,[a.relationshipLabelContainer]:t};return u("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return u(v,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=d(t,s),o=y(this.messages,i,!1)||"";if("src"in e&&e.src)return u("div",{class:a.layerRow,key:`${r}-row`},this._renderImage(e,t,l),u("div",{class:a.imageLabel},o));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return u("div",{afterCreate:m,bind:e.preview,key:`${r}-row`});const s={[a.symbolCell]:this.hasIndicators};return u("div",{class:this.classes(a.layerRow,{[a.symbolRow]:this.hasIndicators}),key:`${r}-row`},u("div",{afterCreate:m,bind:e.preview,class:this.classes(s)}),u("div",{class:this.classes(a.imageLabel,{[a.labelCell]:this.hasIndicators})},o))}return u("div",{class:a.layerRow,key:`${r}-row`},u("div",{class:a.labelElement,styles:this._getBackgroundStyles(e)},o))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{label:i,src:r,opacity:l}=e,o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},n={opacity:`${l??s.opacity}`},c=y(this.messages,i,!1);return u("img",{alt:c,"aria-label":c,border:0,class:this.classes(o),height:e.height,src:r,styles:n,width:e.width})}};e([t()],b.prototype,"activeLayerInfo",void 0),e([t()],b.prototype,"cssEffectFilter",void 0),e([t()],b.prototype,"hasIndicators",void 0),e([t()],b.prototype,"headingLevel",void 0),e([t()],b.prototype,"isChild",void 0),e([t()],b.prototype,"layer",void 0),e([t()],b.prototype,"legendElement",void 0),e([t()],b.prototype,"messages",void 0),b=v=e([i("esri.widgets.Legend.styles.card.LegendElement")],b);export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as s}from"./css.js";import{getUnivariateAboveAndBelowRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";let f=class extends r{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:r}=this,{sizeRampElement:f,colorRampElement:y}=i(e,t,"horizontal");if(!f)return null;const h=l(f,"full",!0,"horizontal"),v=a(f,"above",!0,"horizontal"),u=a(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",cssEffectFilter:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",cssEffectFilter:o,ariaLabel:b}),j=n(f,"card"),E=f.infos.map(e=>e.label),z=E.length-1,C=E.map((e,t)=>0===t||t===z?d("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},L={display:"flex",flexDirection:"row"},A={marginTop:"3px",display:"flex"};m(this.container)?A.marginRight=`${j}px`:A.marginLeft=`${j}px`;const F={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:s.layerRow,key:`${r}-container`,styles:R},d("div",{class:this.classes(s.symbolContainer,s.sizeRampHorizontal),styles:L},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:s.symbol,key:t}))),w?d("div",{class:s.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:A},d("div",{afterCreate:c,bind:w}),d("div",{afterCreate:c,bind:x})):null,d("div",{class:s.layerInfo},d("div",{class:s.rampLabelsContainer,styles:F},C)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as f}from"../../../support/jsxFactory.js";let d=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:s}=this,{sizeRampElement:d,colorRampElement:y}=i(e,"horizontal");if(!d)return null;const u=l(d,"full",!1,"horizontal"),v=a(d,"full",!1,"horizontal"),g=p(y,{width:v,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(d,"card"),x=d.infos.length-1,j=d.infos.map((e,t)=>0===t||t===x?f("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},w={display:"flex",flexDirection:"row"},C={marginTop:"3px",display:"flex"};m(this.container)?C.marginRight=`${h}px`:C.marginLeft=`${h}px`;const E={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return f("div",{class:r.layerRow,key:`${s}-container`,styles:b},f("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:w},d.infos.map((e,t)=>f("div",{afterCreate:c,bind:e.preview,class:r.symbol,key:t}))),f("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:C},f("div",{afterCreate:c,bind:g})),f("div",{class:r.layerInfo},f("div",{class:r.rampLabelsContainer,styles:E},j)))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],d);export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p}from"../../../support/jsxFactory.js";const d=`${i}__`;let m=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?p("section",null,s):p("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${d}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return p("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>p(n,{
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p}from"../../../support/jsxFactory.js";const d=`${i}__`;let m=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?p("section",null,s):p("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${d}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return p("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>p(n,{cssEffectFilter:e.cssEffectFilter,isChild:!1,key:`${r}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),l={[o.groupLayerChild]:!!e.parent};return p("section",{class:this.classes(o.service,l),key:r},s,p("div",{class:o.layer},i))}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s(),c("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),m=e([r("esri.widgets.Legend.styles.classic.ClassicView")],m);export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import i from"./ColorRamp.js";import{css as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import i from"./ColorRamp.js";import{css as l}from"./css.js";import a from"./SizeRamp.js";import o from"./UnivariateAboveAndBelowRamp.js";import n from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as m}from"../support/relationshipUtils.js";import{getLegendElementTitle as c}from"../support/utils.js";import{attachToNode as p,isImageryStretchedLegend as h,getTitle as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";var g;let f=g=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=c(this.legendElement,this.messages),t=this.isChild?l.layerChildTable:l.layerTable,r=s?y("div",{class:l.layerCaption},s):null,i={[l.layerTableSizeRamp]:"size-ramp"===this.legendElement.type||!this.isChild};return y("section",{class:this.classes(t,i),key:`${this.key}-table`},r,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return y(a,{key:this.key,legendElement:this.legendElement,messages:this.messages});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return y(i,{key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return m(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return y("div",{afterCreate:p,bind:this.legendElement.preview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return y(o,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return y(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);return s.length?y("div",{class:l.layerBody},s):null}_renderElementInfo(e,s){const{layer:t}=this,r="label"in e?e.label:null,i=`${this.key}-${r}`;if("type"in e&&e.type)return y(g,{cssEffectFilter:this.cssEffectFilter,isChild:!0,key:i,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const a=h(t,s),o={[l.imageryLayerInfoStretched]:a},n={[l.imageryLayerInfoStretched]:a};return y("div",{class:l.layerRow,key:`${i}-row`},y("div",{class:this.classes(l.symbolContainer,n)},this._renderPreview(e,a)),y("div",{class:this.classes(l.layerInfo,o)},d(this.messages,r,!1)||""))}_renderPreview(e,s){const{layer:t}=this;return"preview"in e&&e.preview?y("div",{afterCreate:p,bind:e.preview,class:l.symbol}):"src"in e&&e.src?this._renderImage(e,t,s):null}_renderImage(e,s,t){const{label:r,src:i,opacity:a}=e,o={[l.imageryLayerStretchedImage]:t,[l.symbol]:!t},n={opacity:`${a??s.opacity}`},m=d(this.messages,r,!1);return y("img",{alt:m,"aria-label":m,border:0,class:this.classes(o),height:e.height,src:i,styles:n,width:e.width})}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"isChild",void 0),e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),f=g=e([t("esri.widgets.Legend.styles.classic.LegendElement")],f);export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as l}from"./css.js";import{getUnivariateAboveAndBelowRampElements as i,getUnivariateColorRampSize as o,getUnivariateColorRampPreview as a,getUnivariateColorRampMargin as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as c,univariateRampContainerStyles as m}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as v}from"../../../support/jsxFactory.js";let y=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:y,colorRampElement:b}=i(e,s);if(!y)return null;const f=this.messages.previewColorRampAriaLabel,u=o(y,"above",!0),g=o(y,"below",!0),h=12,w=a(b,{width:h,height:u,rampAlignment:"vertical",opacity:s,type:"above",cssEffectFilter:t,ariaLabel:f}),j=a(b,{width:h,height:g,rampAlignment:"vertical",opacity:s,type:"below",cssEffectFilter:t,ariaLabel:f}),L=p(y),A=y.infos.map(e=>e.label),E=A.map((e,s)=>{const t=2===s;return 0===s?v("div",{class:e?w?l.univariateAboveAndBelowLabel:l.rampLabel:void 0,key:`${r}-color-ramp-above-label-${e??s}`},e):t?v("div",null):null}),$=A.length-1,C=Math.floor(A.length/2),R=A.map((e,s)=>s===C||s===$?v("div",{class:e?w?l.univariateAboveAndBelowLabel:l.rampLabel:void 0,key:`${r}-color-ramp-below-label-${e??s}`},e):null),x={display:"table-cell",verticalAlign:"middle"},F={marginTop:`${L}px`},k={height:`${u}px`},B={height:`${g}px`};return v("div",{key:`${r}-container`,styles:m},v("div",{class:l.layerBody},y.infos.map((e,s)=>v("div",{class:this.classes(l.layerRow,l.sizeRamp),key:`${r}-row-${s}`},v("div",{afterCreate:d,bind:e.preview,class:l.symbol,styles:x}),w||s%2!=0?null:v("div",{class:l.layerInfo},A[s])))),w?v("div",{styles:F},v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:w,class:l.rampContainer})),v("div",{styles:c},v("div",{class:l.rampLabelsContainer,styles:k},E))),v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:j,class:l.rampContainer})),v("div",{styles:c},v("div",{class:l.rampLabelsContainer,styles:B},R)))):null)}};e([s()],y.prototype,"cssEffectFilter",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([t("esri.widgets.Legend.styles.classic.UnivariateAboveAndBelowRamp")],y);export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as c,univariateColorRampStyles as m,univariateRampContainerStyles as n}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";let f=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:f,colorRampElement:v}=i(e);if(!f)return null;const u=l(f),g=12,b=a(f,"full",!1),h=p(v,{width:g,height:b,rampAlignment:"vertical",opacity:s,type:"full",cssEffectFilter:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),j=f.infos.length-1,E=f.infos.map((e,s)=>0===s||s===j?y("div",{class:e.label?v?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${r}-color-ramp-label-${e.label??s}`},e.label):null),w={display:"table-cell",verticalAlign:"middle"},L={marginTop:`${u}px`},C={height:`${b}px`};return y("div",{key:`${r}-container`,styles:n},y("div",{class:o.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(o.layerRow,o.sizeRamp),key:`${r}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:o.symbol,styles:w})))),y("div",{styles:L},y("div",{styles:c},y("div",{styles:m},y("div",{afterCreate:d,bind:h,class:o.rampContainer})),y("div",{styles:m},y("div",{class:o.rampLabelsContainer,styles:C},E)))))}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{generateFillAttributes as e,renderDef as a,renderShape as l,getBoundingBox as r,computeBBox as t,getTransformMatrix as s,generateStrokeAttributes as o}from"../../../../symbols/support/svgUtils.js";import{
|
|
5
|
+
import{generateFillAttributes as e,renderDef as a,renderShape as l,getBoundingBox as r,computeBBox as t,getTransformMatrix as s,generateStrokeAttributes as o}from"../../../../symbols/support/svgUtils.js";import{isRTL as i,classes as n}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";const b="esri-relationship-ramp",m=`${b}--diamond`,u=`${b}--square`,c="http://www.w3.org/2000/svg",f={diamondContainer:`${m}__container`,diamondLeftCol:`${m}__left-column`,diamondRightCol:`${m}__right-column`,diamondMidCol:`${m}__middle-column`,diamondMidColLabel:`${m}__middle-column--label`,diamondMidColRamp:`${m}__middle-column--ramp`,squareTable:`${u}__table`,squareTableRow:`${u}__table-row`,squareTableCell:`${u}__table-cell`,squareTableLabel:`${u}__table-label`,squareTableLabelLeftBottom:`${u}__table-label--left-bottom`,squareTableLabelRightBottom:`${u}__table-label--right-bottom`,squareTableLabelLeftTop:`${u}__table-label--left-top`,squareTableLabelRightTop:`${u}__table-label--right-top`};function k(e,a,l={}){const{focus:r,labels:t}=e,s=!!r,o=h(e,a,l),b={justifyContent:"center"},m=i(),u=l.key??a;return s?d("div",{class:f.diamondContainer,key:`${u}-container`,styles:b},d("div",{class:f.diamondLeftCol},m?t.right:t.left),d("div",{class:f.diamondMidCol},d("div",{class:f.diamondMidColLabel},t.top),o,d("div",{class:f.diamondMidColLabel},t.bottom)),d("div",{class:f.diamondRightCol},m?t.left:t.right)):d("div",{class:f.squareTable,key:`${u}-container`},d("div",{class:f.squareTableRow},d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightBottom)},m?t.top:t.left),d("div",{class:f.squareTableCell}),d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftBottom)},m?t.left:t.top)),d("div",{class:f.squareTableRow},d("div",{class:f.squareTableCell}),o,d("div",{class:f.squareTableCell})),d("div",{class:f.squareTableRow},d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightTop)},m?t.right:t.bottom),d("div",{class:f.squareTableCell}),d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftTop)},m?t.bottom:t.right)))}function p(e,a,l){const r=`${l}_arrowStart`,t=`${l}_arrowEnd`,s="left"===e,o={markerStart:null,markerEnd:null};switch(a){case"HL":s?o.markerStart=`url(#${t})`:o.markerEnd=`url(#${r})`;break;case"LL":o.markerStart=`url(#${t})`;break;case"LH":s?o.markerEnd=`url(#${r})`:o.markerStart=`url(#${t})`;break;default:o.markerEnd=`url(#${r})`}return o}function h(i,n,b={}){const{focus:m,numClasses:u,colors:k,rotation:h}=i,{opacity:T,cssEffectFilter:_,ariaLabel:q}=b,$=b.size??60,g=!!m,L=Math.sqrt($**2+$**2)+(g?0:5),C=[],v=[],w=[],y=($||75)/u;for(let t=0;t<u;t++){const s=t*y;for(let i=0;i<u;i++){const n=i*y,d=e(k[t][i]),b=o(null),m={type:"rect",x:n,y:s,width:y,height:y},u=a(d);u&&C.push(u);const c=l(m,d.fill,b,null);c&&v.push(c),w.push(r(m))}}const x=15,R=15,E=10;let M=null;g||(M="margin: -15px -15px -18px -15px");const S=p("left",m,n),j=p("right",m,n),B=t(w),H=s(B,L,L,0,!1,h,!1),U=s(B,L,L,0,!1,g?-45:null,!1),W={filter:_??void 0,opacity:null==T?"":`${T}`};return d("div",{class:g?f.diamondMidColRamp:f.squareTableCell,styles:W},d("svg",{"aria-label":q,focusable:!1,height:L,role:"image",style:M,width:L,xmlns:c},d("defs",null,d("marker",{id:`${n}_arrowStart`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"5",refY:"5"},d("polyline",{fill:"none",points:"0,0 5,5 0,10",stroke:"#555555","stroke-width":"1"})),d("marker",{id:`${n}_arrowEnd`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"0",refY:"5"},d("polyline",{fill:"none",points:"5,0 0,5 5,10",stroke:"#555555","stroke-width":"1"})),C),d("g",{transform:H},v),d("g",{transform:U},d("line",{fill:"none","marker-end":S.markerEnd,"marker-start":S.markerStart,stroke:"#555555","stroke-width":"1",x1:-10,x2:-10,y1:$-x,y2:x}),d("line",{fill:"none","marker-end":j.markerEnd,"marker-start":j.markerStart,stroke:"#555555","stroke-width":"1",x1:R,x2:$-R,y1:$+E,y2:$+E}))))}export{k as renderRelationshipRamp};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pt2px as e}from"../../../../core/screenUtils.js";import"../../../../libs/maquette/projection.js";import{createProjector as t}from"../../../../libs/maquette/projector.js";import{isNumber as i}from"../../../../support/guards.js";import{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import"../../../support/widgetUtils.js";import{tsx as l}from"../../../support/jsxFactory.js";const n=t(),r=10,s=20,a=10,c=20,f={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function p(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?l("svg",{height:"4",width:"10"},l("line",{style:t,x1:"0",x2:"10",y1:"2",y2:"2"})):l("svg",{height:"10",width:"10"},l("line",{style:t,x1:"5",x2:"5",y1:"0",y2:"10"}))}function m(e,t="vertical"){const i=document.createElement("div");return i.style.height=`${s}px`,i.className=f.univariateAboveAndBelowSymbol,null!=e&&(i.style.opacity=e.toString()),n.append(i,p.bind(null,t)),i}function u(t,o,l="vertical",n){t.infos.forEach((t,r)=>{if(n&&2===r)t.preview=m(o,l);else{const o=(i(t.size)?e(t.size):0)+("horizontal"===l?c:a),n=t.preview,r="div"===n?.tagName.toLowerCase(),s=r?n:document.createElement("div");s.className=f.univariateAboveAndBelowSymbol,"horizontal"===l?s.style.width=`${o}px`:s.style.height=`${o}px`,!r&&n&&s.appendChild(n),t.preview=s}})}function v(t,o="classic"){const l=t.infos,n=l.at(0),r=l.at(-1),s=i(n.size)?e(n.size):0,c=i(r.size)?e(r.size):0;return"classic"===o?(s+a)/2:(s-c)/2}function h(e,t){if(!e)return null;const i=e.infos.map(e=>e.color),l=o("full"===t.type?i:"above"===t.type?i.slice(0,3):i.slice(2,5),{width:t.width,height:t.height,align:t.rampAlignment,
|
|
5
|
+
import{pt2px as e}from"../../../../core/screenUtils.js";import"../../../../libs/maquette/projection.js";import{createProjector as t}from"../../../../libs/maquette/projector.js";import{isNumber as i}from"../../../../support/guards.js";import{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import"../../../support/widgetUtils.js";import{tsx as l}from"../../../support/jsxFactory.js";const n=t(),r=10,s=20,a=10,c=20,f={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function p(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?l("svg",{height:"4",width:"10"},l("line",{style:t,x1:"0",x2:"10",y1:"2",y2:"2"})):l("svg",{height:"10",width:"10"},l("line",{style:t,x1:"5",x2:"5",y1:"0",y2:"10"}))}function m(e,t="vertical"){const i=document.createElement("div");return i.style.height=`${s}px`,i.className=f.univariateAboveAndBelowSymbol,null!=e&&(i.style.opacity=e.toString()),n.append(i,p.bind(null,t)),i}function u(t,o,l="vertical",n){t.infos.forEach((t,r)=>{if(n&&2===r)t.preview=m(o,l);else{const o=(i(t.size)?e(t.size):0)+("horizontal"===l?c:a),n=t.preview,r="div"===n?.tagName.toLowerCase(),s=r?n:document.createElement("div");s.className=f.univariateAboveAndBelowSymbol,"horizontal"===l?s.style.width=`${o}px`:s.style.height=`${o}px`,!r&&n&&s.appendChild(n),t.preview=s}})}function v(t,o="classic"){const l=t.infos,n=l.at(0),r=l.at(-1),s=i(n.size)?e(n.size):0,c=i(r.size)?e(r.size):0;return"classic"===o?(s+a)/2:(s-c)/2}function h(e,t){if(!e)return null;const i=e.infos.map(e=>e.color),l=o("full"===t.type?i:"above"===t.type?i.slice(0,3):i.slice(2,5),{width:t.width,height:t.height,align:t.rampAlignment,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel});return l.className=f.colorRamp,null!=t.opacity&&(l.style.opacity=t.opacity.toString()),l}function d(t,o,l,n="vertical"){let f=0;const p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m;for(let h=u;h<=v;h++)if(l&&h===m)f+="horizontal"===n?r:s;else{const t=p[h].size;f+=(i(t)?e(t):0)+("horizontal"===n?c:a)}return Math.round(f)}function y(t,o,l,n="vertical"){const f=d(t,o,l,n),p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m,h=i(p[u].size)?p[u].size:0,y=i(p[v].size)?p[v].size:0,b="full"===o?h+y:"above"===o?h:y,g=l?"vertical"===n?s:r:0,z="vertical"===n?a*("full"===o?2:1):c*("full"===o?2:1);return Math.round(f-(e(b)/2+g/2+z/2))}function b(e,t,i="vertical"){const o=e.infos;let l=o.find(({type:e})=>"size-ramp"===e),n=o.find(({type:e})=>"color-ramp"===e);return l&&(l={...l},l.infos=[...l.infos],u(l,t,i,!0)),n&&(n={...n},n.infos=[...n.infos]),"horizontal"===i&&(l?.infos.reverse(),n?.infos.reverse()),{sizeRampElement:l,colorRampElement:n}}function g(e,t="vertical"){const i=e.infos;let o=i.find(({type:e})=>"size-ramp"===e),l=i.find(({type:e})=>"color-ramp"===e);return o&&(o={...o},o.infos=[...o.infos],u(o,null,t,!1)),l&&(l={...l},l.infos=[...l.infos]),"horizontal"===t&&(o?.infos.reverse(),l?.infos.reverse()),{sizeRampElement:o,colorRampElement:l}}const z={marginLeft:"3px"},w={display:"table-cell",verticalAlign:"middle"},x={display:"flex",alignItems:"flex-start"};export{b as getUnivariateAboveAndBelowRampElements,v as getUnivariateColorRampMargin,h as getUnivariateColorRampPreview,y as getUnivariateColorRampSize,g as getUnivariateColorSizeRampElements,d as getUnivariateSizeRampSize,z as univariateColorRampContainerStyles,w as univariateColorRampStyles,x as univariateRampContainerStyles};
|