@arcgis/core 5.2.0-next.13 → 5.2.0-next.14
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/arcgisGlobal.d.ts +3 -3
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +1 -0
- package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +1 -0
- package/assets/esri/core/workers/chunks/{87c2d4d58c2487324fb7.js → 0a8ba5cb857f61de40fb.js} +3 -3
- package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +1 -0
- package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +1 -0
- package/assets/esri/core/workers/chunks/{de541ad390a8d258d2e6.js → 1d5db8746a4f1ed1d18f.js} +1 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +1 -0
- package/assets/esri/core/workers/chunks/{2a5176533e78a92d8e5b.js → 20c729fca2e4b4c6b28d.js} +1 -1
- package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +1 -0
- package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +1 -0
- package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +1 -0
- package/assets/esri/core/workers/chunks/2c4f10eaf02ef090ee8f.js +1 -0
- package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +1 -0
- package/assets/esri/core/workers/chunks/{34544c79ce568f30a094.js → 31762eb20a9a0ed3f8b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{26dca1d387183282276a.js → 318a2702632aaa4d3a63.js} +1 -1
- package/assets/esri/core/workers/chunks/3526ab3b1f87c24ae6f8.js +1 -0
- package/assets/esri/core/workers/chunks/{81808c3aead7dfac3049.js → 38cfedce779dd75bd217.js} +1 -1
- package/assets/esri/core/workers/chunks/{5075e85e1eafd431a8c0.js → 39c994536ce6c1e5c956.js} +1 -1
- package/assets/esri/core/workers/chunks/3b74749db78bcba2bc16.js +1 -0
- package/assets/esri/core/workers/chunks/3d83ac791212b81c9d11.js +1 -0
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +1 -0
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +1 -0
- package/assets/esri/core/workers/chunks/{ef46ef4f0ee9f2aeaa4a.js → 426b8e1e2eef2460851d.js} +1 -1
- package/assets/esri/core/workers/chunks/4376bc2934a996d8bc27.js +1 -0
- package/assets/esri/core/workers/chunks/44d0ca9d4c5f1722688c.js +1 -0
- package/assets/esri/core/workers/chunks/{e25bcfdd8f20f8a08b19.js → 4d57c771af4137f74bfb.js} +1 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +1 -0
- package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +1 -0
- package/assets/esri/core/workers/chunks/4f51963815b0d53ffbd9.js +1 -0
- package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +1 -0
- package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +1 -0
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +1 -0
- package/assets/esri/core/workers/chunks/{d3c760109a70a71448c5.js → 67773a9f031d9f1d672f.js} +1 -1
- package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +1 -0
- package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +1 -0
- package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +1 -0
- package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +1 -0
- package/assets/esri/core/workers/chunks/753e0b21e57c12c742ee.js +1 -0
- package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +1 -0
- package/assets/esri/core/workers/chunks/{1996f0a930abdd97b855.js → 7a8ed08cd173963b3112.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc697c4d9cdc116373dc.js → 81726d997a2d34449bb2.js} +1 -1
- package/assets/esri/core/workers/chunks/{74e1826ad9e2c4fd3b42.js → 81883bca8a79ee2ddb00.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js → 854c320af09b6afc4b80.js} +2 -2
- package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +1 -0
- package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +1 -0
- package/assets/esri/core/workers/chunks/{8407c91cce31e087b41b.js → 886ae23a1d8fa21e531f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff7aa216cd794d951e8.js → 8e99f937fd36cf2cd05f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c357c0a08b99c1e7f290.js → 9331969046f2b277d620.js} +1 -1
- package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +1 -0
- package/assets/esri/core/workers/chunks/97a654e8054302582a3b.js +1 -0
- package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +1 -0
- package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +1 -0
- package/assets/esri/core/workers/chunks/{f25bb204cf6727f6fdef.js → a0876a52a3c2ad849370.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ad09ac5793e8d47b4b2.js → a4b970a841b3085500fc.js} +1 -1
- package/assets/esri/core/workers/chunks/aa5f36d7ed59c625ba78.js +1 -0
- package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +1 -0
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +1 -0
- package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +1 -0
- package/assets/esri/core/workers/chunks/{1a527c0740d9f4fa0791.js → bc547cf814d6703cef59.js} +1 -1
- package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +1 -0
- package/assets/esri/core/workers/chunks/bdc66ef2b6ed783047d5.js +1 -0
- package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
- package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +1 -0
- package/assets/esri/core/workers/chunks/bfd1aef8ac795e1ce227.js +1 -0
- package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +1 -0
- package/assets/esri/core/workers/chunks/{0f75c19d8e296a32e329.js → c2cd80b712f29e8cbb8d.js} +1 -1
- package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +1 -0
- package/assets/esri/core/workers/chunks/{8f6833671c071b522923.js → cd66bd30f654fe571e57.js} +1 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +1 -0
- package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +1 -0
- package/assets/esri/core/workers/chunks/d3be4d914fc99a1d686c.js +1 -0
- package/assets/esri/core/workers/chunks/dbd2bfcbf3e0f86f07b8.js +1 -0
- package/assets/esri/core/workers/chunks/{6675d56f49d07a97dc40.js → dd0c1cf921369e2bc48b.js} +1 -1
- package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +1 -0
- package/assets/esri/core/workers/chunks/df54e741db40b308c2dd.js +2 -0
- package/assets/esri/core/workers/chunks/{89e09276086745aa21fa.js → e4e2f479c0c45ae1b2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +1 -0
- package/assets/esri/core/workers/chunks/{58a7cdebc3d182c15ec6.js → e77df11aee136d64ff0f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a474ce61cf484df87b4.js → e80376832050a4b6d28a.js} +1 -1
- package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +1 -0
- package/assets/esri/core/workers/chunks/{3b837b512999e6ab24bc.js → f148666308071bdb185a.js} +1 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +1 -0
- package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +1 -0
- package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +1 -0
- package/assets/esri/core/workers/chunks/{893c0d28a5bf3f9f29f1.js → f93facf47aba9b128fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +1 -0
- package/assets/esri/core/workers/chunks/{c911f0b5bdd43b66b731.js → fa3faec65882c5b6f1a0.js} +1 -1
- package/assets/esri/core/workers/chunks/fccc34b86454c56f27ab.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
- 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/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/chunks/Component.glsl.js +6 -6
- package/chunks/GlobalIlluminationBlur.glsl.js +7 -7
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/core/promiseUtils.d.ts +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/units.js +1 -1
- package/form/types.d.ts +1 -1
- package/geometry/Mesh.d.ts +220 -95
- package/geometry/operators/support/projectionZScaling.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +35 -13
- package/geometry/support/MeshLocalVertexSpace.d.ts +32 -8
- package/geometry/support/MeshVertexAttributes.d.ts +6 -2
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/graphic/{AnnotationGraphicOrigin.d.ts → AnnotationFeatureGraphicOrigin.d.ts} +9 -9
- package/graphic/{AnnotationGraphicOrigin.js → AnnotationFeatureGraphicOrigin.js} +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/{AnnotationLayer.d.ts → AnnotationFeatureLayer.d.ts} +24 -24
- package/layers/AnnotationFeatureLayer.js +2 -0
- package/layers/GaussianSplatLayer.d.ts +4 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/parquetIdUtils.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/AnnotationSublayer.d.ts +7 -7
- package/layers/support/FeatureEffect.d.ts +3 -2
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/schemaValidator.js +1 -1
- package/layers/types.d.ts +1 -1
- package/networks/Network.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/gaussianSplatLayerItem.js +2 -0
- package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/renderers/support/types.d.ts +1 -1
- package/renderers/visualVariables/RotationVariable.d.ts +1 -16
- package/renderers/visualVariables/RotationVariable.js +1 -1
- package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -2
- package/rest/knowledgeGraph/ServiceDefinition.d.ts +1 -1
- package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.d.ts +2 -2
- package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +2 -2
- package/rest/networks/support/TraceParameters.d.ts +2 -2
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +2 -0
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
- package/views/2d/types.d.ts +2 -2
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +29 -20
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +6 -8
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TexelFormatInfo.js +2 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/layers/{AnnotationLayerView.d.ts → AnnotationFeatureLayerView.d.ts} +6 -6
- package/views/layers/FeatureLikeLayerView.d.ts +2 -2
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/webdoc/widgets/FloorFilter.d.ts +14 -1
- package/webdoc/widgets/FloorFilter.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +12 -4
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/ValueChangeTransaction.js +2 -0
- package/widgets/BatchAttributeForm/VisibleElements.d.ts +8 -1
- package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/stringUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +19 -3
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.d.ts +3 -3
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.d.ts +3 -3
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.d.ts +10 -0
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +0 -1
- package/assets/esri/core/workers/chunks/0bb159ba0226122465cf.js +0 -1
- package/assets/esri/core/workers/chunks/160e5b99f1097a473e6b.js +0 -1
- package/assets/esri/core/workers/chunks/17e68828ca6ff6912d3e.js +0 -1
- package/assets/esri/core/workers/chunks/1e340536d3c5f94920b5.js +0 -1
- package/assets/esri/core/workers/chunks/24810c36ae09bb4e83dc.js +0 -1
- package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +0 -1
- package/assets/esri/core/workers/chunks/297ae764445e6f73a5ea.js +0 -1
- package/assets/esri/core/workers/chunks/29aba121db7f00e0cf81.js +0 -1
- package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +0 -1
- package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +0 -1
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +0 -1
- package/assets/esri/core/workers/chunks/3c5534c576528c1921d2.js +0 -1
- package/assets/esri/core/workers/chunks/40b3cdf81c79bbc44527.js +0 -2
- package/assets/esri/core/workers/chunks/41f12eb7c9b7086528d5.js +0 -1
- package/assets/esri/core/workers/chunks/426156137f279d979ddd.js +0 -1
- package/assets/esri/core/workers/chunks/4714241189c13d0db897.js +0 -1
- package/assets/esri/core/workers/chunks/537c5dd4cd0a067199d1.js +0 -1
- package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +0 -1
- package/assets/esri/core/workers/chunks/5437a1c05c1bd2175981.js +0 -1
- package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +0 -1
- package/assets/esri/core/workers/chunks/5c7aff9604b4576a0e1d.js +0 -1
- package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +0 -1
- package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
- package/assets/esri/core/workers/chunks/603177137eb680afe371.js +0 -1
- package/assets/esri/core/workers/chunks/629099f05ca5c9ca1973.js +0 -1
- package/assets/esri/core/workers/chunks/62f78fa455d556008f6a.js +0 -1
- package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +0 -1
- package/assets/esri/core/workers/chunks/6f0341cfa4c68e6e60b3.js +0 -1
- package/assets/esri/core/workers/chunks/70229007d594536ba6a3.js +0 -1
- package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +0 -1
- package/assets/esri/core/workers/chunks/890b7a1153b7f65eba9a.js +0 -1
- package/assets/esri/core/workers/chunks/9660ae52fb3951a19e9c.js +0 -1
- package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +0 -1
- package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +0 -1
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +0 -1
- package/assets/esri/core/workers/chunks/c3cf9e6e91f71c9cc5f3.js +0 -1
- package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +0 -1
- package/assets/esri/core/workers/chunks/cc3e895cff019e811c07.js +0 -1
- package/assets/esri/core/workers/chunks/d122431f3b0b88dcb488.js +0 -1
- package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +0 -1
- package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +0 -1
- package/assets/esri/core/workers/chunks/d41caf20c26f80385265.js +0 -1
- package/assets/esri/core/workers/chunks/d468994822f9bc3d6279.js +0 -1
- package/assets/esri/core/workers/chunks/d63f532dd7d60ee8ef2c.js +0 -1
- package/assets/esri/core/workers/chunks/d64613209a9eb1eafb11.js +0 -1
- package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +0 -1
- package/assets/esri/core/workers/chunks/d8ec0afb2b91ccf32e55.js +0 -1
- package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +0 -1
- package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +0 -1
- package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +0 -1
- package/assets/esri/core/workers/chunks/e2de13810dce01b98520.js +0 -1
- package/assets/esri/core/workers/chunks/e5837e5ac6ef761f26a2.js +0 -1
- package/assets/esri/core/workers/chunks/e82488b9b3bb0c1dedb4.js +0 -1
- package/assets/esri/core/workers/chunks/f274a8e8c7ca4294e876.js +0 -1
- package/assets/esri/core/workers/chunks/f292c2c22a3822343118.js +0 -1
- package/assets/esri/core/workers/chunks/f4f642ddd4d5db7cbbb4.js +0 -1
- package/assets/esri/core/workers/chunks/f6d047358d14328f3622.js +0 -1
- package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +0 -1
- package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +0 -1
- package/layers/AnnotationLayer.js +0 -2
- package/views/2d/layers/AnnotationLayerView2D.js +0 -2
- /package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js.LICENSE.txt → 854c320af09b6afc4b80.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{40b3cdf81c79bbc44527.js.LICENSE.txt → df54e741db40b308c2dd.js.LICENSE.txt} +0 -0
- /package/views/layers/{AnnotationLayerView.js → AnnotationFeatureLayerView.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as r,subclass as s}from"../../core/accessorSupport/decorators.js";import{Integer as l}from"../../core/accessorSupport/ensureType.js";var d;const n=new t({belowSelected:"belowSelected",selectedOnly:"selectedOnly"});let p=d=class extends i{constructor(e){super(e),this.enabled=!1,this.floorVisibilityMode="selectedOnly",this.longNames=!1,this.minimized=!1,this.pinnedLevels=!1,this.site=null,this.facility=null,this.level=null,this.selectedVerticalOrder=null,this.useVerticalOrder=!1}clone(){return new d(o({enabled:this.enabled,longNames:this.longNames,minimized:this.minimized,pinnedLevels:this.pinnedLevels,site:this.site,facility:this.facility,level:this.level,useVerticalOrder:this.useVerticalOrder,selectedVerticalOrder:this.selectedVerticalOrder,floorVisibilityMode:this.floorVisibilityMode}))}};e([r({type:Boolean,json:{read:!0,write:!0}})],p.prototype,"enabled",void 0),e([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,overridePolicy:(e,t,i)=>({enabled:null==i||"web-scene"===i?.origin})}}})],p.prototype,"floorVisibilityMode",void 0),e([r({type:Boolean,json:{read:!0,write:!0}})],p.prototype,"longNames",void 0),e([r({type:Boolean,json:{read:!0,write:!0}})],p.prototype,"minimized",void 0),e([r({type:Boolean,json:{read:!0,write:!0}})],p.prototype,"pinnedLevels",void 0),e([r({type:String,json:{read:!0,write:!0}})],p.prototype,"site",void 0),e([r({type:String,json:{read:!0,write:!0}})],p.prototype,"facility",void 0),e([r({type:String,json:{read:!0,write:!0}})],p.prototype,"level",void 0),e([r({type:l,json:{read:!0,write:!0}})],p.prototype,"selectedVerticalOrder",void 0),e([r({type:Boolean,json:{read:!0,write:!0}})],p.prototype,"useVerticalOrder",void 0),p=d=e([s("esri.webdoc.widgets.FloorFilter")],p);const a=p;export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as o,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as h,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as d,deriveLengthUnitFromAreaUnit as v}from"../../core/units.js";import{property as y,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import A from"../../geometry/Polyline.js";import{e as k}from"../../chunks/areaOperator.js";import{e as G,l as x}from"../../chunks/geodeticAreaOperator.js";import{e as M,l as O}from"../../chunks/geodeticDensifyOperator.js";import{e as C,l as H}from"../../chunks/geodeticLengthOperator.js";import{e as R}from"../../chunks/lengthOperator.js";import{e as T}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=n(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=n(this._measurementLayer),this._manipulatorLayer=n(this._manipulatorLayer),this._snappingLayer=n(this._snappingLayer),this._updatingHandles=n(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),n=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=Y.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(N({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:n}=e;this._set("measurement",r);const o=r?oe(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!i&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,h=3===c.length,{effectiveTheme:u}=this.view;h?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(u.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:u.accentColor,width:2})}),p=new t({symbol:new V({color:u.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(u.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=n;const d=i?U(i):null,v=d?j.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function ie(e,r,i){const a=8,n={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new E({...n,size:a}),m=new E({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new A({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):M(r,te,{unit:"meters"}):t.isWebMercator?M(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new A({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(_(t)){if(n=w(r,te),o=w(i,te),o=T(o),!o)return null;s=b([r],"meters")[0],a=L([o],"square-meters")[0]}else{if(n=M(r,te,{unit:"meters"}),o=M(i,te,{unit:"meters"}),o=T(o),!o)return null;s=C(r,{unit:"meters"}),a=G(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=M(r,te,{unit:"meters"}),o=M(i,te,{unit:"meters"}),o=T(o),!o)return null;s=C(r,{unit:"meters"}),a=G(o,{unit:"square-meters"})}else{if(n=r,o=T(i),!o)return null;s=R(r,{unit:"meters"}),a=k(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function ae(e){return null!=e}async function ne(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([x(),O(),H()])}function oe(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const n=v(r);if(n)switch(n){case"metric":i.perimeter=u(e,a,"meters");break;case"imperial":i.perimeter=h(e,a,"meters");break;default:{const t=d(a,"meters",n);i.perimeter=l(e,t,n);break}}else i.perimeter="";return i}e([y()],re.prototype,"_drawActive",void 0),e([y({readOnly:!0})],re.prototype,"cursor",null),e([y({value:!0})],re.prototype,"editable",null),e([y({readOnly:!0})],re.prototype,"measurement",void 0),e([y({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([y()],re.prototype,"messages",void 0),e([y({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([y()],re.prototype,"unit",void 0),e([y()],re.prototype,"updating",null),e([y({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,oe as createAreaMeasurementLabel,ae as isSupported,ne as loadGeometryOperators};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as o,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as h,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as d,deriveLengthUnitFromAreaUnit as v}from"../../core/units.js";import{property as y,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import A from"../../geometry/Polyline.js";import{e as k}from"../../chunks/areaOperator.js";import{e as G,l as x}from"../../chunks/geodeticAreaOperator.js";import{e as M,l as O}from"../../chunks/geodeticDensifyOperator.js";import{e as C,l as H}from"../../chunks/geodeticLengthOperator.js";import{e as R}from"../../chunks/lengthOperator.js";import{e as T}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=n(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=n(this._measurementLayer),this._manipulatorLayer=n(this._manipulatorLayer),this._snappingLayer=n(this._snappingLayer),this._updatingHandles=n(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),n=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=Y.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(N({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:n}=e;this._set("measurement",r);const o=r?oe(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!i&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,h=3===c.length,{effectiveTheme:u}=this.view;h?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(u.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:u.accentColor,width:2})}),p=new t({symbol:new V({color:u.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(u.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=n;const d=i?U(i):null,v=d?j.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function ie(e,r,i){const a=8,n={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new E({...n,size:a}),m=new E({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new A({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):M(r,te,{unit:"meters"}):t.isWebMercator?M(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new A({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(_(t)){if(n=w(r,te),o=w(i,te),o=T(o),!o)return null;s=b([r],"meters")[0],a=L([o],"square-meters")[0]}else{if(n=M(r,te,{unit:"meters"}),o=M(i,te,{unit:"meters"}),o=T(o),!o)return null;s=C(r,{unit:"meters"}),a=G(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=M(r,te,{unit:"meters"}),o=M(i,te,{unit:"meters"}),!o||!n)return null;if(o=T(o),!o)return null;s=C(r,{unit:"meters"}),a=G(o,{unit:"square-meters"})}else{if(n=r,o=T(i),!o)return null;s=R(r,{unit:"meters"}),a=k(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function ae(e){return null!=e}async function ne(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([x(),O(),H()])}function oe(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const n=v(r);if(n)switch(n){case"metric":i.perimeter=u(e,a,"meters");break;case"imperial":i.perimeter=h(e,a,"meters");break;default:{const t=d(a,"meters",n);i.perimeter=l(e,t,n);break}}else i.perimeter="";return i}e([y()],re.prototype,"_drawActive",void 0),e([y({readOnly:!0})],re.prototype,"cursor",null),e([y({value:!0})],re.prototype,"editable",null),e([y({readOnly:!0})],re.prototype,"measurement",void 0),e([y({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([y()],re.prototype,"messages",void 0),e([y({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([y()],re.prototype,"unit",void 0),e([y()],re.prototype,"updating",null),e([y({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,oe as createAreaMeasurementLabel,ae as isSupported,ne as loadGeometryOperators};
|
|
@@ -2,6 +2,7 @@ import type Graphic from "../../Graphic.js";
|
|
|
2
2
|
import type EsriMap from "../../Map.js";
|
|
3
3
|
import type Collection from "../../core/Collection.js";
|
|
4
4
|
import type UtilityNetworkAssociationType from "../../popup/support/UtilityNetworkAssociationType.js";
|
|
5
|
+
import type Association from "../../rest/networks/support/Association.js";
|
|
5
6
|
import type AttachmentInfo from "../../rest/query/support/AttachmentInfo.js";
|
|
6
7
|
import type AttachmentElementInput from "./inputs/AttachmentElementInput.js";
|
|
7
8
|
import type BatchFormInputs from "./inputs/BatchFormInputs.js";
|
|
@@ -331,6 +332,15 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
331
332
|
* @internal
|
|
332
333
|
*/
|
|
333
334
|
resetAttachmentChanges(elementId: string, attachmentGlobalId: string): void;
|
|
335
|
+
/**
|
|
336
|
+
* Used to indicate that the current feature being edited is part of an association.
|
|
337
|
+
* This is determined outside of BatchAttributeForm, typically used in nested Editor workflows to
|
|
338
|
+
* determine capabilities for the nested workflow e.g. can the association be deleted.
|
|
339
|
+
*
|
|
340
|
+
* @param association - A reference to association the current feature belongs to.
|
|
341
|
+
* @internal
|
|
342
|
+
*/
|
|
343
|
+
setActiveAssociation(association: Association | null | undefined): void;
|
|
334
344
|
/**
|
|
335
345
|
* Used to specify a specific input to view associated layers for.
|
|
336
346
|
* Related to the 'viewing-associated-layers' page.
|
|
@@ -379,22 +389,20 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
379
389
|
*
|
|
380
390
|
* @param fieldName - The name of the field to update.
|
|
381
391
|
* @param value - The value to assign.
|
|
382
|
-
* @param relatedElementId - The elementId of the visible field input that initiated the change.
|
|
383
392
|
* @param features - The features whose field values should be updated.
|
|
384
393
|
* @returns A promise that resolves after mutation, validity reconciliation, and event emission complete.
|
|
385
394
|
* @internal
|
|
386
395
|
*/
|
|
387
|
-
setValueForFieldName(fieldName: string, value: FieldValue,
|
|
396
|
+
setValueForFieldName(fieldName: string, value: FieldValue, features: Iterable<Graphic>): Promise<void>;
|
|
388
397
|
/**
|
|
389
398
|
* Assigns per-feature values to a field using the view model's mutation and event pipeline.
|
|
390
399
|
*
|
|
391
400
|
* @param fieldName - The name of the field to update.
|
|
392
401
|
* @param values - The values to assign, keyed by feature.
|
|
393
|
-
* @param relatedElementId - The elementId of the visible field input that initiated the change.
|
|
394
402
|
* @returns A promise that resolves after mutation, validity reconciliation, and event emission complete.
|
|
395
403
|
* @internal
|
|
396
404
|
*/
|
|
397
|
-
setValuePerFeatureForFieldName(fieldName: string, values: Map<Graphic, FieldValue
|
|
405
|
+
setValuePerFeatureForFieldName(fieldName: string, values: Map<Graphic, FieldValue>): Promise<void>;
|
|
398
406
|
/**
|
|
399
407
|
* @param elementId - Attachment element identifier.
|
|
400
408
|
* @param files - Files to stage for addition.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as h}from"../../core/maybe.js";import{throwIfAborted as c,isAbortError as u}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as m,sync as d,watch as g,syncAndInitial as f,initial as v,whenOnce as A}from"../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import I from"../../geometry/SpatialReference.js";import{getGraphicLayer as w}from"../../graphic/graphicOriginUtils.js";import{system as E}from"../../time/constants.js";import{getAttachmentKey as x}from"./attachmentUtils.js";import{createReactiveGraphic as C,isAttributeFormSupportedLayerWithAttachments as M,layerSupportsQueryAttachments as V,queryAttachmentsForElements as b}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as k}from"./ReactiveContingentValuesManager.js";import{ArcadeExecutorProvider as R}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as S}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as L}from"./expressions/ExpressionsModel.js";import T from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as H}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as j,isFieldInput as P,applyFieldValueChanges as N}from"./inputs/support/inputUtils.js";import B from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as G}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as O,isGroupElementTemplate as U}from"./templates/support/templateUtils.js";import{ContingentValuesManager as D}from"../support/ContingentValuesManager.js";import{isEmptyValue as W}from"../support/forms/formUtils.js";function Z(e,t){return e?.find(e=>e.layer===t)}let $=class extends n{constructor(e){super(e),this._attachmentCache=new p,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new a,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new R,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new T({inputs:[]}),this._emptyFormTemplate=new B({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new F,this._submitTask=null,this._layerTemplateMap=new p,this._workingFeatures=new a,this._expressionsManager=new S({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:E}}),this._getExternalErrorForFeature=(e,t)=>this._reactiveContingentValuesManager.getViolationTypeForField(e,t),this._getFieldValueOptionsForFeature=e=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(e),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new D),this.addHandles([m(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),g(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),g(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),g(()=>this.activeFeature,()=>{this.goHome()},d),g(()=>this.page,e=>{const t=[...this.pageStack];if(t.includes(e))for(;t.length&&t.at(-1)!==e;)t.pop();else t.push(e);this.pageStack=t},f),g(()=>this.contingentValuesManager,e=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new k({manager:e})},v)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return w(e)??null}get activeAssociationsInput(){return this._activeAssociationsInput}get activeRelationshipInput(){return this._activeRelationshipInput}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){const e=this.contingentValuesManager;for(const t of this.layers)if(e.getFieldsWithContingentValues(t).size>0)return!0;return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.showingSelectedAttachmentReplacePage&&this.selectedAttachmentDetails?"replacing-attachment":this.selectedAttachmentDetails?"viewing-attachment-details":this.selectedAttachmentAddInput?"adding-attachments":this.selectedAttachmentListInput?"viewing-attachments":this.activeAssociationsInput?.associatedLayer?"viewing-associated-features":this.activeAssociationsInput?"viewing-associated-layers":this.activeRelationshipInput?.showAllRelatedRecords?"viewing-related-records":this.activeRelationshipInput?.showAllCategories?"viewing-related-categories":"default"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=w(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){if(this.submitHasBeenAttempted=!0,this._validateContingentValues(this._workingFeatures),!this._hasPendingAttachmentHydration)return this._emitSubmit(),Promise.resolve();if(this._submitTask)return this._submitTask.promise;const e=s(async()=>{await Promise.all(this._allAttachmentInputs.map(e=>e.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=e,e.promise.finally(()=>{this._submitTask===e&&(this._submitTask=null)}),e.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",e),null!=e&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(e){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(e){this._set("selectedAttachmentListElementId",e),null!=e&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const e=this.selectedAttachmentListElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(e){this._set("showingSelectedAttachmentReplacePage",e&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const e=this.selectedAttachmentAddElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get selectedAttachmentDetails(){const e=this.selectedAttachment,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!s)return null;const a=s.attachments.findIndex(t=>x(t)===e.attachmentKey);if(-1===a)return null;return{attachment:s.attachments[a],input:s}}get _allAttachmentInputs(){const e=[...this.sharedForm.allAttachmentElementInputs];for(const t of this._featureFormMap.values())e.push(...t.allAttachmentElementInputs);return e}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(e=>e.hasPendingAttachmentUpdateData)}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(j(e)){const t=e.inputs.find(e=>P(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(P(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}async goBack(){switch(this.page){case"replacing-attachment":return void this.setShowingSelectedAttachmentReplacePage(!1);case"viewing-attachment-details":return void this.setSelectedAttachment(null);case"adding-attachments":return void this.setSelectedAttachmentAddElementId(null);case"viewing-attachments":return void this.setSelectedAttachmentListElementId(null);case"viewing-associated-features":return void this.setActiveAssociationsLayer(null);case"viewing-associated-layers":return void this.setActiveAssociationsInput(null);case"viewing-related-categories":case"viewing-related-records":return void this.clearActiveRelationshipCategoryOrInput();default:return}}async goHome(){this.setShowingSelectedAttachmentReplacePage(!1),this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null),this.setSelectedAttachmentListElementId(null),this.setActiveAssociationsLayer(null),this.setActiveAssociationsInput(null),this.clearAllRelationshipSettings()}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){await this._setFieldValueFromContext(e.features,t,{fieldName:e.fieldName,expressionsManager:e.expressionsManager,fieldInput:e})}async setFieldInputValuePerFeature(e,t){await this._setFieldValuePerFeatureFromContext(t,{fieldName:e.fieldName,expressionsManager:e.expressionsManager,fieldInput:e})}async setValueForFieldName(e,t,s,a){const i=null==a?this._workingFeatures:this._getReactiveGraphics(a);await this._setFieldValueFromContext(i,t,{fieldName:e,expressionsManager:this._expressionsManager,fieldInput:this.findFieldInput(s)??void 0})}async setValuePerFeatureForFieldName(e,t,s){await this._setFieldValuePerFeatureFromContext(this._getReactiveGraphicValueMap(t),{fieldName:e,expressionsManager:this._expressionsManager,fieldInput:this.findFieldInput(s)??void 0})}_getReactiveGraphics(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&t.push(e)}return t}_getReactiveGraphicValueMap(e){const t=new Map;for(const[s,a]of e){const e=this._reactiveGraphicLookup.get(s);e&&t.set(e,a)}return t}async _setFieldValueFromContext(e,t,s){const a=await this._mutateFieldValues(s,e,()=>t);this._emitLegacyValueChangeEvent(e,s.fieldName,t),this._emitValuesChangeEvent(s.fieldName,Q(a,s.fieldName,t))}async _setFieldValuePerFeatureFromContext(e,t){const s=await this._mutateFieldValues(t,e.keys(),t=>e.get(t));if(this._emitValuesChangeEvent(t.fieldName,X(s,t.fieldName,e)),1===e.size){const{value:s}=e.values().next();this._emitLegacyValueChangeEvent(e.keys(),t.fieldName,s)}}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const a=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return 0===a.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),a}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.stageDeleteAttachment(a),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const i=this._findAttachment(a,t);i&&0!==s.trim().length&&(a.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,await a.ensureStagedUpdateData(i),this._emitAttachmentsChange(a))}async stageReplaceAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return!1;const i=this._findAttachment(a,t);if(!i)return!1;return!!await a.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext)&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(a),!0)}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setActiveAssociationsInput(e){this._activeAssociationsInput=e}setActiveAssociationsLayer(e){this._activeAssociationsInput?.setAssociatedLayer(e)}setActiveAssociationType(e){this._activeAssociationsInput?.setActiveAssociationType(e)}setActiveRelationshipInput(e){e||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=e}setActiveRelationshipCategory(e,t){t.setActiveCategory(e),this.setActiveRelationshipInput(t)}clearAllRelationshipSettings(){const e=this.activeRelationshipInput;e&&(e.setActiveCategory(null),e.setShowAllCategories(!1),e.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const e=this.activeRelationshipInput;e&&(e.showAllRelatedRecords?e.showAllCategories?e.setActiveCategory(null):this.setActiveRelationshipInput(null):e.showAllCategories&&(e.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.discardStagedEdits(a),this._emitAttachmentsChange(s))}setSelectedAttachment(e){this.selectedAttachment=e??null}setShowingSelectedAttachmentReplacePage(e){this.showingSelectedAttachmentReplacePage=e}setSelectedAttachmentAddElementId(e){this.selectedAttachmentAddElementId=e??null}setSelectedAttachmentListElementId(e){this.selectedAttachmentListElementId=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?H(t,{allFeatures:new a([e]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,a]of this._reactiveGraphicLookup){const i=[],n=[],r=this._featureFormMap.get(a)?.allAttachmentElementInputs??[];for(const e of r)t(i,e.toSubmitEdits()),e.valid||n.push(e.template.elementId);e.set(s,{feature:s,values:{...a.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:n})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||r.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||r.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const a of e.allAttachmentElementInputs)t(s,a.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_emitLegacyValueChangeEvent(e,t,s){this.emit("value-change",{name:"value-change",features:Array.from(e,e=>e.source),fieldName:t,value:s})}_emitValuesChangeEvent(e,t){this.emit("values-change",{name:"values-change",fieldName:e,data:t})}_validateContingentValues(e,t=!1){if(t&&!this.submitHasBeenAttempted)for(const s of e)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of e)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}async _trackValidityChange(e,t){await A(()=>!1===this.calculating);const s=new Map(t.map(e=>[e.source,e]));for(const a of this.invalidFeatures)if(!e.has(a)){const e=s.get(a);e&&(e.userChangesHaveMadeInvalid=!0)}}async _mutateFieldValues(e,t,s){const a=new Set(this.invalidFeatures),{expressionsManager:i,fieldInput:n,fieldName:r}=e;n&&(n.userHasChangedValue=!0);const o=await N(r,i,t,s);return o.length>0&&(this.userHasChangedValues=!0),"single"!==this.mode&&1!==this.features.length||this._validateContingentValues([o[0]],!0),await this._trackValidityChange(a,o),o}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new S({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??I.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{attachmentsEnabled:e,layers:t}=this;if(0===t.length)return;const a=s(async s=>{try{c(s),this.contingentValuesManager.layers.addMany(t);const a=new Map;await Promise.all(t.map(e=>e.load()));for(const i of t){const t=Z(this.layerInfos,i),n=await G(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:e},t?.formTemplate);c(s),this._layerTemplateMap.set(i,n);const r=n.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new L({preserveFieldValuesWhenHidden:n.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const e of r.keys()){const t=r.get(e);if(this._hasAsyncArcadeExpressions=!0===(t.editableExpression?.isAsync||t.requiredExpression?.isAsync||t.valueExpression?.isAsync||t.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const e of n.elements){if(O(e))continue;const t=e.clone();U(t)&&(t.elements=t.elements.filter(e=>!O(e)));const{elementId:s}=t;a.has(s)?a.get(s).foldIn(t):a.set(s,t)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const n=new B({elements:Array.from(a.values())});this.sharedFormTemplate=n,this.sharedForm=H(n,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray()),await A(()=>!this.contingentValuesManager.updating)}catch(a){throw u(a)||r.getLogger(this).error("Failed preparing form",a),a}});this._updatingHandles.consumePromise(a.promise),this._prepareTask=a}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(C));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&M(t)&&V(t)))return;const a=e.getObjectId();if(null==a)return;const i=this._attachmentCache.get(t),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(i){const e=i.get(a);e&&(r=e)}if(!r){r=await b(t,a,n);o(this._attachmentCache,t,()=>new p).set(a,r)}for(const o of n)o.applyFetchedAttachments(J(o,r))}};e([y()],$.prototype,"_attachmentCache",void 0),e([y({readOnly:!0})],$.prototype,"activeFeature",null),e([y()],$.prototype,"activeFeatureIndex",void 0),e([y({readOnly:!0})],$.prototype,"activeForm",null),e([y({readOnly:!0})],$.prototype,"activeLayer",null),e([y()],$.prototype,"activeAssociationsInput",null),e([y()],$.prototype,"activeRelationshipInput",null),e([y()],$.prototype,"attachmentsEnabled",void 0),e([y()],$.prototype,"callbacks",void 0),e([y()],$.prototype,"disabled",void 0),e([y()],$.prototype,"calculating",null),e([y()],$.prototype,"contingentValuesManager",void 0),e([y()],$.prototype,"editType",void 0),e([y()],$.prototype,"features",void 0),e([y()],$.prototype,"expressionEvaluationFailed",null),e([y()],$.prototype,"hasNonActiveInvalidFeatures",null),e([y()],$.prototype,"hasAsyncArcadeExpressions",null),e([y()],$.prototype,"_hasAsyncArcadeExpressions",void 0),e([y()],$.prototype,"invalidFeatures",null),e([y()],$.prototype,"hasVisibleInputs",null),e([y()],$.prototype,"hasLayersWithContingentValues",null),e([y()],$.prototype,"highlightHelper",void 0),e([y()],$.prototype,"maximumFeatureCount",void 0),e([y()],$.prototype,"maximumFeatureCountWithComplexForms",void 0),e([y()],$.prototype,"visibleInputs",null),e([y()],$.prototype,"map",void 0),e([y()],$.prototype,"noVisibleElementsReason",null),e([y()],$.prototype,"page",null),e([y()],$.prototype,"pageStack",void 0),e([y()],$.prototype,"readOnly",void 0),e([y()],$.prototype,"spatialReference",void 0),e([y()],$.prototype,"submitHasBeenAttempted",void 0),e([y()],$.prototype,"timeZone",void 0),e([y()],$.prototype,"updating",null),e([y()],$.prototype,"valid",null),e([y()],$.prototype,"layers",null),e([y()],$.prototype,"mode",null),e([y()],$.prototype,"sharedForm",void 0),e([y()],$.prototype,"sharedFormTemplate",void 0),e([y()],$.prototype,"selectedAttachment",null),e([y()],$.prototype,"selectedAttachmentAddElementId",null),e([y()],$.prototype,"selectedAttachmentListElementId",null),e([y()],$.prototype,"selectedAttachmentListInput",null),e([y()],$.prototype,"showingSelectedAttachmentReplacePage",null),e([y()],$.prototype,"selectedAttachmentAddInput",null),e([y()],$.prototype,"selectedAttachmentDetails",null),e([y()],$.prototype,"userHasChangedValues",void 0),e([y()],$.prototype,"layerInfos",void 0),e([y()],$.prototype,"_arcadeExecutorProvider",void 0),e([y()],$.prototype,"_activeAssociationsInput",void 0),e([y()],$.prototype,"_activeRelationshipInput",void 0),e([y()],$.prototype,"_prepareTask",void 0),e([y()],$.prototype,"_reactiveGraphicLookup",void 0),e([y()],$.prototype,"_allAttachmentInputs",null),e([y()],$.prototype,"_hasPendingAttachmentHydration",null),e([y()],$.prototype,"_layerTemplateMap",void 0),e([y()],$.prototype,"_workingFeatures",void 0),e([y()],$.prototype,"_expressionsManager",void 0),$=e([_("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],$);const z=$;function K(e){return null!=e&&e.trim().length>0}function q(e,t){const s=e.keywords;return K(s)&&s.toLowerCase()===t}function J(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",a=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(W(a))return t.filter(e=>!K(e.keywords));const e=a.toLowerCase();return t.filter(t=>!K(t.keywords)||q(t,e))}if(W(a))return t;const i=a.toLowerCase();return t.filter(e=>q(e,i))}function Q(e,t,s){return e.map(e=>({feature:e.source,changes:[{fieldName:t,value:s}]}))}function X(e,t,s){return e.map(e=>({feature:e.source,changes:[{fieldName:t,value:s.get(e)}]}))}export{z as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{pushIfSome as e}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as c}from"../../core/maybe.js";import{throwIfAborted as h,isAbortError as u}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as m,sync as d,watch as g,syncAndInitial as f,initial as v,whenOnce as A}from"../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import I from"../../geometry/SpatialReference.js";import{getGraphicLayer as w}from"../../graphic/graphicOriginUtils.js";import{system as E}from"../../time/constants.js";import{getAttachmentKey as C}from"./attachmentUtils.js";import{getLayerTimeZone as x,getEffectiveTimeZone as M,createReactiveGraphic as b,isAttributeFormSupportedLayerWithAttachments as V,layerSupportsQueryAttachments as k,queryAttachmentsForElements as T}from"./batchAttributeFormUtils.js";import{ReactiveContingentValuesManager as R}from"./ReactiveContingentValuesManager.js";import{parseFormTemplateString as L}from"./stringUtils.js";import{ValueChangeTransaction as S}from"./ValueChangeTransaction.js";import{ArcadeExecutorProvider as H}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as P}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as j}from"./expressions/ExpressionsModel.js";import B from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as O}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as G,isFieldInput as D}from"./inputs/support/inputUtils.js";import U from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as N}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as Z,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{ContingentValuesManager as $}from"../support/ContingentValuesManager.js";import{isEmptyValue as z}from"../support/forms/formUtils.js";function K(t,e){return t?.find(t=>t.layer===e)}let q=class extends n{constructor(t){super(t),this._attachmentCache=new p,this.activeFeatureIndex=-1,this.attachmentsEnabled=!1,this.callbacks=null,this.disabled=!1,this.editType="NA",this.features=new i,this._hasAsyncArcadeExpressions=!1,this.highlightHelper=null,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new H,this._activeAssociation=null,this._activeAssociationsInput=null,this._activeRelationshipInput=null,this._ownContingentValuesManager=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new B({inputs:[]}),this._emptyFormTemplate=new U({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new F,this._submitTask=null,this._layerTemplateMap=new p,this._workingFeatures=new i,this._expressionsManager=new P({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:E}}),this._getExternalErrorForFeature=(t,e)=>this._reactiveContingentValuesManager.getViolationTypeForField(t,e),this._getFieldValueOptionsForFeature=t=>this._reactiveContingentValuesManager.getAndWatchFieldValueOptions(t),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.contingentValuesManager||(this.contingentValuesManager=this._ownContingentValuesManager=new $),this.addHandles([m(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),g(()=>[this.attachmentsEnabled,this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),g(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),g(()=>this.activeFeature,()=>{this.goHome()},d),g(()=>this.page,t=>{const e=[...this.pageStack];if(e.includes(t))for(;e.length&&e.at(-1)!==t;)e.pop();else e.push(t);this.pageStack=e},f),g(()=>this.contingentValuesManager,t=>{l(this._reactiveContingentValuesManager),this._reactiveContingentValuesManager=new R({manager:t})},v)]),this._prepare()}destroy(){this._prepareTask=c(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),l(this._reactiveContingentValuesManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy(),this._ownContingentValuesManager=l(this._ownContingentValuesManager),this.highlightHelper?.removeAll()}get activeFeature(){const t=this.activeFeatureIndex;return t<0?null:this.features.at(t)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const t=this._workingFeatures.at(this.activeFeatureIndex);if(!t)return this._emptyForm;const e=this._featureFormMap.get(t);if(e)return e;const s=this._makeBatchFormInputsForFeature(t);return s!==this._emptyForm&&this._featureFormMap.set(t,s),s}get activeLayer(){const{activeFeature:t}=this;if(!t)return null;return w(t)??null}get activeAssociation(){return this._activeAssociation}get activeAssociationsInput(){return this._activeAssociationsInput}get activeAssociationType(){return this.activeAssociationsInput?.activeAssociationType}get activeRelationshipInput(){return this._activeRelationshipInput}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get canGoBack(){return this.pageStack.length>1}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:t}=this;return this.invalidFeatures.some(e=>e!==t)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){const t=this.contingentValuesManager;for(const e of this.layers)if(t.getFieldsWithContingentValues(e).size>0)return!0;return!1}get formDescription(){return this._computeFormHeaderField(this.activeForm?.description)}get formTitle(){return this._computeFormHeaderField(this.activeForm?.title)}get effectiveTimeZone(){const{activeLayer:t,timeZone:e}=this;if(!t)return e??"system";const s=x(t);return M(e,s)}get visibleInputs(){return this.activeForm.inputs.filter(t=>t.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const t=new Set;for(const e of this.activeForm.inputs)switch(e.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":t.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":t.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return t.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.showingSelectedAttachmentReplacePage&&this.selectedAttachmentDetails?"replacing-attachment":this.selectedAttachmentDetails?"viewing-attachment-details":this.selectedAttachmentAddInput?"adding-attachments":this.selectedAttachmentListInput?"viewing-attachments":this.activeAssociationsInput?.associatedLayer?"viewing-associated-features":this.activeAssociationsInput?"viewing-associated-layers":this.activeRelationshipInput?.showAllRelatedRecords?"viewing-related-records":this.activeRelationshipInput?.showAllCategories?"viewing-related-categories":"default"}get status(){const t=this._prepareTask;return null==t?"not-loaded":t.finished?null!=t.error?"failed":"loaded":"loading"}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(t=>t.valid)}get layers(){const t=new Set;return this.features.forEach(e=>{const s=w(e);s&&t.add(s)}),Array.from(t)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){if(this.submitHasBeenAttempted=!0,this.validateContingentValues(this._workingFeatures),!this._hasPendingAttachmentHydration)return this._emitSubmit(),Promise.resolve();if(this._submitTask)return this._submitTask.promise;const t=s(async()=>{await Promise.all(this._allAttachmentInputs.map(t=>t.waitForPendingAttachmentUpdateData())),this._emitSubmit()});return this._submitTask=t,t.promise.finally(()=>{this._submitTask===t&&(this._submitTask=null)}),t.promise}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachment",t),null!=t&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(t){this.showingSelectedAttachmentReplacePage=!1,this._set("selectedAttachmentAddElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentListElementId=null)}get selectedAttachmentListElementId(){return this._get("selectedAttachmentListElementId")??null}set selectedAttachmentListElementId(t){this._set("selectedAttachmentListElementId",t),null!=t&&(this.selectedAttachment=null,this.selectedAttachmentAddElementId=null)}get selectedAttachmentListInput(){const t=this.selectedAttachmentListElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get showingSelectedAttachmentReplacePage(){return this._get("showingSelectedAttachmentReplacePage")??!1}set showingSelectedAttachmentReplacePage(t){this._set("showingSelectedAttachmentReplacePage",t&&null!=this.selectedAttachmentDetails)}get selectedAttachmentAddInput(){const t=this.selectedAttachmentAddElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get selectedAttachmentDetails(){const t=this.selectedAttachment,e=this.activeForm;if(!t||!e)return null;const s=e.allAttachmentElementInputs.find(e=>e.template.elementId===t.elementId);if(!s)return null;const i=s.attachments.findIndex(e=>C(e)===t.attachmentKey);if(-1===i)return null;return{attachment:s.attachments[i],input:s}}get _allAttachmentInputs(){const t=[...this.sharedForm.allAttachmentElementInputs];for(const e of this._featureFormMap.values())t.push(...e.allAttachmentElementInputs);return t}get _hasPendingAttachmentHydration(){return this._allAttachmentInputs.some(t=>t.hasPendingAttachmentUpdateData)}findFieldInput(t){if(null==t)return;const e=this._activeFormInputsByElementId;if(e.has(t))return e.get(t);const s=this.activeForm.allFieldInputs.find(e=>e.template.elementId===t);return void 0!==s?(e.set(t,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const t of this.visibleInputs){if(G(t)){const e=t.inputs.find(t=>D(t)&&!t.valid);if(e)return{input:e,groupInput:t}}if(D(t)&&!t.valid)return{input:t}}}getFieldInputValue(t){return this.findFieldInput(t)?.value}getValues(t){const e=this._reactiveGraphicLookup.get(t);if(!e)throw new a("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...e.attributes}}async goBack(){switch(this.page){case"replacing-attachment":return void this.setShowingSelectedAttachmentReplacePage(!1);case"viewing-attachment-details":return void this.setSelectedAttachment(null);case"adding-attachments":return void this.setSelectedAttachmentAddElementId(null);case"viewing-attachments":return void this.setSelectedAttachmentListElementId(null);case"viewing-associated-features":return void this.setActiveAssociationsLayer(null);case"viewing-associated-layers":return void this.setActiveAssociationsInput(null);case"viewing-related-categories":case"viewing-related-records":return void this.clearActiveRelationshipCategoryOrInput();default:return}}async goHome(){this.setShowingSelectedAttachmentReplacePage(!1),this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null),this.setSelectedAttachmentListElementId(null),this.setActiveAssociationsLayer(null),this.setActiveAssociationsInput(null),this.clearAllRelationshipSettings()}notifyGeometriesChanged(t){const e=[];for(const s of t){const t=this._reactiveGraphicLookup.get(s);t&&(e.push(t),t.geometry=s.geometry)}this._updatingHandles.consumePromise(this._valueChangeTransaction(async t=>this._expressionsManager.runGeometryDependentExpressions(e,t),"user"))}async overrideOriginalFeature(t,e){await(this._prepareTask?.promise);const s=this._reactiveGraphicLookup.get(t);s&&(s.original=e,this._updatingHandles.consumePromise(this._valueChangeTransaction(t=>this._expressionsManager.runOriginalFeatureDependentExpressions(s,t),"expression")))}async setFieldInputValue(t,e){const{fieldName:s}=t;await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of t.features)i.setValue(a,s,e)},"user",t))}async setFieldInputValuePerFeature(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e)s.setValue(i,t.fieldName,a);s.hasChanges&&(t.userHasChangedValue=!0)},"user",t))}async setValueForFieldName(t,e,s){await this._updatingHandles.addPromise(this._valueChangeTransaction(async i=>{for(const a of s){const s=this._reactiveGraphicLookup.get(a);s&&i.setValue(s,t,e)}},"user",t))}async setValuePerFeatureForFieldName(t,e){await this._updatingHandles.addPromise(this._valueChangeTransaction(async s=>{for(const[i,a]of e){const e=this._reactiveGraphicLookup.get(i);e&&s.setValue(e,t,a)}},"user",t))}async setFieldValue(t,e){const s=this.activeForm.allFieldInputs.find(e=>e.fieldName===t);if(null==s)throw new a("no-field-input-found",`Cannot set the value of FieldInput with field name: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async setValue(t,e){const s=this.findFieldInput(t);if(null==s)throw new a("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async stageAddAttachments(t,e){if(0===e.length)return[];const s=this._findAttachmentInput(t);if(!s)return[];const i=await s.stageAddAttachments(e,this._expressionsManager.arcadeContext);return 0===i.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),i}stageDeleteAttachment(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.stageDeleteAttachment(i),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}async stageRenameAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return;const a=this._findAttachment(i,e);a&&0!==s.trim().length&&(i.stageRenameAttachment(a,s.trim()),this.userHasChangedValues=!0,await i.ensureStagedUpdateData(a),this._emitAttachmentsChange(i))}async stageReplaceAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return!1;const a=this._findAttachment(i,e);if(!a)return!1;return!!await i.stageReplaceAttachment(a,s,this._expressionsManager.arcadeContext)&&(this.userHasChangedValues=!0,this._emitAttachmentsChange(i),!0)}clearAttachmentChanges(t){const e=this._findAttachmentInput(t);e&&(e.clearAttachmentChanges(),this._emitAttachmentsChange(e))}setActiveAssociation(t){this._activeAssociation=t}setActiveAssociationsInput(t){this._activeAssociationsInput=t}setActiveAssociationsLayer(t){this._activeAssociationsInput?.setAssociatedLayer(t)}setActiveAssociationType(t){this._activeAssociationsInput?.setActiveAssociationType(t)}setActiveRelationshipInput(t){t||this._activeRelationshipInput?.setActiveCategory(null),this._activeRelationshipInput=t}setActiveRelationshipCategory(t,e){e.setActiveCategory(t),this.setActiveRelationshipInput(e)}clearAllRelationshipSettings(){const t=this.activeRelationshipInput;t&&(t.setActiveCategory(null),t.setShowAllCategories(!1),t.setShowAllRelatedRecords(!1),this._activeRelationshipInput=null)}clearActiveRelationshipCategoryOrInput(){const t=this.activeRelationshipInput;t&&(t.showAllRelatedRecords?t.showAllCategories?t.setActiveCategory(null):this.setActiveRelationshipInput(null):t.showAllCategories&&(t.setShowAllCategories(!1),this.setActiveRelationshipInput(null)))}resetAttachmentChanges(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.discardStagedEdits(i),this._emitAttachmentsChange(s))}setSelectedAttachment(t){this.selectedAttachment=t??null}setShowingSelectedAttachmentReplacePage(t){this.showingSelectedAttachmentReplacePage=t}setSelectedAttachmentAddElementId(t){this.selectedAttachmentAddElementId=t??null}setSelectedAttachmentListElementId(t){this.selectedAttachmentListElementId=t??null}userChangesHaveMadeFeatureInvalid(t){return!!this._reactiveGraphicLookup.get(t)?.userChangesHaveMadeInvalid}validate(){return!1}validateContingentValues(t,e=!1){if(e&&!this.submitHasBeenAttempted)for(const s of t)this._reactiveContingentValuesManager.validateContingenciesForNonNullFields(s);else for(const s of t)this._reactiveContingentValuesManager.validateContingencyConstraints(s,{includeIncompleteViolations:!0})}_makeBatchFormInputsForFeature(t){const e=this._layerTemplateMap.get(t.layer);return e?O(e,{allFeatures:new i([t]),expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}):this._emptyForm}_computeFormHeaderField(t){const{activeFeature:e,activeLayer:s}=this;return t&&s&&e?L({attributes:e?.attributes,label:t,layer:s,timeZone:this.effectiveTimeZone}):null}_makeSubmitResults(){const t=new Map;for(const[s,i]of this._reactiveGraphicLookup){const a=[],n=[],r=this._featureFormMap.get(i)?.allAttachmentElementInputs??[];for(const t of r)e(a,t.toSubmitEdits()),t.valid||n.push(t.template.elementId);t.set(s,{feature:s,values:{...i.attributes},invalidFields:[],attachmentEdits:a,invalidAttachmentElementIds:n})}for(const e of this.sharedForm.allFieldInputs)for(const s of e.invalidFeatures)t.get(s)?.invalidFields.push(e.fieldName);return Array.from(t.values())}_emitSubmit(){this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}_findAttachmentInput(t){const e=this.activeForm.allAttachmentElementInputs.find(e=>e.template.elementId===t);return e||r.getLogger(this).error(`Attachment input not found for elementId '${t}'`),e}_findAttachment(t,e){const s=t.findAttachment(e);return s||r.getLogger(this).error(`Attachment '${e}' not found for attachment element '${t.template.elementId}'`),s}_makeAttachmentEdits(t){const s=[];for(const i of t.allAttachmentElementInputs)e(s,i.toSubmitEdits());return s}_emitAttachmentsChange(t){const e=t.single.feature;if(!e)return;const s=this._featureFormMap.get(e);this.emit("attachments-change",{name:"attachments-change",feature:e.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}async _valueChangeTransaction(t,e,s){const i=new S(this,e,"string"==typeof s?s:s?.fieldName);if(await t(i),"user"===e&&await this._expressionsManager.runExpressionsDependentOnChangedFields(i),await i.close(),i.hasChanges&&s){const t="string"==typeof s?this.activeForm.allFieldInputs.find(t=>t.fieldName===s):s;t&&(t.userHasChangedValue=!0)}}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=c(this._prepareTask),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new P({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??I.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{attachmentsEnabled:t,layers:e}=this;if(0===e.length)return;const i=s(async s=>{try{h(s),this._updateWorkingFeatures(),this.contingentValuesManager.layers.addMany(e);const i=new Map;await Promise.all(e.map(t=>t.load()));for(const a of e){const e=K(this.layerInfos,a),n=await N(a,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone,attachmentsEnabled:t},e?.formTemplate);h(s),this._layerTemplateMap.set(a,n);const r=n.getExpressionExecutorsForLayer(a);if(this._expressionsManager.layerExpressionsModelMap.set(a,new j({preserveFieldValuesWhenHidden:n.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const t of r.keys()){const e=r.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of n.elements){if(Z(t))continue;const e=t.clone();W(e)&&(e.elements=e.elements.filter(t=>!Z(t)));const{elementId:s}=e;i.has(s)?i.get(s).foldIn(e):i.set(s,e)}}if(this.hasTooManyComplexFeatures)throw new a("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new a("too-many-features","There are too many features to load into the form.");const n=new U({elements:Array.from(i.values())});this.sharedFormTemplate=n,this.sharedForm=O(n,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,getExternalErrorForFeature:this._getExternalErrorForFeature,getFieldValueOptionsForFeature:this._getFieldValueOptionsForFeature,map:this.map}),await this._valueChangeTransaction(async t=>await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray(),t),"expression"),await A(()=>!this.contingentValuesManager.updating)}catch(i){throw u(i)||r.getLogger(this).error("Failed preparing form",i),i}});this._updatingHandles.consumePromise(i.promise),this._prepareTask=i}_updateWorkingFeatures(){this._workingFeatures.destroyAll(),this._reactiveContingentValuesManager.reset();for(const e of this._featureFormMap.values())e.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:t}=this;if(this._reactiveGraphicLookup=new p,0!==t.length){this._workingFeatures.addMany(t.map(b));for(const t of this._workingFeatures)this._reactiveGraphicLookup.set(t.source,t)}}async _syncAttachments(){const{activeFeature:t,activeLayer:e,activeForm:s}=this;if(!(t&&s&&V(e)&&k(e)))return;const i=t.getObjectId();if(null==i)return;const a=this._attachmentCache.get(e),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(a){const t=a.get(i);t&&(r=t)}if(!r){r=await T(e,i,n);o(this._attachmentCache,e,()=>new p).set(i,r)}for(const o of n)o.applyFetchedAttachments(Y(o,r))}get test(){return{expressionsManager:this._expressionsManager,reactiveGraphicLookup:this._reactiveGraphicLookup}}};t([y()],q.prototype,"_attachmentCache",void 0),t([y({readOnly:!0})],q.prototype,"activeFeature",null),t([y()],q.prototype,"activeFeatureIndex",void 0),t([y({readOnly:!0})],q.prototype,"activeForm",null),t([y({readOnly:!0})],q.prototype,"activeLayer",null),t([y()],q.prototype,"activeAssociation",null),t([y()],q.prototype,"activeAssociationsInput",null),t([y()],q.prototype,"activeAssociationType",null),t([y()],q.prototype,"activeRelationshipInput",null),t([y()],q.prototype,"attachmentsEnabled",void 0),t([y()],q.prototype,"callbacks",void 0),t([y()],q.prototype,"disabled",void 0),t([y()],q.prototype,"calculating",null),t([y()],q.prototype,"canGoBack",null),t([y()],q.prototype,"contingentValuesManager",void 0),t([y()],q.prototype,"editType",void 0),t([y()],q.prototype,"features",void 0),t([y()],q.prototype,"expressionEvaluationFailed",null),t([y()],q.prototype,"hasNonActiveInvalidFeatures",null),t([y()],q.prototype,"hasAsyncArcadeExpressions",null),t([y()],q.prototype,"_hasAsyncArcadeExpressions",void 0),t([y()],q.prototype,"invalidFeatures",null),t([y()],q.prototype,"hasVisibleInputs",null),t([y()],q.prototype,"hasLayersWithContingentValues",null),t([y()],q.prototype,"formDescription",null),t([y()],q.prototype,"formTitle",null),t([y()],q.prototype,"effectiveTimeZone",null),t([y()],q.prototype,"highlightHelper",void 0),t([y()],q.prototype,"maximumFeatureCount",void 0),t([y()],q.prototype,"maximumFeatureCountWithComplexForms",void 0),t([y()],q.prototype,"visibleInputs",null),t([y()],q.prototype,"map",void 0),t([y()],q.prototype,"noVisibleElementsReason",null),t([y()],q.prototype,"page",null),t([y()],q.prototype,"pageStack",void 0),t([y()],q.prototype,"readOnly",void 0),t([y()],q.prototype,"spatialReference",void 0),t([y()],q.prototype,"submitHasBeenAttempted",void 0),t([y()],q.prototype,"timeZone",void 0),t([y()],q.prototype,"updating",null),t([y()],q.prototype,"valid",null),t([y()],q.prototype,"layers",null),t([y()],q.prototype,"mode",null),t([y()],q.prototype,"sharedForm",void 0),t([y()],q.prototype,"sharedFormTemplate",void 0),t([y()],q.prototype,"selectedAttachment",null),t([y()],q.prototype,"selectedAttachmentAddElementId",null),t([y()],q.prototype,"selectedAttachmentListElementId",null),t([y()],q.prototype,"selectedAttachmentListInput",null),t([y()],q.prototype,"showingSelectedAttachmentReplacePage",null),t([y()],q.prototype,"selectedAttachmentAddInput",null),t([y()],q.prototype,"selectedAttachmentDetails",null),t([y()],q.prototype,"userHasChangedValues",void 0),t([y()],q.prototype,"layerInfos",void 0),t([y()],q.prototype,"_arcadeExecutorProvider",void 0),t([y()],q.prototype,"_activeAssociation",void 0),t([y()],q.prototype,"_activeAssociationsInput",void 0),t([y()],q.prototype,"_activeRelationshipInput",void 0),t([y()],q.prototype,"_prepareTask",void 0),t([y()],q.prototype,"_reactiveGraphicLookup",void 0),t([y()],q.prototype,"_allAttachmentInputs",null),t([y()],q.prototype,"_hasPendingAttachmentHydration",null),t([y()],q.prototype,"_layerTemplateMap",void 0),t([y()],q.prototype,"_workingFeatures",void 0),t([y()],q.prototype,"_expressionsManager",void 0),q=t([_("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],q);const J=q;function Q(t){return null!=t&&t.trim().length>0}function X(t,e){const s=t.keywords;return Q(s)&&s.toLowerCase()===e}function Y(t,e){const s="attachment"===t.input?.type?t.input.attachmentAssociationType:"exact",i=t.attachmentKeyword;if("any"===s)return e;if("exactOrNone"===s){if(z(i))return e.filter(t=>!Q(t.keywords));const t=i.toLowerCase();return e.filter(e=>!Q(e.keywords)||X(e,t))}if(z(i))return e;const a=i.toLowerCase();return e.filter(t=>X(t,a))}export{J as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{createObservableProxy as r}from"../../core/proxy.js";import s from"../../core/ReactiveMap.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{valuesAreEquivalent as a}from"../support/forms/formUtils.js";let u=class extends e{constructor(t){super(t),this._stashedAttributes=new s,this.userChangesHaveMadeInvalid=!1,this.original=t.source.clone();const e=t.source.attributes??{},i=r({...e});this.attributes=i;const o=t.source.cloneShallow();o.attributes=i,this.plainGraphic=o}get geometry(){return this.plainGraphic.geometry}set geometry(t){this.plainGraphic.geometry=t}get layer(){return this.source.sourceLayer??this.source.layer}attributeHasChanged(t){return!a(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}getObjectId(){return this.plainGraphic.getObjectId()}getGlobalId(){return this.plainGraphic.getGlobalId()}getStashedAttribute(t){return this._stashedAttributes.get(t)}setAttribute(t,e){this.attributes[t]=e}stashAttribute(t,e){this._stashedAttributes.set(t,e)}clearStashedAttributes(){this._stashedAttributes.clear()}};t([i()],u.prototype,"attributes",void 0),t([i()],u.prototype,"geometry",null),t([i()],u.prototype,"plainGraphic",void 0),t([i()],u.prototype,"layer",null),t([i(
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{createObservableProxy as r}from"../../core/proxy.js";import s from"../../core/ReactiveMap.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{valuesAreEquivalent as a}from"../support/forms/formUtils.js";let u=class extends e{constructor(t){super(t),this._stashedAttributes=new s,this.userChangesHaveMadeInvalid=!1,this.original=t.source.clone();const e=t.source.attributes??{},i=r({...e});this.attributes=i;const o=t.source.cloneShallow();o.attributes=i,this.plainGraphic=o}get geometry(){return this.plainGraphic.geometry}set geometry(t){this.plainGraphic.geometry=t}get layer(){return this.source.sourceLayer??this.source.layer}attributeHasChanged(t){return!a(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}getObjectId(){return this.plainGraphic.getObjectId()}getGlobalId(){return this.plainGraphic.getGlobalId()}getStashedAttribute(t){return this._stashedAttributes.get(t)}setAttribute(t,e){this.attributes[t]=e}stashAttribute(t,e){this._stashedAttributes.set(t,e)}clearStashedAttributes(){this._stashedAttributes.clear()}};t([i()],u.prototype,"attributes",void 0),t([i()],u.prototype,"geometry",null),t([i()],u.prototype,"plainGraphic",void 0),t([i()],u.prototype,"layer",null),t([i()],u.prototype,"original",void 0),t([i({constructOnly:!0})],u.prototype,"source",void 0),t([i()],u.prototype,"userChangesHaveMadeInvalid",void 0),u=t([o("esri.widgets.BatchAttributeForm.ReactiveGraphic")],u);export{u as ReactiveGraphic};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import e from"../../core/Error.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";class s{constructor(e,t,s){this.changes=new Map,this.isOpen=!0,this.priorInvalidFeatures=new Set,this.viewModel=e,this.originActor=t,this.originField=s,this.priorInvalidFeatures=new Set(e.invalidFeatures)}get hasChanges(){return this.changes.size>0}async close(){if(this._assertIsOpen(),this.isOpen=!1,0!==this.changes.size){"single"!==this.viewModel.mode&&1!==this.viewModel.features.length||this.viewModel.validateContingentValues(this.changes.keys(),!0),this._reconcileValidityTracking(),this.viewModel.emit("values-change",this._makeEventPayload());for(const e of this._makeDeprecatedEventPayloads())this.viewModel.emit("value-change",e)}}setValue(e,s,i){if(this._assertIsOpen(),e.getAttribute(s)===i)return;e.setAttribute(s,i);t(this.changes,e,()=>new Map).set(s,i)}_assertIsOpen(){if(!this.isOpen)throw new e("batch-attribute-form:transaction-closed","Operation cannot be performed on a closed transaction.")}_makeEventPayload(){return{data:Array.from(this.changes.entries()).map(([e,t])=>({feature:e.source,changes:Array.from(t.entries()).map(([e,t])=>({fieldName:e,value:t}))})),fieldName:this.originField,name:"values-change",source:this.originActor}}_makeDeprecatedEventPayloads(){const e=this.originField;if(!e)return[];const s=new Map;for(const i of this.changes.keys()){t(s,i.getAttribute(e),()=>[]).push(i.source)}return Array.from(s.entries()).map(([t,s])=>({features:s,fieldName:e,name:"value-change",value:t}))}_reconcileValidityTracking(){if("expression"===this.originActor)return;const e=new Set(this.viewModel.invalidFeatures);for(const t of this.changes.keys()){const s=t.source,i=this.priorInvalidFeatures.has(s),a=e.has(s);i!==a&&(t.userChangesHaveMadeInvalid=a)}}}export{s as ValueChangeTransaction};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
|
|
3
3
|
/** @since 5.0 */
|
|
4
|
-
export interface VisibleElementsProperties extends Partial<Pick<VisibleElements, "errorsForNonVisibleFields">> {}
|
|
4
|
+
export interface VisibleElementsProperties extends Partial<Pick<VisibleElements, "errorsForNonVisibleFields" | "readOnlyNotice">> {}
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* An object containing properties that control the visibility of certain elements within the [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/) widget.
|
|
@@ -17,4 +17,11 @@ export default class VisibleElements extends Accessor {
|
|
|
17
17
|
* @since 5.0
|
|
18
18
|
*/
|
|
19
19
|
accessor errorsForNonVisibleFields: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Default value is `true`. Indicates whether to display the read-only notice for the form.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
* @since 5.1
|
|
25
|
+
*/
|
|
26
|
+
accessor readOnlyNotice: boolean;
|
|
20
27
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import e from"../../core/Accessor.js";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";let
|
|
2
|
+
import{__decorate as o}from"tslib";import e from"../../core/Accessor.js";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";let l=class extends e{constructor(o){super(o),this.errorsForNonVisibleFields=!0,this.featureInfo=!0,this.featureSwitcher=!0,this.loadingIndicator=!0,this.readOnlyNotice=!0}};o([t({type:Boolean,nonNullable:!0})],l.prototype,"errorsForNonVisibleFields",void 0),o([t({type:Boolean,nonNullable:!0})],l.prototype,"featureInfo",void 0),o([t({type:Boolean,nonNullable:!0})],l.prototype,"featureSwitcher",void 0),o([t({type:Boolean,nonNullable:!0})],l.prototype,"loadingIndicator",void 0),o([t({type:Boolean,nonNullable:!0})],l.prototype,"readOnlyNotice",void 0),l=o([r("esri.widgets.BatchAttributeForm.VisibleElements")],l);const i=l;export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{substitute as e}from"../../intl.js";import t from"../../rest/support/AttachmentQuery.js";import{ReactiveGraphic as
|
|
2
|
+
import{substitute as e}from"../../intl.js";import{isSubtypeSublayer as t}from"../../layers/support/layerUtils.js";import i from"../../rest/support/AttachmentQuery.js";import{unknown as n,utc as r}from"../../time/constants.js";import{ReactiveGraphic as o}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as a,isGroupInput as s}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as l}from"../support/dateUtils.js";import{isEmptyValue as u,getRangeErrorMessage as c,shouldUseScientificNotation as d,scientificNumberFormatOptions as p,numberFormatOptions as f}from"../support/forms/formUtils.js";const m=(e,t)=>null!=e&&e.input?.type===t;function y(e){return new o({source:e})}function h(t,i,n,r){const{dataType:o,minLength:s}=t,u=n?.validationErrors;if(!u||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return u.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return u.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,a={type:"date",intlOptions:{timeZone:"date"===i.type&&r?r:void 0,...l(i)}},s=c(n,u);return e(s,n,{format:{max:"date"===o?a:null!=n.max&&d(n.max)?p:f,min:"date"===o?a:null!=n.min&&d(n.min)?p:f}})}return"domain-validation-error::invalid-coded-value"===i?u.invalidCodedValue:"type-validation-error::invalid-type"===i?u.invalidType:"length-validation-error::too-short"===i?e(u.tooShort,{min:s}):"multiple-choice-validation-error::too-few-selected-choices"===i&&a(t)?e(u.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&a(t)?e(u.tooManySelectedChoices,{max:t.input.maximumChoices}):"length-validation-error::too-long"===i?null:"contingent-values-validation-error::contingency-violation-warning"===i||"contingent-values-validation-error::contingency-violation-error"===i?u.valuesIncompatible:null}function v(e,t,i){const n=i?.validationErrors;if(!n)return null;let r=null;for(const o of e.invalidHiddenInputs)switch(o.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":r=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:o.effectiveVisibilityCode}return r}function b(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function g(e){return!!b(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function w(e){return g(e)&&"queryAttachments"in e}function j(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function x(e){if(!w(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!(!t?.data?.supportsAttachment||!t.operations.supportsQueryAttachments)}async function C(e,t,n){const r=new Set;let o=!1;for(const i of n){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){o=!0;break}if(u(i.attachmentKeyword)){o=!0;break}r.add(i.attachmentKeyword)}const a=r.size&&!o?Array.from(r):void 0,s=new i({objectIds:[t],where:"1=1",returnMetadata:!0,keywords:a});e.capabilities?.query?.supportsCacheHint&&(s.cacheHint=!0);return(await e.queryAttachments(s))[t]??[]}function I(e,t,i,n){const r=e.get(t)?.get(i)??[];if(!n?.length)return r;const o=new Set(n.map(e=>e.toLowerCase()));return r.filter(e=>o.has(e.keywords.toLowerCase()))}function k(e){return e.reduce((e,t)=>s(t)?[...e,...t.inputs]:[...e,t],[])}function T(e){return t(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?n:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function A(e,t){return e||t?t===n?r:e&&e!==n?e:t??"system":"system"}export{y as createReactiveGraphic,k as flattenInputs,I as getAttachmentsForKeywords,A as getEffectiveTimeZone,v as getHiddenFieldsValidationErrorMessage,T as getLayerTimeZone,h as getVisibleFieldInputValidationErrorMessage,j as isAssociationsLayerUnion,g as isAttributeFormSupportedLayer,b as isAttributeFormSupportedLayerUnion,w as isAttributeFormSupportedLayerWithAttachments,m as isElementTemplateWithInputType,x as layerSupportsQueryAttachments,C as queryAttachmentsForElements};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,n=`${t}__attachment-element`,i=`${t}__relationship-element-input`,l=`${t}__multiple-choice-input`,m={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,inputRadio:`${a}--radio`,placeholderRadio:`${a}--radio-placeholder`,inputRadioGroup:`${a}--radio-group`,inputRadioLabel:`${a}--radio-label`,inputDisabled:`${a}--disabled`,inputSwitch:`${a}--switch`,dateInputContainer:`${`${t}__date`}-input-container`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${n}-input`,attachmentElementLabel:`${n}-label`,attachmentElementList:`${n}-list`,attachmentElementListItem:`${n}-list-item`,attachmentElementListItemStart:`${n}-list-item-start`,attachmentElementListItemStagedIndicator:`${n}-list-item-staged-indicator`,attachmentElementListItemThumb:`${n}-list-item-thumb`,attachmentElementListItemIcon:`${n}-list-item-icon`,attachmentElementEmptyState:`${n}-empty-state`,attachmentElementAddActions:`${n}-add-actions`,attachmentElementEmptyAction:`${n}-empty-action`,attachmentElementEmptyActionHint:`${n}-empty-action-hint`,attachmentElementEmptyActionHintValue:`${n}-empty-action-hint-value`,attachmentElementAllPanel:`${n}-all-panel`,attachmentElementAddPanel:`${n}-add-panel`,attachmentElementFileInput:`${n}-file-input`,attachmentElementAddDropzone:`${n}-add-dropzone`,attachmentElementAddDropzoneIcon:`${n}-add-dropzone-icon`,attachmentElementAddDropzoneHeading:`${n}-add-dropzone-heading`,attachmentElementAddDropzoneDetail:`${n}-add-dropzone-detail`,attachmentElementCaptureNotice:`${n}-capture-notice`,attachmentElementValidationCriteria:`${n}-validation-criteria`,attachmentElementDetail:`${n}-detail`,attachmentElementDetailPreview:`${n}-detail-preview`,attachmentElementDetailPreviewImage:`${n}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${n}-detail-preview-icon`,attachmentElementDetailActions:`${n}-detail-actions`,attachmentElementDetailMetadata:`${n}-detail-metadata`,attachmentElementDetailMetadataGroup:`${n}-detail-metadata-group`,attachmentElementDetailFileNameRow:`${n}-detail-file-name-row`,attachmentElementDetailFileNameInput:`${n}-detail-file-name-input`,attachmentElementDetailMetadataLabel:`${n}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${n}-detail-metadata-value`,relationshipElementInput:`${i}`,relationshipElementInputShowingAll:`${i}_showing-all`,relatedRecordsHeader:`${i}_header`,relatedRecordsDescription:`${i}_description`,relatedRecordsList:`${i}_list`,relatedRecordsListObserver:`${i}_list-observer`,relatedRecordsAddButton:`${i}_add-button`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,centeredButton:`${t}__centered-button`,description:`${t}__description-text`,block:`${t}__block`,group:e,groupSequential:`${e}--sequential`,individualElement:`${e}__individual-element`,multipleChoiceInput:`${l}`,multipleChoiceSelectAll:`${l}__select-all`,multipleChoiceOtherChoice:`${l}__other-choice`,multipleChoiceOtherChoiceWithSelectAll:`${l}__other-choice--with-select-all`};export{m as css};
|
|
2
|
+
const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,n=`${t}__attachment-element`,i=`${t}__relationship-element-input`,l=`${t}__multiple-choice-input`,m={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,disabledNotice:`${t}__disabled-notice`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,inputRadio:`${a}--radio`,placeholderRadio:`${a}--radio-placeholder`,inputRadioGroup:`${a}--radio-group`,inputRadioLabel:`${a}--radio-label`,inputDisabled:`${a}--disabled`,inputSwitch:`${a}--switch`,dateInputContainer:`${`${t}__date`}-input-container`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${n}-input`,attachmentElementLabel:`${n}-label`,attachmentElementList:`${n}-list`,attachmentElementListItem:`${n}-list-item`,attachmentElementListItemStart:`${n}-list-item-start`,attachmentElementListItemStagedIndicator:`${n}-list-item-staged-indicator`,attachmentElementListItemThumb:`${n}-list-item-thumb`,attachmentElementListItemIcon:`${n}-list-item-icon`,attachmentElementEmptyState:`${n}-empty-state`,attachmentElementAddActions:`${n}-add-actions`,attachmentElementEmptyAction:`${n}-empty-action`,attachmentElementEmptyActionHint:`${n}-empty-action-hint`,attachmentElementEmptyActionHintValue:`${n}-empty-action-hint-value`,attachmentElementAllPanel:`${n}-all-panel`,attachmentElementAddPanel:`${n}-add-panel`,attachmentElementFileInput:`${n}-file-input`,attachmentElementAddDropzone:`${n}-add-dropzone`,attachmentElementAddDropzoneIcon:`${n}-add-dropzone-icon`,attachmentElementAddDropzoneHeading:`${n}-add-dropzone-heading`,attachmentElementAddDropzoneDetail:`${n}-add-dropzone-detail`,attachmentElementCaptureNotice:`${n}-capture-notice`,attachmentElementValidationCriteria:`${n}-validation-criteria`,attachmentElementDetail:`${n}-detail`,attachmentElementDetailPreview:`${n}-detail-preview`,attachmentElementDetailPreviewImage:`${n}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${n}-detail-preview-icon`,attachmentElementDetailActions:`${n}-detail-actions`,attachmentElementDetailMetadata:`${n}-detail-metadata`,attachmentElementDetailMetadataGroup:`${n}-detail-metadata-group`,attachmentElementDetailFileNameRow:`${n}-detail-file-name-row`,attachmentElementDetailFileNameInput:`${n}-detail-file-name-input`,attachmentElementDetailMetadataLabel:`${n}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${n}-detail-metadata-value`,relationshipElementInput:`${i}`,relationshipElementInputShowingAll:`${i}_showing-all`,relatedRecordsHeader:`${i}_header`,relatedRecordsDescription:`${i}_description`,relatedRecordsList:`${i}_list`,relatedRecordsListObserver:`${i}_list-observer`,relatedRecordsAddButton:`${i}_add-button`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,centeredButton:`${t}__centered-button`,description:`${t}__description-text`,block:`${t}__block`,group:e,groupSequential:`${e}--sequential`,individualElement:`${e}__individual-element`,multipleChoiceInput:`${l}`,multipleChoiceSelectAll:`${l}__select-all`,multipleChoiceOtherChoice:`${l}__other-choice`,multipleChoiceOtherChoiceWithSelectAll:`${l}__other-choice--with-select-all`};export{m as css};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{whenOrAbort as o}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{property as n,subclass as l}from"../../../core/accessorSupport/decorators.js";import{DateOnly as u}from"../../../core/sql/DateOnly.js";import{TimeOnly as c}from"../../../core/sql/TimeOnly.js";import{makeUseId as p}from"../inputs/support/inputUtils.js";import{isGroupElementTemplate as d,isFieldElementTemplate as f}from"../templates/support/templateUtils.js";let h=null,m=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,x,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,v,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],b,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,r])=>this.runExpressionsDependentOnChangedFieldsForFeature([...r.keys()],t,e));await Promise.all(t)}catch(t){s.getLogger(this).error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,r){if(this._abortController.signal.aborted)return;const s=this.layerExpressionsModelMap.get(t.layer);if(!s||0===s.components.length)return;const a=new Set,o=new Set(e),i=new Set;for(;o.size>0;){const[e]=o;if(o.delete(e),a.has(e))continue;a.add(e);const n=s.fieldReferencesMap.get(e.toLowerCase());if(!n)continue;for(const t of n)i.has(t)&&n.delete(t);if(0===n.size)continue;const l=new Set;await this.evaluateAffectedComponents([...n],t,s,r,l);for(const t of n)i.add(t);for(const t of l)a.has(t)||o.add(t)}}async evaluateAffectedComponents(e,t,r,s,a){const o=new Map;for(const n of e)o.has(n)||o.set(n,this.createSccEvaluator(n,t,o,r));if(0===o.size)return;const i=[...o.values()].map(e=>e.evaluate(s,a));await Promise.all(i)}createSccEvaluator(e,t,r,s){const o=new g(e,t,this.arcadeContext,s,this.evaluatedExpressions,this._abortController);for(const i of e.adjacencyList)o.dependentEvaluators.push(a(r,i,()=>this.createSccEvaluator(i,t,r,s)));return o}async _evaluateSpecifiedComponentsForEachFeature(e,t,r){this.calculating=!0;try{const s=[];for(const a of e){const e=this.layerExpressionsModelMap.get(a.layer);if(!e||0===e.components.length)continue;const o=new Set;s.push(this.evaluateAffectedComponents(t(e),a,e,r,o))}await o(Promise.all(s),this._abortController)}catch(a){s.getLogger(this).error(a),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([n()],m.prototype,"calculating",void 0),e([n({constructOnly:!0})],m.prototype,"arcadeContext",void 0),e([n()],m.prototype,"_abortController",void 0),e([n()],m.prototype,"layerExpressionsModelMap",void 0),e([n()],m.prototype,"evaluatedExpressions",void 0),e([n()],m.prototype,"expressionEvaluationFailed",void 0),m=e([l("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],m);class g{constructor(e,t,r,s,a,o){this.scc=e,this.feature=t,this.arcadeContextInfo=r,this.expressionsModel=s,this.evaluatedExpressions=a,this._abortController=o,this.dependentEvaluators=[],this._evaluatorPromise=null}get baseContext(){const{editType:e,map:t,spatialReference:r,timeZone:s}=this.arcadeContextInfo,a=this.feature.layer,o="scene"===a?.type&&null!=a.associatedLayer?a.associatedLayer:a;return{variables:{$originalfeature:this.feature.original,$editcontext:{editType:e},$layer:o,$featureset:o,$datastore:o?.url,$feature:this.feature.plainGraphic,$map:t},executeContext:{rawOutput:!0,spatialReference:r??void 0,timeZone:s,abortSignal:this._abortController.signal}}}evaluate(e,t){return null==this._evaluatorPromise&&(this._evaluatorPromise=this._evaluate(e,t)),this._evaluatorPromise}async _evaluate(e,t){null===h&&(h=await import("../../../arcade/languageUtils.js"));const s=this.dependentEvaluators.map(r=>r.evaluate(e,t));await o(Promise.all(s),this._abortController);for(const o of this.scc.executors){const s=this.baseContext;if(this._abortController.signal.aborted)break;const l=this.expressionsModel.arcadeExecutorUses.get(o)??[],u=a(this.evaluatedExpressions,this.feature,()=>new i);let c=null,h=null;try{c=o.isAsync?await o.executeAsync(s.variables,s.executeContext):o.execute(s.variables,s.executeContext),h={result:c,status:"success"}}catch(n){h={error:n,status:"error"}}for(const r of l){const s=this.expressionsModel.elementTemplateMap.get(r.elementId);switch(r.executorPurpose){case"editable":case"required":case"text":u.set(p(r),h);break;case"value":{if("error"===h?.status)continue;const r=s.getExpressionExecutorsForLayer(this.feature.layer);let a=!0;if(r?.editableExpression&&(a=!1===u.get(p({elementId:s.elementId,executorPurpose:"editable"}))?.result),a){const r=this.feature.getAttribute(s.fieldName)??null,a=y(h.result,this.feature,s.fieldName,this.arcadeContextInfo.timeZone);a!==r&&(e.setValue(this.feature,s.fieldName,a),t.add(s.fieldName))}}break;case"visibility":if(u.set(p(r),h),!this.expressionsModel.preserveFieldValuesWhenHidden&&!1===h.result&&"user"===e.originActor)if(d(s)){for(const r of s.elements)if(f(r)){null!==this.feature.getAttribute(r.fieldName)&&t.add(r.fieldName),e.setValue(this.feature,r.fieldName,null)}}else if(f(s)){null!==this.feature.getAttribute(s.fieldName)&&t.add(s.fieldName),e.setValue(this.feature,s.fieldName,null)}}}if("error"===h?.status){const e=new Set;for(const t of l){const r=this.expressionsModel.elementTemplateMap.get(t.elementId);if(r)switch(t.executorPurpose){case"editable":e.add(r.label+" - Editable expression");break;case"required":e.add(r.label+" - Required expression");break;case"value":e.add(r.label+" - Value expression");break;case"visibility":e.add(r.label+" - Visibility expression")}}if(e.size>0)throw new r("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")");throw new r("expression-evaluation-failed","Arcade evaluation failed ")}}}}function y(e,t,s,a){if(null===e)return null;const o=t.layer.fieldsIndex.get(s);if(!o)throw new r("field-not-found","Unable set field value as the field cannot be found. ("+s+")");switch(o.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":case"single":case"double":return h.toNumber(e);case"global-id":case"guid":case"string":return h.toString(e);case"date":{if(h.isDate(e))return e.getTime();const t=h.toDate(e,a);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.getTime()}case"date-only":{if(h.isDateOnly(e))return e.toStorageFormat();if(h.isDate(e))return u.fromDateTime(e.toDateTime()).toStorageFormat();const t=u.fromString(h.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageFormat()}case"time-only":{if(h.isTime(e))return e.toStorageString();if(h.isDate(e)){return c.fromDateTime(e.toDateTime()).toStorageString()}const t=c.fromString(h.toString(e));if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type.");return t.toStorageString()}case"timestamp-offset":{if(h.isDate(e))return e.toISOString(!1);const t=h.toDate(e,a);if(!t)throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")");return t.toISOString(!1)}}throw new r("unsupported-value-type","Arcade return type is not a supported field type. ("+s+")")}function x(e){return e.components}function v(e){return Array.from(e.geometryReferences)}function b(e){return Array.from(e.originalFeatureReferences)}export{m as ExpressionsManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e,addMany as t,pushIfSome as n}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import s from"../../../core/Queue.js";import{addMany as r,last as i}from"../../../core/SetUtils.js";import{isFieldElementTemplate as
|
|
2
|
+
import{isSome as e,addMany as t,pushIfSome as n}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import s from"../../../core/Queue.js";import{addMany as r,last as i}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";let c=0;class l{constructor(e){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.executorMap=e.executorMap,this.preserveFieldValuesWhenHidden=!0===e.preserveFieldValuesWhenHidden,this.elementTemplateMap=new Map;for(const t of this.executorMap.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph()}_buildDependencyGraph(){const e=x(this.executorMap),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...this.executorMap.keys()].map(e=>[e.elementId,e])),executorMap:this.executorMap,fieldElementTemplateMap:f(this.executorMap),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:e,nodeStack:new s(i),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const n of this.executorMap.keys()){const e=this.executorMap.get(n);e.editableExpression&&o(this.arcadeExecutorUses,e.editableExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"editable"}),e.valueExpression&&o(this.arcadeExecutorUses,e.valueExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"value"}),e.visibilityExpression&&o(this.arcadeExecutorUses,e.visibilityExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"visibility"}),e.requiredExpression&&o(this.arcadeExecutorUses,e.requiredExpression,()=>[]).push({elementId:n.elementId,executorPurpose:"required"}),e.textExpressions&&e.textExpressions.forEach((e,t)=>{o(this.arcadeExecutorUses,e,()=>[]).push({elementId:n.elementId,executorPurpose:"text",textExpressionIndex:t})})}for(const n of this.arcadeExecutorUses.values())n.sort(e=>"editable"===e.executorPurpose?-1:1);for(const n of e.values())-1===n.index&&p(n,t);this.dependencyGraphComponents=m(e),this.fieldReferencesMap=h(t),this.geometryReferences=M(t.geometryReferences,e),this.originalFeatureReferences=M(t.originalFeatureReferences,e),this.components=t.components}}function p(e,t){e.index=e.lowlink=t.nextIndex++,t.nodeStack.push(e);for(const n of d(e,t))-1===n.index?(p(n,t),e.lowlink=Math.min(e.lowlink,n.lowlink)):n.index<e.index&&t.nodeStack.contains(n)&&(e.lowlink=Math.min(e.lowlink,n.index)),t.nodeStack.contains(n)||e.crossLinkNeighbors.add(n);if(e.lowlink===e.index){const n=E();for(t.components.push(n);w(t.nodeStack)>=e.index;){const e=t.nodeStack.pop();if(null!=e){e.component=n,n.executors.add(e.executor);for(const t of e.crossLinkNeighbors)null!=t.component&&n.adjacencyList.add(t.component)}}}}function d({executor:t},n){const s=new Set;for(const e of t.fieldsUsed){const i=e.toLowerCase();o(n.fieldReferencesMap,i,()=>new Set).add(t),r(s,u(i,n))}t.geometryUsed&&n.geometryReferences.add(t),t.variablesUsed.includes("$originalfeature")&&n.originalFeatureReferences.add(t);const i=n.arcadeExecutorUses.get(t)?.filter(e=>"value"===e.executorPurpose)??[];for(const e of i){const o=n.executorMap.get(n.elementTemplatesById.get(e.elementId));o?.editableExpression&&o.editableExpression!==t&&s.add(o.editableExpression)}return Array.from(s).map(e=>n.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:t,fieldElementTemplateMap:o,shouldConsiderVisibility:s}){const r=[],i=o.get(e);if(null==i)return r;const a=t.get(i);if(null==a)return r;if(n(r,a.editableExpression),n(r,a.valueExpression),s){n(r,a.visibilityExpression);const{group:e}=i;if(null!=e){const o=t.get(e)?.visibilityExpression;n(r,o)}}return r}function f(e){const t=new Map;for(const n of e.keys())a(n)&&t.set(n.fieldName.toLowerCase(),n);return t}function x(n){const o=Array.from(n.values()).filter(e),s=new Set(o.flatMap(e=>{const{textExpressions:n,...o}=e,s=[];return n?.length&&t(s,n),t(s,Object.values(o)),s})),r=Array.from(s).map(e=>({component:null,crossLinkNeighbors:new Set,executor:e,index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function m(e){return new Map([...e.values()].map(({component:e,executor:t})=>[t,e]))}function h({fieldReferencesMap:e,nodeInfoMap:t}){const n=new Map;for(const[o,s]of e.entries())n.set(o,M(s,t));return n}function M(e,t){const n=new Set;for(const o of e){const e=t.get(o);e?.component&&n.add(e.component)}return n}function E(){c++;const e=c.toString();return{executors:new Set,adjacencyList:new Set,componentId:e}}function w(e){return e.peek()?.index??-1}export{l as ExpressionsModel,d as getDirectDependencies};
|
|
@@ -3,6 +3,7 @@ import type Accessor from "../../../core/Accessor.js";
|
|
|
3
3
|
import type AttachmentElementInput from "./AttachmentElementInput.js";
|
|
4
4
|
import type EditableInput from "./EditableInput.js";
|
|
5
5
|
import type FieldInput from "./FieldInput.js";
|
|
6
|
+
import type GroupInput from "./GroupInput.js";
|
|
6
7
|
import type { FormInput } from "./types.js";
|
|
7
8
|
|
|
8
9
|
export interface BatchFormInputsProperties {}
|
|
@@ -20,6 +21,8 @@ export default class BatchFormInputs extends Accessor {
|
|
|
20
21
|
get allEditableInputs(): EditableInput[];
|
|
21
22
|
/** Returns an array of all the field inputs in the form, including those in groups. */
|
|
22
23
|
get allFieldInputs(): FieldInput[];
|
|
24
|
+
/** Returns an array of all group inputs in the form. */
|
|
25
|
+
get allGroupInputs(): GroupInput[];
|
|
23
26
|
/** The description for the form. */
|
|
24
27
|
get description(): string | null;
|
|
25
28
|
/** An array of field or group inputs that make up the [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/). */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{destroyMaybe as l}from"../../../core/maybe.js";import{property as i,subclass as n}from"../../../core/accessorSupport/decorators.js";import{deepFilterInputs as r,isGroupInput as s,isFieldInput as p,isAttachmentElementInput as o,isEditableInput as u,isUtilityNetworkAssociationsElementInput as a}from"./support/inputUtils.js";let d=class extends e{constructor(t){super(t),this.inputs=[],this.template=null}destroy(){this.inputs.forEach(t=>l(t))}get allFieldInputs(){return r(this.inputs,p)}get allAttachmentElementInputs(){return r(this.inputs,o)}get allEditableInputs(){return r(this.inputs,u)}get allGroupInputs(){return this.inputs.filter(s)}get allUtilityNetworkAssociationsElementInputs(){return r(this.inputs,a)}get description(){return this.template?.description??null}get hasInvalidHiddenInputs(){return this.invalidHiddenInputs.length>0}get invalidFeatures(){return Array.from(new Set(this.allFieldInputs.flatMap(t=>t.invalidFeatures)))}get invalidHiddenInputs(){return this.allFieldInputs.filter(t=>!t.valid&&!t.effectiveVisible)}get title(){return this.template?.title??null}get valid(){return this.allEditableInputs.every(t=>t.valid)}};t([i()],d.prototype,"allFieldInputs",null),t([i()],d.prototype,"allAttachmentElementInputs",null),t([i()],d.prototype,"allEditableInputs",null),t([i()],d.prototype,"allGroupInputs",null),t([i()],d.prototype,"allUtilityNetworkAssociationsElementInputs",null),t([i()],d.prototype,"description",null),t([i()],d.prototype,"inputs",void 0),t([i()],d.prototype,"hasInvalidHiddenInputs",null),t([i()],d.prototype,"invalidFeatures",null),t([i()],d.prototype,"invalidHiddenInputs",null),t([i()],d.prototype,"template",void 0),t([i()],d.prototype,"title",null),t([i()],d.prototype,"valid",null),d=t([n("esri.widgets.BatchAttributeForm.inputs.BatchFormInputs")],d);const m=d;export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as c,isTimeOnlyField as m,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as b}from"../../../smartMapping/support/utils.js";import{isNumber as x}from"../../../support/guards.js";import v from"./EditableInput.js";import{visibilityCodeToBoolean as F,differentValuesString as V,isFieldInputWithShowNoValueOptionInput as O}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as E,getMaxLength as S,getMinLength as w,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return p(e)?"number":c(e)?"text":b(e)||m(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(g(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return F(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&o(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:V}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.multipleChoiceOtherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===M?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!E(e)),indeterminate:t.some(e=>!E(e))&&t.some(e=>E(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(_,e,()=>new Map):new Map}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!O(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return O(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return S({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=s(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>E(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:V}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===V||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&k(t)?t.getTime():null,min:null!=l&&k(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=s(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:x(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:x(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,s=x(o)&&a&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:s?o:e,min:h?n:t,rawMax:s?a:i,rawMin:h?u:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const a of this.features){const{layer:s}=a,u=s.getField(t)??this.field,h=s.getFieldDomain(t,{feature:a.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(a),m=a.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c})??this.getExternalErrorForFeature?.(a,t);d&&o.push({error:d,feature:a.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new a({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return f(l)||m(l)||C(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),a=this._getValidRangeValue(l.max,1/0),s=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(o)||m(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([l()],N.prototype,"dataType",null),e([l()],N.prototype,"domain",null),e([l()],N.prototype,"distinctValues",null),e([l()],N.prototype,"editable",null),e([l()],N.prototype,"label",null),e([l()],N.prototype,"effectiveVisible",null),e([l()],N.prototype,"effectiveVisibilityCode",null),e([l()],N.prototype,"errors",null),e([l()],N.prototype,"featuresHaveSameValue",null),e([l()],N.prototype,"field",null),e([l()],N.prototype,"fieldName",null),e([l()],N.prototype,"getExternalErrorForFeature",void 0),e([l()],N.prototype,"getFieldValueOptionsForFeature",void 0),e([l()],N.prototype,"group",void 0),e([l()],N.prototype,"input",null),e([l()],N.prototype,"multipleChoiceInput",null),e([l()],N.prototype,"multipleChoiceChoices",null),e([l()],N.prototype,"multipleChoiceValues",null),e([l()],N.prototype,"multipleChoiceOtherChoiceFieldName",null),e([l()],N.prototype,"multipleChoiceOtherChoiceHint",null),e([l()],N.prototype,"multipleChoiceOtherChoiceLabel",null),e([l()],N.prototype,"hasMultipleChoiceOtherChoiceField",null),e([l()],N.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([l()],N.prototype,"multipleChoiceOtherChoiceValue",null),e([l()],N.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([l()],N.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([l()],N.prototype,"invalidFeatures",null),e([l()],N.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([l()],N.prototype,"isSubtypeField",null),e([l()],N.prototype,"showNoValueOptionEnabled",null),e([l()],N.prototype,"showNoValueLabel",null),e([l()],N.prototype,"includeTime",null),e([l()],N.prototype,"includeTimeOffset",null),e([l()],N.prototype,"maxLength",null),e([l()],N.prototype,"minLength",null),e([l()],N.prototype,"range",null),e([l()],N.prototype,"required",null),e([l()],N.prototype,"submittable",null),e([l({readOnly:!0})],N.prototype,"type",void 0),e([l()],N.prototype,"userHasChangedValue",void 0),e([l()],N.prototype,"valid",null),e([l()],N.prototype,"value",null),e([l()],N.prototype,"visibilityCode",null),e([l()],N.prototype,"codedValueDomainOptions",null),e([l()],N.prototype,"codedValueOptions",null),e([l()],N.prototype,"_evaluatedRequiredExpression",null),e([l()],N.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([l()],N.prototype,"_allDomains",null),e([l()],N.prototype,"_fieldShouldHaveDomain",null),e([l()],N.prototype,"_dateFormRange",null),e([l()],N.prototype,"_dateRange",null),N=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],N);const L=N;export{L as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as c,isTimeOnlyField as m,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as x}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import v from"./EditableInput.js";import{visibilityCodeToBoolean as F,differentValuesString as O,isFieldInputWithShowNoValueOptionInput as V}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as E,getMaxLength as S,getMinLength as w,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return p(e)?"number":c(e)?"text":x(e)||m(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(g(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return F(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&o(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:O}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.multipleChoiceOtherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===M?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!E(e)),indeterminate:t.some(e=>!E(e))&&t.some(e=>E(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(_,e,()=>new Map):new Map}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!V(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return V(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return S({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=s(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:O}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===O||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&k(t)?t.getTime():null,min:null!=l&&k(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=s(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:b(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:b(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,s=b(o)&&a&&(null==e||o<e),h=b(n)&&u&&(null==t||n>t);return{max:s?o:e,min:h?n:t,rawMax:s?a:i,rawMin:h?u:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const a of this.features){const{layer:s}=a,u=s.getField(t)??this.field,h=s.getFieldDomain(t,{feature:a.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(a),m=a.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c})??this.getExternalErrorForFeature?.(a,t);d&&o.push({error:d,feature:a.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new a({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return f(l)||m(l)||C(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),a=this._getValidRangeValue(l.max,1/0),s=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(o)||m(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([l()],N.prototype,"dataType",null),e([l()],N.prototype,"domain",null),e([l()],N.prototype,"distinctValues",null),e([l()],N.prototype,"editable",null),e([l()],N.prototype,"label",null),e([l()],N.prototype,"effectiveVisible",null),e([l()],N.prototype,"effectiveVisibilityCode",null),e([l()],N.prototype,"errors",null),e([l()],N.prototype,"featuresHaveSameValue",null),e([l()],N.prototype,"field",null),e([l()],N.prototype,"fieldName",null),e([l()],N.prototype,"getExternalErrorForFeature",void 0),e([l()],N.prototype,"getFieldValueOptionsForFeature",void 0),e([l()],N.prototype,"group",void 0),e([l()],N.prototype,"input",null),e([l()],N.prototype,"multipleChoiceInput",null),e([l()],N.prototype,"multipleChoiceChoices",null),e([l()],N.prototype,"multipleChoiceValues",null),e([l()],N.prototype,"multipleChoiceOtherChoiceFieldName",null),e([l()],N.prototype,"multipleChoiceOtherChoiceHint",null),e([l()],N.prototype,"multipleChoiceOtherChoiceLabel",null),e([l()],N.prototype,"hasMultipleChoiceOtherChoiceField",null),e([l()],N.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([l()],N.prototype,"multipleChoiceOtherChoiceValue",null),e([l()],N.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([l()],N.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([l()],N.prototype,"invalidFeatures",null),e([l()],N.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([l()],N.prototype,"isSubtypeField",null),e([l()],N.prototype,"showNoValueOptionEnabled",null),e([l()],N.prototype,"showNoValueLabel",null),e([l()],N.prototype,"includeTime",null),e([l()],N.prototype,"includeTimeOffset",null),e([l({readOnly:!0})],N.prototype,"inputType",null),e([l()],N.prototype,"maxLength",null),e([l()],N.prototype,"minLength",null),e([l()],N.prototype,"range",null),e([l()],N.prototype,"required",null),e([l({readOnly:!0})],N.prototype,"type",void 0),e([l()],N.prototype,"userHasChangedValue",void 0),e([l()],N.prototype,"valid",null),e([l()],N.prototype,"value",null),e([l()],N.prototype,"visibilityCode",null),e([l()],N.prototype,"codedValueDomainOptions",null),e([l()],N.prototype,"codedValueOptions",null),e([l()],N.prototype,"_evaluatedRequiredExpression",null),e([l()],N.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([l()],N.prototype,"_allDomains",null),e([l()],N.prototype,"_fieldShouldHaveDomain",null),e([l()],N.prototype,"_dateFormRange",null),e([l()],N.prototype,"_dateRange",null),N=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],N);const T=N;export{T as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{property as
|
|
2
|
+
import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../core/maybe.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import o from"./InputBase.js";import{visibilityCodeToBoolean as r}from"./support/inputUtils.js";let p=class extends o{constructor(t){super(t),this.inputs=[],this.type="group"}initialize(){for(const t of this.inputs)t.group=this}destroy(){this.inputs.forEach(t=>e(t))}get open(){return"expanded"===this.template.initialState}set open(t){this._override("open",t)}get visible(){return r(this.visibilityCode)&&this.inputs.some(t=>t.visible)}visibleForFeature(t){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression)return!0;const e=this._lookupEvaluatedExpression(t,"visibility");return"success"===e?.status&&!0===e.result}};t([i()],p.prototype,"inputs",void 0),t([i({readOnly:!0})],p.prototype,"type",void 0),t([i()],p.prototype,"open",null),t([i()],p.prototype,"visible",null),p=t([s("esri.widgets.BatchAttributeForm.inputs.GroupInput")],p);const n=p;export{n as default};
|