@arcgis/core 4.28.0-next.20230719 → 4.28.0-next.20230721
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/Color.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/lib/comment-handler.js +1 -1
- package/arcade/lib/parser.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{75c28da8d0b02d612d69.js → 040b3fc9c9c0736dd893.js} +1 -1
- package/assets/esri/core/workers/chunks/0652f6a8d5221e978033.js +1 -0
- package/assets/esri/core/workers/chunks/{e579ca7d4c1387e17305.js → 092fda62b6f62c2e4869.js} +2 -2
- package/assets/esri/core/workers/chunks/{57e0ad037188bd2997e7.js → 0af18a96cbd4e2d35436.js} +1 -1
- package/assets/esri/core/workers/chunks/0b5eeec0f66c87a46a0c.js +1 -0
- package/assets/esri/core/workers/chunks/{68e568b67b6fb34393db.js → 0cad2b991d0d0fd07846.js} +1 -1
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/256a82f6f6e1405fbcc6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb9213899049e1db90da.js → 2c57c9bd71637c5bed8a.js} +1 -1
- package/assets/esri/core/workers/chunks/2cdbabcbfe32286ec78d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b1c83453a862e01954b.js → 2d9d80b2d0042a9c09fb.js} +1 -1
- package/assets/esri/core/workers/chunks/2f9aec2238ff6cb99e09.js +1 -0
- package/assets/esri/core/workers/chunks/{55705b1bbac91d7db0e7.js → 32d940b2c891bf6ff9a2.js} +1 -1
- package/assets/esri/core/workers/chunks/3a0349c79551a03c2d8e.js +1 -0
- package/assets/esri/core/workers/chunks/{7dbd3e6406fb3e3a1a8f.js → 3cf748c025f3936c1cb2.js} +1 -1
- package/assets/esri/core/workers/chunks/4481d1103363434f16da.js +1 -0
- package/assets/esri/core/workers/chunks/58e11ca7c6e27e0ece7e.js +1 -0
- package/assets/esri/core/workers/chunks/5ae325e6a795c72eac6c.js +1 -0
- package/assets/esri/core/workers/chunks/5e4dde2886a1027b4b96.js +1 -0
- package/assets/esri/core/workers/chunks/{357e0381b6d767585576.js → 675e16d99758e67e5f51.js} +1 -1
- package/assets/esri/core/workers/chunks/726bb661b9e6998572e7.js +1 -0
- package/assets/esri/core/workers/chunks/730eb7e5f617fdab4f10.js +1 -0
- package/assets/esri/core/workers/chunks/{5a2e6bed9431cf4f42b1.js → 740dc67038f554431f1b.js} +1 -1
- package/assets/esri/core/workers/chunks/7cab61c9e09580520990.js +1 -0
- package/assets/esri/core/workers/chunks/{09178454bda15bb7929a.js → 7fbdfd1527582c52f9b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{26546aa98a338051df66.js → 807742f38885fa90b4fe.js} +1 -1
- package/assets/esri/core/workers/chunks/82dfbc175b52c7a10475.js +1 -0
- package/assets/esri/core/workers/chunks/870a05451e074b58f19a.js +1 -0
- package/assets/esri/core/workers/chunks/88038ad401e5ec02f4d3.js +1 -0
- package/assets/esri/core/workers/chunks/88d63d1e56732d148f67.js +1 -0
- package/assets/esri/core/workers/chunks/8b72cd9340e8a44358ac.js +1 -0
- package/assets/esri/core/workers/chunks/8c5a8c1dfb086069bb06.js +1 -0
- package/assets/esri/core/workers/chunks/99a5a434e0bad48c7a5c.js +1 -0
- package/assets/esri/core/workers/chunks/9a5916c66dad91d01d5b.js +1 -0
- package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +1 -0
- package/assets/esri/core/workers/chunks/9cddb504079d396779ea.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{9548aa449fe3a300c015.js → a4fa40dc77e116c954ac.js} +1 -1
- package/assets/esri/core/workers/chunks/a54ec9929a7db879d5db.js +1 -0
- package/assets/esri/core/workers/chunks/afc5b84693757fda2bc8.js +1 -0
- package/assets/esri/core/workers/chunks/{591b5c277cfd3a4101a4.js → b08f2a4aa94087c6c367.js} +1 -1
- package/assets/esri/core/workers/chunks/c0e12f6a7bb2360e4c21.js +1 -0
- package/assets/esri/core/workers/chunks/c8e656cd470a17f538e9.js +1 -0
- package/assets/esri/core/workers/chunks/d0e203405f95e14b1399.js +1 -0
- package/assets/esri/core/workers/chunks/d61506497275bafba384.js +1 -0
- package/assets/esri/core/workers/chunks/{ec72f492f24e67e008ae.js → d8e58dc14d3495f0830c.js} +1 -1
- package/assets/esri/core/workers/chunks/db9a303ee0468d018def.js +1 -0
- package/assets/esri/core/workers/chunks/ddc393a012588f799f42.js +1 -0
- package/assets/esri/core/workers/chunks/de3baa85b1639c25458d.js +1 -0
- package/assets/esri/core/workers/chunks/e66cea26064ba8353af0.js +1 -0
- package/assets/esri/core/workers/chunks/ea478f2f4a19463e13fd.js +1 -0
- package/assets/esri/core/workers/chunks/eba197e45507f56f3ed0.js +1 -0
- package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +1 -0
- package/assets/esri/core/workers/chunks/ef9a9a7d66d818720e20.js +1 -0
- package/assets/esri/core/workers/chunks/f3b458f55236566c940b.js +1 -0
- package/assets/esri/core/workers/chunks/fd0a91b9e0216cc269c3.js +1 -0
- package/assets/esri/core/workers/chunks/{a4fe220a912b1f428e49.js → fdd6403a8390d629392b.js} +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +13 -7
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +108 -4
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/core/Collection.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/accessorSupport/utils.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/interfaces.d.ts +9 -3
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/effects/EffectView.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISCachedService.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/bestImageUtils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterDatasets/pamParser.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelDimension.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/generateRendererUtils.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/tileInfoUtils.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/BaseLayerView2D.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +5 -0
- package/views/2d/tiling/TileInfoView.js +1 -1
- package/views/2d/tiling/TileInfoViewPOT.js +1 -1
- package/views/2d/tiling/TileQueue.js +1 -1
- package/views/2d/tiling.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +5 -0
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +5 -0
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +5 -0
- package/views/3d/webgl-engine/effects/SmaaRenderPass.js +5 -0
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/animation/pointToPoint/Path.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/webgl/ProgramCache.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
- package/widgets/BuildingExplorer/support/validation.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/colorRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/arcUtils.js +5 -0
- package/widgets/OrientedImageryViewer/constants.js +5 -0
- package/widgets/OrientedImageryViewer/utils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/assets/esri/core/workers/chunks/07bb40162d97d098bc19.js +0 -1
- package/assets/esri/core/workers/chunks/0a18317566c1fcb68422.js +0 -1
- package/assets/esri/core/workers/chunks/0de65e03db8c611af9fb.js +0 -1
- package/assets/esri/core/workers/chunks/1a60d23a92bcf91dbb22.js +0 -1
- package/assets/esri/core/workers/chunks/205a0b34b698d5329854.js +0 -1
- package/assets/esri/core/workers/chunks/2158a6ec165503ec4711.js +0 -1
- package/assets/esri/core/workers/chunks/25211d5904ee9d5f4a9d.js +0 -1
- package/assets/esri/core/workers/chunks/26b12d1ea713c1e07701.js +0 -1
- package/assets/esri/core/workers/chunks/2bfa7ee324c32a56b0d3.js +0 -1
- package/assets/esri/core/workers/chunks/370a992bd308bd806f48.js +0 -1
- package/assets/esri/core/workers/chunks/3892650ecc61322f6f7f.js +0 -1
- package/assets/esri/core/workers/chunks/38d168e9a29c40de179d.js +0 -1
- package/assets/esri/core/workers/chunks/4bf1c6c7e0a3051dc797.js +0 -1
- package/assets/esri/core/workers/chunks/524156c3f5383c2dd0e3.js +0 -1
- package/assets/esri/core/workers/chunks/59666ecb7c2c1f5a13b2.js +0 -1
- package/assets/esri/core/workers/chunks/5ae98195bdfd7dc0c44e.js +0 -1
- package/assets/esri/core/workers/chunks/5c005c9514354c77ec27.js +0 -1
- package/assets/esri/core/workers/chunks/5d46fd68878c973bcfab.js +0 -1
- package/assets/esri/core/workers/chunks/5dd23092c8a8a5ccd5d0.js +0 -1
- package/assets/esri/core/workers/chunks/620ec5c75561183d3d73.js +0 -1
- package/assets/esri/core/workers/chunks/68512670816f59c0e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/6c7374ebc18b46b3480a.js +0 -1
- package/assets/esri/core/workers/chunks/75ba2af92da232067adb.js +0 -1
- package/assets/esri/core/workers/chunks/7c1f0598a016516dcec3.js +0 -1
- package/assets/esri/core/workers/chunks/8dcec8d1b670d2b7ea2b.js +0 -1
- package/assets/esri/core/workers/chunks/8e07dfb6fc2673b640cb.js +0 -1
- package/assets/esri/core/workers/chunks/9008dde941cb3973de20.js +0 -1
- package/assets/esri/core/workers/chunks/9050b167355588b7003d.js +0 -1
- package/assets/esri/core/workers/chunks/9230d68799f0b0b9ef36.js +0 -1
- package/assets/esri/core/workers/chunks/94d124453e90a5ab1706.js +0 -1
- package/assets/esri/core/workers/chunks/9ca312af9c056b1efe40.js +0 -1
- package/assets/esri/core/workers/chunks/b0a57718a0765d1c8df0.js +0 -1
- package/assets/esri/core/workers/chunks/b431b81a7bf45dd527da.js +0 -1
- package/assets/esri/core/workers/chunks/bda311ad48efdb265939.js +0 -1
- package/assets/esri/core/workers/chunks/da547c3cabe4a89c3ce6.js +0 -1
- package/assets/esri/core/workers/chunks/dd295fa57b45b7ec4ec5.js +0 -1
- package/assets/esri/core/workers/chunks/eb92aa372e706ce5a5eb.js +0 -1
- package/assets/esri/core/workers/chunks/f553b464e969d45bf451.js +0 -1
- package/assets/esri/core/workers/chunks/f5865294983eb160de8c.js +0 -1
- package/assets/esri/core/workers/chunks/fdb7b1fbdb6fe091ad83.js +0 -1
- package/assets/esri/core/workers/chunks/fe8544bf3bbbacd74b8b.js +0 -1
- package/views/2d/tiling/PagedTileQueue.js +0 -5
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +0 -5
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +0 -5
- /package/views/3d/webgl-engine/{lib → effects}/SmaaRenderPassData.js +0 -0
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as n}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,formatDateFieldValue as v,getErrorMessageForFieldInput as _,getIconForFeature as b,isNumberFieldInput as g}from"./FeatureForm/featureFormUtils.js";import f from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{Heading as y,incrementHeadingLevel as F}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as R}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import{DateTime as O}from"luxon";import{substitute as V}from"../intl/substitute.js";import{getLocale as M}from"../intl/locale.js";const k="TT",D="data-field-name",x="latn",T=e=>"valueAsDate"in e,N="esri.widgets.FeatureForm",L=s.getLogger(N);let E=class extends r{constructor(e,t){super(e,t),this._activeNumberFieldEdit=null,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName="",this._inputsWithInvalidCodedValue=new Map,this._inputsWithInvalidSwitchValue=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new f,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t)=>{const{feature:i,relatedRecordCallbacks:n}=this;i&&n?.addRelatedRecord&&n.addRelatedRecord({parentFeature:i,relatedLayer:t,relationshipId:e})},this._handleInputInput=e=>{this._saveValueFromComponent(e.currentTarget)},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupClick=this._onGroupClick.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this)}initialize(){this.addHandles([o((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._focusedFieldName=e?.name||"",this._inputsWithChanges.clear(),this._inputsWithInvalidCodedValue.clear(),this._inputsWithInvalidSwitchValue.clear(),this._dateComponentMap.clear(),this._attemptFocusOnNextRender=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),o((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return C({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relatedRecordCallbacks(){return this.viewModel.relatedRecordCallbacks}set relatedRecordCallbacks(e){this.viewModel.relatedRecordCallbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return n(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){n(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return I("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return I("form",{class:d.form,novalidate:!0,onsubmit:this._onFormSubmit,onkeydown:this._onFormKeyDown},this._renderHeader(),this._renderContent())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&I(y,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&I("p",{class:d.description,key:"description"},e.formDescription);return I("div",{class:d.formHeader},t,i)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:I("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:n}=this,{description:s,inputs:o,label:a,state:l}=e,r=o.filter((e=>e.visible)),u=this.viewModel.findField(this._focusedFieldName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(s,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===l,C=f?d.collapseIcon:d.expandIcon;return I("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":s?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,n?d.inputDisabled:null),disabled:n,"data-group":e,id:h,key:t,onclick:this._onGroupClick},I("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},I("div",{class:d.groupTitle},I(y,{class:d.groupLabel,id:v,level:null!=i&&i.title?F(this.headingLevel):this.headingLevel},a),b),g?null:I("span",{class:this.classes(C,d.groupToggleIcon)})),r.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,n="forward"===e?i:i.slice().reverse();let s;if(!t||p(t))s=0;else if(u(t)){const e=t.inputs.find(c);s=e?n.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const n=t.group.inputs.filter(c);i="forward"===e?n.at(-1):n[0]}else i=t;s=n.indexOf(i)+1}for(let o=s;o<n.length;o++){const e=n[o];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:n,layer:s}=e;return I("label",{key:`${s.id}-${i.uid}-${e.name}`,class:d.label},[n,"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,element:n,inputType:s,name:o,updating:a,value:l}=e,r=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(n,"switch")){if(!(this._inputsWithInvalidSwitchValue.has(o)||null==l||n.input.onValue!==l&&n.input.offValue!==l))return this._renderSwitchComponent(e,r);this._inputsWithInvalidSwitchValue.add(o)}return"radio-buttons"===s?this._renderRadioButtonComponents(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),r):this._renderComboBoxComponent(e,this._getFieldValueOptions(o,i),r)}if("datetime-picker"===s||"date"===t)return this._renderDateComponents(e,r);const u="number"===t?I("input",{type:"number",...r,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${r.value}`}):"text-area"===s?I("textarea",{...r}):I("input",{type:"text",...r});return a?I("div",{key:`${r.key}-input-updating-wrapper`,class:d.fieldInputWrapper},u,I("div",{class:d.fieldInputLoader},I("calcite-progress",{type:"indeterminate"}))):u}_renderDateComponents(e,t){const{dateDataType:i,includeTime:n,label:s,name:o,valid:a,value:l}=e,{class:r,max:u,min:c,key:p,readOnly:m,required:h}=t;if("string"===i)return this._renderReadOnlyComponent(e,v(e.field,t.value));const{date:_,time:b}=this._formatValueForDateInputs(l),g=null!=u?this._formatValueForDateInputs(u):void 0,f=null!=c?this._formatValueForDateInputs(c):void 0,C=g?.date??void 0,y=f?.date??void 0,F={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,label:s,numberingSystem:x,overlayPositioning:"fixed",readOnly:m,required:h,tabIndex:0,[D]:o};return I("div",{key:`${p}-date-time-container`,class:d.dateInputContainer},I("calcite-input-date-picker",{bind:this,...F,class:this.classes(r,d.inputDate),"data-date-part":"date",key:`${p}-date-input`,valueAsDate:_??void 0,maxAsDate:C,minAsDate:y,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.target),onblur:e=>this._saveValueFromDateComponent(e.target,!0)}),n?I("calcite-input-time-picker",{bind:this,...F,class:this.classes(r,d.inputTime),"data-date-part":"time",key:`${p}-time-input`,value:b??void 0,step:1,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._saveValueFromDateComponent(e.target,!0)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return I("input",{afterCreate:i.afterCreate,afterUpdate:i.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:i.onfocus,readOnly:!0,tabIndex:i.tabIndex,type:"text",value:null!=t?`${t}`:i.value,[D]:i[D]})}_renderComboBoxComponent(e,t,i){const{element:n,required:s,value:o,name:a}=e,{messages:l,messagesTemplates:r,viewModel:d,_inputsWithChanges:u}=this,c=t.map((e=>e.map((({name:e,value:t})=>I("calcite-combobox-item",{key:`#${t}`,selected:o===t,textLabel:e,value:`${t}`}))))),[p,m]=c;this._registerIncompatibleValue(o,t.flat(),e,(e=>{m.unshift(I("calcite-combobox-item",{key:"incompatible-option",readOnly:!0,textLabel:`${e}`,value:`${e}`}))}));const v=m.length>0?[I("calcite-combobox-item-group",{key:"recommended",label:l.recommended},p),I("calcite-combobox-item-group",{key:"other",label:r.other},m)]:p,_=null==n,b=h(n,"combo-box"),g=_||b&&n.input?.showNoValueOption,f="INSERT"===d.arcadeEditType,C=u.has(a),y=null==o&&(!f||C);if(!s&&g){const e="",t=b&&n.input.noValueOptionLabel||l.empty;v.unshift(I("calcite-combobox-item",{value:e,textLabel:l.empty,selected:y,key:"empty-option"},t))}return I("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,clearDisabled:!0,onCalciteComboboxChange:({target:e})=>{y&&0===e.selectedItems.length?this._ignoreDeselectionOfNoValueOption(e):this._saveValueFromComponent(e)}},v)}_registerIncompatibleValue(e,t,{name:i},n){const s=this._inputsWithInvalidCodedValue,o=s.has(i);(o||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(o||s.set(i,e),n?.(e))}_renderRadioButtonComponents(e,t,i){const{element:n,name:s,required:o,value:a}=e,l=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:s,value:t,selected:t===a,props:i})));this._registerIncompatibleValue(a,t,e);const r=null==n,u=h(n,"radio-buttons"),c=r||u&&n.input?.showNoValueOption;if(!o&&c){const e="",t=u&&n.input.noValueOptionLabel||this.messages.empty,o=a===e||null===a;l.unshift(this._renderRadioButtonComponent({key:"empty-option",label:t,name:s,value:e,selected:o,props:i}))}return I("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},l)}_renderSwitchComponent(e,t){const{value:i}=e,n=!!h(e.element,"switch")&&i===e.element.input.onValue;return I("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._saveValueFromComponent(e.target),checked:n,disabled:t.readOnly})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:n,label:s,props:o}){return I("label",{key:e,class:d.inputRadioLabel},I("input",{...o,class:d.inputRadio,name:t,type:"radio",value:`${i}`,checked:n,disabled:o.readOnly,onchange:e=>this._saveValueFromComponent(e.target)}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.valid?_(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?I("calcite-input-message",{status:"invalid",icon:!0},i):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:n}=e,{relatedRecordCallbacks:s}=this;if(!n||!s?.showAllRelatedRecords)return;const o=this.messages;return I("calcite-list-item",{description:V(o.totalCount,{count:t}),label:o.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},I("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:n}=e,{relatedRecordCallbacks:s}=this;if(t&&s?.addRelatedRecord&&n)return I("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,disabled:e.updating,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i,n)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:n,title:s}=e,{feature:o,relatedRecordCallbacks:a}=this,l=()=>{a?.editRelatedRecord&&o&&a.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:i})};return I("calcite-list-item",{bind:this,description:n,label:s,key:`${t}-${i.uid}`,value:s,onclick:l},I("calcite-icon",{slot:"content-start",scale:"m",icon:b(i)}),I("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{featureCount:t,relationshipId:i,showAllEnabled:n}=e,s=n?null:this._renderDescriptionOrEmpty(e.description),o=t>0?this._renderRelatedRecordsList(e):e.loaded?this._renderNoRelatedRecordsNotice():void 0;return I("label",{class:this.classes(d.label,d.relationshipLabel),key:`relationship-${i}-container`},I("div",null,this._renderRelatedRecordsHeaderContainer(e),s,o),this._renderAddRelatedRecordButton(e))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return I("div",{class:d.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},I("span",null,e.label),t?I("calcite-loader",{label:this.messagesCommon?.loading,inline:!0,key:"loader",scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return I("calcite-list",{class:d.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoRelatedRecordsNotice(){return I("calcite-notice",{open:!0,scale:"s",kind:"brand",icon:"information",width:"full"},I("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return I("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:n,editable:s,group:o,hint:a,label:l,maxLength:r,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._inputsWithChanges.has(c),_=!s||t,b="all"===i&&null!=o&&"collapsed"===o.state;return{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:l,minlength:u>-1?`${u}`:"",maxlength:r>-1?`${r}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[D]:c,onfocus:this._onComponentFocus,oninput:this._handleInputInput,onblur:this._onComponentBlur,onkeydown:this._onComponentKeyDown,onmousedown:"number"===n?this._handleNumberInputMouseDown:void 0,placeholder:"number"===n||"text"===n?a??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(n.length>0){const e=new Set(n.map((e=>e.value)));return[n,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const s of this.viewModel.allFieldInputs){const{name:i,value:n}=s;null!=n&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=n)}const i=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const s of i){const i=s.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:o,name:a}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(n.has(o))continue;Object.entries(t).every((([e,t])=>!s.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,s.values[e])))&&n.set(o,{name:a,value:o})}return[...n.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(D))}_afterDateComponentCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateComponentMap.get(t),n=T(e);null!=i?n?i.date=e:i.time=e:this._dateComponentMap.set(t,{[n?"date":"time"]:e}),this._afterComponentCreateOrUpdate(e)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),n=t.findField(this._focusedFieldName),s=this._inputsWithInvalidCodedValue.get(i.name)===i.value;this._attemptFocusOnNextRender&&n===i&&("radio-buttons"!==i.inputType||s||e.checked)&&(this._attemptFocusOnNextRender=!1,m(i)&&(i.group.state="expanded"),e.focus())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name,g(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_onComponentBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._saveValueFromComponent(t),this.scheduleRender()}_saveValueFromDateComponent(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateComponentMap.has(i))return;const n=this._dateComponentMap.get(i);if(!n||!n.date)return;const s=this._getFieldValueFromDateComponent(e),o=this._getFieldValueFromDateComponents(n.date,n.time);this.viewModel.getValue(i)!==o&&(null!==s&&null!==o?this._updateFieldValue(i,o):t&&this._updateFieldValue(i,null))}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&g(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_onComponentKeyDown(e){const{key:t,altKey:i,ctrlKey:n,metaKey:s}=e,o=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(o)&&"collapsed"===o.group.state&&(o.group.state="expanded");else{const{type:a}=o.field,l="single"===a||"double"===a;if(("integer"===a||"small-integer"===a||l)&&(!i&&!n&&!s)&&1===t.length){const i=Number(t),n=["-","+"],s=["e","."],o=l?[...n,...s]:n;isNaN(i)&&!o.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;return"radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked?t.value:"number"===t.dataType?i?parseFloat(i):null:i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:L.warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,n="sequential"===this.groupDisplay,s=`.${d.groupHeader}`;if(!(i&&!e.target.closest(s))){if(this._focusedFieldName=this._getFocusableInput("forward",t)?.name||"",n){const n=e.target.closest(s);if(i&&!n)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._attemptFocusOnNextRender=n,this.scheduleRender()}}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:M(),numberingSystem:x}}_getFieldValueFromDateComponents(e,t){const i=this._getDateTimeFromComponent(e),n=this._getDateTimeFromComponent(t);if(!i&&!n)return null;const s=this._getFieldInputFromHTMLElement(e).range,o=Date.now(),a=null!=s.max&&s.max<o?s.max:o,l=O.fromMillis(a,this._getDefaultLocaleOptions()),r=i||l,{year:d,month:u,day:c}=r,{hour:p,minute:m,second:h}=n||l,v=r.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromComponent(e){if(!e)return null;let t=null;if(T(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=O.fromJSDate(i)}else{if(!e.value)return null;t=O.fromFormat(e.value,k,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateComponent(e){return this._dateTimeToFieldValue(this._getDateTimeFromComponent(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:O.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(k,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([a()],E.prototype,"_listObserverNode",void 0),e([a()],E.prototype,"_relatedRecordsEnabled",null),e([a()],E.prototype,"disabled",null),e([a()],E.prototype,"feature",null),e([a()],E.prototype,"formTemplate",null),e([a()],E.prototype,"groupDisplay",void 0),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"label",null),e([a()],E.prototype,"layer",null),e([a()],E.prototype,"map",null),e([a(),w("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"messages",void 0),e([a(),w("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a(),w("esri/widgets/Feature/t9n/Feature")],E.prototype,"messagesFeature",void 0),e([a(),w("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],E.prototype,"messagesTemplates",void 0),e([a()],E.prototype,"relatedRecordCallbacks",null),e([a()],E.prototype,"relationshipId",null),e([a()],E.prototype,"spatialReference",null),e([a()],E.prototype,"strict",null),e([a()],E.prototype,"view",null),e([a(),R(["value-change","submit"])],E.prototype,"viewModel",void 0),E=e([l(N)],E);const j=E;export{j as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as n}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,formatDateFieldValue as v,getErrorMessageForFieldInput as _,getIconForFeature as b,isNumberFieldInput as g}from"./FeatureForm/featureFormUtils.js";import f from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{Heading as y,incrementHeadingLevel as F}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as R}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import{DateTime as O}from"luxon";import{substitute as V}from"../intl/substitute.js";import{getLocale as M}from"../intl/locale.js";const k="TT",D="data-field-name",x="latn",T=e=>"valueAsDate"in e,N="esri.widgets.FeatureForm",L=s.getLogger(N);let E=class extends r{constructor(e,t){super(e,t),this._activeNumberFieldEdit=null,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName="",this._inputsWithInvalidCodedValue=new Map,this._inputsWithInvalidSwitchValue=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new f,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t)=>{const{feature:i,relatedRecordCallbacks:n}=this;i&&n?.addRelatedRecord&&n.addRelatedRecord({parentFeature:i,relatedLayer:t,relationshipId:e})},this._handleInputInput=e=>{this._saveValueFromComponent(e.currentTarget)},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupClick=this._onGroupClick.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this)}initialize(){this.addHandles([o((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._focusedFieldName=e?.name||"",this._inputsWithChanges.clear(),this._inputsWithInvalidCodedValue.clear(),this._inputsWithInvalidSwitchValue.clear(),this._dateComponentMap.clear(),this._attemptFocusOnNextRender=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),o((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return C({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relatedRecordCallbacks(){return this.viewModel.relatedRecordCallbacks}set relatedRecordCallbacks(e){this.viewModel.relatedRecordCallbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return n(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){n(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return I("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return I("form",{class:d.form,novalidate:!0,onsubmit:this._onFormSubmit,onkeydown:this._onFormKeyDown},this._renderHeader(),this._renderContent())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&I(y,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&I("p",{class:d.description,key:"description"},e.formDescription);return I("div",{class:d.formHeader},t,i)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:I("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:n}=this,{description:s,inputs:o,label:a,state:l}=e,r=o.filter((e=>e.visible)),u=this.viewModel.findField(this._focusedFieldName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(s,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===l,C=f?d.collapseIcon:d.expandIcon;return I("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":s?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,n?d.inputDisabled:null),disabled:n,"data-group":e,id:h,key:t,onclick:this._onGroupClick},I("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},I("div",{class:d.groupTitle},I(y,{class:d.groupLabel,id:v,level:null!=i&&i.title?F(this.headingLevel):this.headingLevel},a),b),g?null:I("span",{class:this.classes(C,d.groupToggleIcon)})),r.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,n="forward"===e?i:i.slice().reverse();let s;if(!t||p(t))s=0;else if(u(t)){const e=t.inputs.find(c);s=e?n.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const n=t.group.inputs.filter(c);i="forward"===e?n[n.length-1]:n[0]}else i=t;s=n.indexOf(i)+1}for(let o=s;o<n.length;o++){const e=n[o];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:n,layer:s}=e;return I("label",{key:`${s.id}-${i.uid}-${e.name}`,class:d.label},[n,"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,element:n,inputType:s,name:o,updating:a,value:l}=e,r=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(n,"switch")){if(!(this._inputsWithInvalidSwitchValue.has(o)||null==l||n.input.onValue!==l&&n.input.offValue!==l))return this._renderSwitchComponent(e,r);this._inputsWithInvalidSwitchValue.add(o)}return"radio-buttons"===s?this._renderRadioButtonComponents(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),r):this._renderComboBoxComponent(e,this._getFieldValueOptions(o,i),r)}if("datetime-picker"===s||"date"===t)return this._renderDateComponents(e,r);const u="number"===t?I("input",{type:"number",...r,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${r.value}`}):"text-area"===s?I("textarea",{...r}):I("input",{type:"text",...r});return a?I("div",{key:`${r.key}-input-updating-wrapper`,class:d.fieldInputWrapper},u,I("div",{class:d.fieldInputLoader},I("calcite-progress",{type:"indeterminate"}))):u}_renderDateComponents(e,t){const{dateDataType:i,includeTime:n,label:s,name:o,valid:a,value:l}=e,{class:r,max:u,min:c,key:p,readOnly:m,required:h}=t;if("string"===i)return this._renderReadOnlyComponent(e,v(e.field,t.value));const{date:_,time:b}=this._formatValueForDateInputs(l),g=null!=u?this._formatValueForDateInputs(u):void 0,f=null!=c?this._formatValueForDateInputs(c):void 0,C=g?.date??void 0,y=f?.date??void 0,F={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,label:s,numberingSystem:x,overlayPositioning:"fixed",readOnly:m,required:h,tabIndex:0,[D]:o};return I("div",{key:`${p}-date-time-container`,class:d.dateInputContainer},I("calcite-input-date-picker",{bind:this,...F,class:this.classes(r,d.inputDate),"data-date-part":"date",key:`${p}-date-input`,valueAsDate:_??void 0,maxAsDate:C,minAsDate:y,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.target),onblur:e=>this._saveValueFromDateComponent(e.target,!0)}),n?I("calcite-input-time-picker",{bind:this,...F,class:this.classes(r,d.inputTime),"data-date-part":"time",key:`${p}-time-input`,value:b??void 0,step:1,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._saveValueFromDateComponent(e.target,!0)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return I("input",{afterCreate:i.afterCreate,afterUpdate:i.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:i.onfocus,readOnly:!0,tabIndex:i.tabIndex,type:"text",value:null!=t?`${t}`:i.value,[D]:i[D]})}_renderComboBoxComponent(e,t,i){const{element:n,required:s,value:o,name:a}=e,{messages:l,messagesTemplates:r,viewModel:d,_inputsWithChanges:u}=this,c=t.map((e=>e.map((({name:e,value:t})=>I("calcite-combobox-item",{key:`#${t}`,selected:o===t,textLabel:e,value:`${t}`}))))),[p,m]=c;this._registerIncompatibleValue(o,t.flat(),e,(e=>{m.unshift(I("calcite-combobox-item",{key:"incompatible-option",readOnly:!0,textLabel:`${e}`,value:`${e}`}))}));const v=m.length>0?[I("calcite-combobox-item-group",{key:"recommended",label:l.recommended},p),I("calcite-combobox-item-group",{key:"other",label:r.other},m)]:p,_=null==n,b=h(n,"combo-box"),g=_||b&&n.input?.showNoValueOption,f="INSERT"===d.arcadeEditType,C=u.has(a),y=null==o&&(!f||C);if(!s&&g){const e="",t=b&&n.input.noValueOptionLabel||l.empty;v.unshift(I("calcite-combobox-item",{value:e,textLabel:l.empty,selected:y,key:"empty-option"},t))}return I("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,clearDisabled:!0,onCalciteComboboxChange:({target:e})=>{y&&0===e.selectedItems.length?this._ignoreDeselectionOfNoValueOption(e):this._saveValueFromComponent(e)}},v)}_registerIncompatibleValue(e,t,{name:i},n){const s=this._inputsWithInvalidCodedValue,o=s.has(i);(o||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(o||s.set(i,e),n?.(e))}_renderRadioButtonComponents(e,t,i){const{element:n,name:s,required:o,value:a}=e,l=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:s,value:t,selected:t===a,props:i})));this._registerIncompatibleValue(a,t,e);const r=null==n,u=h(n,"radio-buttons"),c=r||u&&n.input?.showNoValueOption;if(!o&&c){const e="",t=u&&n.input.noValueOptionLabel||this.messages.empty,o=a===e||null===a;l.unshift(this._renderRadioButtonComponent({key:"empty-option",label:t,name:s,value:e,selected:o,props:i}))}return I("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},l)}_renderSwitchComponent(e,t){const{value:i}=e,n=!!h(e.element,"switch")&&i===e.element.input.onValue;return I("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._saveValueFromComponent(e.target),checked:n,disabled:t.readOnly})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:n,label:s,props:o}){return I("label",{key:e,class:d.inputRadioLabel},I("input",{...o,class:d.inputRadio,name:t,type:"radio",value:`${i}`,checked:n,disabled:o.readOnly,onchange:e=>this._saveValueFromComponent(e.target)}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.valid?_(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?I("calcite-input-message",{status:"invalid",icon:!0},i):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:n}=e,{relatedRecordCallbacks:s}=this;if(!n||!s?.showAllRelatedRecords)return;const o=this.messages;return I("calcite-list-item",{description:V(o.totalCount,{count:t}),label:o.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},I("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:n}=e,{relatedRecordCallbacks:s}=this;if(t&&s?.addRelatedRecord&&n)return I("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,disabled:e.updating,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i,n)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:n,title:s}=e,{feature:o,relatedRecordCallbacks:a}=this,l=()=>{a?.editRelatedRecord&&o&&a.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:i})};return I("calcite-list-item",{bind:this,description:n,label:s,key:`${t}-${i.uid}`,value:s,onclick:l},I("calcite-icon",{slot:"content-start",scale:"m",icon:b(i)}),I("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{featureCount:t,relationshipId:i,showAllEnabled:n}=e,s=n?null:this._renderDescriptionOrEmpty(e.description),o=t>0?this._renderRelatedRecordsList(e):e.loaded?this._renderNoRelatedRecordsNotice():void 0;return I("label",{class:this.classes(d.label,d.relationshipLabel),key:`relationship-${i}-container`},I("div",null,this._renderRelatedRecordsHeaderContainer(e),s,o),this._renderAddRelatedRecordButton(e))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return I("div",{class:d.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},I("span",null,e.label),t?I("calcite-loader",{label:this.messagesCommon?.loading,inline:!0,key:"loader",scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return I("calcite-list",{class:d.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoRelatedRecordsNotice(){return I("calcite-notice",{open:!0,scale:"s",kind:"brand",icon:"information",width:"full"},I("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return I("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:n,editable:s,group:o,hint:a,label:l,maxLength:r,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._inputsWithChanges.has(c),_=!s||t,b="all"===i&&null!=o&&"collapsed"===o.state;return{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:l,minlength:u>-1?`${u}`:"",maxlength:r>-1?`${r}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[D]:c,onfocus:this._onComponentFocus,oninput:this._handleInputInput,onblur:this._onComponentBlur,onkeydown:this._onComponentKeyDown,onmousedown:"number"===n?this._handleNumberInputMouseDown:void 0,placeholder:"number"===n||"text"===n?a??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(n.length>0){const e=new Set(n.map((e=>e.value)));return[n,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const s of this.viewModel.allFieldInputs){const{name:i,value:n}=s;null!=n&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=n)}const i=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const s of i){const i=s.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:o,name:a}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(n.has(o))continue;Object.entries(t).every((([e,t])=>!s.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,s.values[e])))&&n.set(o,{name:a,value:o})}return[...n.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(D))}_afterDateComponentCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateComponentMap.get(t),n=T(e);null!=i?n?i.date=e:i.time=e:this._dateComponentMap.set(t,{[n?"date":"time"]:e}),this._afterComponentCreateOrUpdate(e)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),n=t.findField(this._focusedFieldName),s=this._inputsWithInvalidCodedValue.get(i.name)===i.value;this._attemptFocusOnNextRender&&n===i&&("radio-buttons"!==i.inputType||s||e.checked)&&(this._attemptFocusOnNextRender=!1,m(i)&&(i.group.state="expanded"),e.focus())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name,g(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_onComponentBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._saveValueFromComponent(t),this.scheduleRender()}_saveValueFromDateComponent(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateComponentMap.has(i))return;const n=this._dateComponentMap.get(i);if(!n||!n.date)return;const s=this._getFieldValueFromDateComponent(e),o=this._getFieldValueFromDateComponents(n.date,n.time);this.viewModel.getValue(i)!==o&&(null!==s&&null!==o?this._updateFieldValue(i,o):t&&this._updateFieldValue(i,null))}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&g(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_onComponentKeyDown(e){const{key:t,altKey:i,ctrlKey:n,metaKey:s}=e,o=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(o)&&"collapsed"===o.group.state&&(o.group.state="expanded");else{const{type:a}=o.field,l="single"===a||"double"===a;if(("integer"===a||"small-integer"===a||l)&&(!i&&!n&&!s)&&1===t.length){const i=Number(t),n=["-","+"],s=["e","."],o=l?[...n,...s]:n;isNaN(i)&&!o.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;return"radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked?t.value:"number"===t.dataType?i?parseFloat(i):null:i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:L.warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,n="sequential"===this.groupDisplay,s=`.${d.groupHeader}`;if(!(i&&!e.target.closest(s))){if(this._focusedFieldName=this._getFocusableInput("forward",t)?.name||"",n){const n=e.target.closest(s);if(i&&!n)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._attemptFocusOnNextRender=n,this.scheduleRender()}}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:M(),numberingSystem:x}}_getFieldValueFromDateComponents(e,t){const i=this._getDateTimeFromComponent(e),n=this._getDateTimeFromComponent(t);if(!i&&!n)return null;const s=this._getFieldInputFromHTMLElement(e).range,o=Date.now(),a=null!=s.max&&s.max<o?s.max:o,l=O.fromMillis(a,this._getDefaultLocaleOptions()),r=i||l,{year:d,month:u,day:c}=r,{hour:p,minute:m,second:h}=n||l,v=r.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromComponent(e){if(!e)return null;let t=null;if(T(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=O.fromJSDate(i)}else{if(!e.value)return null;t=O.fromFormat(e.value,k,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateComponent(e){return this._dateTimeToFieldValue(this._getDateTimeFromComponent(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:O.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(k,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([a()],E.prototype,"_listObserverNode",void 0),e([a()],E.prototype,"_relatedRecordsEnabled",null),e([a()],E.prototype,"disabled",null),e([a()],E.prototype,"feature",null),e([a()],E.prototype,"formTemplate",null),e([a()],E.prototype,"groupDisplay",void 0),e([a()],E.prototype,"headingLevel",void 0),e([a()],E.prototype,"label",null),e([a()],E.prototype,"layer",null),e([a()],E.prototype,"map",null),e([a(),w("esri/widgets/FeatureForm/t9n/FeatureForm")],E.prototype,"messages",void 0),e([a(),w("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([a(),w("esri/widgets/Feature/t9n/Feature")],E.prototype,"messagesFeature",void 0),e([a(),w("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],E.prototype,"messagesTemplates",void 0),e([a()],E.prototype,"relatedRecordCallbacks",null),e([a()],E.prototype,"relationshipId",null),e([a()],E.prototype,"spatialReference",null),e([a()],E.prototype,"strict",null),e([a()],E.prototype,"view",null),e([a(),R(["value-change","submit"])],E.prototype,"viewModel",void 0),E=e([l(N)],E);const j=E;export{j 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import s from"../../core/ObjectPool.js";import{when as r}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import s from"../../core/ObjectPool.js";import{when as r}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as a}from"../../layers/support/layerUtils.js";import i from"./TemplateItem.js";import n from"./TemplateItemGroup.js";var p;const u=({layer:e})=>({key:e,label:e.title??""}),m=({layer:e})=>({key:e.geometryType,label:e.geometryType??""});let y=p=class extends t.EventedAccessor{constructor(e){super(e),this._itemPool=new s(i),this._groupPool=new s(n),this.disabled=!1,this.filterFunction=null,this.selectedItem=null}initialize(){this._get("groupBy")||(this.groupBy="layer")}set groupBy(e){if(this._set("groupBy",e),"function"!=typeof e)switch(e){case"layer":this._groupByFunction=u;break;case"geometry":this._groupByFunction=m;break;default:this._groupByFunction=null}else this._groupByFunction=t=>this._ensureGroupByObject(e(t))}set layers(e){const t="layers";if(this.removeHandles(t),e){const s=()=>this.notifyChange("state");this.addHandles(e.map((e=>r((()=>e.loadStatus),s))),t)}this._set("layers",e)}get layers(){return this._get("layers")}get state(){const{layers:e}=this;return e&&0!==e.length?e.some((e=>"loading"===e.loadStatus||"not-loaded"===e.loadStatus))?"loading":"ready":"disabled"}get _featureTemplatesByLayer(){if(!this.layers)return new Map;const e=[];for(const t of this.layers)if("subtype-group"===t.type)for(const s of t.sublayers){const t=c(s);e.push([s,t])}else e.push([t,c(t)]);return new Map(e)}get numberOfFeatureTemplates(){return Array.from(this._featureTemplatesByLayer.values()).reduce(((e,t)=>e+t.length),0)}get items(){if(0===this.numberOfFeatureTemplates)return this._releasePreviousItems(),[];const e=this._featureTemplatesByLayer,t=[],s=null!=this.filterFunction?this.filterFunction:p._nullFilterFunction;for(const[l,i]of e)if(l.loaded||"subtype-sublayer"===l.type&&l.parent?.loaded){const e=a(l)?.operations;if(e?.supportsEditing&&e?.supportsAdd)for(const r of i)t.push({layer:l,template:r,matchesFilter:s({label:r.name})})}if(null==this._groupByFunction){const e=t.filter((({matchesFilter:e})=>e)).map((({template:e,layer:t})=>this._createItem(e,t)));return this._releasePreviousItems(),e}const r=new Map;for(const l of t){const{template:e,layer:t}=l,s=this._groupByFunction({template:e,layer:t}),{key:o,label:a}=null!=s.key?s:p.nullGroupBy;r.has(o)||r.set(o,{label:a,templateItemInfos:[]}),r.get(o)?.templateItemInfos.push(l)}const o=[];for(const l of r.values()){const{label:e,templateItemInfos:t}=l,r=t.filter((({matchesFilter:e})=>e)),a=s({label:e})?t:t.length>0?r:[];if(a.length>0){const t=a.map((({template:e,layer:t})=>this._createItem(e,t)));o.push(this._createGroup(e,t))}}return 1===o.length&&o[0].label===p.nullGroupBy.label?(this._releasePreviousItems(),o[0].items):(this._releasePreviousItems(),o)}refresh(){this.notifyChange("items")}select(e,{emit:t=!0}={}){const s=this.selectedItem,r=e?.clone()||null;this._set("selectedItem",r),t&&this.emit("select",{item:r,oldItem:s,template:r?.template??null})}_createItem(e,t){const s=this._itemPool.acquire();return s.set({template:e,layer:t}),s}_createGroup(e,t){const s=this._groupPool.acquire();return s.set("label",e),s.items=t,s}_releasePreviousItems(){this._destroyItems(this._get("items"))}_destroyItems(e){if(!e)return;e[0]instanceof i?e.forEach((e=>this._destroyItem(e))):e.forEach((e=>this._destroyGroup(e)))}_destroyGroup(e){e.items.forEach((e=>this._destroyItem(e))),e.items.length=0,this._groupPool.release(e)}_destroyItem(e){e.layer=null,e.template=null,this._itemPool.release(e)}_ensureGroupByObject(e){return"string"==typeof e?{key:e,label:e}:e}};y.nullGroupBy={key:Symbol(),label:"Other"},y._nullFilterFunction=e=>!0,e([o()],y.prototype,"_groupByFunction",void 0),e([o()],y.prototype,"disabled",void 0),e([o()],y.prototype,"filterFunction",void 0),e([o()],y.prototype,"groupBy",null),e([o()],y.prototype,"layers",null),e([o()],y.prototype,"state",null),e([o({readOnly:!0})],y.prototype,"_featureTemplatesByLayer",null),e([o({readOnly:!0})],y.prototype,"numberOfFeatureTemplates",null),e([o({readOnly:!0})],y.prototype,"items",null),e([o({readOnly:!0})],y.prototype,"selectedItem",void 0),y=p=e([l("esri.widgets.FeatureTemplates.FeatureTemplatesViewModel")],y);const c=e=>[..."templates"in e&&Array.isArray(e.templates)?e.templates:[],..."types"in e&&Array.isArray(e.types)?e.types.flatMap((e=>e.templates)):[]],h=y;export{h 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{watch as t,initial as r}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import{isTemplateItemGroup as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{watch as t,initial as r}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{isTable as n}from"../layers/support/layerUtils.js";import l from"./Widget.js";import{isTemplateItemGroup as a}from"./FeatureForm/featureFormUtils.js";import d from"./FeatureTemplates/FeatureTemplatesViewModel.js";import{ItemList as c}from"./FeatureTemplates/ItemList.js";import m from"./FeatureTemplates/TemplateItem.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";const v="esri-feature-templates",b={base:v,loader:`${v}__loader`,widget:"esri-widget"};function I(e){return e.length>0&&a(e[0])}function y(e){return e.id}const g={filter:!0};let w=class extends l{constructor(e,t){super(e,t),this.enableListScroll=!0,this.filterText="",this.headingLevel=4,this.messages=null,this.viewModel=new d,this.visibleElements={...g},this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const r=e.target;if(j(r))return void t.unobserve(r);const s=C(r),{layer:i,template:o}=s;F(r,!0);const n=await m.fetchThumbnail(i,o).catch((()=>(F(r,!1),null)));if(null==n)return;r.appendChild(n)}}))})),this.renderItemIcon=e=>n(e.layer)?f("span",{key:"icon","data-item":e,"data-has-icon":!0},f("calcite-icon",{icon:"table"})):f("span",{key:"icon",afterCreate:this._afterItemCreateOrUpdate,afterUpdate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,"data-item":e,"data-has-icon":!1}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}initialize(){const e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(t((()=>this.viewModel),((t,r)=>{t&&!t.filterFunction&&(this.filterFunction=e),r&&r!==t&&r.filterFunction===e&&(r.filterFunction=null)}),r))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js")})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}castVisibleElements(e){return{...g,...e}}select(e,t){return this.viewModel.select(e,t)}render(){const{disabled:e,enableListScroll:t,filterText:r,headingLevel:s,messages:i,viewModel:{items:o,numberOfFeatureTemplates:n,selectedItem:l,state:m}}=this,p=this.visibleElements.filter&&n>1;if(I(o)){const e=o.find((e=>e.label===d.nullGroupBy.label));e&&(e.label=i.other)}return f("div",{class:this.classes(b.base,b.widget),"aria-label":i.widgetLabel},"loading"===m?this.renderLoader():"ready"===m?f(c,{disabled:e,enableListScroll:t,filterEnabled:p,filterText:r,headingLevel:s,id:this.id,identify:y,items:o,messages:{filterPlaceholder:i.filterPlaceholder,noItems:i.noItems,noMatches:i.noMatches},renderIcon:this.renderItemIcon,renderCustomItem:this.renderCustomItem,renderCustomGroupContent:this.renderCustomGroupContent,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:l??void 0,selectionMode:"single",onItemSelect:e=>!a(e)&&this.viewModel.select(e),onFilterChange:e=>{this.filterText=e,this.viewModel.refresh()}}):null)}renderLoader(){return f("div",{class:b.loader,key:"loader"})}};function C(e){return e?.["data-item"]}function j(e){return!!e?.["data-has-icon"]}function F(e,t){e&&(e["data-has-icon"]=t)}e([s()],w.prototype,"disabled",null),e([s()],w.prototype,"enableListScroll",void 0),e([s()],w.prototype,"filterFunction",null),e([s()],w.prototype,"filterText",void 0),e([s()],w.prototype,"groupBy",null),e([s()],w.prototype,"headingLevel",void 0),e([s()],w.prototype,"label",null),e([s()],w.prototype,"layers",null),e([s(),u("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],w.prototype,"messages",void 0),e([s({readOnly:!0})],w.prototype,"selectedItem",null),e([s(),h("select")],w.prototype,"viewModel",void 0),e([s()],w.prototype,"visibleElements",void 0),e([i("visibleElements")],w.prototype,"castVisibleElements",null),e([s()],w.prototype,"renderCustomItem",void 0),e([s()],w.prototype,"renderCustomGroupContent",void 0),e([s()],w.prototype,"renderItemLabel",void 0),e([s()],w.prototype,"renderItemDescription",void 0),e([s()],w.prototype,"renderItemContent",void 0),e([s()],w.prototype,"renderItemContentEnd",void 0),w=e([o("esri.widgets.FeatureTemplates")],w);const M=w;export{M as default};
|
package/widgets/Features.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Logger.js";import{watch as s,when as r}from"../core/reactiveUtils.js";import{throttle as n}from"../core/throttle.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import c from"./Feature.js";import d from"./Spinner.js";import u from"./Widget.js";import{CSS as h}from"./Feature/resources.js";import{FeatureContentMixin as p}from"./Feature/support/FeatureContentMixin.js";import m from"./Features/FeaturesViewModel.js";import v from"./Features/FeaturesVisibleElements.js";import{getPointFromGeometry as w}from"./Popup/actionUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{substitute as M}from"../intl/substitute.js";const b="esri-features",y={calciteModeLight:"calcite-mode-light",calciteModeDark:"calcite-mode-dark",esriWidget:"esri-widget",esriWidgetPanel:"esri-widget--panel",base:`${b}`,container:`${b}__container`,contentFeature:`${b}__content-feature`,footer:`${b}__footer`,featureMenuObserver:`${b}__feature-menu-observer`,actionExit:`${b}__action--exit`},I="selected-index",R=0,x="features-spinner";let C=class extends(p(u)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusFeatureMenuFlowItem=!1,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new t,this._focusRootFlowItem=!1,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this.icon=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new m,this.visibleElements=new v,this._renderAction=(e,t)=>{const i=this._getActionTitle(e);return f("calcite-action",{appearance:"solid",bind:this,icon:this._getActionIcon(e),onclick:this._triggerAction,"data-action-uid":e.uid,disabled:e.disabled,indicator:e.indicator,loading:e.active,active:"toggle"===e.type&&e.value,key:`action-${t}`,text:i},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:i,slot:"tooltip"},i))},this._openFeatureMenu=()=>{this.featureMenuOpen=!0},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this._focusRootFlowItem=!0,this.featureMenuOpen=!1,this.viewModel.browseClusterEnabled=!1},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._displaySpinnerThrottled=n((()=>this._displaySpinner()),R),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.selectedFeatureWidget),(()=>this._destroyRelatedRecordsFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _activeFlowItemWidget(){return this._relatedRecordsFlowItems.at(-1)??null}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new c({flowItems:i,headingLevel:t+1,viewModel:o,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||o.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),this._rootFlowItemNode?.blur()}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{container:e}=this,{active:t}=this.viewModel;if(t||o.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),!e)return;const i=Array.from(e.querySelectorAll("calcite-flow-item")).at(-1);this.scheduleRender(),requestAnimationFrame((()=>i?.setFocus()))}next(){return this.viewModel.next()}open(e){this.removeHandles(I),this.viewModel.open(e),this.addHandles(r((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return f("div",{class:this.classes(y.base,y.esriWidget,y.esriWidgetPanel)},this._renderContentContainer())}_renderFooter(){return this._featureNavigationVisible?f("div",{slot:"footer",class:y.footer,key:"footer-actions"},this._renderPagination(),this._renderFeatureMenuButton()):null}_renderFeatureMenuButton(){const{messages:e,messagesCommon:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=this.viewModel;return f("calcite-action-group",{layout:"horizontal"},s>0?f("calcite-action",{appearance:"solid",key:"feature-menu-loading-action",loading:!0,scale:"s",text:t.loading||"",label:t.loading||""}):f("calcite-action",{appearance:"solid",key:"feature-menu-button",bind:this,scale:"s",textEnabled:!0,label:e.selectFeature||"",text:M(e.pageText||"",{total:i,index:(o+1).toLocaleString(void 0,{minimumIntegerDigits:i.toString().length,useGrouping:!1})}),onclick:this._openFeatureMenu,icon:"list"},f("calcite-tooltip",{overlayPositioning:"fixed",label:e.selectFeature,placement:"bottom",slot:"tooltip"},e.selectFeature)))}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return f("calcite-action-group",{layout:"horizontal"},f("calcite-action",{appearance:"solid",label:e,text:e,iconFlipRtl:!0,icon:"chevron-left",scale:"s",onclick:this._previousFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:e,slot:"tooltip"},e)),f("calcite-action",{appearance:"solid",label:t,text:t,iconFlipRtl:!0,icon:"chevron-right",scale:"s",onclick:this._nextFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:t,slot:"tooltip"},t)))}_renderFeatureMenuItem(e,t){const{selectedFeatureViewModel:i}=this.viewModel,o=e===i;return f("calcite-list-item",{bind:this,key:`feature-menu-item-${e.uid}`,selected:o,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature,"data-feature-index":t,onCalciteListItemSelect:this._selectFeature,label:e.title||this.messagesCommon.untitled})}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel;return e.length?f("calcite-list",{selectionMode:"single",selectionAppearance:"icon"},e.filter((e=>!!e.graphic)).map(((e,t)=>this._renderFeatureMenuItem(e,t)))):null}_renderContentFeature(){const{headingLevel:e,visibleElements:t}=this,{title:i,active:o}=this.viewModel,s=t.heading&&i?i:"";return f("calcite-flow-item",{bind:this,closed:!o,class:y.contentFeature,closable:t.closeButton,heading:s,headingLevel:e,onCalciteFlowItemClose:this.close,afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,key:"root-flow-item",onkeydown:this._onMainKeydown},this._renderActionBar(),f("div",{class:y.container},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:s,featureViewModels:r}=e;return t?f("calcite-flow-item",{bind:this,closable:!1,closed:!s,afterCreate:this._focusFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,loading:e.isLoadingFeature,heading:i.selectFeature,description:M(i.total,{total:r.length}),key:"feature-menu",onCalciteFlowItemBack:this._handleFeatureMenuBack},f("div",{class:y.container},this._renderFeatureMenu()),f("div",{class:y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),f("calcite-button",{onclick:this._handleFeatureMenuBack,slot:"footer-actions",appearance:"transparent",width:"full"},o.back)):null}_renderContentContainer(){const{_relatedRecordsFlowItems:e}=this,{content:t}=this.viewModel,i=e.toArray();return f("calcite-flow",{key:t??"content"},this._renderContentFeature(),this._renderFeatureMenuContainer(),i.map((e=>this._renderRelatedRecordsFlowItem(e))),f("div",{key:"content-tooltips"},i.map((e=>this._renderRelatedRecordsFlowItemTooltips(e)))))}_renderActionBar(){return this.visibleElements.actionBar&&this.viewModel.allActions?.length?f("calcite-action-bar",{key:"header-action-bar",expandDisabled:!0,slot:"action-bar"},f("calcite-action-group",null,this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?f("div",{class:h.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}_renderRelatedRecordsFlowItem(e){const{messages:t}=this,{visibleElements:i}=this,{active:o}=this.viewModel,s="graphic"in e&&!e.isTable;return f("calcite-flow-item",{bind:this,closed:!o,closable:i.closeButton,heading:e.title??"",description:this._getRelatedRecordsFlowItemDescription(e),onCalciteFlowItemBack:this._handleRelatedRecordsBackClick,onCalciteFlowItemClose:this.close,key:`flow-item-${e.viewModel.uid}`},f("calcite-action",{appearance:"transparent",class:y.actionExit,icon:"move-up",label:t.exitRelatedRecords,text:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyRelatedRecordsFlowItemWidgets}),s?f("calcite-action",{appearance:"transparent",icon:"zoom-to-object",label:t.selectFeature,text:t.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,f("div",{class:y.container},e.render()))}_renderRelatedRecordsFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,s=o.get(e);return[f("calcite-tooltip",{key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t.exitRelatedRecords),s?f("calcite-tooltip",{key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t.selectFeature):null]}_focusRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFeatureMenuFlowItem&&(this._focusFeatureMenuFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuFlowItem=!0}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon||"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,r=i?.attributes,n=e.title??"",l="zoom-to-feature"===s?M(n,{messages:t}):"remove-selected-feature"===s?M(n,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?M(n,{messages:t}):e.title;return l&&r?M(l,r):l??""}_onMainKeydown(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}_handleRelatedRecordsBackClick(){const e=this._relatedRecordsFlowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=w(i);this.open({features:[t],location:null!=o?o:void 0})}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyRelatedRecordsFlowItemWidgets(),this.featureMenuOpen=!1,this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),r=o.at(s);r&&"toggle"===r.type&&(r.value=!r.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new d({view:e}),e.ui.add(this._spinner,{key:x,position:"manual"}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,x),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([l()],C.prototype,"_focusFeatureMenuFlowItem",void 0),e([l()],C.prototype,"_relatedRecordsFlowItems",void 0),e([l()],C.prototype,"_focusRootFlowItem",void 0),e([l()],C.prototype,"_featureNavigationVisible",null),e([l()],C.prototype,"_activeFlowItemWidget",null),e([l()],C.prototype,"content",null),e([l()],C.prototype,"icon",void 0),e([l()],C.prototype,"featureMenuOpen",null),e([l()],C.prototype,"features",null),e([l()],C.prototype,"headingLevel",void 0),e([l()],C.prototype,"location",null),e([l()],C.prototype,"label",null),e([l(),g("esri/widgets/Features/t9n/Features")],C.prototype,"messages",void 0),e([l(),g("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([l()],C.prototype,"promises",null),e([l({readOnly:!0})],C.prototype,"selectedFeature",null),e([l()],C.prototype,"selectedFeatureIndex",null),e([l({readOnly:!0})],C.prototype,"selectedFeatureWidget",null),e([l()],C.prototype,"title",null),e([l()],C.prototype,"updateLocationEnabled",null),e([l()],C.prototype,"view",null),e([l({type:m}),F(["triggerAction","trigger-action"])],C.prototype,"viewModel",void 0),e([l({type:v,nonNullable:!0})],C.prototype,"visibleElements",void 0),e([l()],C.prototype,"visible",null),C=e([a("esri.widgets.Features")],C);const A=C;export{A as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Logger.js";import{watch as s,when as r}from"../core/reactiveUtils.js";import{throttle as n}from"../core/throttle.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import c from"./Feature.js";import d from"./Spinner.js";import u from"./Widget.js";import{CSS as h}from"./Feature/resources.js";import{FeatureContentMixin as p}from"./Feature/support/FeatureContentMixin.js";import m from"./Features/FeaturesViewModel.js";import v from"./Features/FeaturesVisibleElements.js";import{getPointFromGeometry as w}from"./Popup/actionUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{vmEvent as F}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{substitute as M}from"../intl/substitute.js";const b="esri-features",y={calciteModeLight:"calcite-mode-light",calciteModeDark:"calcite-mode-dark",esriWidget:"esri-widget",esriWidgetPanel:"esri-widget--panel",base:`${b}`,container:`${b}__container`,contentFeature:`${b}__content-feature`,footer:`${b}__footer`,featureMenuObserver:`${b}__feature-menu-observer`,actionExit:`${b}__action--exit`},I="selected-index",R=0,x="features-spinner";let C=class extends(p(u)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusFeatureMenuFlowItem=!1,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new t,this._focusRootFlowItem=!1,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this.icon=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new m,this.visibleElements=new v,this._renderAction=(e,t)=>{const i=this._getActionTitle(e);return f("calcite-action",{appearance:"solid",bind:this,icon:this._getActionIcon(e),onclick:this._triggerAction,"data-action-uid":e.uid,disabled:e.disabled,indicator:e.indicator,loading:e.active,active:"toggle"===e.type&&e.value,key:`action-${t}`,text:i},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:i,slot:"tooltip"},i))},this._openFeatureMenu=()=>{this.featureMenuOpen=!0},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this._focusRootFlowItem=!0,this.featureMenuOpen=!1,this.viewModel.browseClusterEnabled=!1},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._displaySpinnerThrottled=n((()=>this._displaySpinner()),R),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),s((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.selectedFeatureWidget),(()=>this._destroyRelatedRecordsFlowItemWidgets())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),s((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _activeFlowItemWidget(){return this._relatedRecordsFlowItems.at(-1)??null}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new c({flowItems:i,headingLevel:t+1,viewModel:o,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||o.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),this._rootFlowItemNode?.blur()}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{container:e}=this,{active:t}=this.viewModel;if(t||o.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),!e)return;const i=e.querySelectorAll("calcite-flow-item"),s=i[i?.length-1];this.scheduleRender(),requestAnimationFrame((()=>s?.setFocus()))}next(){return this.viewModel.next()}open(e){this.removeHandles(I),this.viewModel.open(e),this.addHandles(r((()=>!this.viewModel.waitingForResult),(()=>this._addSelectedFeatureIndexHandle()),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return f("div",{class:this.classes(y.base,y.esriWidget,y.esriWidgetPanel)},this._renderContentContainer())}_renderFooter(){return this._featureNavigationVisible?f("div",{slot:"footer",class:y.footer,key:"footer-actions"},this._renderPagination(),this._renderFeatureMenuButton()):null}_renderFeatureMenuButton(){const{messages:e,messagesCommon:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=this.viewModel;return f("calcite-action-group",{layout:"horizontal"},s>0?f("calcite-action",{appearance:"solid",key:"feature-menu-loading-action",loading:!0,scale:"s",text:t.loading||"",label:t.loading||""}):f("calcite-action",{appearance:"solid",key:"feature-menu-button",bind:this,scale:"s",textEnabled:!0,label:e.selectFeature||"",text:M(e.pageText||"",{total:i,index:(o+1).toLocaleString(void 0,{minimumIntegerDigits:i.toString().length,useGrouping:!1})}),onclick:this._openFeatureMenu,icon:"list"},f("calcite-tooltip",{overlayPositioning:"fixed",label:e.selectFeature,placement:"bottom",slot:"tooltip"},e.selectFeature)))}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return f("calcite-action-group",{layout:"horizontal"},f("calcite-action",{appearance:"solid",label:e,text:e,iconFlipRtl:!0,icon:"chevron-left",scale:"s",onclick:this._previousFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:e,slot:"tooltip"},e)),f("calcite-action",{appearance:"solid",label:t,text:t,iconFlipRtl:!0,icon:"chevron-right",scale:"s",onclick:this._nextFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:t,slot:"tooltip"},t)))}_renderFeatureMenuItem(e,t){const{selectedFeatureViewModel:i}=this.viewModel,o=e===i;return f("calcite-list-item",{bind:this,key:`feature-menu-item-${e.uid}`,selected:o,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature,"data-feature-index":t,onCalciteListItemSelect:this._selectFeature,label:e.title||this.messagesCommon.untitled})}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel;return e.length?f("calcite-list",{selectionMode:"single",selectionAppearance:"icon"},e.filter((e=>!!e.graphic)).map(((e,t)=>this._renderFeatureMenuItem(e,t)))):null}_renderContentFeature(){const{headingLevel:e,visibleElements:t}=this,{title:i,active:o}=this.viewModel,s=t.heading&&i?i:"";return f("calcite-flow-item",{bind:this,closed:!o,class:y.contentFeature,closable:t.closeButton,heading:s,headingLevel:e,onCalciteFlowItemClose:this.close,afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,key:"root-flow-item",onkeydown:this._onMainKeydown},this._renderActionBar(),f("div",{class:y.container},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:s,featureViewModels:r}=e;return t?f("calcite-flow-item",{bind:this,closable:!1,closed:!s,afterCreate:this._focusFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,loading:e.isLoadingFeature,heading:i.selectFeature,description:M(i.total,{total:r.length}),key:"feature-menu",onCalciteFlowItemBack:this._handleFeatureMenuBack},f("div",{class:y.container},this._renderFeatureMenu()),f("div",{class:y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),f("calcite-button",{onclick:this._handleFeatureMenuBack,slot:"footer-actions",appearance:"transparent",width:"full"},o.back)):null}_renderContentContainer(){const{_relatedRecordsFlowItems:e}=this,{content:t}=this.viewModel,i=e.toArray();return f("calcite-flow",{key:t??"content"},this._renderContentFeature(),this._renderFeatureMenuContainer(),i.map((e=>this._renderRelatedRecordsFlowItem(e))),f("div",{key:"content-tooltips"},i.map((e=>this._renderRelatedRecordsFlowItemTooltips(e)))))}_renderActionBar(){return this.visibleElements.actionBar&&this.viewModel.allActions?.length?f("calcite-action-bar",{key:"header-action-bar",expandDisabled:!0,slot:"action-bar"},f("calcite-action-group",null,this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?f("div",{class:h.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}_renderRelatedRecordsFlowItem(e){const{messages:t}=this,{visibleElements:i}=this,{active:o}=this.viewModel,s="graphic"in e&&!e.isTable;return f("calcite-flow-item",{bind:this,closed:!o,closable:i.closeButton,heading:e.title??"",description:this._getRelatedRecordsFlowItemDescription(e),onCalciteFlowItemBack:this._handleRelatedRecordsBackClick,onCalciteFlowItemClose:this.close,key:`flow-item-${e.viewModel.uid}`},f("calcite-action",{appearance:"transparent",class:y.actionExit,icon:"move-up",label:t.exitRelatedRecords,text:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyRelatedRecordsFlowItemWidgets}),s?f("calcite-action",{appearance:"transparent",icon:"zoom-to-object",label:t.selectFeature,text:t.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,f("div",{class:y.container},e.render()))}_renderRelatedRecordsFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,s=o.get(e);return[f("calcite-tooltip",{key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t.exitRelatedRecords),s?f("calcite-tooltip",{key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t.selectFeature):null]}_focusRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFeatureMenuFlowItem&&(this._focusFeatureMenuFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuFlowItem=!0}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon||"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,r=i?.attributes,n=e.title??"",l="zoom-to-feature"===s?M(n,{messages:t}):"remove-selected-feature"===s?M(n,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?M(n,{messages:t}):e.title;return l&&r?M(l,r):l??""}_onMainKeydown(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}_handleRelatedRecordsBackClick(){const e=this._relatedRecordsFlowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=w(i);this.open({features:[t],location:null!=o?o:void 0})}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyRelatedRecordsFlowItemWidgets(),this.featureMenuOpen=!1,this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),r=o.at(s);r&&"toggle"===r.type&&(r.value=!r.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new d({view:e}),e.ui.add(this._spinner,{key:x,position:"manual"}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,x),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([l()],C.prototype,"_focusFeatureMenuFlowItem",void 0),e([l()],C.prototype,"_relatedRecordsFlowItems",void 0),e([l()],C.prototype,"_focusRootFlowItem",void 0),e([l()],C.prototype,"_featureNavigationVisible",null),e([l()],C.prototype,"_activeFlowItemWidget",null),e([l()],C.prototype,"content",null),e([l()],C.prototype,"icon",void 0),e([l()],C.prototype,"featureMenuOpen",null),e([l()],C.prototype,"features",null),e([l()],C.prototype,"headingLevel",void 0),e([l()],C.prototype,"location",null),e([l()],C.prototype,"label",null),e([l(),g("esri/widgets/Features/t9n/Features")],C.prototype,"messages",void 0),e([l(),g("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([l()],C.prototype,"promises",null),e([l({readOnly:!0})],C.prototype,"selectedFeature",null),e([l()],C.prototype,"selectedFeatureIndex",null),e([l({readOnly:!0})],C.prototype,"selectedFeatureWidget",null),e([l()],C.prototype,"title",null),e([l()],C.prototype,"updateLocationEnabled",null),e([l()],C.prototype,"view",null),e([l({type:m}),F(["triggerAction","trigger-action"])],C.prototype,"viewModel",void 0),e([l({type:v,nonNullable:!0})],C.prototype,"visibleElements",void 0),e([l()],C.prototype,"visible",null),C=e([a("esri.widgets.Features")],C);const A=C;export{A 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends e{constructor(t){super(t),this.average=null,this.bins=null,this.max=null,this.min=null}get binRange(){const{bins:t}=this;return t&&t.length>1?t.
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends e{constructor(t){super(t),this.average=null,this.bins=null,this.max=null,this.min=null}get binRange(){const{bins:t}=this;return t&&t.length>1?t[t.length-1].maxValue-t[0].minValue:0}set labelFormatFunction(t){this._set("labelFormatFunction",t)}get range(){const{max:t,min:e}=this;return null!=t&&null!=e?t-e:0}get state(){const{bins:t,range:e}=this;return e>0&&t&&t.length?"ready":"disabled"}};t([r()],s.prototype,"average",void 0),t([r()],s.prototype,"bins",void 0),t([r({readOnly:!0})],s.prototype,"binRange",null),t([r()],s.prototype,"labelFormatFunction",null),t([r()],s.prototype,"max",void 0),t([r()],s.prototype,"min",void 0),t([r({readOnly:!0})],s.prototype,"range",null),t([r({readOnly:!0})],s.prototype,"state",null),s=t([o("esri.widgets.Histogram.HistogramViewModel")],s);const n=s;export{n 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Slider/SliderViewModel.js";import{formatDateLabel as a,formatNumberLabel as o}from"../smartMapping/support/utils.js";let i=class extends s{constructor(e){super(e),this.average=null,this.bins=null,this.hasTimeData=!1,this.labelFormatFunction=e=>{if(this.hasTimeData)return a(e);const{max:t,min:r,precision:s}=this,i=t-r>10?2:s;return o(parseFloat(e.toFixed(i)))},this.rangeType="equal",this.standardDeviation=null}generateWhereClause(e){const{rangeType:t,state:r,values:s}=this;if("ready"!==r||!s?.length||null==e)return null;const a=s[0],o=s.length>1?s.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Slider/SliderViewModel.js";import{formatDateLabel as a,formatNumberLabel as o}from"../smartMapping/support/utils.js";let i=class extends s{constructor(e){super(e),this.average=null,this.bins=null,this.hasTimeData=!1,this.labelFormatFunction=e=>{if(this.hasTimeData)return a(e);const{max:t,min:r,precision:s}=this,i=t-r>10?2:s;return o(parseFloat(e.toFixed(i)))},this.rangeType="equal",this.standardDeviation=null}generateWhereClause(e){const{rangeType:t,state:r,values:s}=this;if("ready"!==r||!s?.length||null==e)return null;const a=s[0],o=s.length>1?s[s.length-1]:null;switch(t){case"equal":return`${e} = ${a}`;case"not-equal":return`${e} <> ${a}`;case"less-than":return`${e} < ${a}`;case"greater-than":return`${e} > ${a}`;case"at-least":return`${e} >= ${a}`;case"at-most":return`${e} <= ${a}`;case"between":return`${e} BETWEEN ${a} AND ${o}`;case"not-between":return`${e} NOT BETWEEN ${a} AND ${o}`;default:return null}}};e([t()],i.prototype,"average",void 0),e([t()],i.prototype,"bins",void 0),e([t()],i.prototype,"hasTimeData",void 0),e([t()],i.prototype,"labelFormatFunction",void 0),e([t()],i.prototype,"rangeType",void 0),e([t()],i.prototype,"standardDeviation",void 0),i=e([r("esri.widgets.HistogramRangeSlider.HistogramRangeSliderViewModel")],i);const n=i;export{n 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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t}from"../../../core/reactiveUtils.js";import{pt2px as s}from"../../../core/screenUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as r}from"../../../symbols/support/svgUtils.js";import{getCSSFilterFromEffectList as o}from"../../../symbols/support/utils.js";import l from"../../Widget.js";import{CSS as n}from"./CardCSS.js";import{renderRelationshipRamp as c}from"./support/relationshipUtils.js";import{getUnivariateAboveAndBelowRampElements as p,getUnivariateSizeRampSize as d,getUnivariateColorRampSize as m,getUnivariateColorRampPreview as h,getUnivariateColorRampMargin as y,getUnivariateColorSizeRampElements as v}from"./support/univariateUtils.js";import{getTitle as u,attachToNode as f,isImageryStretchedLegend as g,getStretchStopLabel as b}from"../support/styleUtils.js";import{Heading as _,incrementHeadingLevel as w}from"../../support/Heading.js";import{accessibleHandler as L}from"../../support/decorators/accessibleHandler.js";import{messageBundle as S}from"../../support/decorators/messageBundle.js";import{tsx as x}from"../../support/jsxFactory.js";import{isRTL as C}from"../../support/widgetUtils.js";import{substitute as R}from"../../../intl/substitute.js";const $=25,k=25,z=768,I=100;var A;!function(e){e.Auto="auto",e.Stack="stack",e.SideBySide="side-by-side"}(A||(A={}));const N="#ddd",j=window.devicePixelRatio;function E(e){if(e){if(e.type.includes("3d")){const t=e.symbolLayers&&e.symbolLayers.length;if(!t)return;const s=e.symbolLayers.at(t-1),i=s.resource&&s.resource.primitive;return"circle"===i||"cross"===i||"kite"===i||"sphere"===i||"cube"===i||"diamond"===i}{const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}}}function F(e){if(e){if(e.type.includes("3d")){const t=e.symbolLayers&&e.symbolLayers.length;if(!t)return;const s=e.symbolLayers.at(t-1).get("resource.primitive");return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let T=class extends l{constructor(e,t){super(e,t),this._hasIndicators=!1,this._selectedSectionName=null,this._sectionNames=[],this._sectionMap=new Map,this.activeLayerInfos=null,this.headingLevel=3,this.layout=A.Stack,this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}initialize(){this.addHandles(t((()=>this.activeLayerInfos),(e=>{this.removeAllHandles(),this._watchForSectionChanges(e)})))}render(){const{view:e}=this;this._hasIndicators=this.layout===A.Auto&&e&&e.container.clientWidth<=z||this.layout===A.Stack;const t=this.activeLayerInfos,s=t&&t.toArray().map((e=>this._renderLegendForLayer(e))).filter((e=>!!e));this._hasIndicators?this._selectedSectionName&&this._sectionNames.includes(this._selectedSectionName)||(this._selectedSectionName=this._sectionNames&&this._sectionNames[0]):this._selectedSectionName=null;const i=this._sectionNames.length,a=this._sectionNames.map(((e,t)=>{const s=R(this.messagesCommon.pagination.pageText,{index:t+1,total:i});return x("div",{key:e,role:"tab",id:e,"aria-label":s,"aria-controls":`${e}-panel`,"aria-selected":(this._selectedSectionName===e).toString(),tabIndex:this._selectedSectionName===e?0:-1,title:s,onclick:this._selectSection,onkeydown:this._focusSection,bind:this,class:this.classes(n.indicator,{[n.activated]:this._selectedSectionName===e}),"data-section-name":e})})),r=this._hasIndicators&&i>1?x("div",{class:n.indicatorContainer,key:"carousel-navigation",role:"tablist"},a):null,o=this._hasIndicators?this._sectionMap.get(this._selectedSectionName):s&&s.length?s:null,l={[n.stacked]:this._hasIndicators};return x("div",{class:this.classes(n.base,l)},o||x("div",{class:n.message},this.messages.noLegend),r)}_selectSection(e){const t=e.target.getAttribute("data-section-name");t&&(this._selectedSectionName=t)}_focusSection(e){switch(e.key){case"ArrowLeft":case"ArrowRight":this._switchSectionOnArrowPress(e);break;case"Enter":case" ":this._selectSection(e)}}_switchSectionOnArrowPress(e){const t=e.key,s="ArrowLeft"===t?-1:1,i=e.target.getAttribute("data-section-name"),a=this._sectionNames.indexOf(i),r=this._sectionNames;let o=null;-1!==a&&(r[a+s]?o=document.getElementById(r[a+s]):"ArrowLeft"===t?o=document.getElementById(r.at(-1)):"ArrowRight"===t&&(o=document.getElementById(r[0])),o?.focus())}_watchForSectionChanges(e){if(this._generateSectionNames(),e){e.forEach((e=>{const s=`activeLayerInfo-${e.layer.uid}-version-change`;this.removeHandles(s),this._watchForSectionChanges(e.children),this.addHandles(t((()=>e.version),(()=>this._generateSectionNames())),s)}));const s="activeLayerInfos-collection-change";this.removeHandles(s),this.addHandles(e.on("change",(()=>this._watchForSectionChanges(e))),s)}}_generateSectionNames(){this._sectionNames.length=0,this._selectedSectionName=null,this.activeLayerInfos&&this.activeLayerInfos.forEach(this._generateSectionNamesForActiveLayerInfo,this)}_getSectionName(e,t,s){return`${this.id}${e.uid}-type-${t.type}-${s}`}_generateSectionNamesForActiveLayerInfo(e){e.children.forEach(this._generateSectionNamesForActiveLayerInfo,this),e.legendElements&&e.legendElements.forEach(((t,s)=>{this._sectionNames.push(this._getSectionName(e.layer,t,s))}))}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const t=e.children.map((e=>this._renderLegendForLayer(e))).toArray();return x("div",{key:e.layer.uid,class:this.classes(n.service,n.groupLayer)},x("div",{class:n.serviceCaptionContainer},e.title),t)}{const t=e.legendElements;if(t&&!t.length)return null;const s=t.some((e=>"relationship-ramp"===e.type)),i=t.map(((t,i)=>this._renderLegendForElement(t,e,i,s))).filter((e=>!!e));if(!i.length)return null;const a={[n.groupLayerChild]:!!e.parent};return x("div",{key:e.layer.uid,class:this.classes(n.service,a)},x("div",{class:n.serviceCaptionContainer},x("div",{class:n.serviceCaptionText},e.title)),x("div",{class:n.serviceContent},i))}}_renderLegendForElement(e,t,s,i=!1,a=!1){const r="color-ramp"===e.type,o="opacity-ramp"===e.type,l=t.layer;let p=null;if("string"==typeof e.title)p=e.title;else if(e.title){const t=e.title,s=u(this.messages,t,r||o);p=t.title?`${t.title} (${s})`:s}const d=this._getSectionName(l,e,s),m=this._hasIndicators&&!a?x("div",null,x(_,{level:this.headingLevel,class:n.carouselTitle},t.title),x(_,{level:w(this.headingLevel),class:n.layerCaption},p)):p?x(_,{level:this.headingLevel,class:n.layerCaption},p):null,h=t.effectList;let y=null;switch(e.type){case"symbol-table":{const s=e.infos.map(((s,i)=>this._renderLegendForElementInfo(s,t,e.legendType,i))).filter((e=>!!e));if(s.length){const e=s[0].properties.classes&&s[0].properties.classes[n.symbolRow],t={[n.labelContainer]:!e&&!i,[n.relationshipLabelContainer]:i};y=x("div",{class:this.classes(t)},s)}break}case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":y=this._renderLegendForRamp(e,l.opacity,h);break;case"size-ramp":y=this._renderSizeRamp(e,l.opacity);break;case"pie-chart-ramp":y=this._renderPieChartRamp(e);break;case"relationship-ramp":y=c(e,this.id,{opacity:l.opacity,effectList:h,ariaLabel:this.messages.previewRelationshipRampAriaLabel});break;case"univariate-above-and-below-ramp":y=this._renderUnivariateAboveAndBelowRamp(e,l.opacity,h);break;case"univariate-color-size-ramp":y=this._renderUnivariateColorSizeRamp(e,l.opacity,h)}if(!y)return null;const v=x("div",{key:d,class:n.section,id:`${d}-panel`,role:"tabpanel","aria-labelledby":d,tabIndex:0},[m,y]);return a||this._sectionMap.set(d,v),v}_renderPieChartRamp(e){return x("div",{class:n.pieChartRampPreview,bind:e.preview,afterCreate:f})}_renderUnivariateAboveAndBelowRamp(e,t,s){const{sizeRampElement:i,colorRampElement:a}=p(e,t,"horizontal");if(!i)return null;const r=d(i,"full",!0,"horizontal"),o=m(i,"above",!0,"horizontal"),l=m(i,"below",!0,"horizontal"),c=12,v=this.messages?.previewColorRampAriaLabel,u=h(a,{width:o,height:c,rampAlignment:"horizontal",opacity:t,type:"above",effectList:s,ariaLabel:v}),g=h(a,{width:l,height:c,rampAlignment:"horizontal",opacity:t,type:"below",effectList:s,ariaLabel:v}),b=y(i,"card"),_=i.infos.map((e=>e.label)),w=_.length-1,L=_.map(((e,t)=>0===t||t===w?x("div",{key:t},e):null)),S={display:"flex",flexDirection:"column"},R={display:"flex",flexDirection:"row"},$={marginTop:"3px",display:"flex"};C(this.container)?$.marginRight=`${b}px`:$.marginLeft=`${b}px`;const k={width:`${r}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return x("div",{class:n.layerRow,key:"size-ramp-preview",styles:S},x("div",{class:this.classes(n.symbolContainer,n.sizeRampHorizontal),styles:R},i.infos.map(((e,t)=>x("div",{key:t,class:n.symbol,bind:e.preview,afterCreate:f})))),u?x("div",{class:n.univariateAboveAndBelowColorRamp,styles:$,key:"color-ramp-preview"},x("div",{bind:u,afterCreate:f}),x("div",{bind:g,afterCreate:f})):null,x("div",{class:n.layerInfo},x("div",{class:n.rampLabelsContainer,styles:k},L)))}_renderUnivariateColorSizeRamp(e,t,s){const{sizeRampElement:i,colorRampElement:a}=v(e,"horizontal");if(!i)return null;const r=d(i,"full",!1,"horizontal"),o=m(i,"full",!1,"horizontal"),l=h(a,{width:o,height:12,rampAlignment:"horizontal",opacity:t,type:"full",effectList:s,ariaLabel:this.messages?.previewColorRampAriaLabel}),c=y(i,"card"),p=i.infos.length-1,u=i.infos.map(((e,t)=>0===t||t===p?x("div",{key:t},e.label):null)),g={display:"flex",flexDirection:"column"},b={display:"flex",flexDirection:"row"},_={marginTop:"3px",display:"flex"};C(this.container)?_.marginRight=`${c}px`:_.marginLeft=`${c}px`;const w={width:`${r}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return x("div",{class:n.layerRow,key:"size-ramp-preview",styles:g},x("div",{class:this.classes(n.symbolContainer,n.sizeRampHorizontal),styles:b},i.infos.map(((e,t)=>x("div",{key:t,class:n.symbol,bind:e.preview,afterCreate:f})))),x("div",{class:n.univariateAboveAndBelowColorRamp,styles:_,key:"color-ramp-preview"},x("div",{bind:l,afterCreate:f})),x("div",{class:n.layerInfo},x("div",{class:n.rampLabelsContainer,styles:w},u)))}_renderLegendForElementInfo(e,t,s,i){const a=t.layer;if(e.type)return this._renderLegendForElement(e,t,i,!1,!0);const r=g(a,s),l=u(this.messages,e.label,!1)??"";if(e.preview){if(!e.symbol||!e.symbol.type.includes("simple-fill")){if(!e.label)return x("div",{key:i,bind:e.preview,afterCreate:f});const t={[n.symbolCell]:this._hasIndicators};return x("div",{key:i,class:this.classes(n.layerRow,{[n.symbolRow]:this._hasIndicators})},x("div",{class:this.classes(t),bind:e.preview,afterCreate:f}),x("div",{class:this.classes(n.imageLabel,{[n.labelCell]:this._hasIndicators})},l))}let s=255,r=255,c=255,p=0,d=255,m=255,h=255,y=0;const v=e.symbol.color&&e.symbol.color.a,u=e.symbol.outline&&e.symbol.outline.color&&e.symbol.outline.color.a;v&&(s=e.symbol.color.r,r=e.symbol.color.g,c=e.symbol.color.b,p=e.symbol.color.a*a.opacity),u&&(d=e.symbol.outline.color.r,m=e.symbol.outline.color.g,h=e.symbol.outline.color.b,y=e.symbol.outline.color.a*a.opacity);const g=e.symbol.color?.isBright??!0,b=g?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)",_={background:v?`rgba(${s}, ${r}, ${c}, ${p})`:"none",color:g?"black":"white",textShadow:`-1px -1px 0 ${b},\n 1px -1px 0 ${b},\n -1px 1px 0 ${b},\n 1px 1px 0 ${b}`,border:u?`1px solid rgba(${d}, ${m}, ${h}, ${y})`:"none",filter:o(t.effectList)??void 0};return x("div",{key:i,class:n.layerRow},x("div",{class:n.labelElement,styles:_},l))}if(e.src){const t=this._renderImage(e,a,r);return x("div",{key:i,class:n.layerRow},t,x("div",{class:n.imageLabel},l))}}_renderImage(e,t,s){const{label:i,src:a,opacity:r}=e,o={[n.imageryLayerStretchedImage]:s,[n.symbol]:!s},l={opacity:`${null!=r?r:t.opacity}`};return x("img",{alt:u(this.messages,i,!1),"aria-label":u(this.messages,i,!1),src:a,border:0,width:e.width,height:e.height,class:this.classes(o),styles:l})}_renderSizeRampLines(e){const t=e.infos,i=t[0],a=t.at(-1),r=i.symbol,o=this._hasIndicators,l=s(i.size+i.outlineSize)*j,n=s(a.size+a.outlineSize)*j,c=o?l:l+50*j,p=o?l/2+50*j:l,d=F(r),m=E(r),h=document.createElement("canvas");h.width=c,h.height=p,h.style.width=h.width/j+"px",h.style.height=h.height/j+"px";const y=h.getContext("2d");if(o){y.beginPath();const e=0,t=0,s=c/2-n/2,i=p;y.moveTo(e,t),y.lineTo(s,i);const a=c,r=0,o=c/2+n/2,l=p;y.moveTo(a,r),y.lineTo(o,l)}else{y.beginPath();const e=0,t=p/2-n/2,s=c,i=0;y.moveTo(e,t),y.lineTo(s,i);const a=0,r=p/2+n/2,o=c,l=p;y.moveTo(a,r),y.lineTo(o,l)}return y.strokeStyle=N,y.stroke(),x("div",{bind:h,afterCreate:f,styles:o?{display:"flex",marginTop:`-${d?0:m?l/2:0}px`,marginBottom:`-${d?n:m?n/2:0}px`}:{display:"flex",marginRight:`-${d?0:m?l/2:0}px`,marginLeft:`-${d?0:m?n/2:0}px`}})}_renderSizeRamp(e,t){const s=e.infos,i=s[0].label,a=s.at(-1).label;let r=s[0].preview,o=s.at(-1).preview;const l=this._hasIndicators,c={"flex-direction":l?"column":"row-reverse"};r&&(r=r.cloneNode(!0),r.style.display="flex"),o&&(o=o.cloneNode(!0),o.style.display="flex");const p={opacity:null!=t?`${t}`:""};return x("div",{class:this.classes(n.layerRow,{[n.sizeRampRow]:l})},x("div",{class:n.rampLabel},l?i:a),x("div",{class:n.sizeRampContainer,styles:c},x("div",{bind:r,afterCreate:f,class:n.sizeRampPreview,styles:p}),this._renderSizeRampLines(e),x("div",{bind:o,afterCreate:f,class:n.sizeRampContainer,styles:p})),x("div",{class:n.rampLabel},l?a:i))}_getRampStopLabel(e,t){switch(t){case"heatmap-ramp":return this.messages[e.label];case"stretch-ramp":return b(e,this.messages);default:return e.label}}_renderLegendForRamp(e,t,s){const i=e.infos,a=e.type,l="heatmap-ramp"===a,c=i.length-1,p=k,d=c>2&&!l?$*c:I,m=d+20,h=10,y=i.slice(0).reverse(),v=y.length-1,u=y.length%2!=0?y[y.length/2|0]:null,f=u&&x("div",{class:n.intervalSeparatorsContainer},x("div",{class:n.intervalSeparator},"|"),x("div",{class:n.rampLabel},this._getRampStopLabel(u,a))),g=[[{shape:{type:"path",path:`M0 ${p/2} L${h} 0 L${h} ${p} Z`},fill:y[0].color,stroke:{width:0}},{shape:{type:"rect",x:h,y:0,width:d,height:p},fill:{type:"linear",x1:h,y1:0,x2:d+h,y2:0,colors:y.map(((e,t)=>({color:e.color?.toArray(),offset:l&&"ratio"in e?e.ratio:t/c})))},stroke:{width:0}},{shape:{type:"path",path:`M${d+h} 0 L${m} ${p/2} L${d+h} ${p} Z`},fill:y[v].color,stroke:{width:0}}]],b=r(g,m,p),_={filter:o(s)??void 0,opacity:null==t?void 0:`${t}`},w={justifyContent:"center"};return x("div",{class:n.layerRow,styles:w},x("div",{class:n.rampLabel},this._getRampStopLabel(y[0],a)),x("div",{class:n.symbolContainer},x("div",{styles:_},b),f),x("div",{class:n.rampLabel},this._getRampStopLabel(y[v],a)))}};e([i()],T.prototype,"activeLayerInfos",void 0),e([i()],T.prototype,"headingLevel",void 0),e([i()],T.prototype,"layout",void 0),e([i(),S("esri/widgets/Legend/t9n/Legend")],T.prototype,"messages",void 0),e([i(),S("esri/t9n/common")],T.prototype,"messagesCommon",void 0),e([i({readOnly:!0})],T.prototype,"type",void 0),e([i()],T.prototype,"view",void 0),e([L()],T.prototype,"_selectSection",null),T=e([a("esri.widgets.Legend.styles.Card")],T);const U=T;export{U as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t}from"../../../core/reactiveUtils.js";import{pt2px as s}from"../../../core/screenUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as r}from"../../../symbols/support/svgUtils.js";import{getCSSFilterFromEffectList as o}from"../../../symbols/support/utils.js";import l from"../../Widget.js";import{CSS as n}from"./CardCSS.js";import{renderRelationshipRamp as c}from"./support/relationshipUtils.js";import{getUnivariateAboveAndBelowRampElements as p,getUnivariateSizeRampSize as d,getUnivariateColorRampSize as m,getUnivariateColorRampPreview as h,getUnivariateColorRampMargin as y,getUnivariateColorSizeRampElements as g}from"./support/univariateUtils.js";import{getTitle as v,attachToNode as u,isImageryStretchedLegend as f,getStretchStopLabel as b}from"../support/styleUtils.js";import{Heading as _,incrementHeadingLevel as w}from"../../support/Heading.js";import{accessibleHandler as L}from"../../support/decorators/accessibleHandler.js";import{messageBundle as S}from"../../support/decorators/messageBundle.js";import{tsx as x}from"../../support/jsxFactory.js";import{isRTL as C}from"../../support/widgetUtils.js";import{substitute as R}from"../../../intl/substitute.js";const $=25,k=25,z=768,I=100;var A;!function(e){e.Auto="auto",e.Stack="stack",e.SideBySide="side-by-side"}(A||(A={}));const N="#ddd",j=window.devicePixelRatio;function E(e){if(e){if(e.type.includes("3d")){const t=e.symbolLayers&&e.symbolLayers.length;if(!t)return;const s=e.symbolLayers.at(t-1),i=s.resource&&s.resource.primitive;return"circle"===i||"cross"===i||"kite"===i||"sphere"===i||"cube"===i||"diamond"===i}{const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}}}function F(e){if(e){if(e.type.includes("3d")){const t=e.symbolLayers&&e.symbolLayers.length;if(!t)return;const s=e.symbolLayers.at(t-1).get("resource.primitive");return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let T=class extends l{constructor(e,t){super(e,t),this._hasIndicators=!1,this._selectedSectionName=null,this._sectionNames=[],this._sectionMap=new Map,this.activeLayerInfos=null,this.headingLevel=3,this.layout=A.Stack,this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}initialize(){this.addHandles(t((()=>this.activeLayerInfos),(e=>{this.removeAllHandles(),this._watchForSectionChanges(e)})))}render(){const{view:e}=this;this._hasIndicators=this.layout===A.Auto&&e&&e.container.clientWidth<=z||this.layout===A.Stack;const t=this.activeLayerInfos,s=t&&t.toArray().map((e=>this._renderLegendForLayer(e))).filter((e=>!!e));this._hasIndicators?this._selectedSectionName&&this._sectionNames.includes(this._selectedSectionName)||(this._selectedSectionName=this._sectionNames&&this._sectionNames[0]):this._selectedSectionName=null;const i=this._sectionNames.length,a=this._sectionNames.map(((e,t)=>{const s=R(this.messagesCommon.pagination.pageText,{index:t+1,total:i});return x("div",{key:e,role:"tab",id:e,"aria-label":s,"aria-controls":`${e}-panel`,"aria-selected":(this._selectedSectionName===e).toString(),tabIndex:this._selectedSectionName===e?0:-1,title:s,onclick:this._selectSection,onkeydown:this._focusSection,bind:this,class:this.classes(n.indicator,{[n.activated]:this._selectedSectionName===e}),"data-section-name":e})})),r=this._hasIndicators&&i>1?x("div",{class:n.indicatorContainer,key:"carousel-navigation",role:"tablist"},a):null,o=this._hasIndicators?this._sectionMap.get(this._selectedSectionName):s&&s.length?s:null,l={[n.stacked]:this._hasIndicators};return x("div",{class:this.classes(n.base,l)},o||x("div",{class:n.message},this.messages.noLegend),r)}_selectSection(e){const t=e.target.getAttribute("data-section-name");t&&(this._selectedSectionName=t)}_focusSection(e){switch(e.key){case"ArrowLeft":case"ArrowRight":this._switchSectionOnArrowPress(e);break;case"Enter":case" ":this._selectSection(e)}}_switchSectionOnArrowPress(e){const t=e.key,s="ArrowLeft"===t?-1:1,i=e.target.getAttribute("data-section-name"),a=this._sectionNames.indexOf(i),r=this._sectionNames;let o=null;-1!==a&&(r[a+s]?o=document.getElementById(r[a+s]):"ArrowLeft"===t?o=document.getElementById(r[r.length-1]):"ArrowRight"===t&&(o=document.getElementById(r[0])),o?.focus())}_watchForSectionChanges(e){if(this._generateSectionNames(),e){e.forEach((e=>{const s=`activeLayerInfo-${e.layer.uid}-version-change`;this.removeHandles(s),this._watchForSectionChanges(e.children),this.addHandles(t((()=>e.version),(()=>this._generateSectionNames())),s)}));const s="activeLayerInfos-collection-change";this.removeHandles(s),this.addHandles(e.on("change",(()=>this._watchForSectionChanges(e))),s)}}_generateSectionNames(){this._sectionNames.length=0,this._selectedSectionName=null,this.activeLayerInfos&&this.activeLayerInfos.forEach(this._generateSectionNamesForActiveLayerInfo,this)}_getSectionName(e,t,s){return`${this.id}${e.uid}-type-${t.type}-${s}`}_generateSectionNamesForActiveLayerInfo(e){e.children.forEach(this._generateSectionNamesForActiveLayerInfo,this),e.legendElements&&e.legendElements.forEach(((t,s)=>{this._sectionNames.push(this._getSectionName(e.layer,t,s))}))}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const t=e.children.map((e=>this._renderLegendForLayer(e))).toArray();return x("div",{key:e.layer.uid,class:this.classes(n.service,n.groupLayer)},x("div",{class:n.serviceCaptionContainer},e.title),t)}{const t=e.legendElements;if(t&&!t.length)return null;const s=t.some((e=>"relationship-ramp"===e.type)),i=t.map(((t,i)=>this._renderLegendForElement(t,e,i,s))).filter((e=>!!e));if(!i.length)return null;const a={[n.groupLayerChild]:!!e.parent};return x("div",{key:e.layer.uid,class:this.classes(n.service,a)},x("div",{class:n.serviceCaptionContainer},x("div",{class:n.serviceCaptionText},e.title)),x("div",{class:n.serviceContent},i))}}_renderLegendForElement(e,t,s,i=!1,a=!1){const r="color-ramp"===e.type,o="opacity-ramp"===e.type,l=t.layer;let p=null;if("string"==typeof e.title)p=e.title;else if(e.title){const t=e.title,s=v(this.messages,t,r||o);p=t.title?`${t.title} (${s})`:s}const d=this._getSectionName(l,e,s),m=this._hasIndicators&&!a?x("div",null,x(_,{level:this.headingLevel,class:n.carouselTitle},t.title),x(_,{level:w(this.headingLevel),class:n.layerCaption},p)):p?x(_,{level:this.headingLevel,class:n.layerCaption},p):null,h=t.effectList;let y=null;switch(e.type){case"symbol-table":{const s=e.infos.map(((s,i)=>this._renderLegendForElementInfo(s,t,e.legendType,i))).filter((e=>!!e));if(s.length){const e=s[0].properties.classes&&s[0].properties.classes[n.symbolRow],t={[n.labelContainer]:!e&&!i,[n.relationshipLabelContainer]:i};y=x("div",{class:this.classes(t)},s)}break}case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":y=this._renderLegendForRamp(e,l.opacity,h);break;case"size-ramp":y=this._renderSizeRamp(e,l.opacity);break;case"pie-chart-ramp":y=this._renderPieChartRamp(e);break;case"relationship-ramp":y=c(e,this.id,{opacity:l.opacity,effectList:h,ariaLabel:this.messages.previewRelationshipRampAriaLabel});break;case"univariate-above-and-below-ramp":y=this._renderUnivariateAboveAndBelowRamp(e,l.opacity,h);break;case"univariate-color-size-ramp":y=this._renderUnivariateColorSizeRamp(e,l.opacity,h)}if(!y)return null;const g=x("div",{key:d,class:n.section,id:`${d}-panel`,role:"tabpanel","aria-labelledby":d,tabIndex:0},[m,y]);return a||this._sectionMap.set(d,g),g}_renderPieChartRamp(e){return x("div",{class:n.pieChartRampPreview,bind:e.preview,afterCreate:u})}_renderUnivariateAboveAndBelowRamp(e,t,s){const{sizeRampElement:i,colorRampElement:a}=p(e,t,"horizontal");if(!i)return null;const r=d(i,"full",!0,"horizontal"),o=m(i,"above",!0,"horizontal"),l=m(i,"below",!0,"horizontal"),c=12,g=this.messages?.previewColorRampAriaLabel,v=h(a,{width:o,height:c,rampAlignment:"horizontal",opacity:t,type:"above",effectList:s,ariaLabel:g}),f=h(a,{width:l,height:c,rampAlignment:"horizontal",opacity:t,type:"below",effectList:s,ariaLabel:g}),b=y(i,"card"),_=i.infos.map((e=>e.label)),w=_.length-1,L=_.map(((e,t)=>0===t||t===w?x("div",{key:t},e):null)),S={display:"flex",flexDirection:"column"},R={display:"flex",flexDirection:"row"},$={marginTop:"3px",display:"flex"};C(this.container)?$.marginRight=`${b}px`:$.marginLeft=`${b}px`;const k={width:`${r}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return x("div",{class:n.layerRow,key:"size-ramp-preview",styles:S},x("div",{class:this.classes(n.symbolContainer,n.sizeRampHorizontal),styles:R},i.infos.map(((e,t)=>x("div",{key:t,class:n.symbol,bind:e.preview,afterCreate:u})))),v?x("div",{class:n.univariateAboveAndBelowColorRamp,styles:$,key:"color-ramp-preview"},x("div",{bind:v,afterCreate:u}),x("div",{bind:f,afterCreate:u})):null,x("div",{class:n.layerInfo},x("div",{class:n.rampLabelsContainer,styles:k},L)))}_renderUnivariateColorSizeRamp(e,t,s){const{sizeRampElement:i,colorRampElement:a}=g(e,"horizontal");if(!i)return null;const r=d(i,"full",!1,"horizontal"),o=m(i,"full",!1,"horizontal"),l=h(a,{width:o,height:12,rampAlignment:"horizontal",opacity:t,type:"full",effectList:s,ariaLabel:this.messages?.previewColorRampAriaLabel}),c=y(i,"card"),p=i.infos.length-1,v=i.infos.map(((e,t)=>0===t||t===p?x("div",{key:t},e.label):null)),f={display:"flex",flexDirection:"column"},b={display:"flex",flexDirection:"row"},_={marginTop:"3px",display:"flex"};C(this.container)?_.marginRight=`${c}px`:_.marginLeft=`${c}px`;const w={width:`${r}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return x("div",{class:n.layerRow,key:"size-ramp-preview",styles:f},x("div",{class:this.classes(n.symbolContainer,n.sizeRampHorizontal),styles:b},i.infos.map(((e,t)=>x("div",{key:t,class:n.symbol,bind:e.preview,afterCreate:u})))),x("div",{class:n.univariateAboveAndBelowColorRamp,styles:_,key:"color-ramp-preview"},x("div",{bind:l,afterCreate:u})),x("div",{class:n.layerInfo},x("div",{class:n.rampLabelsContainer,styles:w},v)))}_renderLegendForElementInfo(e,t,s,i){const a=t.layer;if(e.type)return this._renderLegendForElement(e,t,i,!1,!0);const r=f(a,s),l=v(this.messages,e.label,!1)??"";if(e.preview){if(!e.symbol||!e.symbol.type.includes("simple-fill")){if(!e.label)return x("div",{key:i,bind:e.preview,afterCreate:u});const t={[n.symbolCell]:this._hasIndicators};return x("div",{key:i,class:this.classes(n.layerRow,{[n.symbolRow]:this._hasIndicators})},x("div",{class:this.classes(t),bind:e.preview,afterCreate:u}),x("div",{class:this.classes(n.imageLabel,{[n.labelCell]:this._hasIndicators})},l))}let s=255,r=255,c=255,p=0,d=255,m=255,h=255,y=0;const g=e.symbol.color&&e.symbol.color.a,v=e.symbol.outline&&e.symbol.outline.color&&e.symbol.outline.color.a;g&&(s=e.symbol.color.r,r=e.symbol.color.g,c=e.symbol.color.b,p=e.symbol.color.a*a.opacity),v&&(d=e.symbol.outline.color.r,m=e.symbol.outline.color.g,h=e.symbol.outline.color.b,y=e.symbol.outline.color.a*a.opacity);const f=e.symbol.color?.isBright??!0,b=f?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)",_={background:g?`rgba(${s}, ${r}, ${c}, ${p})`:"none",color:f?"black":"white",textShadow:`-1px -1px 0 ${b},\n 1px -1px 0 ${b},\n -1px 1px 0 ${b},\n 1px 1px 0 ${b}`,border:v?`1px solid rgba(${d}, ${m}, ${h}, ${y})`:"none",filter:o(t.effectList)??void 0};return x("div",{key:i,class:n.layerRow},x("div",{class:n.labelElement,styles:_},l))}if(e.src){const t=this._renderImage(e,a,r);return x("div",{key:i,class:n.layerRow},t,x("div",{class:n.imageLabel},l))}}_renderImage(e,t,s){const{label:i,src:a,opacity:r}=e,o={[n.imageryLayerStretchedImage]:s,[n.symbol]:!s},l={opacity:`${null!=r?r:t.opacity}`};return x("img",{alt:v(this.messages,i,!1),"aria-label":v(this.messages,i,!1),src:a,border:0,width:e.width,height:e.height,class:this.classes(o),styles:l})}_renderSizeRampLines(e){const t=e.infos,i=t[0],a=t[t.length-1],r=i.symbol,o=this._hasIndicators,l=s(i.size+i.outlineSize)*j,n=s(a.size+a.outlineSize)*j,c=o?l:l+50*j,p=o?l/2+50*j:l,d=F(r),m=E(r),h=document.createElement("canvas");h.width=c,h.height=p,h.style.width=h.width/j+"px",h.style.height=h.height/j+"px";const y=h.getContext("2d");if(o){y.beginPath();const e=0,t=0,s=c/2-n/2,i=p;y.moveTo(e,t),y.lineTo(s,i);const a=c,r=0,o=c/2+n/2,l=p;y.moveTo(a,r),y.lineTo(o,l)}else{y.beginPath();const e=0,t=p/2-n/2,s=c,i=0;y.moveTo(e,t),y.lineTo(s,i);const a=0,r=p/2+n/2,o=c,l=p;y.moveTo(a,r),y.lineTo(o,l)}return y.strokeStyle=N,y.stroke(),x("div",{bind:h,afterCreate:u,styles:o?{display:"flex",marginTop:`-${d?0:m?l/2:0}px`,marginBottom:`-${d?n:m?n/2:0}px`}:{display:"flex",marginRight:`-${d?0:m?l/2:0}px`,marginLeft:`-${d?0:m?n/2:0}px`}})}_renderSizeRamp(e,t){const s=e.infos,i=s[0].label,a=s[s.length-1].label;let r=s[0].preview,o=s[s.length-1].preview;const l=this._hasIndicators,c={"flex-direction":l?"column":"row-reverse"};r&&(r=r.cloneNode(!0),r.style.display="flex"),o&&(o=o.cloneNode(!0),o.style.display="flex");const p={opacity:null!=t?`${t}`:""};return x("div",{class:this.classes(n.layerRow,{[n.sizeRampRow]:l})},x("div",{class:n.rampLabel},l?i:a),x("div",{class:n.sizeRampContainer,styles:c},x("div",{bind:r,afterCreate:u,class:n.sizeRampPreview,styles:p}),this._renderSizeRampLines(e),x("div",{bind:o,afterCreate:u,class:n.sizeRampContainer,styles:p})),x("div",{class:n.rampLabel},l?a:i))}_getRampStopLabel(e,t){switch(t){case"heatmap-ramp":return this.messages[e.label];case"stretch-ramp":return b(e,this.messages);default:return e.label}}_renderLegendForRamp(e,t,s){const i=e.infos,a=e.type,l="heatmap-ramp"===a,c=i.length-1,p=k,d=c>2&&!l?$*c:I,m=d+20,h=10,y=i.slice(0).reverse(),g=y.length-1,v=y.length%2!=0?y[y.length/2|0]:null,u=v&&x("div",{class:n.intervalSeparatorsContainer},x("div",{class:n.intervalSeparator},"|"),x("div",{class:n.rampLabel},this._getRampStopLabel(v,a))),f=[[{shape:{type:"path",path:`M0 ${p/2} L${h} 0 L${h} ${p} Z`},fill:y[0].color,stroke:{width:0}},{shape:{type:"rect",x:h,y:0,width:d,height:p},fill:{type:"linear",x1:h,y1:0,x2:d+h,y2:0,colors:y.map(((e,t)=>({color:e.color?.toArray(),offset:l&&"ratio"in e?e.ratio:t/c})))},stroke:{width:0}},{shape:{type:"path",path:`M${d+h} 0 L${m} ${p/2} L${d+h} ${p} Z`},fill:y[g].color,stroke:{width:0}}]],b=r(f,m,p),_={filter:o(s)??void 0,opacity:null==t?void 0:`${t}`},w={justifyContent:"center"};return x("div",{class:n.layerRow,styles:w},x("div",{class:n.rampLabel},this._getRampStopLabel(y[0],a)),x("div",{class:n.symbolContainer},x("div",{styles:_},b),u),x("div",{class:n.rampLabel},this._getRampStopLabel(y[g],a)))}};e([i()],T.prototype,"activeLayerInfos",void 0),e([i()],T.prototype,"headingLevel",void 0),e([i()],T.prototype,"layout",void 0),e([i(),S("esri/widgets/Legend/t9n/Legend")],T.prototype,"messages",void 0),e([i(),S("esri/t9n/common")],T.prototype,"messagesCommon",void 0),e([i({readOnly:!0})],T.prototype,"type",void 0),e([i()],T.prototype,"view",void 0),e([L()],T.prototype,"_selectSection",null),T=e([a("esri.widgets.Legend.styles.Card")],T);const U=T;export{U 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.28/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{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import"../../../support/widgetUtils.js";import{tsx as i}from"../../../support/jsxFactory.js";const l=t(),n=10,r=20,s=10,a=20,c={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function f(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?i("svg",{height:"4",width:"10"},i("line",{x1:"0",y1:"2",x2:"10",y2:"2",style:t})):i("svg",{height:"10",width:"10"},i("line",{x1:"5",y1:"0",x2:"5",y2:"10",style:t}))}function p(e,t="vertical"){const o=document.createElement("div");return o.style.height=`${r}px`,o.className=c.univariateAboveAndBelowSymbol,null!=e&&(o.style.opacity=e.toString()),l.append(o,f.bind(null,t)),o}function m(t,o,i="vertical",l){t.infos.forEach(((t,n)=>{if(l&&2===n)t.preview=p(o,i);else{const o=e(t.size)+("horizontal"===i?a:s),l=t.preview,n="div"===l?.tagName.toLowerCase(),r=n?l:document.createElement("div");r.className=c.univariateAboveAndBelowSymbol,"horizontal"===i?r.style.width=`${o}px`:r.style.height=`${o}px`,!n&&l&&r.appendChild(l),t.preview=r}}))}function u(t,o="classic"){const i=t.infos;return"classic"===o?(e(i[0].size)+s)/2:(e(i[0].size)-e(i.
|
|
5
|
+
import{pt2px as e}from"../../../../core/screenUtils.js";import"../../../../libs/maquette/projection.js";import{createProjector as t}from"../../../../libs/maquette/projector.js";import{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import"../../../support/widgetUtils.js";import{tsx as i}from"../../../support/jsxFactory.js";const l=t(),n=10,r=20,s=10,a=20,c={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function f(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?i("svg",{height:"4",width:"10"},i("line",{x1:"0",y1:"2",x2:"10",y2:"2",style:t})):i("svg",{height:"10",width:"10"},i("line",{x1:"5",y1:"0",x2:"5",y2:"10",style:t}))}function p(e,t="vertical"){const o=document.createElement("div");return o.style.height=`${r}px`,o.className=c.univariateAboveAndBelowSymbol,null!=e&&(o.style.opacity=e.toString()),l.append(o,f.bind(null,t)),o}function m(t,o,i="vertical",l){t.infos.forEach(((t,n)=>{if(l&&2===n)t.preview=p(o,i);else{const o=e(t.size)+("horizontal"===i?a:s),l=t.preview,n="div"===l?.tagName.toLowerCase(),r=n?l:document.createElement("div");r.className=c.univariateAboveAndBelowSymbol,"horizontal"===i?r.style.width=`${o}px`:r.style.height=`${o}px`,!n&&l&&r.appendChild(l),t.preview=r}}))}function u(t,o="classic"){const i=t.infos;return"classic"===o?(e(i[0].size)+s)/2:(e(i[0].size)-e(i[i.length-1].size))/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,effectList:t.effectList,ariaLabel:t.ariaLabel});return l.className=c.colorRamp,null!=t.opacity&&(l.style.opacity=t.opacity.toString()),l}function v(t,o,i,l="vertical"){let c=0;const f=t.infos,p=Math.floor(f.length/2),m="full"===o||"above"===o?0:p,u="full"===o||"below"===o?f.length-1:p;for(let h=m;h<=u;h++)if(i&&h===p)c+="horizontal"===l?n:r;else{c+=e(f[h].size)+("horizontal"===l?a:s)}return Math.round(c)}function y(t,o,i,l="vertical"){const c=v(t,o,i,l),f=t.infos,p=Math.floor(f.length/2),m="full"===o||"above"===o?0:p,u="full"===o||"below"===o?f.length-1:p,h="full"===o?f[m].size+f[u].size:"above"===o?f[m].size:f[u].size,y=i?"vertical"===l?r:n:0,d="vertical"===l?s*("full"===o?2:1):a*("full"===o?2:1);return Math.round(c-(e(h)/2+y/2+d/2))}function d(e,t,o="vertical"){const i=e.infos;let l=i.find((({type:e})=>"size-ramp"===e)),n=i.find((({type:e})=>"color-ramp"===e));return l&&(l={...l},l.infos=[...l.infos],m(l,t,o,!0)),n&&(n={...n},n.infos=[...n.infos]),"horizontal"===o&&(l?.infos.reverse(),n?.infos.reverse()),{sizeRampElement:l,colorRampElement:n}}function b(e,t="vertical"){const o=e.infos;let i=o.find((({type:e})=>"size-ramp"===e)),l=o.find((({type:e})=>"color-ramp"===e));return i&&(i={...i},i.infos=[...i.infos],m(i,null,t,!1)),l&&(l={...l},l.infos=[...l.infos]),"horizontal"===t&&(i?.infos.reverse(),l?.infos.reverse()),{sizeRampElement:i,colorRampElement:l}}export{d as getUnivariateAboveAndBelowRampElements,u as getUnivariateColorRampMargin,h as getUnivariateColorRampPreview,y as getUnivariateColorRampSize,b as getUnivariateColorSizeRampElements,v as getUnivariateSizeRampSize};
|