@arcgis/core 5.1.0-next.111 → 5.1.0-next.113

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.
Files changed (323) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +5 -0
  4. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  5. package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
  6. package/analysis/ShadowCastAnalysis.d.ts +8 -5
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/Pixel.js +1 -1
  10. package/arcade/Voxel.js +1 -1
  11. package/arcade/arcade.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeEnvironment.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/containerUtils.js +1 -1
  18. package/arcade/debug.js +1 -1
  19. package/arcade/enum.js +1 -1
  20. package/arcade/executionError.js +1 -1
  21. package/arcade/functions/convertdirection.js +1 -1
  22. package/arcade/functions/date.js +1 -1
  23. package/arcade/functions/feature.js +1 -1
  24. package/arcade/functions/featuresetbase.js +1 -1
  25. package/arcade/functions/featuresetgeom.js +1 -1
  26. package/arcade/functions/featuresetstats.js +1 -1
  27. package/arcade/functions/featuresetstring.js +1 -1
  28. package/arcade/functions/geomasync.js +1 -1
  29. package/arcade/functions/geometry.js +1 -1
  30. package/arcade/functions/geomsync.js +1 -1
  31. package/arcade/functions/knowledgegraph.js +1 -1
  32. package/arcade/functions/maths.js +1 -1
  33. package/arcade/functions/stats.js +1 -1
  34. package/arcade/functions/string.js +1 -1
  35. package/arcade/functions/track.js +1 -1
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/unitConversion.js +1 -1
  39. package/arcade.js +1 -1
  40. package/assets/components/assets/icon/returnToDefault16.json +1 -0
  41. package/assets/components/assets/icon/returnToDefault24.json +1 -0
  42. package/assets/components/assets/icon/returnToDefault32.json +1 -0
  43. package/assets/components/assets/icon/reviewMap16.json +1 -0
  44. package/assets/components/assets/icon/reviewMap24.json +1 -0
  45. package/assets/components/assets/icon/reviewMap32.json +1 -0
  46. package/assets/esri/core/workers/RemoteClient.js +1 -1
  47. package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 02c0640005b09007bb70.js} +1 -1
  48. package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
  49. package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
  54. package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
  55. package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
  56. package/assets/esri/core/workers/chunks/{beff5b4e15edee12bd4c.js → 271e42b7cd3c3441839e.js} +3 -3
  57. package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
  59. package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +2 -0
  60. package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
  61. package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +2 -0
  62. package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 52a91c314afec70199bc.js} +1 -1
  65. package/assets/esri/core/workers/chunks/5c6742728fa705d2e16e.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
  70. package/assets/esri/core/workers/chunks/701125f6cdd91ff3655f.js +2 -0
  71. package/assets/esri/core/workers/chunks/7995e6983456c779adf9.js +1 -0
  72. package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
  73. package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +1 -0
  74. package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
  75. package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
  77. package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
  78. package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
  79. package/assets/esri/core/workers/chunks/9a11ff75009fef45b8c1.js +1 -0
  80. package/assets/esri/core/workers/chunks/a70fa35b2d19460637e9.js +2 -0
  81. package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
  82. package/assets/esri/core/workers/chunks/ae74f722fb385e45fcf1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b4badbcf1bdb7823d825.js} +1 -1
  84. package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +1 -0
  85. package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
  86. package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
  87. package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
  88. package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
  89. package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
  90. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
  91. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
  92. package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
  93. package/assets/esri/core/workers/chunks/e95ce76b5b816256a519.js +1 -0
  94. package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
  95. package/assets/esri/core/workers/chunks/fbcf09526dc1bbe94b91.js +2 -0
  96. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +22 -6
  97. package/assets/esri/themes/dark/main.css +1 -1
  98. package/assets/esri/themes/light/main.css +1 -1
  99. package/assets/esri/themes/light/view.css +1 -1
  100. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  101. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  102. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  105. package/assets/esri/widgets/Features/t9n/Features_en.json +1 -1
  106. package/chunks/GaussianSplatShadow.glsl.js +11 -9
  107. package/chunks/ShadowCastVisualize.glsl.js +26 -18
  108. package/chunks/aiServices.js +1 -1
  109. package/chunks/arcade.js +1 -1
  110. package/chunks/array.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/config.js +1 -1
  113. package/identity/IdentityModal.js +1 -1
  114. package/kernel.js +1 -1
  115. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  116. package/layers/KnowledgeGraphLayer.d.ts +6 -4
  117. package/layers/KnowledgeGraphLayer.js +1 -1
  118. package/layers/LinkChartLayer.js +1 -1
  119. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  120. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  121. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  122. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  123. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  124. package/layers/support/SceneModification.js +1 -1
  125. package/layers/support/SceneModifications.js +1 -1
  126. package/layers/support/featureLayerUtils.js +1 -1
  127. package/layers/support/parquetUtils.js +1 -1
  128. package/linkChart/LinkChartProperties.js +1 -1
  129. package/linkChart/utils.js +1 -1
  130. package/package.json +2 -2
  131. package/renderers/ClassBreaksRenderer.js +1 -1
  132. package/renderers/UniqueValueRenderer.js +1 -1
  133. package/rest/support/TranslateContent.js +1 -1
  134. package/rest/support/TranslateParameters.js +1 -1
  135. package/rest/support/TranslateResult.js +1 -1
  136. package/rest/translate.js +1 -1
  137. package/rest/utils.js +1 -1
  138. package/support/arcadeUtils.js +1 -1
  139. package/support/revision.js +1 -1
  140. package/symbols/cim/types.d.ts +45 -1
  141. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  146. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  147. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  148. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  149. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  153. package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
  154. package/views/3d/environment/EnvironmentManager.js +1 -1
  155. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  156. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  158. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  159. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  160. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  161. package/views/3d/state/utils/navigationUtils.js +1 -1
  162. package/views/3d/support/QualityProfile.js +1 -1
  163. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  164. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
  165. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  166. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  167. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  168. package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
  169. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  170. package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
  171. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  172. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  173. package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
  174. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  175. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  176. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  177. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  178. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  179. package/views/DOMContainer.d.ts +2 -0
  180. package/views/LinkChartView.d.ts +47 -0
  181. package/views/MapView.d.ts +1 -85
  182. package/views/VideoView.d.ts +8 -1
  183. package/views/View2D.d.ts +78 -2
  184. package/views/draw/support/Reshape.js +1 -1
  185. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  186. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  187. package/views/types.d.ts +2 -3
  188. package/views/ui/DefaultUI.d.ts +1 -0
  189. package/widgets/Attachments.js +1 -1
  190. package/widgets/BasemapGallery.js +1 -1
  191. package/widgets/BasemapLayerList.js +1 -1
  192. package/widgets/BasemapToggle.js +1 -1
  193. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +17 -3
  194. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  195. package/widgets/BatchAttributeForm/css.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
  197. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  198. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  199. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +46 -1
  200. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  201. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  202. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  203. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  204. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  205. package/widgets/BatchAttributeForm/types.d.ts +1 -1
  206. package/widgets/BatchAttributeForm.d.ts +2 -1
  207. package/widgets/BatchAttributeForm.js +1 -1
  208. package/widgets/Bookmarks.js +1 -1
  209. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  210. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  211. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  212. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  213. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  214. package/widgets/CatalogLayerList.js +1 -1
  215. package/widgets/Compass.js +1 -1
  216. package/widgets/CoordinateConversion.js +1 -1
  217. package/widgets/Daylight.js +1 -1
  218. package/widgets/DirectionalPad.js +1 -1
  219. package/widgets/Directions.js +1 -1
  220. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  221. package/widgets/Editor/UpdateWorkflow.js +1 -1
  222. package/widgets/Editor/components/FeatureList.js +1 -1
  223. package/widgets/Editor/components/FooterActions.js +1 -1
  224. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  225. package/widgets/Editor/components/Prompt.js +1 -1
  226. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  227. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  228. package/widgets/ElevationProfile.js +1 -1
  229. package/widgets/Expand.js +1 -1
  230. package/widgets/Feature/FeatureMedia.js +1 -1
  231. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  232. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  233. package/widgets/FeatureForm/RelationshipInput.d.ts +3 -3
  234. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  235. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  236. package/widgets/FeatureForm.js +1 -1
  237. package/widgets/FeatureTable.js +1 -1
  238. package/widgets/Features/FeaturesDrillIn.js +1 -1
  239. package/widgets/Features.js +1 -1
  240. package/widgets/FloorFilter.js +1 -1
  241. package/widgets/FovOverlay.js +1 -1
  242. package/widgets/Fullscreen.js +1 -1
  243. package/widgets/Home.js +1 -1
  244. package/widgets/LayerList/LayerListItem.js +1 -1
  245. package/widgets/LayerList.js +1 -1
  246. package/widgets/Locate.js +1 -1
  247. package/widgets/NavigationToggle.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  249. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  250. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  251. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  252. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  253. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  254. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  255. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  256. package/widgets/OrientedImageryViewer.js +1 -1
  257. package/widgets/PanoramicVideoViewer.js +1 -1
  258. package/widgets/Print.js +1 -1
  259. package/widgets/Search.js +1 -1
  260. package/widgets/Sketch/SketchViewModel.js +1 -1
  261. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  262. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  263. package/widgets/Sketch.js +1 -1
  264. package/widgets/Slice.js +1 -1
  265. package/widgets/Slider.js +1 -1
  266. package/widgets/Swipe.js +1 -1
  267. package/widgets/TableList.js +1 -1
  268. package/widgets/TimeSlider.js +1 -1
  269. package/widgets/TimeZoneLabel.js +1 -1
  270. package/widgets/Track.js +1 -1
  271. package/widgets/UtilityNetworkAssociations.js +1 -1
  272. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  273. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  274. package/widgets/UtilityNetworkTrace.js +1 -1
  275. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  276. package/widgets/ValuePicker.js +1 -1
  277. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  278. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  279. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  280. package/widgets/Weather.js +1 -1
  281. package/widgets/Zoom.js +1 -1
  282. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  283. package/widgets/support/ColorPicker.js +1 -1
  284. package/widgets/support/ContingentValuesManager.js +1 -1
  285. package/widgets/support/FilterBuilder.js +1 -1
  286. package/widgets/support/GridControls.js +1 -1
  287. package/widgets/support/ItemList.js +1 -1
  288. package/widgets/support/LabeledSwitch.js +1 -1
  289. package/widgets/support/SelectionList.js +1 -1
  290. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +66 -6
  291. package/widgets/support/SelectionToolbar/types.d.ts +20 -1
  292. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
  293. package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
  294. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
  295. package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
  296. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
  297. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
  298. package/assets/esri/core/workers/chunks/55334ad3618899cdbf78.js +0 -2
  299. package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
  300. package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
  301. package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
  302. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
  303. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
  304. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
  305. package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +0 -1
  306. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
  307. package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
  308. package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
  309. package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +0 -1
  310. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
  311. package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
  312. package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
  313. package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
  314. package/assets/esri/core/workers/chunks/d00b9c1fd0865bf8f317.js +0 -1
  315. package/assets/esri/core/workers/chunks/deab352545c34cac148c.js +0 -1
  316. package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
  317. package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
  318. package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
  319. /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → 32f128a1615d71bbe899.js.LICENSE.txt} +0 -0
  320. /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 40df608337d562553ce1.js.LICENSE.txt} +0 -0
  321. /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 701125f6cdd91ff3655f.js.LICENSE.txt} +0 -0
  322. /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → a70fa35b2d19460637e9.js.LICENSE.txt} +0 -0
  323. /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → fbcf09526dc1bbe94b91.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import a from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import n from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as i}from"../../../core/uuid.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as c}from"../../../layers/support/layerUtils.js";import h from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentTypeCategory as m}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentUrl as d}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as p}from"../batchAttributeFormUtils.js";import u from"./EditableInput.js";import g from"./SingleFeatureInputAdapter.js";let y=-1,f=class extends u{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new g({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new e,this._stagedDeletes=new r,this._stagedUpdates=new n,this._temporaryAttachmentUrls=new n}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount;return null!=t&&this.attachments.length>=t}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const{input:t}=this,e=new Set;if(!t)return e;if("attachment"===t.type){const{inputTypes:a}=t;if(!a||0===a.length)return e;for(const t of a)_(e,t.type);return e}return _(e,t.type),e}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=c(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.attachments.length,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,s=this.hasAttachmentChanges;return!(t<e||t>a)||!s}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._recomputeAttachments()}clearAttachmentChanges(){this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._recomputeAttachments()}stageAddAttachment(t){const{contentType:e,data:a,name:s}=t,n=t.globalId??i(),r=a instanceof Blob?a.size:void 0,o=s.trim(),l=new h({contentType:e??void 0,globalId:n,id:y--,keywords:this.attachmentKeyword??void 0,name:o,size:r});return this._setTemporaryAttachmentUrl(n,a),this._stagedAdds.add({globalId:n,info:l,data:a}),this._recomputeAttachments(),l}async stageAddAttachments(t,e){const a=t.filter(t=>this.isFileAllowed(t));if(0===a.length)return[];const s=[],n=new Map,r=Date.now();for(let i=0;i<a.length;i++){const t=a[i],o=t instanceof File?t.name:`attachment-${r}_${i+1}`,l=await this._computeAttachmentFilename(o,e),c=this._makeUniqueFilenameForOperation(n,l);s.push(this.stageAddAttachment({contentType:t.type,data:t,name:c}))}return s}findAttachment(t){if(t)return this.attachments.find(e=>e.globalId===t)}getAttachmentPreviewUrl(t,e){return(t.globalId?this._temporaryAttachmentUrls.get(t.globalId):void 0)??d(t,this.supportsResize,e)}isFileAllowed(t){if(!t.type)return!0;const{categories:e}=this;return!e.size||e.has(m(t.type))}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedUpdates.delete(e),this._stagedDeletes.add(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=t.globalId;if(!a)return;const s=this._stagedAdds.find(t=>t.globalId===a);if(s)return s.info.name=e,void this._recomputeAttachments();const n=this._stagedUpdates.get(a);this._stagedUpdates.set(a,{...n,info:t,name:e}),this._recomputeAttachments()}async stageReplaceAttachment(t,e,a){const s=e instanceof File?e.name:t.name,n=await this._computeAttachmentFilename(s,a);this._stageReplaceAttachment(t,e,n)}toSubmitEdits(){const t=[],e=[],s=Array.from(this._stagedDeletes);if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===s.length)return null;const n=this._featureIdentifier;if(!n)return a.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const a of this._stagedAdds)t.push({feature:n,attachment:{globalId:a.globalId,contentType:a.info.contentType,data:a.data,name:a.info.name}});for(const[a,r]of this._stagedUpdates)e.push({feature:n,attachment:{globalId:a,contentType:r.contentType,data:r.data,name:r.name}});return{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:s,update:e}}_recomputeAttachments(){const t=this._stagedDeletes,e=[];for(const a of this._stagedAdds)e.push(a.info);for(const a of this._initialAttachments){const s=a.globalId;if(!s||!t.has(s)){if(s&&this._stagedUpdates.has(s)){const t=this._stagedUpdates.get(s),n=a.clone();null!=t.name&&(n.name=t.name),e.push(n);continue}e.push(a)}}this.attachments=e}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!p(e))return null;const a=e.objectIdField,s="globalIdField"in e?e.globalIdField:null,n=t.getGlobalId()??(s?t.getAttribute(s):void 0);if(n)return{globalId:n};const r=t.getObjectId()??t.getAttribute(a),i=Number(r);return null==r||isNaN(i)?null:{objectId:i}}async _computeAttachmentFilename(t,e){const n=this.template.filenameExpressionExecutor;if(!n)return t;const r=this.single.feature,i=r?.plainGraphic,o=this._expressionLayer,l={$originalfeature:r?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:i,$map:e.map},c={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=n.isAsync?await n.executeAsync(l,c):n.execute(l,c);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(h){s(h)||a.getLogger(this).error("Failed evaluating attachment filename expression",h)}return t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),s=t.get(a)??0;if(t.set(a,s+1),0===s)return e;const n=e.lastIndexOf(".");return`${n>0?e.slice(0,n):e}_${s}${n>0?e.slice(n):""}`}_stageReplaceAttachment(t,e,a){const s=t.globalId;if(!s)return;const n=this._stagedAdds.find(t=>t.globalId===s);if(n)return n.data=e,n.info.name=a,n.info.contentType=e.type,n.info.size=e.size,this._setTemporaryAttachmentUrl(s,e),void this._recomputeAttachments();const r=this._stagedUpdates.get(s);this._setTemporaryAttachmentUrl(s,e),this._stagedUpdates.set(s,{...r,info:t,contentType:e.type||r?.contentType,data:e,name:a}),this._recomputeAttachments()}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([o()],f.prototype,"allowUserRename",null),t([o({readOnly:!0})],f.prototype,"addDisabled",null),t([o({readOnly:!0})],f.prototype,"accept",null),t([o({readOnly:!0})],f.prototype,"categories",null),t([o()],f.prototype,"attachmentKeyword",null),t([o()],f.prototype,"attachments",void 0),t([o()],f.prototype,"displayFilename",null),t([o({readOnly:!0})],f.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([o({readOnly:!0})],f.prototype,"defaultPageAttachments",null),t([o()],f.prototype,"displayCount",void 0),t([o()],f.prototype,"feature",null),t([o()],f.prototype,"group",void 0),t([o({readOnly:!0})],f.prototype,"hasAttachmentChanges",null),t([o()],f.prototype,"input",null),t([o()],f.prototype,"layer",null),t([o()],f.prototype,"maxAttachmentCount",null),t([o()],f.prototype,"minAttachmentCount",null),t([o({readOnly:!0})],f.prototype,"single",void 0),t([o({readOnly:!0})],f.prototype,"type",void 0),t([o({readOnly:!0})],f.prototype,"supportsResize",null),t([o()],f.prototype,"useOriginalFilename",null),t([o({readOnly:!0})],f.prototype,"valid",null),t([o()],f.prototype,"_initialAttachments",void 0),t([o()],f.prototype,"_expressionLayer",null),t([o()],f.prototype,"_stagedAdds",void 0),t([o()],f.prototype,"_stagedDeletes",void 0),t([o()],f.prototype,"_stagedUpdates",void 0),t([o()],f.prototype,"_temporaryAttachmentUrls",void 0),t([o()],f.prototype,"_featureIdentifier",null),f=t([l("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],f);const A=f;function _(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}export{A as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../request.js";import a from"../../../core/Collection.js";import n from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as d}from"../../../core/uuid.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as h}from"../../../layers/support/layerUtils.js";import p from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentTypeCategory as c}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentUrl as m}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as g}from"../batchAttributeFormUtils.js";import u from"./EditableInput.js";import y from"./SingleFeatureInputAdapter.js";let f=-1,_=class extends u{constructor(t){super(t),this.attachments=[],this.displayCount=3,this.group=null,this.single=new y({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new a,this._stagedDeletes=new r,this._stagedUpdates=new i,this._failedStagedUpdateHydrations=new r,this._pendingStagedUpdateHydrations=new i,this._temporaryAttachmentUrls=new i}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount;return null!=t&&this.attachments.length>=t}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const{input:t}=this,e=new Set;if(!t)return e;if("attachment"===t.type){const{inputTypes:a}=t;if(!a||0===a.length)return e;for(const t of a)U(e,t.type);return e}return U(e,t.type),e}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=h(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.attachments.length,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,n=this.hasAttachmentChanges;return!(this._failedStagedUpdateHydrations.size>0)&&(!(t<e||t>a)||!n)}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearAttachmentChanges(){this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}stageAddAttachment(t){const{contentType:e,data:a,name:n}=t,s=t.globalId??d(),i=a instanceof Blob?a.size:void 0,r=n.trim(),o=new p({contentType:e??void 0,globalId:s,id:f--,keywords:this.attachmentKeyword??void 0,name:r,size:i});return this._setTemporaryAttachmentUrl(s,a),this._stagedAdds.add({globalId:s,info:o,data:a}),this._recomputeAttachments(),o}async stageAddAttachments(t,e){const a=t.filter(t=>this.isFileAllowed(t));if(0===a.length)return[];const n=[],s=new Map,i=Date.now();for(let r=0;r<a.length;r++){const t=a[r],d=t instanceof File?t.name:`attachment-${i}_${r+1}`,o=await this._computeAttachmentFilename(d,e),l=this._makeUniqueFilenameForOperation(s,o);n.push(this.stageAddAttachment({contentType:t.type,data:t,name:l}))}return n}findAttachment(t){if(t)return this.attachments.find(e=>e.globalId===t)}getAttachmentEditState(t){const e=t.globalId,a=e?this._getInitialAttachment(e):void 0,n=a?.name??null,s=e?this._stagedUpdates.get(e):void 0,i=s?.name??t.name??null;return{initialName:n,isDeleted:!!e&&this._stagedDeletes.has(e),isRenamed:null!=i&&null!=n&&i!==n,isReplaced:!!s?.data}}getAttachmentPreviewUrl(t,e){return(t.globalId?this._temporaryAttachmentUrls.get(t.globalId):void 0)??m(t,this.supportsResize,e)}async ensureStagedUpdateData(t){const e=t.globalId;if(!e)return!1;const a=this._stagedUpdates.get(e);if(!a||a.data||this._stagedDeletes.has(e))return this._failedStagedUpdateHydrations.delete(e),!1;const n=this._pendingStagedUpdateHydrations.get(e);if(n)return await n;const s=this._hydrateStagedUpdateData(t);this._pendingStagedUpdateHydrations.set(e,s);try{return await s}finally{this._pendingStagedUpdateHydrations.get(e)===s&&this._pendingStagedUpdateHydrations.delete(e)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedDeletes.delete(e),this._stagedUpdates.delete(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}isFileAllowed(t){if(!t.type)return!0;const{categories:e}=this;return!e.size||e.has(c(t.type))}isStagedAttachmentAddition(t){return"number"==typeof t.id&&t.id<0}stageDeleteAttachment(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedUpdates.delete(e),this._stagedDeletes.add(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=t.globalId;if(!a)return;const n=this._stagedAdds.find(t=>t.globalId===a);if(n)return n.info.name=e,void this._recomputeAttachments();const s=this._stagedUpdates.get(a),i=this._getInitialAttachment(a)?.name??null,r=null!=i&&e===i;if(r&&null==s?.data&&null==s?.contentType&&null==s?.size)return this._stagedUpdates.delete(a),this._failedStagedUpdateHydrations.delete(a),this._pendingStagedUpdateHydrations.delete(a),void this._recomputeAttachments();const d={...s,info:t};r?delete d.name:d.name=e,this._stagedUpdates.set(a,d),this._recomputeAttachments(),this.ensureStagedUpdateData(t)}async stageReplaceAttachment(t,e,a){if(!this.isFileAllowed(e))return!1;const n=e instanceof File?e.name:t.name,s=await this._computeAttachmentFilename(n,a);return this._stageReplaceAttachment(t,e,s),!0}toSubmitEdits(){const t=[],e=[],a=Array.from(this._stagedDeletes);if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===a.length)return null;const s=this._featureIdentifier;if(!s)return n.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const n of this._stagedAdds)t.push({feature:s,attachment:{globalId:n.globalId,contentType:n.info.contentType,data:n.data,name:n.info.name}});for(const[n,i]of this._stagedUpdates)this._canSubmitStagedUpdate(i)&&e.push({feature:s,attachment:{globalId:n,contentType:i.contentType,data:i.data,name:i.name}});return 0===t.length&&0===e.length&&0===a.length?null:{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:a,update:e}}_recomputeAttachments(){const t=this._stagedDeletes,e=[];for(const a of this._stagedAdds)e.push(a.info);for(const a of this._initialAttachments){const n=a.globalId;if(!n||!t.has(n)){if(n&&this._stagedUpdates.has(n)){const t=this._stagedUpdates.get(n),s=a.clone();null!=t.name&&(s.name=t.name),null!=t.contentType&&(s.contentType=t.contentType),null!=t.size&&(s.size=t.size),e.push(s);continue}e.push(a)}}this.attachments=e}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!g(e))return null;const a=e.objectIdField,n="globalIdField"in e?e.globalIdField:null,s=t.getGlobalId()??(n?t.getAttribute(n):void 0);if(s)return{globalId:s};const i=t.getObjectId()??t.getAttribute(a),r=Number(i);return null==i||isNaN(r)?null:{objectId:r}}async _computeAttachmentFilename(t,e){const a=this.template.filenameExpressionExecutor;if(!a)return t;const i=this.single.feature,r=i?.plainGraphic,d=this._expressionLayer,o={$originalfeature:i?.original,$editcontext:{editType:e.editType},$layer:d,$featureset:d,$datastore:d?.url,$feature:r,$map:e.map},l={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=a.isAsync?await a.executeAsync(o,l):a.execute(o,l);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(h){s(h)||n.getLogger(this).error("Failed evaluating attachment filename expression",h)}return t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),n=t.get(a)??0;if(t.set(a,n+1),0===n)return e;const s=e.lastIndexOf(".");return`${s>0?e.slice(0,s):e}_${n}${s>0?e.slice(s):""}`}_stageReplaceAttachment(t,e,a){const n=t.globalId;if(!n)return;const s=this._stagedAdds.find(t=>t.globalId===n);if(s)return s.data=e,s.info.name=a,s.info.contentType=e.type,s.info.size=e.size,this._setTemporaryAttachmentUrl(n,e),void this._recomputeAttachments();const i=this._stagedUpdates.get(n);this._setTemporaryAttachmentUrl(n,e),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._stagedUpdates.set(n,{...i,info:t,contentType:e.type||i?.contentType||t.contentType,data:e,name:a,size:e.size}),this._recomputeAttachments()}_getInitialAttachment(t){return this._initialAttachments.find(e=>e.globalId===t)}_canSubmitStagedUpdate(t){return null!=t.data}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}async _hydrateStagedUpdateData(t){const a=t.globalId,i=t.url;if(!a||!i)return!1;try{const{data:n}=await e(i,{responseType:"blob"});this._failedStagedUpdateHydrations.delete(a);const s=this._stagedUpdates.get(a);return!(!s||s.data||this._stagedDeletes.has(a))&&(this._stagedUpdates.set(a,{...s,info:t,contentType:s.contentType??t.contentType??n.type,data:n}),!0)}catch(r){const t=this._stagedUpdates.get(a);return!t||t.data||this._stagedDeletes.has(a)||this._failedStagedUpdateHydrations.add(a),s(r)||n.getLogger(this).error("Failed to fetch attachment data for staged update",r),!1}}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([o()],_.prototype,"allowUserRename",null),t([o({readOnly:!0})],_.prototype,"addDisabled",null),t([o({readOnly:!0})],_.prototype,"accept",null),t([o({readOnly:!0})],_.prototype,"categories",null),t([o()],_.prototype,"attachmentKeyword",null),t([o()],_.prototype,"attachments",void 0),t([o()],_.prototype,"displayFilename",null),t([o({readOnly:!0})],_.prototype,"allAttachmentsVisibleOnDefaultPage",null),t([o({readOnly:!0})],_.prototype,"defaultPageAttachments",null),t([o()],_.prototype,"displayCount",void 0),t([o()],_.prototype,"feature",null),t([o()],_.prototype,"group",void 0),t([o({readOnly:!0})],_.prototype,"hasAttachmentChanges",null),t([o({readOnly:!0})],_.prototype,"hasPendingAttachmentUpdateData",null),t([o()],_.prototype,"input",null),t([o()],_.prototype,"layer",null),t([o()],_.prototype,"maxAttachmentCount",null),t([o()],_.prototype,"minAttachmentCount",null),t([o({readOnly:!0})],_.prototype,"single",void 0),t([o({readOnly:!0})],_.prototype,"type",void 0),t([o({readOnly:!0})],_.prototype,"supportsResize",null),t([o()],_.prototype,"useOriginalFilename",null),t([o({readOnly:!0})],_.prototype,"valid",null),t([o()],_.prototype,"_initialAttachments",void 0),t([o()],_.prototype,"_expressionLayer",null),t([o()],_.prototype,"_stagedAdds",void 0),t([o()],_.prototype,"_stagedDeletes",void 0),t([o()],_.prototype,"_stagedUpdates",void 0),t([o()],_.prototype,"_failedStagedUpdateHydrations",void 0),t([o()],_.prototype,"_pendingStagedUpdateHydrations",void 0),t([o()],_.prototype,"_temporaryAttachmentUrls",void 0),t([o()],_.prototype,"_featureIdentifier",null),_=t([l("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],_);const A=_;function U(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/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 s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as a,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 V,differentValuesString as O,isFieldInputWithShowNoValueOptionInput as M}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as _,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as F}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as S,getMaxLength as w,getMinLength as E,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),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 V(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===_?"":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=>!S(e)),indeterminate:t.some(e=>!S(e))&&t.some(e=>S(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(F,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&&(!M(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return M(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 w({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return E({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=a(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=>S(e)))&&!!this.valid}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 e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===O||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}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=a(i,l);if(!r)return e;const{max:o,min:n,rawMax:s,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,a=x(o)&&s&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:a?o:e,min:h?n:t,rawMax:a?s:i,rawMin:h?u:l}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const l of this.features)l.getAttribute(i)!==e&&t.push(l);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.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 s({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),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,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,"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,"_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 A=N;export{A 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 s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as a,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 V,differentValuesString as O,isFieldInputWithShowNoValueOptionInput as F}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as S,getMaxLength as w,getMinLength as E,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),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 V(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=>!S(e)),indeterminate:t.some(e=>!S(e))&&t.some(e=>S(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&&(!F(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return F(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 w({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return E({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=a(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=>S(e)))&&!!this.valid}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=a(i,l);if(!r)return e;const{max:o,min:n,rawMax:s,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,a=x(o)&&s&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:a?o:e,min:h?n:t,rawMax:a?s:i,rawMin:h?u:l}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const l of this.features)l.getAttribute(i)!==e&&t.push(l);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.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 s({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),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,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,"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 A=N;export{A as default};
@@ -1,4 +1,5 @@
1
1
  import type Graphic from "../../../Graphic.js";
2
+ import type RelatedRecordsInfoFieldOrder from "../../../popup/support/RelatedRecordsInfoFieldOrder.js";
2
3
  import type EditableInput from "./EditableInput.js";
3
4
  import type GroupInput from "./GroupInput.js";
4
5
  import type { AttributeFormSupportedLayerUnion } from "../types.js";
@@ -17,6 +18,26 @@ export interface RelationshipElementInputProperties extends EditableInputPropert
17
18
  */
18
19
  export default class RelationshipElementInput extends EditableInput<any> {
19
20
  constructor(properties: RelationshipElementInputProperties);
21
+ /**
22
+ * A numeric value indicating the maximum number of related features to display in the list of related records.
23
+ * If the total amount of features is greater than the `displayCount`, a `Show all` button displays.
24
+ *
25
+ * @default 3
26
+ * @since 5.1
27
+ */
28
+ get displayCount(): number;
29
+ /**
30
+ * A string value indicating how to display related records within the relationship content.
31
+ * Currently, `list` is the only supported value.
32
+ *
33
+ * | Value | Description |
34
+ * | ----- | ----------- |
35
+ * | list | Shows a list of related records from the specified relationship. |
36
+ *
37
+ * @default "list"
38
+ * @since 5.1
39
+ */
40
+ get displayType(): string;
20
41
  /**
21
42
  * The single feature associated with this relationship element.
22
43
  *
@@ -31,7 +52,8 @@ export default class RelationshipElementInput extends EditableInput<any> {
31
52
  */
32
53
  get group(): GroupInput | null;
33
54
  /**
34
- * Identifies the single feature layer associated with this relationship element. The layer must support feature editing and field access.
55
+ * Identifies the single feature layer associated with this relationship element.
56
+ * The layer must support feature editing and field access.
35
57
  *
36
58
  * The following layer types are supported:
37
59
  * - [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
@@ -45,10 +67,33 @@ export default class RelationshipElementInput extends EditableInput<any> {
45
67
  * @see [BatchAttributeFormViewModel.layers](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/#layers)
46
68
  */
47
69
  get layer(): AttributeFormSupportedLayerUnion | null | undefined;
70
+ /**
71
+ * An array of [RelatedRecordsInfoFieldOrder](https://developers.arcgis.com/javascript/latest/references/core/popup/support/RelatedRecordsInfoFieldOrder/)
72
+ * objects indicating the field display order for the related records
73
+ * and whether they should be sorted in ascending `asc` or descending `desc` order.
74
+ *
75
+ * @since 5.1
76
+ */
77
+ get orderByFields(): RelatedRecordsInfoFieldOrder[] | null | undefined;
78
+ /**
79
+ * The numeric id value for the defined relationship.
80
+ * This value can be found on the [service](https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm)
81
+ * itself or on the service's [relationships resource](https://developers.arcgis.com/rest/services-reference/enterprise/relationships-feature-service-.htm)
82
+ * if `supportsRelationshipResource` is `true`.
83
+ *
84
+ * @since 5.1
85
+ */
86
+ get relationshipId(): number;
48
87
  /**
49
88
  * The type of input.
50
89
  *
51
90
  * @since 5.1
52
91
  */
53
92
  get type(): "relationship";
93
+ /**
94
+ * Indicates whether the form is currently updating.
95
+ *
96
+ * @since 5.1
97
+ */
98
+ get updating(): boolean;
54
99
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";import o from"./EditableInput.js";import p from"./SingleFeatureInputAdapter.js";let i=class extends o{constructor(t){super(t),this.group=null,this.single=new p({input:this}),this.type="relationship"}get feature(){return this.single.feature}get layer(){return this.single.layer}};t([e()],i.prototype,"feature",null),t([e()],i.prototype,"group",void 0),t([e()],i.prototype,"layer",null),t([e({readOnly:!0})],i.prototype,"single",void 0),t([e({readOnly:!0})],i.prototype,"type",void 0),i=t([r("esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput")],i);const s=i;export{s as default};
2
+ import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as r}from"../../../core/reactiveUtils.js";import{property as l,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as a,getEffectiveLayerCapabilities as o}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as s}from"../../../popup/support/featureUtils.js";import n from"./EditableInput.js";import p from"./SingleFeatureInputAdapter.js";import d from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";import{getComputedAttributes as u,parseFormTemplateString as h}from"../../FeatureForm/featureFormUtils.js";let y=class extends n{constructor(e){super(e),this._relationshipVM=new d,this.group=null,this.map=null,this.single=new p({input:this}),this.type="relationship"}initialize(){this._setRelationshipVMProps(),this.addHandles([r(()=>this.relatedLayer,"edits",()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){const{relatedLayer:e,_relationshipVM:t}=this;if(!a(e))return;const r=t?.categories,l=(e.subtypes??[]).map(({code:e,name:t})=>{const l=r?.find(e=>e.name===t);return{name:t,count:l?.count??0,value:l?.value??e}});return l.length?l:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){const{editable:e,relatedFeatureCount:t,relationship:r}=this;if(!r||!this.loaded||!this._relatedLayerAllowsAdds)return!1;if(this.allCategories?.length&&!this.activeCategory)return!1;const{cardinality:l,role:i}=r;return!("one-to-one"===l&&t>0)&&("many-to-many"!==l&&(!("one-to-many"===l&&"destination"===i&&t>0)&&e))}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return!!this._relatedLayerAllowsAdds&&(this._evaluatedEditableExpression??!0)}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this.template.label}get layer(){return this.single.layer}get loaded(){return"loading"!==this._relationshipVM?.state}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){return!!this.relationship&&null!=this.feature?.getAttribute(this.relationship.keyField)}get relationship(){return this._relationshipVM?.relationship}get relationshipId(){return this.template.relationshipId}get relatedFeatureInfos(){const{_relationshipVM:e,effectiveTimeZone:t}=this;if(!e?.relatedFeatures?.length||!e?.relatedLayer)return[];const{itemDescriptionFieldName:r,relatedFeatures:l,relatedLayer:i}=e,a=i?.formTemplate?.title||void 0;return l.map(e=>{let l;if(r){const a=e.getAttribute(r),o=i.fieldsIndex.get(r);if(o){const e=u({fields:[o],layer:i,values:[a],timeZone:t})[r];null!=e&&(l=e.toString())}}return{feature:e,description:l,title:a?h({attributes:e.attributes,label:a,layer:i,timeZone:t}):void 0}}).toArray()}get relatedLayer(){return this._relationshipVM?.relatedLayer}get relatedLayerIsTable(){return!!this.relatedLayer?.isTable}get showAllEnabled(){return this._relationshipVM.showAllEnabled}get showAllActionVisible(){return!this.showAllEnabled&&this.relatedFeatureCount>0&&this.relatedFeatureCount>this.displayCount}get showAllCategoriesVisible(){const e=this.allCategories?.length??0;return!this.showAllEnabled&&e>0&&e>this.displayCount}get updating(){return"loading"===this._relationshipVM?.state||"querying"===this._relationshipVM?.state}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}getRelatedFeatureByObjectId(e){return this._relationshipVM?.getRelatedFeatureByObjectId(e)}setActiveCategory(e){this._relationshipVM.activeCategory=e}setShowAllEnabled(e){this._relationshipVM.showAllEnabled=e}get _relatedLayerAllowsAdds(){const{relatedLayer:e}=this;if(!e||!this._relatedLayerAllowsEdits)return!1;const t=o(e);return!!t?.operations?.supportsAdd}get _relatedLayerAllowsEdits(){const{relatedLayer:e}=this;if(!e)return!1;const t=o(e);return!!t?.operations?.supportsEditing}_setRelationshipVMProps(){const{displayCount:e,feature:t,layer:r,orderByFields:l,map:i,relationshipId:a,showAllEnabled:o}=this;t&&r&&s(r)&&this._relationshipVM.set({displayCount:e,graphic:t.plainGraphic,layer:r,map:i,orderByFields:l,relationshipId:a,showAllEnabled:o})}};e([l()],y.prototype,"_relationshipVM",void 0),e([l()],y.prototype,"activeCategory",null),e([l()],y.prototype,"allCategories",null),e([l()],y.prototype,"categories",null),e([l()],y.prototype,"canAddRelatedFeature",null),e([l()],y.prototype,"displayCount",null),e([l()],y.prototype,"displayType",null),e([l()],y.prototype,"editable",null),e([l()],y.prototype,"feature",null),e([l()],y.prototype,"group",void 0),e([l()],y.prototype,"label",null),e([l()],y.prototype,"layer",null),e([l()],y.prototype,"loaded",null),e([l()],y.prototype,"map",void 0),e([l()],y.prototype,"orderByFields",null),e([l()],y.prototype,"originHasValidKey",null),e([l()],y.prototype,"relationship",null),e([l()],y.prototype,"relationshipId",null),e([l()],y.prototype,"relatedFeatureInfos",null),e([l()],y.prototype,"relatedLayer",null),e([l()],y.prototype,"relatedLayerIsTable",null),e([l({readOnly:!0})],y.prototype,"single",void 0),e([l()],y.prototype,"showAllEnabled",null),e([l()],y.prototype,"showAllActionVisible",null),e([l()],y.prototype,"showAllCategoriesVisible",null),e([l({readOnly:!0})],y.prototype,"type",void 0),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"_relatedLayerAllowsAdds",null),e([l()],y.prototype,"_relatedLayerAllowsEdits",null),y=e([i("esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput")],y);const g=y;export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ignoreAbortErrors as e}from"../../../core/promiseUtils.js";import{watch as i,sync as o,on as s}from"../../../core/reactiveUtils.js";import{generateUID as r}from"../../../core/uid.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isAssociationsLayerUnion as n}from"../batchAttributeFormUtils.js";import p from"./EditableInput.js";import u from"./SingleFeatureInputAdapter.js";import d from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";let y=class extends p{constructor(t){super(t),this._associatedLayer=null,this.featureItem=null,this.group=null,this.map=null,this.single=new u({input:this}),this.type="utilityNetworkAssociations",this.viewModel=new d({source:"featureForm"})}initialize(){this.viewModel.set({associationTypes:this.associationTypes,description:this.description,graphic:this.feature?.plainGraphic,layer:this.associationLayer,map:this.map,title:this.label}),this.addHandles([i(()=>this.associatedLayer,t=>this.showAllAssociatedFeatures(null!=t),o),s(()=>this._editableLayer,"edits",()=>this.refresh())])}get _editableLayer(){const{associatedLayer:t}=this;return"subtype-sublayer"===t?.type?t.parent:t}get activeAssociationType(){return this.viewModel.activeAssociationType}get associatedFeatures(){const{associatedLayer:t}=this;return t?this.associatedFeatureInfos.get(t):void 0}get associatedFeatureInfos(){const{utilityNetwork:t,viewModel:{associationFeatures:e}}=this,i=new Map;return e.size&&t?(e.forEach((t,e)=>{n(e)&&i.set(e,t)}),i):i}get associatedLayer(){return this._associatedLayer}get associationLayer(){const{layer:t}=this;return n(t)?t:null}get associationTypes(){return this.template.associationTypes}get canAddAssociation(){return!(!this.utilityNetwork||!this.loaded)&&this.editable}get feature(){return this.single.feature}get featureCount(){return this.viewModel.featureCount}get layer(){return this.single.layer}get loaded(){const t=this.viewModel.state;return"loading"!==t&&"disabled"!==t}get showAllEnabled(){return this.viewModel.showAllEnabled}get uid(){return r()}get updating(){const{state:t}=this.viewModel;return"loading"===t||"querying"===t}get utilityNetwork(){return this.viewModel.utilityNetwork}async refresh(){await e(this.viewModel.refresh())}setAssociatedLayer(t){this._associatedLayer=t}setActiveAssociationType(t){this.viewModel.activeAssociationType=t}showAllAssociatedFeatures(t){this.viewModel.showAllEnabled=t}};t([a()],y.prototype,"_associatedLayer",void 0),t([a()],y.prototype,"_editableLayer",null),t([a()],y.prototype,"activeAssociationType",null),t([a()],y.prototype,"associatedFeatures",null),t([a()],y.prototype,"associatedFeatureInfos",null),t([a()],y.prototype,"associatedLayer",null),t([a()],y.prototype,"associationLayer",null),t([a()],y.prototype,"associationTypes",null),t([a()],y.prototype,"canAddAssociation",null),t([a()],y.prototype,"feature",null),t([a()],y.prototype,"featureItem",void 0),t([a()],y.prototype,"featureCount",null),t([a()],y.prototype,"group",void 0),t([a()],y.prototype,"layer",null),t([a()],y.prototype,"loaded",null),t([a()],y.prototype,"map",void 0),t([a()],y.prototype,"showAllEnabled",null),t([a({readOnly:!0})],y.prototype,"single",void 0),t([a({readOnly:!0})],y.prototype,"type",void 0),t([a()],y.prototype,"uid",null),t([a()],y.prototype,"updating",null),t([a()],y.prototype,"utilityNetwork",null),t([a()],y.prototype,"viewModel",void 0),y=t([l("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],y);const c=y;export{c as default};
2
+ import{__decorate as t}from"tslib";import{ignoreAbortErrors as e}from"../../../core/promiseUtils.js";import{watch as i,sync as o,on as s}from"../../../core/reactiveUtils.js";import{generateUID as r}from"../../../core/uid.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isAssociationsLayerUnion as n}from"../batchAttributeFormUtils.js";import p from"./EditableInput.js";import u from"./SingleFeatureInputAdapter.js";import d from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";let c=class extends p{constructor(t){super(t),this._associatedLayer=null,this.featureItem=null,this.group=null,this.map=null,this.single=new u({input:this}),this.type="utilityNetworkAssociations",this.viewModel=new d({source:"featureForm"})}initialize(){this.viewModel.set({associationTypes:this.associationTypes,description:this.description,graphic:this.associationFeature,layer:this.associationLayer,map:this.map,title:this.label}),this.addHandles([i(()=>this.associatedLayer,t=>this.showAllAssociatedFeatures(null!=t),o),s(()=>this._editableLayer,"edits",()=>this.refresh())])}get _editableLayer(){const{associatedLayer:t}=this;return"subtype-sublayer"===t?.type?t.parent:t}get activeAssociationType(){return this.viewModel.activeAssociationType}get associatedFeatures(){const{associatedLayer:t}=this;return t?this.associatedFeatureInfos.get(t):void 0}get associatedFeatureInfos(){const{utilityNetwork:t,viewModel:{associationFeatures:e}}=this,i=new Map;return e.size&&t?(e.forEach((t,e)=>{n(e)&&i.set(e,t)}),i):i}get associatedLayer(){return this._associatedLayer}get associationFeature(){return this.feature?.plainGraphic}get associationLayer(){const{layer:t}=this;return n(t)?t:null}get associationTypes(){return this.template.associationTypes}get canAddAssociation(){return!(!this.utilityNetwork||!this.loaded)&&this.editable}get feature(){return this.single.feature}get featureCount(){return this.viewModel.featureCount}get layer(){return this.single.layer}get loaded(){const t=this.viewModel.state;return"loading"!==t&&"disabled"!==t}get showAllEnabled(){return this.viewModel.showAllEnabled}get uid(){return r()}get updating(){const{state:t}=this.viewModel;return"loading"===t||"querying"===t}get utilityNetwork(){return this.viewModel.utilityNetwork}async refresh(){await e(this.viewModel.refresh())}setAssociatedLayer(t){this._associatedLayer=t}setActiveAssociationType(t){this.viewModel.activeAssociationType=t}showAllAssociatedFeatures(t){this.viewModel.showAllEnabled=t}};t([a()],c.prototype,"_associatedLayer",void 0),t([a()],c.prototype,"_editableLayer",null),t([a()],c.prototype,"activeAssociationType",null),t([a()],c.prototype,"associatedFeatures",null),t([a()],c.prototype,"associatedFeatureInfos",null),t([a()],c.prototype,"associatedLayer",null),t([a()],c.prototype,"associationFeature",null),t([a()],c.prototype,"associationLayer",null),t([a()],c.prototype,"associationTypes",null),t([a()],c.prototype,"canAddAssociation",null),t([a()],c.prototype,"feature",null),t([a()],c.prototype,"featureItem",void 0),t([a()],c.prototype,"featureCount",null),t([a()],c.prototype,"group",void 0),t([a()],c.prototype,"layer",null),t([a()],c.prototype,"loaded",null),t([a()],c.prototype,"map",void 0),t([a()],c.prototype,"showAllEnabled",null),t([a({readOnly:!0})],c.prototype,"single",void 0),t([a({readOnly:!0})],c.prototype,"type",void 0),t([a()],c.prototype,"uid",null),t([a()],c.prototype,"updating",null),t([a()],c.prototype,"utilityNetwork",null),t([a()],c.prototype,"viewModel",void 0),c=t([l("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],c);const y=c;export{y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import s from"../BatchFormInputs.js";import r from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import a from"../TextElementInput.js";import i from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as p,isGroupElementTemplate as l,isRelationshipElementTemplate as m,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as c}from"../../templates/support/templateUtils.js";function h(e,t){const r=new s({inputs:e.elements.map(e=>I(e,t)),template:e});return x(r),r}function x(e){const t=e.allFieldInputs,s=new Set(t.map(e=>e.fieldName));for(const r of t){const e=r.multipleChoiceOtherChoiceFieldName;if(!e)continue;const t=r.layers[0]?.getField(e)?.name??e;s.has(t)&&(r.shouldShowMultipleChoiceOtherChoice=!1)}}function I(s,h){const{allFeatures:x,expressionsManager:w,map:y}=h,d=new Set(s.layers),g=x.filter(e=>d.has(e.layer)),j=g.length===x.length;if(p(s))return new r({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(l(s)){const e=s.elements.map(e=>I(e,h));return new n({existsInAllLayers:j,features:g,inputs:e,template:s,expressionsManager:w})}if(m(s))return new o({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(u(s))return new a({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(f(s))return new t({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(c(s))return new i({existsInAllLayers:j,features:g,template:s,expressionsManager:w,map:y});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{h as createBatchFormInputsFromBatchFormTemplate};
2
+ import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import r from"../BatchFormInputs.js";import s from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import a from"../TextElementInput.js";import i from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as l,isGroupElementTemplate as p,isRelationshipElementTemplate as m,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as c}from"../../templates/support/templateUtils.js";function h(e,t){const s=new r({inputs:e.elements.map(e=>I(e,t)),template:e});return x(s),s}function x(e){const t=e.allFieldInputs,r=new Set(t.map(e=>e.fieldName));for(const s of t){const e=s.multipleChoiceOtherChoiceFieldName;if(!e)continue;const t=s.layers[0]?.getField(e)?.name??e;r.has(t)&&(s.shouldShowMultipleChoiceOtherChoice=!1)}}function I(r,h){const{allFeatures:x,expressionsManager:w,getFieldValueOptionsForFeature:d,map:g}=h,F=new Set(r.layers),y=x.filter(e=>F.has(e.layer)),j=y.length===x.length;if(l(r))return new s({existsInAllLayers:j,features:y,template:r,expressionsManager:w,getFieldValueOptionsForFeature:d});if(p(r)){const e=r.elements.map(e=>I(e,h));return new n({existsInAllLayers:j,features:y,inputs:e,template:r,expressionsManager:w})}if(m(r))return new o({existsInAllLayers:j,features:y,map:g,template:r,expressionsManager:w});if(u(r))return new a({existsInAllLayers:j,features:y,template:r,expressionsManager:w});if(f(r))return new t({existsInAllLayers:j,features:y,template:r,expressionsManager:w});if(c(r))return new i({existsInAllLayers:j,features:y,template:r,expressionsManager:w,map:g});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{h as createBatchFormInputsFromBatchFormTemplate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function e(e){const{messages:n,onclick:o}=e;return[{appearance:"solid",kind:"brand",message:n.footerButtons.add,onclick:o??(()=>{})}]}function n(e){const{callback:n,formId:o,messages:s}=e;return[{appearance:"solid",form:o,kind:"brand",message:s.footerButtons.update,onclick:()=>n()}]}function o(e){const{messages:n}=e;return[{appearance:"outline",icon:"trash",kind:"danger",message:n.footerButtons.discard,onclick:()=>{}}]}function s(e){const{messages:n}=e;return[{appearance:"solid",kind:"brand",message:n.footerButtons.replace,onclick:()=>{}}]}function t(e){const{messages:n}=e;return[{appearance:"outline",icon:"reset",kind:"brand",message:n.footerButtons.reset,onclick:()=>{}}]}function a(e){const{messages:n}=e;return[{appearance:"outline",kind:"brand",message:n.footerButtons.done,onclick:()=>{}},{appearance:"outline",icon:"attachment",kind:"danger",message:n.footerButtons.delete,onclick:()=>{}}]}export{e as makeAddAttachmentFooterButtons,n as makeDefaultFooterButtons,o as makeDiscardAttachmentFooterButtons,s as makeReplaceAttachmentFooterButtons,t as makeResetAttachmentFooterButtons,a as makeViewingAttachmentFooterButtons};
2
+ function e(e){const{messages:n,onclick:a}=e;return[{appearance:"solid",kind:"brand",message:n.footerButtons.add,onclick:a??(()=>{})}]}function n(e){const{callback:n,formId:a,messages:c}=e;return[{appearance:"solid",form:a,kind:"brand",message:c.footerButtons.update,onclick:()=>n()}]}function a(e){const{message:n,onclick:a}=e;return[{appearance:"outline",icon:"trash",kind:"danger",message:n,onclick:a??(()=>{})}]}function c(e){const{disabled:n,messages:a,onclick:c}=e;return[{appearance:"solid",disabled:n,kind:"brand",message:a.footerButtons.replace,onclick:c??(()=>{})}]}function s(e){const{messages:n,onclick:a}=e;return[{appearance:"outline",icon:"reset",kind:"brand",message:n.footerButtons.reset,onclick:a??(()=>{})}]}function o(e){const{deleteDisabled:n,deleteOnclick:a,doneOnclick:c,messages:s}=e;return[{appearance:"outline",kind:"brand",message:s.done,onclick:c??(()=>{})},{appearance:"outline",disabled:n,icon:"attachment",kind:"danger",message:s.delete,onclick:a??(()=>{})}]}export{e as makeAddAttachmentFooterButtons,n as makeDefaultFooterButtons,a as makeDiscardAttachmentFooterButtons,c as makeReplaceAttachmentFooterButtons,s as makeResetAttachmentFooterButtons,o as makeViewingAttachmentFooterButtons};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import{isMultipleChoiceInput as s}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as a,isFieldElement as l,isGroupElement as m,isRelationshipElement as d,isTextElement as p,isUtilityNetworkAssociationsElement as c}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as f,isFieldVisibleByDefault as u}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as x,isSubtypeGroupLayer as y}from"../../../../layers/support/layerUtils.js";import{isNumber as w}from"../../../../support/guards.js";import{unknown as h}from"../../../../time/constants.js";import{makeExpressionInfosMap as E,makeExecutorSetForFormElement as b}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import I from"../BatchFormTemplate.js";import{FieldElementTemplate as v}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as j}from"../RelationshipElementTemplate.js";import{TextElementTemplate as F}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as C}from"../UtilityNetworkAssociationsElementTemplate.js";import{compileTextElementMarkdownToHTML as P}from"./textElementTemplateUtils.js";const L="expression/dea57012-47ca4b55a000-8df62742ed0c",A=e("form-attachment-filename-calculation"),U=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function Z(e,t,r=e.formTemplate){return r?.elements&&r.elements.length>0?B(r,e,t):N(e,t)}async function N(e,{arcadeExecutorProvider:t,formTimeZone:r}){const n=new Set(f(e)),o={arcadeExecutorProvider:t,formTimeZone:r,layer:e},i=[];for(const a of e.fields)G(a,e,n)&&i.push(O(a,o));const s=await Promise.all(i);return new I({elements:s,preserveFieldValuesWhenHidden:!0})}function k(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(x(t)||y(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(k(r.elements??[],t))return!0;return!1}async function B(e,t,r){let n=null;k(e.elements??[],t)&&(n=new i({title:"",name:L,expression:"false"}));const o=E(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new I(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const i of a){const e=await R(i,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:m});e&&s.elements.push(e)}return e.supportsAttachmentElements,new I(s)}async function H(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){const i=n.get(e.filenameExpression),s=i?await t(i.expression,A):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await b({element:e,expressionInfos:n,provider:r});return a.addLayer(o,l),a}async function R(e,t){return a(e)?H(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):l(e)?S(e,t):m(e)?V(e,t):d(e)?W(e,t):p(e)?z(e,t):c(e)?K(e,t):null}async function S(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:a}=o,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!a.has(d))return U().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=L),o.subtypeField&&(x(o)||y(o))&&e.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=L),c&&s(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=a.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new v({description:l,domain:m,field:a.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:$(o),label:f}),w=await b({element:e,expressionInfos:n,provider:t});return u.addLayer(o,w),u}async function V(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await R(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await b({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function W(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new j({description:r,...w(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),c=await b({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function z(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await P(s):s,d=new F({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await b({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function K(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new C({associationTypes:r,description:n,label:o}),m=await b({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function O(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new v({field:e,label:i,formTimeZone:n,layerTimeZone:$(r)}),a={},l=(y(r)||x(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function G(e,t,r){return!r.has(e.name.toLowerCase())&&u(e,t)}function $(e){return x(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?h:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{Z as createBatchFormTemplate,N as createBatchFormTemplateFromFields};
2
+ import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import{isMultipleChoiceInput as s}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as a,isFieldElement as l,isGroupElement as m,isRelationshipElement as d,isTextElement as p,isUtilityNetworkAssociationsElement as c}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as f,isFieldVisibleByDefault as u}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as x,isSubtypeGroupLayer as y}from"../../../../layers/support/layerUtils.js";import{isNumber as w}from"../../../../support/guards.js";import{unknown as h}from"../../../../time/constants.js";import{makeExpressionInfosMap as E,makeExecutorSetForFormElement as b}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import I from"../BatchFormTemplate.js";import{FieldElementTemplate as v}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as j}from"../RelationshipElementTemplate.js";import{TextElementTemplate as F}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as C}from"../UtilityNetworkAssociationsElementTemplate.js";import{compileTextElementMarkdownToHTML as P}from"./textElementTemplateUtils.js";const L="expression/dea57012-47ca4b55a000-8df62742ed0c",A=e("form-attachment-filename-calculation"),U=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function Z(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?B(r,e,t):N(e,t)}async function N(e,{arcadeExecutorProvider:t,formTimeZone:r}){const n=new Set(f(e)),o={arcadeExecutorProvider:t,formTimeZone:r,layer:e},i=[];for(const a of e.fields)G(a,e,n)&&i.push(O(a,o));const s=await Promise.all(i);return new I({elements:s,preserveFieldValuesWhenHidden:!0})}function k(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(x(t)||y(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(k(r.elements??[],t))return!0;return!1}async function B(e,t,r){let n=null;k(e.elements??[],t)&&(n=new i({title:"",name:L,expression:"false"}));const o=E(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new I(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const i of a){const e=await R(i,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:m});e&&s.elements.push(e)}return e.supportsAttachmentElements,new I(s)}async function H(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){const i=n.get(e.filenameExpression),s=i?await t(i.expression,A):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await b({element:e,expressionInfos:n,provider:r});return a.addLayer(o,l),a}async function R(e,t){return a(e)?H(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):l(e)?S(e,t):m(e)?V(e,t):d(e)?W(e,t):p(e)?z(e,t):c(e)?K(e,t):null}async function S(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:a}=o,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!a.has(d))return U().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=L),o.subtypeField&&(x(o)||y(o))&&e.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=L),c&&s(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=a.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new v({description:l,domain:m,field:a.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:$(o),label:f}),w=await b({element:e,expressionInfos:n,provider:t});return u.addLayer(o,w),u}async function V(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await R(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await b({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function W(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new j({description:r,...w(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),c=await b({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function z(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await P(s):s,d=new F({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await b({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function K(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new C({associationTypes:r,description:n,label:o}),m=await b({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function O(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new v({field:e,label:i,formTimeZone:n,layerTimeZone:$(r)}),a={},l=(y(r)||x(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function G(e,t,r){return!r.has(e.name.toLowerCase())&&u(e,t)}function $(e){return x(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?h:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{Z as createBatchFormTemplate,N as createBatchFormTemplateFromFields};
@@ -237,7 +237,7 @@ export interface FooterNoticeInfo {}
237
237
  *
238
238
  * @internal
239
239
  */
240
- export type Page = "default" | "viewing-attachments" | "viewing-attachment-details" | "adding-attachments" | "viewing-associated-layers" | "viewing-associated-features";
240
+ export type Page = "default" | "viewing-attachments" | "viewing-attachment-details" | "replacing-attachment" | "adding-attachments" | "viewing-associated-layers" | "viewing-associated-features";
241
241
 
242
242
  /**
243
243
  * Configuration information about a selected attachment. Used to display details about the attachment.
@@ -266,6 +266,7 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
266
266
  * Usually, this is called when the user clicks a specified `submit` button or when the form is programmatically submitted and calls the [FeatureLayer.applyEdits()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#applyEdits) method
267
267
  * to update the features' attributes.
268
268
  *
269
+ * @returns Resolves after any pending attachment hydration completes and the `"submit"` event has been emitted.
269
270
  * @example
270
271
  * // Listen for when 'submit' is called on the form.
271
272
  * // Once it is fired, update the features.
@@ -274,5 +275,5 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
274
275
  * // execute the 'submit()' method.
275
276
  * document.getElementById("btnUpdate").addEventListener("click", () => form.submit());
276
277
  */
277
- submit(): void;
278
+ submit(): Promise<void>;
278
279
  }