@arcgis/core 6.0.0-next.40 → 6.0.0-next.41
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/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/059cda6f11a91dbc9e28.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +1 -0
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +1 -0
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +1 -0
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +1 -0
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 46504fc81f357bc7465a.js} +1 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +1 -0
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 54de7dc0597fc80d7a52.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 6738b3d6bce34a1e8be2.js} +1 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 8b0efcc30184593a0812.js} +21 -21
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +1 -0
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → b386e921c273de3ac7a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +1 -0
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → efc1a90742813b55602e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +1 -0
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +7 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.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/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/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.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/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/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.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/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/ListItemPanel.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.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/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.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/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.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/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.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/ValuePickerBaseComponent.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/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.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +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/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
package/widgets/FeatureTable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as n}from"../core/arrayUtils.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,sync as o,syncAndInitial as s,initial as c,on as l}from"../core/reactiveUtils.js";import{renderingSanitizer as u}from"../core/sanitizerUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as m}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as h}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as g,isMapImageLayer as _,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import b from"../time/TimeExtent.js";import x from"./Widget.js";import{isSupportedImage as S,getCalciteIconForAttachment as C,getAttachmentTypeCategory as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as T,Prompt as E}from"./Editor/components/Prompt.js";import D from"./FeatureTable/ColumnMenuVisibleElements.js";import O from"./FeatureTable/FeatureTableViewModel.js";import k from"./FeatureTable/VisibleElements.js";import{isGroupColumn as ee,isFieldColumn as A}from"./FeatureTable/support/columnUtils.js";import j from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as M,isIFeatureTableSupportedLayer as N,isIFeatureTableSupportedLayerWithAttachments as P,getRelationshipIdsToShow as F}from"./FeatureTable/support/tableUtils.js";import{createDropdownReference as I,loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import{getIconForLayer as z}from"./support/iconUtils.js";import{messageBundle as B,vmEvent as V,tsx as H,tsxFragment as U}from"./support/widget.js";import{storeNode as W,discardNode as G}from"./support/widgetUtils.js";var K;const q=`esri-feature-table`,J=`${q}__dialog`,Y=`${q}__table-navigation`,X=`${q}__attachments-view`,Z={base:q,content:`${q}__content`,menuPopover:`${q}__menu-popover`,layerDropdownMenu:`${q}__layer-switcher-menu`,tableContainer:`${q}__table-container`,tableContainerWithAttachments:`${q}__table-container--attachments`,tableNavigation:Y,attachmentsView:X,attachmentsViewContent:`${X}__content`,attachmentsViewDetails:`${X}__details`,attachmentsViewDropArea:`${X}__drop-area`,attachmentsViewDropAreaLabel:`${X}__drop-area__label`,attachmentsViewDropAreaMessage:`${X}__drop-area__message`,attachmentsViewIcon:`${X}__icon`,attachmentsViewInformation:`${X}__information`,attachmentsViewInformationData:`${X}__information__data`,attachmentsViewInformationLabel:`${X}__information__label`,attachmentsViewList:`${X}__list`,attachmentsViewListFileSize:`${X}__list__filesize`,attachmentsViewListThumbnail:`${X}__list__thumbnail`,expanded:`${q}__expanded`,collapsed:`${q}__collapsed`,dialog:`${J}`,dialogContent:`${J}__content`,dialogHeader:`${J}__header`,footerMessage:`${q}__footer__message`,footerIconDanger:`${q}__footer__icon--danger`,footerIconSuccess:`${q}__footer__icon--success`},Q={checkCircle:`check-circle`,chevronRight:`chevron-right`,clearSelection:`clear-selection`,downloadTo:`download-to`,exclamationMarkTriangle:`exclamation-mark-triangle`,expand:`expand`,exportToCSV:`file-csv`,folderOpen:`folder-open`,delete:`trash`,layers:`layers`,moveUp:`move-up`,plus:`plus`,refresh:`refresh`,reset:`reset`,save:`save`,showAll:`selection-x`,showColumn:`show-column`,showSelected:`selection-filter`,table:`table`,upload:`upload`,zoomToSelection:`zoom-to-object`};let $=K=class extends x{constructor(e,t){super(e,t),this._layerDropdownReference=I(),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this._columnVisibilityList=null,this.attachmentsList=null,this.closed=!1,this.collapsed=!1,this.columnVisibilityMenuConfig=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale=`m`,this.title=null,this.viewModel=new O,this.visibleElements=new k,this.announceDeprecation=()=>{r(i.getLogger(this),`Feature Table`,`arcgis-feature-table`,{version:`5.0`})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([a(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),a(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.allColumns.length],()=>{this.allColumns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),a(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),s),a(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},c),l(()=>this.viewModel,`show-related-table`,e=>this._onShowRelatedTable(e)),a(()=>this.editingEnabled,()=>{let{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}),l(()=>this.effectiveTable,`column-reorder`,()=>this.scheduleRender())])}loadDependencies(){return Promise.all([L({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),alert:()=>import(`@esri/calcite-components/dist/components/calcite-alert`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),pagination:()=>import(`@esri/calcite-components/dist/components/calcite-pagination`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),progress:()=>import(`@esri/calcite-components/dist/components/calcite-progress`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)}),T(),M()])}destroy(){this._layerDropdownReference.destroy(),this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!!(this.attachmentsViewOptions.objectId!=null||this.relatedTables.some(e=>e.attachmentsViewOptions.objectId!=null))}get _columnVisibilityActionDisabled(){let e=this.effectiveTable;return e.menuConfig?.disabled??e.columns.length===0}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){let{description:e}=this;return e==null?void 0:u.sanitize(typeof e==`function`?e():e)}get _effectiveLayers(){let{layer:e,layers:t}=this,n=t?.length?t.filter(N):[],r=n.length?n:[...this._viewLayers];return e&&!r.includes(e)&&r.push(e),r}get _effectiveTitle(){let{layer:e,messages:n,state:r,highlightIds:i,title:a,size:o}=this;if(a)return u.sanitize(typeof a==`function`?a():a);if(!n)return``;if(!e)return n.noLayer;switch(r){case`disabled`:return n.errorLayer;case`ready`:case`loading`:return n.loading;case`error`:return n.errorData}return t(n.header,{title:u.sanitize(e.title),count:o,selected:i.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){let e=this.relatedTables.toArray(),t=e.length===1;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return this.attachmentsViewOptions.error!=null}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||this.relatedTables.length===1&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){let{header:e,menu:t}=this._effectiveVisibleElements;return!!(e&&t&&(this._hasDefaultMenuItems||this._hasCustomMenuItems))}get _showClearSelectionAction(){return!!(this.effectiveTable.highlightIds.length&&this._effectiveVisibleElements.menuItems?.clearSelection&&!this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){let{columnVisibilityMenu:e,header:t,menu:n,menuItems:r}=this._effectiveVisibleElements;return!(!t||!n||!e||r?.toggleColumns===!1||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete&&!this.relatedTables.length&&!this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length&&!this.relatedTables.length)}get _showLayerDropdown(){return!!(this._effectiveLayers.length&&this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){let e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){let e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!!(this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle&&this.objectIds.length&&!this.relatedTables.length)}get _showZoomToSelectionAction(){let e=this.effectiveTable;return!!(e.view&&e.highlightIds.length&&!e.layer?.isTable&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){let e=this.view?.map;if(!e)return[];let t=new Set,n=e=>{N(e)&&!v(e)&&!t.has(e)&&(e.type!==`sublayer`||e.capabilities?.operations?.supportsQuery)&&(e.load().catch(()=>{}),t.add(e))},r=e=>{h(e)||e.type===`catalog-footprint`||(g(e)?(e.load().catch(()=>{}),e.layers?.forEach(n),e.tables?.forEach(n)):_(e)?(e.loadAll().catch(()=>{}),e.allSublayers?.forEach(n),e.subtables?.forEach(n)):v(e)?(e.loadAll().catch(()=>{}),e.sublayers?.forEach(n)):n(e))};return e.allLayers.forEach(r),e.allTables.forEach(r),[...t.values()]}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allColumnsVisible(){return this.viewModel.allColumnsVisible}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get defaultSelectionManager(){return this.viewModel.defaultSelectionManager}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get effectiveTimeExtent(){return this.viewModel.effectiveTimeExtent}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get filterByLayerScaleRange(){return this.viewModel.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.viewModel.filterByLayerScaleRange=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return Q.table}set icon(e){this._overrideIfSome(`icon`,e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewTimeEnabled(){return this.viewModel.viewTimeEnabled}set viewTimeEnabled(e){this.viewModel.viewTimeEnabled=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){let{attachmentsViewOptions:e,relatedTable:t,tableController:n,visibleElements:r}=this,{columnDescriptions:i,columnMenus:a,tooltips:o}=r,s=e.objectId!=null;if(t)return new k({columnDescriptions:i,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,columnMenus:!0,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})});if(n){let e=n.relatedTable===this,t=n.allRelatedTablesVisible,c=e&&r.selectionColumn&&!t&&!s,l=e&&!t&&!s;return new k({columnDescriptions:i,tooltips:o,selectionColumn:c,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenus:a||!e,columnMenuItems:new D({sortAscending:l,sortDescending:l})})}return s?new k({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}clearSelection(){this.effectiveTable.viewModel.clearSelection()}async deleteAttachments(e,t,n){e!=null&&t?.length&&(n?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideAllColumns(){this.viewModel.hideAllColumns()}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}get visibilityMenuColumns(){let e=this.effectiveTable.columns;return this.columnVisibilityMenuConfig?.frozenColumnsExcluded?e.filter(e=>!e.frozen&&!e.frozenToEnd).toArray():e.toArray()}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){let{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:n,state:r}=this;return H(`div`,{bind:this,class:this.classes(Z.base,R.widget)},H(`calcite-panel`,{bind:this,class:Z.content,closable:e.close,closed:this.closed,collapsed:this.collapsed,collapsible:e.collapse,description:this._effectiveDescription,dir:this.direction,disabled:this.disabled||r===`disabled`&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:`table-content`,loading:r===`loading`,menuOpen:!!n?.open,overlayPositioning:`fixed`,onCalcitePanelClose:()=>{this.closed=!0,this.emit(`close`)},onCalcitePanelToggle:e=>{this.collapsed=e.target.collapsed,this.emit(`toggle`)}},e.progress?H(`calcite-progress`,{type:t?`indeterminate`:`determinate`}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){let{grid:e,relatedTables:t}=this,n=this.classes(Z.tableContainer);if(t.length){let r=this.classes(Z.base,this.allRelatedTablesVisible?Z.expanded:Z.collapsed,this._attachmentsViewIsVisible?Z.tableContainerWithAttachments:void 0);return H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[this._shouldShowGrid?H(`div`,{class:r},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{let n=t.indexOf(e);return H(`div`,{class:r,key:`related-${n}`},e.render())}),,])))}return this.attachmentsViewOptions.objectId==null?[H(`div`,{class:n},e?.render()),this._renderPagination()]:H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[H(`div`,{class:this.classes(Z.base,Z.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()])))}_renderPagination(){if(this.paginationEnabled)return H(`calcite-pagination`,{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){let{messages:e}=this;return H(`calcite-alert`,{autoClose:!0,autoCloseDuration:`fast`,icon:Q.exclamationMarkTriangle,kind:`danger`,label:e.errorOccured,open:this._hasAttachmentsViewError,slot:`alerts`,topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},H(`span`,{slot:`message`},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;let{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:n,messagesCommon:r}=this,i=e||t,a=this.hasContingentValues,o=[H(`calcite-button`,{appearance:`outline`,disabled:t,iconStart:Q.reset,key:`footer-reset-button`,slot:`footer-end`,width:`auto`,onclick:()=>void this.discardPendingEdits()},r.reset),H(`calcite-button`,{disabled:i,iconStart:Q.save,key:`footer-save-button`,loading:this.isSyncing,slot:`footer-end`,width:`auto`,onclick:()=>{this.savePendingEdits()}},r.save)];if(a){let t=e?n.contingentValues.hasInvalidValues:n.contingentValues.hasValidValues,r=e?Q.exclamationMarkTriangle:Q.checkCircle,i=e?Z.footerIconDanger:Z.footerIconSuccess;o.push(H(`div`,{class:Z.footerMessage,key:`footer-message`,slot:`footer-start`},H(`calcite-icon`,{class:i,icon:r,scale:`s`,slot:`footer-start`}),t))}return o}_renderPrompt(){return this.prompt?H(E,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){let{messages:e,messagesCommon:n}=this,r=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:r,message:e.deleteRecordsRemoved,context:`danger`,actions:{primary:{label:n.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,n){let{messages:r,messagesCommon:i}=this,a=t(r.deleteAttachmentCount,{count:n.length});this.showPrompt({title:a,message:r.deleteAttachmentConfirmation,context:`danger`,actions:{primary:{label:i.delete,action:async()=>{try{await this.deleteAttachments(e,n,!1)}finally{this.clearPrompt()}}},secondary:{label:i.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){let t=Promise.withResolvers(),{messagesEditor:n}=this;return this.showPrompt({title:n.cancelEditTitle,message:n.cancelEditWarningMessage,context:`danger`,actions:{primary:{label:n.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:n.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){let{attachmentsViewOptions:e,messages:t}=this,{objectId:n}=e;return H(`calcite-dialog`,{class:Z.dialog,description:this.viewModel.getFeatureTitleSync(n),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:`cover`,width:`l`,onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){let e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){let{attachmentsViewOptions:t,messages:n}=this,{attachmentInfos:r}=t,i=r.indexOf(e);return H(U,null,H(`div`,{class:Z.dialogHeader,key:`header`,slot:`content-top`},H(`span`,null,e.name),H(`calcite-button`,{appearance:`outline`,onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},n.viewDetails)),H(`calcite-progress`,{type:this._attachmentsDialogPreviewLoading?`indeterminate`:`determinate`}),H(`div`,{class:Z.dialogContent,key:`content`},this._renderAttachmentsViewDetailsImage(e)),H(`calcite-pagination`,{pageSize:1,slot:`footer`,startItem:i+1,totalItems:r.length,onCalcitePaginationChange:e=>{let n=e.currentTarget.startItem-1,i=r[n]?.id;t.dialogId=i}}))}_onDialogClose(){let e=this.attachmentsViewOptions;e.dialogId!=null&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){let{disabled:t,hidden:n,icon:r,text:i,clickFunction:a}=e;if(!n)return H(`calcite-action`,{disabled:t??this.menuConfig?.disabled,icon:r??void 0,key:i,slot:`header-menu-actions`,text:i,textEnabled:!0,title:i,onclick:()=>a()})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];let{messages:e}=this;return[this._showRefreshDataAction&&{icon:Q.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:Q.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:Q.clearSelection,text:e.clearSelection,clickFunction:()=>this.clearSelection()},this._showZoomToSelectionAction&&{icon:Q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:Q.showSelected,text:e.showSelected,clickFunction:()=>{let{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:Q.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:Q.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(n).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:n,label:r,clickFunction:i})=>this._renderHeaderMenuAction({hidden:typeof t==`function`?t():t,icon:n,text:r,disabled:typeof e==`function`?e():e,clickFunction:e=>i(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];let{_columnVisibilityActions:e,id:t}=this,n=this.messages.menuText.columnVisibility;return H(`calcite-action`,{afterCreate:n=>e.set(t,n),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:Q.showColumn,id:`${t}__toggle-columns-action`,slot:`header-actions-end`,text:n},this._effectiveVisibleElements.tooltips?H(`calcite-tooltip`,{closeOnClick:!0,overlayPositioning:`fixed`,placement:`bottom-end`,referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},n):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;let e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return H(`calcite-popover`,{autoClose:!0,class:Z.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:`fixed`,placement:this.columnVisibilityMenuConfig?.placement,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){let{visibilityMenuColumns:e,messages:{menuText:t}}=this;if(e.length!==0)return H(`calcite-list`,{afterCreate:W,afterRemoved:G.bind(this),afterUpdate:W,bind:this,"data-node-ref":`_columnVisibilityList`,dir:this.direction,displayMode:`nested`,filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:`multiple`,onCalciteListChange:()=>this._syncColumnVisibility(),onCalciteListFilter:()=>this.scheduleRender()},this._renderColumnToggleAll(),e.map(e=>{let t=ee(e)?e.columns?.map(e=>this._renderColumnListItem({column:e})):void 0;return this._renderColumnListItem({column:e,items:t})}),H(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,slot:`filter-no-results`},H(`div`,{slot:`message`},t.noMatchesFound)))}_syncColumnVisibility(){let{effectiveTable:e,_columnVisibilityList:t}=this;if(!t)return;let n=new Set(t.selectedItems.map(e=>e.value)),r=!!this.columnVisibilityMenuConfig?.frozenColumnsExcluded;e.allColumns.forEach(t=>{r&&(t.frozen||t.frozenToEnd)||(n.has(t.fieldName)?e.showColumn(t.fieldName):e.hideColumn(t.fieldName))})}_renderColumnToggleAll(){if(!this.visibleElements.columnVisibilityMenuItems.toggleAll)return;let{_columnVisibilityList:e}=this;if(e&&e.filteredItems?.length)return H(`calcite-button`,{appearance:`transparent`,width:`full`,onclick:()=>this._toggleAllColumns()},this._getColumnToggleAllText())}_getColumnToggleAllText(){let{_columnVisibilityList:e,effectiveTable:t,messages:{menuText:n}}=this;return e?e.filterText===``?t.allColumnsVisible?n.deselectAll:n.selectAll:this._allColumnsAreVisible(e.filteredItems.map(e=>e.value))?n.deselectAll:n.selectAll:``}_renderColumnListItem(e){let{column:t,items:n}=e,{effectiveLabel:r,fieldName:i,hidden:a}=t,o=!(!n?.length||a)||void 0;return H(`calcite-list-item`,{expanded:o,key:`toggle-columns__item-${i}`,label:r,metadata:{description:t.effectiveDescription,type:A(t)?t.field.type:void 0},selected:!a,value:i},n)}_renderLayerDropdown(){let e=this.messages.selectALayer,{storeTrigger:t,destroy:n,referenceTrigger:r}=this._layerDropdownReference;return H(`div`,{class:Z.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:`header-actions-start`},H(`calcite-action`,{afterCreate:t,afterRemoved:n,afterUpdate:t,icon:Q.layers,text:e,title:e}),H(`calcite-dropdown`,{afterCreate:r,afterUpdate:r,bind:this,maxItems:5,overlayPositioning:`fixed`,placement:`bottom-start`,topLayerDisabled:this.topLayerDisabled},H(`calcite-dropdown-group`,{selectionMode:`single`},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){let n=this.visibleElements.layerDropdownIcons;return H(`calcite-dropdown-item`,{iconStart:n?z(e):void 0,key:`dropdown-item-${t}`,label:e.title??``,selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){let{autoRefreshEnabled:t,autoSaveEnabled:n,direction:r,editingEnabled:i,effectiveTable:a,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,view:l,viewModel:u,visibleElements:d}=this,{layer:f,objectId:p,relatedLayer:m,relationshipId:h}=e;await f.load();let g=this.attachmentsEnabled&&P(f),_=new K({layer:f,autoRefreshEnabled:t,autoSaveEnabled:n,attachmentsEnabled:g,direction:r,editingEnabled:i,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,relatedRecordsEnabled:!0,relationshipConfig:{objectId:p,relatedLayer:m,relationshipId:h},relationshipColumnConfigs:F(f,h),tableController:this,tableParent:a,view:l,visibleElements:d,showRelatedTableCallback:e=>u.emit(`show-related-table`,e)});this.relatedTables.add(_),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case`list`:return this._renderAttachmentsViewList();case`details`:return this._renderAttachmentsViewDetails();case`file`:return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){let e=this.attachmentsViewOptions,{objectId:t}=e;if(t!=null)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{bind:this,class:Z.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},H(`calcite-icon`,{class:Z.attachmentsViewIcon,icon:Q.upload,scale:`l`}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),H(`form`,{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:`attachments-form`},H(`fieldset`,null,this._renderAttachmentsViewFileNameNode(),H(`input`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,"data-node-ref":`_attachmentsInput`,files:e.candidates,hidden:!0,name:`attachment`,type:`file`,onchange:e=>this._onAttachmentsViewCandidateChange(e)}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if(this.attachmentsViewOptions.fileMode===`replace`)return H(`span`,{class:Z.attachmentsViewDropAreaLabel,key:`replace-file-node`},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){let e=this.attachmentsViewOptions;if(e.hasCandidates)return;let{messages:t}=this,n=this.supportsAddAttachments?e.objectId==null?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`message-node`},n)}_renderAttachmentsViewFileNameNode(){let e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`filename-node`},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return H(`calcite-button`,{appearance:`outline-fill`,disabled:this.isSyncingAttachments,iconStart:Q.folderOpen,key:`select-node`,onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){let{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:n,hasCandidates:r}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&r)return H(`calcite-button`,{appearance:`solid`,disabled:e,iconStart:Q.save,key:`save-node`,loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},n?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){let{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return H(`calcite-button`,{appearance:`transparent`,bind:this,disabled:this.isSyncingAttachments,key:`cancel-node`,onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){let{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{class:Z.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){let t=[this._renderAttachmentsViewDetailsImage(e)];if(S(e.contentType)){let n=this.messages.maximize;t.push(H(`calcite-action`,{icon:Q.expand,label:n,text:n,textEnabled:!0,title:n,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id}}))}return t}_renderAttachmentsViewDetailsImage(e){let{contentType:t,name:n,size:r,url:i}=e,{messages:a}=this;return S(t)?H(`img`,{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:n,key:`thumbnail-image-${n}`,src:`${i}${i?.includes(`?`)?`&`:`?`}s=${r}`,title:n,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1}):[H(`calcite-icon`,{icon:C(t),key:`thumbnail-icon-${n}`,scale:`l`,textLabel:n,title:n}),a.noPreviewAvailable]}_renderAttachmentsViewInformation(){let{attachmentsViewOptions:e,messages:t,messagesUnits:n}=this,{attachmentInfo:r,objectId:i}=e;if(r&&i!=null)return H(`div`,{class:Z.attachmentsViewInformation,key:`information`},this._renderAttachmentViewInformationButtons(r,i),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`file-label`},t.fileName),H(`span`,{class:Z.attachmentsViewInformationData,key:`file-value`},r.name),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`type-label`},t.attachmentType),H(`span`,{class:Z.attachmentsViewInformationData,key:`type-value`},this._getLabelForAttachmentType(r)),this._renderAttachmentKeywordDetails(r),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`size-label`},t.size),H(`span`,{class:Z.attachmentsViewInformationData,key:`size-span`},d(n,r.size??0)))}_renderAttachmentViewInformationButtons(e,t){let{attachmentsViewOptions:n,messages:r,messagesCommon:i}=this,a=n.effectiveMode!==`details`,o=e.id,s=[H(`calcite-button`,{appearance:`outline`,disabled:a,key:`download-button`,width:`full`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)}},r.download)];return this.supportsUpdateAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`replace-button`,width:`full`,onclick:()=>{n.mode=`file`,n.attachmentId=o}},r.replace)),this.supportsDeleteAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`delete-button`,width:`full`,onclick:()=>{this.deleteAttachments(t,[o],!0)}},i.delete)),s}_renderAttachmentKeywordDetails({keywords:e}){if(e&&e!==``)return[H(`span`,{class:Z.attachmentsViewInformationLabel,key:`keyword-label`},this.messages.keyword),H(`span`,{class:Z.attachmentsViewInformationData,key:`keyword-value`},e)]}_renderAttachmentsViewList(){let{attachmentsViewOptions:e,isSyncingAttachments:t,messages:n,messagesUnits:r}=this,{attachmentInfos:i,objectId:a}=e;return H(`calcite-list`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,class:Z.attachmentsViewList,"data-node-ref":`attachmentsList`,key:`attachments-list-${a}`,label:n?.attachments,loading:t,selectionMode:this.supportsDeleteAttachments?`multiple`:`none`,onCalciteListChange:()=>this.scheduleRender(),ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},...i?.map(t=>{let{id:i,name:o,size:s}=t,c=d(r,s??0);return H(`calcite-list-item`,{afterRemoved:()=>this.scheduleRender(),key:`attachment-${i}`,label:o,value:i},this._renderAttachmentsViewListPreview(t),H(`span`,{class:Z.attachmentsViewListFileSize,slot:`actions-end`,title:c},c),H(`calcite-action`,{icon:Q.downloadTo,key:`download`,label:o,slot:`actions-end`,text:n.downloadAttachment,title:n.downloadAttachment,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,i)}}),H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`details`,label:o,slot:`actions-end`,text:n.viewAttachment,title:n.viewAttachment,onclick:()=>{e.mode=`details`,e.attachmentId=i}}))}))}_renderAttachmentsViewListPreview(e){return H(`div`,{class:Z.attachmentsViewListThumbnail,slot:`content-start`},H(`span`,null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){let{contentType:n,name:r,size:i,url:a}=e,o=`${a}${a?.includes(`?`)?`&`:`?`}w=${t}&s=${i}`;return this.supportsResizeAttachments&&S(n)?H(`img`,{alt:r,key:`thumbnail-image-${r}`,src:o,title:r}):H(`calcite-icon`,{icon:C(n),key:`thumbnail-icon-${r}`,scale:`l`,textLabel:r,title:r})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode=`file`,this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value=``)}_getLabelForAttachmentType({contentType:e}){let t=this.messages,n=w(e);return t.attachmentTypes[n]}_renderNavigationBar(){let{effectiveTable:e,messages:n,messagesCommon:r,navigationScale:i,relatedTable:a,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;let{attachmentsList:s,attachmentsViewOptions:c,layer:l,supportsAddAttachments:u,supportsDeleteAttachments:d}=e;if(!l)return;let{attachmentInfos:f,objectId:p}=c,m=p!=null,h=f.length,g=s?.selectedItems?.length??0,_=`${l.objectIdField}: ${p}`,v=t(n.selectedCount,{count:g}),y=t(n.attachmentsCount,{count:h}),b=m?H(`calcite-action`,{bind:this,icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-feature`,scale:i,text:_,textEnabled:!0,title:_,onclick:()=>e.scrollToRow(p)}):void 0,x=m?H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-attachments-label`,label:y,scale:i,text:y,textEnabled:!0,title:y,onclick:()=>{h>0&&(c.mode=`list`)}}):void 0,S=m?H(`calcite-chip`,{closable:!0,closed:g===0,key:`navigation-chip`,kind:`inverse`,label:v,scale:`s`,selected:!0,title:v,value:`selected`,onCalciteChipClose:()=>s?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=a?H(`calcite-label`,{layout:`inline`,scale:i},n.showAllTables,H(`calcite-switch`,{checked:this.allRelatedTablesVisible,scale:i,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,w=m&&c.effectiveMode===`list`&&p!=null&&g&&d?H(`calcite-action`,{icon:Q.delete,iconFlipRtl:!0,key:`attachments-trash-all`,scale:i,text:r.delete,textEnabled:!0,title:t(n.deleteAttachmentCount,{count:g}),onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)}}):void 0,T=m&&c.effectiveMode===`list`&&u?H(`calcite-action`,{bind:this,icon:Q.plus,iconFlipRtl:!0,key:`attachments-add`,scale:i,text:n.addAttachment,textEnabled:!0,title:n.addAttachment,onclick:()=>{c.objectId=p,c.attachmentId=null,c.mode=`file`}}):void 0;return H(`div`,{class:Z.tableNavigation,key:`table-nav`},H(`calcite-action`,{icon:Q.moveUp,iconFlipRtl:!0,key:`go-back`,scale:i,text:this.layer?.title??``,textEnabled:!1,title:a?n.exitRelatedRecords:n.exitAttachments,onclick:()=>this._onTableViewChange(this._resetNestedViews)}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),b,x,H(`div`,null,S,C,w,T))}_renderRelatedTableNavigationAction(e,t){let n=this._getLabelForRelatedTableNavigationAction(e);return H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:t,scale:this.navigationScale,text:n,textEnabled:!0,title:e.layer?.title||``,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))}})}_getLabelForRelatedTableNavigationAction(e){let t=e.layer?.title;if(!t)return``;let{relatedTables:n}=this;return n.length<=1?t:n.indexOf(e)!==n.length-1&&t.length>20?`${t.slice(0,20)}...`:t}_allColumnsAreVisible(e){let t=this.columnVisibilityMenuConfig;return e.every(e=>{let n=this.findColumn(e);return n?t?.frozenColumnsExcluded&&(n.frozen||n.frozenToEnd)?!0:n.effectiveVisible:!1})}_toggleAllColumns(){let{_columnVisibilityList:e,effectiveTable:t}=this,n=e?.filteredItems.map(e=>e.value);e?.filterText!==``&&n?.length?this._allColumnsAreVisible(n)?n.forEach(e=>this.hideColumn(e)):n.forEach(e=>this.showColumn(e)):t.allColumnsVisible?t.visibilityMenuColumns.forEach(e=>t.hideColumn(e.fieldName)):t.visibilityMenuColumns.forEach(e=>t.showColumn(e.fieldName))}};e([f()],$.prototype,`_attachmentsDialogPreviewLoading`,void 0),e([f()],$.prototype,`_attachmentsInput`,void 0),e([f()],$.prototype,`_attachmentsViewIsVisible`,null),e([f()],$.prototype,`_columnVisibilityActions`,void 0),e([f()],$.prototype,`_columnVisibilityActionDisabled`,null),e([f()],$.prototype,`_columnVisibilityList`,void 0),e([f()],$.prototype,`_dialogIsOpen`,null),e([f()],$.prototype,`_effectiveDescription`,null),e([f()],$.prototype,`_effectiveLayers`,null),e([f()],$.prototype,`_effectiveTitle`,null),e([f()],$.prototype,`_effectiveVisibleElements`,null),e([f()],$.prototype,`_filteredTables`,null),e([f()],$.prototype,`_hasAttachmentsViewError`,null),e([f()],$.prototype,`_hasCustomMenuItems`,null),e([f()],$.prototype,`_hasDefaultMenuItems`,null),e([f()],$.prototype,`_shouldShowGrid`,null),e([f()],$.prototype,`_shouldShowMenu`,null),e([f()],$.prototype,`_showClearSelectionAction`,null),e([f()],$.prototype,`_showColumnVisibilityAction`,null),e([f()],$.prototype,`_showDeleteSelectionAction`,null),e([f()],$.prototype,`_showExportSelectionToCSVAction`,null),e([f()],$.prototype,`_showLayerDropdown`,null),e([f()],$.prototype,`_shouldShowNavigationBar`,null),e([f()],$.prototype,`_showRefreshDataAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowSelectedAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowAllAction`,null),e([f()],$.prototype,`_showZoomToSelectionAction`,null),e([f()],$.prototype,`_viewLayers`,null),e([f()],$.prototype,`attachmentsList`,void 0),e([f()],$.prototype,`direction`,null),e([f({readOnly:!0})],$.prototype,`grid`,null),e([f()],$.prototype,`actionColumn`,null),e([f()],$.prototype,`actionColumnConfig`,null),e([f({readOnly:!0})],$.prototype,`activeFilters`,null),e([f({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([f()],$.prototype,`allColumns`,null),e([f()],$.prototype,`allColumnsVisible`,null),e([f({readOnly:!0})],$.prototype,`allRelatedTablesVisible`,null),e([f()],$.prototype,`allVisibleColumns`,null),e([f()],$.prototype,`attachmentsColumns`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`attachmentsViewOptions`,null),e([f({type:y})],$.prototype,`attributeTableTemplate`,null),e([f()],$.prototype,`autoRefreshEnabled`,null),e([f()],$.prototype,`autoSaveEnabled`,null),e([f()],$.prototype,`canAddRelatedFeature`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`closed`,void 0),e([f()],$.prototype,`collapsed`,void 0),e([f()],$.prototype,`columnPerformanceModeEnabled`,null),e([f()],$.prototype,`columnReorderingEnabled`,null),e([f({readOnly:!0})],$.prototype,`columns`,null),e([f()],$.prototype,`columnVisibilityMenuConfig`,void 0),e([f()],$.prototype,`defaultSelectionManager`,null),e([f()],$.prototype,`definitionExpression`,null),e([f()],$.prototype,`description`,void 0),e([f()],$.prototype,`disabled`,void 0),e([f()],$.prototype,`editingEnabled`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`effectiveSize`,null),e([f()],$.prototype,`effectiveTable`,null),e([f()],$.prototype,`effectiveTimeExtent`,null),e([f()],$.prototype,`fieldColumns`,null),e([f({types:m})],$.prototype,`filterGeometry`,null),e([f()],$.prototype,`filterBySelectionEnabled`,null),e([f()],$.prototype,`filterByViewExtent`,null),e([f()],$.prototype,`filterByLayerScaleRange`,null),e([f()],$.prototype,`groupColumns`,null),e([f()],$.prototype,`hasContingentValues`,null),e([f()],$.prototype,`hasInvalidPendingEdits`,null),e([f()],$.prototype,`hasPendingEdits`,null),e([f()],$.prototype,`hiddenFields`,null),e([f()],$.prototype,`highlightEnabled`,null),e([f()],$.prototype,`highlightIds`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`initialSize`,null),e([f()],$.prototype,`isQueryingOrSyncing`,null),e([f()],$.prototype,`isSyncing`,null),e([f()],$.prototype,`isSyncingAttachments`,null),e([f()],$.prototype,`label`,null),e([f()],$.prototype,`layer`,null),e([f()],$.prototype,`layers`,null),e([f()],$.prototype,`layerView`,null),e([f()],$.prototype,`maxSize`,null),e([f(),B(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`messages`,null),e([f(),B(`esri/t9n/common`)],$.prototype,`messagesCommon`,null),e([f(),B(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messagesEditor`,void 0),e([f(),B(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,null),e([f(),B(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,null),e([f()],$.prototype,`menuConfig`,null),e([f()],$.prototype,`multipleSelectionEnabled`,null),e([f()],$.prototype,`multipleSelectionEnabledOverride`,null),e([f()],$.prototype,`multiSortEnabled`,null),e([f()],$.prototype,`multipleSortPriority`,null),e([f()],$.prototype,`navigationScale`,void 0),e([f()],$.prototype,`noDataMessage`,null),e([f()],$.prototype,`objectIds`,null),e([f()],$.prototype,`outFields`,null),e([f()],$.prototype,`pageCount`,null),e([f()],$.prototype,`pageIndex`,null),e([f()],$.prototype,`pageSize`,null),e([f()],$.prototype,`paginationEnabled`,null),e([f()],$.prototype,`pendingEditsCount`,null),e([f()],$.prototype,`prompt`,null),e([f()],$.prototype,`relatedRecordsEnabled`,null),e([f()],$.prototype,`relatedTable`,null),e([f()],$.prototype,`relatedTableHasContingentValues`,null),e([f()],$.prototype,`relatedTableHasInvalidPendingEdits`,null),e([f()],$.prototype,`relatedTableHasPendingEdits`,null),e([f()],$.prototype,`relatedTables`,null),e([f()],$.prototype,`relationship`,null),e([f()],$.prototype,`relationshipColumnConfigs`,null),e([f()],$.prototype,`relationshipColumns`,null),e([f()],$.prototype,`relationshipConfig`,null),e([f()],$.prototype,`relationshipInfos`,null),e([f()],$.prototype,`returnGeometryEnabled`,null),e([f()],$.prototype,`returnMEnabled`,null),e([f()],$.prototype,`returnZEnabled`,null),e([f()],$.prototype,`rowHighlightIds`,null),e([f()],$.prototype,`selectionManager`,null),e([f()],$.prototype,`selectionSource`,null),e([f()],$.prototype,`showAllRelatedTables`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`showRelatedTableCallback`,null),e([f()],$.prototype,`size`,null),e([f({readOnly:!0})],$.prototype,`state`,null),e([f()],$.prototype,`supportsAddAttachments`,null),e([f()],$.prototype,`supportsAttachments`,null),e([f()],$.prototype,`supportsDeleteAttachments`,null),e([f()],$.prototype,`supportsResizeAttachments`,null),e([f()],$.prototype,`supportsUpdateAttachments`,null),e([f()],$.prototype,`syncTemplateOnChangesEnabled`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f({constructOnly:!0})],$.prototype,`tableController`,null),e([f({constructOnly:!0})],$.prototype,`tableParent`,null),e([f({type:j})],$.prototype,`tableTemplate`,null),e([f()],$.prototype,`tableTemplateOverride`,null),e([f()],$.prototype,`title`,void 0),e([f({type:b})],$.prototype,`timeExtent`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`view`,null),e([f({type:O}),V([`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`,`show-related-table`])],$.prototype,`viewModel`,void 0),e([f()],$.prototype,`viewTimeEnabled`,null),e([f()],$.prototype,`visibleColumns`,null),e([f({type:k,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f({type:k})],$.prototype,`visibleElementsOverride`,null),e([f()],$.prototype,`visibilityMenuColumns`,null),$=K=e([p(`esri.widgets.FeatureTable`)],$);const te=$;export{te as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as n}from"../core/arrayUtils.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,sync as o,syncAndInitial as s,initial as c,on as l}from"../core/reactiveUtils.js";import{renderingSanitizer as u}from"../core/sanitizerUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as m}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as h}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as g,isMapImageLayer as _,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import b from"../time/TimeExtent.js";import x from"./Widget.js";import{isSupportedImage as S,getCalciteIconForAttachment as C,getAttachmentTypeCategory as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as T,Prompt as E}from"./Editor/components/Prompt.js";import D from"./FeatureTable/ColumnMenuVisibleElements.js";import O from"./FeatureTable/FeatureTableViewModel.js";import k from"./FeatureTable/VisibleElements.js";import{isGroupColumn as ee,isFieldColumn as A}from"./FeatureTable/support/columnUtils.js";import j from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as M,isIFeatureTableSupportedLayer as N,isIFeatureTableSupportedLayerWithAttachments as P,getRelationshipIdsToShow as F}from"./FeatureTable/support/tableUtils.js";import{createDropdownReference as I,loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import{getIconForLayer as z}from"./support/iconUtils.js";import{messageBundle as B,vmEvent as V,tsx as H,tsxFragment as U}from"./support/widget.js";import{storeNode as W,discardNode as G}from"./support/widgetUtils.js";var K;const q=`esri-feature-table`,J=`${q}__dialog`,Y=`${q}__table-navigation`,X=`${q}__attachments-view`,Z={base:q,content:`${q}__content`,menuPopover:`${q}__menu-popover`,layerDropdownMenu:`${q}__layer-switcher-menu`,tableContainer:`${q}__table-container`,tableContainerWithAttachments:`${q}__table-container--attachments`,tableNavigation:Y,attachmentsView:X,attachmentsViewContent:`${X}__content`,attachmentsViewDetails:`${X}__details`,attachmentsViewDropArea:`${X}__drop-area`,attachmentsViewDropAreaLabel:`${X}__drop-area__label`,attachmentsViewDropAreaMessage:`${X}__drop-area__message`,attachmentsViewIcon:`${X}__icon`,attachmentsViewInformation:`${X}__information`,attachmentsViewInformationData:`${X}__information__data`,attachmentsViewInformationLabel:`${X}__information__label`,attachmentsViewList:`${X}__list`,attachmentsViewListFileSize:`${X}__list__filesize`,attachmentsViewListThumbnail:`${X}__list__thumbnail`,expanded:`${q}__expanded`,collapsed:`${q}__collapsed`,dialog:`${J}`,dialogContent:`${J}__content`,dialogHeader:`${J}__header`,footerMessage:`${q}__footer__message`,footerIconDanger:`${q}__footer__icon--danger`,footerIconSuccess:`${q}__footer__icon--success`},Q={checkCircle:`check-circle`,chevronRight:`chevron-right`,clearSelection:`clear-selection`,downloadTo:`download-to`,exclamationMarkTriangle:`exclamation-mark-triangle`,expand:`expand`,exportToCSV:`file-csv`,folderOpen:`folder-open`,delete:`trash`,layers:`layers`,moveUp:`move-up`,plus:`plus`,refresh:`refresh`,reset:`reset`,save:`save`,showAll:`selection-x`,showColumn:`show-column`,showSelected:`selection-filter`,table:`table`,upload:`upload`,zoomToSelection:`zoom-to-object`};let $=K=class extends x{constructor(e){super(e),this._layerDropdownReference=I(),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this._columnVisibilityList=null,this.attachmentsList=null,this.closed=!1,this.collapsed=!1,this.columnVisibilityMenuConfig=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale=`m`,this.title=null,this.viewModel=new O,this.visibleElements=new k,this.announceDeprecation=()=>{r(i.getLogger(this),`Feature Table`,`arcgis-feature-table`,{version:`5.0`})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([a(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),a(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.allColumns.length],()=>{this.allColumns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),a(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),s),a(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},c),l(()=>this.viewModel,`show-related-table`,e=>this._onShowRelatedTable(e)),a(()=>this.editingEnabled,()=>{let{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}),l(()=>this.effectiveTable,`column-reorder`,()=>this.scheduleRender())])}loadDependencies(){return Promise.all([L({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),alert:()=>import(`@esri/calcite-components/dist/components/calcite-alert`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),pagination:()=>import(`@esri/calcite-components/dist/components/calcite-pagination`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`),popover:()=>import(`@esri/calcite-components/dist/components/calcite-popover`),progress:()=>import(`@esri/calcite-components/dist/components/calcite-progress`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)}),T(),M()])}destroy(){this._layerDropdownReference.destroy(),this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!!(this.attachmentsViewOptions.objectId!=null||this.relatedTables.some(e=>e.attachmentsViewOptions.objectId!=null))}get _columnVisibilityActionDisabled(){let e=this.effectiveTable;return e.menuConfig?.disabled??e.columns.length===0}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){let{description:e}=this;return e==null?void 0:u.sanitize(typeof e==`function`?e():e)}get _effectiveLayers(){let{layer:e,layers:t}=this,n=t?.length?t.filter(N):[],r=n.length?n:[...this._viewLayers];return e&&!r.includes(e)&&r.push(e),r}get _effectiveTitle(){let{layer:e,messages:n,state:r,highlightIds:i,title:a,size:o}=this;if(a)return u.sanitize(typeof a==`function`?a():a);if(!n)return``;if(!e)return n.noLayer;switch(r){case`disabled`:return n.errorLayer;case`ready`:case`loading`:return n.loading;case`error`:return n.errorData}return t(n.header,{title:u.sanitize(e.title),count:o,selected:i.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){let e=this.relatedTables.toArray(),t=e.length===1;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return this.attachmentsViewOptions.error!=null}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||this.relatedTables.length===1&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){let{header:e,menu:t}=this._effectiveVisibleElements;return!!(e&&t&&(this._hasDefaultMenuItems||this._hasCustomMenuItems))}get _showClearSelectionAction(){return!!(this.effectiveTable.highlightIds.length&&this._effectiveVisibleElements.menuItems?.clearSelection&&!this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){let{columnVisibilityMenu:e,header:t,menu:n,menuItems:r}=this._effectiveVisibleElements;return!(!t||!n||!e||r?.toggleColumns===!1||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete&&!this.relatedTables.length&&!this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length&&!this.relatedTables.length)}get _showLayerDropdown(){return!!(this._effectiveLayers.length&&this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){let e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){let e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!!(this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle&&this.objectIds.length&&!this.relatedTables.length)}get _showZoomToSelectionAction(){let e=this.effectiveTable;return!!(e.view&&e.highlightIds.length&&!e.layer?.isTable&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){let e=this.view?.map;if(!e)return[];let t=new Set,n=e=>{N(e)&&!v(e)&&!t.has(e)&&(e.type!==`sublayer`||e.capabilities?.operations?.supportsQuery)&&(e.load().catch(()=>{}),t.add(e))},r=e=>{h(e)||e.type===`catalog-footprint`||(g(e)?(e.load().catch(()=>{}),e.layers?.forEach(n),e.tables?.forEach(n)):_(e)?(e.loadAll().catch(()=>{}),e.allSublayers?.forEach(n),e.subtables?.forEach(n)):v(e)?(e.loadAll().catch(()=>{}),e.sublayers?.forEach(n)):n(e))};return e.allLayers.forEach(r),e.allTables.forEach(r),[...t.values()]}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allColumnsVisible(){return this.viewModel.allColumnsVisible}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get defaultSelectionManager(){return this.viewModel.defaultSelectionManager}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get effectiveTimeExtent(){return this.viewModel.effectiveTimeExtent}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get filterByLayerScaleRange(){return this.viewModel.filterByLayerScaleRange}set filterByLayerScaleRange(e){this.viewModel.filterByLayerScaleRange=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return Q.table}set icon(e){this._overrideIfSome(`icon`,e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewTimeEnabled(){return this.viewModel.viewTimeEnabled}set viewTimeEnabled(e){this.viewModel.viewTimeEnabled=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){let{attachmentsViewOptions:e,relatedTable:t,tableController:n,visibleElements:r}=this,{columnDescriptions:i,columnMenus:a,tooltips:o}=r,s=e.objectId!=null;if(t)return new k({columnDescriptions:i,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,columnMenus:!0,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})});if(n){let e=n.relatedTable===this,t=n.allRelatedTablesVisible,c=e&&r.selectionColumn&&!t&&!s,l=e&&!t&&!s;return new k({columnDescriptions:i,tooltips:o,selectionColumn:c,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenus:a||!e,columnMenuItems:new D({sortAscending:l,sortDescending:l})})}return s?new k({columnDescriptions:i,columnMenus:a,tooltips:o,close:r.close,header:r.header,layerDropdown:r.layerDropdown,layerDropdownIcons:r.layerDropdownIcons,menu:r.menu,menuItems:r.menuItems,progress:r.progress,selectionColumn:!1,columnMenuItems:new D({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}clearSelection(){this.effectiveTable.viewModel.clearSelection()}async deleteAttachments(e,t,n){e!=null&&t?.length&&(n?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideAllColumns(){this.viewModel.hideAllColumns()}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}get visibilityMenuColumns(){let e=this.effectiveTable.columns;return this.columnVisibilityMenuConfig?.frozenColumnsExcluded?e.filter(e=>!e.frozen&&!e.frozenToEnd).toArray():e.toArray()}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){let{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:n,state:r}=this;return H(`div`,{bind:this,class:this.classes(Z.base,R.widget)},H(`calcite-panel`,{bind:this,class:Z.content,closable:e.close,closed:this.closed,collapsed:this.collapsed,collapsible:e.collapse,description:this._effectiveDescription,dir:this.direction,disabled:this.disabled||r===`disabled`&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:`table-content`,loading:r===`loading`,menuOpen:!!n?.open,overlayPositioning:`fixed`,onCalcitePanelClose:()=>{this.closed=!0,this.emit(`close`)},onCalcitePanelToggle:e=>{this.collapsed=e.target.collapsed,this.emit(`toggle`)}},e.progress?H(`calcite-progress`,{type:t?`indeterminate`:`determinate`}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){let{grid:e,relatedTables:t}=this,n=this.classes(Z.tableContainer);if(t.length){let r=this.classes(Z.base,this.allRelatedTablesVisible?Z.expanded:Z.collapsed,this._attachmentsViewIsVisible?Z.tableContainerWithAttachments:void 0);return H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[this._shouldShowGrid?H(`div`,{class:r},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{let n=t.indexOf(e);return H(`div`,{class:r,key:`related-${n}`},e.render())}),,])))}return this.attachmentsViewOptions.objectId==null?[H(`div`,{class:n},e?.render()),this._renderPagination()]:H(`div`,{class:n},H(`calcite-panel`,{overlayPositioning:`fixed`},H(`div`,null,[H(`div`,{class:this.classes(Z.base,Z.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()])))}_renderPagination(){if(this.paginationEnabled)return H(`calcite-pagination`,{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){let{messages:e}=this;return H(`calcite-alert`,{autoClose:!0,autoCloseDuration:`fast`,icon:Q.exclamationMarkTriangle,kind:`danger`,label:e.errorOccured,open:this._hasAttachmentsViewError,slot:`alerts`,topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},H(`span`,{slot:`message`},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;let{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:n,messagesCommon:r}=this,i=e||t,a=this.hasContingentValues,o=[H(`calcite-button`,{appearance:`outline`,disabled:t,iconStart:Q.reset,key:`footer-reset-button`,slot:`footer-end`,width:`auto`,onclick:()=>void this.discardPendingEdits()},r.reset),H(`calcite-button`,{disabled:i,iconStart:Q.save,key:`footer-save-button`,loading:this.isSyncing,slot:`footer-end`,width:`auto`,onclick:()=>{this.savePendingEdits()}},r.save)];if(a){let t=e?n.contingentValues.hasInvalidValues:n.contingentValues.hasValidValues,r=e?Q.exclamationMarkTriangle:Q.checkCircle,i=e?Z.footerIconDanger:Z.footerIconSuccess;o.push(H(`div`,{class:Z.footerMessage,key:`footer-message`,slot:`footer-start`},H(`calcite-icon`,{class:i,icon:r,scale:`s`,slot:`footer-start`}),t))}return o}_renderPrompt(){return this.prompt?H(E,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){let{messages:e,messagesCommon:n}=this,r=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:r,message:e.deleteRecordsRemoved,context:`danger`,actions:{primary:{label:n.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,n){let{messages:r,messagesCommon:i}=this,a=t(r.deleteAttachmentCount,{count:n.length});this.showPrompt({title:a,message:r.deleteAttachmentConfirmation,context:`danger`,actions:{primary:{label:i.delete,action:async()=>{try{await this.deleteAttachments(e,n,!1)}finally{this.clearPrompt()}}},secondary:{label:i.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){let t=Promise.withResolvers(),{messagesEditor:n}=this;return this.showPrompt({title:n.cancelEditTitle,message:n.cancelEditWarningMessage,context:`danger`,actions:{primary:{label:n.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:n.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){let{attachmentsViewOptions:e,messages:t}=this,{objectId:n}=e;return H(`calcite-dialog`,{class:Z.dialog,description:this.viewModel.getFeatureTitleSync(n),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:`cover`,width:`l`,onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){let e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){let{attachmentsViewOptions:t,messages:n}=this,{attachmentInfos:r}=t,i=r.indexOf(e);return H(U,null,H(`div`,{class:Z.dialogHeader,key:`header`,slot:`content-top`},H(`span`,null,e.name),H(`calcite-button`,{appearance:`outline`,onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},n.viewDetails)),H(`calcite-progress`,{type:this._attachmentsDialogPreviewLoading?`indeterminate`:`determinate`}),H(`div`,{class:Z.dialogContent,key:`content`},this._renderAttachmentsViewDetailsImage(e)),H(`calcite-pagination`,{pageSize:1,slot:`footer`,startItem:i+1,totalItems:r.length,onCalcitePaginationChange:e=>{let n=e.currentTarget.startItem-1,i=r[n]?.id;t.dialogId=i}}))}_onDialogClose(){let e=this.attachmentsViewOptions;e.dialogId!=null&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){let{disabled:t,hidden:n,icon:r,text:i,clickFunction:a}=e;if(!n)return H(`calcite-action`,{disabled:t??this.menuConfig?.disabled,icon:r??void 0,key:i,slot:`header-menu-actions`,text:i,textEnabled:!0,title:i,onclick:()=>a()})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];let{messages:e}=this;return[this._showRefreshDataAction&&{icon:Q.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:Q.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:Q.clearSelection,text:e.clearSelection,clickFunction:()=>this.clearSelection()},this._showZoomToSelectionAction&&{icon:Q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:Q.showSelected,text:e.showSelected,clickFunction:()=>{let{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:Q.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:Q.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(n).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:n,label:r,clickFunction:i})=>this._renderHeaderMenuAction({hidden:typeof t==`function`?t():t,icon:n,text:r,disabled:typeof e==`function`?e():e,clickFunction:e=>i(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];let{_columnVisibilityActions:e,id:t}=this,n=this.messages.menuText.columnVisibility;return H(`calcite-action`,{afterCreate:n=>e.set(t,n),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:Q.showColumn,id:`${t}__toggle-columns-action`,slot:`header-actions-end`,text:n},this._effectiveVisibleElements.tooltips?H(`calcite-tooltip`,{closeOnClick:!0,overlayPositioning:`fixed`,placement:`bottom-end`,referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},n):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;let e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return H(`calcite-popover`,{autoClose:!0,class:Z.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:`fixed`,placement:this.columnVisibilityMenuConfig?.placement,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){let{visibilityMenuColumns:e,messages:{menuText:t}}=this;if(e.length!==0)return H(`calcite-list`,{afterCreate:W,afterRemoved:G.bind(this),afterUpdate:W,bind:this,"data-node-ref":`_columnVisibilityList`,dir:this.direction,displayMode:`nested`,filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:`multiple`,onCalciteListChange:()=>this._syncColumnVisibility(),onCalciteListFilter:()=>this.scheduleRender()},this._renderColumnToggleAll(),e.map(e=>{let t=ee(e)?e.columns?.map(e=>this._renderColumnListItem({column:e})):void 0;return this._renderColumnListItem({column:e,items:t})}),H(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,slot:`filter-no-results`},H(`div`,{slot:`message`},t.noMatchesFound)))}_syncColumnVisibility(){let{effectiveTable:e,_columnVisibilityList:t}=this;if(!t)return;let n=new Set(t.selectedItems.map(e=>e.value)),r=!!this.columnVisibilityMenuConfig?.frozenColumnsExcluded;e.allColumns.forEach(t=>{r&&(t.frozen||t.frozenToEnd)||(n.has(t.fieldName)?e.showColumn(t.fieldName):e.hideColumn(t.fieldName))})}_renderColumnToggleAll(){if(!this.visibleElements.columnVisibilityMenuItems.toggleAll)return;let{_columnVisibilityList:e}=this;if(e&&e.filteredItems?.length)return H(`calcite-button`,{appearance:`transparent`,width:`full`,onclick:()=>this._toggleAllColumns()},this._getColumnToggleAllText())}_getColumnToggleAllText(){let{_columnVisibilityList:e,effectiveTable:t,messages:{menuText:n}}=this;return e?e.filterText===``?t.allColumnsVisible?n.deselectAll:n.selectAll:this._allColumnsAreVisible(e.filteredItems.map(e=>e.value))?n.deselectAll:n.selectAll:``}_renderColumnListItem(e){let{column:t,items:n}=e,{effectiveLabel:r,fieldName:i,hidden:a}=t,o=!(!n?.length||a)||void 0;return H(`calcite-list-item`,{expanded:o,key:`toggle-columns__item-${i}`,label:r,metadata:{description:t.effectiveDescription,type:A(t)?t.field.type:void 0},selected:!a,value:i},n)}_renderLayerDropdown(){let e=this.messages.selectALayer,{storeTrigger:t,destroy:n,referenceTrigger:r}=this._layerDropdownReference;return H(`div`,{class:Z.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:`header-actions-start`},H(`calcite-action`,{afterCreate:t,afterRemoved:n,afterUpdate:t,icon:Q.layers,text:e,title:e}),H(`calcite-dropdown`,{afterCreate:r,afterUpdate:r,bind:this,maxItems:5,overlayPositioning:`fixed`,placement:`bottom-start`,topLayerDisabled:this.topLayerDisabled},H(`calcite-dropdown-group`,{selectionMode:`single`},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){let n=this.visibleElements.layerDropdownIcons;return H(`calcite-dropdown-item`,{iconStart:n?z(e):void 0,key:`dropdown-item-${t}`,label:e.title??``,selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){let{autoRefreshEnabled:t,autoSaveEnabled:n,direction:r,editingEnabled:i,effectiveTable:a,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,view:l,viewModel:u,visibleElements:d}=this,{layer:f,objectId:p,relatedLayer:m,relationshipId:h}=e;await f.load();let g=this.attachmentsEnabled&&P(f),_=new K({layer:f,autoRefreshEnabled:t,autoSaveEnabled:n,attachmentsEnabled:g,direction:r,editingEnabled:i,multipleSelectionEnabled:o,paginationEnabled:s,pageSize:c,relatedRecordsEnabled:!0,relationshipConfig:{objectId:p,relatedLayer:m,relationshipId:h},relationshipColumnConfigs:F(f,h),tableController:this,tableParent:a,view:l,visibleElements:d,showRelatedTableCallback:e=>u.emit(`show-related-table`,e)});this.relatedTables.add(_),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case`list`:return this._renderAttachmentsViewList();case`details`:return this._renderAttachmentsViewDetails();case`file`:return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){let e=this.attachmentsViewOptions,{objectId:t}=e;if(t!=null)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{bind:this,class:Z.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},H(`calcite-icon`,{class:Z.attachmentsViewIcon,icon:Q.upload,scale:`l`}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),H(`form`,{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:`attachments-form`},H(`fieldset`,null,this._renderAttachmentsViewFileNameNode(),H(`input`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,"data-node-ref":`_attachmentsInput`,files:e.candidates,hidden:!0,name:`attachment`,type:`file`,onchange:e=>this._onAttachmentsViewCandidateChange(e)}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if(this.attachmentsViewOptions.fileMode===`replace`)return H(`span`,{class:Z.attachmentsViewDropAreaLabel,key:`replace-file-node`},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){let e=this.attachmentsViewOptions;if(e.hasCandidates)return;let{messages:t}=this,n=this.supportsAddAttachments?e.objectId==null?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`message-node`},n)}_renderAttachmentsViewFileNameNode(){let e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return H(`span`,{class:Z.attachmentsViewDropAreaMessage,key:`filename-node`},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return H(`calcite-button`,{appearance:`outline-fill`,disabled:this.isSyncingAttachments,iconStart:Q.folderOpen,key:`select-node`,onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){let{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:n,hasCandidates:r}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&r)return H(`calcite-button`,{appearance:`solid`,disabled:e,iconStart:Q.save,key:`save-node`,loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},n?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){let{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return H(`calcite-button`,{appearance:`transparent`,bind:this,disabled:this.isSyncingAttachments,key:`cancel-node`,onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){let{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[H(`div`,{class:Z.attachmentsView,key:`attachments-view`},this._renderAttachmentsViewInformation(),H(`div`,{class:Z.attachmentsViewContent,key:`attachments-view-content`},H(`div`,{class:Z.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){let t=[this._renderAttachmentsViewDetailsImage(e)];if(S(e.contentType)){let n=this.messages.maximize;t.push(H(`calcite-action`,{icon:Q.expand,label:n,text:n,textEnabled:!0,title:n,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id}}))}return t}_renderAttachmentsViewDetailsImage(e){let{contentType:t,name:n,size:r,url:i}=e,{messages:a}=this;return S(t)?H(`img`,{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:n,key:`thumbnail-image-${n}`,src:`${i}${i?.includes(`?`)?`&`:`?`}s=${r}`,title:n,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1}):[H(`calcite-icon`,{icon:C(t),key:`thumbnail-icon-${n}`,scale:`l`,textLabel:n,title:n}),a.noPreviewAvailable]}_renderAttachmentsViewInformation(){let{attachmentsViewOptions:e,messages:t,messagesUnits:n}=this,{attachmentInfo:r,objectId:i}=e;if(r&&i!=null)return H(`div`,{class:Z.attachmentsViewInformation,key:`information`},this._renderAttachmentViewInformationButtons(r,i),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`file-label`},t.fileName),H(`span`,{class:Z.attachmentsViewInformationData,key:`file-value`},r.name),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`type-label`},t.attachmentType),H(`span`,{class:Z.attachmentsViewInformationData,key:`type-value`},this._getLabelForAttachmentType(r)),this._renderAttachmentKeywordDetails(r),H(`span`,{class:Z.attachmentsViewInformationLabel,key:`size-label`},t.size),H(`span`,{class:Z.attachmentsViewInformationData,key:`size-span`},d(n,r.size??0)))}_renderAttachmentViewInformationButtons(e,t){let{attachmentsViewOptions:n,messages:r,messagesCommon:i}=this,a=n.effectiveMode!==`details`,o=e.id,s=[H(`calcite-button`,{appearance:`outline`,disabled:a,key:`download-button`,width:`full`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)}},r.download)];return this.supportsUpdateAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`replace-button`,width:`full`,onclick:()=>{n.mode=`file`,n.attachmentId=o}},r.replace)),this.supportsDeleteAttachments&&s.push(H(`calcite-button`,{appearance:`outline`,disabled:a,key:`delete-button`,width:`full`,onclick:()=>{this.deleteAttachments(t,[o],!0)}},i.delete)),s}_renderAttachmentKeywordDetails({keywords:e}){if(e&&e!==``)return[H(`span`,{class:Z.attachmentsViewInformationLabel,key:`keyword-label`},this.messages.keyword),H(`span`,{class:Z.attachmentsViewInformationData,key:`keyword-value`},e)]}_renderAttachmentsViewList(){let{attachmentsViewOptions:e,isSyncingAttachments:t,messages:n,messagesUnits:r}=this,{attachmentInfos:i,objectId:a}=e;return H(`calcite-list`,{afterCreate:W,afterRemoved:G,afterUpdate:W,bind:this,class:Z.attachmentsViewList,"data-node-ref":`attachmentsList`,key:`attachments-list-${a}`,label:n?.attachments,loading:t,selectionMode:this.supportsDeleteAttachments?`multiple`:`none`,onCalciteListChange:()=>this.scheduleRender(),ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},...i?.map(t=>{let{id:i,name:o,size:s}=t,c=d(r,s??0);return H(`calcite-list-item`,{afterRemoved:()=>this.scheduleRender(),key:`attachment-${i}`,label:o,value:i},this._renderAttachmentsViewListPreview(t),H(`span`,{class:Z.attachmentsViewListFileSize,slot:`actions-end`,title:c},c),H(`calcite-action`,{icon:Q.downloadTo,key:`download`,label:o,slot:`actions-end`,text:n.downloadAttachment,title:n.downloadAttachment,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,i)}}),H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`details`,label:o,slot:`actions-end`,text:n.viewAttachment,title:n.viewAttachment,onclick:()=>{e.mode=`details`,e.attachmentId=i}}))}))}_renderAttachmentsViewListPreview(e){return H(`div`,{class:Z.attachmentsViewListThumbnail,slot:`content-start`},H(`span`,null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){let{contentType:n,name:r,size:i,url:a}=e,o=`${a}${a?.includes(`?`)?`&`:`?`}w=${t}&s=${i}`;return this.supportsResizeAttachments&&S(n)?H(`img`,{alt:r,key:`thumbnail-image-${r}`,src:o,title:r}):H(`calcite-icon`,{icon:C(n),key:`thumbnail-icon-${r}`,scale:`l`,textLabel:r,title:r})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode=`file`,this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value=``)}_getLabelForAttachmentType({contentType:e}){let t=this.messages,n=w(e);return t.attachmentTypes[n]}_renderNavigationBar(){let{effectiveTable:e,messages:n,messagesCommon:r,navigationScale:i,relatedTable:a,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;let{attachmentsList:s,attachmentsViewOptions:c,layer:l,supportsAddAttachments:u,supportsDeleteAttachments:d}=e;if(!l)return;let{attachmentInfos:f,objectId:p}=c,m=p!=null,h=f.length,g=s?.selectedItems?.length??0,_=`${l.objectIdField}: ${p}`,v=t(n.selectedCount,{count:g}),y=t(n.attachmentsCount,{count:h}),b=m?H(`calcite-action`,{bind:this,icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-feature`,scale:i,text:_,textEnabled:!0,title:_,onclick:()=>e.scrollToRow(p)}):void 0,x=m?H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:`navigation-attachments-label`,label:y,scale:i,text:y,textEnabled:!0,title:y,onclick:()=>{h>0&&(c.mode=`list`)}}):void 0,S=m?H(`calcite-chip`,{closable:!0,closed:g===0,key:`navigation-chip`,kind:`inverse`,label:v,scale:`s`,selected:!0,title:v,value:`selected`,onCalciteChipClose:()=>s?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=a?H(`calcite-label`,{layout:`inline`,scale:i},n.showAllTables,H(`calcite-switch`,{checked:this.allRelatedTablesVisible,scale:i,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,w=m&&c.effectiveMode===`list`&&p!=null&&g&&d?H(`calcite-action`,{icon:Q.delete,iconFlipRtl:!0,key:`attachments-trash-all`,scale:i,text:r.delete,textEnabled:!0,title:t(n.deleteAttachmentCount,{count:g}),onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)}}):void 0,T=m&&c.effectiveMode===`list`&&u?H(`calcite-action`,{bind:this,icon:Q.plus,iconFlipRtl:!0,key:`attachments-add`,scale:i,text:n.addAttachment,textEnabled:!0,title:n.addAttachment,onclick:()=>{c.objectId=p,c.attachmentId=null,c.mode=`file`}}):void 0;return H(`div`,{class:Z.tableNavigation,key:`table-nav`},H(`calcite-action`,{icon:Q.moveUp,iconFlipRtl:!0,key:`go-back`,scale:i,text:this.layer?.title??``,textEnabled:!1,title:a?n.exitRelatedRecords:n.exitAttachments,onclick:()=>this._onTableViewChange(this._resetNestedViews)}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),b,x,H(`div`,null,S,C,w,T))}_renderRelatedTableNavigationAction(e,t){let n=this._getLabelForRelatedTableNavigationAction(e);return H(`calcite-action`,{icon:Q.chevronRight,iconFlipRtl:!0,key:t,scale:this.navigationScale,text:n,textEnabled:!0,title:e.layer?.title||``,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))}})}_getLabelForRelatedTableNavigationAction(e){let t=e.layer?.title;if(!t)return``;let{relatedTables:n}=this;return n.length<=1?t:n.indexOf(e)!==n.length-1&&t.length>20?`${t.slice(0,20)}...`:t}_allColumnsAreVisible(e){let t=this.columnVisibilityMenuConfig;return e.every(e=>{let n=this.findColumn(e);return n?t?.frozenColumnsExcluded&&(n.frozen||n.frozenToEnd)?!0:n.effectiveVisible:!1})}_toggleAllColumns(){let{_columnVisibilityList:e,effectiveTable:t}=this,n=e?.filteredItems.map(e=>e.value);e?.filterText!==``&&n?.length?this._allColumnsAreVisible(n)?n.forEach(e=>this.hideColumn(e)):n.forEach(e=>this.showColumn(e)):t.allColumnsVisible?t.visibilityMenuColumns.forEach(e=>t.hideColumn(e.fieldName)):t.visibilityMenuColumns.forEach(e=>t.showColumn(e.fieldName))}};e([f()],$.prototype,`_attachmentsDialogPreviewLoading`,void 0),e([f()],$.prototype,`_attachmentsInput`,void 0),e([f()],$.prototype,`_attachmentsViewIsVisible`,null),e([f()],$.prototype,`_columnVisibilityActions`,void 0),e([f()],$.prototype,`_columnVisibilityActionDisabled`,null),e([f()],$.prototype,`_columnVisibilityList`,void 0),e([f()],$.prototype,`_dialogIsOpen`,null),e([f()],$.prototype,`_effectiveDescription`,null),e([f()],$.prototype,`_effectiveLayers`,null),e([f()],$.prototype,`_effectiveTitle`,null),e([f()],$.prototype,`_effectiveVisibleElements`,null),e([f()],$.prototype,`_filteredTables`,null),e([f()],$.prototype,`_hasAttachmentsViewError`,null),e([f()],$.prototype,`_hasCustomMenuItems`,null),e([f()],$.prototype,`_hasDefaultMenuItems`,null),e([f()],$.prototype,`_shouldShowGrid`,null),e([f()],$.prototype,`_shouldShowMenu`,null),e([f()],$.prototype,`_showClearSelectionAction`,null),e([f()],$.prototype,`_showColumnVisibilityAction`,null),e([f()],$.prototype,`_showDeleteSelectionAction`,null),e([f()],$.prototype,`_showExportSelectionToCSVAction`,null),e([f()],$.prototype,`_showLayerDropdown`,null),e([f()],$.prototype,`_shouldShowNavigationBar`,null),e([f()],$.prototype,`_showRefreshDataAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowSelectedAction`,null),e([f()],$.prototype,`_showSelectedRecordsShowAllAction`,null),e([f()],$.prototype,`_showZoomToSelectionAction`,null),e([f()],$.prototype,`_viewLayers`,null),e([f()],$.prototype,`attachmentsList`,void 0),e([f()],$.prototype,`direction`,null),e([f({readOnly:!0})],$.prototype,`grid`,null),e([f()],$.prototype,`actionColumn`,null),e([f()],$.prototype,`actionColumnConfig`,null),e([f({readOnly:!0})],$.prototype,`activeFilters`,null),e([f({readOnly:!0})],$.prototype,`activeSortOrders`,null),e([f()],$.prototype,`allColumns`,null),e([f()],$.prototype,`allColumnsVisible`,null),e([f({readOnly:!0})],$.prototype,`allRelatedTablesVisible`,null),e([f()],$.prototype,`allVisibleColumns`,null),e([f()],$.prototype,`attachmentsColumns`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`attachmentsViewOptions`,null),e([f({type:y})],$.prototype,`attributeTableTemplate`,null),e([f()],$.prototype,`autoRefreshEnabled`,null),e([f()],$.prototype,`autoSaveEnabled`,null),e([f()],$.prototype,`canAddRelatedFeature`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`closed`,void 0),e([f()],$.prototype,`collapsed`,void 0),e([f()],$.prototype,`columnPerformanceModeEnabled`,null),e([f()],$.prototype,`columnReorderingEnabled`,null),e([f({readOnly:!0})],$.prototype,`columns`,null),e([f()],$.prototype,`columnVisibilityMenuConfig`,void 0),e([f()],$.prototype,`defaultSelectionManager`,null),e([f()],$.prototype,`definitionExpression`,null),e([f()],$.prototype,`description`,void 0),e([f()],$.prototype,`disabled`,void 0),e([f()],$.prototype,`editingEnabled`,null),e([f()],$.prototype,`effectiveSelectionManager`,null),e([f()],$.prototype,`effectiveSize`,null),e([f()],$.prototype,`effectiveTable`,null),e([f()],$.prototype,`effectiveTimeExtent`,null),e([f()],$.prototype,`fieldColumns`,null),e([f({types:m})],$.prototype,`filterGeometry`,null),e([f()],$.prototype,`filterBySelectionEnabled`,null),e([f()],$.prototype,`filterByViewExtent`,null),e([f()],$.prototype,`filterByLayerScaleRange`,null),e([f()],$.prototype,`groupColumns`,null),e([f()],$.prototype,`hasContingentValues`,null),e([f()],$.prototype,`hasInvalidPendingEdits`,null),e([f()],$.prototype,`hasPendingEdits`,null),e([f()],$.prototype,`hiddenFields`,null),e([f()],$.prototype,`highlightEnabled`,null),e([f()],$.prototype,`highlightIds`,null),e([f()],$.prototype,`icon`,null),e([f()],$.prototype,`initialSize`,null),e([f()],$.prototype,`isQueryingOrSyncing`,null),e([f()],$.prototype,`isSyncing`,null),e([f()],$.prototype,`isSyncingAttachments`,null),e([f()],$.prototype,`label`,null),e([f()],$.prototype,`layer`,null),e([f()],$.prototype,`layers`,null),e([f()],$.prototype,`layerView`,null),e([f()],$.prototype,`maxSize`,null),e([f(),B(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`messages`,null),e([f(),B(`esri/t9n/common`)],$.prototype,`messagesCommon`,null),e([f(),B(`esri/widgets/Editor/t9n/Editor`)],$.prototype,`messagesEditor`,void 0),e([f(),B(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,null),e([f(),B(`esri/widgets/support/t9n/uriUtils`)],$.prototype,`messagesURIUtils`,null),e([f()],$.prototype,`menuConfig`,null),e([f()],$.prototype,`multipleSelectionEnabled`,null),e([f()],$.prototype,`multipleSelectionEnabledOverride`,null),e([f()],$.prototype,`multiSortEnabled`,null),e([f()],$.prototype,`multipleSortPriority`,null),e([f()],$.prototype,`navigationScale`,void 0),e([f()],$.prototype,`noDataMessage`,null),e([f()],$.prototype,`objectIds`,null),e([f()],$.prototype,`outFields`,null),e([f()],$.prototype,`pageCount`,null),e([f()],$.prototype,`pageIndex`,null),e([f()],$.prototype,`pageSize`,null),e([f()],$.prototype,`paginationEnabled`,null),e([f()],$.prototype,`pendingEditsCount`,null),e([f()],$.prototype,`prompt`,null),e([f()],$.prototype,`relatedRecordsEnabled`,null),e([f()],$.prototype,`relatedTable`,null),e([f()],$.prototype,`relatedTableHasContingentValues`,null),e([f()],$.prototype,`relatedTableHasInvalidPendingEdits`,null),e([f()],$.prototype,`relatedTableHasPendingEdits`,null),e([f()],$.prototype,`relatedTables`,null),e([f()],$.prototype,`relationship`,null),e([f()],$.prototype,`relationshipColumnConfigs`,null),e([f()],$.prototype,`relationshipColumns`,null),e([f()],$.prototype,`relationshipConfig`,null),e([f()],$.prototype,`relationshipInfos`,null),e([f()],$.prototype,`returnGeometryEnabled`,null),e([f()],$.prototype,`returnMEnabled`,null),e([f()],$.prototype,`returnZEnabled`,null),e([f()],$.prototype,`rowHighlightIds`,null),e([f()],$.prototype,`selectionManager`,null),e([f()],$.prototype,`selectionSource`,null),e([f()],$.prototype,`showAllRelatedTables`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`showRelatedTableCallback`,null),e([f()],$.prototype,`size`,null),e([f({readOnly:!0})],$.prototype,`state`,null),e([f()],$.prototype,`supportsAddAttachments`,null),e([f()],$.prototype,`supportsAttachments`,null),e([f()],$.prototype,`supportsDeleteAttachments`,null),e([f()],$.prototype,`supportsResizeAttachments`,null),e([f()],$.prototype,`supportsUpdateAttachments`,null),e([f()],$.prototype,`syncTemplateOnChangesEnabled`,null),e([f()],$.prototype,`syncViewSelection`,null),e([f()],$.prototype,`syncWithViewSelectionManager`,null),e([f({constructOnly:!0})],$.prototype,`tableController`,null),e([f({constructOnly:!0})],$.prototype,`tableParent`,null),e([f({type:j})],$.prototype,`tableTemplate`,null),e([f()],$.prototype,`tableTemplateOverride`,null),e([f()],$.prototype,`title`,void 0),e([f({type:b})],$.prototype,`timeExtent`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`view`,null),e([f({type:O}),V([`cell-click`,`cell-dblclick`,`cell-pointerover`,`cell-pointerout`,`cell-keydown`,`column-reorder`,`show-related-table`])],$.prototype,`viewModel`,void 0),e([f()],$.prototype,`viewTimeEnabled`,null),e([f()],$.prototype,`visibleColumns`,null),e([f({type:k,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f({type:k})],$.prototype,`visibleElementsOverride`,null),e([f()],$.prototype,`visibilityMenuColumns`,null),$=K=e([p(`esri.widgets.FeatureTable`)],$);const te=$;export{te as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import{isTable as c}from"../layers/support/layerUtils.js";import l from"./Widget.js";import{nullGroupBy as u,isTemplateItemGroup as d}from"./FeatureTemplates/featureTemplatesUtils.js";import f from"./FeatureTemplates/FeatureTemplatesViewModel.js";import p from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as h}from"./support/globalCss.js";import{ItemList as g}from"./support/ItemList.js";import{fetchThumbnail as _}from"./support/symbolPreviewUtils.js";import{messageBundle as v,vmEvent as y,tsx as b}from"./support/widget.js";const x={base:`esri-feature-templates`};function S(e){return e.length>0&&d(e[0])}function C(e){return e.id}let w=class extends l{constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{watch as i,initial as a}from"../core/reactiveUtils.js";import{property as o,subclass as s}from"../core/accessorSupport/decorators.js";import{isTable as c}from"../layers/support/layerUtils.js";import l from"./Widget.js";import{nullGroupBy as u,isTemplateItemGroup as d}from"./FeatureTemplates/featureTemplatesUtils.js";import f from"./FeatureTemplates/FeatureTemplatesViewModel.js";import p from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as h}from"./support/globalCss.js";import{ItemList as g}from"./support/ItemList.js";import{fetchThumbnail as _}from"./support/symbolPreviewUtils.js";import{messageBundle as v,vmEvent as y,tsx as b}from"./support/widget.js";const x={base:`esri-feature-templates`};function S(e){return e.length>0&&d(e[0])}function C(e){return e.id}let w=class extends l{constructor(e){super(e),this.enableListScroll=!0,this.filterText=``,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.selectionMode=`none`,this.viewModel=new f,this.visibleElements=new p,this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver((e,n)=>{e.forEach(async e=>{if(e.isIntersecting){let r=e.target;if(E(r)){n.unobserve(r);return}let i=T(r),{layer:a,template:o}=i;D(r,!0);let s=i.label?t(this.messagesLegend.previewTemplateAriaLabel,{label:i.label}):this.messagesCommon.preview,c=await _(o,a,{ariaLabel:s}).catch(()=>(D(r,!1),null));if(c==null)return;r.appendChild(c)}})}),this._renderItemIcon=e=>c(e.layer)?b(`span`,{"data-has-icon":!0,"data-item":e,key:`icon`},b(`calcite-icon`,{icon:`table`})):b(`span`,{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:`icon`}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{n(r.getLogger(this),`Feature Templates`,`arcgis-feature-templates-legacy`,{version:`5.0`})})}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){let e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(i(()=>this.viewModel,(t,n)=>{t&&!t.filterFunction&&(this.filterFunction=e),n&&n!==t&&n.filterFunction===e&&(n.filterFunction=null)},a))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return m({icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`)})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get icon(){return`list-rectangle`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}select(e,t){return this.viewModel.select(e,t)}render(){let{disabled:e,enableListScroll:t,filterText:n,headingLevel:r,messages:i,viewModel:{items:a,numberOfFeatureTemplates:o,selectedItem:s,state:c}}=this,l=this.visibleElements.filter&&o>1;if(S(a)){let e=a.find(e=>e.label===u.label);e&&(e.label=i.other)}return b(`div`,{"aria-label":i.widgetLabel,class:this.classes(x.base,h.widget)},c===`loading`?b(`calcite-loader`,{key:`loader`,label:this.messagesCommon.loading,type:`indeterminate`}):c===`ready`?b(g,{disabled:e,enableListScroll:t,filterEnabled:l,filterText:n,headingLevel:r,id:this.id,identify:C,items:a,messages:{filterPlaceholder:i.filterPlaceholder,noItems:i.noItems,noMatches:i.noMatches},renderCustomGroupContent:this.renderCustomGroupContent,renderCustomItem:this.renderCustomItem,renderIcon:this._renderItemIcon,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:s??void 0,selectionMode:this.selectionMode??void 0,onFilterChange:e=>{this.filterText=e},onItemSelect:e=>!d(e)&&this.viewModel.select(e)}):null)}};e([o()],w.prototype,`disabled`,null),e([o()],w.prototype,`enableListScroll`,void 0),e([o()],w.prototype,`filterFunction`,null),e([o()],w.prototype,`filterText`,void 0),e([o()],w.prototype,`groupBy`,null),e([o()],w.prototype,`headingLevel`,void 0),e([o()],w.prototype,`icon`,null),e([o()],w.prototype,`label`,null),e([o()],w.prototype,`layers`,null),e([o(),v(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],w.prototype,`messages`,void 0),e([o(),v(`esri/t9n/common`)],w.prototype,`messagesCommon`,void 0),e([o(),v(`esri/widgets/Legend/t9n/Legend`)],w.prototype,`messagesLegend`,void 0),e([o({readOnly:!0})],w.prototype,`selectedItem`,null),e([o()],w.prototype,`selectionMode`,void 0),e([o({type:f}),y(`select`)],w.prototype,`viewModel`,void 0),e([o({type:p,nonNullable:!0})],w.prototype,`visibleElements`,void 0),e([o()],w.prototype,`renderCustomItem`,void 0),e([o()],w.prototype,`renderCustomGroupContent`,void 0),e([o()],w.prototype,`renderItemLabel`,void 0),e([o()],w.prototype,`renderItemDescription`,void 0),e([o()],w.prototype,`renderItemContent`,void 0),e([o()],w.prototype,`renderItemContentEnd`,void 0),w=e([s(`esri.widgets.FeatureTemplates`)],w);function T(e){return e?.[`data-item`]}function E(e){return!!e?.[`data-has-icon`]}function D(e,t){e&&(e[`data-has-icon`]=t)}const O=w;export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as n}from"../../core/string.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as a,renderAction as o}from"../../support/actions/actionUtils.js";import s from"../Widget.js";import{css as c}from"./css.js";import{zoomToFeature as l}from"../Popup/actions.js";import{loadCalciteComponents as u}from"../support/componentsUtils.js";import{tsx as d,tsxFragment as f,messageBundle as p}from"../support/widget.js";const m=l.clone();let h=class extends s{constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as n}from"../../core/string.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as a,renderAction as o}from"../../support/actions/actionUtils.js";import s from"../Widget.js";import{css as c}from"./css.js";import{zoomToFeature as l}from"../Popup/actions.js";import{loadCalciteComponents as u}from"../support/componentsUtils.js";import{tsx as d,tsxFragment as f,messageBundle as p}from"../support/widget.js";const m=l.clone();let h=class extends s{constructor(e){super(e),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit(`open-feature`,{feature:e})},this._handleZoomToFeature=e=>{this.emit(`zoom-to-feature`,{featureWidget:e})}}loadDependencies(){return Promise.all([a(),u({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`)})])}render(){let{flowItems:e}=this,t=e?.toArray();return d(f,null,t?.map((e,n)=>this._renderFlowItem(e,this.selectLastFlowItem&&n===t.length-1)))}_handleCloseClick(){this.emit(`close`)}_handleExitClick(){this.emit(`exit`)}_handleDrillInBackClick(){let{flowItems:e}=this,t=e?.pop();t&&(`activeCategory`in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):`showAllEnabled`in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case`feature`:case`feature-association`:return``;case`feature-relationship`:return this.messages.exitRelatedRecords;case`feature-utility-network-associations`:case`feature-utility-network-association-type`:return this.messages.exitAssociations}}_renderFlowItem(e,t){let{messages:r,closable:i,closed:a}=this,s=`graphic`in e&&!e.isTable,l=e.flowType===`feature-association`,u=this._getExitMessage(e),f=r.selectFeature;return d(`calcite-flow-item`,{bind:this,closable:i,closed:a,description:n(this._getDrillInFlowItemDescription(e)??``),heading:n(e.title??``),key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},d(`calcite-action`,{bind:this,class:c.actionExit,icon:`move-up`,key:`exit-action`,slot:`header-actions-start`,text:u,title:u,onclick:this._handleExitClick}),s?d(`calcite-action`,{bind:this,icon:`zoom-to-object`,key:`open-feature-action`,slot:`header-actions-end`,text:f,title:f,onclick:()=>this._handleOpenFeature(e)}):null,l?d(`calcite-action-bar`,{expanded:!0,expandToggleDisabled:!0,key:`header-action-bar`,scale:`s`,slot:`action-bar`},d(`calcite-action-group`,{overlayPositioning:`fixed`,scale:`s`},o(m,{key:`action-${m.uid}`,title:this._getActionTitle(m),text:this._getActionTitle(m),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,d(`div`,{class:c.container},e.render()))}_getActionTitle(e){let{messages:n}=this,r=e.title??``;return e.id===`zoom-to-feature`?t(r,{messages:n}):r}_getDrillInFlowItemDescription(e){switch(e.flowType){case`feature`:case`feature-association`:case`feature-utility-network-associations`:return e.viewModel.description??``;case`feature-relationship`:return e.allItemsDescription;case`feature-utility-network-association-type`:return e.description??``}}};e([r()],h.prototype,`flowItems`,void 0),e([r(),p(`esri/widgets/Features/t9n/Features`)],h.prototype,`messages`,void 0),e([r()],h.prototype,`closed`,void 0),e([r()],h.prototype,`closable`,void 0),e([r()],h.prototype,`selectLastFlowItem`,void 0),h=e([i(`esri.widgets.Features.FeaturesDrillIn`)],h);export{h as default};
|
package/widgets/Features.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import r from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as c,when as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{throttle as d}from"../core/throttle.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as m,substituteActionImage as h,getActionStyles as g,renderAction as _}from"../support/actions/actionUtils.js";import v from"./Feature.js";import y from"./Spinner.js";import b from"./Widget.js";import{css as x}from"./Feature/resources.js";import{FeatureContentMixin as S}from"./Feature/support/FeatureContentMixin.js";import{css as C}from"./Features/css.js";import w from"./Features/FeaturesDrillIn.js";import T from"./Features/FeaturesViewModel.js";import E from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as D}from"./Popup/actions.js";import{zoomToLocation as O}from"./Popup/actionUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{Heading as j}from"./support/Heading.js";import{tsx as M,messageBundle as N,vmEvent as P}from"./support/widget.js";import{setFocus as F}from"./support/widgetUtils.js";const I=`selected-index`,L=`features-spinner`;function R(e){return e?.declaredClass.startsWith(`esri.layers.`)??!1}let z=class extends S(b){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new r,this._drillInWidget=new w({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new D,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new T({suppressDeprecationWarning:!0}),this.visibleElements=new E,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=d(()=>this._displaySpinner(),25),e?.suppressDeprecationWarning!==!0&&i(a.getLogger(this),`Features`,`arcgis-features`,{version:`4.34`}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem=this.initialDisplayMode===`list`||!this.featureMenuOpen,c),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on(`close`,()=>this.close()),this._drillInWidget.on(`exit`,()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on(`open-feature`,({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on(`zoom-to-feature`,({featureWidget:e})=>O(this.viewModel,e))])}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}loadDependencies(){return Promise.all([m(),k({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),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`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),"list-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-list-item-group`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.view?.widthBreakpoint;return e===`xsmall`||e===`small`||e===`medium`}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&(this.initialDisplayMode===`list`||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get featureStream(){return this.viewModel.featureStream}set featureStream(e){this.viewModel.featureStream=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){let e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;let{flowType:t}=e;return t===`feature-association`||t===`feature-relationship`?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){let{_feature:e,headingLevel:t,_drillInFlowItems:n,timeZone:r,spatialReference:i,map:a}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new v({flowItems:n,headingLevel:t+1,timeZone:r,spatialReference:i,map:a,viewModel:o,visibleElements:s,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){let{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():a.getLogger(this).warn(`Features can only be blurred when currently active.`)}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){let{active:e}=this.viewModel;e?this._focusFlowItemNode():a.getLogger(this).warn(`Features can only be focused when currently active.`)}next(){return this.viewModel.next()}open(e){this.removeHandles(I);let t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(l(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return M(`div`,{afterCreate:this._storeRootNode,bind:this,class:this.classes(C.base,A.widget,A.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode===`list`?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.header,key:`header-actions`},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.footer,key:`footer-actions`,slot:`footer`},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a}=r;return M(`div`,{class:C.paginationText,key:`feature-pagination-text`},t(e.pageText,{index:n(a+1),total:n(i)}))}_renderFeatureMenuButton(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a,pendingPromisesCount:o,streamingFeatures:s}=r,c=o>0||s;return M(`calcite-action`,{bind:this,class:C.paginationMenuButton,icon:`list`,key:`feature-menu-button`,label:e.selectFeature,loading:c,text:t(e.pageText,{index:n(a+1),total:n(i)}),textEnabled:!0,title:e.selectFeature,onclick:this._handlePaginationMenuButton})}_renderPagination(){let{previous:e,next:t}=this.messagesCommon.pagination;return M(`calcite-action-bar`,{class:C.paginationActionBar,expandToggleDisabled:!0,key:`pagination-action-bar`,layout:`horizontal`,overflowMode:`none`,scale:`s`},M(`calcite-action-group`,{scale:`s`},M(`calcite-action`,{class:C.paginationPrevious,icon:`chevron-left`,iconFlipRtl:!0,label:e,text:e,title:e,onclick:this._previousFeature}),M(`calcite-action`,{icon:`chevron-right`,iconFlipRtl:!0,label:t,text:t,title:t,onclick:this._nextFeature})))}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:n,featureViewModels:r}=this.viewModel,i=e===n,a=r.indexOf(e);return M(`calcite-list-item`,{bind:this,"data-feature-index":a,key:`feature-menu-item-${e.uid}`,selected:i,onblur:this._removeActiveFeature,onCalciteListItemSelect:this._selectFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature},M(`span`,{innerHTML:e.title||this.messagesCommon.untitled,slot:`content`}),t===`list`?M(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}):null)}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{let n=e?.graphic;if(!n)return;let{layer:r,sourceLayer:i}=n,a=(R(r)?r:null)||(R(i)?i:null),o=t.get(a)??[];t.set(a,[...o,e])}),t}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,n=this._groupResultsByLayer(),r=this.initialDisplayMode===`list`?`none`:`single`;return t.featureViewModels.length?M(`calcite-list`,{displayMode:`flat`,label:e?.featuresList,selectionAppearance:`icon`,selectionMode:r},Array.from(n.keys(),e=>{let t=n.get(e)?.map(e=>this._renderFeatureMenuItem(e)),r=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&r!==null?M(`calcite-list-item-group`,{heading:r,key:e?.uid||`map-graphics`},t):t})):null}_renderHeaderAction(e,t){let n=e.title||``;return e.visible?M(`calcite-action`,{active:e.type===`toggle`&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,slot:`header-actions-end`,text:n,title:n,onclick:this._triggerHeaderAction}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){let{headingLevel:e,visibleElements:t,_isCollapsed:n,_collapseEnabled:r,featureNavigationTop:i,_drillInFlowItems:a,initialDisplayMode:o,selectedFeature:s,featureMenuOpen:c}=this,{title:l,active:u}=this.viewModel,d=t.heading&&l?l:``;if(o===`list`&&!s)return null;let f=a.length===0&&(o===`list`?!!s:!c);return M(`calcite-flow-item`,{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[C.contentFeature]:!0,[C.flowItemCollapsed]:n}),closable:t.closeButton,closed:!u,collapsed:n,collapseDirection:i?`down`:`up`,collapsible:r,headingLevel:e,key:`root-flow-item`,selected:f,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?M(j,{class:this.classes(C.featuresHeading,A.heading),innerHTML:d,key:`header-content`,level:this.headingLevel,slot:`header-content`}):null,this._renderHeaderActions(),this._renderActionBar(),M(`div`,{class:this.classes(C.container,C.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){let{viewModel:e,visibleElements:n,featureMenuTitle:r,messages:i,messagesCommon:a,initialDisplayMode:o,featureMenuOpen:s,selectedFeature:c,_collapseEnabled:l,_isCollapsed:u,featureNavigationTop:d,headingLevel:f}=this,{active:p,featureViewModels:m,pendingPromisesCount:h,streamingFeatures:g}=e,_=h>0||g,{featureMenuHeading:v}=n,y=r??i.selectFeature;if(o===`feature`&&!s)return null;let b=o===`list`?!c:s;return M(`calcite-flow-item`,{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[C.flowItemCollapsed]:u}),closable:o===`list`&&n.closeButton,closed:!p,collapsed:o===`list`&&u,collapseDirection:d?`down`:`up`,collapsible:o===`list`&&l,description:v?t(i.total,{total:m.length}):void 0,heading:v?y:void 0,headingLevel:f,key:`feature-menu`,loading:e.waitingForContents,selected:b,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},o===`list`?this._renderHeaderActions():null,_?M(`calcite-loader`,{class:C.loader,inline:!0,key:`feature-menu-loader`,label:a.loading,slot:`header-actions-end`}):null,M(`div`,{class:C.container},this._renderFeatureMenu()),M(`div`,{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:C.featureMenuObserver}),o===`feature`?M(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:this._handleFeatureMenuBack},a.back):null)}_renderContentContainer(){let e=this.initialDisplayMode===`list`?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?M(`calcite-flow`,{key:`content-container`},e):e}_getFallbackIcon(e){let{className:t,icon:n}=e;if(n)return null;let r=h({action:e,feature:this.selectedFeature}),i={[C.icon]:!!t,[C.actionImage]:!!r};return t&&(i[t]=!0),r||t?M(`span`,{"aria-hidden":`true`,class:this.classes(C.icon,i),key:`icon`,styles:g(r)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?M(`calcite-action-bar`,{expanded:!this._hideActionText,expandToggleDisabled:!0,key:`header-action-bar`,scale:`s`,slot:`action-bar`},M(`calcite-action-group`,{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:`fixed`,scale:`s`},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{let n=this._getActionTitle(e);return _(e,{key:`action-${t}`,title:n,text:n,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){let e=this.viewModel?.content;return e?typeof e==`string`?M(`div`,{class:x.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();let t=e.graphic,n=t?.geometry;if(n==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:n});let{labelPointExecute:r}=await import(`../geometry/operators/labelPointOperator.js`),i=r(n);this.open({features:[t],location:i??void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;let e=this._focusAbortController.signal;await o(u(e));let t=this._rootNode?.querySelector(`calcite-flow-item[selected]`);F(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){let{viewModel:t}=this,n=e.currentTarget[`data-feature-index`];t.activeFeature=t.features?.[n]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){let t=e.currentTarget[`data-feature-index`];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.initialDisplayMode===`feature`?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:n,selectedFeature:r,messagesCommon:i}=this,{id:a}=e,o=r?.attributes,s=e.title??``,c=a===`zoom-to-feature`?t(s,{messages:n}):a===`remove-selected-feature`?t(s,{messages:i}):a===`zoom-to-clustered-features`||a===`browse-clustered-features`?t(s,{messages:n}):e.title;return c&&o?t(c,o):c??``}_onMainKeydown(e){let{key:t}=e;t===`ArrowLeft`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t===`ArrowRight`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){let{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){let{selectedFeatureWidget:e,messagesCommon:t}=this,n=e?.viewModel;e&&(this.viewModel.title=n?.state===`error`?t?.errorMessage:n?.title||``)}_addSelectedFeatureIndexHandle(){let e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){let{featureCount:n}=this.viewModel;n&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,r=this.headerActions.find(({uid:e})=>e===n);r&&!r.disabled&&(r?.type===`toggle`&&(r.value=!r.value),this.emit(`trigger-header-action`,{action:r}))}_triggerAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,{allActions:r}=this.viewModel,i=r.findIndex(e=>e.uid===n),a=r.at(i);a?.type===`toggle`&&(a.value=!a.value),this.viewModel.triggerAction(i)}_createSpinner(e){e&&(this._spinner=new y({view:e}),e.ui.add(this._spinner,{key:L,position:`manual`,internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){let{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){let{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{`showAllEnabled`in e.viewModel&&(e.viewModel.showAllEnabled=!1),`activeCategory`in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){let{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){let{_spinner:e}=this;if(!e)return;let{location:t,waitingForResult:n}=this.viewModel;n&&t?e.show({location:t}):e.hide()}_destroySpinner(){let{_spinner:e}=this;e&&(e.view?.ui?.remove(e,L),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([f()],z.prototype,`_drillInFlowItems`,void 0),e([f()],z.prototype,`_hideActionText`,null),e([f()],z.prototype,`_featureNavigationVisible`,null),e([f()],z.prototype,`_isCollapsed`,null),e([f()],z.prototype,`_collapseEnabled`,null),e([f({readOnly:!0})],z.prototype,`active`,null),e([f()],z.prototype,`collapsed`,void 0),e([f()],z.prototype,`content`,null),e([f()],z.prototype,`icon`,null),e([f()],z.prototype,`featureMenuOpen`,null),e([f()],z.prototype,`featureMenuTitle`,null),e([f()],z.prototype,`featureStream`,null),e([f()],z.prototype,`featureNavigationTop`,void 0),e([f()],z.prototype,`features`,null),e([f()],z.prototype,`goToOverride`,null),e([f({type:D})],z.prototype,`headerActions`,void 0),e([f()],z.prototype,`headingLevel`,void 0),e([f()],z.prototype,`initialDisplayMode`,null),e([f()],z.prototype,`location`,null),e([f()],z.prototype,`label`,null),e([f()],z.prototype,`map`,null),e([f(),N(`esri/widgets/Features/t9n/Features`)],z.prototype,`messages`,void 0),e([f(),N(`esri/t9n/common`)],z.prototype,`messagesCommon`,void 0),e([f()],z.prototype,`promises`,null),e([f()],z.prototype,`responsiveActionsEnabled`,void 0),e([f({readOnly:!0})],z.prototype,`selectedFeature`,null),e([f({readOnly:!0})],z.prototype,`selectedDrillInFeature`,null),e([f()],z.prototype,`selectedFeatureIndex`,null),e([f({readOnly:!0})],z.prototype,`selectedFeatureWidget`,null),e([f()],z.prototype,`spatialReference`,null),e([f()],z.prototype,`title`,null),e([f()],z.prototype,`timeZone`,null),e([f()],z.prototype,`updateLocationEnabled`,null),e([f()],z.prototype,`view`,null),e([f({type:T}),P([`triggerAction`,`trigger-action`])],z.prototype,`viewModel`,void 0),e([f({type:E,nonNullable:!0})],z.prototype,`visibleElements`,void 0),e([f()],z.prototype,`visible`,null),z=e([p(`esri.widgets.Features`)],z);export{z as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import r from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as c,when as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{throttle as d}from"../core/throttle.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as m,substituteActionImage as h,getActionStyles as g,renderAction as _}from"../support/actions/actionUtils.js";import v from"./Feature.js";import y from"./Spinner.js";import b from"./Widget.js";import{css as x}from"./Feature/resources.js";import{FeatureContentMixin as S}from"./Feature/support/FeatureContentMixin.js";import{css as C}from"./Features/css.js";import w from"./Features/FeaturesDrillIn.js";import T from"./Features/FeaturesViewModel.js";import E from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as D}from"./Popup/actions.js";import{zoomToLocation as O}from"./Popup/actionUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{Heading as j}from"./support/Heading.js";import{tsx as M,messageBundle as N,vmEvent as P}from"./support/widget.js";import{setFocus as F}from"./support/widgetUtils.js";const I=`selected-index`,L=`features-spinner`;function R(e){return e?.declaredClass.startsWith(`esri.layers.`)??!1}let z=class extends S(b){constructor(e){super(e),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new r,this._drillInWidget=new w({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new D,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new T({suppressDeprecationWarning:!0}),this.visibleElements=new E,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{this.initialDisplayMode===`list`?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=d(()=>this._displaySpinner(),25),e?.suppressDeprecationWarning!==!0&&i(a.getLogger(this),`Features`,`arcgis-features`,{version:`4.34`}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem=this.initialDisplayMode===`list`||!this.featureMenuOpen,c),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{let e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on(`close`,()=>this.close()),this._drillInWidget.on(`exit`,()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on(`open-feature`,({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on(`zoom-to-feature`,({featureWidget:e})=>O(this.viewModel,e))])}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}loadDependencies(){return Promise.all([m(),k({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),"action-bar":()=>import(`@esri/calcite-components/dist/components/calcite-action-bar`),"action-group":()=>import(`@esri/calcite-components/dist/components/calcite-action-group`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),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`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),"list-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-list-item-group`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.view?.widthBreakpoint;return e===`xsmall`||e===`small`||e===`medium`}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&(this.initialDisplayMode===`list`||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get featureStream(){return this.viewModel.featureStream}set featureStream(e){this.viewModel.featureStream=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){let e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;let{flowType:t}=e;return t===`feature-association`||t===`feature-relationship`?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){let{_feature:e,headingLevel:t,_drillInFlowItems:n,timeZone:r,spatialReference:i,map:a}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new v({flowItems:n,headingLevel:t+1,timeZone:r,spatialReference:i,map:a,viewModel:o,visibleElements:s,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){let{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():a.getLogger(this).warn(`Features can only be blurred when currently active.`)}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){let{active:e}=this.viewModel;e?this._focusFlowItemNode():a.getLogger(this).warn(`Features can only be focused when currently active.`)}next(){return this.viewModel.next()}open(e){this.removeHandles(I);let t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(l(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return M(`div`,{afterCreate:this._storeRootNode,bind:this,class:this.classes(C.base,A.widget,A.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode===`list`?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.header,key:`header-actions`},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?M(`div`,{class:C.footer,key:`footer-actions`,slot:`footer`},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a}=r;return M(`div`,{class:C.paginationText,key:`feature-pagination-text`},t(e.pageText,{index:n(a+1),total:n(i)}))}_renderFeatureMenuButton(){let{messages:e,viewModel:r}=this,{featureCount:i,selectedFeatureIndex:a,pendingPromisesCount:o,streamingFeatures:s}=r,c=o>0||s;return M(`calcite-action`,{bind:this,class:C.paginationMenuButton,icon:`list`,key:`feature-menu-button`,label:e.selectFeature,loading:c,text:t(e.pageText,{index:n(a+1),total:n(i)}),textEnabled:!0,title:e.selectFeature,onclick:this._handlePaginationMenuButton})}_renderPagination(){let{previous:e,next:t}=this.messagesCommon.pagination;return M(`calcite-action-bar`,{class:C.paginationActionBar,expandToggleDisabled:!0,key:`pagination-action-bar`,layout:`horizontal`,overflowMode:`none`,scale:`s`},M(`calcite-action-group`,{scale:`s`},M(`calcite-action`,{class:C.paginationPrevious,icon:`chevron-left`,iconFlipRtl:!0,label:e,text:e,title:e,onclick:this._previousFeature}),M(`calcite-action`,{icon:`chevron-right`,iconFlipRtl:!0,label:t,text:t,title:t,onclick:this._nextFeature})))}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:n,featureViewModels:r}=this.viewModel,i=e===n,a=r.indexOf(e);return M(`calcite-list-item`,{bind:this,"data-feature-index":a,key:`feature-menu-item-${e.uid}`,selected:i,onblur:this._removeActiveFeature,onCalciteListItemSelect:this._selectFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature},M(`span`,{innerHTML:e.title||this.messagesCommon.untitled,slot:`content`}),t===`list`?M(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}):null)}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{let n=e?.graphic;if(!n)return;let{layer:r,sourceLayer:i}=n,a=(R(r)?r:null)||(R(i)?i:null),o=t.get(a)??[];t.set(a,[...o,e])}),t}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,n=this._groupResultsByLayer(),r=this.initialDisplayMode===`list`?`none`:`single`;return t.featureViewModels.length?M(`calcite-list`,{displayMode:`flat`,label:e?.featuresList,selectionAppearance:`icon`,selectionMode:r},Array.from(n.keys(),e=>{let t=n.get(e)?.map(e=>this._renderFeatureMenuItem(e)),r=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&r!==null?M(`calcite-list-item-group`,{heading:r,key:e?.uid||`map-graphics`},t):t})):null}_renderHeaderAction(e,t){let n=e.title||``;return e.visible?M(`calcite-action`,{active:e.type===`toggle`&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,slot:`header-actions-end`,text:n,title:n,onclick:this._triggerHeaderAction}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){let{headingLevel:e,visibleElements:t,_isCollapsed:n,_collapseEnabled:r,featureNavigationTop:i,_drillInFlowItems:a,initialDisplayMode:o,selectedFeature:s,featureMenuOpen:c}=this,{title:l,active:u}=this.viewModel,d=t.heading&&l?l:``;if(o===`list`&&!s)return null;let f=a.length===0&&(o===`list`?!!s:!c);return M(`calcite-flow-item`,{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[C.contentFeature]:!0,[C.flowItemCollapsed]:n}),closable:t.closeButton,closed:!u,collapsed:n,collapseDirection:i?`down`:`up`,collapsible:r,headingLevel:e,key:`root-flow-item`,selected:f,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?M(j,{class:this.classes(C.featuresHeading,A.heading),innerHTML:d,key:`header-content`,level:this.headingLevel,slot:`header-content`}):null,this._renderHeaderActions(),this._renderActionBar(),M(`div`,{class:this.classes(C.container,C.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){let{viewModel:e,visibleElements:n,featureMenuTitle:r,messages:i,messagesCommon:a,initialDisplayMode:o,featureMenuOpen:s,selectedFeature:c,_collapseEnabled:l,_isCollapsed:u,featureNavigationTop:d,headingLevel:f}=this,{active:p,featureViewModels:m,pendingPromisesCount:h,streamingFeatures:g}=e,_=h>0||g,{featureMenuHeading:v}=n,y=r??i.selectFeature;if(o===`feature`&&!s)return null;let b=o===`list`?!c:s;return M(`calcite-flow-item`,{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[C.flowItemCollapsed]:u}),closable:o===`list`&&n.closeButton,closed:!p,collapsed:o===`list`&&u,collapseDirection:d?`down`:`up`,collapsible:o===`list`&&l,description:v?t(i.total,{total:m.length}):void 0,heading:v?y:void 0,headingLevel:f,key:`feature-menu`,loading:e.waitingForContents,selected:b,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},o===`list`?this._renderHeaderActions():null,_?M(`calcite-loader`,{class:C.loader,inline:!0,key:`feature-menu-loader`,label:a.loading,slot:`header-actions-end`}):null,M(`div`,{class:C.container},this._renderFeatureMenu()),M(`div`,{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:C.featureMenuObserver}),o===`feature`?M(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:this._handleFeatureMenuBack},a.back):null)}_renderContentContainer(){let e=this.initialDisplayMode===`list`?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?M(`calcite-flow`,{key:`content-container`},e):e}_getFallbackIcon(e){let{className:t,icon:n}=e;if(n)return null;let r=h({action:e,feature:this.selectedFeature}),i={[C.icon]:!!t,[C.actionImage]:!!r};return t&&(i[t]=!0),r||t?M(`span`,{"aria-hidden":`true`,class:this.classes(C.icon,i),key:`icon`,styles:g(r)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?M(`calcite-action-bar`,{expanded:!this._hideActionText,expandToggleDisabled:!0,key:`header-action-bar`,scale:`s`,slot:`action-bar`},M(`calcite-action-group`,{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:`fixed`,scale:`s`},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{let n=this._getActionTitle(e);return _(e,{key:`action-${t}`,title:n,text:n,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){let e=this.viewModel?.content;return e?typeof e==`string`?M(`div`,{class:x.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();let t=e.graphic,n=t?.geometry;if(n==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:n});let{labelPointExecute:r}=await import(`../geometry/operators/labelPointOperator.js`),i=r(n);this.open({features:[t],location:i??void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;let e=this._focusAbortController.signal;await o(u(e));let t=this._rootNode?.querySelector(`calcite-flow-item[selected]`);F(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){let{viewModel:t}=this,n=e.currentTarget[`data-feature-index`];t.activeFeature=t.features?.[n]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){let t=e.currentTarget[`data-feature-index`];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.initialDisplayMode===`feature`?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:n,selectedFeature:r,messagesCommon:i}=this,{id:a}=e,o=r?.attributes,s=e.title??``,c=a===`zoom-to-feature`?t(s,{messages:n}):a===`remove-selected-feature`?t(s,{messages:i}):a===`zoom-to-clustered-features`||a===`browse-clustered-features`?t(s,{messages:n}):e.title;return c&&o?t(c,o):c??``}_onMainKeydown(e){let{key:t}=e;t===`ArrowLeft`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t===`ArrowRight`&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){let{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){let{selectedFeatureWidget:e,messagesCommon:t}=this,n=e?.viewModel;e&&(this.viewModel.title=n?.state===`error`?t?.errorMessage:n?.title||``)}_addSelectedFeatureIndexHandle(){let e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){let{featureCount:n}=this.viewModel;n&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,r=this.headerActions.find(({uid:e})=>e===n);r&&!r.disabled&&(r?.type===`toggle`&&(r.value=!r.value),this.emit(`trigger-header-action`,{action:r}))}_triggerAction(e){let t=e.currentTarget;if(t.disabled)return;let n=t.dataset.actionUid,{allActions:r}=this.viewModel,i=r.findIndex(e=>e.uid===n),a=r.at(i);a?.type===`toggle`&&(a.value=!a.value),this.viewModel.triggerAction(i)}_createSpinner(e){e&&(this._spinner=new y({view:e}),e.ui.add(this._spinner,{key:L,position:`manual`,internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){let{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){let{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{`showAllEnabled`in e.viewModel&&(e.viewModel.showAllEnabled=!1),`activeCategory`in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){let{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){let{_spinner:e}=this;if(!e)return;let{location:t,waitingForResult:n}=this.viewModel;n&&t?e.show({location:t}):e.hide()}_destroySpinner(){let{_spinner:e}=this;e&&(e.view?.ui?.remove(e,L),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([f()],z.prototype,`_drillInFlowItems`,void 0),e([f()],z.prototype,`_hideActionText`,null),e([f()],z.prototype,`_featureNavigationVisible`,null),e([f()],z.prototype,`_isCollapsed`,null),e([f()],z.prototype,`_collapseEnabled`,null),e([f({readOnly:!0})],z.prototype,`active`,null),e([f()],z.prototype,`collapsed`,void 0),e([f()],z.prototype,`content`,null),e([f()],z.prototype,`icon`,null),e([f()],z.prototype,`featureMenuOpen`,null),e([f()],z.prototype,`featureMenuTitle`,null),e([f()],z.prototype,`featureStream`,null),e([f()],z.prototype,`featureNavigationTop`,void 0),e([f()],z.prototype,`features`,null),e([f()],z.prototype,`goToOverride`,null),e([f({type:D})],z.prototype,`headerActions`,void 0),e([f()],z.prototype,`headingLevel`,void 0),e([f()],z.prototype,`initialDisplayMode`,null),e([f()],z.prototype,`location`,null),e([f()],z.prototype,`label`,null),e([f()],z.prototype,`map`,null),e([f(),N(`esri/widgets/Features/t9n/Features`)],z.prototype,`messages`,void 0),e([f(),N(`esri/t9n/common`)],z.prototype,`messagesCommon`,void 0),e([f()],z.prototype,`promises`,null),e([f()],z.prototype,`responsiveActionsEnabled`,void 0),e([f({readOnly:!0})],z.prototype,`selectedFeature`,null),e([f({readOnly:!0})],z.prototype,`selectedDrillInFeature`,null),e([f()],z.prototype,`selectedFeatureIndex`,null),e([f({readOnly:!0})],z.prototype,`selectedFeatureWidget`,null),e([f()],z.prototype,`spatialReference`,null),e([f()],z.prototype,`title`,null),e([f()],z.prototype,`timeZone`,null),e([f()],z.prototype,`updateLocationEnabled`,null),e([f()],z.prototype,`view`,null),e([f({type:T}),P([`triggerAction`,`trigger-action`])],z.prototype,`viewModel`,void 0),e([f({type:E,nonNullable:!0})],z.prototype,`visibleElements`,void 0),e([f()],z.prototype,`visible`,null),z=e([p(`esri.widgets.Features`)],z);export{z as default};
|
package/widgets/FloorFilter.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Widget.js";import{css as c}from"./FloorFilter/css.js";import l from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as f,incrementHeadingLevel as p}from"./support/Heading.js";import{messageBundle as m,tsx as h}from"./support/widget.js";import{isRTL as g,storeNode as _}from"./support/widgetUtils.js";const v=new Set([`ArrowUp`,`ArrowDown`,`End`,`Home`]);let y=class extends s{constructor(e,t){super(e,t),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 l,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this.announceDeprecation=()=>{n(r.getLogger(this),`Floor Filter`,`arcgis-floor-filter`,{version:`5.0`})},this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(i(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return u({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(){let{longNames:e}=this,t=e&&this.viewModel.isNormalMode?`expanded`:`collapsed`,n=this._renderButtons(),r=this._renderFilterMenu(),i=h(`div`,{class:this.classes(c.separator)}),a=this._getComponentPosition(),o=this._getPosition(a),s=a===`top-right`||a===`bottom-right`,l=a===`top-left`||a===`bottom-left`,u=g(this.container),f=u&&l||!u&&s?r:n,p=u&&l||!u&&s?n:r;return h(`div`,{afterCreate:this._afterBaseNodeCreate,class:this.classes(c.floorFilter,d.widget,`${c.floorFilterLayout}${t}`,`${c.floorFilterPosition}${o}`),key:`floor-filter-menu`},f,this.viewModel?.filterMenuOpen?i:null,p)}_renderButtons(){let e=this._getComponentPosition(),t=this._getPosition(e),n=[];return t===`top`?(n.push(this._renderBrowseButton()),n.push(this._renderLevelButtons()),n.push(this._renderCloseLevelsButton()),n.push(this._renderZoomButton()),n.push(this._renderCollapseToggleButton())):(n.push(this._renderCollapseToggleButton()),n.push(this._renderZoomButton()),n.push(this._renderCloseLevelsButton()),n.push(this._renderLevelButtons()),n.push(this._renderBrowseButton())),h(`div`,{class:this.classes(d.widget,c.buttonContainer),key:`button-container`},n)}_renderBrowseButton(){let{longNames:e,messages:t}=this;return h(`button`,{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,(this.viewModel.state===`loading`||this.viewModel.state===`disabled`)&&d.buttonDisabled,c.browseButton,this.viewModel?.filterMenuOpen&&d.widgetButtonActive),key:`browse-button`,title:t.buttons.browse,type:`button`,onclick:this._toggleFilterMenu},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:this.icon,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;let{facility:e,messagesCommon:n,messages:r}=this,i=this.viewModel?.getFacility(e),a=(this.viewModel?.getFacilityLevels(e)).map(e=>this._renderLevelButton(e));if(!a.length)return null;let o=i&&t(r.selector.levelsLabel,{name:`"${i.name}"`});if(this._isWebScene(this.view?.map)&&a?.length>1){let t={id:`all--${e}`,facilityId:e,shortName:n.all,longName:n.all,levelNumber:null,verticalOrder:null},r=this._renderLevelButton(t);a.push(r)}return h(`ul`,{afterCreate:_,"aria-label":o,bind:this,class:this.classes(c.levelsContainer),"data-id":`levels`,"data-node-ref":`_levelsListNode`,key:`levels-button-container`,onkeydown:this._handleListKeydown},a)}_renderLevelButton(e){let{longNames:t}=this,{shortName:n,longName:r,id:i}=e,a=`levels--${i}`,o=this.level===i,s=t&&this.viewModel.isNormalMode?r:n;return!this.viewModel.isNormalMode&&!o&&!this.viewModel.levelsExpanded?null:h(`li`,{key:a},h(`button`,{bind:this,class:this.classes(d.widgetButton,o?d.widgetButtonActive:null,d.interactive,c.levelButton),"data-id":i,"data-list-id":`levels`,type:`button`,onclick:this._levelSelected,onfocus:this._onItemFocus},s))}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;let{messagesCommon:e}=this;return h(`button`,{"aria-label":e.close,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,c.closeLevelsButton),key:`close-levels-button`,title:e.close,type:`button`,onclick:this._closeLevels},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:`x`})))}_renderZoomButton(){let{longNames:e,messages:t,facility:n,site:r}=this,i=this.viewModel?.filterMenuType,a=this.viewModel?.filterMenuOpen,o=this.viewModel?.getSite(r),s=this.viewModel?.getFacility(n),l=i===`site`&&a?!o:!s;return h(`button`,{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(d.widget,d.widgetButton,l&&d.buttonDisabled,d.interactive,this.viewModel?.getFacilityLevels(n).length>0?c.zoomButtonLevels:c.zoomButton),key:`zoom-button`,title:t.buttons.zoomTo,type:`button`,onclick:this._zoomToClicked},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:`zoom-to-object`,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){let{longNames:e,messagesCommon:t}=this,n=e?`chevrons-right`:`chevrons-left`,r=e?t.collapse:t.expand;return h(`button`,{"aria-label":r,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,c.minimizeToggleButton),key:`minimize-toggle-button`,title:r,type:`button`,onclick:this._toggleCollapsed},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{class:this.classes(c.iconFlip),icon:n,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?this.viewModel?.filterMenuType===`site`?this._renderSiteFilterMenu():this.viewModel?.filterMenuType===`facility`?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){let{messages:e,messagesCommon:t}=this,n=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,r=h(`div`,{class:this.classes(`${c.filterMenuHeader}`),key:`filter-menu-site-header`},h(`div`,{class:this.classes(c.filterMenuHeaderTextGroup)},h(f,{class:this.classes(c.filterMenuHeaderText),level:this.headingLevel},n)),h(`button`,{bind:this,class:this.classes(c.iconClose),title:t.close,type:`button`,onclick:this._closeClicked},h(`calcite-icon`,{icon:`x`}))),i=this._renderSearchInput(),a=this._renderSiteItems();return h(`div`,{class:this.classes(c.filterMenu),key:`filter-menu-site`},r,i,a)}_renderFacilityFilterMenu(){let{messages:e,messagesCommon:t,site:n}=this,r=this.viewModel?.getSite(n)?.name,i=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,a=this.viewModel.hasMultipleSites?h(`button`,{bind:this,class:this.classes(c.filterMenuHeaderBack),title:t.back,type:`button`,onclick:this._backClicked},h(`calcite-icon`,{class:this.classes(g(this.container)?c.iconRight:c.iconLeft),icon:g(this.container)?`chevron-right`:`chevron-left`})):null,o=this.viewModel.hasMultipleSites?h(f,{class:this.classes(c.filterMenuHeaderSubtext),level:p(this.headingLevel)},r):null,s=h(`div`,{class:this.classes(c.filterMenuHeader),key:`filter-menu-site-header`},a,h(`div`,{class:this.classes(c.filterMenuHeaderTextGroup)},h(f,{class:this.classes(c.filterMenuHeaderText),level:this.headingLevel},i),o),h(`button`,{bind:this,class:this.classes(c.iconClose),title:t.close,type:`button`,onclick:this._closeClicked},h(`calcite-icon`,{icon:`x`}))),l=this._renderSearchInput(),u=this._renderFacilityItems();return h(`div`,{class:this.classes(c.filterMenu),key:`filter-menu-facility`},s,l,u)}_renderSearchInput(){let{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return h(`div`,{class:this.classes(c.filterMenuSearch),key:`filter-menu-search`},h(`calcite-icon`,{icon:`search`,key:`filter-menu-search-icon`}),h(`input`,{afterCreate:_,bind:this,class:this.classes(c.filterMenuSearchInput),"data-node-ref":`_searchInput`,placeholder:e.search,value:this.viewModel.searchTerm??void 0,oninput:this._onSearchChange,onpaste:this._onSearchChange}),t?h(`calcite-icon`,{bind:this,class:this.classes(c.iconClose),icon:`x`,key:`filter-menu-search-clear`,title:e.clear,onclick:this._onSearchClear}):null)}_renderBlueCircle(){return h(`span`,{class:this.classes(c.selectedItemCircle),key:`floor-filter__selected-item-circle`})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;let{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,n=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),r=n.length===0&&this.viewModel?.searchTerm&&h(`div`,{class:this.classes(d.empty)},e.noResults);return h(`ul`,{afterCreate:_,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(c.filterMenuItems),"data-id":`sites`,"data-node-ref":`_sitesListNode`,key:`filter-menu-items--sites`,tabIndex:-1,onkeydown:this._handleListKeydown},n,r)}_renderSiteItem(e){let{name:t,id:n}=e,r=`filter-menu-site--${n}`,i=this.site===n;return h(`li`,{key:r},h(`button`,{bind:this,class:this.classes(c.filterMenuSite),"data-id":n,"data-list-id":`sites`,type:`button`,onclick:this._siteSelected,onfocus:this._onItemFocus},i?this._renderBlueCircle():null,h(`span`,{class:this.classes(i?c.filterMenuSelectedItem:c.filterMenuItemName)},t),h(`calcite-icon`,{class:this.classes(g(this.container)?c.iconLeft:c.iconRight),icon:`chevron-right`,scale:`s`})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;let{messages:e,site:n}=this,r=this.viewModel.getSite(n),i=this.viewModel.filterFeatures.facilities.facilitiesInfo,a=this.viewModel.filterFacilities(i).map(e=>this._renderFacilityItem(e)),o=a.length===0&&this.viewModel?.searchTerm&&h(`div`,{class:this.classes(d.empty)},e.noResults),s=r?t(e.selector.siteFacilitiesLabel,{name:`"${r.name}"`}):e.selector.facilitiesLabel;return h(`ul`,{afterCreate:_,"aria-label":s,bind:this,class:this.classes(c.filterMenuItems),"data-id":`facilities`,"data-node-ref":`_facilitiesListNode`,key:`filter-menu-items--facilities`,tabIndex:-1,onkeydown:this._handleListKeydown},a,o)}_renderFacilityItem(e){let{name:t,id:n}=e,r=`filter-menu-facility--${n}`,i=this.facility===n;return h(`li`,{key:r},h(`button`,{bind:this,class:this.classes(c.filterMenuFacility),"data-id":n,"data-list-id":`facilities`,type:`button`,onclick:this._facilitySelected,onfocus:this._onItemFocus},i?this._renderBlueCircle():null,h(`span`,{class:this.classes(i?c.filterMenuSelectedItem:c.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(){let e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&this.viewModel?.filterMenuType===`site`&&this.viewModel?.filterMenuOpen){let e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){let e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){let e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){let 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){let t=e.currentTarget.getAttribute(`data-id`),n=this.viewModel.getSite(t),r=!1;this.site!==t&&(this.facility=null,this.level=null,r=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType(`facility`),this.viewModel.goTo(n),r&&this.viewModel.setFloors(null)}_facilitySelected(e){let t=e.currentTarget.getAttribute(`data-id`),n=this.viewModel.getFacility(t),r=!1;if(this.facility!==t){if(this.viewModel.filterMode===`base-floors`){let e=this.viewModel?.getBaseLevel(n);this.level=e?e.id:null}else this.level=null;r=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(n),r){let e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}this.viewModel.isNormalMode||this.viewModel.getFacilityLevels(t)?.length>1&&(this.viewModel.levelsExpanded=!0),setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){let t=e.currentTarget.getAttribute(`data-id`);this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return e?.declaredClass===`esri.WebScene`}_getComponentPosition(){return this.container==null?null:this.view?.ui?.getPosition(this.container)}_getPosition(e){switch(e){case`bottom-right`:case`bottom-left`:return`bottom`;default:return`top`}}_handleListKeydown(e){let t=e.currentTarget.getAttribute(`data-id`),n=null;t===`sites`||t===`facilities`?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,n=`menuItems`):t===`levels`&&(n=`levels`);let r=t===`sites`?this._sitesListNode:t===`facilities`?this._facilitiesListNode:t===`levels`?this._levelsListNode:null,{key:i}=e,a=i===`Tab`,o=v.has(i);o&&e.preventDefault();let s=r?.getElementsByTagName(`li`);s&&s.length!==0&&(o||a)&&this._handleItemNavigation(i,e.shiftKey,s,a,n)}_handleItemNavigation(e,t,n,r,i){if(!i)return;this._activeMenuIndex[i]===n.length&&this._activeMenuIndex[i]--,this._activeMenuIndex[i]===-1&&this._activeMenuIndex[i]++;let a=this._activeMenuIndex[i];switch(e){case`Home`:this._activeMenuIndex[i]=0;break;case`End`:this._activeMenuIndex[i]=n.length-1;break;case`ArrowUp`:this._activeMenuIndex[i]=this._activeMenuIndex[i]<=0?n.length-1:this._activeMenuIndex[i]-1;break;case`ArrowDown`:this._activeMenuIndex[i]=this._activeMenuIndex[i]===n.length-1?0:this._activeMenuIndex[i]+1}if(e===`Tab`&&t&&this._activeMenuIndex[i]>=0&&this._activeMenuIndex[i]--,e===`Tab`&&!t&&this._activeMenuIndex[i]<n.length&&this._activeMenuIndex[i]++,a!==this._activeMenuIndex[i]&&this._activeMenuIndex[i]>-1&&this._activeMenuIndex[i]<n.length&&!r){let e=n[this._activeMenuIndex[i]].getElementsByTagName(`button`);(e?.length===1?e[0]:null)?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){let{level:e}=this,t=this._levelsListNode,n=t?.getElementsByTagName(`li`);if(!e||!t||!n)return;let r=this._facilitiesListNode?.getElementsByTagName(`li`);this._activeMenuIndex.menuItems=r?r.length-1:-1;let i=[];for(let e=0;e<n.length;e++){let t=n[e].getElementsByTagName(`button`);t?.length===1&&i.push(t[0])}i.forEach((t,n)=>{t.getAttribute(`data-id`)===e&&(t.focus(),this._activeMenuIndex.levels=n)})}_onItemFocus(e){let t=e.currentTarget,n=t.getAttribute(`data-list-id`),r=t.getAttribute(`data-id`),i=n===`sites`?this._sitesListNode:n===`facilities`?this._facilitiesListNode:n===`levels`?this._levelsListNode:null;if(!i)return;let a=i?.getElementsByTagName(`li`);if(!a)return;let o=[];Array.from(a).forEach(e=>{let t=e.getElementsByTagName(`button`);t?.length===1&&o.push(t[0])});let s=null;switch(n){case`sites`:case`facilities`:s=`menuItems`;break;case`levels`:s=`levels`}if(!s)return;let c=s;o.forEach((e,t)=>{e.getAttribute(`data-id`)===r&&this._activeMenuIndex[c]!==t&&(this._activeMenuIndex[c]=t)})}};e([a()],y.prototype,`_searchInput`,void 0),e([a()],y.prototype,`enabled`,null),e([a()],y.prototype,`longNames`,null),e([a()],y.prototype,`minimized`,null),e([a()],y.prototype,`pinnedLevels`,null),e([a()],y.prototype,`site`,null),e([a()],y.prototype,`facility`,null),e([a()],y.prototype,`level`,null),e([a()],y.prototype,`view`,null),e([a({type:l})],y.prototype,`viewModel`,void 0),e([a(),m(`esri/widgets/FloorFilter/t9n/FloorFilter`)],y.prototype,`messages`,void 0),e([a(),m(`esri/t9n/common`)],y.prototype,`messagesCommon`,void 0),e([a()],y.prototype,`goToOverride`,null),e([a()],y.prototype,`headingLevel`,void 0),e([a()],y.prototype,`icon`,null),y=e([o(`esri.widgets.FloorFilter`)],y);const b=y;export{b as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as o}from"../core/accessorSupport/decorators.js";import s from"./Widget.js";import{css as c}from"./FloorFilter/css.js";import l from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as u}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as f,incrementHeadingLevel as p}from"./support/Heading.js";import{messageBundle as m,tsx as h}from"./support/widget.js";import{isRTL as g,storeNode as _}from"./support/widgetUtils.js";const v=new Set([`ArrowUp`,`ArrowDown`,`End`,`Home`]);let y=class extends s{constructor(e){super(e),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 l,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this.announceDeprecation=()=>{n(r.getLogger(this),`Floor Filter`,`arcgis-floor-filter`,{version:`5.0`})},this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(i(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return u({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(){let{longNames:e}=this,t=e&&this.viewModel.isNormalMode?`expanded`:`collapsed`,n=this._renderButtons(),r=this._renderFilterMenu(),i=h(`div`,{class:this.classes(c.separator)}),a=this._getComponentPosition(),o=this._getPosition(a),s=a===`top-right`||a===`bottom-right`,l=a===`top-left`||a===`bottom-left`,u=g(this.container),f=u&&l||!u&&s?r:n,p=u&&l||!u&&s?n:r;return h(`div`,{afterCreate:this._afterBaseNodeCreate,class:this.classes(c.floorFilter,d.widget,`${c.floorFilterLayout}${t}`,`${c.floorFilterPosition}${o}`),key:`floor-filter-menu`},f,this.viewModel?.filterMenuOpen?i:null,p)}_renderButtons(){let e=this._getComponentPosition(),t=this._getPosition(e),n=[];return t===`top`?(n.push(this._renderBrowseButton()),n.push(this._renderLevelButtons()),n.push(this._renderCloseLevelsButton()),n.push(this._renderZoomButton()),n.push(this._renderCollapseToggleButton())):(n.push(this._renderCollapseToggleButton()),n.push(this._renderZoomButton()),n.push(this._renderCloseLevelsButton()),n.push(this._renderLevelButtons()),n.push(this._renderBrowseButton())),h(`div`,{class:this.classes(d.widget,c.buttonContainer),key:`button-container`},n)}_renderBrowseButton(){let{longNames:e,messages:t}=this;return h(`button`,{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,(this.viewModel.state===`loading`||this.viewModel.state===`disabled`)&&d.buttonDisabled,c.browseButton,this.viewModel?.filterMenuOpen&&d.widgetButtonActive),key:`browse-button`,title:t.buttons.browse,type:`button`,onclick:this._toggleFilterMenu},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:this.icon,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;let{facility:e,messagesCommon:n,messages:r}=this,i=this.viewModel?.getFacility(e),a=(this.viewModel?.getFacilityLevels(e)).map(e=>this._renderLevelButton(e));if(!a.length)return null;let o=i&&t(r.selector.levelsLabel,{name:`"${i.name}"`});if(this._isWebScene(this.view?.map)&&a?.length>1){let t={id:`all--${e}`,facilityId:e,shortName:n.all,longName:n.all,levelNumber:null,verticalOrder:null},r=this._renderLevelButton(t);a.push(r)}return h(`ul`,{afterCreate:_,"aria-label":o,bind:this,class:this.classes(c.levelsContainer),"data-id":`levels`,"data-node-ref":`_levelsListNode`,key:`levels-button-container`,onkeydown:this._handleListKeydown},a)}_renderLevelButton(e){let{longNames:t}=this,{shortName:n,longName:r,id:i}=e,a=`levels--${i}`,o=this.level===i,s=t&&this.viewModel.isNormalMode?r:n;return!this.viewModel.isNormalMode&&!o&&!this.viewModel.levelsExpanded?null:h(`li`,{key:a},h(`button`,{bind:this,class:this.classes(d.widgetButton,o?d.widgetButtonActive:null,d.interactive,c.levelButton),"data-id":i,"data-list-id":`levels`,type:`button`,onclick:this._levelSelected,onfocus:this._onItemFocus},s))}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;let{messagesCommon:e}=this;return h(`button`,{"aria-label":e.close,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,c.closeLevelsButton),key:`close-levels-button`,title:e.close,type:`button`,onclick:this._closeLevels},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:`x`})))}_renderZoomButton(){let{longNames:e,messages:t,facility:n,site:r}=this,i=this.viewModel?.filterMenuType,a=this.viewModel?.filterMenuOpen,o=this.viewModel?.getSite(r),s=this.viewModel?.getFacility(n),l=i===`site`&&a?!o:!s;return h(`button`,{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(d.widget,d.widgetButton,l&&d.buttonDisabled,d.interactive,this.viewModel?.getFacilityLevels(n).length>0?c.zoomButtonLevels:c.zoomButton),key:`zoom-button`,title:t.buttons.zoomTo,type:`button`,onclick:this._zoomToClicked},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{icon:`zoom-to-object`,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){let{longNames:e,messagesCommon:t}=this,n=e?`chevrons-right`:`chevrons-left`,r=e?t.collapse:t.expand;return h(`button`,{"aria-label":r,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,c.minimizeToggleButton),key:`minimize-toggle-button`,title:r,type:`button`,onclick:this._toggleCollapsed},h(`div`,{class:this.classes(c.buttonInfo)},h(`calcite-icon`,{class:this.classes(c.iconFlip),icon:n,scale:`s`}),h(`span`,{class:this.classes(c.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?this.viewModel?.filterMenuType===`site`?this._renderSiteFilterMenu():this.viewModel?.filterMenuType===`facility`?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){let{messages:e,messagesCommon:t}=this,n=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,r=h(`div`,{class:this.classes(`${c.filterMenuHeader}`),key:`filter-menu-site-header`},h(`div`,{class:this.classes(c.filterMenuHeaderTextGroup)},h(f,{class:this.classes(c.filterMenuHeaderText),level:this.headingLevel},n)),h(`button`,{bind:this,class:this.classes(c.iconClose),title:t.close,type:`button`,onclick:this._closeClicked},h(`calcite-icon`,{icon:`x`}))),i=this._renderSearchInput(),a=this._renderSiteItems();return h(`div`,{class:this.classes(c.filterMenu),key:`filter-menu-site`},r,i,a)}_renderFacilityFilterMenu(){let{messages:e,messagesCommon:t,site:n}=this,r=this.viewModel?.getSite(n)?.name,i=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,a=this.viewModel.hasMultipleSites?h(`button`,{bind:this,class:this.classes(c.filterMenuHeaderBack),title:t.back,type:`button`,onclick:this._backClicked},h(`calcite-icon`,{class:this.classes(g(this.container)?c.iconRight:c.iconLeft),icon:g(this.container)?`chevron-right`:`chevron-left`})):null,o=this.viewModel.hasMultipleSites?h(f,{class:this.classes(c.filterMenuHeaderSubtext),level:p(this.headingLevel)},r):null,s=h(`div`,{class:this.classes(c.filterMenuHeader),key:`filter-menu-site-header`},a,h(`div`,{class:this.classes(c.filterMenuHeaderTextGroup)},h(f,{class:this.classes(c.filterMenuHeaderText),level:this.headingLevel},i),o),h(`button`,{bind:this,class:this.classes(c.iconClose),title:t.close,type:`button`,onclick:this._closeClicked},h(`calcite-icon`,{icon:`x`}))),l=this._renderSearchInput(),u=this._renderFacilityItems();return h(`div`,{class:this.classes(c.filterMenu),key:`filter-menu-facility`},s,l,u)}_renderSearchInput(){let{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return h(`div`,{class:this.classes(c.filterMenuSearch),key:`filter-menu-search`},h(`calcite-icon`,{icon:`search`,key:`filter-menu-search-icon`}),h(`input`,{afterCreate:_,bind:this,class:this.classes(c.filterMenuSearchInput),"data-node-ref":`_searchInput`,placeholder:e.search,value:this.viewModel.searchTerm??void 0,oninput:this._onSearchChange,onpaste:this._onSearchChange}),t?h(`calcite-icon`,{bind:this,class:this.classes(c.iconClose),icon:`x`,key:`filter-menu-search-clear`,title:e.clear,onclick:this._onSearchClear}):null)}_renderBlueCircle(){return h(`span`,{class:this.classes(c.selectedItemCircle),key:`floor-filter__selected-item-circle`})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;let{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,n=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),r=n.length===0&&this.viewModel?.searchTerm&&h(`div`,{class:this.classes(d.empty)},e.noResults);return h(`ul`,{afterCreate:_,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(c.filterMenuItems),"data-id":`sites`,"data-node-ref":`_sitesListNode`,key:`filter-menu-items--sites`,tabIndex:-1,onkeydown:this._handleListKeydown},n,r)}_renderSiteItem(e){let{name:t,id:n}=e,r=`filter-menu-site--${n}`,i=this.site===n;return h(`li`,{key:r},h(`button`,{bind:this,class:this.classes(c.filterMenuSite),"data-id":n,"data-list-id":`sites`,type:`button`,onclick:this._siteSelected,onfocus:this._onItemFocus},i?this._renderBlueCircle():null,h(`span`,{class:this.classes(i?c.filterMenuSelectedItem:c.filterMenuItemName)},t),h(`calcite-icon`,{class:this.classes(g(this.container)?c.iconLeft:c.iconRight),icon:`chevron-right`,scale:`s`})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;let{messages:e,site:n}=this,r=this.viewModel.getSite(n),i=this.viewModel.filterFeatures.facilities.facilitiesInfo,a=this.viewModel.filterFacilities(i).map(e=>this._renderFacilityItem(e)),o=a.length===0&&this.viewModel?.searchTerm&&h(`div`,{class:this.classes(d.empty)},e.noResults),s=r?t(e.selector.siteFacilitiesLabel,{name:`"${r.name}"`}):e.selector.facilitiesLabel;return h(`ul`,{afterCreate:_,"aria-label":s,bind:this,class:this.classes(c.filterMenuItems),"data-id":`facilities`,"data-node-ref":`_facilitiesListNode`,key:`filter-menu-items--facilities`,tabIndex:-1,onkeydown:this._handleListKeydown},a,o)}_renderFacilityItem(e){let{name:t,id:n}=e,r=`filter-menu-facility--${n}`,i=this.facility===n;return h(`li`,{key:r},h(`button`,{bind:this,class:this.classes(c.filterMenuFacility),"data-id":n,"data-list-id":`facilities`,type:`button`,onclick:this._facilitySelected,onfocus:this._onItemFocus},i?this._renderBlueCircle():null,h(`span`,{class:this.classes(i?c.filterMenuSelectedItem:c.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(){let e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&this.viewModel?.filterMenuType===`site`&&this.viewModel?.filterMenuOpen){let e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){let e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){let e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){let 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){let t=e.currentTarget.getAttribute(`data-id`),n=this.viewModel.getSite(t),r=!1;this.site!==t&&(this.facility=null,this.level=null,r=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType(`facility`),this.viewModel.goTo(n),r&&this.viewModel.setFloors(null)}_facilitySelected(e){let t=e.currentTarget.getAttribute(`data-id`),n=this.viewModel.getFacility(t),r=!1;if(this.facility!==t){if(this.viewModel.filterMode===`base-floors`){let e=this.viewModel?.getBaseLevel(n);this.level=e?e.id:null}else this.level=null;r=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(n),r){let e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}this.viewModel.isNormalMode||this.viewModel.getFacilityLevels(t)?.length>1&&(this.viewModel.levelsExpanded=!0),setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){let t=e.currentTarget.getAttribute(`data-id`);this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return e?.declaredClass===`esri.WebScene`}_getComponentPosition(){return this.container==null?null:this.view?.ui?.getPosition(this.container)}_getPosition(e){switch(e){case`bottom-right`:case`bottom-left`:return`bottom`;default:return`top`}}_handleListKeydown(e){let t=e.currentTarget.getAttribute(`data-id`),n=null;t===`sites`||t===`facilities`?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,n=`menuItems`):t===`levels`&&(n=`levels`);let r=t===`sites`?this._sitesListNode:t===`facilities`?this._facilitiesListNode:t===`levels`?this._levelsListNode:null,{key:i}=e,a=i===`Tab`,o=v.has(i);o&&e.preventDefault();let s=r?.getElementsByTagName(`li`);s&&s.length!==0&&(o||a)&&this._handleItemNavigation(i,e.shiftKey,s,a,n)}_handleItemNavigation(e,t,n,r,i){if(!i)return;this._activeMenuIndex[i]===n.length&&this._activeMenuIndex[i]--,this._activeMenuIndex[i]===-1&&this._activeMenuIndex[i]++;let a=this._activeMenuIndex[i];switch(e){case`Home`:this._activeMenuIndex[i]=0;break;case`End`:this._activeMenuIndex[i]=n.length-1;break;case`ArrowUp`:this._activeMenuIndex[i]=this._activeMenuIndex[i]<=0?n.length-1:this._activeMenuIndex[i]-1;break;case`ArrowDown`:this._activeMenuIndex[i]=this._activeMenuIndex[i]===n.length-1?0:this._activeMenuIndex[i]+1}if(e===`Tab`&&t&&this._activeMenuIndex[i]>=0&&this._activeMenuIndex[i]--,e===`Tab`&&!t&&this._activeMenuIndex[i]<n.length&&this._activeMenuIndex[i]++,a!==this._activeMenuIndex[i]&&this._activeMenuIndex[i]>-1&&this._activeMenuIndex[i]<n.length&&!r){let e=n[this._activeMenuIndex[i]].getElementsByTagName(`button`);(e?.length===1?e[0]:null)?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){let{level:e}=this,t=this._levelsListNode,n=t?.getElementsByTagName(`li`);if(!e||!t||!n)return;let r=this._facilitiesListNode?.getElementsByTagName(`li`);this._activeMenuIndex.menuItems=r?r.length-1:-1;let i=[];for(let e=0;e<n.length;e++){let t=n[e].getElementsByTagName(`button`);t?.length===1&&i.push(t[0])}i.forEach((t,n)=>{t.getAttribute(`data-id`)===e&&(t.focus(),this._activeMenuIndex.levels=n)})}_onItemFocus(e){let t=e.currentTarget,n=t.getAttribute(`data-list-id`),r=t.getAttribute(`data-id`),i=n===`sites`?this._sitesListNode:n===`facilities`?this._facilitiesListNode:n===`levels`?this._levelsListNode:null;if(!i)return;let a=i?.getElementsByTagName(`li`);if(!a)return;let o=[];Array.from(a).forEach(e=>{let t=e.getElementsByTagName(`button`);t?.length===1&&o.push(t[0])});let s=null;switch(n){case`sites`:case`facilities`:s=`menuItems`;break;case`levels`:s=`levels`}if(!s)return;let c=s;o.forEach((e,t)=>{e.getAttribute(`data-id`)===r&&this._activeMenuIndex[c]!==t&&(this._activeMenuIndex[c]=t)})}};e([a()],y.prototype,`_searchInput`,void 0),e([a()],y.prototype,`enabled`,null),e([a()],y.prototype,`longNames`,null),e([a()],y.prototype,`minimized`,null),e([a()],y.prototype,`pinnedLevels`,null),e([a()],y.prototype,`site`,null),e([a()],y.prototype,`facility`,null),e([a()],y.prototype,`level`,null),e([a()],y.prototype,`view`,null),e([a({type:l})],y.prototype,`viewModel`,void 0),e([a(),m(`esri/widgets/FloorFilter/t9n/FloorFilter`)],y.prototype,`messages`,void 0),e([a(),m(`esri/t9n/common`)],y.prototype,`messagesCommon`,void 0),e([a()],y.prototype,`goToOverride`,null),e([a()],y.prototype,`headingLevel`,void 0),e([a()],y.prototype,`icon`,null),y=e([o(`esri.widgets.FloorFilter`)],y);const b=y;export{b as default};
|
package/widgets/Fullscreen.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import n from"../core/Logger.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./Widget.js";import o from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as l,tsx as u}from"./support/widget.js";const d={base:`esri-fullscreen`};let f=class extends a{constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import n from"../core/Logger.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import a from"./Widget.js";import o from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as l,tsx as u}from"./support/widget.js";const d={base:`esri-fullscreen`};let f=class extends a{constructor(e){super(e),this.messages=null,this.viewModel=new o({suppressDeprecationWarning:!0}),this._toggle=()=>{this.viewModel.toggle()},t(n.getLogger(this),`Fullscreen`,`arcgis-fullscreen`,{version:`4.32`})}loadDependencies(){return s({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`)})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){let e=this.viewModel?.state;return e===`active`?this.messages.exit:e===`ready`?this.messages.enter:``}get icon(){let e=this.viewModel?.state;return e===`ready`||e===`disabled`||e===`feature-unsupported`?`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(){let{fullscreenTitle:e,icon:t}=this,n=this.viewModel?.state,r=n===`feature-unsupported`;return u(`div`,{class:this.classes(d.base,c.widget)},!r&&u(`calcite-button`,{class:c.widgetButton,disabled:n===`disabled`,iconStart:t,kind:`neutral`,label:e,title:e,onclick:this._toggle}))}};e([r()],f.prototype,`element`,null),e([r({readOnly:!0})],f.prototype,`fullscreenTitle`,null),e([r()],f.prototype,`icon`,null),e([r()],f.prototype,`label`,null),e([r(),l(`esri/widgets/Fullscreen/t9n/Fullscreen`)],f.prototype,`messages`,void 0),e([r()],f.prototype,`view`,null),e([r({type:o})],f.prototype,`viewModel`,void 0),f=e([i(`esri.widgets.Fullscreen`)],f);const p=f;export{p as default};
|