@arcgis/core 4.34.0-next.69 → 4.34.0-next.70
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/applications/Components/QuantityFormatter.js +1 -1
- package/applications/Components/analysisUtils.js +1 -1
- package/applications/MapViewer/mediaUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e2486bf5546443408c85.js → 0618ea8bf9da93d713b1.js} +1 -1
- package/assets/esri/core/workers/chunks/0b69d251961d8b46fe30.js +1 -0
- package/assets/esri/core/workers/chunks/{adfb018f510e19a520fb.js → 0f37204f86d2997a2811.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0fe6bb51ecc9b2faf69.js → 16cfbe7bedf75d3a86e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f0f6653b8e92c633d14.js → 181b3564a0e3939020bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{aff553c3d6544e20f188.js → 28a2f74d4a449386d082.js} +1 -1
- package/assets/esri/core/workers/chunks/{5185c63fecc5f493e142.js → 3bf99037befdedd75cb4.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e2558b14be70b273ce4.js → 43095bed5456251940b9.js} +1 -1
- package/assets/esri/core/workers/chunks/4a5092e27e6f294ea888.js +1 -0
- package/assets/esri/core/workers/chunks/4d33eec23ad6dbd6a0f0.js +1 -0
- package/assets/esri/core/workers/chunks/52286d4135b8395a3400.js +1 -0
- package/assets/esri/core/workers/chunks/{66cb5b294d7f251c2cc8.js → 540506802776f77e47f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e95896ac41c7e2ca26a.js → 56f54d007b0da0d908aa.js} +1 -1
- package/assets/esri/core/workers/chunks/5879cebb22157b0b4998.js +1 -0
- package/assets/esri/core/workers/chunks/{4102ed32b8dbdc32cb3b.js → 5c4ba165816809e06340.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa970a547c60c43d6c7f.js → 61896e64e9ef49b4bb1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{82cb5defb0593e3017ff.js → 6391ce002fbde9f27a77.js} +1 -1
- package/assets/esri/core/workers/chunks/{a895da7fd64ebad3d5a4.js → 6dc62c170e9583222df2.js} +1 -1
- package/assets/esri/core/workers/chunks/72bde3290ad2e1a11d9b.js +2 -0
- package/assets/esri/core/workers/chunks/{48316d91c06928f69f61.js → 78b33c6d73824085c6d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{b482132638f3b351724c.js → 7aaa6b318195d7342e6c.js} +1 -1
- package/assets/esri/core/workers/chunks/810e4c16c6eae420508b.js +1 -0
- package/assets/esri/core/workers/chunks/{837830e1cf712d4243a5.js → 83589cfcc443b925c1aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{26b791291689434dde09.js → 8b587affaaa0b1e4368c.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1b361b8adf1c719a10a.js → 925ad2665c2fe0f47cc3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b84eba4a28e25b6d5c0.js → 9421389888d4d9e4e809.js} +1 -1
- package/assets/esri/core/workers/chunks/{80b0c88a76bd523a406a.js → 96740c75ad65d651cc43.js} +1 -1
- package/assets/esri/core/workers/chunks/98c94a99e2e04d5ae65f.js +1 -0
- package/assets/esri/core/workers/chunks/{ab727ed4417b7dd94ce9.js → 9c00c2263e52ad51c2a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f054557e23978e174686.js → a2baeb9fa805c3537049.js} +1 -1
- package/assets/esri/core/workers/chunks/{18c7b1e1fbf7eb6c3c33.js → a33e1a031ba9f028023d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c053d197935c65792ce.js → b03dcbc31bccb9fdf9fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4e224983c3ee24fc51d.js → b7f5a26ff3a73c64552d.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc5fa33afec5354601a1.js → b818b5e392d5eb7c7e70.js} +1 -1
- package/assets/esri/core/workers/chunks/{efea3e82cec476d486e0.js → bce41b41431a7daed33c.js} +1 -1
- package/assets/esri/core/workers/chunks/{b052d3ef5493eedb44a5.js → c07507a42def2bd2a222.js} +1 -1
- package/assets/esri/core/workers/chunks/{b335e96f6bcac6d2f0ee.js → c427516421edf56e7776.js} +1 -1
- package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +1 -0
- package/assets/esri/core/workers/chunks/{097a5c333de28ec5e16f.js → cd58b40a8105be758c0e.js} +1 -1
- package/assets/esri/core/workers/chunks/ce1f4508487298ab57b6.js +1 -0
- package/assets/esri/core/workers/chunks/{144bfd64daf103a06734.js → ce8f56cf371812b57a46.js} +1 -1
- package/assets/esri/core/workers/chunks/{0c4f07eb3f3dd5cd2c6c.js → d1711256493d55eca523.js} +1 -1
- package/assets/esri/core/workers/chunks/{489fa17e60f25d5f33ae.js → d44f3ee27e142e0c3030.js} +1 -1
- package/assets/esri/core/workers/chunks/d682dd49bb9ee7f48f93.js +1 -0
- package/assets/esri/core/workers/chunks/{6a5b5b80917a5375b9f6.js → e2384a1079a4722c41dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe353a53968827bcd9cc.js → e3ad0a390387c5847aca.js} +1 -1
- package/assets/esri/core/workers/chunks/{87fb5d755860057da164.js → e8e0f73fb94e63e2abc3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f8adac87e48ea86bec21.js → eb0a5d592f5805836203.js} +1 -1
- package/assets/esri/core/workers/chunks/f3ef59991c577ff5e825.js +1 -0
- package/assets/esri/core/workers/chunks/{ed1272e7681e561d843f.js → f51c1420c9243d550c9d.js} +1 -1
- package/assets/esri/core/workers/chunks/f749e2a89a14ab89ae59.js +1 -0
- package/assets/esri/core/workers/chunks/f7e9cbd54154341bd2de.js +1 -0
- package/assets/esri/core/workers/chunks/{09dbb3e200ef8d514eb3.js → f87a6b32292c1464b7b7.js} +2 -2
- package/assets/esri/core/workers/chunks/{a2963ffc9a8c90822d2d.js → fdf2b980e8a8aa47ce91.js} +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +39 -19
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/support/GaussianSplatAtlasPageAllocator.js +1 -1
- package/package.json +3 -2
- package/support/actions/actionUtils.js +1 -1
- package/support/modeUtils.js +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/enums.js +5 -0
- package/symbols/support/svgUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientSizeHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/TerrainTileTree3DDebugger.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/components/TooltipField.js +1 -1
- package/views/interactive/tooltip/components/ValueByValue.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
- package/views/overlay/BoxOverlayItem.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/overlay/OutlineOverlayItem.js +1 -1
- package/views/support/GroundViewElevationSampler.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/PanelContent.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/Legend.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
- package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/Heading.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/12d30c2367652e2c688b.js +0 -1
- package/assets/esri/core/workers/chunks/170ec7fb070c63230c81.js +0 -1
- package/assets/esri/core/workers/chunks/3386420c9ae891db5be7.js +0 -2
- package/assets/esri/core/workers/chunks/3cef77453623bbb37ad2.js +0 -1
- package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +0 -1
- package/assets/esri/core/workers/chunks/570b17a1a4ab405bbdcb.js +0 -1
- package/assets/esri/core/workers/chunks/6433116597021a9af680.js +0 -1
- package/assets/esri/core/workers/chunks/7944c18b270c85ff2e41.js +0 -1
- package/assets/esri/core/workers/chunks/81e518dd62bd95611d00.js +0 -1
- package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +0 -1
- package/assets/esri/core/workers/chunks/a6f66492651646c18f10.js +0 -1
- package/assets/esri/core/workers/chunks/bd7e303dd64a27ba6846.js +0 -1
- package/assets/esri/core/workers/chunks/e956d437c0c2ea81db93.js +0 -1
- package/assets/esri/core/workers/chunks/f1865b28f0f75cadd716.js +0 -1
- package/layers/GroundLayer.js +0 -5
- /package/assets/esri/core/workers/chunks/{3386420c9ae891db5be7.js.LICENSE.txt → 72bde3290ad2e1a11d9b.js.LICENSE.txt} +0 -0
package/widgets/FloorFilter.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../intl.js";import{watch as t}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{css as o}from"./FloorFilter/css.js";import n from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{Heading as c,incrementHeadingLevel as h}from"./support/Heading.js";import{isRTL as d,storeNode as u}from"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import{substitute as M}from"../intl/substitute.js";const g=new Set(["ArrowUp","ArrowDown","End","Home"]);let f=class extends l{constructor(e,i){super(e,i),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new n,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(t(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=m("div",{class:this.classes(o.separator)}),n=this._getComponentPosition(),r=this._getPosition(n),c="top-right"===n||"bottom-right"===n,h="top-left"===n||"bottom-left"===n,u=d(this.container),v=u&&h||!u&&c?s:i,M=u&&h||!u&&c?i:s;return m("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(o.floorFilter,a.widget,`${o.floorFilterLayout}${t}`,`${o.floorFilterPosition}${r}`),key:"floor-filter-menu"},v,this.viewModel?.filterMenuOpen?l:null,M)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),m("div",{class:this.classes(a.widget,o.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return m("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&a.buttonDisabled,o.browseButton,this.viewModel?.filterMenuOpen&&a.widgetButtonActive),key:"browse-button",onclick:this._toggleFilterMenu,title:t.buttons.browse,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:this.icon,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:t,messages:i}=this,s=this.viewModel?.getFacility(e),l=this.viewModel?.getFacilityLevels(e),n=l.map(e=>this._renderLevelButton(e));if(!n.length)return null;const r=s&&M(i.selector.levelsLabel,{name:`"${s.name}"`});if(this._isWebScene(this.view?.map)&&n?.length>1){const i={id:`all--${e}`,facilityId:e,shortName:t.all,longName:t.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(i);n.push(s)}return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},n)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,n=`levels--${l}`,r=this.level===l,c=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||r||this.viewModel.levelsExpanded?m("li",{key:n},m("button",{bind:this,class:this.classes(a.widgetButton,r?a.widgetButtonActive:null,a.interactive,o.levelButton),"data-id":l,"data-list-id":"levels",onclick:this._levelSelected,onfocus:this._onItemFocus,type:"button"},c)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return m("button",{"aria-label":e.close,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.closeLevelsButton),key:"close-levels-button",onclick:this._closeLevels,title:e.close,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,n=this.viewModel?.filterMenuOpen,r=this.viewModel?.getSite(s),c=this.viewModel?.getFacility(i),h="site"===l&&n?!r:!c;return m("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(a.widget,a.widgetButton,h&&a.buttonDisabled,a.interactive,this.viewModel?.getFacilityLevels(i).length>0?o.zoomButtonLevels:o.zoomButton),key:"zoom-button",onclick:this._zoomToClicked,title:t.buttons.zoomTo,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"zoom-to-object",scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return m("button",{"aria-label":s,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.minimizeToggleButton),key:"minimize-toggle-button",onclick:this._toggleCollapsed,title:s,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{class:this.classes(o.iconFlip),icon:i,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=m("div",{class:this.classes(`${o.filterMenuHeader}`),key:"filter-menu-site-header"},m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},i)),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),n=this._renderSiteItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-site"},s,l,n)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,n=this.viewModel.hasMultipleSites?m("button",{bind:this,class:this.classes(o.filterMenuHeaderBack),onclick:this._backClicked,title:t.back,type:"button"},m("calcite-icon",{class:this.classes(d(this.container)?o.iconRight:o.iconLeft),icon:d(this.container)?"chevron-right":"chevron-left"})):null,r=this.viewModel.hasMultipleSites?m(c,{class:this.classes(o.filterMenuHeaderSubtext),level:h(this.headingLevel)},s):null,a=m("div",{class:this.classes(o.filterMenuHeader),key:"filter-menu-site-header"},n,m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},l),r),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),u=this._renderSearchInput(),v=this._renderFacilityItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-facility"},a,u,v)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return m("div",{class:this.classes(o.filterMenuSearch),key:"filter-menu-search"},m("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),m("input",{afterCreate:u,bind:this,class:this.classes(o.filterMenuSearchInput),"data-node-ref":"_searchInput",oninput:this._onSearchChange,onpaste:this._onSearchChange,placeholder:e.search,value:this.viewModel.searchTerm??void 0}),t?m("calcite-icon",{bind:this,class:this.classes(o.iconClose),icon:"x",key:"filter-menu-search-clear",onclick:this._onSearchClear,title:e.clear}):null)}_renderBlueCircle(){return m("span",{class:this.classes(o.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults);return m("ul",{afterCreate:u,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(o.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",onkeydown:this._handleListKeydown,tabIndex:-1},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuSite),"data-id":i,"data-list-id":"sites",onclick:this._siteSelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t),m("calcite-icon",{class:this.classes(d(this.container)?o.iconLeft:o.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:t}=this,i=this.viewModel.getSite(t),s=this.viewModel.filterFeatures.facilities.facilitiesInfo,l=this.viewModel.filterFacilities(s).map(e=>this._renderFacilityItem(e)),n=0===l.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults),r=i?M(e.selector.siteFacilitiesLabel,{name:`"${i.name}"`}):e.selector.facilitiesLabel;return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",onkeydown:this._handleListKeydown,tabIndex:-1},l,n)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuFacility),"data-id":i,"data-list-id":"facilities",onclick:this._facilitySelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,o="Tab"===l,n=g.has(l);n&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(n||o)&&this._handleItemNavigation(l,e.shiftKey,r,o,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const o=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,o!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let o=0;o<i.length;o++){const e=i[o].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const o=l?.getElementsByTagName("li");if(!o)return;const n=[];Array.from(o).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&n.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;n.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([i()],f.prototype,"_searchInput",void 0),e([i()],f.prototype,"enabled",null),e([i()],f.prototype,"longNames",null),e([i()],f.prototype,"minimized",null),e([i()],f.prototype,"pinnedLevels",null),e([i()],f.prototype,"site",null),e([i()],f.prototype,"facility",null),e([i()],f.prototype,"level",null),e([i()],f.prototype,"view",null),e([i({type:n})],f.prototype,"viewModel",void 0),e([i(),v("esri/widgets/FloorFilter/t9n/FloorFilter")],f.prototype,"messages",void 0),e([i(),v("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([i()],f.prototype,"goToOverride",null),e([i()],f.prototype,"headingLevel",void 0),e([i()],f.prototype,"icon",null),f=e([s("esri.widgets.FloorFilter")],f);const p=f;export{p as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../intl.js";import{watch as t}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{css as o}from"./FloorFilter/css.js";import n from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{Heading as c,incrementHeadingLevel as h}from"./support/Heading.js";import{isRTL as d,storeNode as u}from"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as M}from"../intl/substitute.js";const g=new Set(["ArrowUp","ArrowDown","End","Home"]);let f=class extends l{constructor(e,i){super(e,i),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new n,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(t(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=m("div",{class:this.classes(o.separator)}),n=this._getComponentPosition(),r=this._getPosition(n),c="top-right"===n||"bottom-right"===n,h="top-left"===n||"bottom-left"===n,u=d(this.container),v=u&&h||!u&&c?s:i,M=u&&h||!u&&c?i:s;return m("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(o.floorFilter,a.widget,`${o.floorFilterLayout}${t}`,`${o.floorFilterPosition}${r}`),key:"floor-filter-menu"},v,this.viewModel?.filterMenuOpen?l:null,M)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),m("div",{class:this.classes(a.widget,o.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return m("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&a.buttonDisabled,o.browseButton,this.viewModel?.filterMenuOpen&&a.widgetButtonActive),key:"browse-button",onclick:this._toggleFilterMenu,title:t.buttons.browse,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:this.icon,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:t,messages:i}=this,s=this.viewModel?.getFacility(e),l=this.viewModel?.getFacilityLevels(e),n=l.map(e=>this._renderLevelButton(e));if(!n.length)return null;const r=s&&M(i.selector.levelsLabel,{name:`"${s.name}"`});if(this._isWebScene(this.view?.map)&&n?.length>1){const i={id:`all--${e}`,facilityId:e,shortName:t.all,longName:t.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(i);n.push(s)}return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},n)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,n=`levels--${l}`,r=this.level===l,c=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||r||this.viewModel.levelsExpanded?m("li",{key:n},m("button",{bind:this,class:this.classes(a.widgetButton,r?a.widgetButtonActive:null,a.interactive,o.levelButton),"data-id":l,"data-list-id":"levels",onclick:this._levelSelected,onfocus:this._onItemFocus,type:"button"},c)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return m("button",{"aria-label":e.close,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.closeLevelsButton),key:"close-levels-button",onclick:this._closeLevels,title:e.close,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,n=this.viewModel?.filterMenuOpen,r=this.viewModel?.getSite(s),c=this.viewModel?.getFacility(i),h="site"===l&&n?!r:!c;return m("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(a.widget,a.widgetButton,h&&a.buttonDisabled,a.interactive,this.viewModel?.getFacilityLevels(i).length>0?o.zoomButtonLevels:o.zoomButton),key:"zoom-button",onclick:this._zoomToClicked,title:t.buttons.zoomTo,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"zoom-to-object",scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return m("button",{"aria-label":s,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.minimizeToggleButton),key:"minimize-toggle-button",onclick:this._toggleCollapsed,title:s,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{class:this.classes(o.iconFlip),icon:i,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=m("div",{class:this.classes(`${o.filterMenuHeader}`),key:"filter-menu-site-header"},m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},i)),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),n=this._renderSiteItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-site"},s,l,n)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,n=this.viewModel.hasMultipleSites?m("button",{bind:this,class:this.classes(o.filterMenuHeaderBack),onclick:this._backClicked,title:t.back,type:"button"},m("calcite-icon",{class:this.classes(d(this.container)?o.iconRight:o.iconLeft),icon:d(this.container)?"chevron-right":"chevron-left"})):null,r=this.viewModel.hasMultipleSites?m(c,{class:this.classes(o.filterMenuHeaderSubtext),level:h(this.headingLevel)},s):null,a=m("div",{class:this.classes(o.filterMenuHeader),key:"filter-menu-site-header"},n,m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},l),r),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),u=this._renderSearchInput(),v=this._renderFacilityItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-facility"},a,u,v)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return m("div",{class:this.classes(o.filterMenuSearch),key:"filter-menu-search"},m("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),m("input",{afterCreate:u,bind:this,class:this.classes(o.filterMenuSearchInput),"data-node-ref":"_searchInput",oninput:this._onSearchChange,onpaste:this._onSearchChange,placeholder:e.search,value:this.viewModel.searchTerm??void 0}),t?m("calcite-icon",{bind:this,class:this.classes(o.iconClose),icon:"x",key:"filter-menu-search-clear",onclick:this._onSearchClear,title:e.clear}):null)}_renderBlueCircle(){return m("span",{class:this.classes(o.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults);return m("ul",{afterCreate:u,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(o.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",onkeydown:this._handleListKeydown,tabIndex:-1},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuSite),"data-id":i,"data-list-id":"sites",onclick:this._siteSelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t),m("calcite-icon",{class:this.classes(d(this.container)?o.iconLeft:o.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:t}=this,i=this.viewModel.getSite(t),s=this.viewModel.filterFeatures.facilities.facilitiesInfo,l=this.viewModel.filterFacilities(s).map(e=>this._renderFacilityItem(e)),n=0===l.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults),r=i?M(e.selector.siteFacilitiesLabel,{name:`"${i.name}"`}):e.selector.facilitiesLabel;return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",onkeydown:this._handleListKeydown,tabIndex:-1},l,n)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuFacility),"data-id":i,"data-list-id":"facilities",onclick:this._facilitySelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,o="Tab"===l,n=g.has(l);n&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(n||o)&&this._handleItemNavigation(l,e.shiftKey,r,o,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const o=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,o!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let o=0;o<i.length;o++){const e=i[o].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const o=l?.getElementsByTagName("li");if(!o)return;const n=[];Array.from(o).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&n.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;n.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([i()],f.prototype,"_searchInput",void 0),e([i()],f.prototype,"enabled",null),e([i()],f.prototype,"longNames",null),e([i()],f.prototype,"minimized",null),e([i()],f.prototype,"pinnedLevels",null),e([i()],f.prototype,"site",null),e([i()],f.prototype,"facility",null),e([i()],f.prototype,"level",null),e([i()],f.prototype,"view",null),e([i({type:n})],f.prototype,"viewModel",void 0),e([i(),v("esri/widgets/FloorFilter/t9n/FloorFilter")],f.prototype,"messages",void 0),e([i(),v("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([i()],f.prototype,"goToOverride",null),e([i()],f.prototype,"headingLevel",void 0),e([i()],f.prototype,"icon",null),f=e([s("esri.widgets.FloorFilter")],f);const p=f;export{p as default};
|
package/widgets/FovOverlay.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{rad2deg as s}from"../core/mathUtils.js";import{formatAngleDegrees as e,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";const n="esri-fov-overlay",l={base:n,outer:`${n}-outer`,reset:`${n}-reset`,text:`${n}-text`};let c=class extends m{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return a("div",{class:l.outer},a("div",{class:l.base},a("p",{class:l.text},this._overlay),a("p",{class:l.reset,onclick:this.onReset,title:this._messagesCommon.reset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=e(s(t),"degrees","arithmetic","arithmetic",0),m=u/(2*Math.tan(t/2));return`${i} | ${o(r,m,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),p("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),p("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,n as base,l as css};
|
|
5
|
+
import{__decorate as t}from"tslib";import{rad2deg as s}from"../core/mathUtils.js";import{formatAngleDegrees as e,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const n="esri-fov-overlay",l={base:n,outer:`${n}-outer`,reset:`${n}-reset`,text:`${n}-text`};let c=class extends m{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return a("div",{class:l.outer},a("div",{class:l.base},a("p",{class:l.text},this._overlay),a("p",{class:l.reset,onclick:this.onReset,title:this._messagesCommon.reset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=e(s(t),"degrees","arithmetic","arithmetic",0),m=u/(2*Math.tan(t/2));return`${i} | ${o(r,m,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),p("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),p("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,n as base,l as css};
|
package/widgets/Fullscreen.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
|
package/widgets/Histogram.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../intl.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./Histogram/HistogramViewModel.js";import{globalCss as s}from"./support/globalCss.js";import{onResize as n}from"./support/widgetUtils.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";import{substitute as d}from"../intl/substitute.js";var u;const h="esri-histogram",c={base:h,horizontalLayout:`${h}--horizontal`,verticalLayout:`${h}--vertical`,content:`${h}__content`,svg:`${h}__svg`,bar:`${h}__bar`,bars:`${h}__bars`,label:`${h}__label`,dataLines:`${h}__data-lines`,dataLinesSubgroup:`${h}__data-lines-subgroup`,dataLine:`${h}__data-line`,averageLabel:`${h}__average-label`,averageDataLine:`${h}__average-data-line`,averageSymbol:`${h}__average-symbol`};let p=u=class extends r{constructor(e,t){super(e,t),this._bgFillId=`${this.id}-bg-fill`,this._containerNode=null,this._containerDimensions={width:0,height:0},this._defaultBarColor="#d8d8d8",this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.dataLineUpdatedFunction=null,this.messages=null,this.viewModel=new a}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get icon(){return"graph-histogram"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}set layout(e){"vertical"!==e&&(e="horizontal"),this._set("layout",e)}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get state(){return this.viewModel.state}static fromHistogramResult(e){const{bins:t,maxValue:i,minValue:r}=e;return new u({bins:t,max:i,min:r})}render(){const{label:e,layout:t,state:i}=this,r=this.classes(c.base,s.widget,"horizontal"===t?c.horizontalLayout:c.verticalLayout,"disabled"===i?s.disabled:null);return l("div",{afterCreate:this._afterContainerNodeCreate,"aria-label":e,bind:this,class:r},"ready"===i?this._renderContent():null)}_renderContent(){if(!this._containerNode)return;const e=this._bgFillId,t=`clip-path: url(#${e})`;return l("div",{class:c.content},l("svg",{class:c.svg,xmlns:"http://www.w3.org/2000/svg"},l("defs",null,this._renderFillDefinition(e)),l("g",{style:t},this._renderBarsGroup()),this._renderLinesGroup()))}_renderBarsGroup(){return l("g",{class:this.classes(c.bars)},this._renderBars())}_renderBars(){const{layout:e,viewModel:{binRange:t,range:i}}=this;if(!t||!i)return;const r=t/i,{width:a,height:s}=this._containerDimensions;if(0===s&&0===a)return;if(0===s&&0!==a)return void this.scheduleRender();const[n,o]="vertical"===e?[s*r,a]:[s,a*r];return this._getBarDimensions(n,o).map(([e,t],i)=>this._renderBar(i,e,t))}_renderBar(e,t,i){const{bins:r,layout:a,max:s,messages:n,viewModel:{range:o}}=this;if(!r||null==s)return;const{width:u,height:h}=this._containerDimensions,p=r.slice()[e],{count:g,maxValue:m,minValue:_}=p,b=s-m,[v,L]="vertical"===a?[0,b*(h/o)]:[u-i-b*(u/o),h-t],f=d(n.barLabel,{count:g,maxValue:m,minValue:_});return l("rect",{afterCreate:this._afterBarCreate,"aria-label":f,bind:this,class:c.bar,"data-index":e,fill:this._defaultBarColor,height:t,role:"img","shape-rendering":"crispEdges","stroke-width":"0",width:i,x:v,y:L})}_renderLinesGroup(){return l("g",{class:this.classes(c.dataLines)},this._renderAverageLine(),this._renderCustomLines())}_renderAverageLine(){const{average:e}=this;if(null==e)return;const t=[l("tspan",{class:this.classes(c.averageSymbol)},"x̄ "),l("tspan",{class:this.classes(c.averageLabel)},this.labelFormatFunction?this.labelFormatFunction(e,"average"):e)];return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup)},l("title",{key:"title"},e),this._renderLine(e,this.classes(c.averageDataLine)),this._renderLabel({label:t,value:e}))}_renderCustomLines(){if(this.dataLines?.length)return this.dataLines.map((e,t)=>this._renderLineSubgroup(e,t))}_renderLineSubgroup(e,t){const{value:i}=e;return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup),"data-index":t},l("title",{key:"title"},i),this._renderLine(i),this._renderLabel(e))}_renderLine(e,t){const[i,r,a,s]=this._getLinePosition(e);return l("line",{class:this.classes(c.dataLine,t),"shape-rendering":"crispEdges",x1:i,x2:r,y1:a,y2:s})}_renderLabel(e,t){const{label:i,value:r}=e,[a,s]=this._getLabelPosition(r),n=2;return l("text",{class:this.classes(c.label,t),"text-anchor":"end",transform:"horizontal"===this.layout?"rotate(270)":null,x:a,y:s-n},i??"")}_renderFillDefinition(e){const{width:t,height:i}=this._containerDimensions;return l("clipPath",{id:e},l("rect",{height:i,width:t,x:"0",y:"0"}))}_afterContainerNodeCreate(e){this._containerNode=e,this.addHandles(n(e,e=>{const{width:t,height:i}=e.contentRect;this._containerDimensions={width:t,height:i}}))}_getIndexFromElement(e){const t=e.dataset?.index,i=e.getAttribute("data-index");return null!=t?parseInt(t,10):null!=i?parseInt(i,10):null}_afterBarCreate(e){if(this.barCreatedFunction){const t=this._getIndexFromElement(e)??-1;this.barCreatedFunction(t,e)}}_afterLinesSubgroupCreate(e){if(this.dataLineCreatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineCreatedFunction(i,r,t)}}_afterLinesSubgroupUpdate(e){if(this.dataLineUpdatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineUpdatedFunction(i,r,t)}}_getBarDimensions(e,t){const{bins:i,layout:r}=this,a=i?i.map(e=>e.count):[],s=Math.max.apply(Math,a);return a.map(i=>"vertical"===r?[e/a.length,0!==s?i/s*t:0]:[0!==s?i/s*e:0,t/a.length])}_getLinePosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0,0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions,[o,l]=[a*s||1,n-a*n||1];return"vertical"===t?[0,"100%",l,l]:[o,o,"100%",0]}_getLabelPosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions;return"vertical"===t?[s,n-a*n]:[0,a*s]}};e([t()],p.prototype,"_bgFillId",void 0),e([t()],p.prototype,"_containerNode",void 0),e([t()],p.prototype,"_containerDimensions",void 0),e([t()],p.prototype,"_defaultBarColor",void 0),e([t()],p.prototype,"average",null),e([t()],p.prototype,"barCreatedFunction",void 0),e([t()],p.prototype,"dataLines",void 0),e([t()],p.prototype,"dataLineCreatedFunction",void 0),e([t()],p.prototype,"dataLineUpdatedFunction",void 0),e([t()],p.prototype,"icon",null),e([t()],p.prototype,"label",null),e([t()],p.prototype,"labelFormatFunction",null),e([t({value:"horizontal"})],p.prototype,"layout",null),e([t()],p.prototype,"max",null),e([t(),o("esri/widgets/Histogram/t9n/Histogram")],p.prototype,"messages",void 0),e([t()],p.prototype,"min",null),e([t({readOnly:!0})],p.prototype,"state",null),e([t({type:a})],p.prototype,"viewModel",void 0),p=u=e([i("esri.widgets.Histogram")],p);const g=p;export{g as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../intl.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./Histogram/HistogramViewModel.js";import{globalCss as s}from"./support/globalCss.js";import{onResize as n}from"./support/widgetUtils.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as d}from"../intl/substitute.js";var u;const h="esri-histogram",c={base:h,horizontalLayout:`${h}--horizontal`,verticalLayout:`${h}--vertical`,content:`${h}__content`,svg:`${h}__svg`,bar:`${h}__bar`,bars:`${h}__bars`,label:`${h}__label`,dataLines:`${h}__data-lines`,dataLinesSubgroup:`${h}__data-lines-subgroup`,dataLine:`${h}__data-line`,averageLabel:`${h}__average-label`,averageDataLine:`${h}__average-data-line`,averageSymbol:`${h}__average-symbol`};let p=u=class extends r{constructor(e,t){super(e,t),this._bgFillId=`${this.id}-bg-fill`,this._containerNode=null,this._containerDimensions={width:0,height:0},this._defaultBarColor="#d8d8d8",this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.dataLineUpdatedFunction=null,this.messages=null,this.viewModel=new a}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get icon(){return"graph-histogram"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}set layout(e){"vertical"!==e&&(e="horizontal"),this._set("layout",e)}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get state(){return this.viewModel.state}static fromHistogramResult(e){const{bins:t,maxValue:i,minValue:r}=e;return new u({bins:t,max:i,min:r})}render(){const{label:e,layout:t,state:i}=this,r=this.classes(c.base,s.widget,"horizontal"===t?c.horizontalLayout:c.verticalLayout,"disabled"===i?s.disabled:null);return l("div",{afterCreate:this._afterContainerNodeCreate,"aria-label":e,bind:this,class:r},"ready"===i?this._renderContent():null)}_renderContent(){if(!this._containerNode)return;const e=this._bgFillId,t=`clip-path: url(#${e})`;return l("div",{class:c.content},l("svg",{class:c.svg,xmlns:"http://www.w3.org/2000/svg"},l("defs",null,this._renderFillDefinition(e)),l("g",{style:t},this._renderBarsGroup()),this._renderLinesGroup()))}_renderBarsGroup(){return l("g",{class:this.classes(c.bars)},this._renderBars())}_renderBars(){const{layout:e,viewModel:{binRange:t,range:i}}=this;if(!t||!i)return;const r=t/i,{width:a,height:s}=this._containerDimensions;if(0===s&&0===a)return;if(0===s&&0!==a)return void this.scheduleRender();const[n,o]="vertical"===e?[s*r,a]:[s,a*r];return this._getBarDimensions(n,o).map(([e,t],i)=>this._renderBar(i,e,t))}_renderBar(e,t,i){const{bins:r,layout:a,max:s,messages:n,viewModel:{range:o}}=this;if(!r||null==s)return;const{width:u,height:h}=this._containerDimensions,p=r.slice()[e],{count:g,maxValue:m,minValue:_}=p,b=s-m,[v,L]="vertical"===a?[0,b*(h/o)]:[u-i-b*(u/o),h-t],f=d(n.barLabel,{count:g,maxValue:m,minValue:_});return l("rect",{afterCreate:this._afterBarCreate,"aria-label":f,bind:this,class:c.bar,"data-index":e,fill:this._defaultBarColor,height:t,role:"img","shape-rendering":"crispEdges","stroke-width":"0",width:i,x:v,y:L})}_renderLinesGroup(){return l("g",{class:this.classes(c.dataLines)},this._renderAverageLine(),this._renderCustomLines())}_renderAverageLine(){const{average:e}=this;if(null==e)return;const t=[l("tspan",{class:this.classes(c.averageSymbol)},"x̄ "),l("tspan",{class:this.classes(c.averageLabel)},this.labelFormatFunction?this.labelFormatFunction(e,"average"):e)];return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup)},l("title",{key:"title"},e),this._renderLine(e,this.classes(c.averageDataLine)),this._renderLabel({label:t,value:e}))}_renderCustomLines(){if(this.dataLines?.length)return this.dataLines.map((e,t)=>this._renderLineSubgroup(e,t))}_renderLineSubgroup(e,t){const{value:i}=e;return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup),"data-index":t},l("title",{key:"title"},i),this._renderLine(i),this._renderLabel(e))}_renderLine(e,t){const[i,r,a,s]=this._getLinePosition(e);return l("line",{class:this.classes(c.dataLine,t),"shape-rendering":"crispEdges",x1:i,x2:r,y1:a,y2:s})}_renderLabel(e,t){const{label:i,value:r}=e,[a,s]=this._getLabelPosition(r),n=2;return l("text",{class:this.classes(c.label,t),"text-anchor":"end",transform:"horizontal"===this.layout?"rotate(270)":null,x:a,y:s-n},i??"")}_renderFillDefinition(e){const{width:t,height:i}=this._containerDimensions;return l("clipPath",{id:e},l("rect",{height:i,width:t,x:"0",y:"0"}))}_afterContainerNodeCreate(e){this._containerNode=e,this.addHandles(n(e,e=>{const{width:t,height:i}=e.contentRect;this._containerDimensions={width:t,height:i}}))}_getIndexFromElement(e){const t=e.dataset?.index,i=e.getAttribute("data-index");return null!=t?parseInt(t,10):null!=i?parseInt(i,10):null}_afterBarCreate(e){if(this.barCreatedFunction){const t=this._getIndexFromElement(e)??-1;this.barCreatedFunction(t,e)}}_afterLinesSubgroupCreate(e){if(this.dataLineCreatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineCreatedFunction(i,r,t)}}_afterLinesSubgroupUpdate(e){if(this.dataLineUpdatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineUpdatedFunction(i,r,t)}}_getBarDimensions(e,t){const{bins:i,layout:r}=this,a=i?i.map(e=>e.count):[],s=Math.max.apply(Math,a);return a.map(i=>"vertical"===r?[e/a.length,0!==s?i/s*t:0]:[0!==s?i/s*e:0,t/a.length])}_getLinePosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0,0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions,[o,l]=[a*s||1,n-a*n||1];return"vertical"===t?[0,"100%",l,l]:[o,o,"100%",0]}_getLabelPosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions;return"vertical"===t?[s,n-a*n]:[0,a*s]}};e([t()],p.prototype,"_bgFillId",void 0),e([t()],p.prototype,"_containerNode",void 0),e([t()],p.prototype,"_containerDimensions",void 0),e([t()],p.prototype,"_defaultBarColor",void 0),e([t()],p.prototype,"average",null),e([t()],p.prototype,"barCreatedFunction",void 0),e([t()],p.prototype,"dataLines",void 0),e([t()],p.prototype,"dataLineCreatedFunction",void 0),e([t()],p.prototype,"dataLineUpdatedFunction",void 0),e([t()],p.prototype,"icon",null),e([t()],p.prototype,"label",null),e([t()],p.prototype,"labelFormatFunction",null),e([t({value:"horizontal"})],p.prototype,"layout",null),e([t()],p.prototype,"max",null),e([t(),o("esri/widgets/Histogram/t9n/Histogram")],p.prototype,"messages",void 0),e([t()],p.prototype,"min",null),e([t({readOnly:!0})],p.prototype,"state",null),e([t({type:a})],p.prototype,"viewModel",void 0),p=u=e([i("esri.widgets.Histogram")],p);const g=p;export{g as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Color.js";import{watch as i}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{Integer as s}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import o from"./Histogram.js";import n from"./Slider.js";import l from"./Widget.js";import d from"./HistogramRangeSlider/HistogramRangeSliderViewModel.js";import{getDeviationValues as h}from"./smartMapping/support/utils.js";import{globalCss as u}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";const g="esri-histogram-range-slider",c={base:g,sliderContainer:`${g}__slider-container`,histogramContainer:`${g}__histogram-container`,rangeTypePrefix:`${g}__range-type--`};let v=class extends l{constructor(e,i){super(e,i),this._barElements=[],this._histogram=null,this._slider=null,this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.excludedBarColor=new t("#d7e5f0"),this.includedBarColor=new t("#599dd4"),this.messages=null,this.standardDeviationCount=1,this.viewModel=new d}initialize(){const{average:e,bins:t,hasTimeData:r,max:s,min:a,viewModel:l}=this;this._updateBarFill=this._updateBarFill.bind(this),this._histogram=new o({average:e,bins:t,barCreatedFunction:(e,t)=>{0===e&&(this._barElements=[]),this._barElements.push(t),this._updateBarFill(e,t),this.barCreatedFunction?.(e,t)},dataLines:this._getDataLines(),dataLineCreatedFunction:(e,t)=>{this.dataLineCreatedFunction?.(e,t)},labelFormatFunction:this.labelFormatFunction,layout:"horizontal",max:s,min:a}),this._slider=new n({labelFormatFunction:this.labelFormatFunction,layout:"horizontal",visibleElements:{labels:!0,rangeLabels:!0},rangeLabelInputsEnabled:!r,viewModel:l}),this.addHandles([this._slider.on("max-change",e=>this.emit("max-change",e)),this._slider.on("min-change",e=>this.emit("min-change",e)),this._slider.on("segment-drag",e=>{this._updateBarFills(),this.emit("segment-drag",e)}),this._slider.on("thumb-change",e=>{this._updateBarFills(),this.emit("thumb-change",e)}),this._slider.on("thumb-drag",e=>{this._updateBarFills(),this.emit("thumb-drag",e)}),i(()=>this.bins,e=>{if(e&&this._histogram.bins){const t=this._histogram.bins.length-e.length;this._barElements.splice(-t,t)}else this._barElements=[];this._histogram.set({bins:e}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.max,this.min,this.rangeType,this.values],([e,t])=>{this._histogram.set({max:e,min:t}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.average,this.dataLines,this.standardDeviation,this.standardDeviationCount],([e])=>{this._histogram.set({average:e,dataLines:this._getDataLines()})}),i(()=>this.labelFormatFunction,e=>{this._histogram.set({labelFormatFunction:e})}),i(()=>this.hasTimeData,e=>{this._slider.set({rangeLabelInputsEnabled:!e})})])}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get hasTimeData(){return this.viewModel.hasTimeData}set hasTimeData(e){this.viewModel.hasTimeData=e}get icon(){return"arrow-double-horizontal"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get precision(){return this.viewModel.precision}set precision(e){this.viewModel.precision=e}get rangeType(){return this.viewModel.rangeType}set rangeType(e){this.viewModel.rangeType=e}get standardDeviation(){return this.viewModel.standardDeviation}set standardDeviation(e){this.viewModel.standardDeviation=e}get values(){return this.viewModel.values}set values(e){this.viewModel.values=e}generateWhereClause(e){return this.viewModel.generateWhereClause(e)}render(){const{rangeType:e,viewModel:t,label:i}=this,r=this.classes(c.base,u.widget,`${c.rangeTypePrefix}${e}`,"disabled"===t.state?u.disabled:null);return p("div",{"aria-label":i,class:r},"disabled"===t.state?null:this._renderContent())}_renderContent(){return[this._renderHistogram(),this._renderSlider()]}_renderSlider(){return p("div",{class:c.sliderContainer,key:`${this.id}-slider-container`},this._slider.render())}_renderHistogram(){return p("div",{class:c.histogramContainer},this._histogram.render())}_getDataLines(){return[...this._getStandardDeviationDataLines(),...this.dataLines||[]]}_getStandardDeviationDataLines(){const{average:e,standardDeviation:t,standardDeviationCount:i}=this;return h(t,e,i).map(e=>({value:e}))}_updateBarFills(){this._barElements.forEach((e,t)=>this._updateBarFill(t,e))}_updateBarFill(e,t){t.setAttribute("fill",this._getFillForBar(e)?.toHex()??"")}_getFillForBar(e){const{bins:t,rangeType:i,values:r}=this;if(-1===e||!t?.length||!i||!r?.length)return null;const s=t[e];if(!s)return null;const{maxValue:a,minValue:o}=s,n=a-o,l=r[0]>o&&r[0]<a;switch(i){case"equal":case"not-equal":return this.includedBarColor;case"less-than":case"at-most":return l?this._getBlendedColor((r[0]-o)/n):a<=r[0]?this.includedBarColor:this.excludedBarColor;case"greater-than":case"at-least":return l?this._getBlendedColor(1-(r[0]-o)/n):o>=r[0]?this.includedBarColor:this.excludedBarColor;case"between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor(1-(r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor((r[1]-o)/n):o>=r[0]&&a<=r[1]?this.includedBarColor:this.excludedBarColor;break;case"not-between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor((r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor(1-(r[1]-o)/n):o>r[0]&&a<r[1]?this.excludedBarColor:this.includedBarColor}return this.includedBarColor}_getBlendedColor(e){return t.blendColors(this.excludedBarColor,this.includedBarColor,e)}};e([r()],v.prototype,"average",null),e([r()],v.prototype,"barCreatedFunction",void 0),e([r()],v.prototype,"bins",null),e([r()],v.prototype,"dataLines",void 0),e([r()],v.prototype,"dataLineCreatedFunction",void 0),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"excludedBarColor",void 0),e([r()],v.prototype,"hasTimeData",null),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"includedBarColor",void 0),e([r()],v.prototype,"icon",null),e([r()],v.prototype,"label",null),e([r()],v.prototype,"labelFormatFunction",null),e([r()],v.prototype,"max",null),e([r(),m("esri/widgets/HistogramRangeSlider/t9n/HistogramRangeSlider")],v.prototype,"messages",void 0),e([r()],v.prototype,"min",null),e([r()],v.prototype,"precision",null),e([r()],v.prototype,"rangeType",null),e([r()],v.prototype,"standardDeviation",null),e([r()],v.prototype,"standardDeviationCount",void 0),e([r()],v.prototype,"values",null),e([r({type:d})],v.prototype,"viewModel",void 0),v=e([a("esri.widgets.HistogramRangeSlider")],v);const b=v;export{b as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Color.js";import{watch as i}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{Integer as s}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import o from"./Histogram.js";import n from"./Slider.js";import l from"./Widget.js";import d from"./HistogramRangeSlider/HistogramRangeSliderViewModel.js";import{getDeviationValues as h}from"./smartMapping/support/utils.js";import{globalCss as u}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const g="esri-histogram-range-slider",c={base:g,sliderContainer:`${g}__slider-container`,histogramContainer:`${g}__histogram-container`,rangeTypePrefix:`${g}__range-type--`};let v=class extends l{constructor(e,i){super(e,i),this._barElements=[],this._histogram=null,this._slider=null,this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.excludedBarColor=new t("#d7e5f0"),this.includedBarColor=new t("#599dd4"),this.messages=null,this.standardDeviationCount=1,this.viewModel=new d}initialize(){const{average:e,bins:t,hasTimeData:r,max:s,min:a,viewModel:l}=this;this._updateBarFill=this._updateBarFill.bind(this),this._histogram=new o({average:e,bins:t,barCreatedFunction:(e,t)=>{0===e&&(this._barElements=[]),this._barElements.push(t),this._updateBarFill(e,t),this.barCreatedFunction?.(e,t)},dataLines:this._getDataLines(),dataLineCreatedFunction:(e,t)=>{this.dataLineCreatedFunction?.(e,t)},labelFormatFunction:this.labelFormatFunction,layout:"horizontal",max:s,min:a}),this._slider=new n({labelFormatFunction:this.labelFormatFunction,layout:"horizontal",visibleElements:{labels:!0,rangeLabels:!0},rangeLabelInputsEnabled:!r,viewModel:l}),this.addHandles([this._slider.on("max-change",e=>this.emit("max-change",e)),this._slider.on("min-change",e=>this.emit("min-change",e)),this._slider.on("segment-drag",e=>{this._updateBarFills(),this.emit("segment-drag",e)}),this._slider.on("thumb-change",e=>{this._updateBarFills(),this.emit("thumb-change",e)}),this._slider.on("thumb-drag",e=>{this._updateBarFills(),this.emit("thumb-drag",e)}),i(()=>this.bins,e=>{if(e&&this._histogram.bins){const t=this._histogram.bins.length-e.length;this._barElements.splice(-t,t)}else this._barElements=[];this._histogram.set({bins:e}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.max,this.min,this.rangeType,this.values],([e,t])=>{this._histogram.set({max:e,min:t}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.average,this.dataLines,this.standardDeviation,this.standardDeviationCount],([e])=>{this._histogram.set({average:e,dataLines:this._getDataLines()})}),i(()=>this.labelFormatFunction,e=>{this._histogram.set({labelFormatFunction:e})}),i(()=>this.hasTimeData,e=>{this._slider.set({rangeLabelInputsEnabled:!e})})])}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get hasTimeData(){return this.viewModel.hasTimeData}set hasTimeData(e){this.viewModel.hasTimeData=e}get icon(){return"arrow-double-horizontal"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get precision(){return this.viewModel.precision}set precision(e){this.viewModel.precision=e}get rangeType(){return this.viewModel.rangeType}set rangeType(e){this.viewModel.rangeType=e}get standardDeviation(){return this.viewModel.standardDeviation}set standardDeviation(e){this.viewModel.standardDeviation=e}get values(){return this.viewModel.values}set values(e){this.viewModel.values=e}generateWhereClause(e){return this.viewModel.generateWhereClause(e)}render(){const{rangeType:e,viewModel:t,label:i}=this,r=this.classes(c.base,u.widget,`${c.rangeTypePrefix}${e}`,"disabled"===t.state?u.disabled:null);return p("div",{"aria-label":i,class:r},"disabled"===t.state?null:this._renderContent())}_renderContent(){return[this._renderHistogram(),this._renderSlider()]}_renderSlider(){return p("div",{class:c.sliderContainer,key:`${this.id}-slider-container`},this._slider.render())}_renderHistogram(){return p("div",{class:c.histogramContainer},this._histogram.render())}_getDataLines(){return[...this._getStandardDeviationDataLines(),...this.dataLines||[]]}_getStandardDeviationDataLines(){const{average:e,standardDeviation:t,standardDeviationCount:i}=this;return h(t,e,i).map(e=>({value:e}))}_updateBarFills(){this._barElements.forEach((e,t)=>this._updateBarFill(t,e))}_updateBarFill(e,t){t.setAttribute("fill",this._getFillForBar(e)?.toHex()??"")}_getFillForBar(e){const{bins:t,rangeType:i,values:r}=this;if(-1===e||!t?.length||!i||!r?.length)return null;const s=t[e];if(!s)return null;const{maxValue:a,minValue:o}=s,n=a-o,l=r[0]>o&&r[0]<a;switch(i){case"equal":case"not-equal":return this.includedBarColor;case"less-than":case"at-most":return l?this._getBlendedColor((r[0]-o)/n):a<=r[0]?this.includedBarColor:this.excludedBarColor;case"greater-than":case"at-least":return l?this._getBlendedColor(1-(r[0]-o)/n):o>=r[0]?this.includedBarColor:this.excludedBarColor;case"between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor(1-(r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor((r[1]-o)/n):o>=r[0]&&a<=r[1]?this.includedBarColor:this.excludedBarColor;break;case"not-between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor((r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor(1-(r[1]-o)/n):o>r[0]&&a<r[1]?this.excludedBarColor:this.includedBarColor}return this.includedBarColor}_getBlendedColor(e){return t.blendColors(this.excludedBarColor,this.includedBarColor,e)}};e([r()],v.prototype,"average",null),e([r()],v.prototype,"barCreatedFunction",void 0),e([r()],v.prototype,"bins",null),e([r()],v.prototype,"dataLines",void 0),e([r()],v.prototype,"dataLineCreatedFunction",void 0),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"excludedBarColor",void 0),e([r()],v.prototype,"hasTimeData",null),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"includedBarColor",void 0),e([r()],v.prototype,"icon",null),e([r()],v.prototype,"label",null),e([r()],v.prototype,"labelFormatFunction",null),e([r()],v.prototype,"max",null),e([r(),m("esri/widgets/HistogramRangeSlider/t9n/HistogramRangeSlider")],v.prototype,"messages",void 0),e([r()],v.prototype,"min",null),e([r()],v.prototype,"precision",null),e([r()],v.prototype,"rangeType",null),e([r()],v.prototype,"standardDeviation",null),e([r()],v.prototype,"standardDeviationCount",void 0),e([r()],v.prototype,"values",null),e([r({type:d})],v.prototype,"viewModel",void 0),v=e([a("esri.widgets.HistogramRangeSlider")],v);const b=v;export{b as default};
|
package/widgets/Home.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import n from"./Home/HomeViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{vmEvent as a}from"./support/decorators/vmEvent.js";import{tsx as d}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const g={base:"esri-home"};let v=class extends l{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.uiStrings=void 0,this.viewModel=new n,this._go=()=>{const{viewModel:e}=this;"going-home"===e.state?e.cancelGo():e.go()},t(i.getLogger(this),"Home","arcgis-home",{version:"4.32"})}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"home"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewpoint(){return this.viewModel.viewpoint}set viewpoint(e){this.viewModel.viewpoint=e}cancelGo(){this.viewModel.cancelGo()}go(){return this.viewModel.go()}render(){const{messagesCommon:e,messages:o,icon:t}=this,i=this.viewModel?.state,s="going-home"===i;return d("div",{class:this.classes(g.base,m.widget)},d("calcite-button",{class:m.widgetButton,disabled:"disabled"===i,iconStart:s?void 0:t,kind:"neutral",label:o.widgetLabel,onclick:this._go,scale:s?"s":"m",title:"going-home"===i?e.cancel:o.title},s?d("calcite-loader",{inline:!0,label:""}):null))}};e([s()],v.prototype,"goToOverride",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),c("esri/widgets/Home/t9n/Home")],v.prototype,"messages",void 0),e([s(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"view",null),e([s({type:n}),a("go")],v.prototype,"viewModel",void 0),e([s({type:o})],v.prototype,"viewpoint",null),v=e([r("esri.widgets.Home")],v);const u=v;export{u as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";import{substitute as v}from"../../intl/substitute.js";var _;let I=class extends l{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:t,parent:i,messages:n,visibilityAppearance:o,css:s}=this;if(!("visible"in t&&"layerVisibility"in n&&"showLayer"in n&&"hideLayer"in n&&"visibleToggle"in s&&o))return null;const{visible:a}=t,l=this._getParentVisibilityMode(i);if("inherited"===l)return null;const r=c({visible:a,exclusive:"exclusive"===l,visibilityAppearance:o}),d="checkbox"===o,p=n.layerVisibility,m=v(a?n.hideLayer:n.showLayer,{layerName:e});return h("calcite-action",{appearance:"transparent",class:s.visibleToggle,icon:d?r:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(t,i),scale:"s",slot:d?"actions-start":"actions-end",text:p,title:m},d?null:h("calcite-icon",{class:this.classes({[s.visibleIcon]:"exclusive"!==l&&a}),icon:r,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r),g="group"===r?.type,y=!u&&!c&&e&&g,b=!!e&&("childrenSortable"in t&&t.childrenSortable&&m(t));return c||y?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:b,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,a)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(g(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([t()],I.prototype,"activeItem",void 0),e([t()],I.prototype,"canMove",void 0),e([t()],I.prototype,"css",void 0),e([t()],I.prototype,"displayMode",void 0),e([t()],I.prototype,"dragEnabled",void 0),e([t()],I.prototype,"dragDisabled",void 0),e([t()],I.prototype,"item",void 0),e([t()],I.prototype,"layerTablesEnabled",void 0),e([t()],I.prototype,"listModeDisabled",void 0),e([t()],I.prototype,"messages",void 0),e([t()],I.prototype,"messagesCommon",void 0),e([t()],I.prototype,"onAction",void 0),e([t()],I.prototype,"onPanelOpen",void 0),e([t()],I.prototype,"onCatalogOpen",void 0),e([t()],I.prototype,"onTablesOpen",void 0),e([t()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],I.prototype,"onTooltipReferenceChange",void 0),e([t()],I.prototype,"parent",void 0),e([t()],I.prototype,"parentTitles",void 0),e([t()],I.prototype,"rootGroupUid",void 0),e([t()],I.prototype,"selectionMode",void 0),e([t()],I.prototype,"selectedItems",void 0),e([t()],I.prototype,"selectedDragItemLayerUid",void 0),e([t()],I.prototype,"visibleElements",void 0),e([t()],I.prototype,"visibilityAppearance",void 0),e([t()],I.prototype,"_title",null),e([t()],I.prototype,"_renderedItemStatus",null),e([t()],I.prototype,"_renderedItemTemporaryIcon",null),e([t()],I.prototype,"_renderedItemToggle",null),e([t()],I.prototype,"_renderedPanel",null),e([t()],I.prototype,"_renderedPanelAction",null),e([t()],I.prototype,"_renderedActions",null),e([t()],I.prototype,"_renderedActionMenu",null),e([t()],I.prototype,"_renderedActionMenuContent",null),e([t()],I.prototype,"_renderedCatalogFootprintIcon",null),e([t()],I.prototype,"_renderedCatalogDynamicIcon",null),e([t()],I.prototype,"_renderedCatalogSelectNode",null),e([t()],I.prototype,"_renderedChildList",null),e([t()],I.prototype,"_hasTables",null),e([t()],I.prototype,"_renderedTablesItem",null),e([t()],I.prototype,"_renderedItemMessage",null),e([t()],I.prototype,"_singleAction",null),e([t()],I.prototype,"_filteredSections",null),e([t()],I.prototype,"_actionsCount",null),I=_=e([i("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";import"@arcgis/toolkit/dom";import{substitute as v}from"../../intl/substitute.js";var _;let I=class extends l{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:t,parent:i,messages:n,visibilityAppearance:o,css:s}=this;if(!("visible"in t&&"layerVisibility"in n&&"showLayer"in n&&"hideLayer"in n&&"visibleToggle"in s&&o))return null;const{visible:a}=t,l=this._getParentVisibilityMode(i);if("inherited"===l)return null;const r=c({visible:a,exclusive:"exclusive"===l,visibilityAppearance:o}),d="checkbox"===o,p=n.layerVisibility,m=v(a?n.hideLayer:n.showLayer,{layerName:e});return h("calcite-action",{appearance:"transparent",class:s.visibleToggle,icon:d?r:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(t,i),scale:"s",slot:d?"actions-start":"actions-end",text:p,title:m},d?null:h("calcite-icon",{class:this.classes({[s.visibleIcon]:"exclusive"!==l&&a}),icon:r,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r),g="group"===r?.type,y=!u&&!c&&e&&g,b=!!e&&("childrenSortable"in t&&t.childrenSortable&&m(t));return c||y?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:b,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,a)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(g(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([t()],I.prototype,"activeItem",void 0),e([t()],I.prototype,"canMove",void 0),e([t()],I.prototype,"css",void 0),e([t()],I.prototype,"displayMode",void 0),e([t()],I.prototype,"dragEnabled",void 0),e([t()],I.prototype,"dragDisabled",void 0),e([t()],I.prototype,"item",void 0),e([t()],I.prototype,"layerTablesEnabled",void 0),e([t()],I.prototype,"listModeDisabled",void 0),e([t()],I.prototype,"messages",void 0),e([t()],I.prototype,"messagesCommon",void 0),e([t()],I.prototype,"onAction",void 0),e([t()],I.prototype,"onPanelOpen",void 0),e([t()],I.prototype,"onCatalogOpen",void 0),e([t()],I.prototype,"onTablesOpen",void 0),e([t()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],I.prototype,"onTooltipReferenceChange",void 0),e([t()],I.prototype,"parent",void 0),e([t()],I.prototype,"parentTitles",void 0),e([t()],I.prototype,"rootGroupUid",void 0),e([t()],I.prototype,"selectionMode",void 0),e([t()],I.prototype,"selectedItems",void 0),e([t()],I.prototype,"selectedDragItemLayerUid",void 0),e([t()],I.prototype,"visibleElements",void 0),e([t()],I.prototype,"visibilityAppearance",void 0),e([t()],I.prototype,"_title",null),e([t()],I.prototype,"_renderedItemStatus",null),e([t()],I.prototype,"_renderedItemTemporaryIcon",null),e([t()],I.prototype,"_renderedItemToggle",null),e([t()],I.prototype,"_renderedPanel",null),e([t()],I.prototype,"_renderedPanelAction",null),e([t()],I.prototype,"_renderedActions",null),e([t()],I.prototype,"_renderedActionMenu",null),e([t()],I.prototype,"_renderedActionMenuContent",null),e([t()],I.prototype,"_renderedCatalogFootprintIcon",null),e([t()],I.prototype,"_renderedCatalogDynamicIcon",null),e([t()],I.prototype,"_renderedCatalogSelectNode",null),e([t()],I.prototype,"_renderedChildList",null),e([t()],I.prototype,"_hasTables",null),e([t()],I.prototype,"_renderedTablesItem",null),e([t()],I.prototype,"_renderedItemMessage",null),e([t()],I.prototype,"_singleAction",null),e([t()],I.prototype,"_filteredSections",null),e([t()],I.prototype,"_actionsCount",null),I=_=e([i("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
|
package/widgets/LayerList.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";const P=t.ofType(y),A="nested";let j=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(p.item));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map(e=>this._renderItem(e)),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("esri.widgets.LayerList")],j);const D=j;export{D as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const P=t.ofType(y),A="nested";let j=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(p.item));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map(e=>this._renderItem(e)),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("esri.widgets.LayerList")],j);const D=j;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import i from"./LegendElement.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as n}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let m=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return a({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[o.stacked]:this._hasIndicators};return l("div",{class:this.classes(o.base,s)},e||l("div",{class:o.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:o.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:o.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(o.service,o.groupLayer),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(i,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[o.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(o.service,r),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},l("div",{class:o.serviceCaptionText},e.title)),l("div",{class:o.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(i,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s()],m.prototype,"layout",void 0),e([s(),n("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s(),n("esri/t9n/common")],m.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),e([s()],m.prototype,"view",void 0),m=e([t("esri.widgets.Legend.styles.card.CardView")],m);export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import o from"./SizeRamp.js";import n from"./UnivariateAboveAndBelowRamp.js";import c from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as p}from"../support/relationshipUtils.js";import{getLegendElementTitle as h}from"../support/utils.js";import{attachToNode as m,isImageryStretchedLegend as d,getTitle as y}from"../../support/styleUtils.js";import{Heading as g,incrementHeadingLevel as f}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as u}from"../../../support/jsxFactory.js";var v;let b=v=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=h(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?u("div",null,u(g,{class:a.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),u(g,{class:a.layerCaption,level:f(this.headingLevel)},s)):s?u(g,{class:a.layerCaption,level:this.headingLevel},s):null;return u("section",{"aria-labelledby":this.key,class:a.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return u(o,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return u(l,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return p(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return u("div",{afterCreate:m,bind:this.legendElement.preview,class:a.pieChartRampPreview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return u(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return u(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[a.symbolRow],r={[a.labelContainer]:!i&&!t,[a.relationshipLabelContainer]:t};return u("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return u(v,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=d(t,s),o=y(this.messages,i,!1)||"";if("src"in e&&e.src)return u("div",{class:a.layerRow,key:`${r}-row`},this._renderImage(e,t,l),u("div",{class:a.imageLabel},o));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return u("div",{afterCreate:m,bind:e.preview,key:`${r}-row`});const s={[a.symbolCell]:this.hasIndicators};return u("div",{class:this.classes(a.layerRow,{[a.symbolRow]:this.hasIndicators}),key:`${r}-row`},u("div",{afterCreate:m,bind:e.preview,class:this.classes(s)}),u("div",{class:this.classes(a.imageLabel,{[a.labelCell]:this.hasIndicators})},o))}return u("div",{class:a.layerRow,key:`${r}-row`},u("div",{class:a.labelElement,styles:this._getBackgroundStyles(e)},o))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{label:i,src:r,opacity:l}=e,o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},n={opacity:`${l??s.opacity}`},c=y(this.messages,i,!1);return u("img",{alt:c,"aria-label":c,border:0,class:this.classes(o),height:e.height,src:r,styles:n,width:e.width})}};e([t()],b.prototype,"activeLayerInfo",void 0),e([t()],b.prototype,"cssEffectFilter",void 0),e([t()],b.prototype,"hasIndicators",void 0),e([t()],b.prototype,"headingLevel",void 0),e([t()],b.prototype,"isChild",void 0),e([t()],b.prototype,"layer",void 0),e([t()],b.prototype,"legendElement",void 0),e([t()],b.prototype,"messages",void 0),b=v=e([i("esri.widgets.Legend.styles.card.LegendElement")],b);export{b as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import o from"./SizeRamp.js";import n from"./UnivariateAboveAndBelowRamp.js";import c from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as p}from"../support/relationshipUtils.js";import{getLegendElementTitle as h}from"../support/utils.js";import{attachToNode as m,isImageryStretchedLegend as d,getTitle as y}from"../../support/styleUtils.js";import{Heading as g,incrementHeadingLevel as f}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as u}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";var v;let b=v=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=h(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?u("div",null,u(g,{class:a.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),u(g,{class:a.layerCaption,level:f(this.headingLevel)},s)):s?u(g,{class:a.layerCaption,level:this.headingLevel},s):null;return u("section",{"aria-labelledby":this.key,class:a.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return u(o,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return u(l,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return p(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return u("div",{afterCreate:m,bind:this.legendElement.preview,class:a.pieChartRampPreview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return u(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return u(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[a.symbolRow],r={[a.labelContainer]:!i&&!t,[a.relationshipLabelContainer]:t};return u("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return u(v,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=d(t,s),o=y(this.messages,i,!1)||"";if("src"in e&&e.src)return u("div",{class:a.layerRow,key:`${r}-row`},this._renderImage(e,t,l),u("div",{class:a.imageLabel},o));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return u("div",{afterCreate:m,bind:e.preview,key:`${r}-row`});const s={[a.symbolCell]:this.hasIndicators};return u("div",{class:this.classes(a.layerRow,{[a.symbolRow]:this.hasIndicators}),key:`${r}-row`},u("div",{afterCreate:m,bind:e.preview,class:this.classes(s)}),u("div",{class:this.classes(a.imageLabel,{[a.labelCell]:this.hasIndicators})},o))}return u("div",{class:a.layerRow,key:`${r}-row`},u("div",{class:a.labelElement,styles:this._getBackgroundStyles(e)},o))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{label:i,src:r,opacity:l}=e,o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},n={opacity:`${l??s.opacity}`},c=y(this.messages,i,!1);return u("img",{alt:c,"aria-label":c,border:0,class:this.classes(o),height:e.height,src:r,styles:n,width:e.width})}};e([t()],b.prototype,"activeLayerInfo",void 0),e([t()],b.prototype,"cssEffectFilter",void 0),e([t()],b.prototype,"hasIndicators",void 0),e([t()],b.prototype,"headingLevel",void 0),e([t()],b.prototype,"isChild",void 0),e([t()],b.prototype,"layer",void 0),e([t()],b.prototype,"legendElement",void 0),e([t()],b.prototype,"messages",void 0),b=v=e([i("esri.widgets.Legend.styles.card.LegendElement")],b);export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{pt2px as t}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{renderSpikeRamp as n}from"../support/sizeRampUtils.js";import{attachToNode as l}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as a}from"../../../support/jsxFactory.js";const c="#ddd",p=window.devicePixelRatio;function d(e){if(!e)return;if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t.resource?.primitive;return"circle"===s||"cross"===s||"kite"===s||"sphere"===s||"cube"===s||"diamond"===s}const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}function m(e){if(e){if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t?.resource?.primitive;return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let y=class extends r{constructor(e,t){super(e,t),this.hasIndicators=!1,this.legendElement=null,this.opacity=1}render(){if("spike"===this.legendElement.theme)return a("div",{styles:{display:"flex",flex:"1",justifyContent:"center"}},n(this.legendElement));const{legendElement:e,hasIndicators:t,opacity:s}=this,i=e.infos,r=i.at(0),c=i.at(-1);if(!r||!c)return null;const{label:p,...d}=r,{label:m,...y}=c;let u=d.preview,f=y.preview;const h={"flex-direction":t?"column":"row-reverse"};if(!u||!f)return null;u=u.cloneNode(!0),u.style.display="flex",f=f.cloneNode(!0),f.style.display="flex";const g={opacity:`${s??""}`};return a("div",{class:this.classes(o.layerRow,{[o.sizeRampRow]:t})},a("div",{class:o.rampLabel},t?p:m),a("div",{class:o.sizeRampContainer,styles:h},a("div",{afterCreate:l,bind:u,class:o.sizeRampPreview,styles:g}),this._renderSizeRampLines(e),a("div",{afterCreate:l,bind:f,class:o.sizeRampPreview,styles:g})),a("div",{class:o.rampLabel},t?m:p))}_renderSizeRampLines(e){const s=e.infos,i=s.at(0),r=s.at(-1);if(!i||!r)return null;const o=i.symbol,n=this.hasIndicators,y=i.size&&"number"==typeof i.size?i.size:0,u=r.size&&"number"==typeof r.size?r.size:0,f=i.outlineSize||0,h=r.outlineSize||0,g=t(y+f)*p,v=t(u+h)*p,b=n?g:g+50*p,x=n?g/2+50*p:g,z=m(o),j=d(o),w=document.createElement("canvas");w.width=b,w.height=x,w.style.width=w.width/p+"px",w.style.height=w.height/p+"px";const R=w.getContext("2d");if(n){R.beginPath();const e=0,t=0,s=b/2-v/2,i=x;R.moveTo(e,t),R.lineTo(s,i);const r=b,o=0,n=b/2+v/2,l=x;R.moveTo(r,o),R.lineTo(n,l)}else{R.beginPath();const e=0,t=x/2-v/2,s=b,i=0;R.moveTo(e,t),R.lineTo(s,i);const r=0,o=x/2+v/2,n=b,l=x;R.moveTo(r,o),R.lineTo(n,l)}return R.strokeStyle=c,R.stroke(),a("div",{afterCreate:l,bind:w,styles:n?{display:"flex",marginTop:`-${z?0:j?g/2:0}px`,marginBottom:`-${z?v:j?v/2:0}px`}:{display:"flex",marginRight:`-${z?0:j?g/2:0}px`,marginLeft:`-${z?0:j?v/2:0}px`}})}};e([s()],y.prototype,"hasIndicators",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([i("esri.widgets.Legend.styles.card.SizeRamp")],y);export{y as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{pt2px as t}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{renderSpikeRamp as n}from"../support/sizeRampUtils.js";import{attachToNode as l}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as a}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const c="#ddd",p=window.devicePixelRatio;function d(e){if(!e)return;if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t.resource?.primitive;return"circle"===s||"cross"===s||"kite"===s||"sphere"===s||"cube"===s||"diamond"===s}const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}function m(e){if(e){if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t?.resource?.primitive;return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let y=class extends r{constructor(e,t){super(e,t),this.hasIndicators=!1,this.legendElement=null,this.opacity=1}render(){if("spike"===this.legendElement.theme)return a("div",{styles:{display:"flex",flex:"1",justifyContent:"center"}},n(this.legendElement));const{legendElement:e,hasIndicators:t,opacity:s}=this,i=e.infos,r=i.at(0),c=i.at(-1);if(!r||!c)return null;const{label:p,...d}=r,{label:m,...y}=c;let u=d.preview,f=y.preview;const h={"flex-direction":t?"column":"row-reverse"};if(!u||!f)return null;u=u.cloneNode(!0),u.style.display="flex",f=f.cloneNode(!0),f.style.display="flex";const g={opacity:`${s??""}`};return a("div",{class:this.classes(o.layerRow,{[o.sizeRampRow]:t})},a("div",{class:o.rampLabel},t?p:m),a("div",{class:o.sizeRampContainer,styles:h},a("div",{afterCreate:l,bind:u,class:o.sizeRampPreview,styles:g}),this._renderSizeRampLines(e),a("div",{afterCreate:l,bind:f,class:o.sizeRampPreview,styles:g})),a("div",{class:o.rampLabel},t?m:p))}_renderSizeRampLines(e){const s=e.infos,i=s.at(0),r=s.at(-1);if(!i||!r)return null;const o=i.symbol,n=this.hasIndicators,y=i.size&&"number"==typeof i.size?i.size:0,u=r.size&&"number"==typeof r.size?r.size:0,f=i.outlineSize||0,h=r.outlineSize||0,g=t(y+f)*p,v=t(u+h)*p,b=n?g:g+50*p,x=n?g/2+50*p:g,z=m(o),j=d(o),w=document.createElement("canvas");w.width=b,w.height=x,w.style.width=w.width/p+"px",w.style.height=w.height/p+"px";const R=w.getContext("2d");if(n){R.beginPath();const e=0,t=0,s=b/2-v/2,i=x;R.moveTo(e,t),R.lineTo(s,i);const r=b,o=0,n=b/2+v/2,l=x;R.moveTo(r,o),R.lineTo(n,l)}else{R.beginPath();const e=0,t=x/2-v/2,s=b,i=0;R.moveTo(e,t),R.lineTo(s,i);const r=0,o=x/2+v/2,n=b,l=x;R.moveTo(r,o),R.lineTo(n,l)}return R.strokeStyle=c,R.stroke(),a("div",{afterCreate:l,bind:w,styles:n?{display:"flex",marginTop:`-${z?0:j?g/2:0}px`,marginBottom:`-${z?v:j?v/2:0}px`}:{display:"flex",marginRight:`-${z?0:j?g/2:0}px`,marginLeft:`-${z?0:j?v/2:0}px`}})}};e([s()],y.prototype,"hasIndicators",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([i("esri.widgets.Legend.styles.card.SizeRamp")],y);export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateAboveAndBelowRampElements as s,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let f=class extends r{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:r}=this,{sizeRampElement:f,colorRampElement:y}=s(e,t,"horizontal");if(!f)return null;const h=l(f,"full",!0,"horizontal"),v=a(f,"above",!0,"horizontal"),u=a(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",cssEffectFilter:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",cssEffectFilter:o,ariaLabel:b}),j=n(f,"card"),E=f.infos.map(e=>e.label),z=E.length-1,C=E.map((e,t)=>0===t||t===z?d("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},L={display:"flex",flexDirection:"row"},A={marginTop:"3px",display:"flex"};m(this.container)?A.marginRight=`${j}px`:A.marginLeft=`${j}px`;const k={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:i.layerRow,key:`${r}-container`,styles:R},d("div",{class:this.classes(i.symbolContainer,i.sizeRampHorizontal),styles:L},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:i.symbol,key:t}))),w?d("div",{class:i.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:A},d("div",{afterCreate:c,bind:w}),d("div",{afterCreate:c,bind:x})):null,d("div",{class:i.layerInfo},d("div",{class:i.rampLabelsContainer,styles:k},C)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as
|
|
5
|
+
import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let f=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:s}=this,{sizeRampElement:f,colorRampElement:y}=i(e,"horizontal");if(!f)return null;const u=l(f,"full",!1,"horizontal"),g=a(f,"full",!1,"horizontal"),v=p(y,{width:g,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(f,"card"),x=f.infos.length-1,j=f.infos.map((e,t)=>0===t||t===x?d("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},w={display:"flex",flexDirection:"row"},C={marginTop:"3px",display:"flex"};m(this.container)?C.marginRight=`${h}px`:C.marginLeft=`${h}px`;const E={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:r.layerRow,key:`${s}-container`,styles:b},d("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:w},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:r.symbol,key:t}))),d("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:C},d("div",{afterCreate:c,bind:v})),d("div",{class:r.layerInfo},d("div",{class:r.rampLabelsContainer,styles:E},j)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],f);export{f as default};
|