@arcgis/core 6.0.0-next.54 → 6.0.0-next.55
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/WebScene.js +2 -2
- package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
- package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
- package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
- package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 14259910f44c08fd5bbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
- package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
- package/assets/esri/core/workers/chunks/{e507dfc4788295d9c244.js → 249a687ce1b6d0815242.js} +1 -1
- package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
- package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
- package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → 4401b3f8ebb658abe789.js} +1 -1
- package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
- package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
- package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
- package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
- package/assets/esri/core/workers/chunks/{e83806797979138fd22a.js → 844c593754b2692257f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d3e977f3b75474d7ebc.js → 846248697c398468d8e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
- package/assets/esri/core/workers/chunks/{032733b863426c5bde00.js → 9e508f930086d2ef5f22.js} +3 -3
- package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
- package/assets/esri/core/workers/chunks/{817bf487df056da1e6ec.js → a116dd204921e7464944.js} +1 -1
- package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
- package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
- package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
- package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
- package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
- package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
- package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
- package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → be0b8bb4f09aae6ff5de.js} +1 -1
- package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
- package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
- package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → e61082f56c08abe54b3a.js} +1 -1
- package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
- package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
- package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/chunks/CypherParser.js +1 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/blosc-wasm.js +2 -0
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/parquet.js +1 -1
- package/chunks/text.js +1 -1
- package/config.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/support/Ellipsoid.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/geodesicConstants.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/parquet.js +1 -1
- package/layers/raster/datasets/ZarrRaster.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/blosc.js +2 -0
- package/layers/support/BuildingFilter.js +1 -1
- package/layers/support/IntegratedMeshSemantics.js +1 -1
- package/layers/support/fieldUtils.d.ts +23 -87
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersMapping.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/libs/ajv/ajv.bundle-wrapper.js +1 -1
- package/package.json +4 -4
- package/renderers/types.d.ts +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/smartMapping/statistics/support/attributeDensity.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/tests/serviceMockDependencies.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
- package/views/2d/engine/vectorTiles/constants.js +1 -1
- package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
- package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.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/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/support/SweptSphereVolume.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TilingSchemeLogic.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/MapView.d.ts +1 -0
- package/views/SceneView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/ViewingMode.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/helpMessageUtils.js +1 -1
- package/views/draw/support/managers/EditSessionManager.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
- package/views/layers/support/editableLayerViews.js +1 -1
- package/views/overlay/TextOverlayItem.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/spatialReferenceSupport.js +1 -1
- package/views/webgl/ShaderTranspiler.js +2 -2
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
- package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
- package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
- package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
- package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
- package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
- package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
- package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
- package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{measurementLengthUnits as r,measurementAreaUnits as i}from"../../../core/units.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{messageBundle as o}from"../../support/decorators/messageBundle.js";import{UnitSelect as s}from"../../support/UnitSelect.js";import{tsx as c}from"../../support/widget.js";import l from"../../Widget.js";import{css as u}from"../css.js";import{TriangulatedImageMeasurementMixin as d}from"../mixins/TriangulatedImageMeasurementMixin.js";let f=class extends d(l){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return a({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),table:()=>import(`@esri/calcite-components/dist/components/calcite-table`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),"table-row":()=>import(`@esri/calcite-components/dist/components/calcite-table-row`),"table-header":()=>import(`@esri/calcite-components/dist/components/calcite-table-header`),"table-cell":()=>import(`@esri/calcite-components/dist/components/calcite-table-cell`)})}get _measurementResult(){let{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:n,heightMeasurementResult:r,distanceMeasurementResult:i}=t;switch(e){case`area`:return n;case`height`:return r;case`distance`:return i}}get _measurementAccuracy(){let{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:n,heightMeasurementAccuracy:r,distanceAccuracyArray:i}=t;switch(e){case`area`:return n;case`height`:return r;case`distance`:return i}}get _measurementUnit(){let{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:n}=this;
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{measurementLengthUnits as r,measurementAreaUnits as i}from"../../../core/units.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{messageBundle as o}from"../../support/decorators/messageBundle.js";import{UnitSelect as s}from"../../support/UnitSelect.js";import{tsx as c}from"../../support/widget.js";import l from"../../Widget.js";import{css as u}from"../css.js";import{TriangulatedImageMeasurementMixin as d}from"../mixins/TriangulatedImageMeasurementMixin.js";let f=class extends d(l){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return a({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),table:()=>import(`@esri/calcite-components/dist/components/calcite-table`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),"table-row":()=>import(`@esri/calcite-components/dist/components/calcite-table-row`),"table-header":()=>import(`@esri/calcite-components/dist/components/calcite-table-header`),"table-cell":()=>import(`@esri/calcite-components/dist/components/calcite-table-cell`)})}get _measurementResult(){let{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:n,heightMeasurementResult:r,distanceMeasurementResult:i}=t;switch(e){case`area`:return n;case`height`:return r;case`distance`:return i}}get _measurementAccuracy(){let{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:n,heightMeasurementAccuracy:r,distanceAccuracyArray:i}=t;switch(e){case`area`:return n;case`height`:return r;case`distance`:return i}}get _measurementUnit(){let{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:n}=this;return e===`area`?t:n}get _measurementUnitOptions(){let{measurementType:e}=this;return e===`area`?i:r}_convertedMeasurement(){let{measurementType:e}=this;switch(e){case`area`:return this.getConvertedAreaString(`measurement`);case`height`:return this.getConvertedHeightString(`measurement`);case`distance`:return this.getConvertedDistanceString(`measurement`)}}_measurementUnitChangeHandler(e){let{measurementType:t}=this;t===`area`?this.pixelAreaMeasurementUnit=e:this.pixelMeasurementUnit=e}_renderUnitSelect(){let{_measurementUnit:e,_measurementResult:t,_measurementUnitOptions:n,oiViewModel:r,messagesCommon:i}=this,{triangularMeasurementActive:a}=r;return t?c(`div`,{class:u.measurementsBar},c(s,{options:n,selectLabel:``,value:e,onChange:e=>this._measurementUnitChangeHandler(e)}),t?c(`calcite-action`,{bind:this,icon:`copy-to-clipboard`,label:`copy`,scale:`s`,text:``,title:i.copy,onclick:()=>this.copyActiveMeasurementResults(this.measurementType,a)}):null):null}_renderMeasurementResults(){let{_measurementResult:e,_measurementAccuracy:t,messages:n,measurementType:r}=this,{measurementTable:i,value:a,accuracy:o}=n;return e?c(`calcite-table`,{bordered:!0,caption:i,class:u.measurementsTable,scale:`s`},c(`calcite-table-row`,{slot:`table-header`},c(`calcite-table-header`,{alignment:`center`,heading:a}),c(`calcite-table-header`,{alignment:`center`,heading:o})),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},this._convertedMeasurement()),c(`calcite-table-cell`,{alignment:`center`},r===`distance`&&Array.isArray(t)&&t?.length||r===`area`&&t||r===`height`&&t?this.getAccuracy(this.measurementType):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})))):null}_renderActiveMeasurementResults(){let{oiViewModel:e}=this,{triangularMeasurementActive:t,measureType:n}=e;if(t)switch(n){case`area`:return this._renderTriangularAreaMeasurementResults();case`distance`:return this._renderTriangularDistanceMeasurementResults()}return this._renderMeasurementResults()}_renderNewMeasurementButton(){let{messages:e,measurementType:t}=this;return c(`calcite-button`,{class:u.measurementsButton,onclick:()=>this.oiViewModel.initializeMeasurement(t)},e.newMeasurement)}_renderStartMeasurementMessage(){let{oiViewModel:{displayNewMeasurementButton:e},messages:t,_measurementResult:n}=this;return!e&&!n&&c(`div`,{class:u.measurementDisplay,key:`start-measurement-${this.measurementType}`},t.startMeasurement)}_renderTriangularAreaMeasurementResults(){let{messages:e,oiViewModel:t}=this,{measurementTable:n,value:r,accuracy:i}=e,{triangulatedAreaMeasurement:a}=t;return a?c(`calcite-table`,{bordered:!0,caption:n,class:u.measurementsTable,scale:`s`},c(`calcite-table-row`,{slot:`table-header`},c(`calcite-table-header`,{alignment:`center`,heading:r}),c(`calcite-table-header`,{alignment:`center`,heading:i})),c(`calcite-table-row`,null,this._renderTriangularAreaCell(`measurement`),this._renderTriangularAreaCell(`accuracy`))):null}_renderTriangularDistanceAccuracyCell(){let{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return c(`calcite-table-cell`,{alignment:`center`},t?.distanceAccuracy?this.getConvertedTriangularDistanceMeasurementString(t.distanceAccuracy):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`}))}_renderTriangularAreaCell(e){let{oiViewModel:t}=this,{triangulatedAreaMeasurement:n}=t;return c(`calcite-table-cell`,{alignment:`center`},n?this.getConvertedTriangularAreaString(e):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`}))}_renderTriangularDistanceAngleAccuracyCell(){let{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return c(`calcite-table-cell`,{alignment:`center`},t?.angleAccuracy?this.getConvertedTriangularDistanceAngularResultsString(t.angleAccuracy):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`}))}_renderTriangularDistanceMeasurementResults(){let{oiViewModel:e,messages:t}=this,{distance:n,horizontal:r,vertical:i,slope:a,aspect:o,measurementTable:s,value:l,accuracy:d,type:f}=t,{triangulatedDistanceMeasurement:p,triangularMeasurementActive:m,measureType:h}=e;return!m||h!==`distance`?null:p?c(`calcite-table`,{bordered:!0,caption:s,class:u.measurementsTable,scale:`s`},c(`calcite-table-row`,{slot:`table-header`},c(`calcite-table-header`,{alignment:`center`,heading:f}),c(`calcite-table-header`,{alignment:`center`,heading:l}),c(`calcite-table-header`,{alignment:`center`,heading:d})),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},n),c(`calcite-table-cell`,{alignment:`center`},p?.distance?this.getConvertedTriangularDistanceMeasurementString(p.distance):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})),this._renderTriangularDistanceAccuracyCell()),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},r),c(`calcite-table-cell`,{alignment:`center`},p?.horizontalDistance?this.getConvertedTriangularDistanceMeasurementString(p.horizontalDistance):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})),this._renderTriangularDistanceAccuracyCell()),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},i),c(`calcite-table-cell`,{alignment:`center`},p?.verticalDistance?this.getConvertedTriangularDistanceMeasurementString(p.verticalDistance):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})),this._renderTriangularDistanceAccuracyCell()),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},a),c(`calcite-table-cell`,{alignment:`center`},p?.slope?this.getConvertedTriangularDistanceAngularResultsString(p.slope):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})),this._renderTriangularDistanceAngleAccuracyCell()),c(`calcite-table-row`,null,c(`calcite-table-cell`,{alignment:`center`},o),c(`calcite-table-cell`,{alignment:`center`},p?.aspect?this.getConvertedTriangularDistanceAngularResultsString(p.aspect):c(`calcite-icon`,{icon:`hourglass-active`,scale:`s`})),this._renderTriangularDistanceAngleAccuracyCell())):null}render(){return c(`calcite-panel`,{class:u.measurementResults,key:`measurement-result-container-${this.measurementType}`},this._renderStartMeasurementMessage(),this._renderNewMeasurementButton(),this._renderUnitSelect(),this._renderActiveMeasurementResults())}};e([t(),o(`esri/t9n/common`)],f.prototype,`messagesCommon`,void 0),e([t()],f.prototype,`_measurementResult`,null),e([t()],f.prototype,`_measurementAccuracy`,null),e([t()],f.prototype,`_measurementUnit`,null),e([t()],f.prototype,`_measurementUnitOptions`,null),f=e([n(`esri.widgets.OrientedImageryViewer.components.ImageMeasurementWidget`)],f);const p=f;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import{clone as t}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{mappedFind as r}from"../../../core/maybe.js";import{getMetersPerUnitForSR as i}from"../../../core/units.js";import a from"../../../geometry/Polygon.js";import{getExtentFromGeometry as o,scaleExtent as s}from"../../../geometry/support/geometryUtils.js";import{substitute as c,formatDate as l}from"../../../intl.js";import{getPopupLayer as u}from"../../../popup/support/featureUtils.js";import d from"../../../rest/support/FullTextSearch.js";const f=/https?:\/\/services.*\.arcgis\.com/i,p=/(?:\{([^}]+)\})/g,m=()=>n.getLogger(`esri.widgets.Search.support.layerSearchUtils`);function h(t,n){let{exactMatch:r=!1,location:a,maxResults:o,spatialReference:s,source:c,sourceIndex:l,suggestResult:u,view:d}=t,{layer:f,zoomScale:p}=c,h=d?.scale,g=_(c,d),x=n?.signal;return y(f).then(()=>{let e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(t=>{let{objectIdField:n,returnZ:_}=f,y=O(c);if(!A(f,y))throw m().error(`invalid-field: displayField is invalid.`),new e(`getResults():invalid-field`,`displayField is invalid.`);let S=t?.length?t:[y],w=c.outFields||S,T=v(w);if(!w.includes(n)&&!T&&w.push(n),f.floorInfo?.floorField&&w.push(f.floorInfo.floorField),!(T||k(f,w)))throw m().error(`invalid-field: outField is invalid.`),new e(`getResults():invalid-field`,`outField is invalid.`);let D=f.createQuery(),{orderByFields:j}=c;if(j&&(D.orderByFields=j),s){D.outSpatialReference=s;let e=1/i(s);e&&(D.maxAllowableOffset=e)}let M=f.geometryType===`mesh`||f.geometryType===`multipatch`;if(D.returnZ=f.capabilities?.data?.supportsZ&&!M&&_!==!1,D.returnGeometry=!0,D.multipatchOption=M?`xyFootprint`:null,w&&(D.outFields=w),a)D.geometry=a;else if(u.key)D.objectIds=[u.key];else{let t=c.searchFields||[y];if(!k(f,t))throw m().error(`invalid-field: search field is invalid.`),new e(`getResults():invalid-field`,`search field is invalid.`);E(f)&&(D.num=o),g&&(D.geometry=g);let n=u.text;if(!n?.trim()||(C({source:c,searchTerm:n,searchFields:t,exactMatch:r,query:D,type:`search`}),!b(D)))return[]}return f.queryFeatures(D,{signal:x}).then(async e=>{let{labelPointExecute:t}=await import(`../../../geometry/operators/labelPointOperator.js`);return K(e,d,c,l,y,h,p,t)})})}function g(t,n){let{source:r,spatialReference:i,view:a,suggestTerm:o,maxSuggestions:s,sourceIndex:c,exactMatch:l}=t,{layer:u}=r,d=n?.signal,f=_(r,a);return y(u).then(()=>{if(!E(u))return[];let t=O(r),n=r.searchFields||[t],a=[];r.suggestionTemplate?r.suggestionTemplate.replaceAll(p,(e,t)=>(a.push(t),e)):a.push(t);let h=v(a);!a.includes(u.objectIdField)&&!h&&a.push(u.objectIdField);let g=A(u,t),_=h||k(u,a),y=k(u,n);if(!g)throw m().error(`invalid-field: displayField is invalid.`),new e(`getSuggestions():invalid-field`,`displayField is invalid.`);if(!_)throw m().error(`invalid-field: outField is invalid.`),new e(`getSuggestions():invalid-field`,`outField is invalid.`);if(!y)throw m().error(`invalid-field: search field is invalid.`),new e(`getSuggestions():invalid-field`,`search field is invalid.`);let x=u.createQuery(),{orderByFields:S}=r;return S&&(x.orderByFields=S),x.outSpatialReference=i,x.returnGeometry=!1,x.num=s,x.outFields=a,f&&(x.geometry=f),!o.trim()||(C({source:r,searchTerm:o,searchFields:n,exactMatch:l,query:x,type:`suggest`}),!b(x))?[]:u.queryFeatures(x,{signal:d}).then(e=>U(e,r,c,t))})}function _(e,t){let{filter:n,withinViewEnabled:r}=e,i=t?.extent;return n?.geometry??(r&&i?i:void 0)}function v(e){return e&&e.includes(`*`)}async function y(t){if(!t)throw new e(`search:missing-layer`,`A layer is required for a layer search source.`);await t.load()}function b(e){return!!(e.fullText||e.where)}function x(e,t){let n=e?.indexes;return!n||!t?.length?!1:n.filter(e=>e.indexType===`FullText`).some(e=>{let n=e.fields?.split(`,`).map(e=>e.trim().toLowerCase())||[];return t.every(e=>n.includes(e.toLowerCase()))})}function S({text:e,searchFields:t,searchType:n=`prefix`}){return(n===`simple`?[e.trim()]:e.trim().split(` `)).filter(e=>!!e.trim()).map(e=>new d({onFields:t,searchTerm:e,searchType:n}))}function C({source:e,searchTerm:t,searchFields:n,exactMatch:r,query:i,type:a}){let{layer:o,filter:s,prefix:c=``,suffix:l=``,searchMode:u}=e,d=w(u,r,o,n);d.fullTextSearchType&&t&&(i.fullText=S({text:t,searchFields:n,searchType:d.fullTextSearchType})),i.where=L({searchTerm:N(`${c}${t}${l}`),layer:o,searchFields:n,filter:s,exactMatch:d.exactMatch,query:i,type:a})}function w(e,t,n,r){let i=T(n)&&x(n,r),a=e??(t?`simple`:`starts-with`);return a===`simple`?{exactMatch:!0,fullTextSearchType:null}:e===`starts-with`?{exactMatch:!1,fullTextSearchType:null}:a===`full-text-simple`?i?{exactMatch:!1,fullTextSearchType:`simple`}:{exactMatch:!0,fullTextSearchType:null}:i?{exactMatch:!1,fullTextSearchType:`prefix`}:{exactMatch:!1,fullTextSearchType:null}}function T(e){return e?.capabilities?.query?.supportsFullTextSearch??!1}function E(e){return e?.capabilities?.query?.supportsPagination??!1}function D(e){return e?.fieldsIndex?.fields?.find(e=>e.type===`string`)?.name??``}function O(e){return e.displayField||e.layer.displayField||D(e.layer)}function k(e,t){return!e||!t?.length?!1:t.every(t=>A(e,t))}function A(e,t){return!!e.getField(t)}function j(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!0;return!1}function M({codedValues:e},t,n){return r(e??[],e=>{let r=e.name,i=n?r:r.toLowerCase();return(n?t:t.toLowerCase())===i?e.code.toString():null})??null}function N(e){return e.replaceAll(`'`,`''`)}function P(e,t){let n=t?.where;return n?`(${e}) AND (${n})`:e}function F({currentTerm:e,field:t,filter:n,exactMatch:r,url:i,type:a}){let o=t?.type,s=t?.name;if(o===`string`||o===`date`||o===`global-id`){let t=f.test(i??``),o=t&&j(e)?`N`:``;return P(r&&a===`search`?`${s} = ${o}'${e}'`:t?`${s} LIKE ${o}
|
|
2
|
+
import e from"../../../core/Error.js";import{clone as t}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{mappedFind as r}from"../../../core/maybe.js";import{getMetersPerUnitForSR as i}from"../../../core/units.js";import a from"../../../geometry/Polygon.js";import{getExtentFromGeometry as o,scaleExtent as s}from"../../../geometry/support/geometryUtils.js";import{substitute as c,formatDate as l}from"../../../intl.js";import{getPopupLayer as u}from"../../../popup/support/featureUtils.js";import d from"../../../rest/support/FullTextSearch.js";const f=/https?:\/\/services.*\.arcgis\.com/i,p=/(?:\{([^}]+)\})/g,m=()=>n.getLogger(`esri.widgets.Search.support.layerSearchUtils`);function h(t,n){let{exactMatch:r=!1,location:a,maxResults:o,spatialReference:s,source:c,sourceIndex:l,suggestResult:u,view:d}=t,{layer:f,zoomScale:p}=c,h=d?.scale,g=_(c,d),x=n?.signal;return y(f).then(()=>{let e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(t=>{let{objectIdField:n,returnZ:_}=f,y=O(c);if(!A(f,y))throw m().error(`invalid-field: displayField is invalid.`),new e(`getResults():invalid-field`,`displayField is invalid.`);let S=t?.length?t:[y],w=c.outFields||S,T=v(w);if(!w.includes(n)&&!T&&w.push(n),f.floorInfo?.floorField&&w.push(f.floorInfo.floorField),!(T||k(f,w)))throw m().error(`invalid-field: outField is invalid.`),new e(`getResults():invalid-field`,`outField is invalid.`);let D=f.createQuery(),{orderByFields:j}=c;if(j&&(D.orderByFields=j),s){D.outSpatialReference=s;let e=1/i(s);e&&(D.maxAllowableOffset=e)}let M=f.geometryType===`mesh`||f.geometryType===`multipatch`;if(D.returnZ=f.capabilities?.data?.supportsZ&&!M&&_!==!1,D.returnGeometry=!0,D.multipatchOption=M?`xyFootprint`:null,w&&(D.outFields=w),a)D.geometry=a;else if(u.key)D.objectIds=[u.key];else{let t=c.searchFields||[y];if(!k(f,t))throw m().error(`invalid-field: search field is invalid.`),new e(`getResults():invalid-field`,`search field is invalid.`);E(f)&&(D.num=o),g&&(D.geometry=g);let n=u.text;if(!n?.trim()||(C({source:c,searchTerm:n,searchFields:t,exactMatch:r,query:D,type:`search`}),!b(D)))return[]}return f.queryFeatures(D,{signal:x}).then(async e=>{let{labelPointExecute:t}=await import(`../../../geometry/operators/labelPointOperator.js`);return K(e,d,c,l,y,h,p,t)})})}function g(t,n){let{source:r,spatialReference:i,view:a,suggestTerm:o,maxSuggestions:s,sourceIndex:c,exactMatch:l}=t,{layer:u}=r,d=n?.signal,f=_(r,a);return y(u).then(()=>{if(!E(u))return[];let t=O(r),n=r.searchFields||[t],a=[];r.suggestionTemplate?r.suggestionTemplate.replaceAll(p,(e,t)=>(a.push(t),e)):a.push(t);let h=v(a);!a.includes(u.objectIdField)&&!h&&a.push(u.objectIdField);let g=A(u,t),_=h||k(u,a),y=k(u,n);if(!g)throw m().error(`invalid-field: displayField is invalid.`),new e(`getSuggestions():invalid-field`,`displayField is invalid.`);if(!_)throw m().error(`invalid-field: outField is invalid.`),new e(`getSuggestions():invalid-field`,`outField is invalid.`);if(!y)throw m().error(`invalid-field: search field is invalid.`),new e(`getSuggestions():invalid-field`,`search field is invalid.`);let x=u.createQuery(),{orderByFields:S}=r;return S&&(x.orderByFields=S),x.outSpatialReference=i,x.returnGeometry=!1,x.num=s,x.outFields=a,f&&(x.geometry=f),!o.trim()||(C({source:r,searchTerm:o,searchFields:n,exactMatch:l,query:x,type:`suggest`}),!b(x))?[]:u.queryFeatures(x,{signal:d}).then(e=>U(e,r,c,t))})}function _(e,t){let{filter:n,withinViewEnabled:r}=e,i=t?.extent;return n?.geometry??(r&&i?i:void 0)}function v(e){return e&&e.includes(`*`)}async function y(t){if(!t)throw new e(`search:missing-layer`,`A layer is required for a layer search source.`);await t.load()}function b(e){return!!(e.fullText||e.where)}function x(e,t){let n=e?.indexes;return!n||!t?.length?!1:n.filter(e=>e.indexType===`FullText`).some(e=>{let n=e.fields?.split(`,`).map(e=>e.trim().toLowerCase())||[];return t.every(e=>n.includes(e.toLowerCase()))})}function S({text:e,searchFields:t,searchType:n=`prefix`}){return(n===`simple`?[e.trim()]:e.trim().split(` `)).filter(e=>!!e.trim()).map(e=>new d({onFields:t,searchTerm:e,searchType:n}))}function C({source:e,searchTerm:t,searchFields:n,exactMatch:r,query:i,type:a}){let{layer:o,filter:s,prefix:c=``,suffix:l=``,searchMode:u}=e,d=w(u,r,o,n);d.fullTextSearchType&&t&&(i.fullText=S({text:t,searchFields:n,searchType:d.fullTextSearchType})),i.where=L({searchTerm:N(`${c}${t}${l}`),layer:o,searchFields:n,filter:s,exactMatch:d.exactMatch,query:i,type:a})}function w(e,t,n,r){let i=T(n)&&x(n,r),a=e??(t?`simple`:`starts-with`);return a===`simple`?{exactMatch:!0,fullTextSearchType:null}:e===`starts-with`?{exactMatch:!1,fullTextSearchType:null}:a===`full-text-simple`?i?{exactMatch:!1,fullTextSearchType:`simple`}:{exactMatch:!0,fullTextSearchType:null}:i?{exactMatch:!1,fullTextSearchType:`prefix`}:{exactMatch:!1,fullTextSearchType:null}}function T(e){return e?.capabilities?.query?.supportsFullTextSearch??!1}function E(e){return e?.capabilities?.query?.supportsPagination??!1}function D(e){return e?.fieldsIndex?.fields?.find(e=>e.type===`string`)?.name??``}function O(e){return e.displayField||e.layer.displayField||D(e.layer)}function k(e,t){return!e||!t?.length?!1:t.every(t=>A(e,t))}function A(e,t){return!!e.getField(t)}function j(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!0;return!1}function M({codedValues:e},t,n){return r(e??[],e=>{let r=e.name,i=n?r:r.toLowerCase();return(n?t:t.toLowerCase())===i?e.code.toString():null})??null}function N(e){return e.replaceAll(`'`,`''`)}function P(e,t){let n=t?.where;return n?`(${e}) AND (${n})`:e}function F({currentTerm:e,field:t,filter:n,exactMatch:r,url:i,type:a}){let o=t?.type,s=t?.name;if(o===`string`||o===`date`||o===`global-id`){let t=f.test(i??``),o=t&&j(e)?`N`:``;return P(r&&a===`search`?`${s} = ${o}'${e}'`:t?`${s} LIKE ${o}'${e}%'`:`LOWER(${s}) LIKE ${o}'${e.toLowerCase()}%'`,n)}if(o===`oid`||o===`small-integer`||o===`integer`||o===`single`||o===`double`){let t=Number(e);return isNaN(t)?null:P(`${s} = ${t}`,n)}return P(`${s} = ${e}`,n)}function I(e,t){return e?` OR (${t})`:`(${t})`}function L({searchTerm:e,layer:t,searchFields:n,filter:r,exactMatch:i,query:a,type:o}){let{definitionExpression:s,url:c}=t,l=``;if(!a.fullText&&e&&n&&n.forEach(n=>{let a=t.getField(n),s=t.getFieldDomain?.(n),u=(s?.type===`coded-value`?M(s,e,i):null)||e||null;if(u!==null){let e=F({currentTerm:u,field:a,filter:r,exactMatch:i,url:c,type:o});e&&(l+=I(l,e))}}),a.fullText){let e=r?.where;return s&&e?`(${s}) AND (${e})`:s||e||``}return s&&l?`(${s}) AND (${l})`:l}function R(e,t){let n=null,{codedValues:r}=e;return r&&r.length&&r.some(e=>e.code===t&&(n=e.name,!0)),n}function z(e,t){return e[t]??e[Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase())]}function B(e){return!!e&&`getField`in e&&`queryFeatures`in e}function V(e,t,n){let r=u(e);if(!B(r))return``;let{attributes:i}=e,a=r.getFieldDomain?.(n,{feature:e});if(t)return c(t,i);if(n&&i){let e=r.getField(n),t=z(i,n);return t==null?``:a?.type===`coded-value`?R(a,t)??``:e?.type===`date`?l(new Date(t)):typeof t==`number`?t.toString():typeof t==`string`?t.trim():``}return``}function H(e,t,n,r){let i=u(e),{attributes:a}=e,o=B(i)&&i.objectIdField?a[i.objectIdField]:null;return{text:V(e,t.suggestionTemplate,r),key:o,sourceIndex:n}}function U(e,t,n,r){return e.features.map(e=>H(e,t,n,r))}function W(e){return e!=null&&e.minScale!=null&&e.maxScale!=null}function G(e,n,r,i,c,l,d,f){let p=e.clone(),m=u(e);p.layer=m,p.origin=e.origin;let h=B(m)?m.objectIdField:void 0,g=h?e.attributes[h]:null,_=V(e,r.searchTemplate,c);l!=null&&W(m)&&(m.minScale&&m.minScale<l?l=m.minScale:m.maxScale&&m.maxScale>l&&(l=m.maxScale));let v=o(p.geometry,n,l,f),y=typeof d==`number`&&v?s(t(v),n??void 0,d):v,b=e.clone();return b.layer=m,b.origin=e.origin,y!=null&&(b.geometry=a.fromExtent(y)),{extent:y,target:b,feature:p,key:g,name:_,sourceIndex:i}}function K(e,t,n,r,i,a,o,s){return e.features.map(e=>G(e,t,n,r,i,a,o,s))}export{S as createFullTextSearchInfos,h as getResults,g as getSuggestions,B as isSearchableLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{isSome as i,equals as a}from"../../core/arrayUtils.js";import{createTask as o}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import"../../core/has.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../core/maybe.js";import{after as f,throwIfAborted as p}from"../../core/promiseUtils.js";import{watch as m,syncAndInitial as h}from"../../core/reactiveUtils.js";import{createScreenPointArray as g,createRenderScreenPointArray as _}from"../../core/screenUtils.js";import{convertTime as v,offsetDateUTC as y}from"../../core/timeUtils.js";import{equals as b}from"../../geometry/support/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import{breadthFirstBinaryPartitioning as C}from"../support/traversalUtils.js";import w from"./DiscreteOptions.js";import T from"./DurationOptions.js";import{ShadowTooltipViewModel as E}from"./ShadowTooltipViewModel.js";import D from"./ThresholdOptions.js";const O=[],k=c(),A=[],j=v(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.view=null,this.tooltip=new E({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=v(10,`hours`,`milliseconds`),this.endTimeOfDay=v(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new D({suppressDeprecationWarning:!0}),this.durationOptions=new T({suppressDeprecationWarning:!0}),this.discreteOptions=new w({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,t||s(l.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}initialize(){this.addHandles([m(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},h),m(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=o(async e=>{await f(500,e),p(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),m(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),h),m(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),h),m(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),h),m(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),d(this.tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=y(e,-e.getTimezoneOffset(),`minutes`),e=y(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return y(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return y(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,255),i=r.length;A.length=0;let a=C(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let n=e.slice.plane,r=t,a=r.map(e=>e.layer).filter(i),o=r.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(g(e.x,e.y),_());return n.readAccumulatedShadow(i)*this._duration}};e([n()],M.prototype,`state`,null),e([n()],M.prototype,`view`,void 0),e([n()],M.prototype,`tooltip`,void 0),e([n({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([n({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([n({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([n({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([n({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([n({type:D,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([n({type:T,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([n({type:w,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([n()],M.prototype,`_running`,void 0),e([n()],M.prototype,`_stopPreviewingTask`,void 0),e([n()],M.prototype,`_updatedRecently`,void 0),e([n()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([n()],M.prototype,`_sceneUpdating`,null),e([n()],M.prototype,`_utcOffset`,void 0),e([n()],M.prototype,`_utcOffsetAuto`,null),e([n()],M.prototype,`_dateUTCOffset`,null),e([n()],M.prototype,`_startDateTimeUTC`,null),e([n()],M.prototype,`_endDateTimeUTC`,null),e([n()],M.prototype,`_referencePosition`,null),e([n()],M.prototype,`_interval`,null),e([n()],M.prototype,`_intervalContext`,null),e([n()],M.prototype,`_durationSampleCount`,null),e([n()],M.prototype,`_duration`,null),e([n()],M.prototype,`_lightDirections`,null),e([n()],M.prototype,`_lightDirectionsContext`,null),e([n()],M.prototype,`_tooltipEnabled`,null),e([n()],M.prototype,`_visualizationParameters`,null),e([n()],M.prototype,`_thresholdVisualizationParameters`,null),e([n()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([n()],M.prototype,`_durationVisualizationParameters`,null),e([n()],M.prototype,`_discreteVisualizationParameters`,null),e([n()],M.prototype,`_shadowLayerViews`,null),e([n()],M.prototype,`_previewDependencies`,null),e([n()],M.prototype,`renderer`,null),M=e([r(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),i=a(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=a(e.layerVisibilities,t.layerVisibilities),s=a(e.layerOpacities,t.layerOpacities),c=a(e.filters,t.filters),l=a(e.definitionExpressions,t.definitionExpressions);return n&&r&&i&&o&&s&&c&&l}const I=M;export{I as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{isSome as i,equals as a}from"../../core/arrayUtils.js";import{createTask as o}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as s}from"../../core/deprecate.js";import"../../core/has.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../core/Logger.js";import{abortMaybe as u,destroyMaybe as d}from"../../core/maybe.js";import{after as f,throwIfAborted as p}from"../../core/promiseUtils.js";import{watch as m,syncAndInitial as h}from"../../core/reactiveUtils.js";import{createScreenPointArray as g,createRenderScreenPointArray as _}from"../../core/screenUtils.js";import{convertTime as v,offsetDateUTC as y}from"../../core/timeUtils.js";import{equals as b}from"../../geometry/support/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import{breadthFirstBinaryPartitioning as C}from"../support/traversalUtils.js";import w from"./DiscreteOptions.js";import T from"./DurationOptions.js";import{ShadowTooltipViewModel as E}from"./ShadowTooltipViewModel.js";import D from"./ThresholdOptions.js";const O=[],k=c(),A=[],j=v(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.view=null,this.tooltip=new E({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=v(10,`hours`,`milliseconds`),this.endTimeOfDay=v(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new D({suppressDeprecationWarning:!0}),this.durationOptions=new T({suppressDeprecationWarning:!0}),this.discreteOptions=new w({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,t||s(l.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}initialize(){this.addHandles([m(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},h),m(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{u(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=o(async e=>{await f(500,e),p(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),m(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),h),m(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),h),m(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),h),m(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),d(this.tooltip),this._stopPreviewingTask=u(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=y(e,-e.getTimezoneOffset(),`minutes`),e=y(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return y(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return y(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.isGlobal,255),i=r.length;A.length=0;let a=C(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let n=e.slice.plane,r=t,a=r.map(e=>e.layer).filter(i),o=r.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=r.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:n,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(g(e.x,e.y),_());return n.readAccumulatedShadow(i)*this._duration}};e([n()],M.prototype,`state`,null),e([n()],M.prototype,`view`,void 0),e([n()],M.prototype,`tooltip`,void 0),e([n({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([n({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([n({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([n({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([n({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([n({type:D,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([n({type:T,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([n({type:w,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([n()],M.prototype,`_running`,void 0),e([n()],M.prototype,`_stopPreviewingTask`,void 0),e([n()],M.prototype,`_updatedRecently`,void 0),e([n()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([n()],M.prototype,`_sceneUpdating`,null),e([n()],M.prototype,`_utcOffset`,void 0),e([n()],M.prototype,`_utcOffsetAuto`,null),e([n()],M.prototype,`_dateUTCOffset`,null),e([n()],M.prototype,`_startDateTimeUTC`,null),e([n()],M.prototype,`_endDateTimeUTC`,null),e([n()],M.prototype,`_referencePosition`,null),e([n()],M.prototype,`_interval`,null),e([n()],M.prototype,`_intervalContext`,null),e([n()],M.prototype,`_durationSampleCount`,null),e([n()],M.prototype,`_duration`,null),e([n()],M.prototype,`_lightDirections`,null),e([n()],M.prototype,`_lightDirectionsContext`,null),e([n()],M.prototype,`_tooltipEnabled`,null),e([n()],M.prototype,`_visualizationParameters`,null),e([n()],M.prototype,`_thresholdVisualizationParameters`,null),e([n()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([n()],M.prototype,`_durationVisualizationParameters`,null),e([n()],M.prototype,`_discreteVisualizationParameters`,null),e([n()],M.prototype,`_shadowLayerViews`,null),e([n()],M.prototype,`_previewDependencies`,null),e([n()],M.prototype,`renderer`,null),M=e([r(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:case`group`:return!1;case`graphics-3d`:case`sketch-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),i=a(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=a(e.layerVisibilities,t.layerVisibilities),s=a(e.layerOpacities,t.layerOpacities),c=a(e.filters,t.filters),l=a(e.definitionExpressions,t.definitionExpressions);return n&&r&&i&&o&&s&&c&&l}const I=M;export{I as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import i from"../../core/Collection.js";import{deprecatedModule as a}from"../../core/deprecate.js";import o from"../../core/Error.js";import s from"../../core/Logger.js";import{watch as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import u from"../../Graphic.js";import{onLocaleChange as d,fetchMessageBundle as f}from"../../intl.js";import p from"../../layers/GraphicsLayer.js";import m from"../../symbols/LineSymbolMarker.js";import h from"../../symbols/SimpleLineSymbol.js";import{addUniqueLayer as g}from"../../views/draw/support/layerUtils.js";const _={noAssociationTypeSpecified:-0x7ffbcd38};a(s.getLogger(`esri.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationViewModel`),`UtilityNetworkAssociationViewModel`,{replacement:`UtilityNetwork.synthesizeAssociationGeometries`,version:`5.0`,see:`https://esriurl.com/UtilityNetworkClass#synthesizeAssociationGeometries`,warnOnce:!0});let v=class extends t{constructor(e){super(e),this._internalGraphicsLayerConnectivity=this._createInternalGraphicsLayer(`Connectivity Associations (Internal)`),this._internalGraphicsLayerStructuralAttachment=this._createInternalGraphicsLayer(`Structural Attachment Associations (Internal)`),this._initialValidationsFinished=!1,this._updatingHandles=new l,this.autoRefreshAssociations=!1,this.connectivityAssociationsLineSymbol=new h({style:`short-dash`,width:2,color:[190,159,159,1]}),this.executionError=``,this.loadErrors=new i,this.maxAllowableAssociations=250,this.showAssociationsEnabled=!1,this.showArrowsConnectivity=!1,this.showArrowsStructuralAttachment=!1,this.structuralAttachmentAssociationsLineSymbol=new h({style:`short-dash`,width:2,color:[159,190,159,1]})}initialize(){let e=async()=>{this.messages||=await f(`esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations`)};e().then(()=>{this.view||=null,this.utilityNetwork||=null,this.addHandles([c(()=>[this.view,this.utilityNetwork],async()=>{let{loadErrors:e,messages:{info:{noUtilityNetwork:t,noView:n}}}=this;this._initialValidationsFinished=!1,e.removeAll();let r=!1,i=!1;this.removeAssociations(),this.view?.type===`2d`?(g(this.view,this._internalGraphicsLayerConnectivity),g(this.view,this._internalGraphicsLayerStructuralAttachment),r=!0):(this.loadErrors.push(n),s.getLogger(this).error(new o(`utilityNetworkAssociations:missing-property`,n))),this.utilityNetwork?.type===`utility`?i=!0:(this.loadErrors.push(t),s.getLogger(this).error(new o(`utilityNetworkAssociations:missing-property`,t))),r&&i&&this.showAssociationsEnabled&&await this.showAssociations(),this._internalGraphicsLayerConnectivity.visible=this.includeConnectivityAssociations,this._internalGraphicsLayerStructuralAttachment.visible=this.includeStructuralAttachmentAssociations,this._initialValidationsFinished=!0},{initial:!0}),c(()=>[this.view?.stationary,this.showAssociationsEnabled,this.maxAllowableAssociations],async()=>{this.view?.stationary&&this.showAssociationsEnabled&&(this.includeConnectivityAssociations||this.includeStructuralAttachmentAssociations)&&await this.showAssociations()}),c(()=>[this.showArrowsConnectivity],()=>{let e=this.connectivityAssociationsLineSymbol.clone();e.marker=null,this.showArrowsConnectivity&&(e.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`}));for(let t of this._internalGraphicsLayerConnectivity.graphics)t.symbol=e}),c(()=>[this.showArrowsStructuralAttachment],()=>{let e=this.structuralAttachmentAssociationsLineSymbol.clone();e.marker=null,this.showArrowsStructuralAttachment&&(e.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`}));for(let t of this._internalGraphicsLayerStructuralAttachment.graphics)t.symbol=e}),c(()=>{let{cap:e,color:t,style:n,width:r,marker:i}=this.connectivityAssociationsLineSymbol;return[e,t,n,r,i]},()=>{let e=this.connectivityAssociationsLineSymbol.clone();for(let t of this._internalGraphicsLayerConnectivity.graphics)t.symbol=e;this.showArrowsConnectivity=!1,e.marker=null,this.connectivityAssociationsLineSymbol.marker&&(this.showArrowsConnectivity=!0,e.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`}))}),c(()=>{let{cap:e,color:t,style:n,width:r,marker:i}=this.structuralAttachmentAssociationsLineSymbol;return[e,t,n,r,i]},()=>{let e=this.structuralAttachmentAssociationsLineSymbol.clone();for(let t of this._internalGraphicsLayerStructuralAttachment.graphics)t.symbol=e;this.showArrowsStructuralAttachment=!1,e.marker=null,this.structuralAttachmentAssociationsLineSymbol.marker&&(this.showArrowsStructuralAttachment=!0,e.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`}))}),d(e)])})}destroy(){this._updatingHandles.destroy(),this.view=null,this._removeInternalGraphicsLayers()}set includeConnectivityAssociations(e){this._set(`includeConnectivityAssociations`,e),this._internalGraphicsLayerConnectivity.visible=e}set includeStructuralAttachmentAssociations(e){this._set(`includeStructuralAttachmentAssociations`,e),this._internalGraphicsLayerStructuralAttachment.visible=e}get state(){return this.loadErrors.length?`disabled`:this._updatingHandles.updating?`executing`:this.executionError===``?this._initialValidationsFinished?`ready`:`loading`:`warning`}get utilityNetwork(){return this._get(`utilityNetwork`)}set utilityNetwork(e){this._get(`utilityNetwork`)!==e&&this._set(`utilityNetwork`,e)}get view(){return this._get(`view`)}set view(e){this._get(`view`)!==e&&this._set(`view`,e)}removeAssociations(){this._internalGraphicsLayerConnectivity.removeAll(),this._internalGraphicsLayerStructuralAttachment.removeAll()}async showAssociations(){let{messages:{info:{maxAllowableAssociationsExceeded:e,noAssociationsFound:t,noAssociationTypeSpecified:n}},utilityNetwork:r}=this;this._set(`executionError`,``);let i={extent:this.view?.extent,gdbVersion:this.utilityNetwork?.gdbVersion,maxGeometryCount:this.maxAllowableAssociations,moment:this.utilityNetwork?.historicMoment,outSpatialReference:this.view?.spatialReference.clone(),returnConnectivityAssociations:this.includeConnectivityAssociations,returnAttachmentAssociations:this.includeStructuralAttachmentAssociations};this._updatingHandles.consumePromise(r?.synthesizeAssociationGeometries(i).then(n=>{let r=[],i=[];n?.maxGeometryCountExceeded?(this.removeAssociations(),this._set(`executionError`,e)):n?.associations.length===0?(this.removeAssociations(),this._set(`executionError`,t)):n&&(r=n?.associations.filter(({associationType:e})=>e.toLowerCase().includes(`connectivity`)).map(e=>(this.connectivityAssociationsLineSymbol.marker=null,this.showArrowsConnectivity&&(this.connectivityAssociationsLineSymbol.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`})),new u({geometry:e.geometry.clone(),symbol:this.connectivityAssociationsLineSymbol}))),i=n.associations.filter(({associationType:e})=>e===`attachment`).map(e=>(this.structuralAttachmentAssociationsLineSymbol.marker=null,this.showArrowsStructuralAttachment&&(this.structuralAttachmentAssociationsLineSymbol.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`})),new u({geometry:e.geometry.clone(),symbol:this.structuralAttachmentAssociationsLineSymbol}))),this._internalGraphicsLayerConnectivity.removeAll(),r.length>0&&this._internalGraphicsLayerConnectivity.addMany(r),this._internalGraphicsLayerStructuralAttachment.removeAll(),i.length>0&&this._internalGraphicsLayerStructuralAttachment.addMany(i))},e=>{let t=`Error: `+e;
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import i from"../../core/Collection.js";import{deprecatedModule as a}from"../../core/deprecate.js";import o from"../../core/Error.js";import s from"../../core/Logger.js";import{watch as c}from"../../core/reactiveUtils.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import u from"../../Graphic.js";import{onLocaleChange as d,fetchMessageBundle as f}from"../../intl.js";import p from"../../layers/GraphicsLayer.js";import m from"../../symbols/LineSymbolMarker.js";import h from"../../symbols/SimpleLineSymbol.js";import{addUniqueLayer as g}from"../../views/draw/support/layerUtils.js";const _={noAssociationTypeSpecified:-0x7ffbcd38};a(s.getLogger(`esri.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationViewModel`),`UtilityNetworkAssociationViewModel`,{replacement:`UtilityNetwork.synthesizeAssociationGeometries`,version:`5.0`,see:`https://esriurl.com/UtilityNetworkClass#synthesizeAssociationGeometries`,warnOnce:!0});let v=class extends t{constructor(e){super(e),this._internalGraphicsLayerConnectivity=this._createInternalGraphicsLayer(`Connectivity Associations (Internal)`),this._internalGraphicsLayerStructuralAttachment=this._createInternalGraphicsLayer(`Structural Attachment Associations (Internal)`),this._initialValidationsFinished=!1,this._updatingHandles=new l,this.autoRefreshAssociations=!1,this.connectivityAssociationsLineSymbol=new h({style:`short-dash`,width:2,color:[190,159,159,1]}),this.executionError=``,this.loadErrors=new i,this.maxAllowableAssociations=250,this.showAssociationsEnabled=!1,this.showArrowsConnectivity=!1,this.showArrowsStructuralAttachment=!1,this.structuralAttachmentAssociationsLineSymbol=new h({style:`short-dash`,width:2,color:[159,190,159,1]})}initialize(){let e=async()=>{this.messages||=await f(`esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations`)};e().then(()=>{this.view||=null,this.utilityNetwork||=null,this.addHandles([c(()=>[this.view,this.utilityNetwork],async()=>{let{loadErrors:e,messages:{info:{noUtilityNetwork:t,noView:n}}}=this;this._initialValidationsFinished=!1,e.removeAll();let r=!1,i=!1;this.removeAssociations(),this.view?.type===`2d`?(g(this.view,this._internalGraphicsLayerConnectivity),g(this.view,this._internalGraphicsLayerStructuralAttachment),r=!0):(this.loadErrors.push(n),s.getLogger(this).error(new o(`utilityNetworkAssociations:missing-property`,n))),this.utilityNetwork?.type===`utility`?i=!0:(this.loadErrors.push(t),s.getLogger(this).error(new o(`utilityNetworkAssociations:missing-property`,t))),r&&i&&this.showAssociationsEnabled&&await this.showAssociations(),this._internalGraphicsLayerConnectivity.visible=this.includeConnectivityAssociations,this._internalGraphicsLayerStructuralAttachment.visible=this.includeStructuralAttachmentAssociations,this._initialValidationsFinished=!0},{initial:!0}),c(()=>[this.view?.stationary,this.showAssociationsEnabled,this.maxAllowableAssociations],async()=>{this.view?.stationary&&this.showAssociationsEnabled&&(this.includeConnectivityAssociations||this.includeStructuralAttachmentAssociations)&&await this.showAssociations()}),c(()=>[this.showArrowsConnectivity],()=>{let e=this.connectivityAssociationsLineSymbol.clone();e.marker=null,this.showArrowsConnectivity&&(e.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`}));for(let t of this._internalGraphicsLayerConnectivity.graphics)t.symbol=e}),c(()=>[this.showArrowsStructuralAttachment],()=>{let e=this.structuralAttachmentAssociationsLineSymbol.clone();e.marker=null,this.showArrowsStructuralAttachment&&(e.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`}));for(let t of this._internalGraphicsLayerStructuralAttachment.graphics)t.symbol=e}),c(()=>{let{cap:e,color:t,style:n,width:r,marker:i}=this.connectivityAssociationsLineSymbol;return[e,t,n,r,i]},()=>{let e=this.connectivityAssociationsLineSymbol.clone();for(let t of this._internalGraphicsLayerConnectivity.graphics)t.symbol=e;this.showArrowsConnectivity=!1,e.marker=null,this.connectivityAssociationsLineSymbol.marker&&(this.showArrowsConnectivity=!0,e.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`}))}),c(()=>{let{cap:e,color:t,style:n,width:r,marker:i}=this.structuralAttachmentAssociationsLineSymbol;return[e,t,n,r,i]},()=>{let e=this.structuralAttachmentAssociationsLineSymbol.clone();for(let t of this._internalGraphicsLayerStructuralAttachment.graphics)t.symbol=e;this.showArrowsStructuralAttachment=!1,e.marker=null,this.structuralAttachmentAssociationsLineSymbol.marker&&(this.showArrowsStructuralAttachment=!0,e.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`}))}),d(e)])})}destroy(){this._updatingHandles.destroy(),this.view=null,this._removeInternalGraphicsLayers()}set includeConnectivityAssociations(e){this._set(`includeConnectivityAssociations`,e),this._internalGraphicsLayerConnectivity.visible=e}set includeStructuralAttachmentAssociations(e){this._set(`includeStructuralAttachmentAssociations`,e),this._internalGraphicsLayerStructuralAttachment.visible=e}get state(){return this.loadErrors.length?`disabled`:this._updatingHandles.updating?`executing`:this.executionError===``?this._initialValidationsFinished?`ready`:`loading`:`warning`}get utilityNetwork(){return this._get(`utilityNetwork`)}set utilityNetwork(e){this._get(`utilityNetwork`)!==e&&this._set(`utilityNetwork`,e)}get view(){return this._get(`view`)}set view(e){this._get(`view`)!==e&&this._set(`view`,e)}removeAssociations(){this._internalGraphicsLayerConnectivity.removeAll(),this._internalGraphicsLayerStructuralAttachment.removeAll()}async showAssociations(){let{messages:{info:{maxAllowableAssociationsExceeded:e,noAssociationsFound:t,noAssociationTypeSpecified:n}},utilityNetwork:r}=this;this._set(`executionError`,``);let i={extent:this.view?.extent,gdbVersion:this.utilityNetwork?.gdbVersion,maxGeometryCount:this.maxAllowableAssociations,moment:this.utilityNetwork?.historicMoment,outSpatialReference:this.view?.spatialReference.clone(),returnConnectivityAssociations:this.includeConnectivityAssociations,returnAttachmentAssociations:this.includeStructuralAttachmentAssociations};this._updatingHandles.consumePromise(r?.synthesizeAssociationGeometries(i).then(n=>{let r=[],i=[];n?.maxGeometryCountExceeded?(this.removeAssociations(),this._set(`executionError`,e)):n?.associations.length===0?(this.removeAssociations(),this._set(`executionError`,t)):n&&(r=n?.associations.filter(({associationType:e})=>e.toLowerCase().includes(`connectivity`)).map(e=>(this.connectivityAssociationsLineSymbol.marker=null,this.showArrowsConnectivity&&(this.connectivityAssociationsLineSymbol.marker=new m({color:this.connectivityAssociationsLineSymbol.color,placement:`end`,style:`arrow`})),new u({geometry:e.geometry.clone(),symbol:this.connectivityAssociationsLineSymbol}))),i=n.associations.filter(({associationType:e})=>e===`attachment`).map(e=>(this.structuralAttachmentAssociationsLineSymbol.marker=null,this.showArrowsStructuralAttachment&&(this.structuralAttachmentAssociationsLineSymbol.marker=new m({color:this.structuralAttachmentAssociationsLineSymbol.color,placement:`end`,style:`arrow`})),new u({geometry:e.geometry.clone(),symbol:this.structuralAttachmentAssociationsLineSymbol}))),this._internalGraphicsLayerConnectivity.removeAll(),r.length>0&&this._internalGraphicsLayerConnectivity.addMany(r),this._internalGraphicsLayerStructuralAttachment.removeAll(),i.length>0&&this._internalGraphicsLayerStructuralAttachment.addMany(i))},e=>{let t=`Error: `+e;e instanceof o&&e.details?.raw&&(t=e.details.raw.extendedCode===_.noAssociationTypeSpecified?n:e.details.message),this._set(`executionError`,t)}))}_createInternalGraphicsLayer(e){return new p({listMode:`hide`,internal:!0,title:e})}_removeInternalGraphicsLayers(){this._internalGraphicsLayerConnectivity&&this._internalGraphicsLayerStructuralAttachment&&this.view?.map&&(this.view.map.remove(this._internalGraphicsLayerConnectivity),this.view.map.remove(this._internalGraphicsLayerStructuralAttachment))}};e([n()],v.prototype,`_initialValidationsFinished`,void 0),e([n()],v.prototype,`autoRefreshAssociations`,void 0),e([n({type:h,nonNullable:!0})],v.prototype,`connectivityAssociationsLineSymbol`,void 0),e([n({readOnly:!0})],v.prototype,`executionError`,void 0),e([n({type:Boolean,value:!0})],v.prototype,`includeConnectivityAssociations`,null),e([n({type:Boolean,value:!0})],v.prototype,`includeStructuralAttachmentAssociations`,null),e([n()],v.prototype,`loadErrors`,void 0),e([n()],v.prototype,`maxAllowableAssociations`,void 0),e([n()],v.prototype,`messages`,void 0),e([n()],v.prototype,`showAssociationsEnabled`,void 0),e([n()],v.prototype,`showArrowsConnectivity`,void 0),e([n()],v.prototype,`showArrowsStructuralAttachment`,void 0),e([n({readOnly:!0})],v.prototype,`state`,null),e([n({type:h,nonNullable:!0})],v.prototype,`structuralAttachmentAssociationsLineSymbol`,void 0),e([n()],v.prototype,`utilityNetwork`,null),e([n()],v.prototype,`view`,null),v=e([r(`esri.widgets.UtilityNetworkAssociations.UtilityNetworkAssociationsViewModel`)],v);const y=v;export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o,on as s}from"../core/reactiveUtils.js";import c from"../symbols/SimpleLineSymbol.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{messageBundle as u,tsx as d}from"./support/widget.js";import f from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import p from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";import h from"./Widget.js";const g=`esri-un-associations`,_={action:`${g}__action`,blockContent:`${g}__block-content`,blockSectionSettings:`${g}__block-section-settings`,combobox:`${g}__combobox`,comboboxItem:`${g}__combobox-item`,divControlsMain:`${g}__div-controls-main`,label:`${g}__label`,labelAndCombobox:`${g}__label-and-combobox`,labelAndSlider:`${g}__label-and-slider`,labelAndToggle:`${g}__label-and-toggle`,panel:`${g}__panel`,slider:`${g}__slider`,statusIconWarning:`${g}__status-icon-warning`,switch:`${g}__switch`,widgetContainer:`${g}__widget-container`};let v=class extends h{constructor(e){super(e),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new p,this.visibleElements=new m,this.announceDeprecation=()=>{r(i.getLogger(this),`Utility Network Associations`,`arcgis-utility-network-associations`,{version:`5.0`})}}initialize(){this.addHandles([a(()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations],()=>{this.autoRefreshAssociations===!0&&(this.showAssociationsEnabled===!0?this.viewModel.showAssociations():this.viewModel.removeAssociations())}),a(()=>this.view?.map?.utilityNetworks,e=>{e?.items.forEach(async(e,t)=>{e.loaded||await e.load(),t===0&&(this.utilityNetwork=e)})},o),s(()=>this.view?.map?.utilityNetworks,`change`,e=>{let t=e.target;e.added.forEach(async e=>{e.loaded||await e.load()}),e.removed.some(e=>e.layerUrl===this.utilityNetwork?.layerUrl)&&(this.utilityNetwork=null),this.utilityNetwork=t.length?t.getItemAt(0):null})])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(e){this._autoRefreshAssociations=e}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(e){this.viewModel.connectivityAssociationsLineSymbol=e}get icon(){return`view-associations`}set icon(e){this._overrideIfSome(`icon`,e)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(e){this.viewModel.includeConnectivityAssociations=e}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(e){this.viewModel.includeStructuralAttachmentAssociations=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(e){this.viewModel.maxAllowableAssociations=e}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(e){e<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=e)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(e){e<0||e>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=e)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(e){this._maxAllowableAssociationsSliderStep=e}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(e){this.viewModel.showArrowsConnectivity=e}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(e){this.viewModel.showArrowsStructuralAttachment=e}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(e){this.viewModel.showAssociationsEnabled=e}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(e){this.viewModel.structuralAttachmentAssociationsLineSymbol=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){let{label:e}=this;return d(`div`,{class:_.widgetContainer},d(`calcite-block`,{class:_.blockContent,expandable:!0,heading:e},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()),this._renderWarningIconTooltip(),this._renderStatusIconTooltip(),this._renderShowAssociationsTooltip(),this._renderRefreshAssociationsActionTooltip())}loadDependencies(){return l({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),"block-section":()=>import(`@esri/calcite-components/dist/components/calcite-block-section`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),slider:()=>import(`@esri/calcite-components/dist/components/calcite-slider`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}_connectivityAssociationsSwitchChange(e){this.includeConnectivityAssociations=e.currentTarget.checked}_getLoadErrorMessagesAsNotices(e,t){return d(`calcite-notice`,{closable:!1,key:`error-notice-${t}`,kind:`warning`,open:!0,scale:`s`},d(`div`,{slot:`message`},e))}_maxAllowableAssociationsSliderChange(e){this.maxAllowableAssociations=Number(e.currentTarget.value)}_refreshAssociations(){let{viewModel:e,viewModel:{state:t}}=this;(t===`ready`||t===`warning`)&&e.showAssociations()}_renderConnectivityAssociationsSettings(){let{messages:{input:{enableConnectivity:e}},visibleElements:{connectivityAssociationsSettings:t}}=this;if(t)return d(`calcite-block-section`,{class:_.blockSectionSettings,text:e},d(f,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:t}))}_renderConnectivityAssociationsToggle(){let{messages:{input:{enableConnectivity:e}}}=this;return d(`div`,{class:_.labelAndToggle,key:`connectivityAssociationsToggleDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-switch`,{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:e,value:t,selected:n}){return d(`calcite-combobox-item`,{class:_.comboboxItem,heading:e,selected:n,value:t})}_renderContent(){let{viewModel:{loadErrors:e,state:t}}=this;return t===`disabled`?d(`div`,{class:_.divControlsMain,key:`loadErrorsDiv`},e.items.map(this._getLoadErrorMessagesAsNotices)):d(`calcite-panel`,{class:_.panel,disabled:t===`loading`},d(`div`,{class:_.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingIcon(){let{messagesCommon:{executing:e,loading:t},viewModel:{state:n}}=this,r=`${this.id}-status-action`;return d(`calcite-action`,{class:_.statusIconWarning,icon:`spinner`,id:r,loading:!0,scale:`s`,slot:`actions-end`,text:n===`executing`?e:t})}_renderMaxAllowableAssociationsSlider(){let{messages:{input:{maxAllowableAssociations:e}},visibleElements:{maxAllowableAssociationsSlider:t}}=this;if(t)return d(`div`,{class:_.labelAndSlider,key:`maxAllowableAssociationsSliderDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-slider`,{bind:this,class:_.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:`s`,snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){let{messages:{input:{refreshAssociations:e}},viewModel:{state:t}}=this,n=`${this.id}-refresh-action`;return d(`calcite-action`,{bind:this,class:_.action,disabled:t===`disabled`,icon:`refresh-f`,id:n,loading:t===`loading`,slot:`actions-end`,text:e,onclick:this._refreshAssociations})}_renderRefreshAssociationsActionTooltip(){let{messages:{input:{refreshAssociations:e}}}=this,t=`${this.id}-refresh-action`;return d(`calcite-tooltip`,{overlayPositioning:`fixed`,referenceElement:t,topLayerDisabled:this.topLayerDisabled},e)}_renderSettingsPane(){let{messagesCommon:{settings:e},visibleElements:{maxAllowableAssociationsSlider:t,connectivityAssociationsSettings:n,structuralAttachmentAssociationsSettings:r}}=this;if((this.view?.map).utilityNetworks?.items?.length!==1||t||n||r)return d(`calcite-block`,{class:_.blockContent,expandable:!0,heading:e},d(`div`,{class:_.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){let{viewModel:{state:e}}=this,t=`${this.id}-show-associations-switch`;return d(`calcite-switch`,{bind:this,checked:this.showAssociationsEnabled,class:_.switch,disabled:e===`disabled`,id:t,slot:`actions-end`,onCalciteSwitchChange:this._showAssociationsSwitchChange})}_renderShowAssociationsTooltip(){let{messages:{input:{enableAssociations:e}}}=this,t=`${this.id}-show-associations-switch`;return d(`calcite-tooltip`,{referenceElement:t,topLayerDisabled:this.topLayerDisabled},e)}_renderStatusIcon(){let{viewModel:{state:e}}=this;switch(e){case`disabled`:case`warning`:return this._renderWarningIcon();case`loading`:case`executing`:return this._renderLoadingIcon();default:return}}_renderStatusIconTooltip(){let{messagesCommon:{executing:e,loading:t},viewModel:{state:n}}=this,r=`${this.id}-status-action`;return d(`calcite-tooltip`,{overlayPositioning:`fixed`,referenceElement:r,topLayerDisabled:this.topLayerDisabled},n===`executing`?e:t)}_renderStructuralAttachmentAssociationsSettings(){let{messages:{input:{enableStructuralAttachment:e}},visibleElements:{structuralAttachmentAssociationsSettings:t}}=this;if(t)return d(`calcite-block-section`,{class:_.blockSectionSettings,text:e},d(f,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:t}))}_renderStructuralAttachmentAssociationsToggle(){let{messages:{input:{enableStructuralAttachment:e}}}=this;return d(`div`,{class:_.labelAndToggle,key:`structuralAttachmentAssociationsToggleDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-switch`,{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){let{messages:{input:{utilityNetwork:e}}}=this,t=(this.view?.map).utilityNetworks?.items;if(t?.length===1)return null;let n=t?.map(e=>{let t=e.title,n=e.layerUrl,r=e.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:t,value:n,selected:r})});return d(`div`,{class:_.labelAndCombobox,key:`utilityNetworkComboboxDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-combobox`,{class:_.combobox,clearDisabled:!0,label:``,maxItems:3,overlayPositioning:`fixed`,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:e=>{let n=t?.find(t=>t.layerUrl===e.currentTarget.value);this.utilityNetwork=n}},n))}_showAssociationsSwitchChange({currentTarget:e}){let{viewModel:t}=this;this.showAssociationsEnabled=e.checked,this._associationsOptionsEnabled=e.checked,this.showAssociationsEnabled||t.removeAssociations()}_structuralAttAssociationsSwitchChange(e){this.includeStructuralAttachmentAssociations=e.currentTarget.checked}_renderWarningIcon(){let e=`${this.id}-warning-action`;return d(`calcite-icon`,{class:_.statusIconWarning,icon:`exclamation-mark-triangle`,id:e,scale:`s`,slot:`actions-end`})}_renderWarningIconTooltip(){let{viewModel:{executionError:e,state:t}}=this,n=`${this.id}-warning-action`;switch(t){case`warning`:return d(`calcite-tooltip`,{referenceElement:n,topLayerDisabled:this.topLayerDisabled},e);default:return}}};e([t()],v.prototype,`autoRefreshAssociations`,null),e([t({type:c})],v.prototype,`connectivityAssociationsLineSymbol`,null),e([t()],v.prototype,`icon`,null),e([t()],v.prototype,`includeConnectivityAssociations`,null),e([t()],v.prototype,`includeStructuralAttachmentAssociations`,null),e([t()],v.prototype,`label`,null),e([t()],v.prototype,`maxAllowableAssociations`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderMax`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderMin`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderStep`,null),e([t(),u(`esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations`)],v.prototype,`messages`,void 0),e([t(),u(`esri/t9n/common`)],v.prototype,`messagesCommon`,void 0),e([t()],v.prototype,`showArrowsConnectivity`,null),e([t()],v.prototype,`showArrowsStructuralAttachment`,null),e([t()],v.prototype,`showAssociationsEnabled`,null),e([t({type:c})],v.prototype,`structuralAttachmentAssociationsLineSymbol`,null),e([t()],v.prototype,`utilityNetwork`,null),e([t()],v.prototype,`view`,null),e([t({type:p})],v.prototype,`viewModel`,void 0),e([t({type:m,nonNullable:!0})],v.prototype,`visibleElements`,void 0),v=e([n(`esri.widgets.UtilityNetworkAssociations`)],v);const y=v;export{y as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o,on as s}from"../core/reactiveUtils.js";import c from"../symbols/SimpleLineSymbol.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{messageBundle as u,tsx as d}from"./support/widget.js";import f from"./UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js";import p from"./UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import m from"./UtilityNetworkAssociations/VisibleElements.js";import h from"./Widget.js";const g=`esri-un-associations`,_={action:`${g}__action`,blockContent:`${g}__block-content`,blockSectionSettings:`${g}__block-section-settings`,combobox:`${g}__combobox`,comboboxItem:`${g}__combobox-item`,divControlsMain:`${g}__div-controls-main`,label:`${g}__label`,labelAndCombobox:`${g}__label-and-combobox`,labelAndSlider:`${g}__label-and-slider`,labelAndToggle:`${g}__label-and-toggle`,panel:`${g}__panel`,slider:`${g}__slider`,statusIconWarning:`${g}__status-icon-warning`,switch:`${g}__switch`,widgetContainer:`${g}__widget-container`};let v=class extends h{constructor(e){super(e),this._autoRefreshAssociations=!0,this._associationsOptionsEnabled=!1,this._maxAllowableAssociationsSliderMax=1e3,this._maxAllowableAssociationsSliderMin=250,this._maxAllowableAssociationsSliderStep=250,this.messages=null,this.messagesCommon=null,this.viewModel=new p,this.visibleElements=new m,this.announceDeprecation=()=>{r(i.getLogger(this),`Utility Network Associations`,`arcgis-utility-network-associations`,{version:`5.0`})}}initialize(){this.addHandles([a(()=>[this.view?.stationary,this.showAssociationsEnabled,this.includeConnectivityAssociations,this.includeStructuralAttachmentAssociations,this.maxAllowableAssociations],()=>{this.autoRefreshAssociations===!0&&(this.showAssociationsEnabled===!0?this.viewModel.showAssociations():this.viewModel.removeAssociations())}),a(()=>this.view?.map?.utilityNetworks,e=>{e?.items.forEach(async(e,t)=>{e.loaded||await e.load(),t===0&&(this.utilityNetwork=e)})},o),s(()=>this.view?.map?.utilityNetworks,`change`,e=>{let t=e.target;e.added.forEach(async e=>{e.loaded||await e.load()}),e.removed.some(e=>e.layerUrl===this.utilityNetwork?.layerUrl)&&(this.utilityNetwork=null),this.utilityNetwork=t.length?t.getItemAt(0):null})])}get autoRefreshAssociations(){return this._autoRefreshAssociations}set autoRefreshAssociations(e){this._autoRefreshAssociations=e}get connectivityAssociationsLineSymbol(){return this.viewModel.connectivityAssociationsLineSymbol}set connectivityAssociationsLineSymbol(e){this.viewModel.connectivityAssociationsLineSymbol=e}get icon(){return`view-associations`}set icon(e){this._overrideIfSome(`icon`,e)}get includeConnectivityAssociations(){return this.viewModel.includeConnectivityAssociations}set includeConnectivityAssociations(e){this.viewModel.includeConnectivityAssociations=e}get includeStructuralAttachmentAssociations(){return this.viewModel.includeStructuralAttachmentAssociations}set includeStructuralAttachmentAssociations(e){this.viewModel.includeStructuralAttachmentAssociations=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get maxAllowableAssociations(){return this.viewModel.maxAllowableAssociations}set maxAllowableAssociations(e){this.viewModel.maxAllowableAssociations=e}get maxAllowableAssociationsSliderMax(){return this._maxAllowableAssociationsSliderMax}set maxAllowableAssociationsSliderMax(e){e<=this.maxAllowableAssociationsSliderMin||(this._maxAllowableAssociationsSliderMax=e)}get maxAllowableAssociationsSliderMin(){return this._maxAllowableAssociationsSliderMin}set maxAllowableAssociationsSliderMin(e){e<0||e>=this.maxAllowableAssociationsSliderMax||(this._maxAllowableAssociationsSliderMin=e)}get maxAllowableAssociationsSliderStep(){return this._maxAllowableAssociationsSliderStep}set maxAllowableAssociationsSliderStep(e){this._maxAllowableAssociationsSliderStep=e}get showArrowsConnectivity(){return this.viewModel.showArrowsConnectivity}set showArrowsConnectivity(e){this.viewModel.showArrowsConnectivity=e}get showArrowsStructuralAttachment(){return this.viewModel.showArrowsStructuralAttachment}set showArrowsStructuralAttachment(e){this.viewModel.showArrowsStructuralAttachment=e}get showAssociationsEnabled(){return this.viewModel.showAssociationsEnabled}set showAssociationsEnabled(e){this.viewModel.showAssociationsEnabled=e}get structuralAttachmentAssociationsLineSymbol(){return this.viewModel.structuralAttachmentAssociationsLineSymbol}set structuralAttachmentAssociationsLineSymbol(e){this.viewModel.structuralAttachmentAssociationsLineSymbol=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){let{label:e}=this;return d(`div`,{class:_.widgetContainer},d(`calcite-block`,{class:_.blockContent,expandable:!0,heading:e},this._renderStatusIcon(),this.autoRefreshAssociations?this._renderShowAssociationsSwitch():this._renderRefreshAssociationsAction(),this._renderContent()),this._renderWarningIconTooltip(),this._renderStatusIconTooltip(),this._renderShowAssociationsTooltip(),this._renderRefreshAssociationsActionTooltip())}loadDependencies(){return l({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),"block-section":()=>import(`@esri/calcite-components/dist/components/calcite-block-section`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),slider:()=>import(`@esri/calcite-components/dist/components/calcite-slider`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}_connectivityAssociationsSwitchChange(e){this.includeConnectivityAssociations=e.currentTarget.checked}_getLoadErrorMessagesAsNotices(e,t){return d(`calcite-notice`,{closable:!1,key:`error-notice-${t}`,kind:`warning`,open:!0,scale:`s`},d(`div`,{slot:`message`},e))}_maxAllowableAssociationsSliderChange(e){this.maxAllowableAssociations=Number(e.currentTarget.value)}_refreshAssociations(){let{viewModel:e,viewModel:{state:t}}=this;(t===`ready`||t===`warning`)&&e.showAssociations()}_renderConnectivityAssociationsSettings(){let{messages:{input:{enableConnectivity:e}},visibleElements:{connectivityAssociationsSettings:t}}=this;if(t)return d(`calcite-block-section`,{class:_.blockSectionSettings,text:e},d(f,{id:`${this.id}-symbol-picker-connectivity`,lineSymbol:this.connectivityAssociationsLineSymbol,showArrows:this.showArrowsConnectivity,visibleElements:t}))}_renderConnectivityAssociationsToggle(){let{messages:{input:{enableConnectivity:e}}}=this;return d(`div`,{class:_.labelAndToggle,key:`connectivityAssociationsToggleDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-switch`,{bind:this,checked:this.includeConnectivityAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._connectivityAssociationsSwitchChange}))}_renderComboboxItem({heading:e,value:t,selected:n}){return d(`calcite-combobox-item`,{class:_.comboboxItem,heading:e,selected:n,value:t})}_renderContent(){let{viewModel:{loadErrors:e,state:t}}=this;return t===`disabled`?d(`div`,{class:_.divControlsMain,key:`loadErrorsDiv`},e.items.map(this._getLoadErrorMessagesAsNotices)):d(`calcite-panel`,{class:_.panel,disabled:t===`loading`},d(`div`,{class:_.divControlsMain},this._renderConnectivityAssociationsToggle(),this._renderStructuralAttachmentAssociationsToggle(),this._renderSettingsPane()))}_renderLoadingIcon(){let{messagesCommon:{executing:e,loading:t},viewModel:{state:n}}=this,r=`${this.id}-status-action`;return d(`calcite-action`,{class:_.statusIconWarning,icon:`spinner`,id:r,loading:!0,scale:`s`,slot:`actions-end`,text:n===`executing`?e:t})}_renderMaxAllowableAssociationsSlider(){let{messages:{input:{maxAllowableAssociations:e}},visibleElements:{maxAllowableAssociationsSlider:t}}=this;if(t)return d(`div`,{class:_.labelAndSlider,key:`maxAllowableAssociationsSliderDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-slider`,{bind:this,class:_.slider,labelTicks:!0,max:this.maxAllowableAssociationsSliderMax,min:this.maxAllowableAssociationsSliderMin,scale:`s`,snap:!0,step:this.maxAllowableAssociationsSliderStep,ticks:this.maxAllowableAssociationsSliderStep,value:this.maxAllowableAssociations,onCalciteSliderChange:this._maxAllowableAssociationsSliderChange}))}_renderRefreshAssociationsAction(){let{messages:{input:{refreshAssociations:e}},viewModel:{state:t}}=this,n=`${this.id}-refresh-action`;return d(`calcite-action`,{bind:this,class:_.action,disabled:t===`disabled`,icon:`refresh-f`,id:n,loading:t===`loading`,slot:`actions-end`,text:e,onclick:this._refreshAssociations})}_renderRefreshAssociationsActionTooltip(){let{messages:{input:{refreshAssociations:e}}}=this,t=`${this.id}-refresh-action`;return d(`calcite-tooltip`,{overlayPositioning:`fixed`,referenceElement:t,topLayerDisabled:this.topLayerDisabled},e)}_renderSettingsPane(){let{messagesCommon:{settings:e},visibleElements:{maxAllowableAssociationsSlider:t,connectivityAssociationsSettings:n,structuralAttachmentAssociationsSettings:r}}=this;if((this.view?.map).utilityNetworks?.items?.length!==1||t||n||r)return d(`calcite-block`,{class:_.blockContent,expandable:!0,heading:e},d(`div`,{class:_.divControlsMain},this._renderUtilityNetworkSettings(),this._renderMaxAllowableAssociationsSlider()),this._renderConnectivityAssociationsSettings(),this._renderStructuralAttachmentAssociationsSettings())}_renderShowAssociationsSwitch(){let{viewModel:{state:e}}=this,t=`${this.id}-show-associations-switch`;return d(`calcite-switch`,{bind:this,checked:this.showAssociationsEnabled,class:_.switch,disabled:e===`disabled`,id:t,slot:`actions-end`,onCalciteSwitchChange:this._showAssociationsSwitchChange})}_renderShowAssociationsTooltip(){let{messages:{input:{enableAssociations:e}}}=this,t=`${this.id}-show-associations-switch`;return d(`calcite-tooltip`,{referenceElement:t,topLayerDisabled:this.topLayerDisabled},e)}_renderStatusIcon(){let{viewModel:{state:e}}=this;switch(e){case`disabled`:case`warning`:return this._renderWarningIcon();case`loading`:case`executing`:return this._renderLoadingIcon();default:return}}_renderStatusIconTooltip(){let{messagesCommon:{executing:e,loading:t},viewModel:{state:n}}=this,r=`${this.id}-status-action`;return d(`calcite-tooltip`,{overlayPositioning:`fixed`,referenceElement:r,topLayerDisabled:this.topLayerDisabled},n===`executing`?e:t)}_renderStructuralAttachmentAssociationsSettings(){let{messages:{input:{enableStructuralAttachment:e}},visibleElements:{structuralAttachmentAssociationsSettings:t}}=this;if(t)return d(`calcite-block-section`,{class:_.blockSectionSettings,text:e},d(f,{id:`${this.id}-symbol-picker-structural-attachment`,lineSymbol:this.structuralAttachmentAssociationsLineSymbol,showArrows:this.showArrowsStructuralAttachment,visibleElements:t}))}_renderStructuralAttachmentAssociationsToggle(){let{messages:{input:{enableStructuralAttachment:e}}}=this;return d(`div`,{class:_.labelAndToggle,key:`structuralAttachmentAssociationsToggleDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-switch`,{bind:this,checked:this.includeStructuralAttachmentAssociations,disabled:!this._associationsOptionsEnabled&&this.autoRefreshAssociations,onCalciteSwitchChange:this._structuralAttAssociationsSwitchChange}))}_renderUtilityNetworkSettings(){let{messages:{input:{utilityNetwork:e}}}=this,t=(this.view?.map).utilityNetworks?.items;if(t?.length===1)return null;let n=t?.map(e=>{let t=e.title,n=e.layerUrl,r=e.layerUrl===this.utilityNetwork?.layerUrl;return this._renderComboboxItem({heading:t,value:n,selected:r})});return d(`div`,{class:_.labelAndCombobox,key:`utilityNetworkComboboxDiv`},d(`calcite-label`,{class:_.label},e),d(`calcite-combobox`,{class:_.combobox,clearDisabled:!0,label:``,maxItems:3,overlayPositioning:`fixed`,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:e=>{let n=t?.find(t=>t.layerUrl===e.currentTarget.value);this.utilityNetwork=n}},n))}_showAssociationsSwitchChange({currentTarget:e}){let{viewModel:t}=this;this.showAssociationsEnabled=e.checked,this._associationsOptionsEnabled=e.checked,this.showAssociationsEnabled||t.removeAssociations()}_structuralAttAssociationsSwitchChange(e){this.includeStructuralAttachmentAssociations=e.currentTarget.checked}_renderWarningIcon(){let e=`${this.id}-warning-action`;return d(`calcite-icon`,{class:_.statusIconWarning,icon:`exclamation-mark-triangle`,id:e,scale:`s`,slot:`actions-end`})}_renderWarningIconTooltip(){let{viewModel:{executionError:e,state:t}}=this,n=`${this.id}-warning-action`;if(t===`warning`)return d(`calcite-tooltip`,{referenceElement:n,topLayerDisabled:this.topLayerDisabled},e)}};e([t()],v.prototype,`autoRefreshAssociations`,null),e([t({type:c})],v.prototype,`connectivityAssociationsLineSymbol`,null),e([t()],v.prototype,`icon`,null),e([t()],v.prototype,`includeConnectivityAssociations`,null),e([t()],v.prototype,`includeStructuralAttachmentAssociations`,null),e([t()],v.prototype,`label`,null),e([t()],v.prototype,`maxAllowableAssociations`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderMax`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderMin`,null),e([t()],v.prototype,`maxAllowableAssociationsSliderStep`,null),e([t(),u(`esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations`)],v.prototype,`messages`,void 0),e([t(),u(`esri/t9n/common`)],v.prototype,`messagesCommon`,void 0),e([t()],v.prototype,`showArrowsConnectivity`,null),e([t()],v.prototype,`showArrowsStructuralAttachment`,null),e([t()],v.prototype,`showAssociationsEnabled`,null),e([t({type:c})],v.prototype,`structuralAttachmentAssociationsLineSymbol`,null),e([t()],v.prototype,`utilityNetwork`,null),e([t()],v.prototype,`view`,null),e([t({type:p})],v.prototype,`viewModel`,void 0),e([t({type:m,nonNullable:!0})],v.prototype,`visibleElements`,void 0),v=e([n(`esri.widgets.UtilityNetworkAssociations`)],v);const y=v;export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{watch as o,syncAndInitial as s}from"../../core/reactiveUtils.js";import c from"../../views/3d/environment/CloudyWeather.js";import l from"../../views/3d/environment/FoggyWeather.js";import u from"../../views/3d/environment/RainyWeather.js";import d from"../../views/3d/environment/SnowyWeather.js";import f from"../../views/3d/environment/SunnyWeather.js";import{validateWeatherType as p}from"../../views/3d/environment/weather.js";let m=class extends t{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.view=null,this._weatherByType={sunny:new f,cloudy:new c,rainy:new u,snowy:new d,foggy:new l},this._settingWeather=!1,t||i(a.getLogger(this),`Weather`,`arcgis-weather`,{version:`4.33`})}initialize(){this.addHandles([o(()=>this.current,e=>{this._settingWeather||e==null||(this._weatherByType={...this._weatherByType,[e.type]:e})},s)])}get state(){let e=this.view;
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{watch as o,syncAndInitial as s}from"../../core/reactiveUtils.js";import c from"../../views/3d/environment/CloudyWeather.js";import l from"../../views/3d/environment/FoggyWeather.js";import u from"../../views/3d/environment/RainyWeather.js";import d from"../../views/3d/environment/SnowyWeather.js";import f from"../../views/3d/environment/SunnyWeather.js";import{validateWeatherType as p}from"../../views/3d/environment/weather.js";let m=class extends t{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.view=null,this._weatherByType={sunny:new f,cloudy:new c,rainy:new u,snowy:new d,foggy:new l},this._settingWeather=!1,t||i(a.getLogger(this),`Weather`,`arcgis-weather`,{version:`4.33`})}initialize(){this.addHandles([o(()=>this.current,e=>{this._settingWeather||e==null||(this._weatherByType={...this._weatherByType,[e.type]:e})},s)])}get state(){let e=this.view;return e==null||!e.ready?`disabled`:this.error==null||this.error===`not-visible`?`ready`:`error`}get weatherByType(){return this._weatherByType}get error(){let e=this.view;return e==null||!e.ready?null:e.type===`3d`?e.viewingMode===`local`?`local-scene`:e.environment.atmosphereEnabled?e.environment.weatherAvailable?null:`not-visible`:`no-atmosphere`:`unsupported-view`}get current(){return this._environment?.weather??this._weatherByType.sunny}set current(e){let t=this._environment;t&&(t.weather=e)}get _environment(){let e=this.view;return e!=null&&e.type===`3d`?e.environment:null}setWeatherByType(e){if(!p(e,a.getLogger(this)))return;let t=this._environment;t!=null&&(this._settingWeather=!0,t.weather=this._weatherByType[e],this._settingWeather=!1)}setSnowCoverEnabled(e){let t=this.current;`snowCover`in t&&(t.snowCover=e?`enabled`:`disabled`)}};e([n()],m.prototype,`view`,void 0),e([n()],m.prototype,`state`,null),e([n()],m.prototype,`_weatherByType`,void 0),e([n()],m.prototype,`weatherByType`,null),e([n()],m.prototype,`error`,null),e([n()],m.prototype,`current`,null),e([n()],m.prototype,`_environment`,null),m=e([r(`esri.widgets.Weather.WeatherViewModel`)],m);const h=m;export{h as default};
|
package/widgets/Weather/css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
const e=`esri-weather`,t={base:e,content:`${e}__content`,hasError:`${e}__content--has-error`,selector:`${e}__selector`,options:`${e}__options`,optionsHidden:`${e}__options--hidden`,error:`${e}__error`,warning:`${e}__warning`},n={base:`${
|
|
2
|
+
const e=`esri-weather`,t={base:e,content:`${e}__content`,hasError:`${e}__content--has-error`,selector:`${e}__selector`,options:`${e}__options`,optionsHidden:`${e}__options--hidden`,error:`${e}__error`,warning:`${e}__warning`},n={base:`${e}__labeled-slider`};export{t as css,n as labeledSliderCss};
|
package/widgets/Weather.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{memoize as a}from"../core/memoize.js";import{weatherTypesArray as o}from"../views/3d/environment/weather.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as l}from"./support/Heading.js";import{messageBundle as u,tsx as d,classes as f,tsxFragment as p}from"./support/widget.js";import{css as m}from"./Weather/css.js";import{LabeledSlider as h}from"./Weather/LabeledSlider.js";import g from"./Weather/VisibleElements.js";import _ from"./Weather/WeatherViewModel.js";import v from"./Widget.js";const y={sunny:`brightness`,cloudy:`partly-cloudy`,rainy:`rain`,snowy:`snow`,foggy:`fog`};let b=class extends v{constructor(e){super(e),this.viewModel=new _({suppressDeprecationWarning:!0}),this.headingLevel=4,this.visibleElements=new g,this._renderWeatherTypeButton=e=>{let t=this.viewModel,n=this.messages[e].label,r=t.state===`disabled`,i=!r&&t.current.type===e;return d(`calcite-button`,{appearance:i?`solid`:`outline`,"aria-checked":i?`true`:`false`,disabled:r,iconStart:y[e],key:`${e}-type-button`,kind:i?`brand`:`neutral`,label:n,scale:`l`,title:n,onclick:()=>{i||t.setWeatherByType(e)}})},this._memoizedCallbacks=a(e=>({onCloudCoverChange:t=>{`cloudCover`in e&&(e.cloudCover=t)},onPrecipitationChange:t=>{`precipitation`in e&&(e.precipitation=t)},onFogStrengthChange:t=>{`fogStrength`in e&&(e.fogStrength=t)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.currentTarget.checked)}})),r(i.getLogger(this),`Weather`,`arcgis-weather`,{version:`4.33`})}render(){let e=this.viewModel.state===`disabled`;return d(`div`,{"aria-label":this.messages.widgetLabelAccessible,class:this.classes(m.base,c.widget,e&&c.widgetDisabled),role:`region`},this._renderContent())}loadDependencies(){return s({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),checkbox:()=>import(`@esri/calcite-components/dist/components/calcite-checkbox`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`)})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get icon(){return`partly-cloudy`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get _errorMessage(){let e=this.messages.error;switch(this.viewModel.error){case`local-scene`:return e.localScene;case`no-atmosphere`:return e.noAtmosphere;case`unsupported-view`:return e.unsupported;default:return null}}get _warningMessage(){
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{memoize as a}from"../core/memoize.js";import{weatherTypesArray as o}from"../views/3d/environment/weather.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as l}from"./support/Heading.js";import{messageBundle as u,tsx as d,classes as f,tsxFragment as p}from"./support/widget.js";import{css as m}from"./Weather/css.js";import{LabeledSlider as h}from"./Weather/LabeledSlider.js";import g from"./Weather/VisibleElements.js";import _ from"./Weather/WeatherViewModel.js";import v from"./Widget.js";const y={sunny:`brightness`,cloudy:`partly-cloudy`,rainy:`rain`,snowy:`snow`,foggy:`fog`};let b=class extends v{constructor(e){super(e),this.viewModel=new _({suppressDeprecationWarning:!0}),this.headingLevel=4,this.visibleElements=new g,this._renderWeatherTypeButton=e=>{let t=this.viewModel,n=this.messages[e].label,r=t.state===`disabled`,i=!r&&t.current.type===e;return d(`calcite-button`,{appearance:i?`solid`:`outline`,"aria-checked":i?`true`:`false`,disabled:r,iconStart:y[e],key:`${e}-type-button`,kind:i?`brand`:`neutral`,label:n,scale:`l`,title:n,onclick:()=>{i||t.setWeatherByType(e)}})},this._memoizedCallbacks=a(e=>({onCloudCoverChange:t=>{`cloudCover`in e&&(e.cloudCover=t)},onPrecipitationChange:t=>{`precipitation`in e&&(e.precipitation=t)},onFogStrengthChange:t=>{`fogStrength`in e&&(e.fogStrength=t)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.currentTarget.checked)}})),r(i.getLogger(this),`Weather`,`arcgis-weather`,{version:`4.33`})}render(){let e=this.viewModel.state===`disabled`;return d(`div`,{"aria-label":this.messages.widgetLabelAccessible,class:this.classes(m.base,c.widget,e&&c.widgetDisabled),role:`region`},this._renderContent())}loadDependencies(){return s({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),checkbox:()=>import(`@esri/calcite-components/dist/components/calcite-checkbox`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`)})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get icon(){return`partly-cloudy`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get _errorMessage(){let e=this.messages.error;switch(this.viewModel.error){case`local-scene`:return e.localScene;case`no-atmosphere`:return e.noAtmosphere;case`unsupported-view`:return e.unsupported;default:return null}}get _warningMessage(){return this.viewModel.error===`not-visible`&&this.view!=null&&this.view?.type===`3d`&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}_renderContent(){let{headingLevel:e,messages:t,viewModel:n,visibleElements:r}=this,i=this._warningMessage,a=n.current,s=n.state===`error`;return d(p,null,r.header?d(l,{level:e},t.widgetLabel):null,s?d(`div`,{class:m.error,key:`error`},this._errorMessage):null,d(`div`,{class:f({[m.content]:!0,[m.hasError]:s}),key:`content`},d(`div`,{"aria-label":t.weatherType,class:m.selector,key:`type-selector`,role:`radiogroup`},o.map(this._renderWeatherTypeButton)),Object.values(n.weatherByType).map(e=>d(`div`,{class:f({[m.options]:!0,[m.optionsHidden]:e.type!==a?.type}),key:`options-container`},this._renderOptions(e))),i==null?null:this._renderWarning(i)))}_renderOptions(e){let{viewModel:t,messages:n}=this,r=t.state===`disabled`,i=this._memoizedCallbacks(e);switch(e.type){case`sunny`:return d(h,{disabled:r,key:`sunny-cover`,label:n.sunny.cloudCover,value:e.cloudCover,onChange:i.onCloudCoverChange});case`cloudy`:return d(h,{disabled:r,key:`cloudy-cover`,label:n.cloudy.cloudCover,value:e.cloudCover,onChange:i.onCloudCoverChange});case`rainy`:return d(p,null,d(h,{disabled:r,key:`rainy-cover`,label:n.rainy.cloudCover,value:e.cloudCover,onChange:i.onCloudCoverChange}),d(h,{disabled:r,key:`rainy-precipitation`,label:n.rainy.precipitation,value:e.precipitation,onChange:i.onPrecipitationChange}));case`snowy`:return d(p,null,d(h,{disabled:r,key:`snowy-cloud-cover`,label:n.snowy.cloudCover,value:e.cloudCover,onChange:i.onCloudCoverChange}),d(h,{disabled:r,key:`snowy-precipitation`,label:n.snowy.precipitation,value:e.precipitation,onChange:i.onPrecipitationChange}),d(`calcite-label`,{key:`snow-cover`,layout:`inline`,scale:`s`,title:n.snowy.snowCoverTooltip},d(`calcite-checkbox`,{checked:e.snowCover===`enabled`,disabled:r,onCalciteCheckboxChange:i.onSnowCoverChange}),n.snowy.snowCover));case`foggy`:return d(h,{disabled:r,key:`foggy-cover`,label:n.foggy.fogStrength,value:e.fogStrength,onChange:i.onFogStrengthChange})}}_renderWarning(e){return d(`div`,{class:m.warning,key:`warning`},d(`calcite-icon`,{icon:`exclamation-mark-triangle`,scale:`s`}),e)}};e([t({type:_})],b.prototype,`viewModel`,void 0),e([t()],b.prototype,`view`,null),e([t()],b.prototype,`headingLevel`,void 0),e([t({type:g,nonNullable:!0})],b.prototype,`visibleElements`,void 0),e([t()],b.prototype,`icon`,null),e([t()],b.prototype,`label`,null),e([t(),u(`esri/widgets/Weather/t9n/Weather`)],b.prototype,`messages`,void 0),e([t()],b.prototype,`_errorMessage`,null),e([t()],b.prototype,`_warningMessage`,null),b=e([n(`esri.widgets.Weather`)],b);const x=b;export{x as default};
|