@arcgis/core 6.0.0-next.40 → 6.0.0-next.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/059cda6f11a91dbc9e28.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +1 -0
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +1 -0
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +1 -0
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +1 -0
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 46504fc81f357bc7465a.js} +1 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +1 -0
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 54de7dc0597fc80d7a52.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 6738b3d6bce34a1e8be2.js} +1 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 8b0efcc30184593a0812.js} +21 -21
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +1 -0
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → b386e921c273de3ac7a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +1 -0
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → efc1a90742813b55602e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +1 -0
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +7 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
package/widgets/Feature.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as n}from"../intl.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o}from"../core/reactiveUtils.js";import{property as s,cast as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../geometry/Point.js";import d from"./Widget.js";import f from"./Feature/FeatureAttachments.js";import p from"./Feature/FeatureContent.js";import m from"./Feature/FeatureExpression.js";import h from"./Feature/FeatureFields.js";import g from"./Feature/FeatureMedia.js";import _ from"./Feature/FeatureRelationship.js";import v from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as b}from"./Feature/resources.js";import{FeatureContentMixin as x}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as S}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{tsx as T,messageBundle as E}from"./support/widget.js";const D={title:!0,content:!0,lastEditedInfo:!0};let O=class extends x(d){constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{substitute as n}from"../intl.js";import{deprecateWidget as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{watch as a,initial as o}from"../core/reactiveUtils.js";import{property as s,cast as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../geometry/Point.js";import d from"./Widget.js";import f from"./Feature/FeatureAttachments.js";import p from"./Feature/FeatureContent.js";import m from"./Feature/FeatureExpression.js";import h from"./Feature/FeatureFields.js";import g from"./Feature/FeatureMedia.js";import _ from"./Feature/FeatureRelationship.js";import v from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as b}from"./Feature/resources.js";import{FeatureContentMixin as x}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as S}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{tsx as T,messageBundle as E}from"./support/widget.js";const D={title:!0,content:!0,lastEditedInfo:!0};let O=class extends x(d){constructor(e){super(e),this._contentWidgets=[],this.flowType=`feature`,this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...D},this.viewModel=new y({suppressDeprecationWarning:!0}),e?.suppressDeprecationWarning!==!0&&(this.announceDeprecation=()=>{r(i.getLogger(this),`Feature`,`arcgis-feature`,{version:`4.34`})})}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles(a(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),o))}loadDependencies(){return S({notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return`polygon`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...D,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){let{state:e}=this.viewModel,t=T(`div`,{class:b.container,key:`container`},this._renderTitle(),e===`error`?this._renderError():e===`loading`?this._renderLoading():this._renderContentContainer());return T(`div`,{class:this.classes(b.base,C.widget)},t)}_renderError(){let{messagesCommon:e,messages:t,visibleElements:n}=this;return T(`calcite-notice`,{icon:`exclamation-mark-circle`,kind:`danger`,open:!0,scale:`s`},n.title?T(`div`,{key:`error-title`,slot:`title`},e.errorMessage):null,T(`div`,{key:`error-message`,slot:`message`},t.loadingError))}_renderLoading(){return T(`div`,{class:b.loadingSpinnerContainer,key:`loading-container`},T(`calcite-loader`,{inline:!0,label:``}))}_renderContentContainer(){let{visibleElements:e}=this;return e.content?T(`div`,{class:b.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){let{visibleElements:e,title:t}=this;return e.title?T(w,{class:b.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){let e=this.viewModel.content,t=`content`;if(!e)return null;if(Array.isArray(e))return e.length?T(`div`,{class:b.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e==`string`){let e=this._contentWidgets[0];return!e||e.destroyed?null:T(`div`,{class:this.classes(b.contentNode,b.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){let{visibleElements:n}=this;if(typeof n.content!=`boolean`&&!n.content?.[e.type])return null;switch(e.type){case`attachments`:return this._renderAttachments(t);case`custom`:return this._renderCustom(e,t);case`fields`:return this._renderFields(t);case`media`:return this._renderMedia(t);case`text`:return this._renderText(e,t);case`expression`:return this._renderExpression(t);case`relationship`:return this._renderRelationship(t);case`utility-network-associations`:return this._renderAssociation(t);default:return null}}_renderAttachments(e){let t=this._contentWidgets[e];if(!t||t.destroyed)return null;let{state:n,attachmentInfos:r}=t.viewModel;return n===`loading`||r.length>0?T(`div`,{class:this.classes(b.contentElement),key:this._buildKey(`attachments-element`,e)},t.render()):null}_renderRelationship(e){let t=this._contentWidgets[e];return!t||t.destroyed||!this.flowItems?null:T(`div`,{class:b.contentElement,key:this._buildKey(`relationship-element`,e)},t.render())}_renderAssociation(e){let t=this._contentWidgets[e];return!t||t.destroyed||!this.flowItems?null:T(`div`,{class:b.contentElement,key:this._buildKey(`utility-network-association-element`,e)},t.render())}_renderExpression(e){let t=this._contentWidgets[e];return!t||t.destroyed||!t.viewModel.contentElement?null:T(`div`,{class:b.contentElement,key:this._buildKey(`expression-element`,e)},t.render())}_renderCustom(e,t){let{creator:n}=e,r=this._contentWidgets[t];return!r||r.destroyed?null:n?T(`div`,{class:b.contentElement,key:this._buildKey(`custom-element`,t)},r.render()):null}_renderFields(e){let t=this._contentWidgets[e];return!t||t.destroyed?null:T(`div`,{class:b.contentElement,key:this._buildKey(`fields-element`,e)},t.render())}_renderMedia(e){let t=this._contentWidgets[e];return!t||t.destroyed?null:T(`div`,{class:b.contentElement,key:this._buildKey(`media-element`,e)},t.render())}_renderLastEditInfo(){let{visibleElements:e,messages:t}=this,{lastEditInfo:r}=this.viewModel;if(!r||!e.lastEditedInfo)return null;let{date:i,user:a}=r,o=r.type===`edit`?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,s=n(o,{date:i,user:a});return T(`div`,{class:this.classes(b.lastEditedInfo,b.contentElement),key:`edit-info-element`},s)}_renderText(e,t){let n=e.text,r=this._contentWidgets[t];return!r||r.destroyed?null:n?T(`div`,{class:this.classes(b.contentElement,b.text),key:this._buildKey(`text-element`,t)},r.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||`0`}-${t.join(`-`)}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();let{headingLevel:e,visibleElements:t,flowItems:n,viewModel:r}=this,i=r?.content,{contentViewModels:a}=r;if(Array.isArray(i))i.forEach((i,o)=>{if(i.type===`attachments`&&(this._contentWidgets[o]=new f({displayType:i.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:a[o]})),i.type===`fields`&&(this._contentWidgets[o]=new h({viewModel:a[o]})),i.type===`media`&&(this._contentWidgets[o]=new g({viewModel:a[o]})),i.type===`text`&&(this._contentWidgets[o]=new p({viewModel:a[o]})),i.type===`custom`&&(this._contentWidgets[o]=new p({viewModel:a[o]})),i.type===`expression`&&(this._contentWidgets[o]=new m({viewModel:a[o]})),i.type===`relationship`){let e=new _({flowItems:n,featureVisibleElements:t,viewModel:a[o]});this._contentWidgets[o]=e}if(i.type===`utility-network-associations`){let e=new v({flowItems:n,onSelectAssociationType:async e=>{let{viewModel:i,listType:a,title:o}=e;if(!n)return;i.activeAssociationType=a;let{default:s}=await import(`./Feature/FeatureUtilityNetworkAssociationList.js`),c=new s({viewModel:i,parentFeatureViewModel:r,listType:a,title:o,featureVisibleElements:t,description:r.title,flowItems:n});n.push(c)},parentFeatureViewModel:r,featureVisibleElements:t,viewModel:a[o]});this._contentWidgets[o]=e}},this);else{let e=a[0];e&&!e.destroyed&&(this._contentWidgets[0]=new p({viewModel:e}))}this.scheduleRender()}};e([s()],O.prototype,`flowType`,void 0),e([s({type:t})],O.prototype,`graphic`,null),e([s()],O.prototype,`defaultPopupTemplateEnabled`,null),e([s()],O.prototype,`flowItems`,void 0),e([s()],O.prototype,`headingLevel`,void 0),e([s({readOnly:!0})],O.prototype,`isTable`,null),e([s()],O.prototype,`icon`,null),e([s()],O.prototype,`label`,null),e([s({type:u})],O.prototype,`location`,null),e([s(),E(`esri/widgets/Feature/t9n/Feature`)],O.prototype,`messages`,void 0),e([s(),E(`esri/t9n/common`)],O.prototype,`messagesCommon`,void 0),e([s()],O.prototype,`spatialReference`,null),e([s()],O.prototype,`timeZone`,null),e([s({readOnly:!0})],O.prototype,`title`,null),e([s()],O.prototype,`visibleElements`,void 0),e([c(`visibleElements`)],O.prototype,`castVisibleElements`,null),e([s()],O.prototype,`map`,null),e([s()],O.prototype,`view`,null),e([s({type:y})],O.prototype,`viewModel`,void 0),O=e([l(`esri.widgets.Feature`)],O);export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{stripHTML as n}from"../../../core/string.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{AssociationDetails as a}from"./AssociationDetails.js";import o from"./VisibleElements.js";import{loadCalciteComponents as s}from"../../support/componentsUtils.js";import{globalCss as c}from"../../support/globalCss.js";import{Heading as l}from"../../support/Heading.js";import{tsx as u,tsxFragment as d,messageBundle as f}from"../../support/widget.js";import p from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import m from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as h}from"../../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as g}from"../../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as _}from"../../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";const v=`esri-feature-form-utility-network-association-list`,y={base:v,header:`${v}__header`,headingContent:`${v}__heading-content`,listContainer:`${v}__list-container`};let b=class extends m{constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{stripHTML as n}from"../../../core/string.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{AssociationDetails as a}from"./AssociationDetails.js";import o from"./VisibleElements.js";import{loadCalciteComponents as s}from"../../support/componentsUtils.js";import{globalCss as c}from"../../support/globalCss.js";import{Heading as l}from"../../support/Heading.js";import{tsx as u,tsxFragment as d,messageBundle as f}from"../../support/widget.js";import p from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import m from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as h}from"../../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as g}from"../../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as _}from"../../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";const v=`esri-feature-form-utility-network-association-list`,y={base:v,header:`${v}__header`,headingContent:`${v}__heading-content`,listContainer:`${v}__list-container`};let b=class extends m{constructor(e){super(e),this._isLoadingSelectFeature=!1,this._numFilteredItems=0,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new p,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return s({chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),fab:()=>import(`@esri/calcite-components/dist/components/calcite-fab`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}get _featureInfosPage(){return this._featureInfos.slice(0,this.endIndex)}get _featureInfos(){let e=this.associationInput?.associatedFeatures;return e?e.toArray():[]}get associatedFeatureCount(){return this._featureInfos.length}render(){let{associationInput:e}=this;if(!e)return u(`div`,{class:this.classes(y.base,c.widget)});let{associatedLayer:t}=e,{state:n}=this.viewModel;return u(`div`,{class:this.classes(y.base,c.widget)},n===`loading`||n===`querying`?this.renderLoading():t?this._renderFeatureList(e,t):this._renderLayerList(e))}_renderLayerList(e){let{associatedFeatureInfos:t,associationFeature:n,editable:r}=e;if(n)return u(`div`,{class:y.listContainer},u(`calcite-list`,{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(t.keys(),t=>this._renderLayerItem(e,t))),r?u(`calcite-fab`,{appearance:`outline-fill`,icon:`plus`,key:`${e.uid}-add-button`,kind:`neutral`,text:this.messagesCommon.add,textEnabled:!0,onclick:()=>this.onAddAssociation({feature:n,associationType:e.activeAssociationType,utilityNetwork:e.utilityNetwork})}):null)}_renderFeatureList(e,t){return u(d,null,this._renderHeader(e,t),u(`div`,{class:y.listContainer},this.renderFeatureCountWarning(),u(`calcite-list`,{afterCreate:()=>this._numFilteredItems=this.associatedFeatureCount,afterRemoved:()=>this._numFilteredItems=0,filterEnabled:!0,filterLabel:this.messagesFeature.associationFilterPlaceholder,filterPlaceholder:this.messagesFeature.associationFilterPlaceholder,key:`associated-features-list-${t.id}`,label:this.messagesFeatureForm?.associations.associatedFeatures,onCalciteListFilter:e=>this._numFilteredItems=e.currentTarget?.filteredItems.length},this._renderAssociatedFeatureListPage(),this.renderFeatureObserver())))}_renderLayerTitle(e){return e.title?u(l,{key:`title`,level:this.headingLevel},u(`div`,{class:y.headingContent},u(`calcite-icon`,{icon:`layer`}),e.title)):null}_renderTotal(e){let n=t(this.messagesFeature?.numberRecords,{number:this._numFilteredItems});return u(`div`,{key:e.id},n)}_renderHeader(e,t){let{messagesFeatureForm:n}=this,{activeAssociationType:r,associationFeature:i,featureItem:o}=e;if(i)return u(`div`,{class:y.header,key:`filter`},this.visibleElements.associationDetails?u(a,{associationType:r?.type,feature:i,heading:o?.label,messages:n.associations}):void 0,this._renderLayerTitle(t),this._renderTotal(t))}_renderAssociatedFeatureListPage(){let{_featureInfosPage:e}=this;return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){let{tooltipReferenceMap:t}=this,n=e.feature.uid.toString();return g(e.association)?u(`calcite-tooltip`,{key:`tooltip-${n}`,overlayPositioning:`fixed`,referenceElement:t.get(n),topLayerDisabled:this.topLayerDisabled},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){let t=this.messagesCommon.untitled,r=e.title||t,i=e.feature.uid.toString();return u(`calcite-list-item`,{description:n(e.terminalName??``),key:`associated-feature-type-${i}`,label:n(r),onCalciteListItemSelect:()=>this._selectAssociation(e)},g(e.association)?this.renderConnectivityIcon(e.association.associationType,i):null,_(e.association)?u(`calcite-chip`,{label:h(e.association),scale:`s`,slot:`content-end`},h(e.association)):null,u(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderTooltips(e){return e.map(e=>this._renderItemTooltip(e))}_renderAssociatedFeatureList(e){return e.map(e=>this._renderAssociatedFeature(e))}_renderLayerItem(e,t){let{associatedFeatureInfos:n}=e,r=n.get(t)?.length??0;return u(`calcite-list-item`,{expanded:!0,key:`${t.id}-show-all`,label:t.title??this.messagesCommon.untitled,value:t.id,onCalciteListItemSelect:()=>this.onSelectLayer({layer:t})},u(`calcite-chip`,{label:r.toString(),scale:`s`,slot:`content-end`},r),u(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}async _selectAssociation(e){this._isLoadingSelectFeature||=(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:e.feature,association:e.association}),!1)}};e([r()],b.prototype,`_numFilteredItems`,void 0),e([r()],b.prototype,`_featureInfosPage`,null),e([r()],b.prototype,`_featureInfos`,null),e([r()],b.prototype,`associatedFeatureCount`,null),e([r()],b.prototype,`associationInput`,void 0),e([r()],b.prototype,`headingLevel`,void 0),e([r(),f(`esri/widgets/FeatureForm/t9n/FeatureForm`)],b.prototype,`messagesFeatureForm`,void 0),e([r({constructOnly:!0})],b.prototype,`onSelectLayer`,void 0),e([r({constructOnly:!0})],b.prototype,`onSelectFeature`,void 0),e([r({constructOnly:!0})],b.prototype,`onAddAssociation`,void 0),e([r({type:p})],b.prototype,`viewModel`,void 0),e([r({type:o,nonNullable:!0})],b.prototype,`visibleElements`,void 0),b=e([i(`esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList`)],b);const x=b;export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as n,initial as r,on as i}from"../../../core/reactiveUtils.js";import{stripHTML as a}from"../../../core/string.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getGraphicLayer as c}from"../../../graphic/graphicOriginUtils.js";import{isFeatureLayer as l,isSubtypeSublayer as u,isSubtypeGroupLayer as d,isGroupLayer as f}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as p,temporaryHighlightName as m}from"../../../views/support/HighlightDefaults.js";import h from"../../Widget.js";import g from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as _}from"../../support/componentsUtils.js";import v from"../../support/FilterBuilder.js";import{globalCss as y}from"../../support/globalCss.js";import{Heading as b}from"../../support/Heading.js";import x from"../../support/SelectionToolbar.js";import{tsx as S,messageBundle as C}from"../../support/widget.js";import w from"../../support/SelectionToolbar/VisibleElements.js";const T=`esri-feature-form-utility-network-association-layers`,E={base:T,header:`${T}__header`,headingContent:`${T}__heading-content`,featureObserver:`${T}__feature-observer`,filterContainer:`${T}__filter-container`,filterOptionsContainer:`${T}__filter-options-container`,filterOptionsHeader:`${T}__filter-options-header`,listContainer:`${T}__list-container`,spatialSelectContainer:`${T}__spatial-select-container`,spatialSelectToolbar:`${T}__spatial-select-toolbar`,stickySpinnerContainer:`${T}__sticky-loading-container`,loadingContainer:`${T}__loading-container`};let D=class extends h{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new g,this.view=null,this._filterBuilder=new v,this._featureFilterText=``,this._layerFilterText=``,this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new x({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new w({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{let{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([n(()=>this.viewModel,()=>this.reset()),n(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),n(()=>this.selectedLayer,e=>{(l(e)||u(e))&&(this._filterBuilder.layer=e),e||(this.filterOptionsVisible=!1,this._featureFilterText=``)})])}loadDependencies(){return _({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),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`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return this._selectionToolbar.state===`active`}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){let{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:n}=this.viewModel;return(n.length?n:t).map(e=>({label:e.label,graphic:e.feature,layer:c(e.feature)})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){let{featurePage:e,featuresPerPage:t}=this.viewModel,n=e*t;return this._filteredFeatureItems.toArray().slice(0,n)}render(){return S(`div`,{class:this.classes(E.base,y.widget)},this._renderContent())}applyFilterOptions(){let{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText=``,this._layerFilterText=``,this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([n(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view=e?.type===`2d`?e:null},r),n(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>d(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),i(()=>this._selectionToolbar,`before-activate`,e=>this.emit(`before-selection`,e)),i(()=>this._selectionToolbar,`complete`,this._onSelectionComplete)])}_updateToolbarSources(){let e=this.viewModel.layerItems.toArray().filter(e=>{let{parent:t}=e;return t&&(f(t)||d(t))&&!t.visible?!1:e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);let{state:e}=this.viewModel;this._observerNode&&e===`ready`&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){let{featureCount:e,featurePage:t,featureSpatialItems:n,state:r}=this.viewModel;!e&&!n.length&&t!==1?this.viewModel.featurePage=1:r===`ready`&&this.viewModel.featurePage++}_renderContent(){let{state:e,filterOptionsVisible:t}=this.viewModel;return e===`loading`?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():!this.selectedLayer&&!this.viewModel.featureSpatialItems.length?this._renderLayers():this._renderFeatures()}_renderSelectionToolbar(){let{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:n,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;let i=S(`div`,{class:E.spatialSelectToolbar},t.render()),a=S(`calcite-button`,{appearance:`transparent`,disabled:!n.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return S(`div`,{class:E.spatialSelectContainer,key:`spatial-select-toolbar`},i,a)}_renderStickyLoading(){return this.viewModel.state===`querying`?S(`div`,{class:E.stickySpinnerContainer,key:`sticky-loader`},this._renderLoadingIcon()):null}_renderLoading(){return S(`div`,{class:E.loadingContainer,key:`loading-container`},this._renderLoadingIcon())}_renderLoadingIcon(){return S(`calcite-loader`,{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return S(`div`,{class:E.filterOptionsContainer},S(`div`,{class:E.filterOptionsHeader},S(`span`,null,this.messagesFilterBuilder.widgetLabel),S(`calcite-button`,{appearance:`transparent`,onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){let e=this.messagesFeatureForm.associations,t=e.availableLayers,n=e.filterLayers;return S(`div`,null,this._renderHeader({heading:t,placeholder:n,renderFilterOptions:!1,renderTotal:!1}),S(`div`,{class:E.listContainer},S(`calcite-list`,{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){let{_layerFilterText:e,viewModel:t,messagesCommon:n}=this,{layerItems:r,tableItems:i}=t;return r.concat(i).map(e=>({label:e.title??n.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){let{label:t,layer:n}=e;return S(`calcite-list-item`,{key:`layer-item-${n.id}`,label:a(t),onCalciteListItemSelect:()=>{this.selectedLayer=n,this._filterBuilder.reset()}},S(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderFeatures(){let{selectedLayer:e,viewModel:t}=this,n=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,i=n?void 0:e?.title||this.messagesCommon.untitled,a=r.filterFeatures;return S(`div`,null,this._renderHeader({heading:i,placeholder:a,renderFilterOptions:!n,renderTotal:!0}),S(`div`,{class:E.listContainer},S(`calcite-list`,{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){let{viewModel:t}=this,{highlightHelper:n}=t,{label:r,graphic:i}=e,o=t.featureSpatialItems.length>0?()=>n?.update(i,p):void 0,s=t.featureSpatialItems.length>0?()=>n?.update(i,m):void 0;return S(`calcite-list-item`,{key:`feature-item-${i.uid}`,label:a(r),onCalciteListItemSelect:()=>{this.selectedFeature={feature:i,label:r}},onmouseenter:o,onmouseleave:s},S(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return S(`div`,{afterCreate:this._onObserverCreate,bind:this,class:E.featureObserver,key:`feature-observer`})}_renderHeader(e){return S(`div`,{class:E.header,key:`filter`},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?S(b,{key:`title`,level:this.headingLevel},S(`div`,{class:E.headingContent},S(`calcite-icon`,{icon:`layer`}),e)):null}_renderFilter(e,t){let n=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=n?this._layerFilterText:this._featureFilterText;return S(`div`,{class:E.filterContainer,key:`filter`},S(`calcite-input`,{icon:`search`,placeholder:e,type:`search`,value:r,onCalciteInputInput:e=>{n?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){let e=this.messagesFeatureForm.associations.filterOptions;return S(`calcite-action`,{icon:`sliders`,indicator:!!this._filterBuilder.whereClause,slot:`action`,text:e,title:e,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible}})}_renderTotal(){let{messagesFeature:e,viewModel:n}=this,{featureCount:r,featureSpatialItems:i}=n,a=t(e.numberRecords,{number:i.length?i.length:r});return S(`div`,{key:`total`},a)}};e([o()],D.prototype,`filterOptionsVisible`,null),e([o()],D.prototype,`headingLevel`,void 0),e([o()],D.prototype,`isSelecting`,null),e([o(),C(`esri/t9n/common`)],D.prototype,`messagesCommon`,void 0),e([o(),C(`esri/widgets/Editor/t9n/Editor`)],D.prototype,`messagesEditor`,void 0),e([o(),C(`esri/widgets/Feature/t9n/Feature`)],D.prototype,`messagesFeature`,void 0),e([o(),C(`esri/widgets/FeatureForm/t9n/FeatureForm`)],D.prototype,`messagesFeatureForm`,void 0),e([o(),C(`esri/widgets/support/FilterBuilder/t9n/FilterBuilder`)],D.prototype,`messagesFilterBuilder`,void 0),e([o()],D.prototype,`selectedLayer`,null),e([o({type:g})],D.prototype,`viewModel`,void 0),e([o()],D.prototype,`selectedFeature`,null),e([o()],D.prototype,`filterWhereClause`,null),e([o()],D.prototype,`view`,void 0),e([o()],D.prototype,`_filterBuilder`,void 0),e([o()],D.prototype,`_featureFilterText`,void 0),e([o()],D.prototype,`_layerFilterText`,void 0),e([o()],D.prototype,`_observer`,void 0),e([o()],D.prototype,`_featureSpatialGraphics`,null),e([o()],D.prototype,`_filteredFeatureItems`,null),e([o()],D.prototype,`_filteredFeatureItemsPage`,null),e([o()],D.prototype,`_observerNode`,void 0),D=e([s(`esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList`)],D);const O=D;export{O as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as n,initial as r,on as i}from"../../../core/reactiveUtils.js";import{stripHTML as a}from"../../../core/string.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getGraphicLayer as c}from"../../../graphic/graphicOriginUtils.js";import{isFeatureLayer as l,isSubtypeSublayer as u,isSubtypeGroupLayer as d,isGroupLayer as f}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as p,temporaryHighlightName as m}from"../../../views/support/HighlightDefaults.js";import h from"../../Widget.js";import g from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as _}from"../../support/componentsUtils.js";import v from"../../support/FilterBuilder.js";import{globalCss as y}from"../../support/globalCss.js";import{Heading as b}from"../../support/Heading.js";import x from"../../support/SelectionToolbar.js";import{tsx as S,messageBundle as C}from"../../support/widget.js";import w from"../../support/SelectionToolbar/VisibleElements.js";const T=`esri-feature-form-utility-network-association-layers`,E={base:T,header:`${T}__header`,headingContent:`${T}__heading-content`,featureObserver:`${T}__feature-observer`,filterContainer:`${T}__filter-container`,filterOptionsContainer:`${T}__filter-options-container`,filterOptionsHeader:`${T}__filter-options-header`,listContainer:`${T}__list-container`,spatialSelectContainer:`${T}__spatial-select-container`,spatialSelectToolbar:`${T}__spatial-select-toolbar`,stickySpinnerContainer:`${T}__sticky-loading-container`,loadingContainer:`${T}__loading-container`};let D=class extends h{constructor(e){super(e),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new g,this.view=null,this._filterBuilder=new v,this._featureFilterText=``,this._layerFilterText=``,this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new x({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new w({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{let{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([n(()=>this.viewModel,()=>this.reset()),n(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),n(()=>this.selectedLayer,e=>{(l(e)||u(e))&&(this._filterBuilder.layer=e),e||(this.filterOptionsVisible=!1,this._featureFilterText=``)})])}loadDependencies(){return _({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),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`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`)})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return this._selectionToolbar.state===`active`}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){let{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:n}=this.viewModel;return(n.length?n:t).map(e=>({label:e.label,graphic:e.feature,layer:c(e.feature)})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){let{featurePage:e,featuresPerPage:t}=this.viewModel,n=e*t;return this._filteredFeatureItems.toArray().slice(0,n)}render(){return S(`div`,{class:this.classes(E.base,y.widget)},this._renderContent())}applyFilterOptions(){let{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText=``,this._layerFilterText=``,this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([n(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view=e?.type===`2d`?e:null},r),n(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>d(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),i(()=>this._selectionToolbar,`before-activate`,e=>this.emit(`before-selection`,e)),i(()=>this._selectionToolbar,`complete`,this._onSelectionComplete)])}_updateToolbarSources(){let e=this.viewModel.layerItems.toArray().filter(e=>{let{parent:t}=e;return t&&(f(t)||d(t))&&!t.visible?!1:e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);let{state:e}=this.viewModel;this._observerNode&&e===`ready`&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){let{featureCount:e,featurePage:t,featureSpatialItems:n,state:r}=this.viewModel;!e&&!n.length&&t!==1?this.viewModel.featurePage=1:r===`ready`&&this.viewModel.featurePage++}_renderContent(){let{state:e,filterOptionsVisible:t}=this.viewModel;return e===`loading`?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():!this.selectedLayer&&!this.viewModel.featureSpatialItems.length?this._renderLayers():this._renderFeatures()}_renderSelectionToolbar(){let{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:n,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;let i=S(`div`,{class:E.spatialSelectToolbar},t.render()),a=S(`calcite-button`,{appearance:`transparent`,disabled:!n.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return S(`div`,{class:E.spatialSelectContainer,key:`spatial-select-toolbar`},i,a)}_renderStickyLoading(){return this.viewModel.state===`querying`?S(`div`,{class:E.stickySpinnerContainer,key:`sticky-loader`},this._renderLoadingIcon()):null}_renderLoading(){return S(`div`,{class:E.loadingContainer,key:`loading-container`},this._renderLoadingIcon())}_renderLoadingIcon(){return S(`calcite-loader`,{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return S(`div`,{class:E.filterOptionsContainer},S(`div`,{class:E.filterOptionsHeader},S(`span`,null,this.messagesFilterBuilder.widgetLabel),S(`calcite-button`,{appearance:`transparent`,onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){let e=this.messagesFeatureForm.associations,t=e.availableLayers,n=e.filterLayers;return S(`div`,null,this._renderHeader({heading:t,placeholder:n,renderFilterOptions:!1,renderTotal:!1}),S(`div`,{class:E.listContainer},S(`calcite-list`,{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){let{_layerFilterText:e,viewModel:t,messagesCommon:n}=this,{layerItems:r,tableItems:i}=t;return r.concat(i).map(e=>({label:e.title??n.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){let{label:t,layer:n}=e;return S(`calcite-list-item`,{key:`layer-item-${n.id}`,label:a(t),onCalciteListItemSelect:()=>{this.selectedLayer=n,this._filterBuilder.reset()}},S(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderFeatures(){let{selectedLayer:e,viewModel:t}=this,n=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,i=n?void 0:e?.title||this.messagesCommon.untitled,a=r.filterFeatures;return S(`div`,null,this._renderHeader({heading:i,placeholder:a,renderFilterOptions:!n,renderTotal:!0}),S(`div`,{class:E.listContainer},S(`calcite-list`,{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){let{viewModel:t}=this,{highlightHelper:n}=t,{label:r,graphic:i}=e,o=t.featureSpatialItems.length>0?()=>n?.update(i,p):void 0,s=t.featureSpatialItems.length>0?()=>n?.update(i,m):void 0;return S(`calcite-list-item`,{key:`feature-item-${i.uid}`,label:a(r),onCalciteListItemSelect:()=>{this.selectedFeature={feature:i,label:r}},onmouseenter:o,onmouseleave:s},S(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return S(`div`,{afterCreate:this._onObserverCreate,bind:this,class:E.featureObserver,key:`feature-observer`})}_renderHeader(e){return S(`div`,{class:E.header,key:`filter`},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?S(b,{key:`title`,level:this.headingLevel},S(`div`,{class:E.headingContent},S(`calcite-icon`,{icon:`layer`}),e)):null}_renderFilter(e,t){let n=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=n?this._layerFilterText:this._featureFilterText;return S(`div`,{class:E.filterContainer,key:`filter`},S(`calcite-input`,{icon:`search`,placeholder:e,type:`search`,value:r,onCalciteInputInput:e=>{n?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){let e=this.messagesFeatureForm.associations.filterOptions;return S(`calcite-action`,{icon:`sliders`,indicator:!!this._filterBuilder.whereClause,slot:`action`,text:e,title:e,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible}})}_renderTotal(){let{messagesFeature:e,viewModel:n}=this,{featureCount:r,featureSpatialItems:i}=n,a=t(e.numberRecords,{number:i.length?i.length:r});return S(`div`,{key:`total`},a)}};e([o()],D.prototype,`filterOptionsVisible`,null),e([o()],D.prototype,`headingLevel`,void 0),e([o()],D.prototype,`isSelecting`,null),e([o(),C(`esri/t9n/common`)],D.prototype,`messagesCommon`,void 0),e([o(),C(`esri/widgets/Editor/t9n/Editor`)],D.prototype,`messagesEditor`,void 0),e([o(),C(`esri/widgets/Feature/t9n/Feature`)],D.prototype,`messagesFeature`,void 0),e([o(),C(`esri/widgets/FeatureForm/t9n/FeatureForm`)],D.prototype,`messagesFeatureForm`,void 0),e([o(),C(`esri/widgets/support/FilterBuilder/t9n/FilterBuilder`)],D.prototype,`messagesFilterBuilder`,void 0),e([o()],D.prototype,`selectedLayer`,null),e([o({type:g})],D.prototype,`viewModel`,void 0),e([o()],D.prototype,`selectedFeature`,null),e([o()],D.prototype,`filterWhereClause`,null),e([o()],D.prototype,`view`,void 0),e([o()],D.prototype,`_filterBuilder`,void 0),e([o()],D.prototype,`_featureFilterText`,void 0),e([o()],D.prototype,`_layerFilterText`,void 0),e([o()],D.prototype,`_observer`,void 0),e([o()],D.prototype,`_featureSpatialGraphics`,null),e([o()],D.prototype,`_filteredFeatureItems`,null),e([o()],D.prototype,`_filteredFeatureItemsPage`,null),e([o()],D.prototype,`_observerNode`,void 0),D=e([s(`esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList`)],D);const O=D;export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../Widget.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{globalCss as a}from"../../support/globalCss.js";import{tsx as o,messageBundle as s}from"../../support/widget.js";import{getAssociationTitle as c}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{isFromElement as l}from"../../support/UtilityNetworkAssociations/utils/isFromElement.js";const u=`esri-feature-form-utility-network-association-settings`,d={base:u,infoContainer:`${u}__info-container`};let f=class extends r{constructor(e
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../Widget.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{globalCss as a}from"../../support/globalCss.js";import{tsx as o,messageBundle as s}from"../../support/widget.js";import{getAssociationTitle as c}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{isFromElement as l}from"../../support/UtilityNetworkAssociations/utils/isFromElement.js";const u=`esri-feature-form-utility-network-association-settings`,d={base:u,infoContainer:`${u}__info-container`};let f=class extends r{constructor(e){super(e),this.percentAlong=50,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.sourceFeature=null,this.targetFeature=null,this.utilityNetwork=null}loadDependencies(){return i({block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`)})}get association(){return this._get(`association`)}set association(e){this.percentAlong=e.percentAlong?e.percentAlong*100:50,this._set(`association`,e)}get associationType(){return this.association.associationType}set associationType(e){this.association.associationType=e,(e===`junction-edge-to-connectivity`||e===`junction-edge-from-connectivity`)&&(this.association.percentAlong=void 0)}render(){return o(`div`,{class:this.classes(d.base,a.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_renderFromAssociationEndpoint(){let{associationType:e,association:t,sourceFeature:n,targetFeature:r,messagesFeatureForm:i}=this,a=l(n.feature,t)?n:r,o=a.label,s=c(t,`from`,i.associations);switch(e){case`connectivity`:case`junction-junction-connectivity`:case`junction-edge-midspan-connectivity`:case`junction-edge-from-connectivity`:case`junction-edge-to-connectivity`:return this._renderAssociationEndpoint(o,s,this._renderConnectivityContent(a.feature,t.fromNetworkElement))}return this._renderAssociationEndpoint(o,s)}_renderToAssociationEndpoint(){let{associationType:e,association:t,sourceFeature:n,targetFeature:r,messagesFeatureForm:i}=this,a=l(n.feature,t)?r:n,o=a.label,s=c(t,`to`,i.associations),u;switch(e){case`connectivity`:case`junction-junction-connectivity`:u=this._renderConnectivityContent(a.feature,t.toNetworkElement);break;case`containment`:u=this._isNonspatial(a.feature)?null:this._renderContainmentContent()}return this._renderAssociationEndpoint(o,s,u)}_renderAssociationEndpoint(e,t,n){return o(`calcite-block`,{description:t,expanded:!0,heading:e},n)}_renderContainmentContent(){let{messagesFeatureForm:e,association:t}=this,n=t.isContentVisible??!1;return o(`calcite-label`,{layout:`inline`},e.associations.visible,o(`calcite-switch`,{checked:n,onCalciteSwitchChange:({currentTarget:e})=>{t.isContentVisible=e.checked}}))}_renderConnectivityContent(e,t){let{messagesFeatureForm:n,utilityNetwork:r}=this,i=r.getTerminalConfiguration(e)?.terminals.map(e=>this._renderComboboxListItemNumber(e.id,t.terminalId,e.name))||[];return o(`calcite-label`,null,n.associations.terminal,o(`calcite-combobox`,{allowCustomValues:!1,label:n.associations.terminalComboboxLabel,overlayPositioning:`fixed`,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{t.terminalId=parseInt(e.value,10)}},...i))}_renderAdditionalContent(){let{associationType:e}=this;switch(e){case`connectivity`:case`junction-junction-connectivity`:case`attachment`:case`containment`:return}let t=e===`junction-edge-midspan-connectivity`?e:`junction-edge-from-connectivity`,{messagesFeatureForm:n}=this,r=[this._renderComboboxListItemString(`junction-edge-midspan-connectivity`,t,n.associations.midspanEdge),this._renderComboboxListItemString(`junction-edge-from-connectivity`,t,n.associations.endpointEdge)];return o(`div`,{class:d.infoContainer},o(`calcite-label`,{key:`additional-content`},n.associations.connectTo,o(`calcite-combobox`,{allowCustomValues:!1,label:n.associations.edgeConnectionComboboxLabel,overlayPositioning:`fixed`,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.associationType=e.value}},...r)),t===`junction-edge-midspan-connectivity`?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){let{messagesFeatureForm:e,percentAlong:t,association:n}=this;return n.percentAlong=t/100,o(`calcite-label`,{key:`midspan-edge`},e.associations.midspanLocation,o(`calcite-input-number`,{max:100,min:0,numberButtonType:`vertical`,suffixText:`%`,value:`${t}`,onCalciteInputNumberInput:({currentTarget:e})=>{this.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){let{associationType:e,messagesFeatureForm:t}=this,n=e===`junction-edge-to-connectivity`;return o(`calcite-label`,{key:`endpoint-edge`},t.associations.edgeSide,o(`calcite-label`,{layout:`inline`},t.associations.fromSide,o(`calcite-switch`,{checked:n,onCalciteSwitchChange:({currentTarget:e})=>{let t=e.checked?`junction-edge-to-connectivity`:`junction-edge-from-connectivity`;this.associationType=t}}),t.associations.toSide))}_renderComboboxListItemNumber(e,t,n){return o(`calcite-combobox-item`,{heading:n,key:`#${e}`,selected:t===e,value:`${e}`})}_renderComboboxListItemString(e,t,n){return o(`calcite-combobox-item`,{heading:n,key:`#${e}`,selected:t===e,value:`${e}`})}_isNonspatial(e){let{sourceLayer:t}=e;return t!=null&&`geometryType`in t&&t.geometryType==null}};e([t()],f.prototype,`association`,null),e([t()],f.prototype,`percentAlong`,void 0),e([t()],f.prototype,`associationType`,null),e([t()],f.prototype,`headingLevel`,void 0),e([t(),s(`esri/widgets/Feature/t9n/Feature`)],f.prototype,`messagesFeature`,void 0),e([t(),s(`esri/t9n/common`)],f.prototype,`messagesCommon`,void 0),e([t(),s(`esri/widgets/FeatureForm/t9n/FeatureForm`)],f.prototype,`messagesFeatureForm`,void 0),e([t()],f.prototype,`readOnly`,void 0),e([t()],f.prototype,`sourceFeature`,void 0),e([t()],f.prototype,`targetFeature`,void 0),e([t()],f.prototype,`utilityNetwork`,void 0),f=e([n(`esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationSettings`)],f);const p=f;export{p as default};
|
package/widgets/FeatureForm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import{isSome as r}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import o from"../core/ReactiveMap.js";import{watch as s,whenOnce as c,initial as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{isIntegerField as f}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as p,getSubtypesFromLayer as m}from"../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as h}from"../popup/support/featureUtils.js";import{isString as g}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{css as y}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as x,isFieldInput as S,isRelationshipInput as C,isTextElementInput as w,flattenInputs as T,isInputInGroupInput as E,isFieldElementWithInputType as D,getErrorMessageForFieldInput as O,getIconForFeature as k,isNumberFieldInput as A,isInputInThisGroupInput as j,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import N from"./FeatureForm/FeatureFormViewModel.js";import P from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as F}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as L,numberingSystem as R,prepareISOFieldValueForDateComponents as z,prepareUnixFieldValueForDateComponents as B,normalizeTimeOnlyString as V,getISOFieldValueFromDateComponents as H,getUnixFieldValueFromDateComponents as U}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as G,incrementHeadingLevel as K}from"./support/Heading.js";import{messageBundle as q,vmEvent as J,tsx as Y}from"./support/widget.js";import{setFocus as X}from"./support/widgetUtils.js";const Z=`data-field-name`;let Q=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay=`all`,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new N,this.visibleElements=new P,this._onShowAllRelatedRecordsClick=e=>{let{feature:t,callbacks:n}=this;t&&n?.showAllRelatedRecords&&n.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,n)=>{let{feature:r,callbacks:i}=this,a=n;if(r&&i?.addRelatedRecord){if(p(n)&&e.activeCategory){let t=e.activeCategory.value,r=n.findSublayerForSubtypeCode(t);r&&h(r)&&(a=r)}i.addRelatedRecord({parentFeature:r,relatedLayer:a,relationshipId:t})}},e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),`Feature Form`,`arcgis-feature-form`,{version:`5.0`})}),this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([s(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),c(()=>!this.viewModel.updating).then(()=>{let e=this._getFocusableInput(`forward`);this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),s(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},l),s(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on(`submit`,e=>{if(e.invalid.length>0){let[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),s(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),s(()=>this.viewModel.inputs.filter(b),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return F({block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),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`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`)})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){let{callbacks:e}=this;return!!(e?.viewAssociatedLayers&&e.viewAssociatedFeatures)}get _subtypes(){return m(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return`form-field`}set icon(e){this._overrideIfSome(`icon`,e)}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 map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){let{state:e}=this.viewModel;return Y(`div`,{class:this.classes(y.base,W.widget,W.panel)},e===`ready`?this._renderForm():null)}_renderForm(){return Y(`div`,null,Y(`form`,{class:y.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?Y(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){let{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return Y(`calcite-notice`,{class:y.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},t.disabledForm))}_renderHeader(){let e=this.viewModel,{formTitle:t,formDescription:n}=e;if(!e.formHeaderVisible)return;let r=t!=null&&Y(G,{key:`title`,level:this.headingLevel},t),i=n!=null&&Y(`p`,{class:y.description,key:`description`},n);return Y(`div`,{class:y.formHeader},r,i)}_renderContent(){let{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(r).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){if(x(e))return this._renderGroup(e);if(S(e))return this._renderLabeledField(e);if(C(e))return this._renderRelationshipInput(e);if(w(e))return this._renderTextElementInput(e);if(b(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){let{feature:t,callbacks:n}=this;t&&n?.viewAssociatedFeatures&&n.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){let{feature:t,callbacks:n}=this;t&&n?.selectAssociatedFeature&&await n.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){let{feature:t,callbacks:n}=this;t&&n?.addAssociation&&n.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({onSelectAssociationType:({viewModel:t,listType:n})=>{t.activeAssociationType=n;let{feature:r,callbacks:i}=this;r&&i?.viewAssociatedLayers&&i.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return e==null?null:Y(`div`,{class:this.classes(y.description),id:t},e)}_renderGroup(e){let{formTemplate:t,headingLevel:n}=this,{description:r,id:i,inputs:a,label:o,open:s}=e,c=a.filter(e=>e.visible),l=this.viewModel.findField(this._focusedFieldName)?.group===e,u=this.groupDisplay===`sequential`;return Y(`calcite-block`,{afterCreate:this._afterGroupCreate,class:this.classes(y.group,u?y.groupSequential:null,l?y.groupActive:null),"data-group":e,description:r||void 0,expandable:!0,expanded:s,heading:o??``,headingLevel:t?.title?K(n):n,id:i,key:i,onCalciteBlockCollapse:({currentTarget:t})=>{e.open=!1,this._onGroupToggle(t,e)},onCalciteBlockExpand:({currentTarget:t})=>{e.open=!0,this._onGroupToggle(t,e)}},c.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){let n=T(this.viewModel.inputs);e===`backward`&&n.reverse();let r;if(!t)r=0;else if(x(t)){let e=t.inputs.find(e=>e.visible);r=e?n.indexOf(e):0}else{let i;if(E(t)&&!t.group.open){let n=t.group.inputs.filter(S);i=e===`forward`?n[n.length-1]:n[0]}else i=t;r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&S(t)){if(this.disabled&&t.inputType&&(t.inputType===`switch`||t.inputType===`radio-buttons`))continue;return t}}return null}_renderLabeledField(e){let{dataType:n,feature:r,label:i,layer:a,required:o}=e,s={"aria-label":o?t(this.messages.requiredFieldLabel,{name:i}):i,class:y.label,key:`${a.id}-${r.uid}-${e.name}`},c=[Y(`div`,{class:y.labelTextContent,key:`labelTextContainer`},i,o?Y(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),n===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e)];return Y(`calcite-label`,{...s},c)}_renderFieldInput(e){let{dataType:t,domain:n,inputType:r,name:i}=e,a=this.getCommonInputProps(e);if(n?.type===`coded-value`){let t=this.viewModel.getFieldValueOptionsForField(i,this.messages.empty);return r===`switch`&&!e.hasInvalidSwitchValue?this._renderSwitchComponent(e,a):r===`radio-buttons`?this._renderRadioButtonComponents(e,t.flat(),a):this._renderComboBoxComponent(e,t,a)}return r===`datetime-picker`||t===`date`?this._renderDateComponents(e,a):t===`number`?this._renderNumberComponent(e,a):this._renderStringComponent(e,a)}_renderStringComponent(e,t){return e.inputType===`text-area`?t.readOnly?Y(`calcite-text-area`,{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-text-area`,{...t,resize:`vertical`,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-input`,{...t,loading:e.updating,type:`text`,onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){let n=f(e.field),r=n&&t.value!==``?Math.round(parseFloat(t.value)).toString():t.value;return Y(`calcite-input-number`,{...t,integer:n,loading:e.updating,step:n?1:`any`,type:`number`,value:r,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){let{field:n}=e;switch(n.type){case`date`:return this._renderDateFieldComponents(e,t);case`date-only`:return this._renderDateOnlyFieldComponent(e,t);case`time-only`:return this._renderTimeOnlyFieldComponent(e,t);case`timestamp-offset`:return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(n,t.value,{timeZone:this.timeZone,...L(n)}))}}_renderDateOnlyFieldComponent(e,t){let{range:n,valid:r,value:i}=e,{class:a,key:o,readOnly:s}=t,{rawMax:c,rawMin:l}=n;return Y(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!r,class:a,"data-date-part":`date`,"data-field-name":t[Z],key:`${o}-date-input`,max:g(c)?c:void 0,min:g(l)?l:void 0,numberingSystem:R,overlayPositioning:`fixed`,readOnly:s,topLayerDisabled:this.topLayerDisabled,value:i==null?void 0:`${i}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){let{valid:n,value:r}=e,{class:i,key:a,readOnly:o}=t;return Y(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,class:i,"data-date-part":`time`,"data-field-name":t[Z],key:`${a}-time-input`,numberingSystem:R,overlayPositioning:`fixed`,readOnly:o,step:e.timeStep,value:r==null?void 0:`${r}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){let{name:n,range:r,timeZone:i,valid:a,value:o}=e,{class:s,key:c,readOnly:l}=t,{rawMax:u,rawMin:d}=r,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,numberingSystem:R,overlayPositioning:`fixed`,readOnly:l,[Z]:n,onfocus:this._onComponentFocus},p=z(u,i),m=z(d,i),h=z(o,i);return Y(`div`,{class:y.dateInputContainer,key:`${c}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:s,"data-date-part":`date`,key:`${c}-date-input`,max:p?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:h.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),Y(`calcite-input-time-picker`,{...f,class:s,"data-date-part":`time`,key:`${c}-time-input`,step:e.timeStep,value:h.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?Y(`calcite-input-time-zone`,{...f,class:s,"data-date-part":`timeZone`,disabled:l,key:`${c}-timezone-input`,value:h.timeZoneOffset??`0`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){let{includeTime:n,name:r,valid:i,value:a}=e,{class:o,key:s,max:c,min:l,readOnly:u}=t,{timeZone:d}=this,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,numberingSystem:R,overlayPositioning:`fixed`,readOnly:u,[Z]:r,onfocus:this._onComponentFocus},p=B(a,d),m=B(c,d),h=B(l,d);return Y(`div`,{class:y.dateInputContainer,key:`${s}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:o,"data-date-part":`date`,key:`${s}-date-input`,max:m?.date??void 0,min:h?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),n?Y(`calcite-input-time-picker`,{...f,class:o,"data-date-part":`time`,key:`${s}-time-input`,step:1,value:p.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return Y(`calcite-input`,{...n,class:this.classes(y.fieldInput,y.inputDisabled),readOnly:!0,type:`text`,value:t==null?n.value:`${t}`})}_renderComboBoxComponent(e,t,n){let{value:r,name:i}=e,{viewModel:a,_inputsWithChanges:o}=this,s=a.editType===`INSERT`,c=o.has(i),l=r==null&&(!s||c),u=s&&e.showNoValueOptionEnabled&&!c?()=>{}:n.onblur;return Y(`calcite-combobox`,{...n,allowCustomValues:!1,clearDisabled:!0,overlayPositioning:`fixed`,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,onblur:u,onCalciteComboboxChange:({currentTarget:t})=>{l&&t.selectedItems.length===0?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){let{value:n,name:r}=e,{messages:i,messagesTemplates:a,viewModel:o,_inputsWithChanges:s}=this,[c,l,u]=t.map(e=>e.map(({name:e,value:t})=>Y(`calcite-combobox-item`,{heading:e,key:`#${t}`,selected:n===t,value:`${t}`}))),d=[];l.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`other`,label:a.other},l)),u.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`unsupported`,label:i.subtypes.unsupportedDomainGroupTitle},u)),d.length>0?d.unshift(Y(`calcite-combobox-item-group`,{key:`recommended`,label:i.recommended},c)):d.push(...c);let f=o.editType===`INSERT`,p=s.has(r),m=n==null&&(!f||p);return e.showNoValueOptionEnabled&&d.unshift(Y(`calcite-combobox-item`,{heading:e.showNoValueLabel||i.empty,key:`empty-option`,selected:m,value:``})),d}_renderRadioButtonComponents(e,t,n){let{value:r}=e,i=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,value:t,selected:t===r,props:n}));if(e.showNoValueOptionEnabled){let t=e.showNoValueLabel||this.messages.empty,a=r===``||r===null;i.unshift(this._renderRadioButtonComponent({key:`empty-option`,label:t,value:``,selected:a,props:n}))}return Y(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,"data-field-name":n[Z],key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.key}-${this.id}`,required:n.required},i)}_renderSwitchComponent(e,t){let{value:n}=e,r=D(e.element,`switch`)?n===e.element.input.onValue:!1;return Y(`calcite-switch`,{...t,checked:r,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,value:t,selected:n,label:r,props:i}){return Y(`calcite-label`,{class:y.inputRadioLabel,key:e,layout:`inline`},Y(`calcite-radio-button`,{...i,afterCreate:void 0,afterUpdate:void 0,checked:n,class:y.inputRadio,disabled:i.readOnly,value:t,onblur:()=>{this._focusedFieldName=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),r)}_renderAuxiliaryText(e){let t=e.name,n=this._inputsWithChanges.has(t)&&!e.submittable?O(e,this.messages,this.timeZone):this.viewModel.contingencyConstraintViolations.get(t)==null?e.valueExpressionExecutor!=null&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null:this.messages.validationErrors.valuesIncompatible;return n==null?this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?Y(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description):Y(`calcite-input-message`,{icon:!0,status:`invalid`},n)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.featureCount}),key:`show-all-related-features`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderAddRelatedRecordButton(e){let{canAddRelatedFeature:t,relationshipId:n,relatedLayer:r,editable:i}=e,{messages:a,callbacks:o,disabled:s}=this,c=!i||s;if(t&&o?.addRelatedRecord&&r&&!c)return Y(`calcite-button`,{alignment:`center`,appearance:`outline-fill`,class:y.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:`plus`,key:`${n}-add-button`,round:!0,scale:`s`,width:`full`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,n,r)}},e.relatedLayerIsTable?a.addRecord:a.addFeature)}_renderRelatedRecordListItem(e,t,n){let{feature:r,description:i,title:a}=e,{feature:o,callbacks:s}=this,{highlightHelper:c}=this.viewModel,l=()=>{c?.removeAll(),s?.editRelatedRecord&&o&&s.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:r,readOnly:n})},u=c?()=>c.add(r):void 0,d=c?()=>c.remove(r):void 0;return Y(`calcite-list-item`,{bind:this,description:i,key:`${t}-${r.uid}`,label:a,value:a,onCalciteListItemSelect:l,onmouseenter:u,onmouseleave:d},Y(`calcite-icon`,{icon:k(r),slot:`content-start`}),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;let{relationshipId:t,activeCategory:n}=e,r=n?null:this._renderDescriptionOrEmpty(e.description);return Y(`calcite-label`,{class:this.classes(y.label,y.relatedRecordsLabel),key:`relationship-${t}-container`},Y(`div`,null,this._renderRelatedRecordsHeaderContainer(e),r,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){if(e.featureCount>0)return this._renderRelatedRecordsList(e);if(e.activeCategory&&e.featureCount===0)return this._renderNoRelatedRecordsNotice();if(e.allCategories?.length)return this._renderCategoryList(e);if(e.loaded)return e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e)}_renderCategoryList(e){return Y(`calcite-list`,{displayMode:`flat`,label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){let{count:r,name:i,value:a}=t,o=n(r);return Y(`calcite-list-item`,{key:`${i}-${a}`,label:i,onCalciteListItemSelect:()=>this._selectCategory(e,t)},Y(`calcite-chip`,{label:o,scale:`s`,slot:`content-end`},o),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.allCategories?.length??0}),key:`show-all-categories`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderRelatedRecordsHeaderContainer(e){let t=e.updating||!e.loaded;return Y(`div`,{class:y.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},Y(`span`,null,e.label),t?Y(`calcite-loader`,{inline:!0,key:`loader`,label:this.messagesCommon?.loading,scale:`s`,type:`indeterminate`}):void 0)}_renderRelatedRecordsList(e){let{relationshipId:t,editable:n}=e,{disabled:r}=this,i=!n||r;return Y(`calcite-list`,{class:y.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,i)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){let{messages:n}=this,r=e.relatedLayerIsTable?n.noOriginKeyRecord:n.noOriginKeyFeature,i=e.relationship?.keyField,a=this.viewModel.findField(i),o=e.layer?.fieldsIndex.get(i),s=a?.label||o?.alias||i,c=t(r,{relatedLayerName:e.relatedLayer?.title,originKeyField:s});return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},c))}_renderNoRelatedRecordsNotice(){return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return Y(`div`,{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:y.listObserver,key:`feature-observer`})}_renderTextElementInput(e){return Y(`div`,{class:y.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){let{disabled:t}=this,{editable:n,hint:r,label:i,maxLength:a,minLength:o,name:s,range:{max:c,min:l},required:u,valid:d,value:f}=e,p=this._inputsWithChanges.has(s),m=!n||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":d?`false`:`true`,class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:p&&!d?`invalid`:`idle`,key:s,label:i,max:c??void 0,min:l??void 0,maxLength:a>-1?a:void 0,minLength:o>-1?o:void 0,placeholder:r??void 0,readOnly:m,required:u,value:f==null?``:`${f}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Z]:s}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Z))}_afterDateComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e),n=e.dataset.datePart,r=this._dateComponentMap.get(t.name);if(`valueAsDate`in e&&e.value!=null&&t.value!=null){let n=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case`date`:e.value=B(t.value,this.timeZone).date??``;break;case`timestamp-offset`:e.value=z(t.value,this.timeZone).date??``;break;default:e.value=`${t.value}`}n.unobserve(e)});n.observe(e)}if(r!=null)switch(n){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}else this._dateComponentMap.set(t.name,{[n]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e);A(t)&&e.value!=null&&`setNumberValue`in e&&e.setNumberValue({committing:!1,value:e.value,origin:`direct`}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_afterComponentCreateOrUpdate(e){let{viewModel:t}=this,n=this._getFieldInputFromHTMLElement(e),r=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&r===n&&(this._attemptFocusOnNextRender=!1,E(n)&&(n.group.open=!0),X(e))}async _afterGroupCreate(e){let t=this.viewModel.findGroup(e.id),n=this.viewModel.findField(this._focusedFieldName);n&&t&&j(n,t)&&(!n.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=n.name}_onComponentBlur(e){let t=e.target;this._focusedFieldName=null,`readOnly`in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){let{timeZone:t}=this,n=this._getFieldInputFromHTMLElement(e),r=n.field.type,{name:i,range:a}=n,o=this._dateComponentMap.get(i);if(!o)return;let s=this.viewModel.getValue(i),c=null;r===`date-only`?c=Array.isArray(e.value)?e.value[0]:e.value:r===`time-only`?(s=V(s),c=V(e.value)):c=r===`timestamp-offset`?e.value==null?null:H({dateComponent:o.date,timeComponent:o.time,timeZoneComponent:o.timeZone,oldValue:s,defaultTimeZone:t}):e.value==null?null:U({oldValue:s,dateComponent:o.date,timeComponent:o.time,timeZone:t,max:a.max,min:a.min}),c===null||!e.value?this._updateFieldValue(i,null):s!==c&&this._updateFieldValue(i,c)}_saveValueFromComponent(e){let t=this._getFieldInputFromHTMLElement(e),n=this._parseValue(e),r=t.value;!t.isSubtypeField||!M(this.layer,r,n)?this._updateFieldValue(t.name,n):!this._pendingSubtypeChoice&&n!==r&&(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,n))}async _handleSubtypeChoice(e,n){let{value:r,name:i}=e,{messages:a,viewModel:o,messagesCommon:s,_subtypes:c}=this;if(this._updateFieldValue(i,n),!c?.length)return;let l=c.find(e=>e.code===n),u=c.find(e=>e.code===r)?.name??`${r}`;if(!l)return;let d=Promise.withResolvers();o.pendingSubtypeChoice=d;let f=`update-fields`,p=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}],m={context:`info`,title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:l.name}),radios:p,defaultRadioSelection:`update-fields`,onRadioSelection:e=>f=e,actions:{primary:{label:s.apply,action:()=>d.resolve(f),type:`positive`},secondary:{label:s.cancel,type:`neutral`,action:()=>d.resolve(`undo`)}},cancel:()=>d.reject()};try{switch(this.showPrompt(m),await d.promise){case`update-fields`:o.applySubtypeDefaults(l),this._validateContingenciesForNonNullFields();break;case`keep-existing`:this._validateContingenciesForNonNullFields();break;case`undo`:this._updateFieldValue(e.name,r)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){let n=this._getFieldInputFromHTMLElement(t);e===`Enter`&&E(n)&&!n.group.open&&(n.group.open=!0)}_updateFieldValue(e,t){let n=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),n!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){let e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>t!=null));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){let t=this._getFieldInputFromHTMLElement(e),n=e.value;return D(t.element,`switch`)?e.checked?t.element.input.onValue:t.element.input.offValue:n==null||n===``?null:t.dataType===`number`?n===`-0`||n===`-0.`||n===`-0,`?n:parseFloat(n):t.field.type===`date`?parseFloat(n):n}_ignoreDeselectionOfNoValueOption(e){let{firstChild:t,selectedItems:n}=e;n.length===0&&t&&`selected`in t?t.selected=!0:a.getLogger(this).warnOnce(`Failed to override user attempt to deselect 'No value' option.`)}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput(`forward`,t)?.name||null,this._attemptFocusOnNextRender=!0,this.groupDisplay===`sequential`&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){e.key===`Enter`&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){this.viewModel.activeRelationshipInput?.incrementPage()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([u()],Q.prototype,`_listObserverNode`,void 0),e([u()],Q.prototype,`_relatedRecordsEnabled`,null),e([u()],Q.prototype,`_utilityNetworkAssociationsEnabled`,null),e([u()],Q.prototype,`_prompt`,void 0),e([u()],Q.prototype,`_subtypes`,null),e([u()],Q.prototype,`associationId`,null),e([u()],Q.prototype,`associatedLayer`,null),e([u()],Q.prototype,`disabled`,null),e([u()],Q.prototype,`feature`,null),e([u()],Q.prototype,`_featureFormUNAssociationList`,void 0),e([u()],Q.prototype,`formTemplate`,null),e([u()],Q.prototype,`groupDisplay`,void 0),e([u()],Q.prototype,`headingLevel`,void 0),e([u()],Q.prototype,`icon`,null),e([u()],Q.prototype,`label`,null),e([u()],Q.prototype,`layer`,null),e([u()],Q.prototype,`map`,null),e([u(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],Q.prototype,`messages`,void 0),e([u(),q(`esri/t9n/common`)],Q.prototype,`messagesCommon`,void 0),e([u(),q(`esri/widgets/Feature/t9n/Feature`)],Q.prototype,`messagesFeature`,void 0),e([u(),q(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],Q.prototype,`messagesTemplates`,void 0),e([u()],Q.prototype,`callbacks`,null),e([u()],Q.prototype,`relationshipId`,null),e([u()],Q.prototype,`spatialReference`,null),e([u()],Q.prototype,`strict`,null),e([u()],Q.prototype,`timeZone`,null),e([u()],Q.prototype,`showPrompt`,null),e([u()],Q.prototype,`clearPrompt`,null),e([u({type:N}),J([`value-change`,`submit`])],Q.prototype,`viewModel`,void 0),e([u({type:P,nonNullable:!0})],Q.prototype,`visibleElements`,void 0),e([u()],Q.prototype,`test`,null),Q=e([d(`esri.widgets.FeatureForm`)],Q);const $=Q;export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import{isSome as r}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import o from"../core/ReactiveMap.js";import{watch as s,whenOnce as c,initial as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{isIntegerField as f}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as p,getSubtypesFromLayer as m}from"../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as h}from"../popup/support/featureUtils.js";import{isString as g}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{css as y}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as x,isFieldInput as S,isRelationshipInput as C,isTextElementInput as w,flattenInputs as T,isInputInGroupInput as E,isFieldElementWithInputType as D,getErrorMessageForFieldInput as O,getIconForFeature as k,isNumberFieldInput as A,isInputInThisGroupInput as j,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import N from"./FeatureForm/FeatureFormViewModel.js";import P from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as F}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as L,numberingSystem as R,prepareISOFieldValueForDateComponents as z,prepareUnixFieldValueForDateComponents as B,normalizeTimeOnlyString as V,getISOFieldValueFromDateComponents as H,getUnixFieldValueFromDateComponents as U}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as G,incrementHeadingLevel as K}from"./support/Heading.js";import{messageBundle as q,vmEvent as J,tsx as Y}from"./support/widget.js";import{setFocus as X}from"./support/widgetUtils.js";const Z=`data-field-name`;let Q=class extends _{constructor(e){super(e),this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay=`all`,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new N,this.visibleElements=new P,this._onShowAllRelatedRecordsClick=e=>{let{feature:t,callbacks:n}=this;t&&n?.showAllRelatedRecords&&n.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,n)=>{let{feature:r,callbacks:i}=this,a=n;if(r&&i?.addRelatedRecord){if(p(n)&&e.activeCategory){let t=e.activeCategory.value,r=n.findSublayerForSubtypeCode(t);r&&h(r)&&(a=r)}i.addRelatedRecord({parentFeature:r,relatedLayer:a,relationshipId:t})}},e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),`Feature Form`,`arcgis-feature-form`,{version:`5.0`})}),this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([s(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),c(()=>!this.viewModel.updating).then(()=>{let e=this._getFocusableInput(`forward`);this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),s(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},l),s(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on(`submit`,e=>{if(e.invalid.length>0){let[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),s(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),s(()=>this.viewModel.inputs.filter(b),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return F({block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),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`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`)})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){let{callbacks:e}=this;return!!(e?.viewAssociatedLayers&&e.viewAssociatedFeatures)}get _subtypes(){return m(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return`form-field`}set icon(e){this._overrideIfSome(`icon`,e)}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 map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){let{state:e}=this.viewModel;return Y(`div`,{class:this.classes(y.base,W.widget,W.panel)},e===`ready`?this._renderForm():null)}_renderForm(){return Y(`div`,null,Y(`form`,{class:y.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?Y(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){let{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return Y(`calcite-notice`,{class:y.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},t.disabledForm))}_renderHeader(){let e=this.viewModel,{formTitle:t,formDescription:n}=e;if(!e.formHeaderVisible)return;let r=t!=null&&Y(G,{key:`title`,level:this.headingLevel},t),i=n!=null&&Y(`p`,{class:y.description,key:`description`},n);return Y(`div`,{class:y.formHeader},r,i)}_renderContent(){let{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(r).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){if(x(e))return this._renderGroup(e);if(S(e))return this._renderLabeledField(e);if(C(e))return this._renderRelationshipInput(e);if(w(e))return this._renderTextElementInput(e);if(b(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){let{feature:t,callbacks:n}=this;t&&n?.viewAssociatedFeatures&&n.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){let{feature:t,callbacks:n}=this;t&&n?.selectAssociatedFeature&&await n.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){let{feature:t,callbacks:n}=this;t&&n?.addAssociation&&n.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({onSelectAssociationType:({viewModel:t,listType:n})=>{t.activeAssociationType=n;let{feature:r,callbacks:i}=this;r&&i?.viewAssociatedLayers&&i.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return e==null?null:Y(`div`,{class:this.classes(y.description),id:t},e)}_renderGroup(e){let{formTemplate:t,headingLevel:n}=this,{description:r,id:i,inputs:a,label:o,open:s}=e,c=a.filter(e=>e.visible),l=this.viewModel.findField(this._focusedFieldName)?.group===e,u=this.groupDisplay===`sequential`;return Y(`calcite-block`,{afterCreate:this._afterGroupCreate,class:this.classes(y.group,u?y.groupSequential:null,l?y.groupActive:null),"data-group":e,description:r||void 0,expandable:!0,expanded:s,heading:o??``,headingLevel:t?.title?K(n):n,id:i,key:i,onCalciteBlockCollapse:({currentTarget:t})=>{e.open=!1,this._onGroupToggle(t,e)},onCalciteBlockExpand:({currentTarget:t})=>{e.open=!0,this._onGroupToggle(t,e)}},c.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){let n=T(this.viewModel.inputs);e===`backward`&&n.reverse();let r;if(!t)r=0;else if(x(t)){let e=t.inputs.find(e=>e.visible);r=e?n.indexOf(e):0}else{let i;if(E(t)&&!t.group.open){let n=t.group.inputs.filter(S);i=e===`forward`?n[n.length-1]:n[0]}else i=t;r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&S(t)){if(this.disabled&&t.inputType&&(t.inputType===`switch`||t.inputType===`radio-buttons`))continue;return t}}return null}_renderLabeledField(e){let{dataType:n,feature:r,label:i,layer:a,required:o}=e,s={"aria-label":o?t(this.messages.requiredFieldLabel,{name:i}):i,class:y.label,key:`${a.id}-${r.uid}-${e.name}`},c=[Y(`div`,{class:y.labelTextContent,key:`labelTextContainer`},i,o?Y(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),n===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e)];return Y(`calcite-label`,{...s},c)}_renderFieldInput(e){let{dataType:t,domain:n,inputType:r,name:i}=e,a=this.getCommonInputProps(e);if(n?.type===`coded-value`){let t=this.viewModel.getFieldValueOptionsForField(i,this.messages.empty);return r===`switch`&&!e.hasInvalidSwitchValue?this._renderSwitchComponent(e,a):r===`radio-buttons`?this._renderRadioButtonComponents(e,t.flat(),a):this._renderComboBoxComponent(e,t,a)}return r===`datetime-picker`||t===`date`?this._renderDateComponents(e,a):t===`number`?this._renderNumberComponent(e,a):this._renderStringComponent(e,a)}_renderStringComponent(e,t){return e.inputType===`text-area`?t.readOnly?Y(`calcite-text-area`,{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-text-area`,{...t,resize:`vertical`,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-input`,{...t,loading:e.updating,type:`text`,onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){let n=f(e.field),r=n&&t.value!==``?Math.round(parseFloat(t.value)).toString():t.value;return Y(`calcite-input-number`,{...t,integer:n,loading:e.updating,step:n?1:`any`,type:`number`,value:r,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){let{field:n}=e;switch(n.type){case`date`:return this._renderDateFieldComponents(e,t);case`date-only`:return this._renderDateOnlyFieldComponent(e,t);case`time-only`:return this._renderTimeOnlyFieldComponent(e,t);case`timestamp-offset`:return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(n,t.value,{timeZone:this.timeZone,...L(n)}))}}_renderDateOnlyFieldComponent(e,t){let{range:n,valid:r,value:i}=e,{class:a,key:o,readOnly:s}=t,{rawMax:c,rawMin:l}=n;return Y(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!r,class:a,"data-date-part":`date`,"data-field-name":t[Z],key:`${o}-date-input`,max:g(c)?c:void 0,min:g(l)?l:void 0,numberingSystem:R,overlayPositioning:`fixed`,readOnly:s,topLayerDisabled:this.topLayerDisabled,value:i==null?void 0:`${i}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){let{valid:n,value:r}=e,{class:i,key:a,readOnly:o}=t;return Y(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,class:i,"data-date-part":`time`,"data-field-name":t[Z],key:`${a}-time-input`,numberingSystem:R,overlayPositioning:`fixed`,readOnly:o,step:e.timeStep,value:r==null?void 0:`${r}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){let{name:n,range:r,timeZone:i,valid:a,value:o}=e,{class:s,key:c,readOnly:l}=t,{rawMax:u,rawMin:d}=r,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,numberingSystem:R,overlayPositioning:`fixed`,readOnly:l,[Z]:n,onfocus:this._onComponentFocus},p=z(u,i),m=z(d,i),h=z(o,i);return Y(`div`,{class:y.dateInputContainer,key:`${c}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:s,"data-date-part":`date`,key:`${c}-date-input`,max:p?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:h.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),Y(`calcite-input-time-picker`,{...f,class:s,"data-date-part":`time`,key:`${c}-time-input`,step:e.timeStep,value:h.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?Y(`calcite-input-time-zone`,{...f,class:s,"data-date-part":`timeZone`,disabled:l,key:`${c}-timezone-input`,value:h.timeZoneOffset??`0`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){let{includeTime:n,name:r,valid:i,value:a}=e,{class:o,key:s,max:c,min:l,readOnly:u}=t,{timeZone:d}=this,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,numberingSystem:R,overlayPositioning:`fixed`,readOnly:u,[Z]:r,onfocus:this._onComponentFocus},p=B(a,d),m=B(c,d),h=B(l,d);return Y(`div`,{class:y.dateInputContainer,key:`${s}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:o,"data-date-part":`date`,key:`${s}-date-input`,max:m?.date??void 0,min:h?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),n?Y(`calcite-input-time-picker`,{...f,class:o,"data-date-part":`time`,key:`${s}-time-input`,step:1,value:p.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return Y(`calcite-input`,{...n,class:this.classes(y.fieldInput,y.inputDisabled),readOnly:!0,type:`text`,value:t==null?n.value:`${t}`})}_renderComboBoxComponent(e,t,n){let{value:r,name:i}=e,{viewModel:a,_inputsWithChanges:o}=this,s=a.editType===`INSERT`,c=o.has(i),l=r==null&&(!s||c),u=s&&e.showNoValueOptionEnabled&&!c?()=>{}:n.onblur;return Y(`calcite-combobox`,{...n,allowCustomValues:!1,clearDisabled:!0,overlayPositioning:`fixed`,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,onblur:u,onCalciteComboboxChange:({currentTarget:t})=>{l&&t.selectedItems.length===0?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){let{value:n,name:r}=e,{messages:i,messagesTemplates:a,viewModel:o,_inputsWithChanges:s}=this,[c,l,u]=t.map(e=>e.map(({name:e,value:t})=>Y(`calcite-combobox-item`,{heading:e,key:`#${t}`,selected:n===t,value:`${t}`}))),d=[];l.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`other`,label:a.other},l)),u.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`unsupported`,label:i.subtypes.unsupportedDomainGroupTitle},u)),d.length>0?d.unshift(Y(`calcite-combobox-item-group`,{key:`recommended`,label:i.recommended},c)):d.push(...c);let f=o.editType===`INSERT`,p=s.has(r),m=n==null&&(!f||p);return e.showNoValueOptionEnabled&&d.unshift(Y(`calcite-combobox-item`,{heading:e.showNoValueLabel||i.empty,key:`empty-option`,selected:m,value:``})),d}_renderRadioButtonComponents(e,t,n){let{value:r}=e,i=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,value:t,selected:t===r,props:n}));if(e.showNoValueOptionEnabled){let t=e.showNoValueLabel||this.messages.empty,a=r===``||r===null;i.unshift(this._renderRadioButtonComponent({key:`empty-option`,label:t,value:``,selected:a,props:n}))}return Y(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,"data-field-name":n[Z],key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.key}-${this.id}`,required:n.required},i)}_renderSwitchComponent(e,t){let{value:n}=e,r=D(e.element,`switch`)?n===e.element.input.onValue:!1;return Y(`calcite-switch`,{...t,checked:r,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,value:t,selected:n,label:r,props:i}){return Y(`calcite-label`,{class:y.inputRadioLabel,key:e,layout:`inline`},Y(`calcite-radio-button`,{...i,afterCreate:void 0,afterUpdate:void 0,checked:n,class:y.inputRadio,disabled:i.readOnly,value:t,onblur:()=>{this._focusedFieldName=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),r)}_renderAuxiliaryText(e){let t=e.name,n=this._inputsWithChanges.has(t)&&!e.submittable?O(e,this.messages,this.timeZone):this.viewModel.contingencyConstraintViolations.get(t)==null?e.valueExpressionExecutor!=null&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null:this.messages.validationErrors.valuesIncompatible;return n==null?this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?Y(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description):Y(`calcite-input-message`,{icon:!0,status:`invalid`},n)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.featureCount}),key:`show-all-related-features`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderAddRelatedRecordButton(e){let{canAddRelatedFeature:t,relationshipId:n,relatedLayer:r,editable:i}=e,{messages:a,callbacks:o,disabled:s}=this,c=!i||s;if(t&&o?.addRelatedRecord&&r&&!c)return Y(`calcite-button`,{alignment:`center`,appearance:`outline-fill`,class:y.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:`plus`,key:`${n}-add-button`,round:!0,scale:`s`,width:`full`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,n,r)}},e.relatedLayerIsTable?a.addRecord:a.addFeature)}_renderRelatedRecordListItem(e,t,n){let{feature:r,description:i,title:a}=e,{feature:o,callbacks:s}=this,{highlightHelper:c}=this.viewModel,l=()=>{c?.removeAll(),s?.editRelatedRecord&&o&&s.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:r,readOnly:n})},u=c?()=>c.add(r):void 0,d=c?()=>c.remove(r):void 0;return Y(`calcite-list-item`,{bind:this,description:i,key:`${t}-${r.uid}`,label:a,value:a,onCalciteListItemSelect:l,onmouseenter:u,onmouseleave:d},Y(`calcite-icon`,{icon:k(r),slot:`content-start`}),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;let{relationshipId:t,activeCategory:n}=e,r=n?null:this._renderDescriptionOrEmpty(e.description);return Y(`calcite-label`,{class:this.classes(y.label,y.relatedRecordsLabel),key:`relationship-${t}-container`},Y(`div`,null,this._renderRelatedRecordsHeaderContainer(e),r,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){if(e.featureCount>0)return this._renderRelatedRecordsList(e);if(e.activeCategory&&e.featureCount===0)return this._renderNoRelatedRecordsNotice();if(e.allCategories?.length)return this._renderCategoryList(e);if(e.loaded)return e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e)}_renderCategoryList(e){return Y(`calcite-list`,{displayMode:`flat`,label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){let{count:r,name:i,value:a}=t,o=n(r);return Y(`calcite-list-item`,{key:`${i}-${a}`,label:i,onCalciteListItemSelect:()=>this._selectCategory(e,t)},Y(`calcite-chip`,{label:o,scale:`s`,slot:`content-end`},o),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.allCategories?.length??0}),key:`show-all-categories`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderRelatedRecordsHeaderContainer(e){let t=e.updating||!e.loaded;return Y(`div`,{class:y.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},Y(`span`,null,e.label),t?Y(`calcite-loader`,{inline:!0,key:`loader`,label:this.messagesCommon?.loading,scale:`s`,type:`indeterminate`}):void 0)}_renderRelatedRecordsList(e){let{relationshipId:t,editable:n}=e,{disabled:r}=this,i=!n||r;return Y(`calcite-list`,{class:y.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,i)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){let{messages:n}=this,r=e.relatedLayerIsTable?n.noOriginKeyRecord:n.noOriginKeyFeature,i=e.relationship?.keyField,a=this.viewModel.findField(i),o=e.layer?.fieldsIndex.get(i),s=a?.label||o?.alias||i,c=t(r,{relatedLayerName:e.relatedLayer?.title,originKeyField:s});return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},c))}_renderNoRelatedRecordsNotice(){return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return Y(`div`,{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:y.listObserver,key:`feature-observer`})}_renderTextElementInput(e){return Y(`div`,{class:y.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){let{disabled:t}=this,{editable:n,hint:r,label:i,maxLength:a,minLength:o,name:s,range:{max:c,min:l},required:u,valid:d,value:f}=e,p=this._inputsWithChanges.has(s),m=!n||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":d?`false`:`true`,class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:p&&!d?`invalid`:`idle`,key:s,label:i,max:c??void 0,min:l??void 0,maxLength:a>-1?a:void 0,minLength:o>-1?o:void 0,placeholder:r??void 0,readOnly:m,required:u,value:f==null?``:`${f}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Z]:s}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Z))}_afterDateComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e),n=e.dataset.datePart,r=this._dateComponentMap.get(t.name);if(`valueAsDate`in e&&e.value!=null&&t.value!=null){let n=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case`date`:e.value=B(t.value,this.timeZone).date??``;break;case`timestamp-offset`:e.value=z(t.value,this.timeZone).date??``;break;default:e.value=`${t.value}`}n.unobserve(e)});n.observe(e)}if(r!=null)switch(n){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}else this._dateComponentMap.set(t.name,{[n]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e);A(t)&&e.value!=null&&`setNumberValue`in e&&e.setNumberValue({committing:!1,value:e.value,origin:`direct`}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_afterComponentCreateOrUpdate(e){let{viewModel:t}=this,n=this._getFieldInputFromHTMLElement(e),r=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&r===n&&(this._attemptFocusOnNextRender=!1,E(n)&&(n.group.open=!0),X(e))}async _afterGroupCreate(e){let t=this.viewModel.findGroup(e.id),n=this.viewModel.findField(this._focusedFieldName);n&&t&&j(n,t)&&(!n.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=n.name}_onComponentBlur(e){let t=e.target;this._focusedFieldName=null,`readOnly`in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){let{timeZone:t}=this,n=this._getFieldInputFromHTMLElement(e),r=n.field.type,{name:i,range:a}=n,o=this._dateComponentMap.get(i);if(!o)return;let s=this.viewModel.getValue(i),c=null;r===`date-only`?c=Array.isArray(e.value)?e.value[0]:e.value:r===`time-only`?(s=V(s),c=V(e.value)):c=r===`timestamp-offset`?e.value==null?null:H({dateComponent:o.date,timeComponent:o.time,timeZoneComponent:o.timeZone,oldValue:s,defaultTimeZone:t}):e.value==null?null:U({oldValue:s,dateComponent:o.date,timeComponent:o.time,timeZone:t,max:a.max,min:a.min}),c===null||!e.value?this._updateFieldValue(i,null):s!==c&&this._updateFieldValue(i,c)}_saveValueFromComponent(e){let t=this._getFieldInputFromHTMLElement(e),n=this._parseValue(e),r=t.value;!t.isSubtypeField||!M(this.layer,r,n)?this._updateFieldValue(t.name,n):!this._pendingSubtypeChoice&&n!==r&&(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,n))}async _handleSubtypeChoice(e,n){let{value:r,name:i}=e,{messages:a,viewModel:o,messagesCommon:s,_subtypes:c}=this;if(this._updateFieldValue(i,n),!c?.length)return;let l=c.find(e=>e.code===n),u=c.find(e=>e.code===r)?.name??`${r}`;if(!l)return;let d=Promise.withResolvers();o.pendingSubtypeChoice=d;let f=`update-fields`,p=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}],m={context:`info`,title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:l.name}),radios:p,defaultRadioSelection:`update-fields`,onRadioSelection:e=>f=e,actions:{primary:{label:s.apply,action:()=>d.resolve(f),type:`positive`},secondary:{label:s.cancel,type:`neutral`,action:()=>d.resolve(`undo`)}},cancel:()=>d.reject()};try{switch(this.showPrompt(m),await d.promise){case`update-fields`:o.applySubtypeDefaults(l),this._validateContingenciesForNonNullFields();break;case`keep-existing`:this._validateContingenciesForNonNullFields();break;case`undo`:this._updateFieldValue(e.name,r)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){let n=this._getFieldInputFromHTMLElement(t);e===`Enter`&&E(n)&&!n.group.open&&(n.group.open=!0)}_updateFieldValue(e,t){let n=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),n!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){let e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>t!=null));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){let t=this._getFieldInputFromHTMLElement(e),n=e.value;return D(t.element,`switch`)?e.checked?t.element.input.onValue:t.element.input.offValue:n==null||n===``?null:t.dataType===`number`?n===`-0`||n===`-0.`||n===`-0,`?n:parseFloat(n):t.field.type===`date`?parseFloat(n):n}_ignoreDeselectionOfNoValueOption(e){let{firstChild:t,selectedItems:n}=e;n.length===0&&t&&`selected`in t?t.selected=!0:a.getLogger(this).warnOnce(`Failed to override user attempt to deselect 'No value' option.`)}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput(`forward`,t)?.name||null,this._attemptFocusOnNextRender=!0,this.groupDisplay===`sequential`&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){e.key===`Enter`&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){this.viewModel.activeRelationshipInput?.incrementPage()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([u()],Q.prototype,`_listObserverNode`,void 0),e([u()],Q.prototype,`_relatedRecordsEnabled`,null),e([u()],Q.prototype,`_utilityNetworkAssociationsEnabled`,null),e([u()],Q.prototype,`_prompt`,void 0),e([u()],Q.prototype,`_subtypes`,null),e([u()],Q.prototype,`associationId`,null),e([u()],Q.prototype,`associatedLayer`,null),e([u()],Q.prototype,`disabled`,null),e([u()],Q.prototype,`feature`,null),e([u()],Q.prototype,`_featureFormUNAssociationList`,void 0),e([u()],Q.prototype,`formTemplate`,null),e([u()],Q.prototype,`groupDisplay`,void 0),e([u()],Q.prototype,`headingLevel`,void 0),e([u()],Q.prototype,`icon`,null),e([u()],Q.prototype,`label`,null),e([u()],Q.prototype,`layer`,null),e([u()],Q.prototype,`map`,null),e([u(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],Q.prototype,`messages`,void 0),e([u(),q(`esri/t9n/common`)],Q.prototype,`messagesCommon`,void 0),e([u(),q(`esri/widgets/Feature/t9n/Feature`)],Q.prototype,`messagesFeature`,void 0),e([u(),q(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],Q.prototype,`messagesTemplates`,void 0),e([u()],Q.prototype,`callbacks`,null),e([u()],Q.prototype,`relationshipId`,null),e([u()],Q.prototype,`spatialReference`,null),e([u()],Q.prototype,`strict`,null),e([u()],Q.prototype,`timeZone`,null),e([u()],Q.prototype,`showPrompt`,null),e([u()],Q.prototype,`clearPrompt`,null),e([u({type:N}),J([`value-change`,`submit`])],Q.prototype,`viewModel`,void 0),e([u({type:P,nonNullable:!0})],Q.prototype,`visibleElements`,void 0),e([u()],Q.prototype,`test`,null),Q=e([d(`esri.widgets.FeatureForm`)],Q);const $=Q;export{$ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as n}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as i,sync as a,watch as o}from"../../../core/reactiveUtils.js";import{renderingSanitizer as s}from"../../../core/sanitizerUtils.js";import{property as c,subclass as l}from"../../../core/accessorSupport/decorators.js";import u from"../../Widget.js";import d from"./GridViewModel.js";import{globalCss as f}from"../../support/globalCss.js";import{messageBundle as p,tsx as m}from"../../support/widget.js";const h=`esri-grid`,g={base:h,content:`${h}__content`,grid:`${h}__grid`,noDataMessage:`${h}__no-data-message`},_={sort:[`Enter`,` `]};let v=class extends u{constructor(e,t){super(e,t),this._columnElements=[],this._grid=null,this.itemIdPath=`objectId`,this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new d,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on(`before-changes`,()=>this.renderNow()),this.columns.on(`change`,()=>this.onColumnChange()),i(()=>this.highlightIds,`before-add`,({target:e})=>{!this.effectiveMultipleSelectionEnabled&&e.length&&e.removeAll()},a),this.rowHighlightIds.on(`change`,()=>this.generateCellPartNames()),o(()=>this.effectiveSize,()=>this._updateGridSize()),o(()=>[this.isEditing,this.store?.hasPendingEdits],()=>{this.generateCellPartNames(),this.requestContentUpdate()}),o(()=>this.store?.state,(e,t)=>{e===`ready`&&(t===`loaded`||t===`error`)&&this.refreshPageCache()}),i(()=>this._table,`scroll`,()=>this.viewModel.closeColumnMenus()),n(window,`resize`,()=>this._updateColumnBorderStyles()),i(()=>this._table,`scrollend`,()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex()),this._updateColumnBorderStyles()}),o(()=>this.effectiveMultipleSelectionEnabled,e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()},a)])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}get _columnRendering(){return this.columnPerformanceModeEnabled?`lazy`:`eager`}get _selectedItems(){let{highlightIds:e,store:t}=this;return e.toArray().map(e=>t?.getItemByObjectId(e)??{objectId:e})}get _gridIsDisabled(){return this.viewModel.allVisibleColumns.length===0||this.hasInvalidColumnConfiguration}get _noDataMessage(){return s.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveMultipleSelectionEnabled(){return this.viewModel.effectiveMultipleSelectionEnabled}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this.viewModel.temporaryHighlightId}set temporaryHighlightId(e){this.viewModel.temporaryHighlightId=e}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter(e=>!!e&&e.path).map(({direction:e,path:t})=>({direction:e,path:t})):[]}get store(){return this.viewModel.store}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange(`sortOrders`)}getColumnProps(e,t){let{id:n}=this,{autoWidth:r,direction:i,fieldName:a,flexGrow:o,frozen:s,frozenToEnd:c,hidden:l,label:u,resizable:d,textAlign:f,width:p}=e,m=`${n}_${a}_${t}`,{renderFunction:h,footerRenderFunction:g,headerRenderFunction:_}=e,v=g?(e,t)=>g({root:e,column:t}):void 0,y=_?(e,t)=>_({root:e,column:t}):void 0,b=h?(e,t,n)=>h({root:e,column:t,rowData:n}):void 0,x=``;return e.direction&&(x+=` direction`),e.invalid&&(x+=` invalid`),{footerRenderer:v,headerRenderer:y,renderer:b,autoWidth:r,direction:i,flexGrow:o,frozen:s,frozenToEnd:c,headerPartName:x,key:m,resizable:d,bind:this,"data-fieldName":a,header:u,hidden:this.hasInvalidColumnConfiguration||l,path:a,"text-align":f,width:typeof p==`number`?`${p}px`:p,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;this._grid&&(this._grid._sorters?.length&&(this._grid._sorters.forEach(e=>{e._order=null,e.direction=null}),e=!0),this.columns.length&&this.columns.some(e=>!!e.direction)&&(this.columns.forEach(e=>e.direction=null),e=!0),e&&(this.notifyChange(`sortOrders`),this.scheduleRender()))}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),this.store?.reset(),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this.temporaryHighlightId=void 0}requestContentUpdate(){this._grid?.requestContentUpdate(),this.temporaryHighlightId=void 0}selectRows(e){let{itemIdPath:t}=this,n=(e?.filter(e=>!this.highlightIds.includes(e[t]))).map(e=>e[t]);n.length&&(this.effectiveMultipleSelectionEnabled||(this.highlightIds.removeAll(),n.splice(1)),this.highlightIds.addMany(n))}deselectRows(e){let{itemIdPath:t}=this,n=e?.map(e=>e[t])||[];n.length&&this.highlightIds.removeMany(n)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange(`sortOrders`)}scrollToIndex(e){this.size!==0&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this.temporaryHighlightId=void 0)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){let{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach(e=>this._applyRenderersToColumnElement(e)),this.requestContentUpdate()}render(){return m(`div`,{bind:this,class:this.classes(g.base,f.widget)},m(`div`,{bind:this,class:g.content},this._renderGrid()))}_renderGrid(){return m(`vaadin-grid`,{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:g.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,dir:this.direction,disabled:this._gridIsDisabled,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,multiSortPriority:this.multipleSortPriority,pageSize:this.pageSize,ref:`grid`,rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return this.state===`disabled`||!this.columns.length?null:[this._renderSelectionColumn(),this._renderColumns()]}_renderSelectionColumn(){return m(`vaadin-grid-selection-column`,{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:`center`})}_renderColumns(){return this.columns.toArray().map((e,t)=>`columns`in e?this._renderGroupColumn(e,t):this._renderColumn(e,t)).filter(t)}_renderColumn(e,t){let n=this.getColumnProps(e,t);if(!n.hidden)return m(`vaadin-grid-column`,{...n})}_renderGroupColumn(e,t){let n=this.getColumnProps(e,t);return n.hidden||!e.effectiveVisible?null:m(`vaadin-grid-column-group`,{...n},e.visibleChildColumns.map(e=>m(`vaadin-grid-column`,{...this.getColumnProps(e,t)})))}_renderEmptyState(){let e=this.viewModel;if(!(e.state!==`loaded`||e.isQueryingOrSyncing))return m(`div`,{class:g.noDataMessage,slot:`empty-state`},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){let t=this._grid=e;customElements.whenDefined(`vaadin-grid`).then(()=>{this._addGridEventListeners()}),t.__updateSorter=(e,n,r)=>{let{multiSort:i,multiSortOnShiftClick:a,multiSortPriority:o}=t,s=e._initialOrder,c=t._sorters.find(t=>t.path===e.path),l=t._sorters.filter(t=>t.path!==e.path),u=i&&(!a||!r)||a&&n;e._order=null,e.direction?u?s==null?o===`append`&&!c?t._sorters=[...l,e]:o===`prepend`&&(t._sorters=[e,...l]):(l.splice(s,0,e),t._sorters=[...l],e._initialOrder=null):(e.direction||a)&&(t._sorters=e.direction?[e]:[],l.forEach(e=>{e._order=null,e.direction=null})):c&&(t._sorters=[...l])},t.__removeSorters=e=>{if(e.length===0)return;let n=new Set(e.filter(e=>!e.direction));t._sorters=t._sorters.filter(e=>!n.has(e)),t.__applySorters()}}_afterGridUpdate(e){this._grid||=e}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){let t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){let e=this._grid;r(e),this.addHandles([n(e,[`click`,`dblclick`,`keydown`,`pointerover`,`pointerout`],e=>this._onGridInteraction(e)),n(e,[`pointerover`,`pointerout`,`cell-focus`],e=>this._onTransientGridInteraction(e)),n(e,`selected-items-changed`,this._onSelectedItemsChange),n(e,`sorter-changed`,()=>{this.notifyChange(`sortOrders`),this._updateColumnBorderStyles()}),n(e,`column-resize`,e=>{let t=e.detail.resizedColumn,n=t.getAttribute(`data-fieldName`);this.findColumn(n)?.set({width:t.width}),this._updateColumnBorderStyles()}),n(e,`column-reorder`,()=>this._onColumnOrderChange())])}_onGridInteraction(e){let t=this._grid;if(r(t),(e.type===`pointerover`||e.type===`pointerout`)&&e.relatedTarget!==t){let{target:t,relatedTarget:n}=e;if(!(this._isGridCellContentNode(t)&&this._isGridCellContentNode(n)))return}let n=null;try{n=t.getEventContext(e)}catch{}if(!n)return;let{column:i,index:a,item:o,section:s}=n;if(!s)return;if(s===`header`&&e.type===`keydown`&&i?.path){let t=e.key;_.sort.includes(t)&&this.findColumn(i.path)?.sort()}let c=`cell-${e.type}`;this.emit(c,{type:c,context:n,index:a,item:o,native:e,path:i?.path??void 0})}_onTransientGridInteraction(e){if(e.type===`pointerout`){this.temporaryHighlightId=void 0;return}let t=this._grid;if(t)try{this.temporaryHighlightId=t.getEventContext(e)?.item?.objectId??void 0}catch{this.temporaryHighlightId=void 0}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&e.localName===`vaadin-grid-cell-content`)}_onColumnOrderChange(){let e=this._grid;r(e);let t=e._getColumnsInOrder(0),n=[],i=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map(e=>e.getAttribute(`data-fieldName`));t?.forEach(e=>{let t=e.getAttribute(`data-fieldName`);if(t!=null){let e=this.findColumn(t);n.push(t),e&&`columns`in e&&e.columns?.length&&e.columns.sort((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1)}}),this.columns.sort((e,t)=>n.indexOf(e.fieldName)>n.indexOf(t.fieldName)?1:-1),this.notifyChange(`sortOrders`),this.emit(`column-reorder`,{type:`column-reorder`})}_clearSelection(){this.highlightIds.removeAll(),this.temporaryHighlightId=void 0}_onSelectedItemsChange(e){let{highlightIds:t,itemIdPath:n}=this,r=e.detail.value.map(e=>e[n]),i=r.filter(e=>!t.includes(e));if(!this.effectiveMultipleSelectionEnabled&&i.length&&t.length)t.removeAll(),t.add(i[0]);else{let e=t.filter(e=>!r.includes(e));t.removeMany(e),t.addMany(i)}}_applyRenderersToColumnElement(e){let t=e?.path,n=t==null?void 0:this.findColumn(t);if(n)try{let{renderFunction:t,footerRenderFunction:r,headerRenderFunction:i}=n;t&&`renderer`in e&&(e.renderer=(e,n,r)=>t({root:e,column:n,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),i&&(e.headerRenderer=(e,t)=>i({root:e,column:t}))}catch{}}_updateColumnBorderStyles(){try{this._grid?._updateFirstAndLastColumn()}catch{}}};e([c()],v.prototype,`_columnElements`,void 0),e([c()],v.prototype,`_columnRendering`,null),e([c()],v.prototype,`_selectedItems`,null),e([c()],v.prototype,`_grid`,void 0),e([c()],v.prototype,`_gridIsDisabled`,null),e([c()],v.prototype,`_noDataMessage`,null),e([c()],v.prototype,`_table`,null),e([c()],v.prototype,`cellPartNameGenerator`,null),e([c()],v.prototype,`columns`,null),e([c()],v.prototype,`columnPerformanceModeEnabled`,null),e([c()],v.prototype,`columnReorderingEnabled`,null),e([c()],v.prototype,`dataProvider`,null),e([c()],v.prototype,`direction`,null),e([c()],v.prototype,`editingEnabled`,null),e([c()],v.prototype,`effectiveMultipleSelectionEnabled`,null),e([c()],v.prototype,`effectiveSize`,null),e([c()],v.prototype,`groupColumns`,null),e([c()],v.prototype,`hasInvalidColumnConfiguration`,null),e([c()],v.prototype,`highlightIds`,null),e([c()],v.prototype,`temporaryHighlightId`,null),e([c()],v.prototype,`isEditing`,null),e([c()],v.prototype,`isReady`,null),e([c()],v.prototype,`itemIdPath`,void 0),e([c()],v.prototype,`label`,null),e([c(),p(`esri/widgets/FeatureTable/t9n/FeatureTable`)],v.prototype,`messages`,void 0),e([c()],v.prototype,`multipleSelectionEnabled`,null),e([c()],v.prototype,`multipleSelectionEnabledOverride`,null),e([c()],v.prototype,`multiSortEnabled`,null),e([c()],v.prototype,`noDataMessage`,null),e([c()],v.prototype,`pageIndex`,null),e([c()],v.prototype,`multipleSortPriority`,null),e([c()],v.prototype,`pageSize`,null),e([c()],v.prototype,`paginationEnabled`,null),e([c()],v.prototype,`rowDetailsRenderer`,null),e([c()],v.prototype,`rowHighlightIds`,null),e([c()],v.prototype,`selectionColumnEnabled`,void 0),e([c()],v.prototype,`size`,null),e([c({readOnly:!0})],v.prototype,`sortOrders`,null),e([c()],v.prototype,`store`,null),e([c()],v.prototype,`state`,null),e([c()],v.prototype,`viewModel`,void 0),v=e([l(`esri.widgets.FeatureTable.Grid.Grid`)],v);const y=v;export{y as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as n}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as i,sync as a,watch as o}from"../../../core/reactiveUtils.js";import{renderingSanitizer as s}from"../../../core/sanitizerUtils.js";import{property as c,subclass as l}from"../../../core/accessorSupport/decorators.js";import u from"../../Widget.js";import d from"./GridViewModel.js";import{globalCss as f}from"../../support/globalCss.js";import{messageBundle as p,tsx as m}from"../../support/widget.js";const h=`esri-grid`,g={base:h,content:`${h}__content`,grid:`${h}__grid`,noDataMessage:`${h}__no-data-message`},_={sort:[`Enter`,` `]};let v=class extends u{constructor(e){super(e),this._columnElements=[],this._grid=null,this.itemIdPath=`objectId`,this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new d,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on(`before-changes`,()=>this.renderNow()),this.columns.on(`change`,()=>this.onColumnChange()),i(()=>this.highlightIds,`before-add`,({target:e})=>{!this.effectiveMultipleSelectionEnabled&&e.length&&e.removeAll()},a),this.rowHighlightIds.on(`change`,()=>this.generateCellPartNames()),o(()=>this.effectiveSize,()=>this._updateGridSize()),o(()=>[this.isEditing,this.store?.hasPendingEdits],()=>{this.generateCellPartNames(),this.requestContentUpdate()}),o(()=>this.store?.state,(e,t)=>{e===`ready`&&(t===`loaded`||t===`error`)&&this.refreshPageCache()}),i(()=>this._table,`scroll`,()=>this.viewModel.closeColumnMenus()),n(window,`resize`,()=>this._updateColumnBorderStyles()),i(()=>this._table,`scrollend`,()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex()),this._updateColumnBorderStyles()}),o(()=>this.effectiveMultipleSelectionEnabled,e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()},a)])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}get _columnRendering(){return this.columnPerformanceModeEnabled?`lazy`:`eager`}get _selectedItems(){let{highlightIds:e,store:t}=this;return e.toArray().map(e=>t?.getItemByObjectId(e)??{objectId:e})}get _gridIsDisabled(){return this.viewModel.allVisibleColumns.length===0||this.hasInvalidColumnConfiguration}get _noDataMessage(){return s.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveMultipleSelectionEnabled(){return this.viewModel.effectiveMultipleSelectionEnabled}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this.viewModel.temporaryHighlightId}set temporaryHighlightId(e){this.viewModel.temporaryHighlightId=e}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter(e=>!!e&&e.path).map(({direction:e,path:t})=>({direction:e,path:t})):[]}get store(){return this.viewModel.store}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange(`sortOrders`)}getColumnProps(e,t){let{id:n}=this,{autoWidth:r,direction:i,fieldName:a,flexGrow:o,frozen:s,frozenToEnd:c,hidden:l,label:u,resizable:d,textAlign:f,width:p}=e,m=`${n}_${a}_${t}`,{renderFunction:h,footerRenderFunction:g,headerRenderFunction:_}=e,v=g?(e,t)=>g({root:e,column:t}):void 0,y=_?(e,t)=>_({root:e,column:t}):void 0,b=h?(e,t,n)=>h({root:e,column:t,rowData:n}):void 0,x=``;return e.direction&&(x+=` direction`),e.invalid&&(x+=` invalid`),{footerRenderer:v,headerRenderer:y,renderer:b,autoWidth:r,direction:i,flexGrow:o,frozen:s,frozenToEnd:c,headerPartName:x,key:m,resizable:d,bind:this,"data-fieldName":a,header:u,hidden:this.hasInvalidColumnConfiguration||l,path:a,"text-align":f,width:typeof p==`number`?`${p}px`:p,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;this._grid&&(this._grid._sorters?.length&&(this._grid._sorters.forEach(e=>{e._order=null,e.direction=null}),e=!0),this.columns.length&&this.columns.some(e=>!!e.direction)&&(this.columns.forEach(e=>e.direction=null),e=!0),e&&(this.notifyChange(`sortOrders`),this.scheduleRender()))}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),this.store?.reset(),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this.temporaryHighlightId=void 0}requestContentUpdate(){this._grid?.requestContentUpdate(),this.temporaryHighlightId=void 0}selectRows(e){let{itemIdPath:t}=this,n=(e?.filter(e=>!this.highlightIds.includes(e[t]))).map(e=>e[t]);n.length&&(this.effectiveMultipleSelectionEnabled||(this.highlightIds.removeAll(),n.splice(1)),this.highlightIds.addMany(n))}deselectRows(e){let{itemIdPath:t}=this,n=e?.map(e=>e[t])||[];n.length&&this.highlightIds.removeMany(n)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange(`sortOrders`)}scrollToIndex(e){this.size!==0&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this.temporaryHighlightId=void 0)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){let{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach(e=>this._applyRenderersToColumnElement(e)),this.requestContentUpdate()}render(){return m(`div`,{bind:this,class:this.classes(g.base,f.widget)},m(`div`,{bind:this,class:g.content},this._renderGrid()))}_renderGrid(){return m(`vaadin-grid`,{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:g.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,dir:this.direction,disabled:this._gridIsDisabled,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,multiSortPriority:this.multipleSortPriority,pageSize:this.pageSize,ref:`grid`,rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return this.state===`disabled`||!this.columns.length?null:[this._renderSelectionColumn(),this._renderColumns()]}_renderSelectionColumn(){return m(`vaadin-grid-selection-column`,{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:`center`})}_renderColumns(){return this.columns.toArray().map((e,t)=>`columns`in e?this._renderGroupColumn(e,t):this._renderColumn(e,t)).filter(t)}_renderColumn(e,t){let n=this.getColumnProps(e,t);if(!n.hidden)return m(`vaadin-grid-column`,{...n})}_renderGroupColumn(e,t){let n=this.getColumnProps(e,t);return n.hidden||!e.effectiveVisible?null:m(`vaadin-grid-column-group`,{...n},e.visibleChildColumns.map(e=>m(`vaadin-grid-column`,{...this.getColumnProps(e,t)})))}_renderEmptyState(){let e=this.viewModel;if(!(e.state!==`loaded`||e.isQueryingOrSyncing))return m(`div`,{class:g.noDataMessage,slot:`empty-state`},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){let t=this._grid=e;customElements.whenDefined(`vaadin-grid`).then(()=>{this._addGridEventListeners()}),t.__updateSorter=(e,n,r)=>{let{multiSort:i,multiSortOnShiftClick:a,multiSortPriority:o}=t,s=e._initialOrder,c=t._sorters.find(t=>t.path===e.path),l=t._sorters.filter(t=>t.path!==e.path),u=i&&(!a||!r)||a&&n;e._order=null,e.direction?u?s==null?o===`append`&&!c?t._sorters=[...l,e]:o===`prepend`&&(t._sorters=[e,...l]):(l.splice(s,0,e),t._sorters=[...l],e._initialOrder=null):(e.direction||a)&&(t._sorters=e.direction?[e]:[],l.forEach(e=>{e._order=null,e.direction=null})):c&&(t._sorters=[...l])},t.__removeSorters=e=>{if(e.length===0)return;let n=new Set(e.filter(e=>!e.direction));t._sorters=t._sorters.filter(e=>!n.has(e)),t.__applySorters()}}_afterGridUpdate(e){this._grid||=e}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){let t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){let e=this._grid;r(e),this.addHandles([n(e,[`click`,`dblclick`,`keydown`,`pointerover`,`pointerout`],e=>this._onGridInteraction(e)),n(e,[`pointerover`,`pointerout`,`cell-focus`],e=>this._onTransientGridInteraction(e)),n(e,`selected-items-changed`,this._onSelectedItemsChange),n(e,`sorter-changed`,()=>{this.notifyChange(`sortOrders`),this._updateColumnBorderStyles()}),n(e,`column-resize`,e=>{let t=e.detail.resizedColumn,n=t.getAttribute(`data-fieldName`);this.findColumn(n)?.set({width:t.width}),this._updateColumnBorderStyles()}),n(e,`column-reorder`,()=>this._onColumnOrderChange())])}_onGridInteraction(e){let t=this._grid;if(r(t),(e.type===`pointerover`||e.type===`pointerout`)&&e.relatedTarget!==t){let{target:t,relatedTarget:n}=e;if(!(this._isGridCellContentNode(t)&&this._isGridCellContentNode(n)))return}let n=null;try{n=t.getEventContext(e)}catch{}if(!n)return;let{column:i,index:a,item:o,section:s}=n;if(!s)return;if(s===`header`&&e.type===`keydown`&&i?.path){let t=e.key;_.sort.includes(t)&&this.findColumn(i.path)?.sort()}let c=`cell-${e.type}`;this.emit(c,{type:c,context:n,index:a,item:o,native:e,path:i?.path??void 0})}_onTransientGridInteraction(e){if(e.type===`pointerout`){this.temporaryHighlightId=void 0;return}let t=this._grid;if(t)try{this.temporaryHighlightId=t.getEventContext(e)?.item?.objectId??void 0}catch{this.temporaryHighlightId=void 0}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&e.localName===`vaadin-grid-cell-content`)}_onColumnOrderChange(){let e=this._grid;r(e);let t=e._getColumnsInOrder(0),n=[],i=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map(e=>e.getAttribute(`data-fieldName`));t?.forEach(e=>{let t=e.getAttribute(`data-fieldName`);if(t!=null){let e=this.findColumn(t);n.push(t),e&&`columns`in e&&e.columns?.length&&e.columns.sort((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1)}}),this.columns.sort((e,t)=>n.indexOf(e.fieldName)>n.indexOf(t.fieldName)?1:-1),this.notifyChange(`sortOrders`),this.emit(`column-reorder`,{type:`column-reorder`})}_clearSelection(){this.highlightIds.removeAll(),this.temporaryHighlightId=void 0}_onSelectedItemsChange(e){let{highlightIds:t,itemIdPath:n}=this,r=e.detail.value.map(e=>e[n]),i=r.filter(e=>!t.includes(e));if(!this.effectiveMultipleSelectionEnabled&&i.length&&t.length)t.removeAll(),t.add(i[0]);else{let e=t.filter(e=>!r.includes(e));t.removeMany(e),t.addMany(i)}}_applyRenderersToColumnElement(e){let t=e?.path,n=t==null?void 0:this.findColumn(t);if(n)try{let{renderFunction:t,footerRenderFunction:r,headerRenderFunction:i}=n;t&&`renderer`in e&&(e.renderer=(e,n,r)=>t({root:e,column:n,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),i&&(e.headerRenderer=(e,t)=>i({root:e,column:t}))}catch{}}_updateColumnBorderStyles(){try{this._grid?._updateFirstAndLastColumn()}catch{}}};e([c()],v.prototype,`_columnElements`,void 0),e([c()],v.prototype,`_columnRendering`,null),e([c()],v.prototype,`_selectedItems`,null),e([c()],v.prototype,`_grid`,void 0),e([c()],v.prototype,`_gridIsDisabled`,null),e([c()],v.prototype,`_noDataMessage`,null),e([c()],v.prototype,`_table`,null),e([c()],v.prototype,`cellPartNameGenerator`,null),e([c()],v.prototype,`columns`,null),e([c()],v.prototype,`columnPerformanceModeEnabled`,null),e([c()],v.prototype,`columnReorderingEnabled`,null),e([c()],v.prototype,`dataProvider`,null),e([c()],v.prototype,`direction`,null),e([c()],v.prototype,`editingEnabled`,null),e([c()],v.prototype,`effectiveMultipleSelectionEnabled`,null),e([c()],v.prototype,`effectiveSize`,null),e([c()],v.prototype,`groupColumns`,null),e([c()],v.prototype,`hasInvalidColumnConfiguration`,null),e([c()],v.prototype,`highlightIds`,null),e([c()],v.prototype,`temporaryHighlightId`,null),e([c()],v.prototype,`isEditing`,null),e([c()],v.prototype,`isReady`,null),e([c()],v.prototype,`itemIdPath`,void 0),e([c()],v.prototype,`label`,null),e([c(),p(`esri/widgets/FeatureTable/t9n/FeatureTable`)],v.prototype,`messages`,void 0),e([c()],v.prototype,`multipleSelectionEnabled`,null),e([c()],v.prototype,`multipleSelectionEnabledOverride`,null),e([c()],v.prototype,`multiSortEnabled`,null),e([c()],v.prototype,`noDataMessage`,null),e([c()],v.prototype,`pageIndex`,null),e([c()],v.prototype,`multipleSortPriority`,null),e([c()],v.prototype,`pageSize`,null),e([c()],v.prototype,`paginationEnabled`,null),e([c()],v.prototype,`rowDetailsRenderer`,null),e([c()],v.prototype,`rowHighlightIds`,null),e([c()],v.prototype,`selectionColumnEnabled`,void 0),e([c()],v.prototype,`size`,null),e([c({readOnly:!0})],v.prototype,`sortOrders`,null),e([c()],v.prototype,`store`,null),e([c()],v.prototype,`state`,null),e([c()],v.prototype,`viewModel`,void 0),v=e([l(`esri.widgets.FeatureTable.Grid.Grid`)],v);const y=v;export{y as default};
|