@arcgis/core 5.0.0-next.55 → 5.0.0-next.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Color.d.ts +12 -4
- package/Ground.js +1 -1
- package/applications/Components/SelectionOperation.d.ts +5 -0
- package/applications/Components/SketchTooltipControls.d.ts +5 -0
- package/applications/Components/actionUtils.d.ts +5 -0
- package/applications/Components/analysisUtils.d.ts +5 -0
- package/applications/Components/arcadeEditorUtils.d.ts +5 -0
- package/applications/Components/arcadeFeatureUtils.d.ts +5 -0
- package/applications/Components/basemapUtils.d.ts +5 -0
- package/applications/Components/drawUtils.d.ts +5 -0
- package/applications/Components/featureUtils.d.ts +5 -0
- package/applications/Components/fontUtils.d.ts +5 -0
- package/applications/Components/formatUtils.d.ts +5 -0
- package/applications/Components/getDefaultUnits.d.ts +5 -0
- package/applications/Components/gfxUtils.d.ts +5 -0
- package/applications/Components/imageryUtils.d.ts +5 -0
- package/applications/Components/layerOriginUtils.d.ts +5 -0
- package/applications/Components/layersEffectsJsonUtils.d.ts +5 -0
- package/applications/Components/previewSymbol2D.d.ts +5 -0
- package/applications/Components/reactiveUtils.d.ts +6 -0
- package/applications/Components/sanitizerUtils.d.ts +5 -0
- package/applications/Components/stringUtils.d.ts +6 -2
- package/applications/Components/styleUtils.d.ts +5 -0
- package/applications/Components/svgUtils.d.ts +5 -0
- package/applications/Components/testUtils.d.ts +5 -0
- package/applications/Components/viewUtils.d.ts +5 -0
- package/applications/Components/webStyleSymbolUtils.d.ts +5 -0
- package/applications/Excalibur/videoViewUtils.d.ts +5 -0
- package/applications/ExperienceBuilder/sketchUtils.d.ts +5 -0
- package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +10 -0
- package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +10 -0
- package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +11 -1
- package/applications/KnowledgeStudio/reshape.d.ts +5 -0
- package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +5 -0
- package/applications/MapViewer/layerUtils.d.ts +5 -0
- package/applications/MapViewer/mediaUtils.d.ts +5 -0
- package/applications/MapViewer/templateUtils.d.ts +5 -0
- package/applications/PortalApp/layerUtils.d.ts +5 -0
- package/applications/SceneViewer/colorUtils.d.ts +5 -0
- package/applications/SceneViewer/devEnvironmentUtils.d.ts +5 -0
- package/applications/SceneViewer/layerUtils.d.ts +5 -0
- package/applications/SceneViewer/sceneViewerUtils.d.ts +5 -0
- package/applications/SceneViewer/symbolUtils.d.ts +5 -0
- package/applications/Urban/meshUtils.d.ts +5 -0
- package/applications/WebEditor/sketchUtils.d.ts +5 -0
- package/arcade.d.ts +22 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +1 -0
- package/assets/esri/core/workers/chunks/82ced9254b27707522ef.js +1 -0
- package/assets/esri/core/workers/chunks/8628bf45a33af786cd49.js +1 -0
- package/assets/esri/core/workers/chunks/{d63cf90d1356d1f10138.js → 8f4c480c418eba299c2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa92a7c11befbad8739f.js → b4f944ef6c174b20b619.js} +1 -1
- package/assets/esri/core/workers/chunks/c531c0e3d420a1be0ad2.js +316 -0
- package/assets/esri/core/workers/chunks/{14765f98b8ea447498a1.js → da2c41ac0f82f32013c1.js} +4 -4
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/ChapmanAtmosphere.glsl.js +5 -7
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/LineCallout.glsl.js +2 -2
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.d.ts +19 -1
- package/config.js +1 -1
- package/core/Error.d.ts +3 -4
- package/core/Error.js +1 -1
- package/core/Warning.js +1 -1
- package/core/accessorSupport/decorators.d.ts +11 -0
- package/core/accessorSupport/types.d.ts +2 -0
- package/core/has.js +1 -1
- package/core/lang.d.ts +6 -0
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/vec3.js +1 -1
- package/core/promiseUtils.d.ts +5 -0
- package/core/quantity.d.ts +5 -0
- package/core/reactiveUtils.d.ts +142 -0
- package/core/scheduling.d.ts +26 -5
- package/core/scheduling.js +1 -1
- package/core/sql/WhereClause.d.ts +2 -13
- package/core/sql/{WhereGrammar.d.ts → types.d.ts} +22 -1
- package/core/sql.d.ts +8 -0
- package/core/string.js +1 -1
- package/core/types.d.ts +30 -1
- package/core/units.d.ts +8 -0
- package/core/urlUtils.d.ts +7 -0
- package/core/workers/loaderConfig.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers.d.ts +26 -0
- package/form/elements/inputs.d.ts +55 -0
- package/form/elements.d.ts +43 -0
- package/geometry/coordinateFormatter.d.ts +33 -0
- package/geometry/geometryEngine.d.ts +16 -0
- package/geometry/operators/affineTransformOperator.d.ts +5 -0
- package/geometry/operators/alphaShapeOperator.d.ts +9 -0
- package/geometry/operators/areaOperator.d.ts +7 -0
- package/geometry/operators/autoCompleteOperator.d.ts +5 -0
- package/geometry/operators/boundaryOperator.d.ts +5 -0
- package/geometry/operators/bufferOperator.d.ts +11 -0
- package/geometry/operators/centroidOperator.d.ts +14 -0
- package/geometry/operators/clipOperator.d.ts +7 -0
- package/geometry/operators/containsOperator.d.ts +9 -0
- package/geometry/operators/convexHullOperator.d.ts +9 -0
- package/geometry/operators/crossesOperator.d.ts +7 -0
- package/geometry/operators/cutOperator.d.ts +18 -0
- package/geometry/operators/densifyOperator.d.ts +21 -0
- package/geometry/operators/differenceOperator.d.ts +7 -0
- package/geometry/operators/disjointOperator.d.ts +8 -0
- package/geometry/operators/distanceOperator.d.ts +8 -0
- package/geometry/operators/equalsOperator.d.ts +5 -0
- package/geometry/operators/extendOperator.d.ts +8 -0
- package/geometry/operators/generalizeOperator.d.ts +7 -0
- package/geometry/operators/geodesicBufferOperator.d.ts +13 -0
- package/geometry/operators/geodesicProximityOperator.d.ts +13 -0
- package/geometry/operators/geodeticAreaOperator.d.ts +11 -0
- package/geometry/operators/geodeticDensifyOperator.d.ts +12 -0
- package/geometry/operators/geodeticDistanceOperator.d.ts +14 -0
- package/geometry/operators/geodeticLengthOperator.d.ts +11 -0
- package/geometry/operators/geodeticUtilsOperator.d.ts +11 -0
- package/geometry/operators/graphicBufferOperator.d.ts +7 -0
- package/geometry/operators/integrateOperator.d.ts +9 -0
- package/geometry/operators/intersectionOperator.d.ts +7 -0
- package/geometry/operators/intersectsOperator.d.ts +9 -0
- package/geometry/operators/isNearOperator.d.ts +7 -0
- package/geometry/operators/labelPointOperator.d.ts +14 -0
- package/geometry/operators/lengthOperator.d.ts +7 -0
- package/geometry/operators/linesToPolygonsOperator.d.ts +5 -0
- package/geometry/operators/locateBetweenOperator.d.ts +10 -0
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +13 -0
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +7 -0
- package/geometry/operators/offsetOperator.d.ts +44 -0
- package/geometry/operators/overlapsOperator.d.ts +7 -0
- package/geometry/operators/polygonOverlayOperator.d.ts +6 -0
- package/geometry/operators/polygonSlicerOperator.d.ts +5 -0
- package/geometry/operators/projectOperator.d.ts +41 -0
- package/geometry/operators/proximityOperator.d.ts +8 -0
- package/geometry/operators/relateOperator.d.ts +7 -0
- package/geometry/operators/reshapeOperator.d.ts +5 -0
- package/geometry/operators/shapePreservingProjectOperator.d.ts +27 -0
- package/geometry/operators/simplifyOGCOperator.d.ts +8 -0
- package/geometry/operators/simplifyOperator.d.ts +9 -0
- package/geometry/operators/support/geographicTransformationUtils.d.ts +11 -0
- package/geometry/operators/symmetricDifferenceOperator.d.ts +12 -0
- package/geometry/operators/touchesOperator.d.ts +7 -0
- package/geometry/operators/unionOperator.d.ts +7 -0
- package/geometry/operators/withinOperator.d.ts +9 -0
- package/geometry/support/geodesicUtils.d.ts +8 -0
- package/geometry/support/jsonUtils.d.ts +7 -0
- package/geometry/support/meshUtils.d.ts +5 -0
- package/geometry/support/normalizeUtils.d.ts +7 -0
- package/geometry/support/webMercatorUtils.d.ts +12 -0
- package/geometry.d.ts +38 -0
- package/interfaces.d.ts +31 -32
- package/intl.d.ts +111 -0
- package/kernel.d.ts +5 -0
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +1 -1
- package/layers/CSVLayer.d.ts +2 -2
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/FeatureLayer.d.ts +2 -1
- package/layers/GeoJSONLayer.d.ts +2 -1
- package/layers/ILyr3DWasmPerSceneView.js +1 -1
- package/layers/Layer.d.ts +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/OGCFeatureLayer.d.ts +1 -1
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SceneLayer.d.ts +2 -1
- package/layers/StreamLayer.d.ts +6 -5
- package/layers/SubtypeGroupLayer.d.ts +3 -4
- package/layers/VectorTileLayer.d.ts +1 -1
- package/layers/WFSLayer.d.ts +2 -1
- package/layers/WMSLayer.d.ts +2 -2
- package/layers/catalog/catalogUtils.d.ts +6 -0
- package/layers/ogc/wcsUtils.d.ts +6 -0
- package/layers/ogc/wfsUtils.d.ts +6 -0
- package/layers/orientedImagery/transformations/imageToWorld.d.ts +10 -0
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.d.ts +10 -0
- package/layers/orientedImagery/types.d.ts +1 -1
- package/layers/support/arcadeUtils.d.ts +5 -0
- package/layers/support/csvUtils.d.ts +6 -0
- package/layers/support/fieldUtils.d.ts +9 -0
- package/layers/support/parquetUtils.d.ts +6 -0
- package/layers/support/rasterFunctionConstants.d.ts +9 -0
- package/layers/support/rasterFunctionUtils.d.ts +7 -0
- package/package.json +1 -1
- package/pointCloudRenderers.d.ts +44 -0
- package/popup/content.d.ts +48 -0
- package/rasterRenderers.d.ts +46 -0
- package/renderers/support/AuthoringInfo.d.ts +1 -1
- package/renderers/support/jsonUtils.d.ts +7 -0
- package/renderers/support/utils.d.ts +5 -0
- package/renderers/visualVariables/SizeVariable.d.ts +0 -3
- package/renderers/visualVariables/VisualVariable.d.ts +1 -1
- package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +1 -1
- package/renderers.d.ts +46 -0
- package/request.d.ts +17 -0
- package/rest/closestFacility.d.ts +21 -0
- package/rest/featureService/utils.d.ts +5 -0
- package/rest/find.d.ts +21 -0
- package/rest/geometryService.d.ts +14 -0
- package/rest/geoprocessor.d.ts +16 -0
- package/rest/identify.d.ts +19 -0
- package/rest/imageService.d.ts +10 -0
- package/rest/knowledgeGraphService.d.ts +39 -0
- package/rest/lastMileDelivery.d.ts +12 -0
- package/rest/locator.d.ts +24 -0
- package/rest/networkService.d.ts +5 -0
- package/rest/networks/queryAssociations.d.ts +7 -0
- package/rest/networks/support/NetworkElement.d.ts +1 -1
- package/rest/networks/synthesizeAssociationGeometries.d.ts +7 -0
- package/rest/networks/trace.d.ts +6 -0
- package/rest/places.d.ts +34 -0
- package/rest/print.d.ts +74 -0
- package/rest/query.d.ts +33 -0
- package/rest/route.d.ts +18 -0
- package/rest/serviceArea.d.ts +18 -0
- package/rest/support/AreasAndLengthsParameters.d.ts +2 -2
- package/rest/support/AttachmentQuery.d.ts +0 -1
- package/rest/support/AttributeBinsQuery.d.ts +3 -3
- package/rest/support/AutoIntervalBinParameters.d.ts +4 -4
- package/rest/support/DateBinParameters.d.ts +2 -2
- package/rest/support/DateBinTimeInterval.d.ts +1 -1
- package/rest/support/DensifyParameters.d.ts +1 -1
- package/rest/support/DirectionsFeature.d.ts +1 -1
- package/rest/support/GPMessage.d.ts +1 -1
- package/rest/support/LastMileDeliveryParameters.d.ts +1 -1
- package/rest/support/QuantizationParameters.d.ts +3 -3
- package/rest/support/Query.d.ts +0 -1
- package/rest/support/QueryMixin.d.ts +1 -1
- package/rest/support/RelationshipQuery.d.ts +0 -1
- package/rest/support/interfaces.d.ts +1 -2
- package/rest/symbolService.d.ts +9 -0
- package/smartMapping/heuristics/binLevel.d.ts +12 -0
- package/smartMapping/heuristics/scaleRange.d.ts +15 -0
- package/smartMapping/heuristics/sizeRange.d.ts +12 -0
- package/smartMapping/labels/bins.d.ts +13 -0
- package/smartMapping/labels/clusters.d.ts +16 -0
- package/smartMapping/popup/clusters.d.ts +21 -0
- package/smartMapping/popup/templates.d.ts +18 -0
- package/smartMapping/raster/renderers/classBreaks.d.ts +7 -0
- package/smartMapping/raster/renderers/colormap.d.ts +7 -0
- package/smartMapping/raster/renderers/flow.d.ts +19 -0
- package/smartMapping/raster/renderers/rgb.d.ts +7 -0
- package/smartMapping/raster/renderers/shadedRelief.d.ts +7 -0
- package/smartMapping/raster/renderers/stretch.d.ts +7 -0
- package/smartMapping/raster/renderers/uniqueValue.d.ts +7 -0
- package/smartMapping/raster/renderers/vectorField.d.ts +20 -0
- package/smartMapping/raster/support/colorRamps.d.ts +7 -0
- package/smartMapping/raster/support/utils.d.ts +5 -0
- package/smartMapping/renderers/color.d.ts +17 -0
- package/smartMapping/renderers/dotDensity.d.ts +21 -0
- package/smartMapping/renderers/heatmap.d.ts +17 -0
- package/smartMapping/renderers/location.d.ts +10 -0
- package/smartMapping/renderers/opacity.d.ts +19 -0
- package/smartMapping/renderers/pieChart.d.ts +19 -0
- package/smartMapping/renderers/predominance.d.ts +27 -0
- package/smartMapping/renderers/relationship.d.ts +48 -0
- package/smartMapping/renderers/size.d.ts +18 -0
- package/smartMapping/renderers/support/rendererUtils.d.ts +8 -0
- package/smartMapping/renderers/support/spikeUtils.d.ts +6 -0
- package/smartMapping/renderers/type.d.ts +18 -0
- package/smartMapping/renderers/univariateColorSize.d.ts +29 -0
- package/smartMapping/statistics/classBreaks.d.ts +14 -0
- package/smartMapping/statistics/heatmapStatistics.d.ts +15 -0
- package/smartMapping/statistics/histogram.d.ts +17 -0
- package/smartMapping/statistics/predominantCategories.d.ts +6 -0
- package/smartMapping/statistics/summaryStatistics.d.ts +15 -0
- package/smartMapping/statistics/summaryStatisticsForAge.d.ts +8 -1
- package/smartMapping/statistics/support/ageUtils.d.ts +8 -0
- package/smartMapping/statistics/support/predominanceUtils.d.ts +8 -1
- package/smartMapping/statistics/types.d.ts +6 -1
- package/smartMapping/statistics/uniqueValues.d.ts +13 -0
- package/smartMapping/symbology/color.d.ts +8 -0
- package/smartMapping/symbology/dotDensity.d.ts +7 -0
- package/smartMapping/symbology/flow.d.ts +8 -0
- package/smartMapping/symbology/heatmap.d.ts +8 -0
- package/smartMapping/symbology/location.d.ts +8 -0
- package/smartMapping/symbology/pieChart.d.ts +7 -0
- package/smartMapping/symbology/predominance.d.ts +7 -0
- package/smartMapping/symbology/relationship.d.ts +7 -0
- package/smartMapping/symbology/size.d.ts +7 -0
- package/smartMapping/symbology/support/colorRamps.d.ts +7 -0
- package/smartMapping/symbology/type.d.ts +8 -0
- package/support/popupUtils.d.ts +5 -0
- package/support/revision.js +1 -1
- package/support/timeUtils.d.ts +9 -0
- package/symbols/CIMSymbol.d.ts +1 -1
- package/symbols/ExtrudeSymbol3DLayer.d.ts +2 -2
- package/symbols/FillSymbol3DLayer.d.ts +1 -1
- package/symbols/LineSymbol3DLayer.d.ts +2 -2
- package/symbols/ObjectSymbol3DLayer.d.ts +2 -2
- package/symbols/PathSymbol3DLayer.d.ts +2 -2
- package/symbols/TextSymbol.d.ts +2 -2
- package/symbols/support/Symbol3DFillMaterial.d.ts +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DHalo.d.ts +8 -4
- package/symbols/support/Symbol3DHalo.js +1 -1
- package/symbols/support/cimConversionUtils.d.ts +9 -0
- package/symbols/support/cimSymbolUtils.d.ts +10 -0
- package/symbols/support/jsonUtils.d.ts +7 -0
- package/symbols/support/symbolUtils.d.ts +5 -0
- package/symbols.d.ts +59 -0
- package/tables/elements.d.ts +41 -0
- package/time/TimeExtent.d.ts +1 -1
- package/time/TimeInterval.d.ts +1 -1
- package/unionTypes.d.ts +5 -0
- package/versionManagement/utils.d.ts +5 -0
- package/versionManagement/versionAdapters/utils.d.ts +5 -0
- package/views/2d/MapViewConstraints.d.ts +18 -10
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
- package/views/2d/layers/support/RouteLayerWaypointVisualization.js +5 -0
- package/views/3d/analysis/DirectLineMeasurement/types.d.ts +5 -0
- package/views/3d/analysis/LineOfSight/types.d.ts +5 -0
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -1
- package/views/3d/analysis/VolumeMeasurement/types.d.ts +5 -0
- package/views/3d/environment/ChapmanRaymarching.glsl.js +2 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +8 -8
- package/views/3d/webgl.d.ts +6 -0
- package/views/BreakpointsOwner.d.ts +16 -16
- package/views/IBreakpointsOwner.d.ts +15 -15
- package/views/MapView.d.ts +1 -1
- package/views/PopupView.d.ts +2 -2
- package/views/SelectionManager.d.ts +1 -0
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.d.ts +6 -8
- package/views/analysis/AreaMeasurement/types.d.ts +6 -0
- package/views/analysis/DistanceMeasurement/types.d.ts +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -4
- package/views/analysis/ElevationProfile/types.d.ts +6 -0
- package/views/analysis/types.d.ts +5 -0
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/GridSnappingEngine.js +1 -1
- package/views/layers/BuildingSceneLayerView.d.ts +1 -1
- package/views/layers/LayerView.d.ts +1 -1
- package/views/support/colorUtils.d.ts +5 -0
- package/views/support/selectionUtils.js +1 -1
- package/webscene/types.d.ts +5 -0
- package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -2
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +1 -1
- package/widgets/Home/HomeViewModel.d.ts +1 -1
- package/widgets/Locate/LocateViewModel.d.ts +2 -2
- package/widgets/Search/types.d.ts +5 -0
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/smartMapping/support/utils.d.ts +6 -0
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/symbolPreviewUtils.js +1 -1
- package/widgets/support/widget.d.ts +11 -0
- package/assets/esri/core/workers/chunks/0d1e8d5d9abee38e275e.js +0 -316
- package/assets/esri/core/workers/chunks/73c3ee2697265b0f7208.js +0 -1
- package/assets/esri/core/workers/chunks/cd2ea924cb91cdb6dde9.js +0 -1
- package/assets/esri/core/workers/chunks/d57577c02fb2932e8305.js +0 -1
- package/colorUtils.d.ts +0 -13
- package/core/Logger.d.ts +0 -29
- package/core/Message.d.ts +0 -2
- package/core/Message.js +0 -5
- package/core/accessorSupport/PropertyOrigin.d.ts +0 -2
- package/core/sql/sql92grammar.d.ts +0 -12
- package/core/string.d.ts +0 -3
- package/core/time.d.ts +0 -2
- package/core/timeUtils.d.ts +0 -2
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../intl.js";import{isSome as l}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecatedFunction as n}from"../../core/deprecate.js";import a from"../../core/Error.js";import h from"../../core/Handles.js";import d from"../../core/Logger.js";import{abortMaybe as m}from"../../core/maybe.js";import{debounce as c,ignoreAbortErrors as p,after as u,throwIfAborted as g,createResolver as b}from"../../core/promiseUtils.js";import{watch as f,on as y,initial as T}from"../../core/reactiveUtils.js";import{throttle as w}from"../../core/throttle.js";import{property as _,subclass as C}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as I}from"../../editing/fieldUtils.js";import{geometryTypes as v}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as E}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as A,isSubtypeGroupLayer as F}from"../../layers/support/layerUtils.js";import{createFieldInfos as S}from"../../support/popupUtils.js";import j from"../../tables/AttributeTableTemplate.js";import R from"../../tables/support/FieldOrder.js";import x from"../../time/TimeExtent.js";import{defaultHighlightName as U,temporaryHighlightName as O}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as V}from"../../views/support/layerViewUtils.js";import{isISelectableLayerWithObjectIds as z}from"../../views/support/selectionUtils.js";import W from"./ActionColumn.js";import P from"./AttachmentsColumn.js";import H from"./FieldColumn.js";import L from"./RelationshipColumn.js";import B from"./Grid/Column.js";import G from"./Grid/Grid.js";import k from"./Grid/GridViewModel.js";import N from"./Grid/GroupColumn.js";import D from"./support/AttachmentsColumnTemplate.js";import M from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as $,isFieldColumn as Z,isRelationshipColumn as q}from"./support/columnUtils.js";import{downloadAttachmentInfo as Q,exportToCSV as K}from"./support/exportUtils.js";import J from"./support/FeatureStore.js";import X from"./support/FieldColumnTemplate.js";import Y from"./support/RelationshipColumnTemplate.js";import ee from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as te,isIFeatureTableSupportedLayerWithRelationships as ie,findRelatedLayerInSources as se,findRelationship as le,uniqueColumnNames as oe,hasColumnForField as re,findField as ne,isIFeatureTableSupportedLayerWithAttachments as ae,getTableHighlightKey as he,getRelationshipIdsToShow as de}from"./support/tableUtils.js";import{createAttributeTableElements as me}from"./support/templateUtils.js";import{goTo as ce}from"../support/goToUtils.js";import{messageBundle as pe}from"../support/widget.js";const ue="80px";let ge=class extends k{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new h,this._refreshDebounced=c(()=>this._refresh()),this._syncTemplateThrottled=w(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new M,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new o,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,r=await s.fetchItems({...e,page:o});t&&t(r)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new o,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new J),this._set("grid",new G({viewModel:this}))}initialize(){const e=async()=>{this.messages=await s("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await s("esri/t9n/common"),this.messagesUnits=await s("esri/core/t9n/Units"),this.messagesURIUtils=await s("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),f(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},T),y(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),f(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,p(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),f(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),f(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),f(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),f(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),f(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),f(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),f(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),f(()=>this.editingEnabled,()=>this.refreshCellContent()),f(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),f(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),f(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),y(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),y(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,r=o?.getObjectId(),n="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:r}),(n||"cell-click"===l)&&this._onCellInteraction(r)}),f(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),f(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),y(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),f(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),f(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),f(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),f(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),f(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),y(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),y(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),f(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),f(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=m(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return E(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return V(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return z(e)&&this._selectionManager?.sources?.includes(e)?e:null}get _subtypes(){return A(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:i,highlightIds:s}=this,l=new o;return e&&l.push({type:"geometry",geometry:e}),i?l.push({type:"selection",objectIds:s.toArray()}):t.length&&l.push({type:"objectId",objectIds:t.toArray()}),l}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>$(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>Z(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new o}set hiddenFields(e){this._set("hiddenFields",r(e,this._get("hiddenFields"),o))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return te(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>q(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!ie(e)||!i?.length)return l;const o=[],r=s?.layers||t||[];return i.forEach(t=>{const i=se(e,r,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:i,objectId:s,relationshipId:l}=t,{objectIdField:r}=i,n=le(i,l),a=i.displayField||n?.keyField||r;e.set({highlightIds:new o([s]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,l)});const h=e.hiddenFields;h.includes(oe.action)||h.add(oe.action),h.includes(oe.attachments)||h.add(oe.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await Q(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([oe.action,oe.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await K({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(n(d.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(oe.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),p(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:i,layer:s}=this;if(!this.attachmentsEnabled||!s)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await s.load();const l=this._getDefaultLayerDisplayField(s),r=await this.store.getAttachmentsByObjectId(e,!0),n=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:r,mode:r.length?"list":"file",objectId:e}),this.set({highlightIds:new o([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(l)}),i.includes(oe.action)||i.add(oe.action),null!=n&&this.scrollToIndex(n)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){n(d.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,o=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{o&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),o&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await ce(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:r,columns:n}=this,a=[],h=me(n.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new R({field:e,order:t}))}),r.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new R({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&F(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>$(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>q(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:t}=this;if(!e||!t)return null;const{elements:i,orderByFields:s}=e,o=S(t),r=[];r.push(...this._generateColumnsFromAttributeTableElements(i,s));const n=o.map(e=>{if(!e.fieldName||re(e.fieldName,r))return null;const{fieldName:i}=e,l=ne(t,i);return l?this._generateDefaultFieldColumn(l,{hidden:!0,orderByFields:s}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(l);return r.push(...n),this.attachmentsEnabled&&ae(t)&&!r.some(e=>$(e))&&r.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&ie(t)&&t.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!r.some(t=>q(t)&&t.relationshipId===e)&&r.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),r.length?r:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=ne(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:r,label:n}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{grid:m,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b}=this;return new H({description:r,direction:h,field:o,fieldName:l,grid:m,initialSortPriority:d,label:n,layer:t,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a,store:h}=this;return new N({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:r,messagesCommon:n,messagesURIUtils:a,store:h})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d}=this;return new P({description:s,fieldName:`${oe.attachments}-${i}`,grid:o,label:l,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,r=this.relationshipInfos.find(e=>e.relationshipId===o);if(!r)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:n,messages:a,messagesCommon:h,messagesURIUtils:d,store:m}=this;return new L({description:s,fieldName:`${oe.relationship}-${o}-${i}`,grid:n,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,layer:r.relatedLayer,relatedLayer:r.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,view:n}=this;if(!e?.length||!i)return null;const a=[];return e.forEach((e,h)=>{const{autoWidth:d,description:m,direction:c,flexGrow:p,fieldName:u,formatFunction:g,frozen:b,frozenToEnd:f,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,type:R,width:x}=e;if(!R)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(b&&f)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const U=!1===e.visible;if("group"===R){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const i=this._generateColumnsFromColumnTemplates(e.columnTemplates),r=U||this._isFieldHidden(e.label);a.push(new N({autoWidth:d,columns:i,description:m,flexGrow:p,frozen:b,frozenToEnd:f,grid:t,hidden:r,icon:y,iconText:T,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,textAlign:F,textWrap:S,timeZone:j,width:x}))}else if("attachment"===R){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");a.push(this._generateAttachmentsColumnFromTemplate(e,h))}else if("relationship"===R){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");a.push(this._generateRelationshipColumnFromTemplate(i,e,h))}else if(!u)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const O=U||this._isFieldHidden(u);if("column"===R)a.push(new B({autoWidth:d,description:m,direction:c,fieldName:u,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,width:x}));else if("field"===R){const h=ne(i,e.fieldName);if(!h)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:u,required:R}=e;a.push(new H({autoWidth:d,description:m,direction:c,editable:u,field:h,fieldName:h.name,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,menuConfig:v,required:R,resizable:E,sortable:A,store:r,template:e,textAlign:F,textWrap:S,timeZone:j,width:x,view:n,onShowPromptCallback:this._onShowPromptCallback}))}}),a.length?a:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(l)??[]}_generateDefaultFieldColumn(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a}=this,h=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const d=e.name,m=h?.findIndex(({field:e})=>e&&e===d)??-1,c=m>-1?h?.at(m)?.order:void 0,p=m>-1?m:void 0;return new H({direction:c,field:e,fieldName:d,grid:i,hidden:t?.hidden||this._isFieldHidden(d),initialSortPriority:p,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{attachmentsViewEnabled:a,autoWidth:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,resizable:C,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R}=e;return new P({attachmentsViewEnabled:a,autoWidth:h,description:d,fieldName:`${oe.attachments}-${t}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:i,hidden:!1===e.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,layer:s,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,resizable:C,store:n,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r}=this,n=oe.attachments;return new P({fieldName:n,grid:t,hidden:e?.hidden||this._isFieldHidden(n),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{autoWidth:a,collapsed:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,relationshipId:C,resizable:I,textAlign:v,textWrap:E,timeZone:A,width:F}=t;return new L({autoWidth:a,collapsed:h,description:d,fieldName:`${oe.relationship}-${C}-${i}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:s,hidden:!1===t.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,relationshipId:C,resizable:I,store:n,textAlign:v,textWrap:E,timeZone:A,width:F,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a}=this,{relationshipId:h}=l;return new L({...t,fieldName:`${oe.relationship}-${h}-${s}`,grid:o,hidden:i,messages:r,messagesCommon:n,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new W({hidden:this._isFieldHidden(oe.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:U}),he(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(he(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await u(25),g(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:O})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(oe.action)||s.add(oe.action),s.includes(oe.attachments)||s.add(oe.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:de(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([oe.action,oe.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new ee({columnTemplates:[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new Y({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:ue})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})),new ee({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:r}=this;if(!r||!o.length)return void t.cancel();const n=o.find(e=>e.code===l);if(!n)return void t.cancel();const a=b(),h=this._createSubtypeEditPrompt(s,n,a),d=!!r.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(n.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,s){const{_subtypes:l,messages:o,messagesCommon:r}=this,n=l.find(t=>t.code===e)?.name??`${e}`;let a="update-fields";const h=[{label:o.subtypes.useDefaultValuesOption,value:"update-fields"},{label:o.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:o.subtypes.changeWarningTitle,message:i(o.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>{a=e},actions:{primary:{label:r.apply,action:()=>s.resolve(a),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>s.resolve("undo")}},cancel:()=>s.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new ee({columnTemplates:[new X({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&I(s,i)]}):i?.fields.map(e=>[e.name,I(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?d.getLogger(this).warnOnce(e):d.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([_()],ge.prototype,"_defaultHiddenFields",null),e([_()],ge.prototype,"_effectiveTableTemplate",null),e([_()],ge.prototype,"_effectiveAttributeTableTemplate",null),e([_()],ge.prototype,"_highlights",void 0),e([_()],ge.prototype,"_highlightableLayerView",null),e([_()],ge.prototype,"_selectionManager",null),e([_()],ge.prototype,"_selectableLayer",null),e([_()],ge.prototype,"_subtypes",null),e([_()],ge.prototype,"_tableHighlightsReady",null),e([_()],ge.prototype,"_viewSelection",null),e([_()],ge.prototype,"_viewSelectionReady",null),e([_()],ge.prototype,"activeFilters",null),e([_({readOnly:!0})],ge.prototype,"activeSortOrders",null),e([_()],ge.prototype,"allRelatedTablesVisible",null),e([_()],ge.prototype,"attachmentsColumns",null),e([_()],ge.prototype,"attachmentsEnabled",null),e([_()],ge.prototype,"attachmentsViewOptions",void 0),e([_({type:j})],ge.prototype,"attributeTableTemplate",void 0),e([_()],ge.prototype,"autoRefreshEnabled",void 0),e([_()],ge.prototype,"clearPrompt",null),e([_({readOnly:!0})],ge.prototype,"columns",void 0),e([_()],ge.prototype,"dataProvider",void 0),e([_()],ge.prototype,"definitionExpression",null),e([_()],ge.prototype,"fieldColumns",null),e([_({types:v})],ge.prototype,"filterGeometry",null),e([_()],ge.prototype,"filterBySelectionEnabled",null),e([_({readOnly:!0})],ge.prototype,"grid",void 0),e([_()],ge.prototype,"hiddenFields",null),e([_()],ge.prototype,"highlightEnabled",void 0),e([_()],ge.prototype,"initialSize",null),e([_()],ge.prototype,"isQueryingOrSyncing",null),e([_()],ge.prototype,"isSyncingAttachments",null),e([_()],ge.prototype,"layer",null),e([_()],ge.prototype,"layers",void 0),e([_()],ge.prototype,"layerFieldConfigurations",null),e([_()],ge.prototype,"layerView",null),e([_()],ge.prototype,"menuConfig",void 0),e([_()],ge.prototype,"messages",void 0),e([_(),pe("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([_(),pe("esri/core/t9n/Units")],ge.prototype,"messagesUnits",void 0),e([_(),pe("esri/widgets/support/t9n/uriUtils")],ge.prototype,"messagesURIUtils",void 0),e([_()],ge.prototype,"outFields",null),e([_()],ge.prototype,"prompt",void 0),e([_()],ge.prototype,"relatedRecordsEnabled",null),e([_()],ge.prototype,"relatedTable",null),e([_()],ge.prototype,"relatedTables",void 0),e([_()],ge.prototype,"relationship",null),e([_()],ge.prototype,"relationshipColumnConfigs",void 0),e([_()],ge.prototype,"relationshipColumns",null),e([_()],ge.prototype,"relationshipConfig",null),e([_()],ge.prototype,"relationshipInfos",null),e([_()],ge.prototype,"relationships",null),e([_()],ge.prototype,"returnGeometryEnabled",null),e([_()],ge.prototype,"returnMEnabled",null),e([_()],ge.prototype,"returnZEnabled",null),e([_()],ge.prototype,"selectionSource",void 0),e([_()],ge.prototype,"showAllRelatedTables",null),e([_()],ge.prototype,"showPrompt",null),e([_()],ge.prototype,"showRelatedTableCallback",void 0),e([_({readOnly:!0,type:J})],ge.prototype,"store",void 0),e([_()],ge.prototype,"supportsAttachments",null),e([_()],ge.prototype,"supportsAddAttachments",null),e([_()],ge.prototype,"supportsDeleteAttachments",null),e([_()],ge.prototype,"supportsResizeAttachments",null),e([_()],ge.prototype,"supportsUpdateAttachments",null),e([_()],ge.prototype,"syncTemplateOnChangesEnabled",void 0),e([_()],ge.prototype,"tableController",void 0),e([_()],ge.prototype,"tableParent",void 0),e([_({type:ee})],ge.prototype,"tableTemplate",void 0),e([_()],ge.prototype,"tableTemplateOverride",void 0),e([_({type:x})],ge.prototype,"timeExtent",null),e([_()],ge.prototype,"timeZone",null),e([_()],ge.prototype,"view",null),ge=e([C("esri.widgets.FeatureTable.FeatureTableViewModel")],ge);const be=ge;export{be as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../intl.js";import{isSome as l}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecatedFunction as n}from"../../core/deprecate.js";import a from"../../core/Error.js";import h from"../../core/Handles.js";import d from"../../core/Logger.js";import{abortMaybe as m}from"../../core/maybe.js";import{debounce as c,ignoreAbortErrors as p,after as u,throwIfAborted as g,createResolver as b}from"../../core/promiseUtils.js";import{watch as f,on as y,initial as T}from"../../core/reactiveUtils.js";import{throttle as w}from"../../core/throttle.js";import{property as _,subclass as C}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as I}from"../../editing/fieldUtils.js";import{geometryTypes as v}from"../../geometry/support/typeUtils.js";import{getLowerCaseDefaultHiddenFields as E}from"../../layers/support/fieldUtils.js";import{getSubtypesFromLayer as A,isSubtypeGroupLayer as F}from"../../layers/support/layerUtils.js";import{createFieldInfos as S}from"../../support/popupUtils.js";import j from"../../tables/AttributeTableTemplate.js";import R from"../../tables/support/FieldOrder.js";import x from"../../time/TimeExtent.js";import{defaultHighlightName as U,temporaryHighlightName as O}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as V}from"../../views/support/layerViewUtils.js";import{isISelectableLayerWithObjectIds as z}from"../../views/support/selectionUtils.js";import W from"./ActionColumn.js";import P from"./AttachmentsColumn.js";import H from"./FieldColumn.js";import L from"./RelationshipColumn.js";import B from"./Grid/Column.js";import G from"./Grid/Grid.js";import k from"./Grid/GridViewModel.js";import N from"./Grid/GroupColumn.js";import D from"./support/AttachmentsColumnTemplate.js";import M from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as $,isFieldColumn as Z,isRelationshipColumn as q}from"./support/columnUtils.js";import{downloadAttachmentInfo as Q,exportToCSV as K}from"./support/exportUtils.js";import J from"./support/FeatureStore.js";import X from"./support/FieldColumnTemplate.js";import Y from"./support/RelationshipColumnTemplate.js";import ee from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as te,isIFeatureTableSupportedLayerWithRelationships as ie,findRelatedLayerInSources as se,findRelationship as le,uniqueColumnNames as oe,hasColumnForField as re,findField as ne,isIFeatureTableSupportedLayerWithAttachments as ae,getTableHighlightKey as he,getRelationshipIdsToShow as de}from"./support/tableUtils.js";import{createAttributeTableElements as me}from"./support/templateUtils.js";import{goTo as ce}from"../support/goToUtils.js";import{messageBundle as pe}from"../support/widget.js";const ue="80px";let ge=class extends k{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new h,this._refreshDebounced=c(()=>this._refresh()),this._syncTemplateThrottled=w(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new M,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new o,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,r=await s.fetchItems({...e,page:o});t&&t(r)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new o,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new J),this._set("grid",new G({viewModel:this}))}initialize(){const e=async()=>{this.messages=await s("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await s("esri/t9n/common"),this.messagesUnits=await s("esri/core/t9n/Units"),this.messagesURIUtils=await s("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),f(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},T),y(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),f(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,p(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),f(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),f(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),f(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),f(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),f(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),f(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),f(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),f(()=>this.editingEnabled,()=>this.refreshCellContent()),f(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),f(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),f(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),y(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),y(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,r=o?.getObjectId(),n="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:r}),(n||"cell-click"===l)&&this._onCellInteraction(r)}),f(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),f(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),y(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),f(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),f(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),f(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),f(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),f(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),y(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),y(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),f(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),f(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=m(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return E(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return V(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return z(e)&&this._selectionManager?.sources?.includes(e)?e:null}get _subtypes(){return A(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:i,highlightIds:s}=this,l=new o;return e&&l.push({type:"geometry",geometry:e}),i?l.push({type:"selection",objectIds:s.toArray()}):t.length&&l.push({type:"objectId",objectIds:t.toArray()}),l}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>$(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get editingEnabled(){return super.editingEnabled}set editingEnabled(e){super.editingEnabled=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>Z(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new o}set hiddenFields(e){this._set("hiddenFields",r(e,this._get("hiddenFields"),o))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return te(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>q(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!ie(e)||!i?.length)return l;const o=[],r=s?.layers||t||[];return i.forEach(t=>{const i=se(e,r,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this.store.timeZone}set timeZone(e){this.store.timeZone=e}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:i,objectId:s,relationshipId:l}=t,{objectIdField:r}=i,n=le(i,l),a=i.displayField||n?.keyField||r;e.set({highlightIds:new o([s]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,l)});const h=e.hiddenFields;h.includes(oe.action)||h.add(oe.action),h.includes(oe.attachments)||h.add(oe.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await Q(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([oe.action,oe.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await K({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(n(d.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(oe.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),p(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:i,layer:s}=this;if(!this.attachmentsEnabled||!s)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await s.load();const l=this._getDefaultLayerDisplayField(s),r=await this.store.getAttachmentsByObjectId(e,!0),n=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:r,mode:r.length?"list":"file",objectId:e}),this.set({highlightIds:new o([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(l)}),i.includes(oe.action)||i.add(oe.action),null!=n&&this.scrollToIndex(n)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){n(d.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,o=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{o&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),o&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await ce(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:r,columns:n}=this,a=[],h=me(n.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new R({field:e,order:t}))}),r.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new R({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&F(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>$(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>q(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:t}=this;if(!e||!t)return null;const{elements:i,orderByFields:s}=e,o=S(t),r=[];r.push(...this._generateColumnsFromAttributeTableElements(i,s));const n=o.map(e=>{if(!e.fieldName||re(e.fieldName,r))return null;const{fieldName:i}=e,l=ne(t,i);return l?this._generateDefaultFieldColumn(l,{hidden:!0,orderByFields:s}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(l);return r.push(...n),this.attachmentsEnabled&&ae(t)&&!r.some(e=>$(e))&&r.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&ie(t)&&t.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!r.some(t=>q(t)&&t.relationshipId===e)&&r.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),r.length?r:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=ne(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:r,label:n}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{grid:m,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b}=this;return new H({description:r,direction:h,field:o,fieldName:l,grid:m,initialSortPriority:d,label:n,layer:t,messages:c,messagesCommon:p,messagesURIUtils:u,store:g,view:b,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a,store:h}=this;return new N({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:r,messagesCommon:n,messagesURIUtils:a,store:h})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d}=this;return new P({description:s,fieldName:`${oe.attachments}-${i}`,grid:o,label:l,layer:r,messages:n,messagesCommon:a,messagesURIUtils:h,store:d,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,r=this.relationshipInfos.find(e=>e.relationshipId===o);if(!r)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:n,messages:a,messagesCommon:h,messagesURIUtils:d,store:m}=this;return new L({description:s,fieldName:`${oe.relationship}-${o}-${i}`,grid:n,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,layer:r.relatedLayer,relatedLayer:r.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,view:n}=this;if(!e?.length||!i)return null;const a=[];return e.forEach((e,h)=>{const{autoWidth:d,description:m,direction:c,flexGrow:p,fieldName:u,formatFunction:g,frozen:b,frozenToEnd:f,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,type:R,width:x}=e;if(!R)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(b&&f)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const U=!1===e.visible;if("group"===R){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const i=this._generateColumnsFromColumnTemplates(e.columnTemplates),r=U||this._isFieldHidden(e.label);a.push(new N({autoWidth:d,columns:i,description:m,flexGrow:p,frozen:b,frozenToEnd:f,grid:t,hidden:r,icon:y,iconText:T,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,textAlign:F,textWrap:S,timeZone:j,width:x}))}else if("attachment"===R){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");a.push(this._generateAttachmentsColumnFromTemplate(e,h))}else if("relationship"===R){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");a.push(this._generateRelationshipColumnFromTemplate(i,e,h))}else if(!u)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const O=U||this._isFieldHidden(u);if("column"===R)a.push(new B({autoWidth:d,description:m,direction:c,fieldName:u,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,menuConfig:v,messages:s,messagesCommon:l,messagesURIUtils:o,resizable:E,sortable:A,textAlign:F,textWrap:S,timeZone:j,width:x}));else if("field"===R){const h=ne(i,e.fieldName);if(!h)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:u,required:R}=e;a.push(new H({autoWidth:d,description:m,direction:c,editable:u,field:h,fieldName:h.name,flexGrow:p,formatFunction:g,frozen:b,frozenToEnd:f,grid:t,hidden:O,icon:y,iconText:T,initialSortPriority:w,invalid:_,label:C,labelTooltipText:I,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,menuConfig:v,required:R,resizable:E,sortable:A,store:r,template:e,textAlign:F,textWrap:S,timeZone:j,width:x,view:n,onShowPromptCallback:this._onShowPromptCallback}))}}),a.length?a:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(l)??[]}_generateDefaultFieldColumn(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a}=this,h=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const d=e.name,m=h?.findIndex(({field:e})=>e&&e===d)??-1,c=m>-1?h?.at(m)?.order:void 0,p=m>-1?m:void 0;return new H({direction:c,field:e,fieldName:d,grid:i,hidden:t?.hidden||this._isFieldHidden(d),initialSortPriority:p,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n,view:a,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{attachmentsViewEnabled:a,autoWidth:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,resizable:C,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R}=e;return new P({attachmentsViewEnabled:a,autoWidth:h,description:d,fieldName:`${oe.attachments}-${t}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:i,hidden:!1===e.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,layer:s,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,resizable:C,store:n,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:S,timeZone:j,width:R,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r}=this,n=oe.attachments;return new P({fieldName:n,grid:t,hidden:e?.hidden||this._isFieldHidden(n),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:r,store:n}=this,{autoWidth:a,collapsed:h,description:d,flexGrow:m,fieldName:c,formatFunction:p,frozen:u,frozenToEnd:g,icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,relationshipId:C,resizable:I,textAlign:v,textWrap:E,timeZone:A,width:F}=t;return new L({autoWidth:a,collapsed:h,description:d,fieldName:`${oe.relationship}-${C}-${i}`,flexGrow:m,formatFunction:p,frozen:u,frozenToEnd:g,grid:s,hidden:!1===t.visible||this._isFieldHidden(T)||this._isFieldHidden(c),icon:b,iconText:f,invalid:y,label:T,labelTooltipText:w,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:r,relationshipId:C,resizable:I,store:n,textAlign:v,textWrap:E,timeZone:A,width:F,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:r,messagesCommon:n,messagesURIUtils:a}=this,{relationshipId:h}=l;return new L({...t,fieldName:`${oe.relationship}-${h}-${s}`,grid:o,hidden:i,messages:r,messagesCommon:n,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new W({hidden:this._isFieldHidden(oe.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:U}),he(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(he(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await u(25),g(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:O})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.add(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.remove(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(oe.action)||s.add(oe.action),s.includes(oe.attachments)||s.add(oe.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:de(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([oe.action,oe.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new ee({columnTemplates:[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new Y({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:ue})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new X({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})),new ee({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:r}=this;if(!r||!o.length)return void t.cancel();const n=o.find(e=>e.code===l);if(!n)return void t.cancel();const a=b(),h=this._createSubtypeEditPrompt(s,n,a),d=!!r.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(n.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,s){const{_subtypes:l,messages:o,messagesCommon:r}=this,n=l.find(t=>t.code===e)?.name??`${e}`;let a="update-fields";const h=[{label:o.subtypes.useDefaultValuesOption,value:"update-fields"},{label:o.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:o.subtypes.changeWarningTitle,message:i(o.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>{a=e},actions:{primary:{label:r.apply,action:()=>s.resolve(a),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>s.resolve("undo")}},cancel:()=>s.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new ee({columnTemplates:[new X({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new D({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:ue})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&I(s,i)]}):i?.fields.map(e=>[e.name,I(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?d.getLogger(this).warnOnce(e):d.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([_()],ge.prototype,"_defaultHiddenFields",null),e([_()],ge.prototype,"_effectiveTableTemplate",null),e([_()],ge.prototype,"_effectiveAttributeTableTemplate",null),e([_()],ge.prototype,"_highlights",void 0),e([_()],ge.prototype,"_highlightableLayerView",null),e([_()],ge.prototype,"_selectionManager",null),e([_()],ge.prototype,"_selectableLayer",null),e([_()],ge.prototype,"_subtypes",null),e([_()],ge.prototype,"_tableHighlightsReady",null),e([_()],ge.prototype,"_viewSelection",null),e([_()],ge.prototype,"_viewSelectionReady",null),e([_()],ge.prototype,"activeFilters",null),e([_({readOnly:!0})],ge.prototype,"activeSortOrders",null),e([_()],ge.prototype,"allRelatedTablesVisible",null),e([_()],ge.prototype,"attachmentsColumns",null),e([_()],ge.prototype,"attachmentsEnabled",null),e([_()],ge.prototype,"attachmentsViewOptions",void 0),e([_({type:j})],ge.prototype,"attributeTableTemplate",void 0),e([_()],ge.prototype,"autoRefreshEnabled",void 0),e([_()],ge.prototype,"clearPrompt",null),e([_({readOnly:!0})],ge.prototype,"columns",void 0),e([_()],ge.prototype,"dataProvider",void 0),e([_()],ge.prototype,"definitionExpression",null),e([_()],ge.prototype,"fieldColumns",null),e([_({types:v})],ge.prototype,"filterGeometry",null),e([_()],ge.prototype,"filterBySelectionEnabled",null),e([_({readOnly:!0})],ge.prototype,"grid",void 0),e([_()],ge.prototype,"hiddenFields",null),e([_()],ge.prototype,"highlightEnabled",void 0),e([_()],ge.prototype,"initialSize",null),e([_()],ge.prototype,"isQueryingOrSyncing",null),e([_()],ge.prototype,"isSyncingAttachments",null),e([_()],ge.prototype,"layer",null),e([_()],ge.prototype,"layers",void 0),e([_()],ge.prototype,"layerFieldConfigurations",null),e([_()],ge.prototype,"layerView",null),e([_()],ge.prototype,"menuConfig",void 0),e([_()],ge.prototype,"messages",void 0),e([_(),pe("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),e([_(),pe("esri/core/t9n/Units")],ge.prototype,"messagesUnits",void 0),e([_(),pe("esri/widgets/support/t9n/uriUtils")],ge.prototype,"messagesURIUtils",void 0),e([_()],ge.prototype,"outFields",null),e([_()],ge.prototype,"prompt",void 0),e([_()],ge.prototype,"relatedRecordsEnabled",null),e([_()],ge.prototype,"relatedTable",null),e([_()],ge.prototype,"relatedTables",void 0),e([_()],ge.prototype,"relationship",null),e([_()],ge.prototype,"relationshipColumnConfigs",void 0),e([_()],ge.prototype,"relationshipColumns",null),e([_()],ge.prototype,"relationshipConfig",null),e([_()],ge.prototype,"relationshipInfos",null),e([_()],ge.prototype,"relationships",null),e([_()],ge.prototype,"returnGeometryEnabled",null),e([_()],ge.prototype,"returnMEnabled",null),e([_()],ge.prototype,"returnZEnabled",null),e([_()],ge.prototype,"selectionSource",void 0),e([_()],ge.prototype,"showAllRelatedTables",null),e([_()],ge.prototype,"showPrompt",null),e([_()],ge.prototype,"showRelatedTableCallback",void 0),e([_({readOnly:!0,type:J})],ge.prototype,"store",void 0),e([_()],ge.prototype,"supportsAttachments",null),e([_()],ge.prototype,"supportsAddAttachments",null),e([_()],ge.prototype,"supportsDeleteAttachments",null),e([_()],ge.prototype,"supportsResizeAttachments",null),e([_()],ge.prototype,"supportsUpdateAttachments",null),e([_()],ge.prototype,"syncTemplateOnChangesEnabled",void 0),e([_()],ge.prototype,"tableController",void 0),e([_()],ge.prototype,"tableParent",void 0),e([_({type:ee})],ge.prototype,"tableTemplate",void 0),e([_()],ge.prototype,"tableTemplateOverride",void 0),e([_({type:x})],ge.prototype,"timeExtent",null),e([_()],ge.prototype,"timeZone",null),e([_()],ge.prototype,"view",null),ge=e([C("esri.widgets.FeatureTable.FeatureTableViewModel")],ge);const be=ge;export{be as default};
|
|
@@ -111,7 +111,7 @@ export interface FeaturesViewModelEvents {
|
|
|
111
111
|
*
|
|
112
112
|
* @see [Popup#actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions)
|
|
113
113
|
* @see [PopupTemplate#actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions)
|
|
114
|
-
* @see [
|
|
114
|
+
* @see [open()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html#open)
|
|
115
115
|
* @example
|
|
116
116
|
* featuresWidget.open({
|
|
117
117
|
* location: event.mapPoint,
|
|
@@ -32,7 +32,7 @@ export interface HomeViewModelEvents {
|
|
|
32
32
|
/**
|
|
33
33
|
* Fires when the [Home#go()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go) method is called.
|
|
34
34
|
*
|
|
35
|
-
* @see [
|
|
35
|
+
* @see [go()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go)
|
|
36
36
|
* @example
|
|
37
37
|
* homeWidget.on("go", function(event){
|
|
38
38
|
* console.log("updating viewpoint");
|
|
@@ -9,7 +9,7 @@ export interface LocateViewModelEvents {
|
|
|
9
9
|
/**
|
|
10
10
|
* Fires after the `locate()` method is called and succeeds.
|
|
11
11
|
*
|
|
12
|
-
* @see [locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
|
|
12
|
+
* @see [LocateViewModel#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
|
|
13
13
|
* @example
|
|
14
14
|
* locateBtn.on("locate", ({ position }) => {
|
|
15
15
|
* const { longitude, latitude } = position.coords;
|
|
@@ -20,7 +20,7 @@ export interface LocateViewModelEvents {
|
|
|
20
20
|
/**
|
|
21
21
|
* Fires after the [Locate#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#locate) method is called and fails.
|
|
22
22
|
*
|
|
23
|
-
* @see [locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
|
|
23
|
+
* @see [LocateViewModel#locate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate)
|
|
24
24
|
*/
|
|
25
25
|
"locate-error": LocateViewModelLocateErrorEvent;
|
|
26
26
|
}
|
|
@@ -134,7 +134,7 @@ export interface TimeSliderViewModelEvents {
|
|
|
134
134
|
* Fires when a user clicks on an action in the actions menu.
|
|
135
135
|
*
|
|
136
136
|
* @since 4.21
|
|
137
|
-
* @see [
|
|
137
|
+
* @see [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TimeSlider.html#actions)
|
|
138
138
|
* @example
|
|
139
139
|
* // Add an action to reset the time extent to the full time extent.
|
|
140
140
|
* timeSlider.actions.add({
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../core/accessorSupport/decorators.js";import i from"./Widget.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{messageBundle as n,tsx as c}from"./support/widget.js";import a from"./UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js";const l="esri-un-validate-topology",r={container:`${l}__container`,content:`${l}__content`,controlsContainer:`${l}__controls-container`,statusIconError:`${l}__status-icon-error`,statusIconSuccess:`${l}__status-icon-success`,statusIconContainer:`${l}__status-icon-container`};let d=class extends i{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new a}loadDependencies(){return s({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get extentToValidate(){return this.viewModel.extentToValidate}set extentToValidate(t){this.viewModel.extentToValidate=t}get icon(){return"check-circle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.label??""}set label(t){this._overrideIfSome("label",t)}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{viewModel:t}=this;return"disabled"===t.state?c("div",{class:r.container},c("calcite-block",{class:r.content,collapsible:!1,expanded:!0,heading:this.label},this._renderLoadErrorStatusIcon(),this._renderLoadErrorsNotices())):c("div",{class:r.container},c("calcite-block",{class:r.content,collapsible:!0,expanded:!1,heading:this.label},this._renderStatusIcon(),this._renderValidateTopologyAction(),this._renderControls()))}_extentOptionSelectChange(t){this.extentToValidate=t.currentTarget.value}_getLoadErrorMessagesAsNotices(t,e){return c("calcite-notice",{closable:!1,key:"error-notice-"+e,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t))}_handleValidateTopologyAction(){this.viewModel.validateTopology().catch(()=>{})}_renderControls(){const{viewModel:t}=this;return"failed"===t.state?c("div",{class:r.controlsContainer},this._renderExtentOptionSelect(),this._renderStatusNotice()):this._renderExtentOptionSelect()}_renderExtentOptionSelect(){const{messages:t,viewModel:e}=this;return c("div",{key:"selectExtentDiv"},c("calcite-select",{bind:this,disabled:"loading"===e.state||"executing"===e.state,label:t.input.extentToValidate,onCalciteSelectChange:this._extentOptionSelectChange},c("calcite-option",{value:"current"},t.input.currentExtent),c("calcite-option",{value:"entire"},t.input.entireExtent)))}_renderLoadErrorsNotices(){const{viewModel:t}=this;return c("div",{class:r.controlsContainer,key:"loadErrorsDiv"},t.loadErrors.items.map(this._getLoadErrorMessagesAsNotices))}_renderLoadErrorStatusIcon(){return c("div",{class:r.statusIconContainer,key:"statusDiv",slot:"control"},c("calcite-icon",{class:r.statusIconError,icon:"exclamation-mark-triangle",scale:"s"}))}_renderStatusIcon(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-status-action`,i=`${this.id}-error-status-icon`,s=`${this.id}-success-status-icon`,n=t=>{setTimeout(()=>{t.textContent=""},3500)};return"executing"===e.state?c("div",{key:"statusDivExecuting",slot:"control"},c("calcite-action",{id:o,loading:!0,text:t.status.executing}),c("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:o},c("span",null,t.status.executing))):"success"===e.state?c("div",{afterCreate:n,class:r.statusIconContainer,key:"statusDivSuccess",slot:"control"},c("calcite-icon",{class:r.statusIconSuccess,icon:"check-circle",id:s,scale:"s"}),c("calcite-tooltip",{referenceElement:s},c("span",null,t.status.success))):"failed"===e.state?c("div",{class:r.statusIconContainer,key:"statusDivFailed",slot:"control"},c("calcite-icon",{class:r.statusIconError,icon:"exclamation-mark-triangle",id:i,scale:"s"}),c("calcite-tooltip",{referenceElement:i},c("span",null,e.executionError))):c("div",{class:r.statusIconContainer,key:"statusDiv",slot:"control"})}_renderStatusNotice(){const{viewModel:t}=this;return c("div",{key:"executionErrorDiv"},c("calcite-notice",{closable:!0,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t.executionError)))}_renderValidateTopologyAction(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-action`;return c("div",{key:"actionDiv",slot:"control"},c("calcite-action",{bind:this,disabled:"executing"===e.state,icon:"play-f",id:o,loading:"loading"===e.state,onclick:this._handleValidateTopologyAction,text:t.input.validateTopology}),c("calcite-tooltip",{referenceElement:o},c("span",null,"loading"===e.state?t.status.loading:t.input.validateTopology)))}};t([e()],d.prototype,"extentToValidate",null),t([e()],d.prototype,"icon",null),t([e()],d.prototype,"label",null),t([e(),n("esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology")],d.prototype,"messages",void 0),t([e()],d.prototype,"utilityNetwork",null),t([e()],d.prototype,"view",null),t([e({type:a})],d.prototype,"viewModel",void 0),d=t([o("esri.widgets.UtilityNetworkValidateTopology")],d);const p=d;export{p as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../core/accessorSupport/decorators.js";import i from"./Widget.js";import{loadCalciteComponents as s}from"./support/componentsUtils.js";import{messageBundle as n,tsx as c}from"./support/widget.js";import a from"./UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js";const l="esri-un-validate-topology",r={container:`${l}__container`,content:`${l}__content`,controlsContainer:`${l}__controls-container`,statusIconError:`${l}__status-icon-error`,statusIconSuccess:`${l}__status-icon-success`,statusIconContainer:`${l}__status-icon-container`};let d=class extends i{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new a}loadDependencies(){return s({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get extentToValidate(){return this.viewModel.extentToValidate}set extentToValidate(t){this.viewModel.extentToValidate=t}get icon(){return"check-circle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.label??""}set label(t){this._overrideIfSome("label",t)}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(t){this.viewModel.utilityNetwork=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{viewModel:t}=this;return"disabled"===t.state?c("div",{class:r.container},c("calcite-block",{class:r.content,collapsible:!1,expanded:!0,heading:this.label},this._renderLoadErrorStatusIcon(),this._renderLoadErrorsNotices())):c("div",{class:r.container},c("calcite-block",{class:r.content,collapsible:!0,expanded:!1,heading:this.label},this._renderStatusIcon(),this._renderValidateTopologyAction(),this._renderControls()))}_extentOptionSelectChange(t){this.extentToValidate=t.currentTarget.value}_getLoadErrorMessagesAsNotices(t,e){return c("calcite-notice",{closable:!1,key:"error-notice-"+e,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t))}_handleValidateTopologyAction(){this.viewModel.validateTopology().catch(()=>{})}_renderControls(){const{viewModel:t}=this;return"failed"===t.state?c("div",{class:r.controlsContainer},this._renderExtentOptionSelect(),this._renderStatusNotice()):this._renderExtentOptionSelect()}_renderExtentOptionSelect(){const{messages:t,viewModel:e}=this;return c("div",{key:"selectExtentDiv"},c("calcite-select",{bind:this,disabled:"loading"===e.state||"executing"===e.state,label:t.input.extentToValidate,onCalciteSelectChange:this._extentOptionSelectChange},c("calcite-option",{selected:"current"===e.extentToValidate,value:"current"},t.input.currentExtent),c("calcite-option",{selected:"entire"===e.extentToValidate,value:"entire"},t.input.entireExtent)))}_renderLoadErrorsNotices(){const{viewModel:t}=this;return c("div",{class:r.controlsContainer,key:"loadErrorsDiv"},t.loadErrors.items.map(this._getLoadErrorMessagesAsNotices))}_renderLoadErrorStatusIcon(){return c("div",{class:r.statusIconContainer,key:"statusDiv",slot:"control"},c("calcite-icon",{class:r.statusIconError,icon:"exclamation-mark-triangle",scale:"s"}))}_renderStatusIcon(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-status-action`,i=`${this.id}-error-status-icon`,s=`${this.id}-success-status-icon`,n=t=>{setTimeout(()=>{t.textContent=""},3500)};return"executing"===e.state?c("div",{key:"statusDivExecuting",slot:"control"},c("calcite-action",{id:o,loading:!0,text:t.status.executing}),c("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:o},c("span",null,t.status.executing))):"success"===e.state?c("div",{afterCreate:n,class:r.statusIconContainer,key:"statusDivSuccess",slot:"control"},c("calcite-icon",{class:r.statusIconSuccess,icon:"check-circle",id:s,scale:"s"}),c("calcite-tooltip",{referenceElement:s},c("span",null,t.status.success))):"failed"===e.state?c("div",{class:r.statusIconContainer,key:"statusDivFailed",slot:"control"},c("calcite-icon",{class:r.statusIconError,icon:"exclamation-mark-triangle",id:i,scale:"s"}),c("calcite-tooltip",{referenceElement:i},c("span",null,e.executionError))):c("div",{class:r.statusIconContainer,key:"statusDiv",slot:"control"})}_renderStatusNotice(){const{viewModel:t}=this;return c("div",{key:"executionErrorDiv"},c("calcite-notice",{closable:!0,kind:"warning",open:!0,scale:"s"},c("div",{slot:"message"},t.executionError)))}_renderValidateTopologyAction(){const{messages:t,viewModel:e}=this,o=`${this.id}-validation-action`;return c("div",{key:"actionDiv",slot:"control"},c("calcite-action",{bind:this,disabled:"executing"===e.state,icon:"play-f",id:o,loading:"loading"===e.state,onclick:this._handleValidateTopologyAction,text:t.input.validateTopology}),c("calcite-tooltip",{referenceElement:o},c("span",null,"loading"===e.state?t.status.loading:t.input.validateTopology)))}};t([e()],d.prototype,"extentToValidate",null),t([e()],d.prototype,"icon",null),t([e()],d.prototype,"label",null),t([e(),n("esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology")],d.prototype,"messages",void 0),t([e()],d.prototype,"utilityNetwork",null),t([e()],d.prototype,"view",null),t([e({type:a})],d.prototype,"viewModel",void 0),d=t([o("esri.widgets.UtilityNetworkValidateTopology")],d);const p=d;export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import{
|
|
5
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isISelectableLayerWithObjectIds as l}from"../../../views/support/selectionUtils.js";import{fetchThumbnail as o}from"../symbolPreviewUtils.js";import s from"./ItemBase.js";let a=class extends s{constructor(t){super(t),this._thumbnail=null,this.graphic=null,this.layer=null,this.layerItem=null,this.thumbnailSize=24}get _filterTerms(){return[this.title,this.layerItem.title,this.layerItem.groupLayerItem?.title].filter(e)}get identifier(){return l(this.layer)&&null!=this.objectId?this.objectId:this.graphic}get key(){return`${this.layer.id}:${this.objectId??this.graphic.uid}`}get objectId(){return this.graphic.getObjectId()}get title(){const{objectId:t}=this;if(null!=t)return this.layerItem.featureTitleMap.get(t)||`${t}`}get thumbnail(){return this._thumbnail??void 0}get thumbnailKey(){return`${this.key}-${this.graphic.uid}`}get visible(){const{_filterTerms:t,viewModel:{activeLayerItem:e,filterText:i}}=this;if(e&&e.layer!==this.layer)return!1;if(null==i||""===i||!t.length)return!0;const r=new RegExp(i,"iu");return t.some(t=>r.test(t))}async fetchThumbnail(t){return this._thumbnail=await o(this.graphic,this.layer,{maxSize:this.thumbnailSize,ariaLabel:t?.ariaLabel})}};t([i()],a.prototype,"_filterTerms",null),t([i()],a.prototype,"_thumbnail",void 0),t([i()],a.prototype,"graphic",void 0),t([i()],a.prototype,"identifier",null),t([i()],a.prototype,"key",null),t([i()],a.prototype,"layer",void 0),t([i()],a.prototype,"layerItem",void 0),t([i()],a.prototype,"objectId",null),t([i()],a.prototype,"title",null),t([i()],a.prototype,"thumbnail",null),t([i()],a.prototype,"thumbnailKey",null),t([i()],a.prototype,"thumbnailSize",void 0),t([i()],a.prototype,"visible",null),a=t([r("esri.widgets.support.SelectionList.FeatureItem")],a);const n=a;export{n as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{countIf as t,addMany as r,isSome as s}from"../../../core/arrayUtils.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import{countIf as t,addMany as r,isSome as s}from"../../../core/arrayUtils.js";import i from"../../../core/ReactiveMap.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{getDisplayFieldNameFromFields as l}from"../../../layers/support/fieldUtils.js";import{isISelectableLayerWithObjectIds as n,isISelectableLayerViewWithObjectIds as c}from"../../../views/support/selectionUtils.js";import u from"./FeatureItem.js";import p from"./ItemBase.js";import{getSuggestedQueryOutFields as f}from"../Selector2D/selectorUtils.js";let m=class extends p{constructor(e){super(e),this._onChangeController=null,this.featureItems=[],this.featureTitleMap=new i,this.groupLayerItem=null,this.layer=null}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get effectiveSelection(){return this.selection.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){const{viewModel:e}=this;return this.selection.length>e.maxVisibleFeatureCountPerLayer&&this.visibleTotal===e.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){const e=this.layer;return n(e)?this.selection:[]}get selection(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.selection.length}get visible(){return this.featureItems.some(e=>e.visible)}get visibleTotal(){return t(this.featureItems,e=>e.visible)}cancel(){this._onChangeController?.abort()}reset(){this.featureItems.forEach(e=>e.destroy()),this.featureItems=[]}async sync({controller:e,promises:t}){const{effectiveSelection:i,layer:o}=this;this.cancel();const a=new Map(this.featureItems.map(e=>[e.identifier,e])),l=new Map,c=[],u=[];for(const r of i){const e=a.get(r);e?l.set(r,e):(c.push(r),l.set(r,null))}if(this._onChangeController=e,c.length>0){n(o)?r(u,await this._createFeatureItemsFromIds(o,c,e)):r(u,this._createFeatureItemsFromGraphics(c));for(const e of u)null!=e.identifier&&l.set(e.identifier,e)}e.signal.aborted||(this.featureItems=Array.from(l.values()).filter(s),t.push(this.syncTitles(u)))}async syncTitles(e=this.featureItems){const{layer:t}=this,r=e.map(e=>e.graphic);if("getFeatureTitles"in t&&t.getFeatureTitles){(await t.getFeatureTitles(r,{fetchMissingFields:!0,removeHTML:!0})).forEach((e,t)=>this.featureTitleMap.set(t,e))}else if(n(t)){const e=t.displayField||l(t.fields);e&&r.forEach(t=>{const r=t.getObjectId(),s=t.attributes[e];null!=r&&s&&this.featureTitleMap.set(r,s)})}}_createFeatureItemsFromGraphics(e){const{layer:t,viewModel:r}=this;return e.map(e=>new u({graphic:e,layer:t,layerItem:this,viewModel:r}))}async _createFeatureItemsFromIds(e,t,r){const{layerView:s,viewModel:i}=this,o=new Map;if(c(s)){const e=s.createQuery();e.objectIds=t,e.outFields=["*"],e.returnGeometry=!0;const i=await s.queryFeatures(e,r);for(const t of i.features){const e=t.getObjectId();null!=e&&o.set(e,t)}}if(r.signal.aborted)return[];const a=t.filter(e=>!o.has(e));if(a.length){const{view:t}=this,s=e.createQuery();s.objectIds=a,s.outSpatialReference=t?.spatialReference,s.outFields=t?f(e,t,!0):["*"],s.returnGeometry=!0;const i=await e.queryFeatures(s,r);for(const e of i.features){const t=e.getObjectId();null!=t&&o.set(t,e)}}return Array.from(o.values()).map(t=>new u({graphic:t,layer:e,layerItem:this,viewModel:i}))}};e([o()],m.prototype,"_onChangeController",void 0),e([o()],m.prototype,"effectiveObjectIds",null),e([o()],m.prototype,"effectiveSelection",null),e([o()],m.prototype,"featureItems",void 0),e([o()],m.prototype,"featureTitleMap",void 0),e([o()],m.prototype,"groupLayerItem",void 0),e([o()],m.prototype,"layer",void 0),e([o()],m.prototype,"maxVisibleFeatureCountExceeded",null),e([o()],m.prototype,"maxVisibleFeatureCountPerLayer",null),e([o()],m.prototype,"objectIds",null),e([o()],m.prototype,"selection",null),e([o()],m.prototype,"total",null),e([o()],m.prototype,"visible",null),e([o()],m.prototype,"visibleTotal",null),m=e([a("esri.widgets.support.SelectionList.LayerItem")],m);const h=m;export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Collection.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{removeMaybe as o,abortMaybe as s}from"../../../core/maybe.js";import{ignoreAbortErrors as a,debounce as l,whenOrTimeout as n}from"../../../core/promiseUtils.js";import{watch as c,on as h,whenOnce as p}from"../../../core/reactiveUtils.js";import{property as y,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as u,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import{isISelectableLayerViewWithHighlights as f,isISelectableLayerWithObjectIds as v,isISelectableLayerWithGraphics as _,isISelectableLayer as C,isISelectableLayerBaseWithEditing as I}from"../../../views/support/selectionUtils.js";import{goTo as b}from"../goToUtils.js";import L from"./GroupLayerItem.js";import S from"./LayerItem.js";import{computeEffectiveCount as w,getNestedLayerItems as M,isLayerItem as H,isGroupLayerItem as E,getNestedFeatureItems as A}from"./selectionListUtils.js";const F=100;let T=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new r,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new d,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(a(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=l(this._onSelectionChangeController,F),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([c(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager?.sources,"change",()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager,"selection-change",()=>this._onSelectionChange())])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(o),this._layerEditAbortControllers.forEach(s)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){const{layer:e}=this;return e&&this.layerItems.find(t=>t.layer===e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return w(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return M(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const r of t.allLayerViews)if(e.set(r.layer.id,r),u(r.layer))for(const t of r.layer.sublayers)e.set(t.id,r);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){const{effectiveSelectionManager:e}=this;return e&&0!==e.count?1===e.count||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length:0}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&f(t)&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem({layer:e,graphic:t,objectId:r}){v(e)&&null!=r?this.effectiveSelectionManager?.remove(e,[r]):_(e)&&this.effectiveSelectionManager?.remove(e,[t])}deselectGroupItem(e){e.items.forEach(e=>{H(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem({layer:e}){this.replace({layer:e,selection:[]})}deselectItem(e){E(e)?this.deselectGroupItem(e):H(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){H(e)||E(e)?this._goTo(A([e]).map(e=>e.graphic)):this._goTo(e.graphic)}layersToItems(e){const{controller:t,groupLayerItem:r,layers:i,promises:o}=e,{_groupItemCache:s,_layerItemCache:a,effectiveSelectionManager:l,viewLayersAndTables:n}=this,c=i??n;if(!l||0===l.count)return[];const h=[];for(const p of c)switch(p.type){case"subtype-group":case"knowledge-graph":case"group":{const e=s.get(p),r=e??new L({layer:p,viewModel:this});e||s.set(p,r),o.push(r.sync({controller:t,promises:o})),h.push(r)}break;default:if(C(p)){const e=l.getSelection(p);if(!e?.length)continue;const i=a.get(p),s=i??new S({groupLayerItem:r,layer:p,viewModel:this});i||a.set(p,s),o.push(s.sync({controller:t,promises:o})),h.push(s)}}return h}removeFromSelection({layer:e,selection:t}){(v(e)||_(e))&&this.effectiveSelectionManager?.remove(e,t)}removeTemporaryHighlight(){this._hoverHighlightHandle=o(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.identifier;if(this.effectiveSelectionManager)for(const{layer:r}of this.effectiveSelectionManager.selections)this.replace({layer:r,selection:r===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?r:[]})}selectSingleItem(e){E(e)?this.selectSingleGroupItem(e):H(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?r:[]})}replace({layer:e,selection:t}){(v(e)||_(e))&&this.effectiveSelectionManager?.replace(e,t)}async _goTo(e){const{view:t}=this;if(t)try{await b(t,e)}catch(r){"AbortError"!==r.name&&i.getLogger(this).warn("Failed to go to feature(s)",r)}}async _generateListItems(e){try{this.removeTemporaryHighlight();const t=[],r=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=r)}catch(t){i.getLogger(this).warn("Failed updating selection",t)}}_onSelectionChange(){a(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){const{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(o),!e?.sources.length)return;const t=new Set(e.sources.map(e=>m(e)?e.parent:e));for(const r of t)C(r)&&(_(r)?this._layerEditHandles.push(r.graphics.on("change",()=>{this._onLayerEdit(r)})):I(r)&&this._layerEditHandles.push(r.on("edits",e=>{this._onLayerEdit(r,e)})))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>null!=e.objectId&&!e.error))return;const r=new AbortController;this._layerEditAbortControllers.set(e,r);const i="subtype-group"===e.type||"knowledge-graph"===e.type?this.allLayerItems.find(t=>t.layer===e):this.layerItems.find(t=>t.layer===e);if(i?.layerView){const e=i.layerView;if(await this._onLayerViewUpdate(e),r.signal.aborted)return;i.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===r&&this._layerEditAbortControllers.delete(e)}catch(r){i.getLogger(this).warn("Failed updating selected features",r)}}async _onLayerViewUpdate(e){await n(p(()=>e.updating),2e3),await p(()=>!e.updating)}};e([y()],T.prototype,"_allLayerItems",void 0),e([y()],T.prototype,"_groupItemCache",void 0),e([y()],T.prototype,"_hoverHighlightHandle",void 0),e([y()],T.prototype,"_layerEditAbortControllers",void 0),e([y()],T.prototype,"_layerEditHandles",void 0),e([y()],T.prototype,"_layerItemCache",void 0),e([y()],T.prototype,"_onChangeAbortController",void 0),e([y()],T.prototype,"_sources",null),e([y()],T.prototype,"_updatingHandles",void 0),e([y()],T.prototype,"activeLayerItem",null),e([y()],T.prototype,"allLayerItems",null),e([y()],T.prototype,"effectiveCount",null),e([y()],T.prototype,"effectiveSelectionManager",null),e([y()],T.prototype,"filterText",void 0),e([y()],T.prototype,"isUpdating",null),e([y()],T.prototype,"layer",void 0),e([y()],T.prototype,"layerItems",null),e([y()],T.prototype,"layerViewMap",null),e([y()],T.prototype,"maxVisibleFeatureCountExceeded",null),e([y()],T.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([y()],T.prototype,"selectionManager",void 0),e([y()],T.prototype,"state",null),e([y()],T.prototype,"view",void 0),e([y()],T.prototype,"viewLayersAndTables",null),e([y()],T.prototype,"visibleFeatureCount",null),e([y()],T.prototype,"visibleFeatureItems",null),e([y()],T.prototype,"visibleLayerCount",null),T=e([g("esri.widgets.support.SelectionList.SelectionListViewModel")],T);const j=T;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as g}from"./SelectionList/selectionListUtils.js";import y from"./SelectionList/SelectionListViewModel.js";import I from"./SelectionList/VisibleElements.js";const b="esri-selection-list",f=`${b}__list-item`,w={base:b,container:`${b}__container`,flowItem:`${b}__flow-item`,layerDropdown:`${b}__layer-dropdown`,listItemFeature:`${f}__feature`,listItemFeatureIcon:`${f}__feature-icon`,listItemIcon:`${f}__icon`,itemCount:`${b}__item-count`,notice:`${b}__notice`,panel:`${b}__panel`,totalCount:`${b}__total-count`};let _=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.viewModel=new y,this.visibleElements=new I,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return h("div",{class:this.classes(w.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:w.flowItem,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:w.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:w.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:w.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:w.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:w.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:w.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=g(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{appearance:"transparent","data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,type:r}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!r||"feature"===r&&o||"layer"===r&&l||"group"===r&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?w.listItemFeatureIcon:w.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:w.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],_.prototype,"_hasFilterText",null),e([n()],_.prototype,"_itemWithOpenMenu",void 0),e([n()],_.prototype,"_list",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"displayMode",void 0),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"filterText",null),e([n()],_.prototype,"highlightOnHoverEnabled",void 0),e([n()],_.prototype,"icon",null),e([n()],_.prototype,"itemActionConfigs",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"label",null),e([n()],_.prototype,"layer",null),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],_.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],_.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],_.prototype,"messagesLegend",void 0),e([n()],_.prototype,"onListItemSelect",void 0),e([n()],_.prototype,"scale",void 0),e([n()],_.prototype,"selectionManager",null),e([n()],_.prototype,"state",null),e([n()],_.prototype,"view",null),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"viewModel",void 0),e([n({type:I,nonNullable:!0})],_.prototype,"visibleElements",void 0),e([n()],_.prototype,"visibleFeatureCount",null),e([n()],_.prototype,"visibleFeatureItems",null),e([n()],_.prototype,"visibleLayerCount",null),_=e([r("esri.widgets.support.SelectionList")],_);const C=_;export{C as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as g}from"./SelectionList/selectionListUtils.js";import y from"./SelectionList/SelectionListViewModel.js";import I from"./SelectionList/VisibleElements.js";const f="esri-selection-list",b=`${f}__list-item`,w={base:f,container:`${f}__container`,flowItem:`${f}__flow-item`,layerDropdown:`${f}__layer-dropdown`,listItemFeature:`${b}__feature`,listItemFeatureIcon:`${b}__feature-icon`,listItemIcon:`${b}__icon`,itemCount:`${f}__item-count`,notice:`${f}__notice`,panel:`${f}__panel`,totalCount:`${f}__total-count`};let _=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.title=null,this.viewModel=new y,this.visibleElements=new I,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _effectiveTitle(){if(this.visibleElements.header)return this.title||this.messages?.selection}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}replace(e){this.viewModel.replace(e)}render(){return h("div",{class:this.classes(w.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:w.flowItem,heading:this._effectiveTitle,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:w.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:w.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:w.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:w.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:w.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:w.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=g(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{appearance:"transparent","data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,type:r}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!r||"feature"===r&&o||"layer"===r&&l||"group"===r&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?w.listItemFeatureIcon:w.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:w.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],_.prototype,"_effectiveTitle",null),e([n()],_.prototype,"_hasFilterText",null),e([n()],_.prototype,"_itemWithOpenMenu",void 0),e([n()],_.prototype,"_list",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"displayMode",void 0),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"filterText",null),e([n()],_.prototype,"highlightOnHoverEnabled",void 0),e([n()],_.prototype,"icon",null),e([n()],_.prototype,"itemActionConfigs",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"label",null),e([n()],_.prototype,"layer",null),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],_.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],_.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],_.prototype,"messagesLegend",void 0),e([n()],_.prototype,"onListItemSelect",void 0),e([n()],_.prototype,"scale",void 0),e([n()],_.prototype,"selectionManager",null),e([n()],_.prototype,"state",null),e([n()],_.prototype,"title",void 0),e([n()],_.prototype,"view",null),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"viewModel",void 0),e([n({type:I,nonNullable:!0})],_.prototype,"visibleElements",void 0),e([n()],_.prototype,"visibleFeatureCount",null),e([n()],_.prototype,"visibleFeatureItems",null),e([n()],_.prototype,"visibleLayerCount",null),_=e([r("esri.widgets.support.SelectionList")],_);const C=_;export{C as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{addMany as e}from"../../../core/arrayUtils.js";import{ignoreAbortErrors as r,whenOrAbort as t}from"../../../core/promiseUtils.js";import{getDisplayFieldName as s}from"../../../layers/support/fieldUtils.js";import{isKnowledgeGraphLayer as a,isLinkChartLayer as i,isMapNotesLayer as l}from"../../../layers/support/layerUtils.js";import{calculateTolerance as n}from"../../../renderers/support/clickToleranceUtils.js";import{createQueryGeometry as o}from"../../../views/support/drapedUtils.js";import{isISelectableLayerWithObjectIds as c,isISelectableLayerView as u,isISelectableLayerWithGraphics as d}from"../../../views/support/selectionUtils.js";async function
|
|
5
|
+
import{addMany as e}from"../../../core/arrayUtils.js";import{ignoreAbortErrors as r,whenOrAbort as t}from"../../../core/promiseUtils.js";import{getDisplayFieldName as s}from"../../../layers/support/fieldUtils.js";import{isKnowledgeGraphLayer as a,isLinkChartLayer as i,isMapNotesLayer as l}from"../../../layers/support/layerUtils.js";import{calculateTolerance as n}from"../../../renderers/support/clickToleranceUtils.js";import{createQueryGeometry as o}from"../../../views/support/drapedUtils.js";import{isISelectableLayerWithObjectIds as c,isISelectableLayerView as u,isISelectableLayerWithGraphics as d,isISelectableLayerViewWithObjectIds as y}from"../../../views/support/selectionUtils.js";async function p(e){const{returnFeatureTitleFields:s,returnGeometry:a,selector:i,signal:l,sources:n,view:o}=e;if(!n?.length)return[];const{layers:c,layerViews:u,graphicsLayers:d}=m(n),y=[];return await r(t(Promise.all([h({candidates:y,layers:c,returnFeatureTitleFields:s,returnGeometry:a,selector:i,signal:l,view:o}),f({candidates:y,layerViews:u,returnGeometry:a,selector:i,signal:l,view:o}),v({candidates:y,graphicsLayers:d,selector:i})]),l)),y}function m(e){const r=[],t=[],s=[];return e.forEach(e=>{(a(e)||i(e))&&e.layers?.length?r.push(...e.layers.toArray()):l(e)&&e.sublayers?.length?s.push(...e.sublayers.toArray()):c(e)?r.push(e):u(e)?t.push(e):d(e)&&s.push(e)}),{layers:r,layerViews:t,graphicsLayers:s}}async function f(r){const{candidates:s,layerViews:a,returnGeometry:i,selector:l,signal:n,view:o}=r;"point"!==l.type?await t(Promise.allSettled(a.map(async r=>{if(y(r)){const t=b(r,l,o,i),a=await r.queryFeatures(t,{signal:n});e(s,a.features)}else d(r.layer)&&await v({candidates:s,graphicsLayers:[r.layer],selector:l})})),n):await g({candidates:s,layerViews:a,selector:l,view:o})}async function g({candidates:e,layerViews:r,selector:t,view:s}){const a=s.toScreen(t);if(!a)return;const i=r.map(e=>e.layer),{results:l}=await s.hitTest(a,{include:i});l.forEach(r=>{"graphic"in r&&r.graphic&&e.push(r.graphic)})}async function h(r){const{candidates:s,layers:a,returnFeatureTitleFields:i,returnGeometry:l,selector:n,signal:o,view:c}=r;await t(Promise.allSettled(a.map(async r=>{if("isTable"in r&&r.isTable)return;const t=T(r,n,c,i,l),a=await r.queryFeatures(t,{signal:o});e(s,a.features)})),o)}function w(e,r,t){return"point"===e.type?o(e,"renderer"in r?n({renderer:r.renderer}):0,t):e}function F(e,r,t){const{fields:a,fieldsIndex:i}=e,l=new Set([e.objectIdField]);"globalIdField"in e&&null!=e.globalIdField&&i.has(e.globalIdField)&&l.add(i.get(e.globalIdField).name);const n="displayField"in e?e.displayField:null,o=s({displayField:n,fields:a});if(null!=o&&i.has(o)&&l.add(o),"subtypeField"in e&&null!=e.subtypeField){const t=i.get(e.subtypeField)?.name;if(null!=t&&l.add(t),"utilityNetworks"in r.map&&r.map.utilityNetworks?.length){const e=i.get("assetgroup");e?.name&&l.add(e.name);const r=i.get("assettype");r?.name&&l.add(r.name)}}return(t||r.requiredFieldsOptions.featureTitleFields)&&"featureTitleFields"in e&&e.featureTitleFields&&e.featureTitleFields.forEach(e=>l.add(e)),Array.from(l.values())}function b(e,r,t,s=!0){const a=e.createQuery();return a.outFields=["*"],a.geometry=w(r,e.layer,t),a.returnGeometry=s,a.outSpatialReference=t.spatialReference,a}function T(e,r,t,s=!1,a=!0){const i=e.createQuery();return i.outFields=F(e,t,s),i.geometry=w(r,e,t),i.returnGeometry=a,i.outSpatialReference=t.spatialReference,i}async function v(e){const{candidates:r,graphicsLayers:t,selector:s}=e,a=t.flatMap(e=>e.graphics.toArray())??[];if(!a?.length||!s)return;const i=await import("../../../geometry/operators/intersectsOperator.js");i.accelerateGeometry(s),a.forEach(e=>{e.geometry&&"mesh"!==e.geometry.type&&i.execute(s,e.geometry)&&r.push(e)})}export{f as collectSelectionFromFeatureLayerViews,h as collectSelectionFromFeatureLayers,v as collectSelectionFromGraphicsLayers,p as getSelectionFromGeometry,w as getSuggestedQueryGeometry,F as getSuggestedQueryOutFields};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Graphic.js";import{px2pt as t}from"../../core/screenUtils.js";import{isSharedTemplateMetadata as r,isStandardFeatureTemplate as i}from"../../editing/templateUtils.js";import{isGraphic as
|
|
5
|
+
import e from"../../Graphic.js";import{px2pt as t}from"../../core/screenUtils.js";import{isSharedTemplateMetadata as r,isStandardFeatureTemplate as i}from"../../editing/templateUtils.js";import{isGraphic as o}from"../../support/guards.js";import{renderPreviewHTML as n}from"../../symbols/support/symbolUtils.js";async function a(e,a,m){if(!o(e)&&r(e)&&e.thumbnail){const t=`data:image/png;base64,${e.thumbnail.imageData}`,r=document.createElement("div");return r.classList.add("esri-thumbnail-preview"),"geometryType"in a&&a.geometryType&&r.classList.add(`esri-thumbnail-preview--${a.geometryType}`),r.style.backgroundImage=`url(${t})`,r}const l=await s(a,e);if(null==l)return null;const y={maxSize:t(m?.maxSize??32),ariaLabel:m?.ariaLabel};if((o(e)||i(e))&&"renderer"in a&&"dictionary"===a.renderer?.type&&(y.fieldMap=a.renderer.fieldMap??void 0,y.feature=o(e)?e:{attributes:e.prototype.attributes??{}}),o(e)&&e.geometry&&!1!==m?.useGeometry&&!e.geometry.type.includes("point")){y.geometry=e.geometry,y.useMarkerSymbolSize=!1;const r=t(m?.maxSize??22);y.size={width:r,height:r}}return await n(l,y)}async function s(t,i){if(!o(i)&&r(i))return l(t);if("renderer"in t&&t.renderer){const{renderer:r}=t,n=o(i)?i:new e({attributes:i.prototype.attributes});if("getSymbolAsync"in r){const e=await r.getSymbolAsync(n);if(e)return e}}return"graphics"===t.type&&o(i)&&i.geometry?m(i.geometry.type):l(t)}async function m(e){const t="point"===e||"multipoint"===e?await import("../../symbols/SimpleMarkerSymbol.js"):"polyline"===e?await import("../../symbols/SimpleLineSymbol.js"):"polygon"===e||"mesh"===e||"multipatch"===e?await import("../../symbols/SimpleFillSymbol.js"):null;return t?new t.default:null}async function l(e){return"geometryType"in e&&e.geometryType?m(e.geometryType):null}export{a as fetchThumbnail};
|