@arcgis/core 5.0.0-next.67 → 5.0.0-next.69
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/Ground.d.ts +3 -4
- package/WebDocument2D.d.ts +1 -1
- package/WebLinkChart.d.ts +2 -0
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +3 -4
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +9 -6
- package/analysis/ElevationProfile/ElevationProfileLineViewOptions.js +1 -1
- package/analysis/types.d.ts +1 -0
- package/applications/Components/analysisUtils.d.ts +1 -3
- package/applications/Components/arcadeFeatureUtils.d.ts +1 -1
- package/applications/ExperienceBuilder/sketchUtils.d.ts +2 -2
- package/applications/KnowledgeStudio/reshape.d.ts +2 -2
- package/applications/SceneViewer/sceneViewerUtils.d.ts +11 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
- package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01d7542d85a453384cf1.js +1 -0
- package/assets/esri/core/workers/chunks/{251eb6e00f99a816d55c.js → 0326314947734b8e640a.js} +1 -1
- package/assets/esri/core/workers/chunks/04176244b0a3539c9681.js +1 -0
- package/assets/esri/core/workers/chunks/{168ec8fca2702617a543.js → 09dfec3e097ebbef6a89.js} +1 -1
- package/assets/esri/core/workers/chunks/{942fad4ec96295672ce8.js → 10e474d664b20adcd917.js} +1 -1
- package/assets/esri/core/workers/chunks/12f9a55253084a910b2e.js +1 -0
- package/assets/esri/core/workers/chunks/{0629087bd5bb8048493e.js → 14dedd80fb797303f91f.js} +1 -1
- package/assets/esri/core/workers/chunks/{81d89107ff82604a3ea0.js → 1b445981fbc8373f4dd8.js} +1 -1
- package/assets/esri/core/workers/chunks/{794960ec36e11f4416c2.js → 1d1e25bb61eeeee8ee94.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ba3c2b9f699d94d62b8.js → 1ec1a1997b5577619040.js} +1 -1
- package/assets/esri/core/workers/chunks/2085084324cd5a81783f.js +1 -0
- package/assets/esri/core/workers/chunks/2c2c0f66cffc521df736.js +1 -0
- package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +1 -0
- package/assets/esri/core/workers/chunks/2dfa7abf2d39fa5a3874.js +1 -0
- package/assets/esri/core/workers/chunks/{6cb44cd319cb6c2539c8.js → 2e2c47f8a80ee9234350.js} +1 -1
- package/assets/esri/core/workers/chunks/322085d63719da6e443c.js +1 -0
- package/assets/esri/core/workers/chunks/{76086517591d0eb35156.js → 34a2e0462eb05986cdd1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6dcd13c792b6538ac50.js → 35593a9790818b689455.js} +1 -1
- package/assets/esri/core/workers/chunks/3a04153ca9d8e4f01185.js +1 -0
- package/assets/esri/core/workers/chunks/{4e9a8fce55cad841c731.js → 3b25f5d9c8f78bb6e011.js} +1 -1
- package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +1 -0
- package/assets/esri/core/workers/chunks/3ed317900f0edf635508.js +1 -0
- package/assets/esri/core/workers/chunks/401ce5cb98fa14c1a725.js +1 -0
- package/assets/esri/core/workers/chunks/4319b89cfa02894a8cae.js +1 -0
- package/assets/esri/core/workers/chunks/{7bed14d9bcd7fc5e2eec.js → 4bcd74951477e8977ba1.js} +1 -1
- package/assets/esri/core/workers/chunks/4c04c54330b693892cfc.js +314 -0
- package/assets/esri/core/workers/chunks/{687d2b761dc5b5cf0c31.js → 4d4d71d24c1a9cb342b8.js} +1 -1
- package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
- package/assets/esri/core/workers/chunks/50f03813fba4b752ca9f.js +1 -0
- package/assets/esri/core/workers/chunks/{abc236e99b52be1c83b9.js → 52a14266fe239b95c5ce.js} +1 -1
- package/assets/esri/core/workers/chunks/53b5c77832df7df4d4e3.js +1 -0
- package/assets/esri/core/workers/chunks/{34178ace79e8dea3567d.js → 562cddaf63985e53ee6e.js} +1 -1
- package/assets/esri/core/workers/chunks/563933a84fc9b0e021f6.js +1 -0
- package/assets/esri/core/workers/chunks/58b3a776ef129f7f86dc.js +1 -0
- package/assets/esri/core/workers/chunks/58e8d41dcc450e6427c9.js +1 -0
- package/assets/esri/core/workers/chunks/{6599cc702a46f81a5634.js → 5dd5be91038df8902dc4.js} +1 -1
- package/assets/esri/core/workers/chunks/{49a1b7f700b8a42de817.js → 60c7f896f2246a8aa6d7.js} +19 -19
- package/assets/esri/core/workers/chunks/60f363ee2add089e8f0b.js +1 -0
- package/assets/esri/core/workers/chunks/68074a484d7f9bc713c0.js +1 -0
- package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +1 -0
- package/assets/esri/core/workers/chunks/{3fe7be535affae31de7e.js → 6b85a8776ec2beff63cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{0dc3a04ce717b7ddd957.js → 6c9dac4a869742cc2718.js} +1 -1
- package/assets/esri/core/workers/chunks/6df484faf54e90a6cc77.js +1 -0
- package/assets/esri/core/workers/chunks/6ea6ad894ac634aa4391.js +1 -0
- package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +1 -0
- package/assets/esri/core/workers/chunks/75fd2ef1236a9364ca7f.js +1 -0
- package/assets/esri/core/workers/chunks/7be9bbae23895d1cfa92.js +1 -0
- package/assets/esri/core/workers/chunks/7ea48661f1087d06aa41.js +1 -0
- package/assets/esri/core/workers/chunks/{47e5149765beee46f208.js → 7ee68f67f9cc48a328f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5aac523c37d906eece6.js → 827277e5da652bcecaf2.js} +1 -1
- package/assets/esri/core/workers/chunks/866477acdf03b8a40bc9.js +1 -0
- package/assets/esri/core/workers/chunks/8e83c133b201b9b61e70.js +1 -0
- package/assets/esri/core/workers/chunks/9086a4933d3d3d9ffa72.js +1 -0
- package/assets/esri/core/workers/chunks/94174d40de39dbe7d0bf.js +1 -0
- package/assets/esri/core/workers/chunks/{dd99b77a7c0a052507bb.js → 9d88b4ba8e511da64583.js} +3 -3
- package/assets/esri/core/workers/chunks/9f34cf024231f574009c.js +1 -0
- package/assets/esri/core/workers/chunks/{e705d041f6c1632bfbcc.js → a10c6dd3bb8b3602de68.js} +1 -1
- package/assets/esri/core/workers/chunks/a64cd02ca959d511101c.js +1 -0
- package/assets/esri/core/workers/chunks/a808be466812db51813d.js +1 -0
- package/assets/esri/core/workers/chunks/{6b4a24248182245167ca.js → a931515a2569713e743b.js} +1 -1
- package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +1 -0
- package/assets/esri/core/workers/chunks/adc68e2c6d2698a52bfe.js +1 -0
- package/assets/esri/core/workers/chunks/{0f8149fdcf0adeca268e.js → b28e0b89603d8b03f9e1.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e4a36784d598ae6679.js +1 -0
- package/assets/esri/core/workers/chunks/{204d738c8b651314ae64.js → b899b4e7979c13b99526.js} +1 -1
- package/assets/esri/core/workers/chunks/bb4574a87ca21e719f0d.js +1 -0
- package/assets/esri/core/workers/chunks/{07639f406b71bb49ffd6.js → bdbb5b33f0f49661bf6d.js} +1 -1
- package/assets/esri/core/workers/chunks/bf05164b7a3e4f31e9db.js +1 -0
- package/assets/esri/core/workers/chunks/c042269586921e337be9.js +1 -0
- package/assets/esri/core/workers/chunks/c7391b0b5a9c916a53f7.js +1 -0
- package/assets/esri/core/workers/chunks/{43d28c6509c21b8917a8.js → ca7523c14d81c470e92e.js} +1 -1
- package/assets/esri/core/workers/chunks/d0ae8752419d5b761190.js +1 -0
- package/assets/esri/core/workers/chunks/d445e9399fe4ca3d2a50.js +1 -0
- package/assets/esri/core/workers/chunks/d7683a95775c9f401a7e.js +1 -0
- package/assets/esri/core/workers/chunks/{9d6945cda99d14af83ac.js → d7d9656b990ce8be2152.js} +1 -1
- package/assets/esri/core/workers/chunks/dbfb00fb28b8b9f687a1.js +1 -0
- package/assets/esri/core/workers/chunks/df4a0af329ce94a47a7b.js +1 -0
- package/assets/esri/core/workers/chunks/e071b912539304564b69.js +1 -0
- package/assets/esri/core/workers/chunks/e10d6e511921394474ca.js +1 -0
- package/assets/esri/core/workers/chunks/e4b6aa8f67c2bd285020.js +1 -0
- package/assets/esri/core/workers/chunks/e6ca02f98f855024f74b.js +1 -0
- package/assets/esri/core/workers/chunks/{892157696e8f9e38c472.js → e6e837e43b9348050832.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3325ed8d224e2350db7.js → e8a3ad00936f2ccaf362.js} +1 -1
- package/assets/esri/core/workers/chunks/ef7063ee790d2d64d4b2.js +1 -0
- package/assets/esri/core/workers/chunks/{b65fcfde62d49de1fa54.js → ef977be20a647aeded0a.js} +1 -1
- package/assets/esri/core/workers/chunks/efb631371b6bb3f043bb.js +1 -0
- package/assets/esri/core/workers/chunks/{0f5693541111fcae0c2f.js → f0914715e90e43466f8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab71865b94022e78035c.js → f92845eb7df1804fcd6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfc063d4431bfa162160.js → fd09f38fb4d99bf34988.js} +1 -1
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +108 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GaussianSplatDepthComposition.glsl.js +4 -5
- package/chunks/HUDMaterial.glsl.js +45 -47
- package/chunks/LineMarker.glsl.js +33 -34
- package/chunks/PointRenderer.glsl.js +6 -6
- package/chunks/RibbonLine.glsl.js +62 -54
- package/chunks/boundedPlane.js +1 -1
- package/chunks/libtess-f32.js +1 -1
- package/chunks/libtess-f64.js +1 -1
- package/config.js +1 -1
- package/core/Collection.d.ts +3 -2
- package/core/Identifiable.d.ts +1 -3
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/types.d.ts +0 -8
- package/core/compilerUtils.js +1 -1
- package/core/promiseUtils.d.ts +1 -1
- package/core/reactiveUtils.d.ts +2 -2
- package/core/typedArrayUtil.js +1 -1
- package/core/units.d.ts +8 -2
- package/core/units.js +1 -1
- package/core/workers/loaderConfig.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/geometry/HeightModelInfo.d.ts +3 -3
- package/geometry/SpatialReference.d.ts +2 -2
- package/geometry/libtess.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/meshUtils/External.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/imageutils.js +1 -1
- package/geometry/support/meshUtils/loadExternal.js +1 -1
- package/geometry/support/meshUtils/types.d.ts +2 -2
- package/geometry/support/rotate.js +1 -1
- package/geometry/types.d.ts +2 -0
- package/identity/IdentityManagerBase.d.ts +4 -4
- package/interfaces.d.ts +2937 -2955
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.d.ts +3 -4
- package/layers/BuildingSceneLayer.d.ts +1 -1
- package/layers/ElevationLayer.d.ts +3 -4
- package/layers/FeatureLayer.d.ts +12 -11
- package/layers/FeatureLayer.js +1 -1
- package/layers/GroupLayer.d.ts +3 -3
- package/layers/ImageryLayer.d.ts +3 -3
- package/layers/ImageryTileLayer.d.ts +3 -4
- package/layers/Layer.d.ts +4 -4
- package/layers/LineOfSightLayer.d.ts +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +7 -8
- package/layers/MediaLayer.d.ts +3 -3
- package/layers/OrientedImageryLayer.d.ts +3 -3
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/RouteLayer.d.ts +2 -3
- package/layers/SceneLayer.d.ts +167 -3
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.d.ts +3 -3
- package/layers/SubtypeGroupLayer.d.ts +3 -3
- package/layers/WCSLayer.d.ts +3 -3
- package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/dehydratedFeatureComparison.js +1 -1
- package/layers/graphics/dehydratedFeatures.js +1 -1
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/graphics/sources/ParquetSource.d.ts +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/SceneService.d.ts +2 -2
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.d.ts +2 -2
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/types.d.ts +1 -1
- package/layers/raster/datasets/pixelReader.d.ts +1 -7
- package/layers/raster/functions/changeDetectionUtils.js +1 -1
- package/layers/raster/functions/creators/createBandIndexFunctions.d.ts +29 -29
- package/layers/raster/functions/customBandIndexUtils.js +1 -1
- package/layers/raster/functions/focalStatUtils.js +1 -1
- package/layers/raster/functions/pixelTransformUtils.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/BuildingFilterMode.d.ts +3 -1
- package/layers/support/BuildingFilterMode.js +1 -1
- package/layers/support/BuildingFilterModeSolid.js +1 -1
- package/layers/support/BuildingFilterModeWireFrame.js +1 -1
- package/layers/support/BuildingFilterModeXRay.js +1 -1
- package/layers/support/CodedValue.d.ts +1 -1
- package/layers/support/ControlPoint.d.ts +6 -20
- package/layers/support/ControlPointsGeoreference.d.ts +2 -1
- package/layers/support/ElevationSampler.d.ts +2 -2
- package/layers/support/ElevationSampler.js +1 -1
- package/layers/support/FeatureReductionBinning.d.ts +4 -4
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionSelection.d.ts +3 -3
- package/layers/support/FeatureReductionSelection.js +1 -1
- package/layers/support/Field.d.ts +1 -2
- package/layers/support/ParquetGeometryEncodingLocation.d.ts +6 -4
- package/layers/support/ParquetGeometryEncodingLocation.js +1 -1
- package/layers/support/ParquetGeometryEncodingWkb.d.ts +6 -4
- package/layers/support/ParquetGeometryEncodingWkb.js +1 -1
- package/layers/support/PixelBlock.d.ts +11 -3
- package/layers/support/RangeDomain.d.ts +2 -1
- package/layers/support/SceneServiceTimeInfo.js +5 -0
- package/layers/support/SpriteSource.d.ts +1 -0
- package/layers/support/Sublayer.d.ts +17 -16
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/domains.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +30 -30
- package/layers/support/types.d.ts +101 -1
- package/layers/types.d.ts +12 -1
- package/layers/wms/types.d.ts +0 -4
- package/networks/CircuitManager.d.ts +5 -5
- package/networks/Network.d.ts +5 -5
- package/networks/UtilityNetwork.d.ts +2 -2
- package/networks/support/TopologyValidationJobInfo.js +1 -1
- package/networks/support/TraceJobInfo.js +1 -1
- package/package.json +2 -2
- package/popup/content/types.d.ts +1 -3
- package/portal/PortalItem.d.ts +8 -8
- package/portal/PortalItemResource.d.ts +2 -2
- package/portal/PortalUser.d.ts +3 -3
- package/portal/support/resourceUtils.d.ts +3 -3
- package/portal/types.d.ts +6 -6
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/pointCloud/types.d.ts +1 -0
- package/renderers/support/raster/types.d.ts +1 -0
- package/renderers/support/rendererConversion.js +1 -1
- package/renderers/types.d.ts +2 -0
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.d.ts +0 -2
- package/rest/layerSources/DynamicDataLayer.d.ts +102 -0
- package/rest/layerSources/DynamicDataLayer.js +5 -0
- package/{layers/support/source/MapLayerSource.d.ts → rest/layerSources/DynamicMapLayer.d.ts} +4 -4
- package/rest/layerSources/DynamicMapLayer.js +5 -0
- package/rest/layerSources/JoinTableDataSource.d.ts +75 -0
- package/rest/layerSources/JoinTableDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/QueryTableDataSource.d.ts +8 -7
- package/rest/layerSources/QueryTableDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/RasterDataSource.d.ts +2 -2
- package/rest/layerSources/RasterDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/TableDataSource.d.ts +2 -2
- package/rest/layerSources/TableDataSource.js +5 -0
- package/rest/layerSources/utils.js +5 -0
- package/rest/print.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/types.d.ts +0 -4
- package/smartMapping/heuristics/binLevel.d.ts +2 -2
- package/smartMapping/heuristics/scaleRange.d.ts +2 -2
- package/smartMapping/heuristics/sizeRange.d.ts +2 -2
- package/smartMapping/heuristics/sizeRange.js +1 -1
- package/smartMapping/heuristics/types.d.ts +3 -3
- package/smartMapping/labels/bins.d.ts +2 -2
- package/smartMapping/labels/clusters.d.ts +2 -2
- package/smartMapping/renderers/color.d.ts +14 -14
- package/smartMapping/renderers/dotDensity.d.ts +2 -2
- package/smartMapping/renderers/heatmap.d.ts +4 -4
- package/smartMapping/renderers/location.d.ts +2 -2
- package/smartMapping/renderers/opacity.d.ts +2 -2
- package/smartMapping/renderers/pieChart.d.ts +4 -4
- package/smartMapping/renderers/predominance.d.ts +2 -2
- package/smartMapping/renderers/relationship.d.ts +4 -4
- package/smartMapping/renderers/size.d.ts +15 -15
- package/smartMapping/renderers/support/rendererUtils.d.ts +2 -2
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/type.d.ts +4 -4
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
- package/smartMapping/statistics/classBreaks.d.ts +2 -2
- package/smartMapping/statistics/heatmapStatistics.d.ts +2 -2
- package/smartMapping/statistics/histogram.d.ts +2 -2
- package/smartMapping/statistics/predominantCategories.d.ts +2 -2
- package/smartMapping/statistics/summaryStatistics.d.ts +2 -2
- package/smartMapping/statistics/summaryStatisticsForAge.d.ts +2 -2
- package/smartMapping/statistics/support/ageUtils.d.ts +2 -2
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/statistics/types.d.ts +7 -7
- package/smartMapping/statistics/uniqueValues.d.ts +2 -2
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/smartMapping/symbology/color.d.ts +8 -8
- package/smartMapping/symbology/dotDensity.d.ts +6 -6
- package/smartMapping/symbology/flow.d.ts +6 -6
- package/smartMapping/symbology/heatmap.d.ts +6 -6
- package/smartMapping/symbology/location.d.ts +2 -2
- package/smartMapping/symbology/pieChart.d.ts +6 -6
- package/smartMapping/symbology/predominance.d.ts +6 -6
- package/smartMapping/symbology/relationship.d.ts +6 -6
- package/smartMapping/symbology/size.d.ts +2 -2
- package/smartMapping/symbology/support/colorRamps.d.ts +2 -2
- package/smartMapping/symbology/type.d.ts +6 -6
- package/support/popupUtils.d.ts +2 -2
- package/support/revision.js +1 -1
- package/symbols/LineSymbol3D.d.ts +2 -2
- package/symbols/PointSymbol3D.d.ts +2 -2
- package/symbols/PolygonSymbol3D.d.ts +2 -2
- package/symbols/patterns/LinePattern3D.d.ts +8 -0
- package/symbols/patterns/LineStylePattern3D.d.ts +1 -2
- package/symbols/patterns/Pattern3D.d.ts +9 -0
- package/symbols/patterns/StylePattern3D.d.ts +1 -2
- package/symbols/support/ElevationInfo.d.ts +2 -2
- package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
- package/symbols/support/defaults.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/symbolLayerUtils3D.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/symbols/types.d.ts +7 -0
- package/unionTypes.d.ts +13 -13
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +16 -11
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/analysis/types.d.ts +1 -0
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/input/handlers/DoubleTapDragZoom.js +1 -1
- package/views/2d/input/handlers/KeyZoom.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +0 -5
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/support/MediaLayerInteractionOptions.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/utils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +16 -11
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +0 -2
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/types.d.ts +1 -0
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/SceneViewEnvironment.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +1 -3
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/internal/fillDefaults.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
- package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
- package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/layers/graphics/primitiveObjectSymbolUtils.js +1 -1
- package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/SphereCone.js +5 -0
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionOptions.d.ts +4 -0
- package/views/3d/layers/support/edgeUtils.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +8 -8
- package/views/3d/webgl-engine/collections/Component/Transform.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/LocalOriginManager.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/LegacyTransform.js +5 -0
- package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +4 -4
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/types.d.ts +4 -0
- package/views/draw/Draw.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/input/types.d.ts +2 -4
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
- package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
- package/views/interactive/snapping/featureSources/symbologySnappingCandidates.js +1 -1
- package/views/layers/CatalogLayerView.d.ts +1 -4
- package/views/layers/DimensionLayerView.d.ts +4 -6
- package/views/layers/DimensionLayerViewMixin.d.ts +0 -97
- package/views/layers/LineOfSightLayerView.d.ts +4 -6
- package/views/layers/LineOfSightLayerViewMixin.d.ts +0 -77
- package/views/layers/StreamLayerView.d.ts +31 -2
- package/views/support/PromiseQueue.js +1 -1
- package/views/support/WebAssemblyRequirements.js +5 -0
- package/views/support/WebGLRequirements.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Uniform.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/webdoc/support/SlideThumbnail.d.ts +6 -3
- package/webdoc/support/SlideThumbnail.js +1 -1
- package/webscene/Slide.d.ts +2 -2
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -2
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +2 -2
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/textInputElementUtils.js +5 -0
- package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +2 -2
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.d.ts +20 -4
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.d.ts +2 -3
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -2
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -2
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.d.ts +2 -2
- package/widgets/ElevationProfile/support/HoveredPoints.js +1 -1
- package/widgets/ElevationProfile/types.d.ts +3 -4
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/Feature/types.d.ts +1 -5
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +0 -2
- package/widgets/FeatureTable/support/types.d.ts +8 -8
- package/widgets/Features/FeaturesViewModel.d.ts +3 -3
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.d.ts +2 -2
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/Popup/types.d.ts +0 -2
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ShadowCastVisibleElements.d.ts +2 -0
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/Sketch/types.d.ts +2 -2
- package/widgets/Slice/SliceViewModel.d.ts +2 -2
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Spinner/SpinnerViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/support/AnalysisViewModelMixin.js +5 -0
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModelMixin.js +5 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/055fdc5134d54174444d.js +0 -316
- package/assets/esri/core/workers/chunks/058fb2cd6387acfd458c.js +0 -1
- package/assets/esri/core/workers/chunks/08359ae020238a565955.js +0 -1
- package/assets/esri/core/workers/chunks/0ae018098906d6a88904.js +0 -1
- package/assets/esri/core/workers/chunks/0cd3acfbf9ee991bdab4.js +0 -1
- package/assets/esri/core/workers/chunks/0e5cd0cf6ab7cb37d723.js +0 -1
- package/assets/esri/core/workers/chunks/0ee407b8db5c07a00d82.js +0 -1
- package/assets/esri/core/workers/chunks/10373885604655f673df.js +0 -1
- package/assets/esri/core/workers/chunks/119822a646834c1cebc0.js +0 -1
- package/assets/esri/core/workers/chunks/13d61d34e55c80e4ecdf.js +0 -1
- package/assets/esri/core/workers/chunks/17dea03fc4eb414f0022.js +0 -1
- package/assets/esri/core/workers/chunks/1967239713b58dccfd81.js +0 -1
- package/assets/esri/core/workers/chunks/1c350a2c4014146dbcd9.js +0 -1
- package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
- package/assets/esri/core/workers/chunks/226acd251ad7d7ee3b57.js +0 -1
- package/assets/esri/core/workers/chunks/22b07c54a5fcc27771b0.js +0 -1
- package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +0 -1
- package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +0 -1
- package/assets/esri/core/workers/chunks/27f096c434f049b8df01.js +0 -1
- package/assets/esri/core/workers/chunks/3371935a4fd6346d3a17.js +0 -1
- package/assets/esri/core/workers/chunks/3c3d311b88f5400951ef.js +0 -1
- package/assets/esri/core/workers/chunks/3c4f8597f602779174f1.js +0 -1
- package/assets/esri/core/workers/chunks/3da53c017f9c5d2d778a.js +0 -1
- package/assets/esri/core/workers/chunks/4773a358832f87963766.js +0 -1
- package/assets/esri/core/workers/chunks/492515860198f38dd698.js +0 -1
- package/assets/esri/core/workers/chunks/4f33a2ecb154a2c2449c.js +0 -1
- package/assets/esri/core/workers/chunks/4f6f181ee83b4d484518.js +0 -1
- package/assets/esri/core/workers/chunks/52726458f590e726d52c.js +0 -1
- package/assets/esri/core/workers/chunks/536c492fdda30f2f1288.js +0 -1
- package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +0 -1
- package/assets/esri/core/workers/chunks/62b28f73f814413c10fc.js +0 -1
- package/assets/esri/core/workers/chunks/63b8cd7d5cafbaeed894.js +0 -1
- package/assets/esri/core/workers/chunks/6925f09d44cc38480d53.js +0 -1
- package/assets/esri/core/workers/chunks/7f4fa2f2e85863d3cfb9.js +0 -1
- package/assets/esri/core/workers/chunks/8f4c480c418eba299c2b.js +0 -1
- package/assets/esri/core/workers/chunks/990341f7c47bd656c782.js +0 -1
- package/assets/esri/core/workers/chunks/a3836f6a93924ee4816e.js +0 -1
- package/assets/esri/core/workers/chunks/ab520fd1ae917daf07d8.js +0 -1
- package/assets/esri/core/workers/chunks/acc7ff44bfcb5c195114.js +0 -1
- package/assets/esri/core/workers/chunks/b25a131c04092c3ab75d.js +0 -1
- package/assets/esri/core/workers/chunks/b7960ab9a9da7f88184c.js +0 -1
- package/assets/esri/core/workers/chunks/b9909264cfea68d5f2a1.js +0 -1
- package/assets/esri/core/workers/chunks/ba7f57788847cc0f68df.js +0 -1
- package/assets/esri/core/workers/chunks/bb08359610a41e304b55.js +0 -1
- package/assets/esri/core/workers/chunks/bf06250be7a7a36306b1.js +0 -1
- package/assets/esri/core/workers/chunks/bfbbcaa1fb04f17fc869.js +0 -1
- package/assets/esri/core/workers/chunks/d30cfc5fa302cc08d862.js +0 -1
- package/assets/esri/core/workers/chunks/d75adfd4acb3c92accc9.js +0 -1
- package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +0 -1
- package/assets/esri/core/workers/chunks/de71db3b0fb947b13c97.js +0 -1
- package/assets/esri/core/workers/chunks/dfbbead4c24d13682891.js +0 -1
- package/assets/esri/core/workers/chunks/e4ba850e8344ac2c5fc0.js +0 -1
- package/assets/esri/core/workers/chunks/f7d93aae350796b88562.js +0 -1
- package/assets/esri/core/workers/chunks/f9370830051865a3435b.js +0 -1
- package/layers/mixins/TemporalSceneLayer.d.ts +0 -177
- package/layers/mixins/TemporalSceneLayer.js +0 -5
- package/layers/mixins/properties/ILayerWithSave.d.ts +0 -11
- package/layers/support/ContingencyConstraintViolation.d.ts +0 -2
- package/layers/support/ContingentValue.d.ts +0 -2
- package/layers/support/ContingentValuesResult.d.ts +0 -2
- package/layers/support/ElevationQuery.d.ts +0 -35
- package/layers/support/ElevationQueryContext.d.ts +0 -37
- package/layers/support/FeatureReduction.d.ts +0 -3
- package/layers/support/FeatureReduction.js +0 -5
- package/layers/support/FieldGroup.d.ts +0 -2
- package/layers/support/FieldValueType.d.ts +0 -2
- package/layers/support/I3SLayer.d.ts +0 -9
- package/layers/support/ParquetGeometryEncodingBase.d.ts +0 -9
- package/layers/support/ParquetGeometryEncodingBase.js +0 -5
- package/layers/support/SimpleBandStatistics.d.ts +0 -10
- package/layers/support/source/DataLayerSource.d.ts +0 -171
- package/layers/support/source/DataLayerSource.js +0 -5
- package/layers/support/source/MapLayerSource.js +0 -5
- package/layers/support/source/QueryTableDataSource.js +0 -5
- package/layers/support/source/RasterDataSource.js +0 -5
- package/layers/support/source/TableDataSource.js +0 -5
- package/layers/support/source/types.d.ts +0 -4
- package/views/2d/layers/features/FeaturePipelineWorkerProxy.d.ts +0 -32
- package/views/3d/webgl-engine/shaders/GaussianSplatColorTechnique.js +0 -5
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +0 -5
- package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +0 -5
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
- package/widgets/support/AnalysisViewModel.d.ts +0 -5
- package/widgets/support/AnalysisViewModel.js +0 -5
- package/widgets/support/AnchorElementViewModel.d.ts +0 -3
- package/widgets/support/InteractiveToolViewModel.d.ts +0 -4
- package/widgets/support/InteractiveToolViewModel.js +0 -5
- /package/webdoc/support/{thumbnailUtils.d.ts → types.d.ts} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as e,__disposeResources as r}from"tslib";import{isSupportedLayer as t}from"../../../arcade/featureset/support/shared.js";import a from"../../../core/Logger.js";import{sqlAnd as i}from"../../../core/sql.js";import{isImageryGraphicOrigin as n}from"../../../graphic/isImageryGraphicOrigin.js";import{isImageryTileGraphicOrigin as o}from"../../../graphic/isImageryTileGraphicOrigin.js";import s from"../../../layers/FeatureLayer.js";import{internalTimeReceivedField as c}from"../../../layers/support/streamLayerUtils.js";import{isDate as u}from"../../../support/guards.js";import{applyTextFormattingHTML as l,htmlEntities as p}from"./featureUtils.js";const d="esri.widgets.Feature.support.arcadeFeatureUtils",f=()=>a.getLogger(d);function y(e){return l(p(e))}function m(e){return"createQuery"in e&&"queryFeatures"in e}async function g({graphic:e,view:r,options:t}){const{isAggregate:a}=e,i=e.layer??e.sourceLayer;if(!a||!i||"2d"!==r?.type)return[];const n=await r.whenLayerView(i);if(!m(n))return[];const o=n.createQuery(),s=e.getObjectId();o.aggregateIds=null!=s?[s]:[];const{features:c}=await n.queryFeatures(o,t);return c}function w({layer:e,aggregatedFeatures:r,interceptor:t}){const{fields:a,objectIdField:i,geometryType:n,spatialReference:o}=e,c="displayField"in e?e.displayField:void 0;return new s({fields:a,objectIdField:i,geometryType:n,spatialReference:o,displayField:c,interceptor:t,..."feature"===e.type?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:r})}function v(e){return e.isAggregate?"popup-feature-reduction":"esri.views.3d.layers.VoxelGraphic"===e.declaredClass?"popup-voxel":n(e.origin)||o(e.origin)?"popup-imagery":"popup"}function h(e){return{scale:e?.scale,timeProperties:{currentStart:e?.timeExtent?.start,currentEnd:e?.timeExtent?.end,startIncluded:!0,endIncluded:!0}}}function x(e){return{$voxel:e}}function b(e,r,t){let a=null;const
|
|
5
|
+
import{__addDisposableResource as e,__disposeResources as r}from"tslib";import{isSupportedLayer as t}from"../../../arcade/featureset/support/shared.js";import a from"../../../core/Logger.js";import{sqlAnd as i}from"../../../core/sql.js";import{isImageryGraphicOrigin as n}from"../../../graphic/isImageryGraphicOrigin.js";import{isImageryTileGraphicOrigin as o}from"../../../graphic/isImageryTileGraphicOrigin.js";import s from"../../../layers/FeatureLayer.js";import{internalTimeReceivedField as c}from"../../../layers/support/streamLayerUtils.js";import{isDate as u}from"../../../support/guards.js";import{applyTextFormattingHTML as l,htmlEntities as p}from"./featureUtils.js";const d="esri.widgets.Feature.support.arcadeFeatureUtils",f=()=>a.getLogger(d);function y(e){return l(p(e))}function m(e){return"createQuery"in e&&"queryFeatures"in e}async function g({graphic:e,view:r,options:t}){const{isAggregate:a}=e,i=e.layer??e.sourceLayer;if(!a||!i||"2d"!==r?.type)return[];const n=await r.whenLayerView(i);if(!m(n))return[];const o=n.createQuery(),s=e.getObjectId();o.aggregateIds=null!=s?[s]:[];const{features:c}=await n.queryFeatures(o,t);return c}function w({layer:e,aggregatedFeatures:r,interceptor:t}){const{fields:a,objectIdField:i,geometryType:n,spatialReference:o}=e,c="displayField"in e?e.displayField:void 0;return new s({fields:a,objectIdField:i,geometryType:n,spatialReference:o,displayField:c,interceptor:t,..."feature"===e.type?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:r})}function v(e){return e.isAggregate?"popup-feature-reduction":"esri.views.3d.layers.VoxelGraphic"===e.declaredClass?"popup-voxel":n(e.origin)||o(e.origin)?"popup-imagery":"popup"}function h(e){return{scale:e?.scale,timeProperties:{currentStart:e?.timeExtent?.start,currentEnd:e?.timeExtent?.end,startIncluded:!0,endIncluded:!0}}}function x(e){return{$voxel:e}}function b(e,r,t){let a=null;if(null!=e){const r=e.origin.layer;if("imagery"===r.type&&"mosaic-dataset"===r.sourceType){a=e.cloneShallow();const r=e.origin.layer.fieldsIndex;a.attributes=Object.fromEntries(Object.entries(a.attributes??{}).filter(([e])=>r.has(e)))}}return{$pixel:e,$imageCollectionItem:a,$userInput:r,$view:h(t)}}async function F(e,r,t,a,i,n,o){let s=null;if(n.has("$aggregatedfeatures")){const e=await g({graphic:r,view:t,options:a}),n=r.sourceLayer||r.layer;s=w({layer:n,aggregatedFeatures:e,interceptor:i})}return{vars:{$feature:r,$aggregatedFeatures:s,$view:h(t)},track:o?await $(e,r,t):null,[Symbol.dispose]:()=>s?.[Symbol.dispose]()}}function I(e){if(u(e))return e.getTime();if("number"==typeof e)return e;if("string"==typeof e)return new Date(e).getTime();throw new Error(`Unexpected time value: ${e}`)}async function $(e,r,t){const a=r.sourceLayer||r.layer;if(null==a||!("timeInfo"in a))return null;const n=a.timeInfo?.trackIdField;if(null==n)return null;const o=r.getAttribute(n);if(null==o)return null;let s,u;if("string"==typeof o)s=`"${n.replaceAll('"','""')}" = '${o.replaceAll("'","''")}'`;else{if("number"!=typeof o)return f().warn("Expected track id to be a string or number"),null;s=`"${n.replaceAll('"','""')}" = ${o}`}if("stream"===a.type&&null!=t){const e=await t.whenLayerView(a),r=e.createQuery();r.returnGeometry=!0,r.where=i(r.where,s),u=(await e.queryFeatures(r)).features}else{if(!("queryFeatures"in a))return null;{const e=a.createQuery();e.returnGeometry=!0,e.where=i(e.where,s),u=(await a.queryFeatures(e)).features}}const l=a.fieldsIndex.normalizeFieldName(a.timeInfo.startField)??c,p=a.timeInfo.endField?a.fieldsIndex.normalizeFieldName(a.timeInfo.endField):null,d=u.map(r=>{const a=r.getObjectId();if(null==a)throw new Error("Cannot identify observation");const i=e.ArcadeFeature.createFromGraphic(r,t?.timeZone),n=I(r.getAttribute(l));return{id:a,feature:i,startTime:n,endTime:null!=p?I(r.getAttribute(p)):n,stats:{totalDistance:void 0,distance:void 0,speed:void 0,acceleration:void 0}}}).sort((e,r)=>e.startTime-r.startTime),y="esri.TrackGraphic"===r.declaredClass?d.length-1:d.findIndex(e=>r.getObjectId()===e.id);if(y<0)throw new Error("Couldn't locate feature in observations");return{observations:d,currentObservationIndex:y}}async function j(e,r,a,i,n,o){const s=(r.sourceLayer||r.layer)??void 0;return{vars:{$feature:r,$layer:null!=s&&t(s)?s:"scene"===s?.type&&null!=s.associatedLayer?s.associatedLayer:void 0,$map:a,$datastore:s&&"url"in s?s.url:void 0,$userInput:i,$graph:"knowledge-graph-sublayer"===s?.type?s.parentCompositeLayer?.knowledgeGraph:void 0,$view:h(n)},track:o?await $(e,r,n):null}}async function T(e,{arcade:r,graphic:t,map:a,location:i,view:n,options:o,interceptor:s,arcadeExecutor:c,usesTrack:u}){switch(e){case"popup":return{...await j(r,t,a,i,n,u),[Symbol.dispose](){}};case"popup-feature-reduction":{const e=new Set(c.variablesUsed);return await F(r,t,n,o,s,e,u)}case"popup-voxel":return{vars:x(t),track:null,[Symbol.dispose](){}};case"popup-imagery":return{vars:b(t,i,n),track:null,[Symbol.dispose](){}};default:throw new Error(`Unexpected profile name ${e}`)}}async function k(){const[e,r,{Feature:t}]=await Promise.all([import("../../../arcade.js"),import("../../../arcade/arcade.js"),import("../../../arcade/Feature.js")]);return{executor:e,syntaxUtils:r,ArcadeFeature:t}}async function E(t,a,i){const{executor:{createArcadeProfile:n,createArcadeExecutor:o},syntaxUtils:s}=i,c=v(a),u=n(c);let l;try{l=await o(t,u)}catch(y){return f().error("arcade-executor-error",{error:y,expression:t}),null}const p=new Set;l.variablesUsed.includes("$view")&&(s.scriptUsesViewProperties(l.syntaxTree,["scale"])&&p.add("view-scale"),s.scriptUsesViewProperties(l.syntaxTree,["timeProperties"])&&p.add("view-time-extent"));const d=s.scriptUsesTrack(l.syntaxTree);return{dependencies:p,async evaluate({graphic:a,interceptor:n,location:o,map:s,options:u,spatialReference:p,view:m}){const g={stack:[],error:void 0,hasError:!1};try{const r=e(g,await T(c,{arcade:i,graphic:a,map:s,location:o,view:m,options:u,interceptor:n,arcadeExecutor:l,usesTrack:d}),!1),w={abortSignal:u?.signal??void 0,interceptor:n??void 0,rawOutput:!0,spatialReference:p??void 0,timeZone:m?.timeZone,track:r.track,console(...e){f().info(...e)}};try{return await l.executeAsync(r.vars,w)}catch(y){if(u?.signal?.aborted)return;return void f().error("arcade-execution-error",{error:y,graphic:a,expression:t})}}catch(w){g.error=w,g.hasError=!0}finally{r(g)}}}}async function A({expression:e,graphic:r}){return e?E(e,r,await k()):null}async function L(e,r){if(!e?.length)return{dependencies:new Set,expressions:new Map};const t=await k(),a=new Set,i=new Map;for(const n of e){const e=await E(n.expression,r,t);i.set(`expression/${n.name}`,e),e?.dependencies.forEach(e=>a.add(e))}return{dependencies:a,expressions:i}}export{A as compileExpression,L as compileExpressionInfos,y as formatArcadeValue,b as prepareImageryPopupArgs};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{neverReached as n}from"../../core/compilerUtils.js";import{EventedAccessor as s}from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{EsriPromiseMixin as r}from"../../core/Promise.js";import{debounce as a}from"../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,whenOnce as p,on as c}from"../../core/reactiveUtils.js";import{templateHasKey as h}from"../../core/string.js";import{property as d,subclass as f}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../core/support/UpdatingHandles.js";import y from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as g,isGroupElement as _,isFieldElement as v,isRelationshipElement as I,isTextElement as x}from"../../form/support/formUtils.js";import E from"../../layers/support/ContingentValue.js";import{isEditableLayer as C}from"../../layers/support/editableLayers.js";import F from"../../layers/support/LayerContingentValuesCache.js";import b from"../../rest/networks/support/Association.js";import{utc as V,unknown as w,system as A}from"../../time/constants.js";import{flattenAssociationInputs as j,flattenFieldInputs as T,isGroupInput as M,flattenRelationshipInputs as k,parseFormTemplateString as N,isRelationshipInput as S,isFieldInput as L,isTextElementInput as R,getNormalizedFeatureTypeInfo as U,valueIsValidContingentValue as Z}from"./featureFormUtils.js";import H from"./FieldInput.js";import{FormExpressionsManager as P}from"./FormExpressionsManager.js";import O from"./GroupInput.js";import W from"./RelationshipInput.js";import G from"./TextElementInput.js";import{createFormExpressionArcadeExecutor as $}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const D=new t({attributes:{}}),z={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},J="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",B="#JSAPI_CONTINGENT_VALUE_ANY_HASH",K="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let Y=class extends(r(s)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=D.clone(),this._initialFeature=D.clone(),this._timeZone=null,this._updatingHandles=new m,this.activeAssociation=null,this.editType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.pendingSubtypeChoice=null,this._updateInputs=a(async()=>{this._stopExpressions();const{_featureClone:e,_initialFeature:t,editType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={editType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,this._startExpressions()})}initialize(){const e=l(()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this._initialFeature,this.timeZone,this.editType],([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch(()=>{}))},u),t=l(()=>this._arcadeContextInfo,e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._evaluateExpressions(e=>e.evaluateAll()))}),n=l(()=>this.layer,e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(F.createLoadedLayerContingentValuesCache(t).then(e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")}))},{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map(e=>[e.name,e]))}get activeAssociationInput(){return this.allAssociationInputs.find(e=>e.uid===this.associationId)}get activeRelationshipInput(){return this.allRelationshipInputs.find(e=>e.relationshipId===this.relationshipId||e.activeCategory||e.showAllEnabled)}get _arcadeContextInfo(){const{_initialFeature:e,editType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:C(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel&&(this.activeAssociationInput.associatedLayer=null,this.activeAssociationInput.viewModel.activeAssociationType=null),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return j(this.inputs)}get allFieldInputs(){return T(this.inputs)}get allGroupInputs(){return this.inputs.filter(M)}get allRelationshipInputs(){return k(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map(e=>[e.name,e]))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");e!==t&&(this._featureClone=e?.clone()??D.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach(t=>t.feature=e)):(this.inputs.forEach(e=>e.destroy()),this.inputs.length=0),t!==e&&(this.pendingSubtypeChoice=null),this.contingencyConstraintViolations.clear(),this._set("feature",e),this._initialFeature=this._featureClone.clone())}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap(e=>e.fields);return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?N({attributes:this.getValues(),label:e.description,layer:t,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?N({attributes:this.getValues(),label:e.title,layer:t,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){const e=this._initialFeature;return e?.sourceLayer&&"applyEdits"in e.sourceLayer?e.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach(e=>{e.showAllEnabled=!1,e.activeCategory=null}),null!=e){const n=t.find(t=>t.relationshipId===e);n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter(e=>!e.valid).every(({submittable:e})=>e)}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return V;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===w?t||V:this._timeZone||A}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every(({valid:e})=>e)}findField(e){return this.allFieldInputs.find(t=>t.name===e)}findGroup(e){return this.allGroupInputs.find(t=>t.id===e)}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],i=null==n.value||s.some(e=>e.value===n.value)?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map(e=>e.value));return[o,s.filter(t=>!e.has(t.value)),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),this._evaluateExpressions(t=>t.evaluateInvalidated([e]))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter(e=>e.valid).map(({name:e})=>e)),n=e.filter(e=>!e.valid).map(({name:e})=>e),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.notifyChange("submittable"),this.notifyChange("valid"),this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{feature:e,_featureClone:t}=this;e&&(t.geometry=e.geometry,this._evaluateExpressions(e=>e.evaluateInvalidatedByGeometry()))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_evaluateExpressions(e){const t=this._expressionsManager;null!=t&&this._updatingHandles.addPromise(e(t).finally(()=>this._afterExpressionsEvaluated()))}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(M(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(e=>this._isSupportedElement(e)),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):g(a)?await this._makeUtilityNetworkAssociationInputFromElement(a,s,i):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await p(()=>!n.updating),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),M(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(S(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else g(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(_(a)){const e=a.elements.filter(e=>this._isSupportedElement(e));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return i.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const i of e)if(M(i)){for(const e of i.inputs)e.destroy();i.inputs.length=0,i.destroy()}else S(i)?i.destroy():L(i)&&(null!==i.element?i.destroy():s.set(i.field,i));const o=[];for(const i of t){const e=n.feature?.getAttribute(i.name)??null,t=s.get(i)??new H({field:i,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});o.push(t.set({...n,value:e})),s.delete(i)}for(const[i,r]of s.entries())s.delete(i),r.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)??null}_makeInputFromElement(e,t,s){return _(e)?q(e,t):v(e)?this._makeFieldInputFromElement(e,t,s):I(e)?this._makeRelationshipInputFromElement(e,t,s):g(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):x(e)?Q(e,t):g(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,s):n()}_makeFieldInputFromElement(e,t,n){const{editType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new H({editType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new W({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(c(()=>a.relatedLayer,"edits",()=>this._evaluateExpressions(e=>e.evaluateAsyncExpressions()))),a}async _makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new(0,(await import("./UtilityNetworkAssociationInput.js")).default)({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=z[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then(t=>{e[s]=this._useExecutor(t)}))}}return R(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,s=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?s.push(this._getOrCreateExecutorForExpression(r.expression,t).then(t=>e.setExpressionExecutor(o,this._useExecutor(t)))):i.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const i of e.fieldsUsed){const n=`return $feature['${i}'];`;s.push(this._getOrCreateExecutorForExpression(n,t).then(t=>e.setFieldExecutor(i,this._useExecutor(t))))}return s}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=$(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new P({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}_startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),this._evaluateExpressions(e=>e.evaluateAll())}_stopExpressions(){this._expressionsManager=o(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=U(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);e&&(this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e,this._initialFeature.sourceLayer=e)}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&h(n,t)&&this.notifyChange("formTitle"),e&&h(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=U(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap(e=>this._joinFieldGroupContingencies(e)),...o.flatMap(e=>e.contingencies)]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map(e=>[...e]),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(B)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(B),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(B)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(B),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:h,rightIsRange:d}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new E({objectType:"null"});continue}if(r&&d||a&&h)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new E({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter(t=>n.every(n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=new RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===B)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every(([e,n])=>!t.values.hasOwnProperty(e)||Z(n,t.values[e]))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[J,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[B,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${K}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}_isSupportedElement(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(i.getLogger(this).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}get test(){return{featureClone:this._featureClone}}};function q(e,t){const{feature:n,layer:s}=t;return new O({element:e,inputs:[],feature:n,layer:s})}function Q(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new G({element:e,feature:s,group:n,layer:i,timeZone:o})}e([d()],Y.prototype,"_expressionInfosLookup",null),e([d()],Y.prototype,"_featureClone",void 0),e([d()],Y.prototype,"_initialFeature",void 0),e([d()],Y.prototype,"_timeZone",void 0),e([d({type:b})],Y.prototype,"activeAssociation",void 0),e([d()],Y.prototype,"activeAssociationInput",null),e([d()],Y.prototype,"activeRelationshipInput",null),e([d()],Y.prototype,"_arcadeContextInfo",null),e([d()],Y.prototype,"associationId",null),e([d()],Y.prototype,"associatedLayer",null),e([d()],Y.prototype,"allAssociationInputs",null),e([d()],Y.prototype,"allFieldInputs",null),e([d()],Y.prototype,"allGroupInputs",null),e([d()],Y.prototype,"allRelationshipInputs",null),e([d()],Y.prototype,"_layerFieldsByName",null),e([d()],Y.prototype,"editType",void 0),e([d()],Y.prototype,"contingencyConstraintViolations",void 0),e([d()],Y.prototype,"disabled",void 0),e([d()],Y.prototype,"feature",null),e([d()],Y.prototype,"fieldsWithContingentValues",null),e([d({type:y})],Y.prototype,"formTemplate",null),e([d()],Y.prototype,"formDescription",null),e([d()],Y.prototype,"formTitle",null),e([d()],Y.prototype,"formHeaderVisible",null),e([d()],Y.prototype,"highlightHelper",void 0),e([d()],Y.prototype,"inputs",void 0),e([d()],Y.prototype,"joinedContingentValues",null),e([d()],Y.prototype,"layer",null),e([d()],Y.prototype,"map",void 0),e([d()],Y.prototype,"callbacks",void 0),e([d()],Y.prototype,"relationshipId",null),e([d()],Y.prototype,"spatialReference",null),e([d()],Y.prototype,"state",null),e([d()],Y.prototype,"strict",void 0),e([d()],Y.prototype,"submittable",null),e([d()],Y.prototype,"timeZone",null),e([d()],Y.prototype,"updating",null),e([d()],Y.prototype,"valid",null),e([d()],Y.prototype,"pendingSubtypeChoice",void 0),e([d()],Y.prototype,"getValues",null),e([d()],Y.prototype,"submit",null),e([d()],Y.prototype,"test",null),Y=e([f("esri.widgets.FeatureForm.FeatureFormViewModel")],Y);const X=Y;export{X as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{EventedAccessor as n}from"../../core/Evented.js";import s from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{debounce as r}from"../../core/promiseUtils.js";import{watch as a,syncAndInitial as l,whenOnce as u,on as p}from"../../core/reactiveUtils.js";import{templateHasKey as c}from"../../core/string.js";import{property as h,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import m from"../../form/FormTemplate.js";import{isUtilityNetworkAssociationsElement as y,isGroupElement as g,isFieldElement as _,isRelationshipElement as v,isTextElement as I}from"../../form/support/formUtils.js";import x from"../../layers/support/ContingentValue.js";import{isEditableLayer as E}from"../../layers/support/editableLayers.js";import C from"../../layers/support/LayerContingentValuesCache.js";import F from"../../rest/networks/support/Association.js";import{utc as b,unknown as V,system as w}from"../../time/constants.js";import{flattenAssociationInputs as A,flattenFieldInputs as j,isGroupInput as T,flattenRelationshipInputs as M,parseFormTemplateString as k,isRelationshipInput as N,isFieldInput as S,isTextElementInput as L,getNormalizedFeatureTypeInfo as R,valueIsValidContingentValue as U}from"./featureFormUtils.js";import Z from"./FieldInput.js";import{FormExpressionsManager as H}from"./FormExpressionsManager.js";import P from"./GroupInput.js";import O from"./RelationshipInput.js";import W from"./TextElementInput.js";import{createFormExpressionArcadeExecutor as G}from"../support/forms/expressions/FormExpressionArcadeExecutor.js";const $=new t({attributes:{}}),D={field:["editableExpression","requiredExpression","valueExpression","visibilityExpression"],group:["visibilityExpression"],relationship:["editableExpression","visibilityExpression"],text:["visibilityExpression"],utilityNetworkAssociations:["editableExpression","visibilityExpression"]},z="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",J="#JSAPI_CONTINGENT_VALUE_ANY_HASH",B="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let K=class extends(o(n)){constructor(e){super(e),this._expressionExecutorsInUse=new Set,this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=$.clone(),this._initialFeature=$.clone(),this._timeZone=null,this._updatingHandles=new f,this.activeAssociation=null,this.editType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.highlightHelper=null,this.inputs=[],this.map=null,this.callbacks=null,this.strict=!1,this.pendingSubtypeChoice=null,this._updateInputs=r(async()=>{this._stopExpressions();const{_featureClone:e,_initialFeature:t,editType:n,formTemplate:s,inputs:i,layer:o,timeZone:r}=this;if(!o)return;const a={editType:n,feature:e,initialFeature:t,layer:o,timeZone:r},l=i.slice(),u=s?.elements&&s.elements.length>0?await this._updateInputsUsingFormElements(l,s.elements,a):this._updateInputsUsingLayerFields(l,o?.fields,a);this.inputs=u,this._startExpressions()})}initialize(){const e=a(()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this._initialFeature,this.timeZone,this.editType],([e,t])=>{null!=e&&(t?this._updatingHandles.addPromise(this._updateInputs()):e.load().catch(()=>{}))},l),t=a(()=>this._arcadeContextInfo,e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e,this._evaluateExpressions(e=>e.evaluateAll()))}),n=a(()=>this.layer,e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(C.createLoadedLayerContingentValuesCache(t).then(e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")}))},{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=i(this._contingentValuesCache),this.highlightHelper?.removeAll(),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map(e=>[e.name,e]))}get activeAssociationInput(){return this.allAssociationInputs.find(e=>e.uid===this.associationId)}get activeRelationshipInput(){return this.allRelationshipInputs.find(e=>e.relationshipId===this.relationshipId||e.activeCategory||e.showAllEnabled)}get _arcadeContextInfo(){const{_initialFeature:e,editType:t,layer:n,map:s,spatialReference:i,timeZone:o}=this;return{layer:E(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i,timeZone:o}}get associationId(){return this._get("associationId")}set associationId(e){null==e&&this.activeAssociationInput?.viewModel&&(this.activeAssociationInput.associatedLayer=null,this.activeAssociationInput.viewModel.activeAssociationType=null),this._set("associationId",e)}get associatedLayer(){return this.activeAssociationInput?.associatedLayer}set associatedLayer(e){this.activeAssociationInput&&(this.activeAssociationInput.associatedLayer=e)}get allAssociationInputs(){return A(this.inputs)}get allFieldInputs(){return j(this.inputs)}get allGroupInputs(){return this.inputs.filter(T)}get allRelationshipInputs(){return M(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map(e=>[e.name,e]))}get feature(){return this._get("feature")}set feature(e){const t=this._get("feature");e!==t&&(this._featureClone=e?.clone()??$.clone(),this._expressionsManager&&(this._expressionsManager.feature=this._featureClone),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach(t=>t.feature=e)):(this.inputs.forEach(e=>e.destroy()),this.inputs.length=0),t!==e&&(this.pendingSubtypeChoice=null),this.contingencyConstraintViolations.clear(),this._set("feature",e),this._initialFeature=this._featureClone.clone())}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap(e=>e.fields);return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return e?.description&&t?k({attributes:this.getValues(),label:e.description,layer:t,timeZone:this.timeZone}):null}get formTitle(){const{formTemplate:e,layer:t}=this;return e?.title&&t?k({attributes:this.getValues(),label:e.title,layer:t,timeZone:this.timeZone}):null}get formHeaderVisible(){const{activeRelationshipInput:e,activeAssociationInput:t,formDescription:n,formTitle:s}=this;return!(e||t||!n&&!s)}get joinedContingentValues(){return this._joinContingentValues()}get layer(){const e=this._initialFeature;return e?.sourceLayer&&"applyEdits"in e.sourceLayer?e.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach(e=>{e.showAllEnabled=!1,e.activeCategory=null}),null!=e){const n=t.find(t=>t.relationshipId===e);n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter(e=>!e.valid).every(({submittable:e})=>e)}get timeZone(){const{layer:e}=this;if(e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone)return b;const t=e&&"preferredTimeZone"in e&&e.preferredTimeZone;return this._timeZone===V?t||b:this._timeZone||w}set timeZone(e){this._timeZone=e}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every(({valid:e})=>e)}findField(e){return this.allFieldInputs.find(t=>t.name===e)}findGroup(e){return this.allGroupInputs.find(t=>t.id===e)}getFieldValueOptionsForField(e,t){const n=this.findField(e);if(!n)return[[],[],[]];const s="coded-value"===n.domain?.type?n.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],i=null==n.value||s.some(e=>e.value===n.value)?[]:[{name:`${n.value}`,value:n.value}],o=this.fieldsWithContingentValues.has(e)?this._getContingentValueOptionsForField(e,t):[];if(o.length>0){const e=new Set(o.map(e=>e.value));return[o,s.filter(t=>!e.has(t.value)),i]}return[s,[],i]}getValue(e){const t=this.layer?.getField(e);if(null!=t)return this._featureClone.getAttribute(t.name)??null}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),this._evaluateExpressions(t=>t.evaluateInvalidated([e]))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter(e=>e.valid).map(({name:e})=>e)),n=e.filter(e=>!e.valid).map(({name:e})=>e),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.notifyChange("submittable"),this.notifyChange("valid"),this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{feature:e,_featureClone:t}=this;e&&(t.geometry=e.geometry,this._evaluateExpressions(e=>e.evaluateInvalidatedByGeometry()))}applySubtypeDefaults(e){const{defaultValues:t}=e,{allFieldInputs:n}=this;for(const{name:s}of n){const e=t[s];null!=e&&this.setValue(s,e)}}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_evaluateExpressions(e){const t=this._expressionsManager;null!=t&&this._updatingHandles.addPromise(e(t).finally(()=>this._afterExpressionsEvaluated()))}async _updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(T(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(e=>this._isSupportedElement(e)),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});for(const[r,a]of s.entries())s.delete(r),a.destroy();return await Promise.all(Array.from(i.values())),o}async _updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):y(a)?await this._makeUtilityNetworkAssociationInputFromElement(a,s,i):this._makeInputFromElement(a,s,i);if(n){if(r.push(n),await u(()=>!n.updating),this._assignExpressionExecutors(n,a,o),e)if(t.delete(a),T(n)){const{feature:e,timeZone:t}=s;n.set({feature:e,timeZone:t})}else if(N(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else y(n)?(n.set(s),n.set({map:this.map})):n.set(s);if(g(a)){const e=a.elements.filter(e=>this._isSupportedElement(e));n.inputs=await this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return s.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const i=new Map;for(const s of e)if(T(s)){for(const e of s.inputs)e.destroy();s.inputs.length=0,s.destroy()}else N(s)?s.destroy():S(s)&&(null!==s.element?s.destroy():i.set(s.field,s));const o=[];for(const s of t){const e=n.feature?.getAttribute(s.name)??null,t=i.get(s)??new Z({field:s,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden});o.push(t.set({...n,value:e})),i.delete(s)}for(const[s,r]of i.entries())i.delete(s),r.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)??null}_makeInputFromElement(e,t,n){return g(e)?Y(e,t):_(e)?this._makeFieldInputFromElement(e,t,n):v(e)?this._makeRelationshipInputFromElement(e,t,n):y(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,n):I(e)?q(e,t):y(e)?this._makeUtilityNetworkAssociationInputFromElement(e,t,n):e}_makeFieldInputFromElement(e,t,n){const{editType:s,feature:i,initialFeature:o,layer:r,timeZone:a}=t,{fieldName:l}=e,u=l&&this._layerFieldsByName.get(l);return u?new Z({editType:s,element:e,field:u,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n,preservesValueWhenHidden:this.formTemplate?.preserveFieldValuesWhenHidden,timeZone:a}):null}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t,a=new O({element:e,feature:i,group:n,layer:o,map:s,timeZone:r});return a.addHandles(p(()=>a.relatedLayer,"edits",()=>this._evaluateExpressions(e=>e.evaluateAsyncExpressions()))),a}async _makeUtilityNetworkAssociationInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o,timeZone:r}=t;return new(0,(await import("./UtilityNetworkAssociationInput.js")).default)({element:e,feature:i,group:n,layer:o,map:s,timeZone:r})}_assignExpressionExecutors(e,t,n){const s=D[t.type],i=[];for(const o of s){const s=`${o}Executor`;if(e[s]){this._useExecutor(e[s]);continue}const r=t[o];if(null!=r&&""!==r){const t=this._expressionInfosLookup.get(r)?.expression??r;i.push(this._getOrCreateExecutorForExpression(t,n).then(t=>{e[s]=this._useExecutor(t)}))}}return L(e)&&i.push(...this._assignTextElementExpressionExecutors(e,n)),i}_assignTextElementExpressionExecutors(e,t){const{_expressionInfosLookup:n}=this,i=[];for(const o of e.expressionsUsed){const r=n.get(o);null!=r?i.push(this._getOrCreateExecutorForExpression(r.expression,t).then(t=>e.setExpressionExecutor(o,this._useExecutor(t)))):s.getLogger(this).error("feature-form:expression-not-found",`Could not find expressionInfo object with name '${o}'`)}for(const s of e.fieldsUsed){const n=`return $feature['${s}'];`;i.push(this._getOrCreateExecutorForExpression(n,t).then(t=>e.setFieldExecutor(s,this._useExecutor(t))))}return i}async _getOrCreateExecutorForExpression(e,t){const{_expressionExecutorLookup:n}=this;if(n.has(e))return n.get(e);if(t.has(e))return t.get(e);const s=G(e,this.layer);t.set(e,s);const i=await s;return n.set(e,i),i}_createExpressionsManager(e){const{_arcadeContextInfo:t,_featureClone:n,allFieldInputs:s,formTemplate:i}=this;this._expressionsManager=new H({executors:e,feature:n,arcadeContextInfo:t,fieldInputs:s,preserveFieldValuesWhenHidden:!0===i?.preserveFieldValuesWhenHidden})}_startExpressions(){if(0===this._expressionExecutorsInUse.size)return;const e=Array.from(this._expressionExecutorsInUse);this._createExpressionsManager(e),this._evaluateExpressions(e=>e.evaluateAll())}_stopExpressions(){this._expressionsManager=i(this._expressionsManager),this._expressionExecutorsInUse.clear()}_useExecutor(e){return this._expressionExecutorsInUse.add(e),e}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:l}=R(o);if((e.isSubtypeField||t===a)&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);e&&(this.feature&&(this.feature.sourceLayer=e),s.sourceLayer=e,this._initialFeature.sourceLayer=e)}const e=new Set;for(const t of l)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}this.notifyChange("joinedContingentValues")}if(null!=i){const{description:e,title:n}=i;n&&c(n,t)&&this.notifyChange("formTitle"),e&&c(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=R(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap(e=>this._joinFieldGroupContingencies(e)),...o.flatMap(e=>e.contingencies)]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map(e=>[...e]),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(J)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(J),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(J)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(J),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:h,rightIsRange:d}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new x({objectType:"null"});continue}if(r&&d||a&&h)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const f=Math.max(n.minValue,o.minValue),m=Math.min(n.maxValue,o.maxValue);if(f>m)return null;s.values[i]=new x({objectType:"range",minValue:f,maxValue:m})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter(t=>n.every(n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=new RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===J)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,{feature:r}=this,a=new Set,l=new Set;for(const u of i)if(o.has(u)){const e=this.layer?.getFieldDomain(u,{feature:r??void 0,excludeImpliedDomains:!0});if(null==e)continue;switch(e.type){case"coded-value":a.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...a],rangeFields:[...l]}}_contingencyIsValid(e,t){const n={};for(const{name:s,value:i}of this.allFieldInputs)this.fieldsWithContingentValues.has(s)&&null!=i&&s!==e&&(n[s]=i);return Object.entries(n).every(([e,n])=>!t.values.hasOwnProperty(e)||U(n,t.values[e]))}_getContingentValueOptionsForField(e,t){const n=this.joinedContingentValues.slice(),s=new Map,i={code:"",name:t??"No value"};for(const o of n){const t=o.values[e];if("code"===t?.objectType||"null"===t?.objectType){const{code:n,name:r}=t.codedValue&&"null"!==t.objectType?t.codedValue:i;!s.has(n)&&this._contingencyIsValid(e,o)&&s.set(n,{name:r,value:n})}}return[...s.values()]}_hashContingency(e,t,n=!1){if(t.length<1)return[z,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[J,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${B}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}_isSupportedElement(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||"text"===e.type||"utilityNetworkAssociations"===e.type||(s.getLogger(this).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}get test(){return{featureClone:this._featureClone}}};function Y(e,t){const{feature:n,layer:s}=t;return new P({element:e,inputs:[],feature:n,layer:s})}function q(e,t,n=null){const{feature:s,layer:i,timeZone:o}=t;return new W({element:e,feature:s,group:n,layer:i,timeZone:o})}e([h()],K.prototype,"_expressionInfosLookup",null),e([h()],K.prototype,"_featureClone",void 0),e([h()],K.prototype,"_initialFeature",void 0),e([h()],K.prototype,"_timeZone",void 0),e([h({type:F})],K.prototype,"activeAssociation",void 0),e([h()],K.prototype,"activeAssociationInput",null),e([h()],K.prototype,"activeRelationshipInput",null),e([h()],K.prototype,"_arcadeContextInfo",null),e([h()],K.prototype,"associationId",null),e([h()],K.prototype,"associatedLayer",null),e([h()],K.prototype,"allAssociationInputs",null),e([h()],K.prototype,"allFieldInputs",null),e([h()],K.prototype,"allGroupInputs",null),e([h()],K.prototype,"allRelationshipInputs",null),e([h()],K.prototype,"_layerFieldsByName",null),e([h()],K.prototype,"editType",void 0),e([h()],K.prototype,"contingencyConstraintViolations",void 0),e([h()],K.prototype,"disabled",void 0),e([h()],K.prototype,"feature",null),e([h()],K.prototype,"fieldsWithContingentValues",null),e([h({type:m})],K.prototype,"formTemplate",null),e([h()],K.prototype,"formDescription",null),e([h()],K.prototype,"formTitle",null),e([h()],K.prototype,"formHeaderVisible",null),e([h()],K.prototype,"highlightHelper",void 0),e([h()],K.prototype,"inputs",void 0),e([h()],K.prototype,"joinedContingentValues",null),e([h()],K.prototype,"layer",null),e([h()],K.prototype,"map",void 0),e([h()],K.prototype,"callbacks",void 0),e([h()],K.prototype,"relationshipId",null),e([h()],K.prototype,"spatialReference",null),e([h()],K.prototype,"state",null),e([h()],K.prototype,"strict",void 0),e([h()],K.prototype,"submittable",null),e([h()],K.prototype,"timeZone",null),e([h()],K.prototype,"updating",null),e([h()],K.prototype,"valid",null),e([h()],K.prototype,"pendingSubtypeChoice",void 0),e([h()],K.prototype,"getValues",null),e([h()],K.prototype,"submit",null),e([h()],K.prototype,"test",null),K=e([d("esri.widgets.FeatureForm.FeatureFormViewModel")],K);const Q=K;export{Q as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{substitute as e}from"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{
|
|
5
|
+
import{substitute as e}from"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{equalsShallow as r}from"../../core/lang.js";import n from"../../core/Logger.js";import{templateHasKey as o,replace as i}from"../../core/string.js";import{isFieldElement as l}from"../../form/support/formUtils.js";import{convertDateTimeFieldFormatToIntlOptions as a}from"../../intl/date.js";import{defaultFieldFormat as s}from"../../layers/support/fieldFormatUtils.js";import{isTimeOnlyField as u}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as m,supportsFieldConfiguration as p,getSubtypesFromLayer as d}from"../../layers/support/layerUtils.js";import{isAnyDateField as f}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as c,getIntlOptionsForField as y}from"../support/dateUtils.js";import{getRangeErrorMessage as g,shouldUseScientificNotation as b,scientificNumberFormatOptions as v,numberFormatOptions as j}from"../support/forms/formUtils.js";const x=e=>"field"===e?.type,F=e=>"group"===e?.type,h=e=>"relationship"===e?.type,N=e=>"text"===e.type,T=e=>"utilityNetworkAssociations"===e.type,V=e=>!F(e)&&null!=e.group,U=(e,t)=>V(e)&&e.group===t,$=e=>e.reduce((e,t)=>F(t)?[...e,...t.inputs]:[...e,t],[]),O=e=>$(e).filter(x),w=e=>$(e).filter(h),E=e=>$(e).filter(T),L=e=>null!=e&&(Z(e,"combo-box")||Z(e,"radio-buttons")),Z=(e,t)=>null!=e&&e.input?.type===t,C=({domain:e,inputType:t="text-box",dataType:r})=>"number"===r&&"text-box"===t&&(!e||"coded-value"!==e.type);function I(e){const{attributes:r,layer:n,label:i,timeZone:l}=e;if(!r||"object"!=typeof r)return i;const a=Object.keys(r).filter(e=>o(i,e)),s=a.map(e=>r[e]),u=a.map(e=>n.fieldsIndex.get(e)).filter(t);return H(i,D({fields:u,layer:n,timeZone:l,values:s}))}const k="expression/",S="expr/",W="field/";function A(e){const[t,r]=e.split(k);return""===t&&r?r:(n.getLogger("esri.widgets.FeatureForm/featureFormUtils").error("extractExpressionNameFromString:invalid-input",`The string ${e} is not a valid expression reference of the form '${k}/expressionName'`),"")}function B(e){return`${k}${e}`}function M(e){return`${W}${e}`}function q(e){return e.startsWith(k)}function z(e){return e.startsWith(S)}function D(e){const{layer:t,values:r}=e,n=e.fields??t.fields??[],o=e.timeZone??void 0,i=n.map((e,n)=>{let i=r[n];if("coded-value"===e.domain?.type){const t=e.domain.codedValues.find(e=>e.code===i);t?.name&&(i=t.name)}return(f(e)||u(e))&&(i=c(e,i,{timeZone:o,...G(t,e)})),[e.name,i]});return Object.fromEntries(i)}function G(e,t){if(p(e)){const r=e.getFieldConfiguration(t.name)?.fieldFormat??s(t);if("date-time"===r?.type)return a(r)}return y(t)}function H(e,t){return i(i(e,e=>`{${e.toLowerCase()}}`),Object.fromEntries(Object.entries(t).map(([e,t])=>[e.toLowerCase(),t])))}const J=e=>{const t={typeFieldName:null,types:[]};return e?(m(e)?(t.typeFieldName=e.parent?.subtypeField,t.types=e.parent?.subtypes??[]):"subtype-group"===e.type||"feature"===e.type&&e.subtypes?.length?(t.typeFieldName=e.subtypeField,t.types=e.subtypes??[]):"types"in e&&e.types&&(t.typeFieldName=e.typeIdField,t.types=e.types.map(({id:e,name:t,domains:r})=>({code:e,name:t,domains:r}))),null!=t.typeFieldName&&(t.typeFieldName=e.getField(t.typeFieldName)?.name??t.typeFieldName),t):t},K=(t,r,n)=>{const{dataType:o,error:i,minLength:l}=t,a=r?.validationErrors;if(!a||!i)return null;if("input-validation-error::cannot-be-empty"===i)return a.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:r,range:i}=t,l={type:"date",intlOptions:{timeZone:"date"===r.type&&n?n:void 0,...y(r)}},s=g(i,a);return e(s,i,{format:{max:"date"===o?l:null!=i.max&&b(i.max)?v:j,min:"date"===o?l:null!=i.min&&b(i.min)?v:j}})}return"domain-validation-error::invalid-coded-value"===i?a.invalidCodedValue:"type-validation-error::invalid-type"===i?a.invalidType:"length-validation-error::too-short"===i?e(a.tooShort,{min:l}):null},P=e=>{if(!e)return;const t=e.layer,r=t&&"geometryType"in t?t.geometryType:void 0,n=e.geometry?.type;return"polyline"===n||"polyline"===r?"line":"mesh"===n||"mesh"===r||"multipatch"===r?"cube":"multipoint"===n||"multipoint"===r?"point":n||r||"table"},Q=e=>{const t=[];if(e.formTemplate){const{description:r,title:n}=e.formTemplate;e.fields?.forEach(e=>{const i=n&&o(n,e.name),l=r&&o(r,e.name);(i||l)&&t.push(e.name)})}return t};function R(e,t){const r=t??("formTemplate"in e&&e.formTemplate);if(r){return(r.elements?.filter(l)??[]).some(({fieldName:t})=>!e.fieldsIndex.get(t))}return!1}function X(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function Y(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return t.objectType,!1}}function _(e,t,n){const o=d(e),i=o?.find(e=>e.code===n);if(!i)return!1;const l=o?.find(e=>e.code===t);return!r(i.defaultValues,l?.defaultValues)&&Object.values(i.defaultValues).some(e=>null!=e)}export{A as extractExpressionNameFromString,E as flattenAssociationInputs,O as flattenFieldInputs,$ as flattenInputs,w as flattenRelationshipInputs,R as formTemplateHasInvalidFields,D as getComputedAttributes,G as getDateTimeFormatOptions,K as getErrorMessageForFieldInput,Q as getFieldsInTitleAndDesc,P as getIconForFeature,J as getNormalizedFeatureTypeInfo,q as isExpressionReference,Z as isFieldElementWithInputType,L as isFieldElementWithShowNoValueOptionInput,x as isFieldInput,F as isGroupInput,V as isInputInGroupInput,U as isInputInThisGroupInput,z as isLegacyFieldMapsExpressionReference,C as isNumberFieldInput,h as isRelationshipInput,N as isTextElementInput,T as isUtilityNetworkAssociationInput,I as parseFormTemplateString,B as prependExpressionPrefix,M as prependFieldPrefix,H as substituteFieldTemplatesInString,_ as subtypeChangeShouldPrompt,X as valueIsInvalidSwitchValue,Y as valueIsValidContingentValue};
|
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import"../core/has.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as O,isFieldElementWithInputType as I,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as j,normalizeTimeOnlyString as P,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,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 x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},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)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({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(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(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(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const 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){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(O(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-text-area",{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.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,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=j(n,u),h=j(l,u),v=j(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i===t,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||s.empty,key:"empty-option",selected:h,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("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){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=j(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,O(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=P(r),l=P(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&O(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.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,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?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([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as O,isFieldElementWithInputType as I,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as P,normalizeTimeOnlyString as j,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,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 x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},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)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({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(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(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(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const 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){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(O(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-text-area",{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.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,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=P(n,u),h=P(l,u),v=P(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i===t,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||s.empty,key:"empty-option",selected:h,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("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){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=P(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,O(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=j(r),l=j(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&O(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.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,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?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([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|
|
@@ -12,8 +12,6 @@ export type GridSupportedColumns = Column;
|
|
|
12
12
|
|
|
13
13
|
export type GridMultiSortPriority = "append" | "prepend";
|
|
14
14
|
|
|
15
|
-
export type GridInteractionEventType = "cell-click" | "cell-dblclick" | "cell-pointerover" | "cell-pointerout" | "cell-keydown" | "column-reorder";
|
|
16
|
-
|
|
17
15
|
export interface TableInteractionEvent {
|
|
18
16
|
/** The feature associated with the cell. */
|
|
19
17
|
feature?: Graphic;
|
|
@@ -24,9 +24,9 @@ import type { FieldValue } from "../../../layers/support/fieldUtils.js";
|
|
|
24
24
|
import type { ObjectId } from "../../../views/types.js";
|
|
25
25
|
import type { CellValue, Direction } from "../Grid/types.js";
|
|
26
26
|
|
|
27
|
-
export interface
|
|
27
|
+
export interface FieldValueFormatFunctionParameters extends FormatFunctionParameters {}
|
|
28
28
|
|
|
29
|
-
export interface
|
|
29
|
+
export interface FormatFunctionParameters {
|
|
30
30
|
/** _(Since 4.31)_ A reference to attachments for the associated feature. */
|
|
31
31
|
attachments?: AttachmentInfo[] | null;
|
|
32
32
|
/** A reference to this specific Column. */
|
|
@@ -55,7 +55,7 @@ export type FeatureTableSupportedColumn = Column;
|
|
|
55
55
|
* @param params - An object containing information about the associated row and feature.
|
|
56
56
|
* @returns Formatted content to be displayed in the cell.
|
|
57
57
|
*/
|
|
58
|
-
export type FormatFunction = (params:
|
|
58
|
+
export type FormatFunction = (params: FormatFunctionParameters) => CellValue | HTMLElement;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Custom function for rendering cell content. Accepts a string, number, an HTML element or equivalent node type (e.g. a [Calcite component](https://developers.arcgis.com/calcite-design-system/components/)).
|
|
@@ -63,7 +63,7 @@ export type FormatFunction = (params: FormatFunctionParams) => CellValue | HTMLE
|
|
|
63
63
|
* @param params - An object containing information about the associated row and feature.
|
|
64
64
|
* @returns Formatted content to be displayed in the cell.
|
|
65
65
|
*/
|
|
66
|
-
export type FieldValueFormatFunction = (params:
|
|
66
|
+
export type FieldValueFormatFunction = (params: FieldValueFormatFunctionParameters) => FieldValue | HTMLElement;
|
|
67
67
|
|
|
68
68
|
export type FeatureTableSupportedFilters = GeometryFilter | SelectionFilter;
|
|
69
69
|
|
|
@@ -119,7 +119,7 @@ export interface ColumnSortOrder {
|
|
|
119
119
|
fieldName: string;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export interface
|
|
122
|
+
export interface ActionColumnCallbackParameters {
|
|
123
123
|
/** A reference to the associated feature. */
|
|
124
124
|
feature: Graphic;
|
|
125
125
|
/** The index of the associated row. */
|
|
@@ -133,7 +133,7 @@ export interface ActionColumnCallbackParams {
|
|
|
133
133
|
*
|
|
134
134
|
* @param params - An object containing information about the associated row and feature.
|
|
135
135
|
*/
|
|
136
|
-
export type ActionColumnCallback = (params:
|
|
136
|
+
export type ActionColumnCallback = (params: ActionColumnCallbackParameters) => void;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* Configuration for the [FeatureTable's actionColumn](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#actionColumn).
|
|
@@ -161,7 +161,7 @@ export interface ActionColumnConfig {
|
|
|
161
161
|
label: string;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
export interface
|
|
164
|
+
export interface ActionColumnDisabledParameters {
|
|
165
165
|
/** The feature to use when determining if the action should be disabled. */
|
|
166
166
|
feature: Graphic;
|
|
167
167
|
/** The row's index position when determining if the action should be disabled. */
|
|
@@ -174,7 +174,7 @@ export interface ActionColumnDisabledParams {
|
|
|
174
174
|
* @param params - An object containing information about an associated row and feature.
|
|
175
175
|
* @returns Indicates whether the action should be disabled.
|
|
176
176
|
*/
|
|
177
|
-
export type ActionColumnDisabledFunction = (params:
|
|
177
|
+
export type ActionColumnDisabledFunction = (params: ActionColumnDisabledParameters) => boolean;
|
|
178
178
|
|
|
179
179
|
/** The related records for the associated feature used in the [Columns's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-Grid-Column.html#formatFunction) and [FieldColumn's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-support-types.html#FieldValueFormatFunction) `formatFunction`. */
|
|
180
180
|
export interface RelatedRecordInfo {
|
|
@@ -5,7 +5,7 @@ import type Point from "../../geometry/Point.js";
|
|
|
5
5
|
import type SpatialReference from "../../geometry/SpatialReference.js";
|
|
6
6
|
import type Widget from "../Widget.js";
|
|
7
7
|
import type FeatureViewModel from "../Feature/FeatureViewModel.js";
|
|
8
|
-
import type
|
|
8
|
+
import type { EventedAccessor, EventedMixinProperties } from "../../core/Evented.js";
|
|
9
9
|
import type { ScreenPoint } from "../../core/types.js";
|
|
10
10
|
import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";
|
|
11
11
|
import type { TimeZone } from "../../time/types.js";
|
|
@@ -20,7 +20,7 @@ import type { ActionButtonProperties } from "../../support/actions/ActionButton.
|
|
|
20
20
|
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
|
|
21
21
|
import type { PointProperties } from "../../geometry/Point.js";
|
|
22
22
|
|
|
23
|
-
export interface FeaturesViewModelProperties extends GoToProperties, Partial<Pick<FeaturesViewModel, "activeFeature" | "autoCloseEnabled" | "browseClusterEnabled" | "content" | "defaultPopupTemplateEnabled" | "featureMenuOpen" | "featureMenuTitle" | "featurePage" | "features" | "featuresPerPage" | "featureViewModelAbilities" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "promises" | "screenLocationEnabled" | "selectedFeatureIndex" | "title" | "updateLocationEnabled" | "view" | "visible" | "zoomFactor">> {
|
|
23
|
+
export interface FeaturesViewModelProperties extends EventedMixinProperties, GoToProperties, Partial<Pick<FeaturesViewModel, "activeFeature" | "autoCloseEnabled" | "browseClusterEnabled" | "content" | "defaultPopupTemplateEnabled" | "featureMenuOpen" | "featureMenuTitle" | "featurePage" | "features" | "featuresPerPage" | "featureViewModelAbilities" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "promises" | "screenLocationEnabled" | "selectedFeatureIndex" | "title" | "updateLocationEnabled" | "view" | "visible" | "zoomFactor">> {
|
|
24
24
|
/**
|
|
25
25
|
* [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects.
|
|
26
26
|
* Each action may be executed by clicking the icon or image symbolizing them.
|
|
@@ -754,4 +754,4 @@ export default class FeaturesViewModel extends FeaturesViewModelSuperclass {
|
|
|
754
754
|
*/
|
|
755
755
|
zoomTo(params: GoToParameters): Promise<void>;
|
|
756
756
|
}
|
|
757
|
-
declare const FeaturesViewModelSuperclass: typeof
|
|
757
|
+
declare const FeaturesViewModelSuperclass: typeof EventedAccessor & typeof GoTo
|