@arcgis/core 5.1.0-next.111 → 5.1.0-next.113
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/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
- package/analysis/ElevationProfileAnalysis.d.ts +5 -0
- package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
- package/analysis/ShadowCastAnalysis.d.ts +8 -5
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/arcade.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeEnvironment.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/debug.js +1 -1
- package/arcade/enum.js +1 -1
- package/arcade/executionError.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/stats.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/functions/track.js +1 -1
- package/arcade/geometry/constructors.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/icon/returnToDefault16.json +1 -0
- package/assets/components/assets/icon/returnToDefault24.json +1 -0
- package/assets/components/assets/icon/returnToDefault32.json +1 -0
- package/assets/components/assets/icon/reviewMap16.json +1 -0
- package/assets/components/assets/icon/reviewMap24.json +1 -0
- package/assets/components/assets/icon/reviewMap32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 02c0640005b09007bb70.js} +1 -1
- package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
- package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
- package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
- package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
- package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
- package/assets/esri/core/workers/chunks/{beff5b4e15edee12bd4c.js → 271e42b7cd3c3441839e.js} +3 -3
- package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
- package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
- package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +2 -0
- package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
- package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +2 -0
- package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 52a91c314afec70199bc.js} +1 -1
- package/assets/esri/core/workers/chunks/5c6742728fa705d2e16e.js +1 -0
- package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
- package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
- package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
- package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
- package/assets/esri/core/workers/chunks/701125f6cdd91ff3655f.js +2 -0
- package/assets/esri/core/workers/chunks/7995e6983456c779adf9.js +1 -0
- package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
- package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +1 -0
- package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
- package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
- package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
- package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
- package/assets/esri/core/workers/chunks/9a11ff75009fef45b8c1.js +1 -0
- package/assets/esri/core/workers/chunks/a70fa35b2d19460637e9.js +2 -0
- package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
- package/assets/esri/core/workers/chunks/ae74f722fb385e45fcf1.js +1 -0
- package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b4badbcf1bdb7823d825.js} +1 -1
- package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +1 -0
- package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
- package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
- package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
- package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
- package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
- package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
- package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
- package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
- package/assets/esri/core/workers/chunks/e95ce76b5b816256a519.js +1 -0
- package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
- package/assets/esri/core/workers/chunks/fbcf09526dc1bbe94b91.js +2 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +22 -6
- 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/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/Features/t9n/Features_en.json +1 -1
- package/chunks/GaussianSplatShadow.glsl.js +11 -9
- package/chunks/ShadowCastVisualize.glsl.js +26 -18
- package/chunks/aiServices.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.d.ts +6 -4
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/SceneModifications.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/linkChart/utils.js +1 -1
- package/package.json +2 -2
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/rest/support/TranslateContent.js +1 -1
- package/rest/support/TranslateParameters.js +1 -1
- package/rest/support/TranslateResult.js +1 -1
- package/rest/translate.js +1 -1
- package/rest/utils.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/types.d.ts +45 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.d.ts +2 -0
- package/views/LinkChartView.d.ts +47 -0
- package/views/MapView.d.ts +1 -85
- package/views/VideoView.d.ts +8 -1
- package/views/View2D.d.ts +78 -2
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/types.d.ts +2 -3
- package/views/ui/DefaultUI.d.ts +1 -0
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +17 -3
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +46 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +1 -1
- package/widgets/BatchAttributeForm.d.ts +2 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +3 -3
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +66 -6
- package/widgets/support/SelectionToolbar/types.d.ts +20 -1
- package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
- package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
- package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
- package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
- package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
- package/assets/esri/core/workers/chunks/55334ad3618899cdbf78.js +0 -2
- package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
- package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
- package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
- package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
- package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
- package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
- package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +0 -1
- package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
- package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
- package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
- package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +0 -1
- package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
- package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
- package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
- package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
- package/assets/esri/core/workers/chunks/d00b9c1fd0865bf8f317.js +0 -1
- package/assets/esri/core/workers/chunks/deab352545c34cac148c.js +0 -1
- package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
- package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
- package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
- /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → 32f128a1615d71bbe899.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 40df608337d562553ce1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 701125f6cdd91ff3655f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → a70fa35b2d19460637e9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → fbcf09526dc1bbe94b91.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{Y as t}from"../../chunks/languageUtils.js";import n from"../../core/Accessor.js";import s from"../../core/Collection.js";import{abortHandle as o}from"../../core/handleUtils.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import r from"../../core/ReactiveMap.js";import{on as l}from"../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import p from"../../layers/support/ContingentValue.js";import{getFeatureSubtype as f}from"../../layers/support/featureLayerUtils.js";import h from"../../layers/support/LayerContingentValuesCache.js";import{isFeatureLayer as g,isSubtypeGroupLayer as m}from"../../layers/support/layerUtils.js";import{valueIsValidContingentValue as y}from"../FeatureForm/featureFormUtils.js";const _="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",V="#JSAPI_CONTINGENT_VALUE_ANY_HASH",v="#JSAPI_CONTINGENT_VALUE_NULL_HASH",b={_any:"any",_code:"code",_null:"null",_range:"range"};let C=class extends n{constructor(e){super(e),this._cacheMap=new r,this._joinedContingenciesMap=new Map,this._optionsMap=new Map,this._pendingCacheLoad=new Set,this._updatingHandles=new d,this._violationsMap=new Map,this.layers=new s}initialize(){this.layers.length&&this._onLayersChange(this.layers.toArray()),this.addHandles([l(()=>this.layers,"change",({added:e})=>this._onLayersChange(e))])}destroy(){this.reset()}get _fieldsWithContingentValues(){const e=new r;return this._cacheMap.forEach((t,n)=>{e.set(n,new Set(t.fieldGroups.flatMap(e=>e.fields)))}),e}get updating(){return this._updatingHandles.updating}clear(){this._joinedContingenciesMap.clear(),this.resetOptions(),this.resetViolations()}getViolationForField(e,t,n){const s=this._violationsMap.get(e),o=N(e,t),i=s?.get(o);return i?.get(n)||null}getAllViolations(e,t){const n=this._violationsMap.get(e),s=N(e,t),o=n?.get(s);return o?Array.from(o.values()):[]}getFieldsWithContingentValues(e){return T(e)?this._fieldsWithContingentValues.get(e)??new Set:new Set}getFieldValueOptions(e){const{feature:t,layer:n,fieldName:s,emptyString:o}=e,i=I(n,t,s),a=t.getAttribute(s),l=this._optionsMap.get(n),c=N(n,t),u=l?.get(c);if(u){const e=u.get(s);if(e)return e}const d="coded-value"===i?.type?i.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],p=null==a||d.some(e=>e.value===a)?[]:[{name:`${a}`,value:a}],f=T(n)&&this._fieldsWithContingentValues.get(n)?.has(s)?this._getContingentValueOptionsForField(n,t,s,o):[];let h=null;if(f.length>0){const e=new Set(f.map(e=>e.value));h={recommended:f,other:d.filter(t=>!e.has(t.value)),unsupported:p}}else h={recommended:d,other:[],unsupported:p};if(u)u.set(s,h);else{const e=new r([[s,h]]);l?l.set(c,e):this._optionsMap.set(n,new r([[c,e]]))}return h}getJoinedContingentValues(e,t){const n=U(e,t),s=this._joinedContingenciesMap.get(n);if(s)return s;const o=this._cacheMap.get(e);if(!o)return[];const i=this._joinContingentValues(o,t);return this._joinedContingenciesMap.set(n,i),i}getRelatedFields(e,t){return this._cacheMap.get(e)?.getRelatedFields(t)??new Set}hasFieldsWithContingentValues(e){return this.getFieldsWithContingentValues(e).size>0}reset(){this.clear(),this._cacheMap.forEach(a),this._cacheMap.clear()}resetOptions(){this._optionsMap.clear()}resetOptionsForFeature(e,t){this._optionsMap.get(e)?.get(N(e,t))?.clear()}resetOptionsForField(e,t,n){this._optionsMap.get(e)?.get(N(e,t))?.delete(n)}resetOptionsForLayer(e){this._optionsMap.get(e)?.clear()}resetViolations(){this._violationsMap.clear()}resetViolationsForFeature(e,t){this._violationsMap.get(e)?.get(t)?.clear()}resetViolationsForLayer(e){this._violationsMap.get(e)?.clear()}validateContingencyConstraints(e,t,n){const s=this._cacheMap.get(e);if(!s)return[];const o=S(t),{invalid:a,incomplete:l}=s.validateContingencyConstraints(o),c=[...a,...n?.includeIncompleteViolations?l:[]],u=new r;for(const i of c)for(const e of i.fieldGroup.fields)u.set(e,i);const d=N(e,t);return i(this._violationsMap,e,()=>new r).set(d,u),c}validateContingenciesForNonNullFields(e,t){const n=t.clone();n.attributes=Object.fromEntries(Object.entries(S(t)).filter(([e,t])=>null!=t)),this.validateContingencyConstraints(e,n)}_onLayersChange(e){e.forEach(e=>{let n=null;if(t(e)?n=e.parent:(g(e)||m(e))&&(n=e),!n||this._cacheMap.get(n)||this._pendingCacheLoad.has(n))return;const s=new AbortController,i=o(s),a=Symbol();this.addHandles(i,a),this._pendingCacheLoad.add(n),this._updatingHandles.addPromise(h.createLoadedLayerContingentValuesCache(n,s).then(t=>{t&&!s.signal.aborted&&(this.removeHandles(a),this._cacheMap.set(n,t),this.resetOptionsForLayer(e))}).finally(()=>this._pendingCacheLoad.delete(n)))})}_getContingentValueOptionsForField(e,t,n,s){const o=this.getJoinedContingentValues(e,t),i=new Map,a={code:"",name:s??"No value"},{_code:r,_null:l}=b;for(const c of o){const s=c.values[n];if(s?.objectType===r||s?.objectType===l){const{code:o,name:r}=s.codedValue&&s.objectType!==l?s.codedValue:a;!i.has(o)&&this._isValidContingency(e,t,n,c)&&i.set(o,{name:r,value:o})}}return[...i.values()]}_isValidContingency(e,t,n,s){const o=this._fieldsWithContingentValues.get(e);for(const i of o??[]){const e=t.attributes[i];if(i!==n&&null!=e&&s.values.hasOwnProperty(i)&&!y(e,s.values[i]))return!1}return!0}_joinContingentValues(e,t){const n=e.subtypeFieldName,s=n?t.attributes[n]:null,o=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:n}=r,i=[];for(const o of e)o.isRetired||null!=o.subtype&&o.subtype.code!==s||i.push({values:o.values});i.length>0&&o.push({name:n,fields:t,contingencies:i})}const[i,a]=A(o);return[...i.flatMap(n=>E(e.layer,t,n)),...a.flatMap(e=>e.contingencies)]}};function M(e,t){const{_any:n,_null:s,_range:o}=b;return{leftIsNull:e===s,rightIsNull:t===s,bothAreNull:e===s&&t===s,leftIsAny:e===n,rightIsAny:t===n,bothAreAny:e===n&&t===n,leftIsRange:e===o,rightIsRange:t===o}}function F(e,t,n){const{_any:s}=b,o=Array.from(n);return t.filter(t=>o.every(n=>{const o=t.values[n],i=e.values[n];return o.objectType===s||i.objectType===s||o.codedValue?.code===i.codedValue?.code}))}function j(e,t){const n=new RegExp(`${t}$`),s=[];for(const[o,i]of e){if(o===V)break;n.test(o)&&s.push(...i)}return s}function w(e,t,n,s){const o=Array.isArray(n)?new Set(n):n,i=Array.isArray(s)?new Set(s):s,a=o.size<i.size?o:i,r=a===o?i:o,l=new Set,c=new Set;for(const u of a)if(r.has(u)){const n=I(e,t,u,!0);if(null==n)continue;switch(n.type){case"coded-value":l.add(u);break;case"range":c.add(u)}}return{codedValueFields:l,rangeFields:c}}function A(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const o=t.get(e),i=l,a=[o.name,i.name].sort().join("|");if(s.has(a))continue;n.push([o,i]),s.add(a),t.set(e,i)}else t.set(e,l);const o=new Set(n.flat()),i=new Set(e);for(const l of o)i.delete(l);const a=new Map,r=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,c]of n){const e=r.get(l),t=r.get(c);if(e===t)continue;const n=a.get(e),s=a.get(t);for(const o of s)n.add(o),r.set(o,e);a.delete(t)}return[[...a.values()].map(e=>[...e]),[...i]]}function S(e){return e.attributes}function I(e,t,n,s=!1){return e.getFieldDomain(n,{feature:t,excludeImpliedDomains:s})}function N(e,t){return t.getObjectId()??t.attributes[e.objectIdField]??t}function L(e,t,n=!1){if(t.size<1)return[_,!1];const{_any:s,_null:o}=b,i=[];let a=!1;for(const r of t.values()){const t=e.values[r];if(t.objectType===s){if(n)return[V,!0];a=!0,i.push(`${r}:.*`)}else t.objectType===o?i.push(`${r}:${v}`):i.push(`${r}:${t.codedValue?.code}`)}return[i.sort().join("&"),a]}function T(e){return g(e)||m(e)}function O(e,t){const n={values:{...e.values,...t.values}};for(const[s,o]of Object.entries(n.values))o.objectType===b._any&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}function H(e,t,n){const s=O(e,t),{_null:o,_range:i}=b;for(const a of n.values()){const n=e.values[a],r=t.values[a],{leftIsNull:l,rightIsNull:c,bothAreNull:u,leftIsAny:d,rightIsAny:f,bothAreAny:h,leftIsRange:g,rightIsRange:m}=M(n.objectType,r.objectType);if(u||h)continue;if(l&&f||c&&d){s.values[a]=new p({objectType:o});continue}if(l&&m||c&&g)return null;d?(n.minValue=-1/0,n.maxValue=1/0):f&&(r.minValue=-1/0,r.maxValue=1/0);const y=Math.max(n.minValue,r.minValue),_=Math.min(n.maxValue,r.maxValue);if(y>_)return null;s.values[a]=new p({objectType:i,minValue:y,maxValue:_})}return s}function E(e,t,n){const s=n.slice(),o=s.shift();let i=s.shift(),a=w(e,t,o.fields,i.fields),r=new Set([...o.fields,...i.fields]),l=new Map;for(const u of o.contingencies){const[e]=L(u,a.codedValueFields,!0);l.has(e)?l.get(e)?.push(u):l.set(e,[u])}for(;s.length>0;){const n=new Map,o=s.shift(),c=w(e,t,r,o.fields);for(const e of i.contingencies){const[t,s]=L(e,a.codedValueFields),o=s?j(l,t):l.get(t);if(l.has(V)&&o?.push(...F(e,l.get(V),a.codedValueFields)),null!=o)for(const i of o){const t=a.rangeFields.size>0?H(i,e,a.rangeFields):O(i,e);if(null==t)break;const[s]=L(t,c.codedValueFields,!0);n.has(s)?n.get(s)?.push(t):n.set(s,[t])}}l=n,i=o,a=c,r=new Set([...r,...i.fields])}const c=[];for(const u of i.contingencies){const[e,t]=L(u,a.codedValueFields),n=t?j(l,e):l.get(e);if(l.has(V)&&n.push(...F(u,l.get(V),a.codedValueFields)),null!=n)for(const s of n){const e=a.rangeFields.size>0?H(s,u,a.rangeFields):O(s,u);null!=e&&c.push(e)}}return c}function U(e,t){let n=e.url??e.uid;if(e.subtypes&&e.subtypes.length>0){const s=f(e,t);n+=`|${s?`subtype:${s.code}`:"subtype:null"}`}if(g(e)&&e.types&&e.typeIdField&&e.types.some(e=>Object.keys(e.domains).length>0)){n+=`|${`type:${t.getAttribute(e.typeIdField)}`}`}return n}e([c()],C.prototype,"_fieldsWithContingentValues",null),e([c()],C.prototype,"layers",void 0),e([c()],C.prototype,"updating",null),C=e([u("esri.widgets.support.ContingentValuesManager")],C);export{C as ContingentValuesManager,T as isLayerWithContingentValues};
|
|
2
|
+
import{__decorate as e}from"tslib";import{Y as t}from"../../chunks/languageUtils.js";import n from"../../core/Accessor.js";import s from"../../core/Collection.js";import{abortHandle as o}from"../../core/handleUtils.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import r from"../../core/ReactiveMap.js";import{on as l}from"../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import p from"../../layers/support/ContingentValue.js";import{getFeatureSubtype as f}from"../../layers/support/featureLayerUtils.js";import h from"../../layers/support/LayerContingentValuesCache.js";import{isFeatureLayer as g,isSubtypeGroupLayer as m}from"../../layers/support/layerUtils.js";import{valueIsValidContingentValue as y}from"../FeatureForm/featureFormUtils.js";const _="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",V="#JSAPI_CONTINGENT_VALUE_ANY_HASH",v="#JSAPI_CONTINGENT_VALUE_NULL_HASH",b={_any:"any",_code:"code",_null:"null",_range:"range"};let C=class extends n{constructor(e){super(e),this._cacheMap=new r,this._joinedContingenciesMap=new Map,this._optionsMap=new Map,this._pendingCacheLoad=new Set,this._updatingHandles=new d,this._violationsMap=new Map,this.layers=new s}initialize(){this.layers.length&&this._onLayersChange(this.layers.toArray()),this.addHandles([l(()=>this.layers,"change",({added:e})=>this._onLayersChange(e))])}destroy(){this.reset()}get _fieldsWithContingentValues(){const e=new r;return this._cacheMap.forEach((t,n)=>{e.set(n,new Set(t.fieldGroups.flatMap(e=>e.fields)))}),e}get updating(){return this._updatingHandles.updating}clear(){this._joinedContingenciesMap.clear(),this.resetOptions(),this.resetViolations()}getViolationForField(e,t,n){const s=this._violationsMap.get(e),o=O(e,t),i=s?.get(o);return i?.get(n)||null}getAllViolations(e,t){const n=this._violationsMap.get(e),s=O(e,t),o=n?.get(s);return o?Array.from(o.values()):[]}getFieldsWithContingentValues(e){return L(e)?this._fieldsWithContingentValues.get(e)??new Set:new Set}getFieldValueOptions(e){const{feature:t,layer:n,fieldName:s,emptyString:o}=e,i=e.domain??I(n,t,s),a=t.getAttribute(s),l=this._optionsMap.get(n),c=O(n,t),u=l?.get(c);if(u){const e=u.get(s);if(e)return e}const d="coded-value"===i?.type?i.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],p=null==a||d.some(e=>e.value===a)?[]:[{name:`${a}`,value:a}],f=L(n)&&this._fieldsWithContingentValues.get(n)?.has(s)?this._getContingentValueOptionsForField(n,t,s,o):{containsEmptyOption:!1,options:[]};let h=null;if(f.options.length>0){const{options:e,containsEmptyOption:t}=f,n=new Set(e.map(e=>e.value));h={recommended:e,other:d.filter(e=>!n.has(e.value)),unsupported:p,containsEmptyOption:t}}else h={recommended:d,other:[],unsupported:p,containsEmptyOption:!1};if(u)u.set(s,h);else{const e=new r([[s,h]]);l?l.set(c,e):this._optionsMap.set(n,new r([[c,e]]))}return h}getJoinedContingentValues(e,t){const n=U(e,t),s=this._joinedContingenciesMap.get(n);if(s)return s;const o=this._cacheMap.get(e);if(!o)return[];const i=this._joinContingentValues(o,t);return this._joinedContingenciesMap.set(n,i),i}getRelatedFields(e,t){return this._cacheMap.get(e)?.getRelatedFields(t)??new Set}hasFieldsWithContingentValues(e){return this.getFieldsWithContingentValues(e).size>0}reset(){this.clear(),this._cacheMap.forEach(a),this._cacheMap.clear()}resetOptions(){this._optionsMap.clear()}resetOptionsForFeature(e,t){this._optionsMap.get(e)?.get(O(e,t))?.clear()}resetOptionsForField(e,t,n){this._optionsMap.get(e)?.get(O(e,t))?.delete(n)}resetOptionsForLayer(e){this._optionsMap.get(e)?.clear()}resetViolations(){this._violationsMap.clear()}resetViolationsForFeature(e,t){this._violationsMap.get(e)?.get(t)?.clear()}resetViolationsForLayer(e){this._violationsMap.get(e)?.clear()}validateContingencyConstraints(e,t,n){const s=this._cacheMap.get(e);if(!s)return[];const o=S(t),{invalid:a,incomplete:l}=s.validateContingencyConstraints(o),c=[...a,...n?.includeIncompleteViolations?l:[]],u=new r;for(const i of c)for(const e of i.fieldGroup.fields)u.set(e,i);const d=O(e,t);return i(this._violationsMap,e,()=>new r).set(d,u),c}validateContingenciesForNonNullFields(e,t){const n=t.clone();n.attributes=Object.fromEntries(Object.entries(S(t)).filter(([e,t])=>null!=t)),this.validateContingencyConstraints(e,n)}_onLayersChange(e){e.forEach(e=>{let n=null;if(t(e)?n=e.parent:(g(e)||m(e))&&(n=e),!n||this._cacheMap.get(n)||this._pendingCacheLoad.has(n))return;const s=new AbortController,i=o(s),a=Symbol();this.addHandles(i,a),this._pendingCacheLoad.add(n),this._updatingHandles.addPromise(h.createLoadedLayerContingentValuesCache(n,s).then(t=>{t&&!s.signal.aborted&&(this.removeHandles(a),this._cacheMap.set(n,t),this.resetOptionsForLayer(e))}).finally(()=>this._pendingCacheLoad.delete(n)))})}_getContingentValueOptionsForField(e,t,n,s){const o=this.getJoinedContingentValues(e,t),i=new Map,a={code:"",name:s??"No value"},{_code:r,_null:l}=b;for(const c of o){const s=c.values[n];if(s?.objectType===r||s?.objectType===l){const{code:o,name:r}=s.codedValue&&s.objectType!==l?s.codedValue:a;!i.has(o)&&this._isValidContingency(e,t,n,c)&&i.set(o,{name:r,value:o})}}return{containsEmptyOption:i.has(""),options:[...i.values()]}}_isValidContingency(e,t,n,s){const o=this._fieldsWithContingentValues.get(e);for(const i of o??[]){const e=t.attributes[i];if(i!==n&&null!=e&&s.values.hasOwnProperty(i)&&!y(e,s.values[i]))return!1}return!0}_joinContingentValues(e,t){const n=e.subtypeFieldName,s=n?t.attributes[n]:null,o=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:n}=r,i=[];for(const o of e)o.isRetired||null!=o.subtype&&o.subtype.code!==s||i.push({values:o.values});i.length>0&&o.push({name:n,fields:t,contingencies:i})}const[i,a]=A(o);return[...i.flatMap(n=>H(e.layer,t,n)),...a.flatMap(e=>e.contingencies)]}};function M(e,t){const{_any:n,_null:s,_range:o}=b;return{leftIsNull:e===s,rightIsNull:t===s,bothAreNull:e===s&&t===s,leftIsAny:e===n,rightIsAny:t===n,bothAreAny:e===n&&t===n,leftIsRange:e===o,rightIsRange:t===o}}function F(e,t,n){const{_any:s}=b,o=Array.from(n);return t.filter(t=>o.every(n=>{const o=t.values[n],i=e.values[n];return o.objectType===s||i.objectType===s||o.codedValue?.code===i.codedValue?.code}))}function j(e,t){const n=new RegExp(`${t}$`),s=[];for(const[o,i]of e){if(o===V)break;n.test(o)&&s.push(...i)}return s}function w(e,t,n,s){const o=Array.isArray(n)?new Set(n):n,i=Array.isArray(s)?new Set(s):s,a=o.size<i.size?o:i,r=a===o?i:o,l=new Set,c=new Set;for(const u of a)if(r.has(u)){const n=I(e,t,u,!0);if(null==n)continue;switch(n.type){case"coded-value":l.add(u);break;case"range":c.add(u)}}return{codedValueFields:l,rangeFields:c}}function A(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const o=t.get(e),i=l,a=[o.name,i.name].sort().join("|");if(s.has(a))continue;n.push([o,i]),s.add(a),t.set(e,i)}else t.set(e,l);const o=new Set(n.flat()),i=new Set(e);for(const l of o)i.delete(l);const a=new Map,r=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,c]of n){const e=r.get(l),t=r.get(c);if(e===t)continue;const n=a.get(e),s=a.get(t);for(const o of s)n.add(o),r.set(o,e);a.delete(t)}return[[...a.values()].map(e=>[...e]),[...i]]}function S(e){return e.attributes}function I(e,t,n,s=!1){return e.getFieldDomain(n,{feature:t,excludeImpliedDomains:s})}function O(e,t){return t.getObjectId()??t.attributes[e.objectIdField]??t}function N(e,t,n=!1){if(t.size<1)return[_,!1];const{_any:s,_null:o}=b,i=[];let a=!1;for(const r of t.values()){const t=e.values[r];if(t.objectType===s){if(n)return[V,!0];a=!0,i.push(`${r}:.*`)}else t.objectType===o?i.push(`${r}:${v}`):i.push(`${r}:${t.codedValue?.code}`)}return[i.sort().join("&"),a]}function L(e){return g(e)||m(e)}function T(e,t){const n={values:{...e.values,...t.values}};for(const[s,o]of Object.entries(n.values))o.objectType===b._any&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}function E(e,t,n){const s=T(e,t),{_null:o,_range:i}=b;for(const a of n.values()){const n=e.values[a],r=t.values[a],{leftIsNull:l,rightIsNull:c,bothAreNull:u,leftIsAny:d,rightIsAny:f,bothAreAny:h,leftIsRange:g,rightIsRange:m}=M(n.objectType,r.objectType);if(u||h)continue;if(l&&f||c&&d){s.values[a]=new p({objectType:o});continue}if(l&&m||c&&g)return null;d?(n.minValue=-1/0,n.maxValue=1/0):f&&(r.minValue=-1/0,r.maxValue=1/0);const y=Math.max(n.minValue,r.minValue),_=Math.min(n.maxValue,r.maxValue);if(y>_)return null;s.values[a]=new p({objectType:i,minValue:y,maxValue:_})}return s}function H(e,t,n){const s=n.slice(),o=s.shift();let i=s.shift(),a=w(e,t,o.fields,i.fields),r=new Set([...o.fields,...i.fields]),l=new Map;for(const u of o.contingencies){const[e]=N(u,a.codedValueFields,!0);l.has(e)?l.get(e)?.push(u):l.set(e,[u])}for(;s.length>0;){const n=new Map,o=s.shift(),c=w(e,t,r,o.fields);for(const e of i.contingencies){const[t,s]=N(e,a.codedValueFields),o=s?j(l,t):l.get(t);if(l.has(V)&&o?.push(...F(e,l.get(V),a.codedValueFields)),null!=o)for(const i of o){const t=a.rangeFields.size>0?E(i,e,a.rangeFields):T(i,e);if(null==t)break;const[s]=N(t,c.codedValueFields,!0);n.has(s)?n.get(s)?.push(t):n.set(s,[t])}}l=n,i=o,a=c,r=new Set([...r,...i.fields])}const c=[];for(const u of i.contingencies){const[e,t]=N(u,a.codedValueFields),n=t?j(l,e):l.get(e);if(l.has(V)&&n.push(...F(u,l.get(V),a.codedValueFields)),null!=n)for(const s of n){const e=a.rangeFields.size>0?E(s,u,a.rangeFields):T(s,u);null!=e&&c.push(e)}}return c}function U(e,t){let n=e.url??e.uid;if(e.subtypes&&e.subtypes.length>0){const s=f(e,t);n+=`|${s?`subtype:${s.code}`:"subtype:null"}`}if(g(e)&&e.types&&e.typeIdField&&e.types.some(e=>Object.keys(e.domains).length>0)){n+=`|${`type:${t.getAttribute(e.typeIdField)}`}`}return n}e([c()],C.prototype,"_fieldsWithContingentValues",null),e([c()],C.prototype,"layers",void 0),e([c()],C.prototype,"updating",null),C=e([u("esri.widgets.support.ContingentValuesManager")],C);export{C as ContingentValuesManager,L as isLayerWithContingentValues};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,cast as o,subclass as i}from"../../core/accessorSupport/decorators.js";import r from"../Widget.js";import{loadCalciteComponents as n}from"./componentsUtils.js";import{tsx as s,messageBundle as l}from"./widget.js";import c from"./FilterBuilder/FilterBuilderViewModel.js";const a={fab:!0,menu:!0},d="esri-filter-builder",p={base:d,conditionContainer:`${d}__condition-container`,operatorSelect:`${d}__operator-select`};let u=class extends r{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new c,this.visibleElements={...a}}loadDependencies(){return n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conditionOperator(){return this.viewModel.conditionOperator}set conditionOperator(e){this.viewModel.conditionOperator=e}get count(){return this.viewModel.count}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}castVisibleElements(e){return{...a,...e}}get whereClause(){return this.viewModel.whereClause}get whereClauses(){return this.viewModel.whereClauses}render(){return s("div",{class:p.base},this._renderOperatorSelect(),this._renderConditions(),this._renderFAB())}reset(){this.viewModel.reset()}_renderOperatorSelect(){if(this.count<2)return;const{conditionOperator:e,messages:t}=this,o="AND"===e;return s("div",{class:p.operatorSelect},s("calcite-select",{label:t.condition,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.conditionOperator=e.value}},s("calcite-option",{label:t.allAreTrue,selected:o,value:"AND"}),s("calcite-option",{label:t.anyAreTrue,selected:!o,value:"OR"})))}_renderConditions(){return this.viewModel.conditionWidgets.toArray().map((e,t)=>this._renderConditionContainer(e,t))}_renderConditionContainer(e,t){return s("calcite-block",{class:p.conditionContainer,expanded:!0,heading:this.messages.condition},e.render(),this._renderConditionrMenu(t))}_renderFAB(){if(!this.visibleElements.fab)return;const e="loading"===this.state;return s("calcite-fab",{appearance:"outline-fill",disabled:e,icon:"plus",kind:"neutral",loading:e,onclick:()=>this.viewModel.addCondition()
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,cast as o,subclass as i}from"../../core/accessorSupport/decorators.js";import r from"../Widget.js";import{loadCalciteComponents as n}from"./componentsUtils.js";import{tsx as s,messageBundle as l}from"./widget.js";import c from"./FilterBuilder/FilterBuilderViewModel.js";const a={fab:!0,menu:!0},d="esri-filter-builder",p={base:d,conditionContainer:`${d}__condition-container`,operatorSelect:`${d}__operator-select`};let u=class extends r{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new c,this.visibleElements={...a}}loadDependencies(){return n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conditionOperator(){return this.viewModel.conditionOperator}set conditionOperator(e){this.viewModel.conditionOperator=e}get count(){return this.viewModel.count}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}castVisibleElements(e){return{...a,...e}}get whereClause(){return this.viewModel.whereClause}get whereClauses(){return this.viewModel.whereClauses}render(){return s("div",{class:p.base},this._renderOperatorSelect(),this._renderConditions(),this._renderFAB())}reset(){this.viewModel.reset()}_renderOperatorSelect(){if(this.count<2)return;const{conditionOperator:e,messages:t}=this,o="AND"===e;return s("div",{class:p.operatorSelect},s("calcite-select",{label:t.condition,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.conditionOperator=e.value}},s("calcite-option",{label:t.allAreTrue,selected:o,value:"AND"}),s("calcite-option",{label:t.anyAreTrue,selected:!o,value:"OR"})))}_renderConditions(){return this.viewModel.conditionWidgets.toArray().map((e,t)=>this._renderConditionContainer(e,t))}_renderConditionContainer(e,t){return s("calcite-block",{class:p.conditionContainer,expanded:!0,heading:this.messages.condition},e.render(),this._renderConditionrMenu(t))}_renderFAB(){if(!this.visibleElements.fab)return;const e="loading"===this.state;return s("calcite-fab",{appearance:"outline-fill",disabled:e,icon:"plus",kind:"neutral",loading:e,text:this.messages.addNew,textEnabled:!0,onclick:()=>this.viewModel.addCondition()})}_renderConditionrMenu(e){if(!this.visibleElements.menu)return;const{messages:t}=this;return s("calcite-action-menu",{label:t.moreOptions,overlayPositioning:"fixed",placement:"bottom-end",slot:"control"},s("calcite-action",{text:t.delete,textEnabled:!0,onclick:()=>this.viewModel.removeCondition(e)}),s("calcite-action",{text:t.duplicate,textEnabled:!0,onclick:()=>this.viewModel.duplicateCondition(e)}))}};e([t()],u.prototype,"conditionOperator",null),e([t()],u.prototype,"count",null),e([t()],u.prototype,"layer",null),e([t(),l("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],u.prototype,"messages",void 0),e([t(),l("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([t()],u.prototype,"operators",null),e([t()],u.prototype,"state",null),e([t()],u.prototype,"viewModel",void 0),e([t()],u.prototype,"visibleElements",void 0),e([o("visibleElements")],u.prototype,"castVisibleElements",null),e([t()],u.prototype,"whereClause",null),e([t()],u.prototype,"whereClauses",null),u=e([i("esri.widgets.support.FilterBuilder")],u);export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Color.js";import{substitute as i}from"../../intl.js";import{deprecateWidget as n}from"../../core/deprecate.js";import s from"../../core/Logger.js";import{watch as o,initial as l}from"../../core/reactiveUtils.js";import{formatDecimal as a}from"../../core/unitFormatUtils.js";import{property as r,subclass as c}from"../../core/accessorSupport/decorators.js";import d from"../../views/interactive/snapping/SnappingOptions.js";import p from"../Widget.js";import{loadCalciteComponents as g}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{loadLabeledSwitchComponents as u,LabeledSwitch as h}from"./LabeledSwitch.js";import{tsx as b,classes as v,messageBundle as w}from"./widget.js";import y from"./GridControls/GridControlsViewModel.js";import{userInputToGridRotation as _,gridRotationToDegrees as C}from"./GridControls/gridUtils.js";import f from"./GridControls/VisibleElements.js";const M="esri-grid-controls",I={base:M,borderedSwitch:`${M}__switch--bordered`,container:`${M}__container`,numericInputsContainer:`${M}__numeric-inputs__container`,tilegroup:`${M}__tilegroup`,tile:`${M}__tile`,tileDisabled:`${M}__tile--disabled`,tileContent:`${M}__tile__content`,suffixedInputContainer:`${M}__input-with-suffix__container`,inlineIcon:`${M}__inline-icon`},S={widgetIcon:"grid-unit",gridTheme:{light:"circle",dark:"circle-area",custom:"palette"},placementState:{interactive:"maximum-territory-distance",place:"move",rotate:"rotate"},warning:"exclamation-mark-triangle"},T=t.fromArray([115,115,115]),L=t.fromArray([200,200,200]),D=["interactive","place","rotate"];let k=class extends p{constructor(e,t){super(e,t),this.customColor=null,this.messages=null,this.messagesUnits=null,this.viewModel=new y,this.visibleElements=new f,e?.suppressDeprecationWarning||n(s.getLogger(this),"Grid Controls","arcgis-grid-controls",{version:"4.33"})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.viewModel.gridColor,e=>{!e||T.equals(e)||L.equals(e)||(this.customColor=e)},l)])}loadDependencies(){return Promise.all([g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip"),"color-picker":()=>import("@esri/calcite-components/dist/components/calcite-color-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number")}),u()])}get icon(){return S.widgetIcon}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages.widgetLabel}set label(e){this._overrideIfSome("label",e)}get snappingManager(){return this.viewModel.snappingManager}set snappingManager(e){this.viewModel.snappingManager=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get theme(){const e=this.viewModel.gridColor;return e?T.equals(e)?"dark":L.equals(e)?"light":"custom":null}set theme(e){const{viewModel:t,customColor:i,view:n}=this;switch(e){case"light":t.gridColor=L;break;case"dark":t.gridColor=T;break;case"custom":t.gridColor=i??n?.effectiveTheme.accentColor??T}}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){return b("div",{"aria-label":this.label,class:this.classes(I.base,m.widget,m.panel)},b("div",{class:I.container},this._renderContent()))}_renderContent(){const{visibleElements:e}=this;return[e.gridEnabledToggle?this._renderEnabledToggle():null,e.placementButtons?this._renderGridPlacementButtons():null,e.numericInputs?this._renderNumericInputs():null,e.lineIntervalInput?this._renderIntervalInput():null,e.gridSnapEnabledToggle&&this.viewModel.snappingOptions?this._renderSnappingToggle():null,e.dynamicScaleToggle?this._renderDynamicScaleToggle():null,e.rotateWithMapToggle?this._renderRotateToggle():null,e.colorSelection?this._renderColorSelection():null]}_renderGridPlacementButtons(){const{interactivePlacementState:e,placementDisabled:t,gridControlsEnabled:i}=this.viewModel,n=t||!i;return b("calcite-label",{key:"grid-placement-buttons",scale:"s"},this.messages.placementOptions,b("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},D.map(t=>this._renderPlacementModeButton(t,n,e))))}_renderPlacementModeButton(e,t,i){const n=this.messages.placementState[e],s=`__placement-action-${e}`;return b("div",null,b("calcite-action",{active:i===e,alignment:"center",disabled:t,icon:S.placementState[e],id:s,onclick:()=>this.viewModel.togglePlacementState(e),text:n}),b("calcite-tooltip",{overlayPositioning:"fixed",placement:"top",referenceElement:s,topLayerDisabled:this.topLayerDisabled},n))}_renderNumericInputs(){const{rotation:e,spacing:t,effectiveSpacingAfterDynamicScaling:n,numericSpacingInputShouldBeVisible:s,unit:o="meters"}=this.viewModel,l=this.messagesUnits.units[o].abbr,r=this.viewModel.gridControlsEnabled,c=null!=n&&n!==this.viewModel.spacing,d=`__spacing_input_scaled-${this.id}`;return b("div",{class:this.classes(I.numericInputsContainer)},[s?b("calcite-label",{key:"spacing-label",scale:"s"},b("span",null,this.messages.inputLabel.spacing,c?b("calcite-icon",{class:this.classes(I.inlineIcon),icon:S.warning,id:d,scale:"s",tabIndex:0}):void 0),b("div",{class:I.suffixedInputContainer},b("calcite-input-number",{disabled:!r,numberButtonType:"none",suffixText:l,value:`${t?.toFixed(2)}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=parseFloat(e.value);this.viewModel.spacing=t,t!==this.viewModel.spacing&&(e.value=`${this.viewModel.spacing}`)}}),c?b("calcite-tooltip",{overlayPositioning:"fixed",placement:"leading",referenceElement:d,topLayerDisabled:this.topLayerDisabled},i(this.messages.warnings.dynamicSpacing,{actualSpacingIncludingUnit:a(this.messagesUnits,n,o,2,"plural")})):void 0)):void 0,b("calcite-label",{key:"angle-label",scale:"s"},this.messages.inputLabel.angle,b("calcite-input-number",{disabled:!r,integer:!0,numberButtonType:"none",suffixText:this.messagesUnits.units.degrees.abbr,value:`${C(e)}`,onCalciteInputNumberChange:({currentTarget:e})=>this.viewModel.rotation=_(e.value)}))])}_renderIntervalInput(){const{majorLineInterval:e,gridControlsEnabled:t}=this.viewModel;return b("div",{class:this.classes(I.numericInputsContainer)},b("calcite-label",{scale:"s"},this.messages.inputLabel.interval,b("calcite-input-number",{disabled:!t,integer:!0,max:15,min:1,numberButtonType:"vertical",value:`${e}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=Number.parseInt(e.value,10);this.viewModel.majorLineInterval=t,t!==this.viewModel.majorLineInterval&&(e.value=`${this.viewModel.majorLineInterval}`)}})))}_renderSnappingToggle(){const{snappingOptions:e,gridControlsEnabled:t}=this.viewModel;return b(h,{checked:!!(e?.gridEnabled??!1),disabled:!(t&&!!e),key:"grid-snap-enabled-toggle",label:this.messages.switchLabel.snap,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.snappingOptions?.set("gridEnabled",e)})}_renderDynamicScaleToggle(){const{viewModel:e,messages:t}=this,i=this.visibleElements.outOfScaleWarning&&e.gridOutOfScale;return b(h,{checked:e.dynamicScaling,disabled:!e.gridControlsEnabled,hint:i?t.warnings.outOfScale:void 0,hintIcon:S.warning,hintKind:"warning",key:`grid-dynamic-scale-toggle-${this.id}`,label:t.switchLabel.scaling,topLayerDisabled:this.topLayerDisabled,onChange:t=>e.dynamicScaling=t})}_renderRotateToggle(){const{gridControlsEnabled:e,rotateWithMap:t}=this.viewModel;return b(h,{checked:t,disabled:!e,key:"grid-rotate-map-toggle",label:this.messages.switchLabel.rotateWithMap,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.rotateWithMap=e})}_renderEnabledToggle(){return b("div",{class:I.borderedSwitch},b(h,{checked:this.viewModel.displayEnabled,disabled:!!this.viewModel.interactivePlacementState,key:"grid-enabled-toggle",label:this.messages.switchLabel.display,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.trySetDisplayEnabled(e)}))}_renderColorSelection(){const{customColor:e}=this,i=`${this.id}--custom-grid-color-button`;return b("calcite-label",{scale:"s"},this.messages.inputLabel.theme,b("div",{class:I.tilegroup},[this._renderThemeTile({value:"dark"}),this._renderThemeTile({value:"light"}),this._renderThemeTile({value:"custom",id:i}),b("calcite-popover",{closable:!0,heading:this.messages.colorInputHeading,label:this.messages.gridLineColorPopoverLabel,overlayPositioning:"fixed",referenceElement:i,topLayerDisabled:this.topLayerDisabled},b("calcite-color-picker",{alphaChannel:!0,savedDisabled:!0,value:e?.toHex({digits:8})??"#000000ff",onCalciteColorPickerChange:e=>{const i=t.fromHex(e.currentTarget.value);i&&(this.customColor=i,this.theme="custom")}}))]))}_renderThemeTile(e){const{theme:t}=this,{value:i}=e,n=this.messages.gridTheme[i],s=`${this.id}--theme_tile_${i}`,o=`${s}__label`,l=S.gridTheme[i],a=this.viewModel.gridControlsEnabled;return b("div",{class:v({[I.tile]:!0,[I.tileDisabled]:!a}),id:e.id,role:"button"},b("input",{"aria-labelledby":o,checked:t===i,disabled:!a,id:s,name:`${this.id}--theme`,onchange:e=>{this.theme=i,e.target?.focus()},tabIndex:0,type:"radio"}),b("div",{class:I.tileContent},b("calcite-icon",{icon:l,scale:"l"}),b("calcite-label",{for:s,id:o},n)))}};e([r({type:t})],k.prototype,"customColor",void 0),e([r()],k.prototype,"icon",null),e([r()],k.prototype,"label",null),e([r(),w("esri/widgets/support/GridControls/t9n/GridControls")],k.prototype,"messages",void 0),e([r(),w("esri/core/t9n/Units")],k.prototype,"messagesUnits",void 0),e([r()],k.prototype,"snappingManager",null),e([r({type:d})],k.prototype,"snappingOptions",null),e([r()],k.prototype,"theme",null),e([r()],k.prototype,"view",null),e([r({type:y})],k.prototype,"viewModel",void 0),e([r({type:f,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([c("esri.widgets.support.GridControls")],k);const E=k;export{E as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Color.js";import{substitute as i}from"../../intl.js";import{deprecateWidget as n}from"../../core/deprecate.js";import s from"../../core/Logger.js";import{watch as o,initial as l}from"../../core/reactiveUtils.js";import{formatDecimal as a}from"../../core/unitFormatUtils.js";import{property as r,subclass as c}from"../../core/accessorSupport/decorators.js";import d from"../../views/interactive/snapping/SnappingOptions.js";import p from"../Widget.js";import{loadCalciteComponents as g}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{loadLabeledSwitchComponents as u,LabeledSwitch as h}from"./LabeledSwitch.js";import{tsx as b,classes as v,messageBundle as w}from"./widget.js";import y from"./GridControls/GridControlsViewModel.js";import{userInputToGridRotation as _,gridRotationToDegrees as C}from"./GridControls/gridUtils.js";import f from"./GridControls/VisibleElements.js";const M="esri-grid-controls",I={base:M,borderedSwitch:`${M}__switch--bordered`,container:`${M}__container`,numericInputsContainer:`${M}__numeric-inputs__container`,tilegroup:`${M}__tilegroup`,tile:`${M}__tile`,tileDisabled:`${M}__tile--disabled`,tileContent:`${M}__tile__content`,suffixedInputContainer:`${M}__input-with-suffix__container`,inlineIcon:`${M}__inline-icon`},S={widgetIcon:"grid-unit",gridTheme:{light:"circle",dark:"circle-area",custom:"palette"},placementState:{interactive:"maximum-territory-distance",place:"move",rotate:"rotate"},warning:"exclamation-mark-triangle"},T=t.fromArray([115,115,115]),L=t.fromArray([200,200,200]),D=["interactive","place","rotate"];let k=class extends p{constructor(e,t){super(e,t),this.customColor=null,this.messages=null,this.messagesUnits=null,this.viewModel=new y,this.visibleElements=new f,e?.suppressDeprecationWarning||n(s.getLogger(this),"Grid Controls","arcgis-grid-controls",{version:"4.33"})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([o(()=>this.viewModel.gridColor,e=>{!e||T.equals(e)||L.equals(e)||(this.customColor=e)},l)])}loadDependencies(){return Promise.all([g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip"),"color-picker":()=>import("@esri/calcite-components/dist/components/calcite-color-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number")}),u()])}get icon(){return S.widgetIcon}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages.widgetLabel}set label(e){this._overrideIfSome("label",e)}get snappingManager(){return this.viewModel.snappingManager}set snappingManager(e){this.viewModel.snappingManager=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get theme(){const e=this.viewModel.gridColor;return e?T.equals(e)?"dark":L.equals(e)?"light":"custom":null}set theme(e){const{viewModel:t,customColor:i,view:n}=this;switch(e){case"light":t.gridColor=L;break;case"dark":t.gridColor=T;break;case"custom":t.gridColor=i??n?.effectiveTheme.accentColor??T}}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){return b("div",{"aria-label":this.label,class:this.classes(I.base,m.widget,m.panel)},b("div",{class:I.container},this._renderContent()))}_renderContent(){const{visibleElements:e}=this;return[e.gridEnabledToggle?this._renderEnabledToggle():null,e.placementButtons?this._renderGridPlacementButtons():null,e.numericInputs?this._renderNumericInputs():null,e.lineIntervalInput?this._renderIntervalInput():null,e.gridSnapEnabledToggle&&this.viewModel.snappingOptions?this._renderSnappingToggle():null,e.dynamicScaleToggle?this._renderDynamicScaleToggle():null,e.rotateWithMapToggle?this._renderRotateToggle():null,e.colorSelection?this._renderColorSelection():null]}_renderGridPlacementButtons(){const{interactivePlacementState:e,placementDisabled:t,gridControlsEnabled:i}=this.viewModel,n=t||!i;return b("calcite-label",{key:"grid-placement-buttons",scale:"s"},this.messages.placementOptions,b("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},D.map(t=>this._renderPlacementModeButton(t,n,e))))}_renderPlacementModeButton(e,t,i){const n=this.messages.placementState[e],s=`__placement-action-${e}`;return b("div",null,b("calcite-action",{active:i===e,alignment:"center",disabled:t,icon:S.placementState[e],id:s,text:n,onclick:()=>this.viewModel.togglePlacementState(e)}),b("calcite-tooltip",{overlayPositioning:"fixed",placement:"top",referenceElement:s,topLayerDisabled:this.topLayerDisabled},n))}_renderNumericInputs(){const{rotation:e,spacing:t,effectiveSpacingAfterDynamicScaling:n,numericSpacingInputShouldBeVisible:s,unit:o="meters"}=this.viewModel,l=this.messagesUnits.units[o].abbr,r=this.viewModel.gridControlsEnabled,c=null!=n&&n!==this.viewModel.spacing,d=`__spacing_input_scaled-${this.id}`;return b("div",{class:this.classes(I.numericInputsContainer)},[s?b("calcite-label",{key:"spacing-label",scale:"s"},b("span",null,this.messages.inputLabel.spacing,c?b("calcite-icon",{class:this.classes(I.inlineIcon),icon:S.warning,id:d,scale:"s",tabIndex:0}):void 0),b("div",{class:I.suffixedInputContainer},b("calcite-input-number",{disabled:!r,numberButtonType:"none",suffixText:l,value:`${t?.toFixed(2)}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=parseFloat(e.value);this.viewModel.spacing=t,t!==this.viewModel.spacing&&(e.value=`${this.viewModel.spacing}`)}}),c?b("calcite-tooltip",{overlayPositioning:"fixed",placement:"leading",referenceElement:d,topLayerDisabled:this.topLayerDisabled},i(this.messages.warnings.dynamicSpacing,{actualSpacingIncludingUnit:a(this.messagesUnits,n,o,2,"plural")})):void 0)):void 0,b("calcite-label",{key:"angle-label",scale:"s"},this.messages.inputLabel.angle,b("calcite-input-number",{disabled:!r,integer:!0,numberButtonType:"none",suffixText:this.messagesUnits.units.degrees.abbr,value:`${C(e)}`,onCalciteInputNumberChange:({currentTarget:e})=>this.viewModel.rotation=_(e.value)}))])}_renderIntervalInput(){const{majorLineInterval:e,gridControlsEnabled:t}=this.viewModel;return b("div",{class:this.classes(I.numericInputsContainer)},b("calcite-label",{scale:"s"},this.messages.inputLabel.interval,b("calcite-input-number",{disabled:!t,integer:!0,max:15,min:1,numberButtonType:"vertical",value:`${e}`,onCalciteInputNumberChange:({currentTarget:e})=>{const t=Number.parseInt(e.value,10);this.viewModel.majorLineInterval=t,t!==this.viewModel.majorLineInterval&&(e.value=`${this.viewModel.majorLineInterval}`)}})))}_renderSnappingToggle(){const{snappingOptions:e,gridControlsEnabled:t}=this.viewModel;return b(h,{checked:!!(e?.gridEnabled??!1),disabled:!(t&&!!e),key:"grid-snap-enabled-toggle",label:this.messages.switchLabel.snap,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.snappingOptions?.set("gridEnabled",e)})}_renderDynamicScaleToggle(){const{viewModel:e,messages:t}=this,i=this.visibleElements.outOfScaleWarning&&e.gridOutOfScale;return b(h,{checked:e.dynamicScaling,disabled:!e.gridControlsEnabled,hint:i?t.warnings.outOfScale:void 0,hintIcon:S.warning,hintKind:"warning",key:`grid-dynamic-scale-toggle-${this.id}`,label:t.switchLabel.scaling,topLayerDisabled:this.topLayerDisabled,onChange:t=>e.dynamicScaling=t})}_renderRotateToggle(){const{gridControlsEnabled:e,rotateWithMap:t}=this.viewModel;return b(h,{checked:t,disabled:!e,key:"grid-rotate-map-toggle",label:this.messages.switchLabel.rotateWithMap,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.rotateWithMap=e})}_renderEnabledToggle(){return b("div",{class:I.borderedSwitch},b(h,{checked:this.viewModel.displayEnabled,disabled:!!this.viewModel.interactivePlacementState,key:"grid-enabled-toggle",label:this.messages.switchLabel.display,topLayerDisabled:this.topLayerDisabled,onChange:e=>this.viewModel.trySetDisplayEnabled(e)}))}_renderColorSelection(){const{customColor:e}=this,i=`${this.id}--custom-grid-color-button`;return b("calcite-label",{scale:"s"},this.messages.inputLabel.theme,b("div",{class:I.tilegroup},[this._renderThemeTile({value:"dark"}),this._renderThemeTile({value:"light"}),this._renderThemeTile({value:"custom",id:i}),b("calcite-popover",{closable:!0,heading:this.messages.colorInputHeading,label:this.messages.gridLineColorPopoverLabel,overlayPositioning:"fixed",referenceElement:i,topLayerDisabled:this.topLayerDisabled},b("calcite-color-picker",{alphaChannel:!0,savedDisabled:!0,value:e?.toHex({digits:8})??"#000000ff",onCalciteColorPickerChange:e=>{const i=t.fromHex(e.currentTarget.value);i&&(this.customColor=i,this.theme="custom")}}))]))}_renderThemeTile(e){const{theme:t}=this,{value:i}=e,n=this.messages.gridTheme[i],s=`${this.id}--theme_tile_${i}`,o=`${s}__label`,l=S.gridTheme[i],a=this.viewModel.gridControlsEnabled;return b("div",{class:v({[I.tile]:!0,[I.tileDisabled]:!a}),id:e.id,role:"button"},b("input",{"aria-labelledby":o,checked:t===i,disabled:!a,id:s,name:`${this.id}--theme`,tabIndex:0,type:"radio",onchange:e=>{this.theme=i,e.target?.focus()}}),b("div",{class:I.tileContent},b("calcite-icon",{icon:l,scale:"l"}),b("calcite-label",{for:s,id:o},n)))}};e([r({type:t})],k.prototype,"customColor",void 0),e([r()],k.prototype,"icon",null),e([r()],k.prototype,"label",null),e([r(),w("esri/widgets/support/GridControls/t9n/GridControls")],k.prototype,"messages",void 0),e([r(),w("esri/core/t9n/Units")],k.prototype,"messagesUnits",void 0),e([r()],k.prototype,"snappingManager",null),e([r({type:d})],k.prototype,"snappingOptions",null),e([r()],k.prototype,"theme",null),e([r()],k.prototype,"view",null),e([r({type:y})],k.prototype,"viewModel",void 0),e([r({type:f,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([c("esri.widgets.support.GridControls")],k);const E=k;export{E as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{Heading as e}from"./Heading.js";import{tsx as t}from"./widget.js";import{classes as n}from"./widgetUtils.js";const l="esri-item-list",i=`${l}__list-item`,r={filterContainerSticky:`${l}__filter-container--sticky`,group:`${l}__group`,groupHeader:`${l}__group__header`,item:i,itemDisabled:`${i}--disabled`,itemIcon:`${i}-icon`,itemContentEnd:`${i}-content-end`,noMatchesMessage:`${l}__no-matches-message`,scroller:`${l}__scroller`,scrollerEnabled:`${l}__scroller--enabled`},o=4;function s(e){const{disabled:n,filterText:l="",id:i,messages:r,onFilterChange:o,...s}=e;return t("div",{key:i},e.filterEnabled??1?c({disabled:n,filterText:l,id:i,messages:r,onFilterChange:o}):null,d({...s,disabled:n,enableListScroll:e.enableListScroll??!0,filterText:l,messages:r}))}function a(e){return!!e.items}function d(e){const{headingLevel:l,items:i,...o}=e;return 0===i.length?t("div",{class:r.noMatchesMessage,key:"no-matches"},e.messages.noMatches):t("div",{class:n({[r.scroller]:!0,[r.scrollerEnabled]:!!e.enableListScroll}),key:"item-container"},i.map(e=>a(e)?g({...o,group:e,headingLevel:l}):m({...o,grouped:!0,item:e})))}function c(e){const{disabled:n,messages:l,filterText:i,enableListScroll:o}=e;return t("div",{class:o?void 0:r.filterContainerSticky,key:"filter"},t("calcite-input",{disabled:n,placeholder:l.filterPlaceholder,type:"search",value:i,onCalciteInputInput:t=>{const n=t.currentTarget;e.onFilterChange?.(n.value)}}))}function m(e){const{disabled:l,identify:i,item:o,onItemMouseEnter:s,onItemMouseLeave:a,onItemSelect:d,renderIcon:c,renderCustomItem:m,renderItemContent:g,renderItemContentEnd:p,renderItemLabel:f,renderItemDescription:v,renderItemActionEnd:_,renderItemTitle:I,selectedItem:h}=e,y=u(o,i),C=y===u(h,i),k=m?.(e);if(k)return k;const $=g?.(o),L=p?.(o),M=_?.(o),E=!(!o.disabled&&!l),S=c?.(o);return t("calcite-list-item",{afterUpdate:e=>{e.selected=C},class:n({[r.item]:!0,[r.itemDisabled]:E}),"data-item":o,description:$?void 0:v?.(o)??void 0,disabled:E,key:y,label:$?void 0:f?.(o)??o.label??void 0,onblur:e=>a?.(b(e)),
|
|
2
|
+
import{Heading as e}from"./Heading.js";import{tsx as t}from"./widget.js";import{classes as n}from"./widgetUtils.js";const l="esri-item-list",i=`${l}__list-item`,r={filterContainerSticky:`${l}__filter-container--sticky`,group:`${l}__group`,groupHeader:`${l}__group__header`,item:i,itemDisabled:`${i}--disabled`,itemIcon:`${i}-icon`,itemContentEnd:`${i}-content-end`,noMatchesMessage:`${l}__no-matches-message`,scroller:`${l}__scroller`,scrollerEnabled:`${l}__scroller--enabled`},o=4;function s(e){const{disabled:n,filterText:l="",id:i,messages:r,onFilterChange:o,...s}=e;return t("div",{key:i},e.filterEnabled??1?c({disabled:n,filterText:l,id:i,messages:r,onFilterChange:o}):null,d({...s,disabled:n,enableListScroll:e.enableListScroll??!0,filterText:l,messages:r}))}function a(e){return!!e.items}function d(e){const{headingLevel:l,items:i,...o}=e;return 0===i.length?t("div",{class:r.noMatchesMessage,key:"no-matches"},e.messages.noMatches):t("div",{class:n({[r.scroller]:!0,[r.scrollerEnabled]:!!e.enableListScroll}),key:"item-container"},i.map(e=>a(e)?g({...o,group:e,headingLevel:l}):m({...o,grouped:!0,item:e})))}function c(e){const{disabled:n,messages:l,filterText:i,enableListScroll:o}=e;return t("div",{class:o?void 0:r.filterContainerSticky,key:"filter"},t("calcite-input",{disabled:n,placeholder:l.filterPlaceholder,type:"search",value:i,onCalciteInputInput:t=>{const n=t.currentTarget;e.onFilterChange?.(n.value)}}))}function m(e){const{disabled:l,identify:i,item:o,onItemMouseEnter:s,onItemMouseLeave:a,onItemSelect:d,renderIcon:c,renderCustomItem:m,renderItemContent:g,renderItemContentEnd:p,renderItemLabel:f,renderItemDescription:v,renderItemActionEnd:_,renderItemTitle:I,selectedItem:h}=e,y=u(o,i),C=y===u(h,i),k=m?.(e);if(k)return k;const $=g?.(o),L=p?.(o),M=_?.(o),E=!(!o.disabled&&!l),S=c?.(o);return t("calcite-list-item",{afterUpdate:e=>{e.selected=C},class:n({[r.item]:!0,[r.itemDisabled]:E}),"data-item":o,description:$?void 0:v?.(o)??void 0,disabled:E,key:y,label:$?void 0:f?.(o)??o.label??void 0,selected:C,title:I?.(o)??void 0,onblur:e=>a?.(b(e)),onCalciteListItemSelect:e=>{e.preventDefault(),d?.(b(e))},onfocus:e=>s?.(b(e)),onmouseenter:e=>s?.(b(e)),onmouseleave:e=>a?.(b(e))},S?t("div",{class:r.itemIcon,key:"content-start",slot:"content-start"},S):void 0,$?t("div",{key:"content",slot:"content"},$):null,L?t("div",{class:r.itemContentEnd,key:"content-end",slot:"content-end"},L):null,M??null)}function u(e,t){return e?`${t?.(e)||e.id}__${e.label}`:""}function b(e){return e.currentTarget["data-item"]}function g(n){const{disabled:l,group:i,headingLevel:s=o,selectionMode:a="none",renderCustomGroupContent:d,...c}=n,u=d?.(n);return t("div",{class:r.group,key:i.label??void 0},t(e,{class:r.groupHeader,level:s},i.label),u||t("calcite-list",{disabled:l,label:i.label??"",selectionAppearance:"border",selectionMode:a},i.items.map(e=>m({...c,disabled:l,item:e,grouped:!0}))))}export{s as ItemList,g as renderGroup,m as renderItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{loadCalciteComponents as e}from"./componentsUtils.js";import{tsx as t}from"./widget.js";const n=()=>e({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),i="esri-labeled-switch",o={label:`${i}__label`,labelContent:`${i}__label-content`,iconInfo:`${i}__icon_info`,iconWarning:`${i}__icon_warning`,tooltip:`${i}__tooltip`};function c({checked:e,disabled:n,hint:i,key:c,label:l,topLayerDisabled:a,onChange:s,hintIcon:r,hintKind:p}){return t("calcite-label",{class:o.label,disabled:n,key:c,layout:"inline-space-between",scale:"s"},i?t("div",{class:o.labelContent,key:"label-content"},t("div",null,l),t("calcite-icon",{class:"warning"!==p?o.iconInfo:o.iconWarning,icon:r??"information",id:c,onclick:e=>e.stopPropagation(),onpointerdown:e=>{e.preventDefault(),e.stopPropagation();const t=e.target.nextElementSibling;t.open=!t.open}
|
|
2
|
+
import{loadCalciteComponents as e}from"./componentsUtils.js";import{tsx as t}from"./widget.js";const n=()=>e({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),i="esri-labeled-switch",o={label:`${i}__label`,labelContent:`${i}__label-content`,iconInfo:`${i}__icon_info`,iconWarning:`${i}__icon_warning`,tooltip:`${i}__tooltip`};function c({checked:e,disabled:n,hint:i,key:c,label:l,topLayerDisabled:a,onChange:s,hintIcon:r,hintKind:p}){return t("calcite-label",{class:o.label,disabled:n,key:c,layout:"inline-space-between",scale:"s"},i?t("div",{class:o.labelContent,key:"label-content"},t("div",null,l),t("calcite-icon",{class:"warning"!==p?o.iconInfo:o.iconWarning,icon:r??"information",id:c,scale:"s",tabIndex:0,onclick:e=>e.stopPropagation(),onpointerdown:e=>{e.preventDefault(),e.stopPropagation();const t=e.target.nextElementSibling;t.open=!t.open}}),t("calcite-tooltip",{class:o.tooltip,overlayPositioning:"fixed",referenceElement:c,topLayerDisabled:a},i)):l,t("calcite-switch",{checked:e,disabled:n,scale:"s",onCalciteSwitchChange:e=>s(e.currentTarget.checked)}))}export{c as LabeledSwitch,n as loadLabeledSwitchComponents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as y}from"./SelectionList/selectionListUtils.js";import g from"./SelectionList/SelectionListViewModel.js";import b from"./SelectionList/VisibleElements.js";const I="esri-selection-list",f=`${I}__list-item`,_={base:I,container:`${I}__container`,flowItem:`${I}__flow-item`,layerDropdown:`${I}__layer-dropdown`,listItemFeature:`${f}__feature`,listItemFeatureIcon:`${f}__feature-icon`,listItemIcon:`${f}__icon`,itemCount:`${I}__item-count`,notice:`${I}__notice`,panel:`${I}__panel`,totalCount:`${I}__total-count`};let w=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.itemUnavailableFunction=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.title=null,this.viewModel=new g,this.visibleElements=new b,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _effectiveTitle(){if(this.visibleElements.header)return this.title||this.messages?.selection}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}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 layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}replace(e){this.viewModel.replace(e)}render(){return h("div",{class:this.classes(_.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:_.flowItem,heading:this._effectiveTitle,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:_.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:_.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:_.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:_.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:_.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:_.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:_.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=y(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",placement:"bottom-end",scale:this.menuScale,slot:"actions-end",topLayerDisabled:this.topLayerDisabled,width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{"data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",key:"zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",key:"select-single",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",key:"clear-selection",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,label:r,type:a}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!a||"feature"===a&&o||"layer"===a&&l||"group"===a&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,key:`custom-action-${r}`,onCalciteDropdownItemSelect:()=>t.callback({item:e})},r)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,title:e.layerIsVisible?void 0:t.layerIsNotVisible,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:_.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?_.listItemFeatureIcon:_.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,unavailable:this._itemIsUnavailable(e),value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:_.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_itemIsUnavailable(e){return this.itemUnavailableFunction?.({item:e})||!e.layerIsVisible}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],w.prototype,"_effectiveTitle",null),e([n()],w.prototype,"_hasFilterText",null),e([n()],w.prototype,"_itemWithOpenMenu",void 0),e([n()],w.prototype,"_list",void 0),e([n()],w.prototype,"activeLayerItem",null),e([n()],w.prototype,"allLayerItems",null),e([n()],w.prototype,"displayMode",void 0),e([n()],w.prototype,"effectiveCount",null),e([n()],w.prototype,"effectiveSelectionManager",null),e([n()],w.prototype,"filterText",null),e([n()],w.prototype,"highlightOnHoverEnabled",void 0),e([n()],w.prototype,"icon",null),e([n()],w.prototype,"itemActionConfigs",void 0),e([n()],w.prototype,"itemUnavailableFunction",void 0),e([n()],w.prototype,"isUpdating",null),e([n()],w.prototype,"label",null),e([n()],w.prototype,"layer",null),e([n()],w.prototype,"layerItems",null),e([n()],w.prototype,"layerViewMap",null),e([n()],w.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],w.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],w.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],w.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([n()],w.prototype,"onListItemSelect",void 0),e([n()],w.prototype,"scale",void 0),e([n()],w.prototype,"selectionManager",null),e([n()],w.prototype,"state",null),e([n()],w.prototype,"title",void 0),e([n()],w.prototype,"view",null),e([n()],w.prototype,"viewLayersAndTables",null),e([n()],w.prototype,"viewModel",void 0),e([n({type:b,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([n()],w.prototype,"visibleFeatureCount",null),e([n()],w.prototype,"visibleFeatureItems",null),e([n()],w.prototype,"visibleLayerCount",null),w=e([r("esri.widgets.support.SelectionList")],w);const C=w;export{C as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as y}from"./SelectionList/selectionListUtils.js";import g from"./SelectionList/SelectionListViewModel.js";import b from"./SelectionList/VisibleElements.js";const I="esri-selection-list",f=`${I}__list-item`,_={base:I,container:`${I}__container`,flowItem:`${I}__flow-item`,layerDropdown:`${I}__layer-dropdown`,listItemFeature:`${f}__feature`,listItemFeatureIcon:`${f}__feature-icon`,listItemIcon:`${f}__icon`,itemCount:`${I}__item-count`,notice:`${I}__notice`,panel:`${I}__panel`,totalCount:`${I}__total-count`};let w=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.itemUnavailableFunction=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.title=null,this.viewModel=new g,this.visibleElements=new b,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _effectiveTitle(){if(this.visibleElements.header)return this.title||this.messages?.selection}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}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 layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}replace(e){this.viewModel.replace(e)}render(){return h("div",{class:this.classes(_.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:_.flowItem,heading:this._effectiveTitle,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:_.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:_.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:_.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0,onclick:this.clear}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0,onclick:this.collapseItems})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:_.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:_.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:_.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:_.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=y(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",placement:"bottom-end",scale:this.menuScale,slot:"actions-end",topLayerDisabled:this.topLayerDisabled,width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{"data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",key:"zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",key:"select-single",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",key:"clear-selection",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,label:r,type:a}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!a||"feature"===a&&o||"layer"===a&&l||"group"===a&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,key:`custom-action-${r}`,onCalciteDropdownItemSelect:()=>t.callback({item:e})},r)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,title:e.layerIsVisible?void 0:t.layerIsNotVisible,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:_.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?_.listItemFeatureIcon:_.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,scale:this.scale,unavailable:this._itemIsUnavailable(e),value:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t),onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:_.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_itemIsUnavailable(e){return this.itemUnavailableFunction?.({item:e})||!e.layerIsVisible}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],w.prototype,"_effectiveTitle",null),e([n()],w.prototype,"_hasFilterText",null),e([n()],w.prototype,"_itemWithOpenMenu",void 0),e([n()],w.prototype,"_list",void 0),e([n()],w.prototype,"activeLayerItem",null),e([n()],w.prototype,"allLayerItems",null),e([n()],w.prototype,"displayMode",void 0),e([n()],w.prototype,"effectiveCount",null),e([n()],w.prototype,"effectiveSelectionManager",null),e([n()],w.prototype,"filterText",null),e([n()],w.prototype,"highlightOnHoverEnabled",void 0),e([n()],w.prototype,"icon",null),e([n()],w.prototype,"itemActionConfigs",void 0),e([n()],w.prototype,"itemUnavailableFunction",void 0),e([n()],w.prototype,"isUpdating",null),e([n()],w.prototype,"label",null),e([n()],w.prototype,"layer",null),e([n()],w.prototype,"layerItems",null),e([n()],w.prototype,"layerViewMap",null),e([n()],w.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],w.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],w.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],w.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([n()],w.prototype,"onListItemSelect",void 0),e([n()],w.prototype,"scale",void 0),e([n()],w.prototype,"selectionManager",null),e([n()],w.prototype,"state",null),e([n()],w.prototype,"title",void 0),e([n()],w.prototype,"view",null),e([n()],w.prototype,"viewLayersAndTables",null),e([n()],w.prototype,"viewModel",void 0),e([n({type:b,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([n()],w.prototype,"visibleFeatureCount",null),e([n()],w.prototype,"visibleFeatureItems",null),e([n()],w.prototype,"visibleLayerCount",null),w=e([r("esri.widgets.support.SelectionList")],w);const C=w;export{C as default};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type SelectionManager from "../../../views/SelectionManager.js";
|
|
1
2
|
import type SelectionOperation from "../../../views/selection/SelectionOperation.js";
|
|
2
3
|
import type { EventedAccessor } from "../../../core/Evented.js";
|
|
3
|
-
import type { SelectableViewUnion, SelectionOperationEvents, SelectionSource, SelectionToolName } from "../../../views/selection/types.js";
|
|
4
|
-
import type { SelectionToolOptions } from "./types.js";
|
|
4
|
+
import type { SelectableViewUnion, SelectionOperationEvents, SelectionOperationType, SelectionSource, SelectionToolName } from "../../../views/selection/types.js";
|
|
5
|
+
import type { SelectionToolConfig, SelectionToolOptions, SelectionToolbarState } from "./types.js";
|
|
5
6
|
|
|
6
7
|
/** @internal */
|
|
7
|
-
export interface SelectionToolbarViewModelProperties extends Partial<Pick<SelectionToolbarViewModel, "persistSelection" | "sources" | "view">> {}
|
|
8
|
+
export interface SelectionToolbarViewModelProperties extends Partial<Pick<SelectionToolbarViewModel, "continuousSelectionEnabled" | "defaultLassoToolOptions" | "defaultOperationType" | "defaultPointToolOptions" | "defaultRectangleToolOptions" | "layerViewPreferenceEnabled" | "persistSelection" | "returnFeatureTitleFields" | "returnGeometry" | "selectionManager" | "selectOnComplete" | "sources" | "toolConfigs" | "view">> {}
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Events emitted by SelectionToolbarViewModel.
|
|
@@ -32,19 +33,78 @@ export default class SelectionToolbarViewModel extends EventedAccessor {
|
|
|
32
33
|
constructor(properties?: SelectionToolbarViewModelProperties);
|
|
33
34
|
/** @internal */
|
|
34
35
|
get activeOperation(): SelectionOperation | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* @default false
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
accessor continuousSelectionEnabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Default configuration for the lasso tool.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
accessor defaultLassoToolOptions: SelectionToolOptions;
|
|
47
|
+
/**
|
|
48
|
+
* @default "add"
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
accessor defaultOperationType: SelectionOperationType;
|
|
52
|
+
/**
|
|
53
|
+
* Default configuration for the point tool.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
accessor defaultPointToolOptions: SelectionToolOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Default configuration for the rectangle tool.
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
accessor defaultRectangleToolOptions: SelectionToolOptions;
|
|
64
|
+
/**
|
|
65
|
+
* Reference to the selection manager in use by the toolbar.
|
|
66
|
+
*
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
get effectiveSelectionManager(): SelectionManager | null | undefined;
|
|
70
|
+
/** @internal */
|
|
71
|
+
get effectiveSources(): SelectionSource[];
|
|
72
|
+
/**
|
|
73
|
+
* @default true
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
accessor layerViewPreferenceEnabled: boolean;
|
|
35
77
|
/**
|
|
36
78
|
* @default true
|
|
37
79
|
* @internal
|
|
38
80
|
*/
|
|
39
81
|
accessor persistSelection: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @default false
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
accessor returnFeatureTitleFields: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* @default true
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
accessor returnGeometry: boolean;
|
|
92
|
+
/** @internal */
|
|
93
|
+
accessor selectionManager: SelectionManager | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* @default true
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
accessor selectOnComplete: boolean;
|
|
40
99
|
/** @internal */
|
|
41
100
|
accessor sources: SelectionSource[] | null | undefined;
|
|
101
|
+
/** @internal */
|
|
102
|
+
get state(): SelectionToolbarState;
|
|
103
|
+
/** @internal */
|
|
104
|
+
accessor toolConfigs: SelectionToolConfig[];
|
|
42
105
|
/**
|
|
43
106
|
* The view from which the widget will operate.
|
|
44
107
|
*
|
|
45
|
-
* @name view
|
|
46
|
-
* @instance
|
|
47
|
-
* @type {module:esri/views/MapView | module:esri/views/SceneView}
|
|
48
108
|
* @internal
|
|
49
109
|
*/
|
|
50
110
|
accessor view: SelectableViewUnion | null | undefined;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
+
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
1
2
|
import type { SelectionOperationProperties } from "../../../views/selection/SelectionOperation.js";
|
|
3
|
+
import type { SelectionToolName } from "../../../views/selection/types.js";
|
|
2
4
|
|
|
3
5
|
/** @internal */
|
|
4
|
-
export type
|
|
6
|
+
export type SelectionToolbarState = "ready" | "disabled" | "active";
|
|
7
|
+
|
|
8
|
+
/** @internal */
|
|
9
|
+
export type SelectionToolOptions = SelectionOperationProperties;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Configuration object used to customize the Action representing the Tool
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface SelectionToolConfig extends SelectionToolOptions {
|
|
17
|
+
/** @internal */
|
|
18
|
+
icon: Icon["icon"];
|
|
19
|
+
/** @internal */
|
|
20
|
+
toolKey: string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
toolName: SelectionToolName;
|
|
23
|
+
}
|