@arcgis/core 4.24.0-next.20220430 → 4.24.0-next.20220503

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{eachAlways as r}from"../../../core/promiseUtils.js";import t from"../../../layers/FeatureLayer.js";import{applyTextFormattingHTML as a,htmlEntities as i}from"./featureUtils.js";const s=["$datastore","$map","$layer","$aggregatedfeatures"],n="esri.widgets.Feature.support.arcadeFeatureUtils",o=e.getLogger(n);function c(e){return"string"==typeof e?a(i(e)):Array.isArray(e)?p(e):"esri.arcade.Dictionary"===(null==e?void 0:e.declaredClass)?l(e):e}function p(e){return`<ul class="esri-widget__list">${e.map((e=>`<li>${"string"==typeof e?a(i(e)):e}</li>`)).join("")}</ul>`}function l(e){return`<table class="esri-widget__table">${e.keys().map((r=>{const t=e.field(r);return`<tr><th>${r}</th><td>${"string"==typeof t?a(i(t)):t}</td></tr>`})).join("")}</table>`}function u({aggregatedFeatures:e,arcadeUtils:r,featureSetVars:a,context:i,viewInfo:s,map:n,graphic:o,interceptor:c}){a.forEach((a=>{const p=a.toLowerCase(),l={map:n,spatialReference:s.sr,interceptor:c};if("$map"===p&&(i.vars[p]=r.convertMapToFeatureSetCollection(l)),"$layer"===p&&(i.vars[p]=r.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:s.sr,interceptor:c})),"$datastore"===p&&(i.vars[p]=r.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:s.sr,interceptor:c})),"$aggregatedfeatures"===p){const a=o.layer,{fields:n,objectIdField:l,geometryType:u,spatialReference:f,displayField:d}=a,g=new t({fields:n,objectIdField:l,geometryType:u,spatialReference:f,displayField:d,..."feature"===a.type?{templates:a.templates,typeIdField:a.typeIdField,types:a.types}:null,source:e});i.vars[p]=r.convertFeatureLayerToFeatureSet({layer:g,spatialReference:s.sr,interceptor:c})}}))}function f(){return import("../../../support/arcadeUtils.js")}async function d({graphic:e,view:r}){const{isAggregate:t,layer:a}=e;if(!t||!a||"2d"!==(null==r?void 0:r.type))return[];const i=await r.whenLayerView(a);if(!i.createQuery||!i.queryFeatures)return[];const s=i.createQuery();s.aggregateIds=[e.getObjectId()];const{features:n}=await i.queryFeatures(s);return n}async function g({expressionInfo:e,arcadeUtils:r,interceptor:t,spatialReference:a,map:i,graphic:n,view:c}){if(!e||!e.expression)return null;const p=r.createSyntaxTree(e.expression),l=s.filter((e=>r.hasVariable(p,e))),[f]=await Promise.all([d({graphic:n,view:c}),r.loadScriptDependencies(p,!0,l)]),g=r.getViewInfo({spatialReference:a}),y=r.createExecContext(n,g);y.interceptor=t,y.useAsync=!0,u({aggregatedFeatures:f,arcadeUtils:r,featureSetVars:l,context:y,viewInfo:g,map:i,graphic:n,interceptor:t});const m=r.createFunction(p,y);return r.executeAsyncFunction(m,y).catch((r=>o.error("arcade-execution-error",{error:r,graphic:n,expressionInfo:e})))}async function y({expressionInfos:e,spatialReference:t,graphic:a,interceptor:i,map:s,view:n}){if(!e||!e.length)return{};const o=await f(),p={};for(const r of e)p[`expression/${r.name}`]=g({expressionInfo:r,arcadeUtils:o,interceptor:i,spatialReference:t,map:s,graphic:a,view:n});const l=await r(p),u={};for(const r in l)u[r]=c(l[r].value);return u}export{g as createCompiledExpression,y as createCompiledExpressions,f as loadArcadeUtils};
5
+ import e from"../../../core/Logger.js";import{eachAlways as r}from"../../../core/promiseUtils.js";import t from"../../../layers/FeatureLayer.js";import{applyTextFormattingHTML as a,htmlEntities as i}from"./featureUtils.js";const s=["$datastore","$map","$layer","$aggregatedfeatures"],n="esri.widgets.Feature.support.arcadeFeatureUtils",o=e.getLogger(n);function c(e){return"string"==typeof e?a(i(e)):Array.isArray(e)?p(e):"esri.arcade.Dictionary"===e?.declaredClass?l(e):e}function p(e){return`<ul class="esri-widget__list">${e.map((e=>`<li>${"string"==typeof e?a(i(e)):e}</li>`)).join("")}</ul>`}function l(e){return`<table class="esri-widget__table">${e.keys().map((r=>{const t=e.field(r);return`<tr><th>${r}</th><td>${"string"==typeof t?a(i(t)):t}</td></tr>`})).join("")}</table>`}function u({aggregatedFeatures:e,arcadeUtils:r,featureSetVars:a,context:i,viewInfo:s,map:n,graphic:o,interceptor:c}){a.forEach((a=>{const p=a.toLowerCase(),l={map:n,spatialReference:s.sr,interceptor:c};if("$map"===p&&(i.vars[p]=r.convertMapToFeatureSetCollection(l)),"$layer"===p&&(i.vars[p]=r.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:s.sr,interceptor:c})),"$datastore"===p&&(i.vars[p]=r.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:s.sr,interceptor:c})),"$aggregatedfeatures"===p){const a=o.layer,{fields:n,objectIdField:l,geometryType:u,spatialReference:f,displayField:g}=a,y=new t({fields:n,objectIdField:l,geometryType:u,spatialReference:f,displayField:g,..."feature"===a.type?{templates:a.templates,typeIdField:a.typeIdField,types:a.types}:null,source:e});i.vars[p]=r.convertFeatureLayerToFeatureSet({layer:y,spatialReference:s.sr,interceptor:c})}}))}function f(){return import("../../../support/arcadeUtils.js")}async function g({graphic:e,view:r}){const{isAggregate:t,layer:a}=e;if(!t||!a||"2d"!==r?.type)return[];const i=await r.whenLayerView(a);if(!i.createQuery||!i.queryFeatures)return[];const s=i.createQuery();s.aggregateIds=[e.getObjectId()];const{features:n}=await i.queryFeatures(s);return n}async function y({expressionInfo:e,arcadeUtils:r,interceptor:t,spatialReference:a,map:i,graphic:n,view:c}){if(!e||!e.expression)return null;const p=r.createSyntaxTree(e.expression),l=s.filter((e=>r.hasVariable(p,e))),[f]=await Promise.all([g({graphic:n,view:c}),r.loadScriptDependencies(p,!0,l)]),y=r.getViewInfo({spatialReference:a}),d=r.createExecContext(n,y);d.interceptor=t,d.useAsync=!0,u({aggregatedFeatures:f,arcadeUtils:r,featureSetVars:l,context:d,viewInfo:y,map:i,graphic:n,interceptor:t});const m=r.createFunction(p,d);return r.executeAsyncFunction(m,d).catch((r=>o.error("arcade-execution-error",{error:r,graphic:n,expressionInfo:e})))}async function d({expressionInfos:e,spatialReference:t,graphic:a,interceptor:i,map:s,view:n}){if(!e||!e.length)return{};const o=await f(),p={};for(const r of e)p[`expression/${r.name}`]=y({expressionInfo:r,arcadeUtils:o,interceptor:i,spatialReference:t,map:s,graphic:a,view:n});const l=await r(p),u={};for(const r in l)u[r]=c(l[r].value);return u}export{y as createCompiledExpression,d as createCompiledExpressions,f as loadArcadeUtils};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../../intl.js";import e from"../../../core/Logger.js";import{isNone as t,isSome as r}from"../../../core/maybe.js";import{replace as n}from"../../../core/string.js";import{formatDate as i,convertDateFormatToIntlOptions as o}from"../../../intl/date.js";import{formatNumber as a,convertNumberFormatToIntlOptions as l}from"../../../intl/number.js";import{isRasterPixelValueField as u,featureHasFields as s}from"../../../layers/support/fieldUtils.js";import f from"../../../popup/support/FieldInfoFormat.js";import{loadArcade as c}from"../../../support/arcadeOnDemand.js";const d="esri.widgets.Feature.support.featureUtils",p=e.getLogger(d),m=/href=(""|'')/gi,y=/(\{([^\{\r\n]+)\})/g,g=/\'/g,h=/^\s*expression\//i,I=/(\n)/gi,b=/[\u00A0-\u9999<>\&]/gim,F=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,w=/^(?:mailto:|tel:)/,N="relationships/",E=o("short-date-short-time");function v(e){if(!t(e))return e.get("sourceLayer")||e.get("layer")}async function j(e,t){return"function"==typeof e?e.call(null,t):e}function x(e=""){if(e)return!w.test(e.trim().toLowerCase())}function T(e){return!!e&&h.test(e)}function C(e,t){if(!T(t)||!e)return null;const r=t.replace(h,"").toLowerCase();let n;return e.some((e=>e.name.toLowerCase()===r&&(n=e,!0))),n}function M(e,t){const r=C(t,null==e?void 0:e.fieldName);return r?r.title||null:e?e.label||e.fieldName:null}function q(e,t){const r=t.get(e.toLowerCase());return`{${r&&r.fieldName||e}}`}function R(e){return e.replace(m,"")}function D(e,t){const r=U(t,e);return r?r.name:e}function L(e,t){return e&&e.map((e=>D(e,t)))}function U(e,t){return e&&"function"==typeof e.getField?e.getField(t):null}function $(e){return`${e}`.trim()}function A({attributes:e,globalAttributes:t,layer:r,text:n,expressionAttributes:i,fieldInfoMap:o}){return n?S({formattedAttributes:t,template:_(n,{...t,...i,...e},r),fieldInfoMap:o}):""}function S({formattedAttributes:e,template:t,fieldInfoMap:r}){return $(R(n(n(t,(e=>q(e,r))),e)))}function G(e,t,r=!1){const n=t[e];if("string"==typeof n){const i="%27",o=(r?encodeURIComponent(n):n).replace(g,i);t[e]=o}}function k(e,t=!1){const r={...e};return Object.keys(r).forEach((e=>G(e,r,t))),r}function O(e,t,r){const i=(t=$(t))&&"{"!==t[0];return n(e,k(r,i))}function P(e,t){return e.replace(y,((e,r,n)=>{const i=U(t,n);return i?`{${i.name}}`:r}))}function _(e,t,r){const n=P(e,r);return n?n.replace(F,((e,r,n)=>O(e,r||n,t))):n}function z(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}function H(e){return"feature"===(null==e?void 0:e.type)}function Q(e){return!(null==e||!e.layer)}function Z(e){return"map-image"===(null==e?void 0:e.type)}function V(e,t){const r=t.fieldInfos,n=t.fieldName,i=B(r,n),o=null==i?void 0:i.clone(),s=t.preventPlacesFormatting,c=t.layer,d=U(c,n);if(o&&"date"===(null==d?void 0:d.type)){const e=o.format||new f;e.dateFormat=e.dateFormat||"short-date-short-time",e.dateTimeFormatOptions=!Q(c)&&H(c)&&c.datesInUnknownTimezone||Q(c)&&Z(c.layer)&&c.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,o.format=e}const p=o&&o.format;return"string"==typeof e&&u(n)?p.formatRasterPixelValue(e):"string"==typeof(e=z(e,p))||null==e||null==p?te(e):s?a(e,{...l(p),minimumFractionDigits:0,maximumFractionDigits:20}):p.format(e)}function B(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let n;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r)&&(n=e,!0))),n}function J({fieldName:e,graphic:t,layer:r}){if(le(e))return null;if(!r||"function"!=typeof r.getFeatureType)return null;const{typeIdField:n}=r;if(!n||e!==n)return null;const i=r.getFeatureType(t);return i?i.name:null}function K({fieldName:e,value:t,graphic:r,layer:n}){if(le(e))return null;if(!n||"function"!=typeof n.getFieldDomain)return null;const i=n.getFieldDomain(e,{feature:r});return i&&"coded-value"===i.type?i.getName(t):null}function W(e,t){const{creatorField:r,creationDateField:n,editorField:o,editDateField:a}=e;if(!t)return;const l=t[a];if("number"==typeof l){const e=t[o];return{type:"edit",date:i(l,E),user:e}}const u=t[n];if("number"==typeof u){const e=t[r];return{type:"create",date:i(u,E),user:e}}return null}function X(e,t){const r=new Map;return e&&e.forEach((e=>{const n=D(e.fieldName,t);e.fieldName=n,r.set(n.toLowerCase(),e)})),r}function Y(e){const t=[];if(!e)return t;const{fieldInfos:r,content:n}=e;return r&&t.push(...r),n&&Array.isArray(n)?(n.forEach((e=>{if("fields"===e.type){const r=e&&e.fieldInfos;r&&t.push(...r)}})),t):t}function ee(e){return e.replace(b,(e=>`&#${e.charCodeAt(0)};`))}function te(e){return"string"==typeof e?e.replace(I,'<br class="esri-text-new-line" />'):e}function re(e){const{value:t,fieldName:r,fieldInfos:n,fieldInfoMap:o,layer:a,graphic:l}=e;if(null==t)return"";const u=K({fieldName:r,value:t,graphic:l,layer:a});if(u)return u;const s=J({fieldName:r,graphic:l,layer:a});if(s)return s;if(o.get(r.toLowerCase()))return V(t,{fieldInfos:n,fieldName:r,layer:a});const f=a&&a.fieldsIndex;return f&&f.isDateField(r)?i(t,E):te(t)}function ne({fieldInfos:e,attributes:t,layer:r,graphic:n,fieldInfoMap:i,relatedInfos:o}){const a={};return null==o||o.forEach((t=>fe({attributes:a,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:r}))),Object.keys(t).forEach((o=>{const l=t[o];a[o]=re({fieldName:o,fieldInfos:e,fieldInfoMap:i,layer:r,value:l,graphic:n})})),a}async function ie(e,t){var r,n;const{layer:i,graphic:o,outFields:a,objectIds:l,returnGeometry:u,spatialReference:s}=e,f=l[0];if("number"!=typeof f&&"string"!=typeof f){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:i,graphic:o,objectId:f,requiredFields:a};return p.warn(e,t),null}if(null==(r=i.capabilities)||null==(n=r.operations)||!n.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:i,graphic:o,requiredFields:a,returnGeometry:u};return p.warn(e,t),null}const c=i.createQuery();c.objectIds=l,c.outFields=null!=a&&a.length?a:[i.objectIdField],c.returnGeometry=!!u,c.returnZ=!!u,c.returnM=!!u,c.outSpatialReference=s;return(await i.queryFeatures(c,t)).features[0]}async function oe(e){var t;if(null==(t=e.expressionInfos)||!t.length)return!1;const r=await c(),{arcadeUtils:{hasGeometryFunctions:n}}=r;return n(e)}async function ae({graphic:e,popupTemplate:t,layer:r,spatialReference:n},i){if(!r||!t)return;if("function"==typeof r.load&&await r.load(i),!e.attributes)return;const o=e.attributes[r.objectIdField];if(null==o)return;const a=[o],l=await t.getRequiredFields(r.fieldsIndex),u=s(l,e),f=u?[]:l,c=t.returnGeometry||await oe(t);if(u&&!c)return;const d=await ie({layer:r,graphic:e,outFields:f,objectIds:a,returnGeometry:c,spatialReference:n},i);d&&(d.geometry&&(e.geometry=d.geometry),d.attributes&&(e.attributes={...e.attributes,...d.attributes}))}function le(e=""){return!!e&&e.includes(N)}function ue(e){return e?`${N}${e.layerId}/${e.fieldName}`:""}function se({attributes:e,graphic:t,relatedInfo:r,fieldInfos:n,fieldInfoMap:i,layer:o}){e&&t&&r&&Object.keys(t.attributes).forEach((a=>{const l=ue({layerId:r.relation.id.toString(),fieldName:a}),u=t.attributes[a];e[l]=re({fieldName:l,fieldInfos:n,fieldInfoMap:i,layer:o,value:u,graphic:t})}))}function fe({attributes:e,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}){e&&t&&(t.relatedFeatures&&t.relatedFeatures&&t.relatedFeatures.forEach((o=>se({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}))),t.relatedStatsFeatures&&t.relatedStatsFeatures&&t.relatedStatsFeatures.forEach((o=>se({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}))))}const ce=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},de=({layer:e,method:t,query:n,definitionExpression:i})=>{var o,a;if(null==(o=e.capabilities)||null==(a=o.query)||!a.supportsCacheHint||"attachments"===t)return;const l=r(n.where)&&n.where,u=r(n.geometry)&&n.geometry;ce(i)||ce(l)||"extent"===(null==u?void 0:u.type)||"tile"===n.resultType||(n.cacheHint=!0)},pe=({query:e,layer:t,method:r})=>{de({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})},me=({queryPayload:e,layer:t,method:r})=>{de({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})};export{te as applyTextFormattingHTML,X as createfieldInfoMap,P as fixTokens,ne as formatAttributes,W as formatEditInfo,V as formatValueToFieldInfo,Y as getAllFieldInfos,B as getFieldInfo,M as getFieldInfoLabel,D as getFixedFieldName,L as getFixedFieldNames,v as getSourceLayer,j as graphicCallback,ee as htmlEntities,T as isExpressionField,le as isRelatedField,pe as preLayerQueryCallback,me as preRequestCallback,ae as queryUpdatedFeature,x as shouldOpenInNewTab,S as substituteAttributes,A as substituteFieldsInLinksAndAttributes};
5
+ import"../../../intl.js";import e from"../../../core/Logger.js";import{isNone as t,isSome as r}from"../../../core/maybe.js";import{replace as n}from"../../../core/string.js";import{formatDate as i,convertDateFormatToIntlOptions as o}from"../../../intl/date.js";import{formatNumber as a,convertNumberFormatToIntlOptions as u}from"../../../intl/number.js";import{isRasterPixelValueField as l,featureHasFields as s}from"../../../layers/support/fieldUtils.js";import f from"../../../popup/support/FieldInfoFormat.js";import{loadArcade as c}from"../../../support/arcadeOnDemand.js";const d="esri.widgets.Feature.support.featureUtils",p=e.getLogger(d),m=/href=(""|'')/gi,y=/(\{([^\{\r\n]+)\})/g,g=/\'/g,h=/^\s*expression\//i,I=/(\n)/gi,b=/[\u00A0-\u9999<>\&]/gim,F=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,w=/^(?:mailto:|tel:)/,N="relationships/",E=o("short-date-short-time");function j(e){if(!t(e))return e.get("sourceLayer")||e.get("layer")}async function x(e,t){return"function"==typeof e?e.call(null,t):e}function T(e=""){if(e)return!w.test(e.trim().toLowerCase())}function C(e){return!!e&&h.test(e)}function M(e,t){if(!C(t)||!e)return null;const r=t.replace(h,"").toLowerCase();let n;return e.some((e=>e.name.toLowerCase()===r&&(n=e,!0))),n}function q(e,t){const r=M(t,e?.fieldName);return r?r.title||null:e?e.label||e.fieldName:null}function R(e,t){const r=t.get(e.toLowerCase());return`{${r&&r.fieldName||e}}`}function D(e){return e.replace(m,"")}function v(e,t){const r=U(t,e);return r?r.name:e}function L(e,t){return e&&e.map((e=>v(e,t)))}function U(e,t){return e&&"function"==typeof e.getField?e.getField(t):null}function $(e){return`${e}`.trim()}function A({attributes:e,globalAttributes:t,layer:r,text:n,expressionAttributes:i,fieldInfoMap:o}){return n?S({formattedAttributes:t,template:_(n,{...t,...i,...e},r),fieldInfoMap:o}):""}function S({formattedAttributes:e,template:t,fieldInfoMap:r}){return $(D(n(n(t,(e=>R(e,r))),e)))}function G(e,t,r=!1){const n=t[e];if("string"==typeof n){const i="%27",o=(r?encodeURIComponent(n):n).replace(g,i);t[e]=o}}function k(e,t=!1){const r={...e};return Object.keys(r).forEach((e=>G(e,r,t))),r}function O(e,t,r){const i=(t=$(t))&&"{"!==t[0];return n(e,k(r,i))}function P(e,t){return e.replace(y,((e,r,n)=>{const i=U(t,n);return i?`{${i.name}}`:r}))}function _(e,t,r){const n=P(e,r);return n?n.replace(F,((e,r,n)=>O(e,r||n,t))):n}function z(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}function H(e){return"feature"===e?.type}function Q(e){return!!e?.layer}function Z(e){return"map-image"===e?.type}function V(e,t){const r=t.fieldInfos,n=t.fieldName,i=B(r,n)?.clone(),o=t.preventPlacesFormatting,s=t.layer,c=U(s,n);if(i&&"date"===c?.type){const e=i.format||new f;e.dateFormat=e.dateFormat||"short-date-short-time",e.dateTimeFormatOptions=!Q(s)&&H(s)&&s.datesInUnknownTimezone||Q(s)&&Z(s.layer)&&s.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,i.format=e}const d=i&&i.format;return"string"==typeof e&&l(n)?d.formatRasterPixelValue(e):"string"==typeof(e=z(e,d))||null==e||null==d?te(e):o?a(e,{...u(d),minimumFractionDigits:0,maximumFractionDigits:20}):d.format(e)}function B(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let n;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r)&&(n=e,!0))),n}function J({fieldName:e,graphic:t,layer:r}){if(ue(e))return null;if(!r||"function"!=typeof r.getFeatureType)return null;const{typeIdField:n}=r;if(!n||e!==n)return null;const i=r.getFeatureType(t);return i?i.name:null}function K({fieldName:e,value:t,graphic:r,layer:n}){if(ue(e))return null;if(!n||"function"!=typeof n.getFieldDomain)return null;const i=n.getFieldDomain(e,{feature:r});return i&&"coded-value"===i.type?i.getName(t):null}function W(e,t){const{creatorField:r,creationDateField:n,editorField:o,editDateField:a}=e;if(!t)return;const u=t[a];if("number"==typeof u){const e=t[o];return{type:"edit",date:i(u,E),user:e}}const l=t[n];if("number"==typeof l){const e=t[r];return{type:"create",date:i(l,E),user:e}}return null}function X(e,t){const r=new Map;return e&&e.forEach((e=>{const n=v(e.fieldName,t);e.fieldName=n,r.set(n.toLowerCase(),e)})),r}function Y(e){const t=[];if(!e)return t;const{fieldInfos:r,content:n}=e;return r&&t.push(...r),n&&Array.isArray(n)?(n.forEach((e=>{if("fields"===e.type){const r=e&&e.fieldInfos;r&&t.push(...r)}})),t):t}function ee(e){return e.replace(b,(e=>`&#${e.charCodeAt(0)};`))}function te(e){return"string"==typeof e?e.replace(I,'<br class="esri-text-new-line" />'):e}function re(e){const{value:t,fieldName:r,fieldInfos:n,fieldInfoMap:o,layer:a,graphic:u}=e;if(null==t)return"";const l=K({fieldName:r,value:t,graphic:u,layer:a});if(l)return l;const s=J({fieldName:r,graphic:u,layer:a});if(s)return s;if(o.get(r.toLowerCase()))return V(t,{fieldInfos:n,fieldName:r,layer:a});const f=a&&a.fieldsIndex;return f&&f.isDateField(r)?i(t,E):te(t)}function ne({fieldInfos:e,attributes:t,layer:r,graphic:n,fieldInfoMap:i,relatedInfos:o}){const a={};return o?.forEach((t=>fe({attributes:a,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:r}))),Object.keys(t).forEach((o=>{const u=t[o];a[o]=re({fieldName:o,fieldInfos:e,fieldInfoMap:i,layer:r,value:u,graphic:n})})),a}async function ie(e,t){const{layer:r,graphic:n,outFields:i,objectIds:o,returnGeometry:a,spatialReference:u}=e,l=o[0];if("number"!=typeof l&&"string"!=typeof l){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:r,graphic:n,objectId:l,requiredFields:i};return p.warn(e,t),null}if(!r.capabilities?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:r,graphic:n,requiredFields:i,returnGeometry:a};return p.warn(e,t),null}const s=r.createQuery();s.objectIds=o,s.outFields=i?.length?i:[r.objectIdField],s.returnGeometry=!!a,s.returnZ=!!a,s.returnM=!!a,s.outSpatialReference=u;return(await r.queryFeatures(s,t)).features[0]}async function oe(e){if(!e.expressionInfos?.length)return!1;const t=await c(),{arcadeUtils:{hasGeometryFunctions:r}}=t;return r(e)}async function ae({graphic:e,popupTemplate:t,layer:r,spatialReference:n},i){if(!r||!t)return;if("function"==typeof r.load&&await r.load(i),!e.attributes)return;const o=e.attributes[r.objectIdField];if(null==o)return;const a=[o],u=await t.getRequiredFields(r.fieldsIndex),l=s(u,e),f=l?[]:u,c=t.returnGeometry||await oe(t);if(l&&!c)return;const d=await ie({layer:r,graphic:e,outFields:f,objectIds:a,returnGeometry:c,spatialReference:n},i);d&&(d.geometry&&(e.geometry=d.geometry),d.attributes&&(e.attributes={...e.attributes,...d.attributes}))}function ue(e=""){return!!e&&e.includes(N)}function le(e){return e?`${N}${e.layerId}/${e.fieldName}`:""}function se({attributes:e,graphic:t,relatedInfo:r,fieldInfos:n,fieldInfoMap:i,layer:o}){e&&t&&r&&Object.keys(t.attributes).forEach((a=>{const u=le({layerId:r.relation.id.toString(),fieldName:a}),l=t.attributes[a];e[u]=re({fieldName:u,fieldInfos:n,fieldInfoMap:i,layer:o,value:l,graphic:t})}))}function fe({attributes:e,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}){e&&t&&(t.relatedFeatures&&t.relatedFeatures&&t.relatedFeatures.forEach((o=>se({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}))),t.relatedStatsFeatures&&t.relatedStatsFeatures&&t.relatedStatsFeatures.forEach((o=>se({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i}))))}const ce=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},de=({layer:e,method:t,query:n,definitionExpression:i})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const o=r(n.where)&&n.where,a=r(n.geometry)&&n.geometry;ce(i)||ce(o)||"extent"===a?.type||"tile"===n.resultType||(n.cacheHint=!0)},pe=({query:e,layer:t,method:r})=>{de({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})},me=({queryPayload:e,layer:t,method:r})=>{de({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})};export{te as applyTextFormattingHTML,X as createfieldInfoMap,P as fixTokens,ne as formatAttributes,W as formatEditInfo,V as formatValueToFieldInfo,Y as getAllFieldInfos,B as getFieldInfo,q as getFieldInfoLabel,v as getFixedFieldName,L as getFixedFieldNames,j as getSourceLayer,x as graphicCallback,ee as htmlEntities,C as isExpressionField,ue as isRelatedField,pe as preLayerQueryCallback,me as preRequestCallback,ae as queryUpdatedFeature,T as shouldOpenInNewTab,S as substituteAttributes,A as substituteFieldsInLinksAndAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../request.js";import t from"../../../core/Error.js";import r from"../../../core/Logger.js";import{eachAlways as s}from"../../../core/promiseUtils.js";import{isNumericField as o}from"../../../layers/support/fieldUtils.js";import"../../../core/has.js";import"../../../layers/support/source/DataLayerSource.js";import{executeQueryJSON as i}from"../../../rest/query/executeQueryJSON.js";import"../../../core/arrayUtils.js";import"../../../core/urlUtils.js";import"../../../core/unitUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/support/normalizeUtils.js";import"../../../core/pbf.js";import"../../../rest/support/FeatureSet.js";import n from"../../../rest/support/Query.js";import"../../../kernel.js";import"../../../rest/query/support/AttachmentInfo.js";import"../../../rest/support/AttachmentQuery.js";import"../../../geometry.js";import a from"../../../rest/support/RelationshipQuery.js";import"../../../rest/support/TopFeaturesQuery.js";import l from"../../../rest/support/StatisticDefinition.js";import{isRelatedField as u}from"./featureUtils.js";const p="esri.widgets.Feature.support.relatedFeatureUtils",c=r.getLogger(p),f=new Map;function d(e){if(!u(e))return null;const[t,r]=e.split("/").slice(1);return{layerId:t,fieldName:r}}function m(e,t){if(!t.relationships)return null;let r=null;const{relationships:s}=t;return s.some((t=>t.id===parseInt(e,10)&&(r=t,!0))),r}function y({originRelationship:e,relationships:t,layerId:r}){let s;return t&&t.some((t=>(`${t.relatedTableId}`===r&&t.id===e.id&&(s=t),!!s))),s}function j(e,t){const r=t.toLowerCase();for(const s in e)if(s.toLowerCase()===r)return e[s];return null}function h(e,t){const r=m(e,t);if(!r)return;return{url:`${t.url}/${r.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:r,relatedFields:[],outStatistics:[]}}function F(e,t){if(!t)return;if(!e)return;const{features:r,statsFeatures:s}=e,o=r&&r.value;t.relatedFeatures=o?o.features:[];const i=s&&s.value;t.relatedStatsFeatures=i?i.features:[]}function g(e,t,r,s){const o=new a;return o.outFields=["*"],o.relationshipId="number"==typeof t.id?t.id:parseInt(t.id,10),o.objectIds=[e.attributes[r.objectIdField]],r.queryRelatedFeatures(o,s)}function I(e,t,r){let s=0;const o=[];for(;s<t.length;)o.push(`${e} IN (${t.slice(s,r+s)})`),s+=r;return o.join(" OR ")}async function S(e,t,r,a){const l=r.layerId.toString(),{layerInfo:u,relation:p,relatedFields:c,outStatistics:f,url:d,sourceSpatialReference:m}=t,h=y({originRelationship:p,relationships:u.relationships,layerId:l});if(h.relationshipTableId&&h.keyFieldInRelationshipTable){const t=(await g(e,h,r,a))[e.attributes[r.objectIdField]];if(!t)return null;const o=t.features.map((e=>e.attributes[u.objectIdField]));if((null==f?void 0:f.length)>0&&u.supportsStatistics){const e=new n;e.where=I(u.objectIdField,o,1e3),e.outFields=c,e.outStatistics=f,e.sourceSpatialReference=m;const r={features:Promise.resolve(t),statsFeatures:i(d,e)};return s(r)}}const F=null==h?void 0:h.keyField;if(F){const r=o(U(u.fields,F)),l=j(e.attributes,p.keyField),c=r?`${F}=${l}`:`${F}='${l}'`,f=i(d,new n({where:c,outFields:t.relatedFields,sourceSpatialReference:m}),a),y=t.outStatistics&&t.outStatistics.length>0&&u.supportsStatistics?i(d,new n({where:c,outFields:t.relatedFields,outStatistics:t.outStatistics,sourceSpatialReference:m}),a):null,h={features:f};return y&&(h.statsFeatures=y),s(h)}return null}function w(t,r){return e(t,{query:{f:"json"},signal:r&&r.signal})}function b({relatedInfos:e,layer:r},o){const i={};return e.forEach(((e,s)=>{const{relation:n}=e;if(!n){const e=new t("relation-required","A relation is required on a layer to retrieve related records.");throw c.error(e),e}const{relatedTableId:a}=n;if("number"!=typeof a){const e=new t("A related table ID is required on a layer to retrieve related records.");throw c.error(e),e}const l=`${r.url}/${a}`,u=f.get(l),p=u||w(l,o);u||f.set(l,p),i[s]=p})),s(i)}function R({graphic:e,relatedInfos:t,layer:r},o){const i={};return t.forEach(((t,s)=>{t.layerInfo&&(i[s]=S(e,t,r,o))})),s(i)}function $({relatedInfo:e,fieldName:t,fieldInfo:r}){if(e.relatedFields.push(t),r.statisticType){const s=new l({statisticType:r.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics.push(s)}}function U(e,t){if(null!=e){t=t.toLowerCase();for(const r of e)if(r&&r.name.toLowerCase()===t)return r}return null}export{h as createRelatedInfo,y as getDestinationRelation,d as getRelatedFieldInfo,b as queryLayerInfos,R as queryRelatedFeatures,F as setRelatedFeatures,$ as updateRelatedInfo};
5
+ import e from"../../../request.js";import t from"../../../core/Error.js";import r from"../../../core/Logger.js";import{eachAlways as s}from"../../../core/promiseUtils.js";import{isNumericField as o}from"../../../layers/support/fieldUtils.js";import"../../../core/has.js";import"../../../layers/support/source/DataLayerSource.js";import{executeQueryJSON as i}from"../../../rest/query/executeQueryJSON.js";import"../../../core/arrayUtils.js";import"../../../core/urlUtils.js";import"../../../core/unitUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/support/normalizeUtils.js";import"../../../core/pbf.js";import"../../../rest/support/FeatureSet.js";import n from"../../../rest/support/Query.js";import"../../../kernel.js";import"../../../rest/query/support/AttachmentInfo.js";import"../../../rest/support/AttachmentQuery.js";import"../../../geometry.js";import a from"../../../rest/support/RelationshipQuery.js";import"../../../rest/support/TopFeaturesQuery.js";import l from"../../../rest/support/StatisticDefinition.js";import{isRelatedField as u}from"./featureUtils.js";const p="esri.widgets.Feature.support.relatedFeatureUtils",c=r.getLogger(p),f=new Map;function d(e){if(!u(e))return null;const[t,r]=e.split("/").slice(1);return{layerId:t,fieldName:r}}function m(e,t){if(!t.relationships)return null;let r=null;const{relationships:s}=t;return s.some((t=>t.id===parseInt(e,10)&&(r=t,!0))),r}function y({originRelationship:e,relationships:t,layerId:r}){let s;return t&&t.some((t=>(`${t.relatedTableId}`===r&&t.id===e.id&&(s=t),!!s))),s}function j(e,t){const r=t.toLowerCase();for(const s in e)if(s.toLowerCase()===r)return e[s];return null}function h(e,t){const r=m(e,t);if(!r)return;return{url:`${t.url}/${r.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:r,relatedFields:[],outStatistics:[]}}function F(e,t){if(!t)return;if(!e)return;const{features:r,statsFeatures:s}=e,o=r&&r.value;t.relatedFeatures=o?o.features:[];const i=s&&s.value;t.relatedStatsFeatures=i?i.features:[]}function g(e,t,r,s){const o=new a;return o.outFields=["*"],o.relationshipId="number"==typeof t.id?t.id:parseInt(t.id,10),o.objectIds=[e.attributes[r.objectIdField]],r.queryRelatedFeatures(o,s)}function I(e,t,r){let s=0;const o=[];for(;s<t.length;)o.push(`${e} IN (${t.slice(s,r+s)})`),s+=r;return o.join(" OR ")}async function S(e,t,r,a){const l=r.layerId.toString(),{layerInfo:u,relation:p,relatedFields:c,outStatistics:f,url:d,sourceSpatialReference:m}=t,h=y({originRelationship:p,relationships:u.relationships,layerId:l});if(h.relationshipTableId&&h.keyFieldInRelationshipTable){const t=(await g(e,h,r,a))[e.attributes[r.objectIdField]];if(!t)return null;const o=t.features.map((e=>e.attributes[u.objectIdField]));if(f?.length>0&&u.supportsStatistics){const e=new n;e.where=I(u.objectIdField,o,1e3),e.outFields=c,e.outStatistics=f,e.sourceSpatialReference=m;const r={features:Promise.resolve(t),statsFeatures:i(d,e)};return s(r)}}const F=h?.keyField;if(F){const r=o(U(u.fields,F)),l=j(e.attributes,p.keyField),c=r?`${F}=${l}`:`${F}='${l}'`,f=i(d,new n({where:c,outFields:t.relatedFields,sourceSpatialReference:m}),a),y=t.outStatistics&&t.outStatistics.length>0&&u.supportsStatistics?i(d,new n({where:c,outFields:t.relatedFields,outStatistics:t.outStatistics,sourceSpatialReference:m}),a):null,h={features:f};return y&&(h.statsFeatures=y),s(h)}return null}function w(t,r){return e(t,{query:{f:"json"},signal:r&&r.signal})}function b({relatedInfos:e,layer:r},o){const i={};return e.forEach(((e,s)=>{const{relation:n}=e;if(!n){const e=new t("relation-required","A relation is required on a layer to retrieve related records.");throw c.error(e),e}const{relatedTableId:a}=n;if("number"!=typeof a){const e=new t("A related table ID is required on a layer to retrieve related records.");throw c.error(e),e}const l=`${r.url}/${a}`,u=f.get(l),p=u||w(l,o);u||f.set(l,p),i[s]=p})),s(i)}function R({graphic:e,relatedInfos:t,layer:r},o){const i={};return t.forEach(((t,s)=>{t.layerInfo&&(i[s]=S(e,t,r,o))})),s(i)}function $({relatedInfo:e,fieldName:t,fieldInfo:r}){if(e.relatedFields.push(t),r.statisticType){const s=new l({statisticType:r.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics.push(s)}}function U(e,t){if(null!=e){t=t.toLowerCase();for(const r of e)if(r&&r.name.toLowerCase()===t)return r}return null}export{h as createRelatedInfo,y as getDestinationRelation,d as getRelatedFieldInfo,b as queryLayerInfos,R as queryRelatedFeatures,F as setRelatedFeatures,$ as updateRelatedInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{destroyMaybe as o,isNone as l,isSome as r}from"../../core/maybe.js";import{EsriPromiseMixin as a}from"../../core/Promise.js";import{watch as u}from"../../core/reactiveUtils.js";import{ReentrantObjectPool as c}from"../../core/ReentrantObjectPool.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as F}from"../../intl/locale.js";import{fetchMessageBundle as v}from"../../intl/messages.js";function C(e){return!!e.inputFields}const I=new t({attributes:{}}),E="esri.widgets.FeatureForm.FeatureFormViewModel",V=s.getLogger(E),b="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",A="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let x=class extends(n(a(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressionLookup=new Map,this._expressionLookup=new Map,this._contingentValuesCache=null,this._fieldPool=new c(y,(e=>this.handles.add(u((()=>e.value),(()=>{e.isUsingValueExpression&&this._afterValueChange(e)})),e.id)),(({id:e})=>this.handles.remove(e))),this._fieldGroupPool=new c(_),this._featureClone=I.clone(),this._initialFeature=I.clone(),this._needsArcade=!1,this._inputFieldCache=new Map,this._inputFieldGroupCache=new Map,this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await v("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=u((()=>this.layer),(e=>{"feature"===(null==e?void 0:e.type)&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0}),i=u((()=>{var e,t;const{formTemplate:i}=this;if(l(i))return null;const n=null!=(e=i.expressionInfos)?e:[],s=null!=(t=i.elements)?t:[];return[...n.map((e=>e.expression)),...null==s?void 0:s.map((e=>this._getExpressionsFromElementRecursive(e))).flat()]}),(async e=>{if(!e||e.length<1)return this._compiledExpressionLookup.clear(),void this._expressionLookup.clear();const{_compiledExpressionLookup:t,_expressionLookup:n,formTemplate:s}=this,o=new Set(e);if(n.clear(),r(s)&&r(s.expressionInfos))for(const i of s.expressionInfos)o.delete(i.name),n.set(i.name,i.expression);for(const i of t.keys())o.delete(i),n.set(i,i);if(o.size<1)return;this._needsArcade=!0;const l=await g();this._arcade=l;const{arcadeUtils:a}=l;for(const r of o.values())a.hasGeometryOperations(r)&&(await a.enableGeometryOperations(),i.remove()),n.set(r,r),this._setFunctionForExpression(r);this.notifyChange("inputFields")}),{initial:!0});this.handles.add([F(e),i,t])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._fieldPool.destroy(),this._fieldGroupPool.destroy()}get allInputFields(){return this.inputFields.reduce(((e,t)=>C(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():I.clone(),this._initialFeature=this._featureClone.clone(),this._inputFieldCache.clear(),this._inputFieldGroupCache.clear(),this.contingencyConstraintViolations.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(l(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,_inputFieldGroupCache:s,_needsArcade:o,formTemplate:l,messages:a,layer:u,state:c}=this;if("ready"!==c||o&&!e)return[];const p=t.clone(),d=Array.from(n.keys()),h=Array.from(s.keys()),f={arcade:e,feature:p,initialFeature:i,layer:u,messages:a},m=r(l)&&l.elements.length>0?this._generateInputFieldsFromElements(l.elements,f):this._generateInputFieldsFromLayerFields(null==u?void 0:u.fields,f);return this._cullCaches(m,d,h),this._releasePreviousInputFields(),m.filter((e=>e.visible))}get joinedContingentValues(){return this._joinContingentValues()}get layer(){var e;return null!=(e=this.feature)&&e.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){var t;const{_featureClone:i,layer:n}=this,s=!(null==n||!n.getField(e));return null!=(t=i.getAttribute(e))?t:s?null:void 0}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);t=""===t?null:t,s&&i.getAttribute(e)!==t&&(s.value=t,n&&!s.valid||this._afterValueChange(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,l(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),r=[...s,...null!=t&&t.includeIncompleteViolations?o:[]];for(const l of r)for(const e of l.fieldGroup.fields)n.set(e,l);return r}_cullCaches(e,t,i){const n=[],s=[];for(const o of e)C(o)?(s.push(o.label),n.push(...o.inputFields.map((e=>e.name)))):n.push(o.name);this._cullInputFieldCache(n,t),this._cullInputFieldGroupCache(s,i)}_cullInputFieldCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldCache.delete(n)}_cullInputFieldGroupCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldGroupCache.delete(n)}_releasePreviousInputFields(){const e=this._get("inputFields");if(e&&!(e.length<1))for(const t of e)"groupElement"in t?this._releaseInputFieldGroup(t):this._releaseInputField(t)}_releaseInputFieldGroup(e){e.inputFields.forEach((e=>this._releaseInputField(e))),this._fieldGroupPool.release(e)}_releaseInputField(e){this._fieldPool.release(e)}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_generateInputFieldsFromElements(e,t){const i=[];for(const n of e)this._isSupportedElement(n)&&i.push("group"===n.type?this._acquireAndInitializeInputFieldGroup(n,t):this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(n.fieldName),fieldElement:n,...t}));return i}_generateInputFieldsFromLayerFields(e,t){return Array.isArray(e)?e.map((e=>this._acquireAndInitializeInputField({field:e,fieldElement:null,...t}))):(V.warn(E,"No attribute fields found."),[])}_acquireAndInitializeInputField(e){var t,i,n,s,o,l;const{arcade:r,feature:a,field:u,fieldElement:c,group:p,initialFeature:d,layer:h,messages:f}=e,m=null!=(t=this._getCompiledExpression(null==c?void 0:c.requiredExpression))?t:void 0,g=null!=(i=this._getCompiledExpression(null==c?void 0:c.visibilityExpression))?i:void 0,y=null!=(n=this._getCompiledExpression(null==c?void 0:c.valueExpression))?n:void 0,_=null!=(s=this._getCompiledExpression(null==c?void 0:c.editableExpression))?s:void 0,F=u.name,v=null!=(o=null==(l=this._inputFieldCache.get(F))?void 0:l.value)?o:this.getValue(F),C=this._fieldPool.acquire();return this._inputFieldCache.set(F,C),C.set({field:u,fieldElement:c,arcade:r,feature:a,group:p,initialFeature:d,layer:h,messages:f,requiredFunction:m,visibilityFunction:g,editableFunction:_,valueFunction:y,value:v})}_acquireAndInitializeInputFieldGroup(e,t){var i,n;const s=null!=(i=null==(n=this._inputFieldGroupCache.get(e.label))?void 0:n.state)?i:e.initialState,o=this._fieldGroupPool.acquire();this._inputFieldGroupCache.set(e.label,o);const l=[];for(const c of e.elements)this._isSupportedElement(c)&&l.push(this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(c.fieldName),fieldElement:c,group:o,...t}));const{arcade:r,feature:a}=t,u=this._getCompiledExpression(e.visibilityExpression);return o.set({arcade:r,feature:a,groupElement:e,inputFields:l,state:s,visibilityFunction:u})}_afterValueChange(e){const{name:t,value:i}=e;if(this.get("layer.typeIdField")===e.name&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,i),this.notifyChange("inputFields"),this._emitChangeEvent(e)}_getCompiledExpression(e){return this._compiledExpressionLookup.get(this._expressionLookup.get(e))}_getExpressionsFromElementRecursive(e){const t=[];if(e.visibilityExpression&&t.push(e.visibilityExpression),"field"===e.type){const i=["requiredExpression","valueExpression","editableExpression"];for(const n of i)e[n]&&t.push(e[n])}if("group"===e.type&&e.elements)for(const i of e.elements)t.push(...this._getExpressionsFromElementRecursive(i));return t}_setFunctionForExpression(e){const{_arcade:{arcadeUtils:t},_compiledExpressionLookup:i}=this;i.set(e,t.createFunction(e))}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(V.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(l(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const l of e.fieldGroups){const{contingencies:e,fields:t,name:s}=l,o=[];for(const n of e)n.isRetired||r(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const a of e)for(const e of a.fields)if(t.has(e)){const s=t.get(e),o=a,l=[s.name,o.name].sort().join("|");if(n.has(l))continue;i.push([s,o]),n.add(l),t.set(e,o)}else t.set(e,a);const s=new Set(i.flat()),o=new Set(e);for(const a of s)o.delete(a);const l=new Map,r=new Map;for(const a of new Set(i.flat())){const e=Symbol(a.name);l.set(e,new Set([a])),r.set(a,e)}for(const[a,u]of i){const e=r.get(a),t=r.get(u);if(e===t)continue;const i=l.get(e),n=l.get(t);for(const s of n)i.add(s),r.set(s,e);l.delete(t)}return[[...l.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),a=new Map;for(const l of i.contingencies){const[e]=this._hashContingency(l,s.codedValueFields,!0);a.has(e)?a.get(e).push(l):a.set(e,[l])}for(;t.length>0;){const e=new Map,i=t.shift(),r=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(a,i):a.get(i);if(a.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,a.get(j),s.codedValueFields)),!l(o))for(const a of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(a,t,s.rangeFields):this._joinContingencies(a,t);if(l(i))break;const[n]=this._hashContingency(i,r.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}a=e,n=i,s=r,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(a,e):a.get(e);if(a.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,a.get(j),s.codedValueFields)),!l(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);r(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&r(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:l,rightIsNull:r,bothAreNull:a,leftIsAny:u,rightIsAny:c,bothAreAny:p,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(a||p)continue;if(l&&c||r&&u){n.values[s]=new f({objectType:"null"});continue}if(l&&h||r&&d)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{var n,s;const o=t.values[i],l=e.values[i];return"any"===o.objectType||"any"===l.objectType||(null==(n=o.codedValue)?void 0:n.code)===(null==(s=l.codedValue)?void 0:s.code)}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,r=new Set,a=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(l(e))continue;switch(e.type){case"coded-value":r.add(u);break;case"range":a.add(u)}}return{codedValueFields:[...r],rangeFields:[...a]}}_hashContingency(e,t,i=!1){if(t.length<1)return[b,!1];const n=[];let s=!1;for(const l of t){const t=e.values[l];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${l}:.*`)}else if("null"===t.objectType)n.push(`${l}:${A}`);else{var o;n.push(`${l}:${null==(o=t.codedValue)?void 0:o.code}`)}}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([p({readOnly:!0})],x.prototype,"allInputFields",null),e([p()],x.prototype,"_layerFieldsByName",null),e([p({readOnly:!0})],x.prototype,"_inputFieldCache",void 0),e([p({readOnly:!0})],x.prototype,"_inputFieldGroupCache",void 0),e([p()],x.prototype,"contingencyConstraintViolations",void 0),e([p()],x.prototype,"feature",null),e([p()],x.prototype,"fieldsWithContingentValues",null),e([p({type:h})],x.prototype,"formTemplate",null),e([p({readOnly:!0,dependsOn:["formTemplate","messages","feature","layer.fields","layer.loaded","state"]})],x.prototype,"inputFields",null),e([p()],x.prototype,"joinedContingentValues",null),e([p()],x.prototype,"layer",null),e([p()],x.prototype,"messages",void 0),e([p()],x.prototype,"state",null),e([p()],x.prototype,"strict",void 0),e([p()],x.prototype,"submittable",null),e([p()],x.prototype,"valid",null),e([p()],x.prototype,"getValues",null),e([p()],x.prototype,"submit",null),x=e([d(E)],x);const w=x;export{w as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{destroyMaybe as o,isNone as r,isSome as l}from"../../core/maybe.js";import{EsriPromiseMixin as a}from"../../core/Promise.js";import{watch as u}from"../../core/reactiveUtils.js";import{ReentrantObjectPool as c}from"../../core/ReentrantObjectPool.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as F}from"../../intl/locale.js";import{fetchMessageBundle as C}from"../../intl/messages.js";function v(e){return!!e.inputFields}const I=new t({attributes:{}}),E="esri.widgets.FeatureForm.FeatureFormViewModel",V=s.getLogger(E),b="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",A="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let x=class extends(n(a(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressionLookup=new Map,this._expressionLookup=new Map,this._contingentValuesCache=null,this._fieldPool=new c(y,(e=>this.handles.add(u((()=>e.value),(()=>{e.isUsingValueExpression&&this._afterValueChange(e)})),e.id)),(({id:e})=>this.handles.remove(e))),this._fieldGroupPool=new c(_),this._featureClone=I.clone(),this._initialFeature=I.clone(),this._needsArcade=!1,this._inputFieldCache=new Map,this._inputFieldGroupCache=new Map,this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await C("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=u((()=>this.layer),(e=>{"feature"===e?.type&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0}),i=u((()=>{const{formTemplate:e}=this;if(r(e))return null;const t=e.expressionInfos??[],i=e.elements??[];return[...t.map((e=>e.expression)),...i?.map((e=>this._getExpressionsFromElementRecursive(e))).flat()]}),(async e=>{if(!e||e.length<1)return this._compiledExpressionLookup.clear(),void this._expressionLookup.clear();const{_compiledExpressionLookup:t,_expressionLookup:n,formTemplate:s}=this,o=new Set(e);if(n.clear(),l(s)&&l(s.expressionInfos))for(const i of s.expressionInfos)o.delete(i.name),n.set(i.name,i.expression);for(const i of t.keys())o.delete(i),n.set(i,i);if(o.size<1)return;this._needsArcade=!0;const r=await g();this._arcade=r;const{arcadeUtils:a}=r;for(const l of o.values())a.hasGeometryOperations(l)&&(await a.enableGeometryOperations(),i.remove()),n.set(l,l),this._setFunctionForExpression(l);this.notifyChange("inputFields")}),{initial:!0});this.handles.add([F(e),i,t])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._fieldPool.destroy(),this._fieldGroupPool.destroy()}get allInputFields(){return this.inputFields.reduce(((e,t)=>v(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():I.clone(),this._initialFeature=this._featureClone.clone(),this._inputFieldCache.clear(),this._inputFieldGroupCache.clear(),this.contingencyConstraintViolations.clear(),this._set("feature",e)}get fieldsWithContingentValues(){if(r(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,_inputFieldGroupCache:s,_needsArcade:o,formTemplate:r,messages:a,layer:u,state:c}=this;if("ready"!==c||o&&!e)return[];const p=t.clone(),d=Array.from(n.keys()),h=Array.from(s.keys()),f={arcade:e,feature:p,initialFeature:i,layer:u,messages:a},m=l(r)&&r.elements.length>0?this._generateInputFieldsFromElements(r.elements,f):this._generateInputFieldsFromLayerFields(u?.fields,f);return this._cullCaches(m,d,h),this._releasePreviousInputFields(),m.filter((e=>e.visible))}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:i}=this,n=!!i?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);t=""===t?null:t,s&&i.getAttribute(e)!==t&&(s.value=t,n&&!s.valid||this._afterValueChange(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,r(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),l=[...s,...t?.includeIncompleteViolations?o:[]];for(const r of l)for(const e of r.fieldGroup.fields)n.set(e,r);return l}_cullCaches(e,t,i){const n=[],s=[];for(const o of e)v(o)?(s.push(o.label),n.push(...o.inputFields.map((e=>e.name)))):n.push(o.name);this._cullInputFieldCache(n,t),this._cullInputFieldGroupCache(s,i)}_cullInputFieldCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldCache.delete(n)}_cullInputFieldGroupCache(e,t){const i=t.filter((t=>!e.includes(t)));for(const n in i)this._inputFieldGroupCache.delete(n)}_releasePreviousInputFields(){const e=this._get("inputFields");if(e&&!(e.length<1))for(const t of e)"groupElement"in t?this._releaseInputFieldGroup(t):this._releaseInputField(t)}_releaseInputFieldGroup(e){e.inputFields.forEach((e=>this._releaseInputField(e))),this._fieldGroupPool.release(e)}_releaseInputField(e){this._fieldPool.release(e)}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_generateInputFieldsFromElements(e,t){const i=[];for(const n of e)this._isSupportedElement(n)&&i.push("group"===n.type?this._acquireAndInitializeInputFieldGroup(n,t):this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(n.fieldName),fieldElement:n,...t}));return i}_generateInputFieldsFromLayerFields(e,t){return Array.isArray(e)?e.map((e=>this._acquireAndInitializeInputField({field:e,fieldElement:null,...t}))):(V.warn(E,"No attribute fields found."),[])}_acquireAndInitializeInputField(e){const{arcade:t,feature:i,field:n,fieldElement:s,group:o,initialFeature:r,layer:l,messages:a}=e,u=this._getCompiledExpression(s?.requiredExpression)??void 0,c=this._getCompiledExpression(s?.visibilityExpression)??void 0,p=this._getCompiledExpression(s?.valueExpression)??void 0,d=this._getCompiledExpression(s?.editableExpression)??void 0,h=n.name,f=this._inputFieldCache.get(h)?.value??this.getValue(h),m=this._fieldPool.acquire();return this._inputFieldCache.set(h,m),m.set({field:n,fieldElement:s,arcade:t,feature:i,group:o,initialFeature:r,layer:l,messages:a,requiredFunction:u,visibilityFunction:c,editableFunction:d,valueFunction:p,value:f})}_acquireAndInitializeInputFieldGroup(e,t){const i=this._inputFieldGroupCache.get(e.label)?.state??e.initialState,n=this._fieldGroupPool.acquire();this._inputFieldGroupCache.set(e.label,n);const s=[];for(const a of e.elements)this._isSupportedElement(a)&&s.push(this._acquireAndInitializeInputField({field:this._layerFieldsByName.get(a.fieldName),fieldElement:a,group:n,...t}));const{arcade:o,feature:r}=t,l=this._getCompiledExpression(e.visibilityExpression);return n.set({arcade:o,feature:r,groupElement:e,inputFields:s,state:i,visibilityFunction:l})}_afterValueChange(e){const{name:t,value:i}=e;if(this.get("layer.typeIdField")===e.name&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,i),this.notifyChange("inputFields"),this._emitChangeEvent(e)}_getCompiledExpression(e){return this._compiledExpressionLookup.get(this._expressionLookup.get(e))}_getExpressionsFromElementRecursive(e){const t=[];if(e.visibilityExpression&&t.push(e.visibilityExpression),"field"===e.type){const i=["requiredExpression","valueExpression","editableExpression"];for(const n of i)e[n]&&t.push(e[n])}if("group"===e.type&&e.elements)for(const i of e.elements)t.push(...this._getExpressionsFromElementRecursive(i));return t}_setFunctionForExpression(e){const{_arcade:{arcadeUtils:t},_compiledExpressionLookup:i}=this;i.set(e,t.createFunction(e))}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(V.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(r(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:s}=r,o=[];for(const n of e)n.isRetired||l(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const a of e)for(const e of a.fields)if(t.has(e)){const s=t.get(e),o=a,r=[s.name,o.name].sort().join("|");if(n.has(r))continue;i.push([s,o]),n.add(r),t.set(e,o)}else t.set(e,a);const s=new Set(i.flat()),o=new Set(e);for(const a of s)o.delete(a);const r=new Map,l=new Map;for(const a of new Set(i.flat())){const e=Symbol(a.name);r.set(e,new Set([a])),l.set(a,e)}for(const[a,u]of i){const e=l.get(a),t=l.get(u);if(e===t)continue;const i=r.get(e),n=r.get(t);for(const s of n)i.add(s),l.set(s,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),a=new Map;for(const r of i.contingencies){const[e]=this._hashContingency(r,s.codedValueFields,!0);a.has(e)?a.get(e).push(r):a.set(e,[r])}for(;t.length>0;){const e=new Map,i=t.shift(),l=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(a,i):a.get(i);if(a.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,a.get(j),s.codedValueFields)),!r(o))for(const a of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(a,t,s.rangeFields):this._joinContingencies(a,t);if(r(i))break;const[n]=this._hashContingency(i,l.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}a=e,n=i,s=l,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(a,e):a.get(e);if(a.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,a.get(j),s.codedValueFields)),!r(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);l(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&l(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:r,rightIsNull:l,bothAreNull:a,leftIsAny:u,rightIsAny:c,bothAreAny:p,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(a||p)continue;if(r&&c||l&&u){n.values[s]=new f({objectType:"null"});continue}if(r&&h||l&&d)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{const n=t.values[i],s=e.values[i];return"any"===n.objectType||"any"===s.objectType||n.codedValue?.code===s.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,l=new Set,a=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(r(e))continue;switch(e.type){case"coded-value":l.add(u);break;case"range":a.add(u)}}return{codedValueFields:[...l],rangeFields:[...a]}}_hashContingency(e,t,i=!1){if(t.length<1)return[b,!1];const n=[];let s=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${A}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([p({readOnly:!0})],x.prototype,"allInputFields",null),e([p()],x.prototype,"_layerFieldsByName",null),e([p({readOnly:!0})],x.prototype,"_inputFieldCache",void 0),e([p({readOnly:!0})],x.prototype,"_inputFieldGroupCache",void 0),e([p()],x.prototype,"contingencyConstraintViolations",void 0),e([p()],x.prototype,"feature",null),e([p()],x.prototype,"fieldsWithContingentValues",null),e([p({type:h})],x.prototype,"formTemplate",null),e([p({readOnly:!0,dependsOn:["formTemplate","messages","feature","layer.fields","layer.loaded","state"]})],x.prototype,"inputFields",null),e([p()],x.prototype,"joinedContingentValues",null),e([p()],x.prototype,"layer",null),e([p()],x.prototype,"messages",void 0),e([p()],x.prototype,"state",null),e([p()],x.prototype,"strict",void 0),e([p()],x.prototype,"submittable",null),e([p()],x.prototype,"valid",null),e([p()],x.prototype,"getValues",null),e([p()],x.prototype,"submit",null),x=e([d(E)],x);const w=x;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as l,isNone as r,get as n}from"../../core/maybe.js";import{watch as o}from"../../core/reactiveUtils.js";import{generateUID as s}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as p,DomainValidationError as c,getDomainRange as m}from"../../layers/support/domainUtils.js";import{isNumericField as h,isStringField as y,isDateField as v,TypeValidationError as f,validateFieldValue as g,getFeatureEditFields as E,getFeatureGeometryFields as b,NumericRangeValidationError as _,getFieldRange as x}from"../../layers/support/fieldUtils.js";import{substitute as F}from"../../intl/substitute.js";var V,O;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(V||(V={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(O||(O={}));const U={type:"number"},T={type:"number",intlOptions:{notation:"scientific"}},j={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};function A(e){return e>=1e7||e<=-1e7}let D=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.arcade=null,this.editableFunction=null,this.id=s().toString(),this.requiredFunction=null,this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){this.handles.add(o((()=>this.value),((e,t)=>{if(e!==t){const{feature:e,name:t,value:i}=this;e.setAttribute(t,i)}})))}get _configAllowsEdits(){var e,t,i;const{fieldElement:r,layer:n,name:o}=this;if(l(r))return!1!==r.editable;const s="subtype-group"!==(null==n?void 0:n.type)?null==n||null==(e=n.popupTemplate)||null==(t=e.fieldInfos)?void 0:t.find((({fieldName:e})=>e===o)):null;return null==(i=null==s?void 0:s.isEditable)||i}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return(null==t?void 0:t.capabilities.operations.supportsEditing)&&(null==e?void 0:e.editable)}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedRequiredExpression(){const{requiredFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedVisibilityExpression(){const{visibilityFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedValueExpression(){const{valueFunction:e}=this;if(r(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){var e;const{typeIdField:t}=this.layer,i=t===this.name,r=null==(e=this.field)?void 0:e.domain;if(i&&!r){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new d({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:o}=this,s=t&&this.layer.getFieldDomain(this.name,{feature:o})||r,a=n(this.fieldElement,"domain");return l(a)&&this._isDomainCompatible(a)?a:s}get editable(){var e;return!!this._layerFieldAllowsEdits&&(null!=(e=this.evaluatedEditableExpression)?e:this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){var e;const{fieldElement:t}=this,i=l(t)&&"datetime-picker"===(null==(e=t.input)?void 0:e.type)?t.input.includeTime:void 0;return void 0===i||i}get label(){return l(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&N(i.input)?i.input.maxLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:r}get minLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,r=null==t?void 0:t.length,n=l(i)&&N(i.input)?i.input.minLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:e}get required(){var e,t;return!!this.editable&&(!1===(null==(e=this.field)?void 0:e.nullable)||null!=(t=this.evaluatedRequiredExpression)&&t)}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return!!i||(!t||!r(l))&&this.initialFeature.getAttribute(e.name)===l}get type(){const{field:e}=this;return h(e)?V.Number:y(e)?V.Text:v(e)?V.Date:V.Unsupported}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){return this._shouldUseValueExpression()?this.evaluatedValueExpression:this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(l(this.fieldElement)?null==(e=this.evaluatedVisibilityExpression)||e:this._isVisibleByDefault());var e}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===(null==e?void 0:e.type)){const i=typeof e.codedValues[0].code;if("string"===i&&y(t)||"number"===i&&h(t))return!0}return!!("range"===(null==e?void 0:e.type)&&h(t)||v(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:l,required:r,type:n,valid:o,value:s}=this,a=r&&null===s,u=void 0!==o;return!a&&i.getAttribute(t.name)===s&&u?null:"text"===n&&l>-1&&"string"==typeof s&&s.length<l?O.TOO_SHORT:e?null!==s||r?p(e,s):null:a?f.INVALID_TYPE:g(t,s)}_isVisibleByDefault(){var e;const t=null==(e=this.field)?void 0:e.type;return"oid"!==t&&"global-id"!==t&&!this._isGeometryField()}_isEditorField(){return E(this.layer).includes(this.name)}_isGeometryField(){return b(this.layer).includes(this.name)}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&l(this.valueFunction)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:l,value:r,required:n,type:o}=this,s=this.error;if(n&&null===r)return i.validationErrors.cannotBeNull;if(s===c.VALUE_OUT_OF_RANGE||s===_.OUT_OF_RANGE){const l=m(e)||x(t);return F(i.validationErrors.outsideRange,l,{format:{max:"date"===o?j:A(l.max)?T:U,min:"date"===o?j:A(l.min)?T:U}})}return s===c.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:s===f.INVALID_TYPE?i.validationErrors.invalidType:s===O.TOO_SHORT?F(i.validationErrors.tooShort,{min:l}):null}};function N(e){return!!e&&"maxLength"in e}e([a()],D.prototype,"_storedValue",void 0),e([a()],D.prototype,"_configAllowsEdits",null),e([a()],D.prototype,"_layerFieldAllowsEdits",null),e([a()],D.prototype,"arcade",void 0),e([a()],D.prototype,"editableFunction",void 0),e([a()],D.prototype,"requiredFunction",void 0),e([a()],D.prototype,"valueFunction",void 0),e([a()],D.prototype,"isUsingValueExpression",null),e([a()],D.prototype,"visibilityFunction",void 0),e([a()],D.prototype,"evaluatedEditableExpression",null),e([a()],D.prototype,"evaluatedRequiredExpression",null),e([a()],D.prototype,"evaluatedVisibilityExpression",null),e([a()],D.prototype,"evaluatedValueExpression",null),e([a()],D.prototype,"feature",void 0),e([a()],D.prototype,"field",void 0),e([a()],D.prototype,"fieldElement",void 0),e([a()],D.prototype,"initialFeature",null),e([a()],D.prototype,"layer",void 0),e([a({aliasOf:"fieldElement.description"})],D.prototype,"description",void 0),e([a()],D.prototype,"domain",null),e([a()],D.prototype,"editable",null),e([a({aliasOf:"fieldElement.input.type"})],D.prototype,"inputType",void 0),e([a({readOnly:!0})],D.prototype,"error",void 0),e([a({dependsOn:["error","messages","value"]})],D.prototype,"errorMessage",null),e([a()],D.prototype,"group",void 0),e([a({aliasOf:"fieldElement.hint"})],D.prototype,"hint",void 0),e([a()],D.prototype,"includeTime",null),e([a()],D.prototype,"label",null),e([a()],D.prototype,"maxLength",null),e([a()],D.prototype,"minLength",null),e([a()],D.prototype,"messages",void 0),e([a({aliasOf:"field.name"})],D.prototype,"name",void 0),e([a()],D.prototype,"required",null),e([a()],D.prototype,"submittable",null),e([a()],D.prototype,"type",null),e([a()],D.prototype,"valid",null),e([a({value:null})],D.prototype,"value",null),e([a()],D.prototype,"visible",null),D=e([u("esri.widgets.FeatureForm.InputField")],D);const L=D;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{isSome as r,isNone as s,get as l}from"../../core/maybe.js";import{watch as n}from"../../core/reactiveUtils.js";import{generateUID as o}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as p,DomainValidationError as c,getDomainRange as m}from"../../layers/support/domainUtils.js";import{isNumericField as h,isStringField as y,isDateField as f,TypeValidationError as v,validateFieldValue as g,getFeatureEditFields as E,getFeatureGeometryFields as b,NumericRangeValidationError as _,getFieldRange as x}from"../../layers/support/fieldUtils.js";import{substitute as F}from"../../intl/substitute.js";var V,O;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(V||(V={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(O||(O={}));const U={type:"number"},T={type:"number",intlOptions:{notation:"scientific"}},j={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};function A(e){return e>=1e7||e<=-1e7}let D=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this.arcade=null,this.editableFunction=null,this.id=o().toString(),this.requiredFunction=null,this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){this.handles.add(n((()=>this.value),((e,t)=>{if(e!==t){const{feature:e,name:t,value:i}=this;e.setAttribute(t,i)}})))}get _configAllowsEdits(){const{fieldElement:e,layer:t,name:i}=this;if(r(e))return!1!==e.editable;return("subtype-group"!==t?.type?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null)?.isEditable??!0}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return t?.capabilities.operations.supportsEditing&&e?.editable}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e}=this;if(s(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedRequiredExpression(){const{requiredFunction:e}=this;if(s(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedVisibilityExpression(){const{visibilityFunction:e}=this;if(s(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}get evaluatedValueExpression(){const{valueFunction:e}=this;if(s(e))return null;const{arcade:t}=this;return t.arcadeUtils.executeFunction(e,t.arcadeUtils.createExecContext(this.feature))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){const{typeIdField:e}=this.layer,t=e===this.name,i=this.field?.domain;if(t&&!i){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new d({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:s}=this,n=e&&this.layer.getFieldDomain(this.name,{feature:s})||i,o=l(this.fieldElement,"domain");return r(o)&&this._isDomainCompatible(o)?o:n}get editable(){return!!this._layerFieldAllowsEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){const{fieldElement:e}=this,t=r(e)&&"datetime-picker"===e.input?.type?e.input.includeTime:void 0;return void 0===t||t}get label(){return r(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,s=t?.length,l=r(i)&&N(i.input)?i.input.maxLength:NaN;return!isNaN(l)&&l>=e&&(s===e||l<=s)?l:s}get minLength(){const e=-1;if(this.type===V.Date)return e;const{field:t,fieldElement:i}=this,s=t?.length,l=r(i)&&N(i.input)?i.input.minLength:NaN;return!isNaN(l)&&l>=e&&(s===e||l<=s)?l:e}get required(){return!!this.editable&&(!1===this.field?.nullable||(this.evaluatedRequiredExpression??!1))}get submittable(){const{field:e,required:t,valid:i,value:r}=this;return!!i||(!t||!s(r))&&this.initialFeature.getAttribute(e.name)===r}get type(){const{field:e}=this;return h(e)?V.Number:y(e)?V.Text:f(e)?V.Date:V.Unsupported}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){return this._shouldUseValueExpression()?this.evaluatedValueExpression:this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(r(this.fieldElement)?this.evaluatedVisibilityExpression??!0:this._isVisibleByDefault())}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&y(t)||"number"===i&&h(t))return!0}return!!("range"===e?.type&&h(t)||f(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:r,required:s,type:l,valid:n,value:o}=this,a=s&&null===o,u=void 0!==n;return!a&&i.getAttribute(t.name)===o&&u?null:"text"===l&&r>-1&&"string"==typeof o&&o.length<r?O.TOO_SHORT:e?null!==o||s?p(e,o):null:a?v.INVALID_TYPE:g(t,o)}_isVisibleByDefault(){const e=this.field?.type;return"oid"!==e&&"global-id"!==e&&!this._isGeometryField()}_isEditorField(){return E(this.layer).includes(this.name)}_isGeometryField(){return b(this.layer).includes(this.name)}_shouldUseValueExpression(){return this._layerFieldAllowsEdits&&!this._configAllowsEdits&&r(this.valueFunction)}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:r,value:s,required:l,type:n}=this,o=this.error;if(l&&null===s)return i.validationErrors.cannotBeNull;if(o===c.VALUE_OUT_OF_RANGE||o===_.OUT_OF_RANGE){const r=m(e)||x(t);return F(i.validationErrors.outsideRange,r,{format:{max:"date"===n?j:A(r.max)?T:U,min:"date"===n?j:A(r.min)?T:U}})}return o===c.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:o===v.INVALID_TYPE?i.validationErrors.invalidType:o===O.TOO_SHORT?F(i.validationErrors.tooShort,{min:r}):null}};function N(e){return!!e&&"maxLength"in e}e([a()],D.prototype,"_storedValue",void 0),e([a()],D.prototype,"_configAllowsEdits",null),e([a()],D.prototype,"_layerFieldAllowsEdits",null),e([a()],D.prototype,"arcade",void 0),e([a()],D.prototype,"editableFunction",void 0),e([a()],D.prototype,"requiredFunction",void 0),e([a()],D.prototype,"valueFunction",void 0),e([a()],D.prototype,"isUsingValueExpression",null),e([a()],D.prototype,"visibilityFunction",void 0),e([a()],D.prototype,"evaluatedEditableExpression",null),e([a()],D.prototype,"evaluatedRequiredExpression",null),e([a()],D.prototype,"evaluatedVisibilityExpression",null),e([a()],D.prototype,"evaluatedValueExpression",null),e([a()],D.prototype,"feature",void 0),e([a()],D.prototype,"field",void 0),e([a()],D.prototype,"fieldElement",void 0),e([a()],D.prototype,"initialFeature",null),e([a()],D.prototype,"layer",void 0),e([a({aliasOf:"fieldElement.description"})],D.prototype,"description",void 0),e([a()],D.prototype,"domain",null),e([a()],D.prototype,"editable",null),e([a({aliasOf:"fieldElement.input.type"})],D.prototype,"inputType",void 0),e([a({readOnly:!0})],D.prototype,"error",void 0),e([a({dependsOn:["error","messages","value"]})],D.prototype,"errorMessage",null),e([a()],D.prototype,"group",void 0),e([a({aliasOf:"fieldElement.hint"})],D.prototype,"hint",void 0),e([a()],D.prototype,"includeTime",null),e([a()],D.prototype,"label",null),e([a()],D.prototype,"maxLength",null),e([a()],D.prototype,"minLength",null),e([a()],D.prototype,"messages",void 0),e([a({aliasOf:"field.name"})],D.prototype,"name",void 0),e([a()],D.prototype,"required",null),e([a()],D.prototype,"submittable",null),e([a()],D.prototype,"type",null),e([a()],D.prototype,"valid",null),e([a({value:null})],D.prototype,"value",null),e([a()],D.prototype,"visible",null),D=e([u("esri.widgets.FeatureForm.InputField")],D);const L=D;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../layers/support/RangeDomain.js";import i from"../FieldConfig.js";import n from"../FieldGroupConfig.js";function t(e){var i;const n={},t=[];return null==(i=e.expressionInfos)||i.map((e=>n[e.name]=e.expression)),{config:o(e.elements,n,t),encounteredUnsupportedTypes:t}}function l(n,t,l){const{description:o,domain:a,editable:s,fieldName:p,hint:r,input:u,label:m,requiredExpression:d,visibilityExpression:f}=n,c=t[d]||null,y=t[f]||null,x=new i({description:o,domain:a,editable:s,hint:r,label:m,name:p,requiredExpression:c,visibilityExpression:y});if(u)if("barcode-scanner"===u.type||"text-area"===u.type||"text-box"===u.type)x.minLength=u.minLength,x.maxLength=u.maxLength;else if("combo-box"===u.type||"radio-buttons"===u.type)x.noValueOptionLabel=u.noValueOptionLabel,x.showNoValueOption=u.showNoValueOption;else if("switch"===u.type)x.offValue=u.offValue,x.onValue=u.onValue;else if("datetime-picker"===u.type){x.includeTime=u.includeTime;const{max:i,min:n}=u;if(i||n){const t="range"===(null==a?void 0:a.type)?Math.min(null==i?void 0:i.getTime(),a.maxValue):null==i?void 0:i.getTime(),l="range"===(null==a?void 0:a.type)?Math.max(null==n?void 0:n.getTime(),a.minValue):null==n?void 0:n.getTime();x.domain=new e({maxValue:t,minValue:l,name:"__internal-range-domain-based-on-datetime-picker-input__"})}}else l.push({type:"unsupported-input-type",details:u});return x}function o(e,i,t,a=!0){return e.map((e=>{if("field"===e.type)return l(e,i,t);if("group"===e.type){if(!a)return t.push({type:"nested-group",details:e}),null;const l=i[e.visibilityExpression]||null;return new n({description:e.description,state:e.initialState,fieldConfig:o(e.elements,i,t,!1),label:e.label,visibilityExpression:l})}return t.push({type:"unsupported-element-type",details:e}),null})).filter((e=>!!e))}export{t as fieldConfigsFromFormTemplate};
5
+ import e from"../../../layers/support/RangeDomain.js";import i from"../FieldConfig.js";import n from"../FieldGroupConfig.js";function t(e){const i={},n=[];return e.expressionInfos?.map((e=>i[e.name]=e.expression)),{config:a(e.elements,i,n),encounteredUnsupportedTypes:n}}function o(n,t,o){const{description:a,domain:l,editable:s,fieldName:p,hint:r,input:u,label:m,requiredExpression:d,visibilityExpression:f}=n,c=t[d]||null,y=t[f]||null,x=new i({description:a,domain:l,editable:s,hint:r,label:m,name:p,requiredExpression:c,visibilityExpression:y});if(u)if("barcode-scanner"===u.type||"text-area"===u.type||"text-box"===u.type)x.minLength=u.minLength,x.maxLength=u.maxLength;else if("combo-box"===u.type||"radio-buttons"===u.type)x.noValueOptionLabel=u.noValueOptionLabel,x.showNoValueOption=u.showNoValueOption;else if("switch"===u.type)x.offValue=u.offValue,x.onValue=u.onValue;else if("datetime-picker"===u.type){x.includeTime=u.includeTime;const{max:i,min:n}=u;if(i||n){const t="range"===l?.type?Math.min(i?.getTime(),l.maxValue):i?.getTime(),o="range"===l?.type?Math.max(n?.getTime(),l.minValue):n?.getTime();x.domain=new e({maxValue:t,minValue:o,name:"__internal-range-domain-based-on-datetime-picker-input__"})}}else o.push({type:"unsupported-input-type",details:u});return x}function a(e,i,t,l=!0){return e.map((e=>{if("field"===e.type)return o(e,i,t);if("group"===e.type){if(!l)return t.push({type:"nested-group",details:e}),null;const o=i[e.visibilityExpression]||null;return new n({description:e.description,state:e.initialState,fieldConfig:a(e.elements,i,t,!1),label:e.label,visibilityExpression:o})}return t.push({type:"unsupported-element-type",details:e}),null})).filter((e=>!!e))}export{t as fieldConfigsFromFormTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{neverReached as t}from"../core/compilerUtils.js";import{isSome as i,isNone as a}from"../core/maybe.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{getDomainRange as r}from"../layers/support/domainUtils.js";import{getFieldRange as o}from"../layers/support/fieldUtils.js";import u from"./Widget.js";import d from"./FeatureForm/FeatureFormViewModel.js";import{Heading as p,incrementHeadingLevel as c}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{DateTime as _}from"luxon";import{getLocale as v}from"../intl/locale.js";const g={base:"esri-feature-form",form:"esri-feature-form__form",formHeader:"esri-feature-form__form-header",label:"esri-feature-form__label",inputField:"esri-feature-form__input",inputDate:"esri-feature-form__input--date",inputTime:"esri-feature-form__input--time",inputRadioGroup:"esri-feature-form__input--radio-group",inputRadio:"esri-feature-form__input--radio",inputRadioLabel:"esri-feature-form__input--radio-label",inputDisabled:"esri-feature-form__input--disabled",inputSwitch:"esri-feature-form__input--switch",inputInvalid:"esri-feature-form__input--invalid",inputIconInvalid:"esri-feature-form__input-icon--invalid",errorMessage:"esri-feature-form__field-error-message",description:"esri-feature-form__description-text",dateInputPart:"esri-feature-form__date-input-part",loneDateInputPart:"esri-feature-form__date-input-part--lone",dateInputContainer:"esri-feature-form__date-input-container",dateFormatHint:"esri-feature-form__date-format-hint",group:"esri-feature-form__group",groupLabel:"esri-feature-form__group-label",groupHeader:"esri-feature-form__group-header",groupHeading:"esri-feature-form__group-header",groupTitle:"esri-feature-form__group-title",groupDescription:"esri-feature-form__group-description",groupToggleIcon:"esri-feature-form__group-toggle-icon",groupCollapsed:"esri-feature-form__group--collapsed",groupSequential:"esri-feature-form__group--sequential",groupActive:"esri-feature-form__group--active",collapseIcon:"esri-icon-up",errorIcon:"esri-icon-notice-triangle",expandIcon:"esri-icon-down",widget:"esri-widget",panel:"esri-widget--panel",input:"esri-input",select:"esri-select"},b={datePattern:"D",timePattern:"tt"};function I(e){return e&&e.inputFields}const F="data-field-name";let y=class extends u{constructor(e,t){super(e,t),this._activeDateFieldEdit=null,this._activeInputName=null,this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedInputFieldNames=new Set,this.feature=null,this.formTemplate=null,this.groupDisplay="all",this.headingLevel=2,this.label=void 0,this.layer=null,this.messages=null,this.messagesTemplates=null,this.strict=null,this.viewModel=new d,this._handleSwitchClick=e=>{e.target===e.currentTarget&&e.stopImmediatePropagation()},this._handleRadioInputChange=e=>{this._commitInputValue(e.target)},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget,!0)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this)}initialize(){this.own([this.watch("feature",(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e&&e.name,this._userUpdatedInputFieldNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedInputFieldNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}}))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-combobox.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),import("@esri/calcite-components/dist/components/calcite-input-message.js"),import("@esri/calcite-components/dist/components/calcite-switch.js")])}destroy(){this._userUpdatedInputFieldNames.clear(),this._userUpdatedInputFieldNames=null}getValues(){return null}submit(){return null}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(g.base,g.widget,g.panel)},"ready"===e?this.renderForm():null)}renderForm(){var e,t;const i=null!=(e=this.formTemplate)&&e.title?f(p,{key:"title",level:this.headingLevel},this.formTemplate.title):null,a=null!=(t=this.formTemplate)&&t.description?f("p",{class:g.description,key:"description"},this.formTemplate.description):null,n=i||a?f("div",{class:g.formHeader},i,a):null;return f("form",{class:g.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},n,this.renderFields())}renderFields(){const{viewModel:{inputFields:e}}=this;return e.map(((e,t)=>I(e)?this.renderGroup(e,t):this.renderLabeledField(e)))}renderGroup(e,t){var i;const{description:a,inputFields:n,label:l,state:s}=e,r=n.filter((e=>e.visible)),o=this.viewModel.findField(this._activeInputName),u=!(!o||o.group!==e),d=`${this.id}_group_${t}`,m=`${this.id}_group-label_${t}`,h=`${this.id}_group-description_${t}`,_=a?f("p",{class:this.classes(g.groupDescription,g.description),id:h},a):null,v="sequential"===this.groupDisplay,b=v?u:"expanded"===s,I=b?g.collapseIcon:g.expandIcon;return f("fieldset",{"aria-expanded":b.toString(),"aria-labelledby":m,"aria-describedby":a?h:"",class:this.classes(g.group,v?g.groupSequential:null,b?null:g.groupCollapsed,u?g.groupActive:null),"data-group":e,id:d,key:t,onclick:this._handleGroupClick},f("button",{role:v?"presentation":void 0,class:g.groupHeader,type:"button",tabIndex:v?-1:0},f("div",{class:g.groupTitle},f(p,{class:g.groupLabel,id:m,level:null!=(i=this.formTemplate)&&i.title?c(this.headingLevel):this.headingLevel},l),_),v?null:f("span",{class:this.classes(I,g.groupToggleIcon)})),r.map((e=>this.renderLabeledField(e))))}_getFocusableInput(e,t){const i=this.viewModel.allInputFields,a="forward"===e?i:i.slice().reverse();let n;if(t)if(I(t))n=a.indexOf(t.inputFields[0]);else{let i;if(this._isInputFieldInGroup(t)&&"collapsed"===t.group.state){const{inputFields:a}=t.group;i="forward"===e?a[a.length-1]:a[0]}else i=t;n=a.indexOf(i)+1}else n=0;for(let l=n;l<a.length;l++){const e=a[l];if(e.visible)return e}return null}renderLabeledField(e){const{label:t,layer:i,type:a}=e;return f("label",{key:`${i.id}-${e.name}`,class:g.label},[t,"unsupported"!==a?this.renderInputField(e):this.renderUnsupportedField(e),this.renderAuxiliaryText(e)])}renderInputField(e){const{domain:t,name:a,type:n,value:l}=e,s=this.getCommonInputProps(e);if("coded-value"===(null==t?void 0:t.type)){if(this._inputFieldHasInputType(e,"switch")){const{fieldElement:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(a)||null==l||t.input.onValue!==l&&t.input.offValue!==l))return this.renderSwitchInputField(e,s);this._switchFieldsWithInitialIncompatibleValue.add(a)}return"radio-buttons"===e.inputType?this.renderRadioButtonsInputField(e,t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),s):this.renderSelectInputField(e,this._getFieldValueOptions(a,t),s)}return"datetime-picker"===e.inputType||"date"===n?this.renderDateInputField(e,s):"number"===n?f("input",{type:"number",...s,value:i(this._activeNumberFieldEdit)&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${s.value}`}):"text-area"===e.inputType?f("textarea",{...s}):f("input",{type:"text",...s})}_parseDateTime(e,t,i){if(i){var a;let n=_.fromJSDate(this._parseDate(e,i));const l=_.fromMillis(null!=(a=t.value)?a:Date.now());return n="date"===i?n.set({hour:l.hour,minute:l.minute,second:l.second}):n.set({day:l.day,month:l.month,year:l.year}),n.isValid?n.toMillis():null}const n=_.fromJSDate(this._parseDate(e));return n.isValid?n.toMillis():null}renderDateInputField(e,t){const{value:i,includeTime:a}=e,{date:n,time:l}=this._formatDate(0),s=`${this.id}-${t.key}`,r=`${s}-date`,o=`${s}-time`,{_activeDateFieldEdit:u}=this;let{date:d,time:p}=this._formatDate(i);var c,m,h,_;(null==u?void 0:u.fieldName)===e.name&&(d=null!=(c=null==(m=u.date.input)?void 0:m.value)?c:d,p=null!=(h=null==(_=u.time.input)?void 0:_.value)?h:p);return f("div",{key:`${t.key}-date`,class:g.dateInputContainer},f("div",{class:this.classes(g.dateInputPart,a?null:g.loneDateInputPart)},f("input",{"aria-label":e.label,"aria-describedby":r,type:"text",...t,"data-date-part":"date",class:this.classes(t.class,g.inputDate),value:d}),f("div",{class:g.dateFormatHint,id:r},n)),a?f("div",{class:g.dateInputPart,key:"time-input"},f("input",{"aria-describedby":o,"aria-label":e.label,type:"text",...t,"data-date-part":"time",class:this.classes(t.class,g.inputTime),value:p}),f("div",{class:g.dateFormatHint,id:o},l)):null)}renderUnsupportedField(e){const t=this.getCommonInputProps(e);return f("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(g.input,g.inputField,g.inputDisabled),onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value,[F]:t[F]})}renderSelectInputField(e,t,i){const{value:n}=e,{messages:l,messagesTemplates:s}=this,r=t.map((e=>e.map((e=>f("calcite-combobox-item",{value:`${e.value}`,"text-label":e.name,key:`#${e.value}`,selected:n===e.value}))))),[o,u]=r;this._registerIncompatibleValue(n,t.flat(),e,(e=>{u.unshift(f("calcite-combobox-item",{value:`${e}`,"text-label":`${e}`,key:"incompatible-option",readOnly:!0}))}));const d=u.length>0?[f("calcite-combobox-item-group",{key:"recommended",label:l.recommended},o),f("calcite-combobox-item-group",{key:"other",label:s.other},u)]:o,p=a(e.fieldElement)||this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.showNoValueOption;if(!e.required&&p){const t="",i=this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty;d.unshift(f("calcite-combobox-item",{value:t,"text-label":this.messages.empty,key:"empty-option"},i))}return f("calcite-combobox",{...i,"selection-mode":"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},d)}_registerIncompatibleValue(e,t,i,a){const n=this._fieldToInitialIncompatibleDomainValue,l=n.has(i.name);(l||null!=e&&""!==e&&!t.some((t=>t.value===e))||l)&&(l||n.set(i.name,e),null==a||a(n.get(i.name)))}renderRadioButtonsInputField(e,t,i){const{value:n}=e,l=t.map((t=>this.renderRadioButton({key:t.name,label:t.name,name:e.name,value:t.value,selected:t.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const s=a(e.fieldElement)||this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.showNoValueOption;if(!e.required&&s){const t="",a=this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty,s=n===t||null===n;l.unshift(this.renderRadioButton({key:"empty-option",label:a,name:e.name,value:t,selected:s,props:i}))}return f("div",{key:`${i.key}-radio`,class:g.inputRadioGroup},l)}renderSwitchInputField(e,t){const{value:i}=e,a=!!this._inputFieldHasInputType(e,"switch")&&i===e.fieldElement.input.onValue;return f("calcite-switch",{...t,class:g.inputSwitch,onclick:this._handleSwitchClick,checked:a,disabled:t.readOnly})}renderRadioButton({key:e,name:t,value:i,selected:a,label:n,props:l}){return f("label",{key:e,class:g.inputRadioLabel},f("input",{...l,class:g.inputRadio,name:t,type:"radio",value:i,checked:a,onchange:this._handleRadioInputChange}),n)}renderAuxiliaryText(e){const t=this._userUpdatedInputFieldNames.has(e.name)&&!e.valid?e.errorMessage:i(this.viewModel.contingencyConstraintViolations.get(e.name))?this.messages.validationErrors.valuesIncompatible:null;return i(t)?f("calcite-input-message",{status:"invalid",icon:!0,active:!0},t):e.description?f("div",{key:"description",class:g.description},e.description):void 0}getCommonInputProps(e){const{groupDisplay:t}=this,{editable:a,group:n,hint:l,maxLength:s,minLength:r,name:o,required:u,type:d,valid:p,value:c}=e,m=this._userUpdatedInputFieldNames.has(o),h=!a,f="all"===t&&i(n)&&"collapsed"===n.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":p?"false":"true",class:this.classes(g.input,g.inputField,h?g.inputDisabled:null,m&&!p?g.inputInvalid:null),key:o,label:o,minlength:r>-1?`${r}`:"",maxlength:s>-1?`${s}`:"",...this._getNumberFieldConstraints(e),readOnly:h,value:null==c?"":`${c}`,[F]:o,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===d?this._handleNumberInputMouseDown:null,placeholder:"number"===d||"text"===d?l:"",required:u,tabIndex:f?-1:0}}_isInputFieldInGroup(e){return!I(e)&&i(e.group)}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),a=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(a.length>0){const e=new Set(a.map((e=>e.value)));return[a,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const l of this.viewModel.allInputFields){const{name:i,value:n}=l;!a(n)&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=n)}const i=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const l of i){const i=l.values[e];if(a(i)||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:s,name:r}="null"===i.objectType?{code:"",name:this.messages.empty}:i.codedValue;if(n.has(s))continue;Object.entries(t).every((([e,t])=>!l.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,l.values[e])))&&n.set(s,{name:r,value:s})}return[...n.values()]}_getInputFieldFromInput(e){return this.viewModel.findField(e.getAttribute(F))}_getNumberFieldConstraints(e){const t=r(e.domain)||o(e.field);return t&&t.max!==Number.MAX_VALUE&&t.min!==Number.MIN_VALUE?t:{min:null,max:null}}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getInputFieldFromInput(e),a=t.findField(this._activeInputName),n=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&a===i&&("radio-buttons"!==i.inputType||n||e.checked)&&(this._fieldFocusNeeded=!1,e.focus())}_handleInputFocus(e){const t=e.target,i=this._getInputFieldFromInput(t);this._activeInputName=i.name,"date"===i.type?this._syncDateFieldEdits(t):this._isNumberInputField(i)&&this._setUpNumberFieldEdit(t)}_isNumberInputField({domain:e,inputType:t="text-box",type:i}){return"number"===i&&"text-box"===t&&(!e||"coded-value"!==e.type)}_handleInputBlur(e){const t=e.target,a=this._getInputFieldFromInput(t);if("date"===a.type){const i=e.relatedTarget,l=i&&this._getInputFieldFromInput(i);if(l&&"date"===a.type&&"date"===l.type&&a.field===l.field){if(""!==t.value&&""===i.value){var n;const l=i.getAttribute("data-date-part");i.value=this._formatDate(null!=(n=a.value)?n:Date.now())[l],this._parseDate(t.value,t.getAttribute("data-date-part"))&&this._commitInputValue(e.target,!0,!1)}return}}"number"===a.type&&i(this._activeNumberFieldEdit)&&(this._activeNumberFieldEdit.input.value=`${a.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitInputValue(e,t=!1,a=!0){const n=this._getInputFieldFromInput(e);if(this._activeDateFieldEdit){const{date:i,time:u}=this._activeDateFieldEdit,d=this._parseDateTime(e.value,n,i.active?"date":"time"),p=null!==this.viewModel.getValue(n.name),c=i.input&&(u.input||!n.includeTime),m=null===d;if(t){if(m)return;(c||!a||p)&&this._updateDateFieldValue(n,d)}else{var l,s;if(""===(null==(l=i.input)?void 0:l.value)||""===(null==(s=u.input)?void 0:s.value))this._updateDateFieldValue(n,null);else if(c){var r,o;const e=`${i.input.value} ${null!=(r=null==(o=u.input)?void 0:o.value)?r:""}`,t=this._parseDateTime(e,n);!(null!==t)&&p||this._updateDateFieldValue(n,t)}this._activeDateFieldEdit=null}}else i(this._activeNumberFieldEdit)&&this._isNumberInputField(n)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(e)}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:a,metaKey:n}=e,l=this._getInputFieldFromInput(e.target);if("Enter"===t)this._isInputFieldInGroup(l)&&"collapsed"===l.group.state&&(l.group.state="expanded");else{const{type:s}=l.field,r="single"===s||"double"===s,o=!i&&!a&&!n;if(("integer"===s||"small-integer"===s||r)&&o&&1===t.length){const i=Number(t),a=["-","+"],n=["e","."],l=r?[...a,...n]:a;isNaN(i)&&!l.includes(t)&&e.preventDefault()}}}_setUpNumberFieldEdit(e){const t=this._getInputFieldFromInput(e);this._activeNumberFieldEdit={fieldName:t.name,input:e,value:e.value}}_syncDateFieldEdits(e){var t,i;const a=this._getInputFieldFromInput(e);if("date"!==a.type)return;const n=e.getAttribute("data-date-part"),l="date"===n?{value:e.value,input:e,active:!0}:{...null==(t=this._activeDateFieldEdit)?void 0:t.date,active:!1},s="time"===n?{value:e.value,input:e,active:!0}:{...null==(i=this._activeDateFieldEdit)?void 0:i.time,active:!1};this._activeDateFieldEdit={fieldName:a.name,date:l,time:s}}_updateFieldValue(e){const t=e.getAttribute(F);if(this.viewModel.setValue(t,this._parseValue(e)),this._userUpdatedInputFieldNames.add(t),this.viewModel.fieldsWithContingentValues.has(t)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>i(t))));this.viewModel.validateContingencyConstraints(e)}}_updateDateFieldValue(e,t){this.viewModel.setValue(e.name,t),this._userUpdatedInputFieldNames.add(e.name)}_parseValue(e){const t=this._getInputFieldFromInput(e),i=e.value;if(this._inputFieldHasInputType(t,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.fieldElement.input.onValue:t.fieldElement.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{type:a}=t;if("number"===a)return i?parseFloat(i):null;if("date"===a){if(!i)return null;const a=Number(i);if(!isNaN(a))return a;const n=e.getAttribute("data-date-part"),l=this._parseDate(i,n);if(!l)return null;let s=_.fromJSDate(l);const r=t.domain,o=_.now();let u=o;if(r&&"range"===r.type){const e=_.fromMillis(r.maxValue);o<e&&(u=e)}const d=this.viewModel.getValue(t.name),p=null!=d?_.fromMillis(d):u;return s="date"===n?s.set({hour:p.hour,minute:p.minute,second:p.second}):s.set({day:p.day,month:p.month,year:p.year}),s.toMillis()}return i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){var t;const i=e.currentTarget["data-group"],a="expanded"===i.state,n="sequential"===this.groupDisplay,l=`.${g.groupHeader}`;if(!(a&&!e.target.closest(l))){if(this._activeInputName=null==(t=this._getFocusableInput("forward",i))?void 0:t.name,n){const t=e.target.closest(l);if(a&&!t)return;this.viewModel.inputFields.forEach((e=>{I(e)&&e!==i&&(e.state="collapsed")}))}i.state=a?"collapsed":"expanded",this._fieldFocusNeeded=n,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_formatDate(e){if(null==e)return{date:"",time:""};const t=_.fromMillis(e,{locale:v(),numberingSystem:"latn"});return{date:t.toLocaleString({year:"numeric",month:"2-digit",day:"2-digit"}),time:t.toFormat(b.timePattern)}}_parseDate(e,t){if(null==e||""===e)return null;const{timePattern:i,datePattern:a}=b,n=t?"date"===t?a:i:`${a} ${i}`,l=_.fromFormat(e,n,{locale:v(),numberingSystem:"latn"});return l.isValid?l.toJSDate():null}_inputFieldHasInputType(e,t){var a;return i(e.fieldElement)&&(null==(a=e.fieldElement.input)?void 0:a.type)===t}_valueIsValidContingentValue(e,i){var a;switch(i.objectType){case"any":return!0;case"null":return null==e;case"code":return e===(null==(a=i.codedValue)?void 0:a.code);case"range":return e>=i.minValue&&e<=i.maxValue;default:return t(i.objectType),!1}}};e([n("viewModel.feature")],y.prototype,"feature",void 0),e([n("viewModel.formTemplate")],y.prototype,"formTemplate",void 0),e([l()],y.prototype,"groupDisplay",void 0),e([l()],y.prototype,"headingLevel",void 0),e([l({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],y.prototype,"label",void 0),e([n("viewModel.layer")],y.prototype,"layer",void 0),e([l(),m("esri/widgets/FeatureForm/t9n/FeatureForm")],y.prototype,"messages",void 0),e([l(),m("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],y.prototype,"messagesTemplates",void 0),e([n("viewModel.strict")],y.prototype,"strict",void 0),e([l(),h(["value-change","submit"])],y.prototype,"viewModel",void 0),e([n("viewModel.getValues")],y.prototype,"getValues",null),e([n("viewModel.submit")],y.prototype,"submit",null),y=e([s("esri.widgets.FeatureForm")],y);const w=y;export{w as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{neverReached as t}from"../core/compilerUtils.js";import{isSome as i,isNone as a}from"../core/maybe.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{getDomainRange as r}from"../layers/support/domainUtils.js";import{getFieldRange as o}from"../layers/support/fieldUtils.js";import u from"./Widget.js";import d from"./FeatureForm/FeatureFormViewModel.js";import{Heading as p,incrementHeadingLevel as c}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{DateTime as _}from"luxon";import{getLocale as g}from"../intl/locale.js";const v={base:"esri-feature-form",form:"esri-feature-form__form",formHeader:"esri-feature-form__form-header",label:"esri-feature-form__label",inputField:"esri-feature-form__input",inputDate:"esri-feature-form__input--date",inputTime:"esri-feature-form__input--time",inputRadioGroup:"esri-feature-form__input--radio-group",inputRadio:"esri-feature-form__input--radio",inputRadioLabel:"esri-feature-form__input--radio-label",inputDisabled:"esri-feature-form__input--disabled",inputSwitch:"esri-feature-form__input--switch",inputInvalid:"esri-feature-form__input--invalid",inputIconInvalid:"esri-feature-form__input-icon--invalid",errorMessage:"esri-feature-form__field-error-message",description:"esri-feature-form__description-text",dateInputPart:"esri-feature-form__date-input-part",loneDateInputPart:"esri-feature-form__date-input-part--lone",dateInputContainer:"esri-feature-form__date-input-container",dateFormatHint:"esri-feature-form__date-format-hint",group:"esri-feature-form__group",groupLabel:"esri-feature-form__group-label",groupHeader:"esri-feature-form__group-header",groupHeading:"esri-feature-form__group-header",groupTitle:"esri-feature-form__group-title",groupDescription:"esri-feature-form__group-description",groupToggleIcon:"esri-feature-form__group-toggle-icon",groupCollapsed:"esri-feature-form__group--collapsed",groupSequential:"esri-feature-form__group--sequential",groupActive:"esri-feature-form__group--active",collapseIcon:"esri-icon-up",errorIcon:"esri-icon-notice-triangle",expandIcon:"esri-icon-down",widget:"esri-widget",panel:"esri-widget--panel",input:"esri-input",select:"esri-select"},b={datePattern:"D",timePattern:"tt"};function I(e){return e&&e.inputFields}const F="data-field-name";let y=class extends u{constructor(e,t){super(e,t),this._activeDateFieldEdit=null,this._activeInputName=null,this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedInputFieldNames=new Set,this.feature=null,this.formTemplate=null,this.groupDisplay="all",this.headingLevel=2,this.label=void 0,this.layer=null,this.messages=null,this.messagesTemplates=null,this.strict=null,this.viewModel=new d,this._handleSwitchClick=e=>{e.target===e.currentTarget&&e.stopImmediatePropagation()},this._handleRadioInputChange=e=>{this._commitInputValue(e.target)},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget,!0)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this)}initialize(){this.own([this.watch("feature",(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e&&e.name,this._userUpdatedInputFieldNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedInputFieldNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}}))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-combobox.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),import("@esri/calcite-components/dist/components/calcite-input-message.js"),import("@esri/calcite-components/dist/components/calcite-switch.js")])}destroy(){this._userUpdatedInputFieldNames.clear(),this._userUpdatedInputFieldNames=null}getValues(){return null}submit(){return null}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(v.base,v.widget,v.panel)},"ready"===e?this.renderForm():null)}renderForm(){const e=this.formTemplate?.title?f(p,{key:"title",level:this.headingLevel},this.formTemplate.title):null,t=this.formTemplate?.description?f("p",{class:v.description,key:"description"},this.formTemplate.description):null,i=e||t?f("div",{class:v.formHeader},e,t):null;return f("form",{class:v.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},i,this.renderFields())}renderFields(){const{viewModel:{inputFields:e}}=this;return e.map(((e,t)=>I(e)?this.renderGroup(e,t):this.renderLabeledField(e)))}renderGroup(e,t){const{description:i,inputFields:a,label:n,state:s}=e,l=a.filter((e=>e.visible)),r=this.viewModel.findField(this._activeInputName),o=!(!r||r.group!==e),u=`${this.id}_group_${t}`,d=`${this.id}_group-label_${t}`,m=`${this.id}_group-description_${t}`,h=i?f("p",{class:this.classes(v.groupDescription,v.description),id:m},i):null,_="sequential"===this.groupDisplay,g=_?o:"expanded"===s,b=g?v.collapseIcon:v.expandIcon;return f("fieldset",{"aria-expanded":g.toString(),"aria-labelledby":d,"aria-describedby":i?m:"",class:this.classes(v.group,_?v.groupSequential:null,g?null:v.groupCollapsed,o?v.groupActive:null),"data-group":e,id:u,key:t,onclick:this._handleGroupClick},f("button",{role:_?"presentation":void 0,class:v.groupHeader,type:"button",tabIndex:_?-1:0},f("div",{class:v.groupTitle},f(p,{class:v.groupLabel,id:d,level:this.formTemplate?.title?c(this.headingLevel):this.headingLevel},n),h),_?null:f("span",{class:this.classes(b,v.groupToggleIcon)})),l.map((e=>this.renderLabeledField(e))))}_getFocusableInput(e,t){const i=this.viewModel.allInputFields,a="forward"===e?i:i.slice().reverse();let n;if(t)if(I(t))n=a.indexOf(t.inputFields[0]);else{let i;if(this._isInputFieldInGroup(t)&&"collapsed"===t.group.state){const{inputFields:a}=t.group;i="forward"===e?a[a.length-1]:a[0]}else i=t;n=a.indexOf(i)+1}else n=0;for(let s=n;s<a.length;s++){const e=a[s];if(e.visible)return e}return null}renderLabeledField(e){const{label:t,layer:i,type:a}=e;return f("label",{key:`${i.id}-${e.name}`,class:v.label},[t,"unsupported"!==a?this.renderInputField(e):this.renderUnsupportedField(e),this.renderAuxiliaryText(e)])}renderInputField(e){const{domain:t,name:a,type:n,value:s}=e,l=this.getCommonInputProps(e);if("coded-value"===t?.type){if(this._inputFieldHasInputType(e,"switch")){const{fieldElement:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(a)||null==s||t.input.onValue!==s&&t.input.offValue!==s))return this.renderSwitchInputField(e,l);this._switchFieldsWithInitialIncompatibleValue.add(a)}return"radio-buttons"===e.inputType?this.renderRadioButtonsInputField(e,t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),l):this.renderSelectInputField(e,this._getFieldValueOptions(a,t),l)}return"datetime-picker"===e.inputType||"date"===n?this.renderDateInputField(e,l):"number"===n?f("input",{type:"number",...l,value:i(this._activeNumberFieldEdit)&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${l.value}`}):"text-area"===e.inputType?f("textarea",{...l}):f("input",{type:"text",...l})}_parseDateTime(e,t,i){if(i){let a=_.fromJSDate(this._parseDate(e,i));const n=_.fromMillis(t.value??Date.now());return a="date"===i?a.set({hour:n.hour,minute:n.minute,second:n.second}):a.set({day:n.day,month:n.month,year:n.year}),a.isValid?a.toMillis():null}const a=_.fromJSDate(this._parseDate(e));return a.isValid?a.toMillis():null}renderDateInputField(e,t){const{value:i,includeTime:a}=e,{date:n,time:s}=this._formatDate(0),l=`${this.id}-${t.key}`,r=`${l}-date`,o=`${l}-time`,{_activeDateFieldEdit:u}=this;let{date:d,time:p}=this._formatDate(i);return u?.fieldName===e.name&&(d=u.date.input?.value??d,p=u.time.input?.value??p),f("div",{key:`${t.key}-date`,class:v.dateInputContainer},f("div",{class:this.classes(v.dateInputPart,a?null:v.loneDateInputPart)},f("input",{"aria-label":e.label,"aria-describedby":r,type:"text",...t,"data-date-part":"date",class:this.classes(t.class,v.inputDate),value:d}),f("div",{class:v.dateFormatHint,id:r},n)),a?f("div",{class:v.dateInputPart,key:"time-input"},f("input",{"aria-describedby":o,"aria-label":e.label,type:"text",...t,"data-date-part":"time",class:this.classes(t.class,v.inputTime),value:p}),f("div",{class:v.dateFormatHint,id:o},s)):null)}renderUnsupportedField(e){const t=this.getCommonInputProps(e);return f("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(v.input,v.inputField,v.inputDisabled),onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value,[F]:t[F]})}renderSelectInputField(e,t,i){const{value:n}=e,{messages:s,messagesTemplates:l}=this,r=t.map((e=>e.map((e=>f("calcite-combobox-item",{value:`${e.value}`,"text-label":e.name,key:`#${e.value}`,selected:n===e.value}))))),[o,u]=r;this._registerIncompatibleValue(n,t.flat(),e,(e=>{u.unshift(f("calcite-combobox-item",{value:`${e}`,"text-label":`${e}`,key:"incompatible-option",readOnly:!0}))}));const d=u.length>0?[f("calcite-combobox-item-group",{key:"recommended",label:s.recommended},o),f("calcite-combobox-item-group",{key:"other",label:l.other},u)]:o,p=a(e.fieldElement)||this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.showNoValueOption;if(!e.required&&p){const t="",i=this._inputFieldHasInputType(e,"combo-box")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty;d.unshift(f("calcite-combobox-item",{value:t,"text-label":this.messages.empty,key:"empty-option"},i))}return f("calcite-combobox",{...i,"selection-mode":"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},d)}_registerIncompatibleValue(e,t,i,a){const n=this._fieldToInitialIncompatibleDomainValue,s=n.has(i.name);(s||null!=e&&""!==e&&!t.some((t=>t.value===e))||s)&&(s||n.set(i.name,e),a?.(n.get(i.name)))}renderRadioButtonsInputField(e,t,i){const{value:n}=e,s=t.map((t=>this.renderRadioButton({key:t.name,label:t.name,name:e.name,value:t.value,selected:t.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const l=a(e.fieldElement)||this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.showNoValueOption;if(!e.required&&l){const t="",a=this._inputFieldHasInputType(e,"radio-buttons")&&e.fieldElement.input.noValueOptionLabel||this.messages.empty,l=n===t||null===n;s.unshift(this.renderRadioButton({key:"empty-option",label:a,name:e.name,value:t,selected:l,props:i}))}return f("div",{key:`${i.key}-radio`,class:v.inputRadioGroup},s)}renderSwitchInputField(e,t){const{value:i}=e,a=!!this._inputFieldHasInputType(e,"switch")&&i===e.fieldElement.input.onValue;return f("calcite-switch",{...t,class:v.inputSwitch,onclick:this._handleSwitchClick,checked:a,disabled:t.readOnly})}renderRadioButton({key:e,name:t,value:i,selected:a,label:n,props:s}){return f("label",{key:e,class:v.inputRadioLabel},f("input",{...s,class:v.inputRadio,name:t,type:"radio",value:i,checked:a,onchange:this._handleRadioInputChange}),n)}renderAuxiliaryText(e){const t=this._userUpdatedInputFieldNames.has(e.name)&&!e.valid?e.errorMessage:i(this.viewModel.contingencyConstraintViolations.get(e.name))?this.messages.validationErrors.valuesIncompatible:null;return i(t)?f("calcite-input-message",{status:"invalid",icon:!0,active:!0},t):e.description?f("div",{key:"description",class:v.description},e.description):void 0}getCommonInputProps(e){const{groupDisplay:t}=this,{editable:a,group:n,hint:s,maxLength:l,minLength:r,name:o,required:u,type:d,valid:p,value:c}=e,m=this._userUpdatedInputFieldNames.has(o),h=!a,f="all"===t&&i(n)&&"collapsed"===n.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":p?"false":"true",class:this.classes(v.input,v.inputField,h?v.inputDisabled:null,m&&!p?v.inputInvalid:null),key:o,label:o,minlength:r>-1?`${r}`:"",maxlength:l>-1?`${l}`:"",...this._getNumberFieldConstraints(e),readOnly:h,value:null==c?"":`${c}`,[F]:o,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===d?this._handleNumberInputMouseDown:null,placeholder:"number"===d||"text"===d?s:"",required:u,tabIndex:f?-1:0}}_isInputFieldInGroup(e){return!I(e)&&i(e.group)}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),a=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(a.length>0){const e=new Set(a.map((e=>e.value)));return[a,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const s of this.viewModel.allInputFields){const{name:i,value:n}=s;!a(n)&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=n)}const i=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const s of i){const i=s.values[e];if(a(i)||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:l,name:r}="null"===i.objectType?{code:"",name:this.messages.empty}:i.codedValue;if(n.has(l))continue;Object.entries(t).every((([e,t])=>!s.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,s.values[e])))&&n.set(l,{name:r,value:l})}return[...n.values()]}_getInputFieldFromInput(e){return this.viewModel.findField(e.getAttribute(F))}_getNumberFieldConstraints(e){const t=r(e.domain)||o(e.field);return t&&t.max!==Number.MAX_VALUE&&t.min!==Number.MIN_VALUE?t:{min:null,max:null}}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getInputFieldFromInput(e),a=t.findField(this._activeInputName),n=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&a===i&&("radio-buttons"!==i.inputType||n||e.checked)&&(this._fieldFocusNeeded=!1,e.focus())}_handleInputFocus(e){const t=e.target,i=this._getInputFieldFromInput(t);this._activeInputName=i.name,"date"===i.type?this._syncDateFieldEdits(t):this._isNumberInputField(i)&&this._setUpNumberFieldEdit(t)}_isNumberInputField({domain:e,inputType:t="text-box",type:i}){return"number"===i&&"text-box"===t&&(!e||"coded-value"!==e.type)}_handleInputBlur(e){const t=e.target,a=this._getInputFieldFromInput(t);if("date"===a.type){const i=e.relatedTarget,n=i&&this._getInputFieldFromInput(i);if(n&&"date"===a.type&&"date"===n.type&&a.field===n.field){if(""!==t.value&&""===i.value){const n=i.getAttribute("data-date-part");i.value=this._formatDate(a.value??Date.now())[n],this._parseDate(t.value,t.getAttribute("data-date-part"))&&this._commitInputValue(e.target,!0,!1)}return}}"number"===a.type&&i(this._activeNumberFieldEdit)&&(this._activeNumberFieldEdit.input.value=`${a.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitInputValue(e,t=!1,a=!0){const n=this._getInputFieldFromInput(e);if(this._activeDateFieldEdit){const{date:i,time:s}=this._activeDateFieldEdit,l=this._parseDateTime(e.value,n,i.active?"date":"time"),r=null!==this.viewModel.getValue(n.name),o=i.input&&(s.input||!n.includeTime),u=null===l;if(t){if(u)return;(o||!a||r)&&this._updateDateFieldValue(n,l)}else{if(""===i.input?.value||""===s.input?.value)this._updateDateFieldValue(n,null);else if(o){const e=`${i.input.value} ${s.input?.value??""}`,t=this._parseDateTime(e,n);!(null!==t)&&r||this._updateDateFieldValue(n,t)}this._activeDateFieldEdit=null}}else i(this._activeNumberFieldEdit)&&this._isNumberInputField(n)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(e)}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:a,metaKey:n}=e,s=this._getInputFieldFromInput(e.target);if("Enter"===t)this._isInputFieldInGroup(s)&&"collapsed"===s.group.state&&(s.group.state="expanded");else{const{type:l}=s.field,r="single"===l||"double"===l,o=!i&&!a&&!n;if(("integer"===l||"small-integer"===l||r)&&o&&1===t.length){const i=Number(t),a=["-","+"],n=["e","."],s=r?[...a,...n]:a;isNaN(i)&&!s.includes(t)&&e.preventDefault()}}}_setUpNumberFieldEdit(e){const t=this._getInputFieldFromInput(e);this._activeNumberFieldEdit={fieldName:t.name,input:e,value:e.value}}_syncDateFieldEdits(e){const t=this._getInputFieldFromInput(e);if("date"!==t.type)return;const i=e.getAttribute("data-date-part"),a="date"===i?{value:e.value,input:e,active:!0}:{...this._activeDateFieldEdit?.date,active:!1},n="time"===i?{value:e.value,input:e,active:!0}:{...this._activeDateFieldEdit?.time,active:!1};this._activeDateFieldEdit={fieldName:t.name,date:a,time:n}}_updateFieldValue(e){const t=e.getAttribute(F);if(this.viewModel.setValue(t,this._parseValue(e)),this._userUpdatedInputFieldNames.add(t),this.viewModel.fieldsWithContingentValues.has(t)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>i(t))));this.viewModel.validateContingencyConstraints(e)}}_updateDateFieldValue(e,t){this.viewModel.setValue(e.name,t),this._userUpdatedInputFieldNames.add(e.name)}_parseValue(e){const t=this._getInputFieldFromInput(e),i=e.value;if(this._inputFieldHasInputType(t,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.fieldElement.input.onValue:t.fieldElement.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{type:a}=t;if("number"===a)return i?parseFloat(i):null;if("date"===a){if(!i)return null;const a=Number(i);if(!isNaN(a))return a;const n=e.getAttribute("data-date-part"),s=this._parseDate(i,n);if(!s)return null;let l=_.fromJSDate(s);const r=t.domain,o=_.now();let u=o;if(r&&"range"===r.type){const e=_.fromMillis(r.maxValue);o<e&&(u=e)}const d=this.viewModel.getValue(t.name),p=null!=d?_.fromMillis(d):u;return l="date"===n?l.set({hour:p.hour,minute:p.minute,second:p.second}):l.set({day:p.day,month:p.month,year:p.year}),l.toMillis()}return i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,a="sequential"===this.groupDisplay,n=`.${v.groupHeader}`;if(!(i&&!e.target.closest(n))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name,a){const a=e.target.closest(n);if(i&&!a)return;this.viewModel.inputFields.forEach((e=>{I(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=a,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_formatDate(e){if(null==e)return{date:"",time:""};const t=_.fromMillis(e,{locale:g(),numberingSystem:"latn"});return{date:t.toLocaleString({year:"numeric",month:"2-digit",day:"2-digit"}),time:t.toFormat(b.timePattern)}}_parseDate(e,t){if(null==e||""===e)return null;const{timePattern:i,datePattern:a}=b,n=t?"date"===t?a:i:`${a} ${i}`,s=_.fromFormat(e,n,{locale:g(),numberingSystem:"latn"});return s.isValid?s.toJSDate():null}_inputFieldHasInputType(e,t){return i(e.fieldElement)&&e.fieldElement.input?.type===t}_valueIsValidContingentValue(e,i){switch(i.objectType){case"any":return!0;case"null":return null==e;case"code":return e===i.codedValue?.code;case"range":return e>=i.minValue&&e<=i.maxValue;default:return t(i.objectType),!1}}};e([n("viewModel.feature")],y.prototype,"feature",void 0),e([n("viewModel.formTemplate")],y.prototype,"formTemplate",void 0),e([s()],y.prototype,"groupDisplay",void 0),e([s()],y.prototype,"headingLevel",void 0),e([s({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],y.prototype,"label",void 0),e([n("viewModel.layer")],y.prototype,"layer",void 0),e([s(),m("esri/widgets/FeatureForm/t9n/FeatureForm")],y.prototype,"messages",void 0),e([s(),m("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],y.prototype,"messagesTemplates",void 0),e([n("viewModel.strict")],y.prototype,"strict",void 0),e([s(),h(["value-change","submit"])],y.prototype,"viewModel",void 0),e([n("viewModel.getValues")],y.prototype,"getValues",null),e([n("viewModel.submit")],y.prototype,"submit",null),y=e([l("esri.widgets.FeatureForm")],y);const w=y;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Collection.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import r from"../../core/Handles.js";import{isSome as o}from"../../core/maybe.js";import{debounce as l,ignoreAbortErrors as a}from"../../core/promiseUtils.js";import{on as n,watch as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{highlightsSupported as m}from"../../views/support/layerViewUtils.js";import g from"./AttachmentsColumn.js";import u from"./FieldColumn.js";import p from"./Grid/Grid.js";import y from"./Grid/GridViewModel.js";import f from"./support/FeatureStore.js";import{onLocaleChange as v}from"../../intl/locale.js";import{fetchMessageBundle as _}from"../../intl/messages.js";let b=class extends(i(y)){constructor(e){super(e),this._debounceRefresh=l((()=>this._refresh())),this._defaultHiddenFields=["CreationDate","Creator","EditDate","Editor","GlobalID"],this._highlights=new r,this.activeFilters=new s,this.autoRefreshEnabled=!0,this.cellClassNameGenerator=(e,t)=>e.path||null,this.dataProvider=async(e,t)=>{const{store:s}=this,{page:i,pageSize:r,sortOrders:o}=e,l=this._sortOrdersToLayerOrderByFields(o);t&&(s?(await s.set({orderByFields:l}),"loaded"!==s.state&&"loading"!==s.state&&await s.load(),t&&t(await s.fetchItems({page:i,pageSize:r}))):t&&t([]))},this.editingEnabled=!1,this.grid=null,this.hiddenFields=new s,this.highlightOnRowSelectEnabled=!0,this.itemIdPath="objectId",this.messagesCommon=null,this.relatedRecordsEnabled=!1,this.store=null,this.view=null;const{hiddenFields:t,itemIdPath:i}=this;t.addMany(this._defaultHiddenFields),this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new f),this._set("grid",new p({itemIdPath:i,viewModel:this}))}initialize(){const e=async()=>{this.messages=await _("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await _("esri/t9n/common")};e(),this.handles.add([v(e),n((()=>this.grid.selectedItems),"change",(e=>this._onSelectionChange(e))),d((()=>this.relatedRecordsEnabled),(e=>this.store.relatedRecordsEnabled=e)),d((()=>{var e;return null==(e=this.layer)?void 0:e.loaded}),(e=>e&&this._onLayerLoad())),d((()=>this.store.state),(e=>{var t;"loaded"===e&&(null==(t=this.grid)||t.scrollToTop())})),d((()=>[this.editingEnabled,this.messages]),(()=>{var e;return(null==(e=this.layer)?void 0:e.loaded)&&this._generateColumns()})),d((()=>{var e;return null==(e=this.layer)?void 0:e.definitionExpression}),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),n((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e)))])}destroy(){var e,t;this._resetColumns(),this.handles.removeAll(),this._highlights.removeAll(),this._highlights.destroy(),null==(e=this.grid)||e.destroy(),null==(t=this.columns)||t.destroy(),this.layer=null,this.view=null}get activeSortOrders(){var e;return(null==(e=this.grid)?void 0:e.sortOrders)||[]}set attachmentsEnabled(e){this.attachmentsEnabled!==e&&(this._set("attachmentsEnabled",e),this._generateColumns(),this.store.attachmentsEnabled=e)}set fieldConfigs(e){var t;this._set("fieldConfigs",e),(null==(t=this.layer)?void 0:t.loaded)&&this._generateColumns()}set filterGeometry(e){if(!this.filterGeometry&&!e)return;const t=this.activeFilters.find((e=>"geometry"===e.type));t&&this.activeFilters.remove(t),this.clearSelection(),this._set("filterGeometry",e),this.store.filterGeometry=e,e&&this.activeFilters.add({type:"geometry",geometry:e})}set layer(e){var t;this._set("layer",e),null==(t=this.grid)||t.clearSort(),this._resetColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load()),this.notifyChange("state")}set messages(e){var t;null==(t=this.grid)||t.set("messages",e),this._set("messages",e)}clearHighlights(){this._highlights.removeAll()}clearSelection(){var e;null==(e=this.grid)||e.clearSelection()}deselectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid.deselectRows(t)}filterBySelection(){const e=this.grid.getSelectedRowIds();e.length&&(this.clearSelectionFilter(),this.store.objectIds=e,this.activeFilters.add({type:"selection",objectIds:e}))}getObjectIdIndex(e){var t;return null==(t=this.store)?void 0:t.getObjectIdIndex(e)}getValue(e,t){var s;const i=this.store.getItemByObjectId(e);return null==i||null==(s=i.feature)?void 0:s.attributes[t]}async refresh(){return a(this._debounceRefresh())}reset(){this.grid.reset()}selectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid.selectRows(t)}scrollToIndex(e){var t;null==(t=this.grid)||t.scrollToIndex(e)}clearSelectionFilter(){this.store.objectIds=null;const e=this.activeFilters.find((e=>"selection"===e.type));e&&this.activeFilters.remove(e)}zoomToSelection(){const{layer:e,view:t}=this,s=this.grid.getSelectedRowIds();if(!e||!t||!s.length)return;const i=e.createQuery();i.objectIds=s,i.returnGeometry=!0,e.queryFeatures(i).then((e=>{t.goTo(e.features).catch((e=>{"AbortError"!==e.name&&console.error(e)}))}))}async _refresh(){await this.store.refreshLayerInfo();const e=this.grid.getSelectedRowIds();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,s)=>{t||this.deselectRows(e[s])}))}this.grid.refreshPageCache()}_onLayerLoad(){const e=this.layer.capabilities.query.maxRecordCount;e&&e<this.pageSize&&this.grid&&(this.grid.pageSize=e),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._resetColumns(),this.columns.addMany([...this._createFieldColumns()]),this.attachmentsEnabled&&this.columns.push(this._createAttachmentsColumn())}_createFieldColumns(){return this.fieldConfigs&&this.fieldConfigs.length?this._createColumnsFromConfigs():this._createColumnsFromFields()}_createColumnsFromConfigs(){var e,t;const{editingEnabled:s,fieldConfigs:i,grid:r,hiddenFields:l,layer:a,messages:n,messagesCommon:d,store:h}=this,c=null!=(e=null==(t=this.layer)?void 0:t.fields)?e:[];return i.filter((e=>(c||[]).find((t=>e.name===t.name)))).map((e=>{const t=e.direction||null,i=e.formatFunction||null,m=e.textAlign||null,g=o(e.initialSortPriority)?e.initialSortPriority:null,p=(c||[]).find((t=>e.name===t.name)),y=!1===e.visible||!0!==e.visible&&l.includes(p.name);return new u({config:e,direction:t,editingEnabled:s,field:p,formatFunction:i,grid:r,hidden:y,layer:a,store:h,messages:n,messagesCommon:d,textAlign:m,initialSortPriority:g})}))}_createColumnsFromFields(){var e,t;const{editingEnabled:s,grid:i,hiddenFields:r,layer:o,messages:l,messagesCommon:a,store:n}=this;return(null!=(e=null==(t=this.layer)?void 0:t.fields)?e:[]).map((e=>{const t=r.includes(e.name);return new u({editingEnabled:s,field:e,grid:i,hidden:t,layer:o,store:n,messages:l,messagesCommon:a})}))}_createAttachmentsColumn(){var e;return new g({header:null==(e=this.messages)?void 0:e.attachments})}_sortOrdersToLayerOrderByFields(e){return e&&e.length?e.filter(((e,t,s)=>s.map((e=>e.path)).indexOf(e.path)===t)).filter((({direction:e})=>!!e)).map((({direction:e,path:t})=>t+" "+e.toUpperCase())):[]}_highlight(e){const{view:t}=this,s=t&&e&&t.allLayerViews.items.find((({layer:t})=>t===e.layer));m(s)&&this._highlights.add(s.highlight(e),`feature-${e.getObjectId()}`)}_unhighlight(e){e&&this._highlights.remove(`feature-${e.getObjectId()}`)}_getStoreItemsFromSelectionParams(e){const s=[];return(e=e instanceof Array?e:[e]).forEach((e=>{let i=e instanceof t?e:null;const r=i?i.getObjectId():e;if("number"==typeof r||"string"==typeof r){if(!i){const e=this.store.getItemByObjectId(r);e&&(i=e.feature)}s.push({objectId:r,feature:i})}})),s}_onSelectionChange(e){const{highlightOnRowSelectEnabled:t}=this,{added:s,removed:i}=e;t&&s.forEach((e=>this._highlight(e.feature))),t&&i.forEach((e=>this._unhighlight(e.feature)))}_resetColumns(){this.columns.items.forEach((e=>e.destroy())),this.columns.removeAll()}};e([h({readOnly:!0})],b.prototype,"activeFilters",void 0),e([h({readOnly:!0})],b.prototype,"activeSortOrders",null),e([h()],b.prototype,"attachmentsEnabled",null),e([h()],b.prototype,"autoRefreshEnabled",void 0),e([h()],b.prototype,"cellClassNameGenerator",void 0),e([h()],b.prototype,"dataProvider",void 0),e([h()],b.prototype,"editingEnabled",void 0),e([h()],b.prototype,"fieldConfigs",null),e([h()],b.prototype,"filterGeometry",null),e([h({readOnly:!0})],b.prototype,"grid",void 0),e([h()],b.prototype,"hiddenFields",void 0),e([h()],b.prototype,"highlightOnRowSelectEnabled",void 0),e([h({readOnly:!0})],b.prototype,"itemIdPath",void 0),e([h()],b.prototype,"layer",null),e([h()],b.prototype,"messages",null),e([h()],b.prototype,"messagesCommon",void 0),e([h()],b.prototype,"relatedRecordsEnabled",void 0),e([h({readOnly:!0,type:f})],b.prototype,"store",void 0),e([h()],b.prototype,"view",void 0),b=e([c("esri.widgets.FeatureTable.FeatureTableViewModel")],b);const C=b;export{C as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import s from"../../core/Collection.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import r from"../../core/Handles.js";import{isSome as o}from"../../core/maybe.js";import{debounce as a,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{on as n,watch as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{highlightsSupported as m}from"../../views/support/layerViewUtils.js";import g from"./AttachmentsColumn.js";import u from"./FieldColumn.js";import p from"./Grid/Grid.js";import y from"./Grid/GridViewModel.js";import f from"./support/FeatureStore.js";import{onLocaleChange as _}from"../../intl/locale.js";import{fetchMessageBundle as b}from"../../intl/messages.js";let C=class extends(i(y)){constructor(e){super(e),this._debounceRefresh=a((()=>this._refresh())),this._defaultHiddenFields=["CreationDate","Creator","EditDate","Editor","GlobalID"],this._highlights=new r,this.activeFilters=new s,this.autoRefreshEnabled=!0,this.cellClassNameGenerator=(e,t)=>e.path||null,this.dataProvider=async(e,t)=>{const{store:s}=this,{page:i,pageSize:r,sortOrders:o}=e,a=this._sortOrdersToLayerOrderByFields(o);t&&(s?(await s.set({orderByFields:a}),"loaded"!==s.state&&"loading"!==s.state&&await s.load(),t&&t(await s.fetchItems({page:i,pageSize:r}))):t&&t([]))},this.editingEnabled=!1,this.grid=null,this.hiddenFields=new s,this.highlightOnRowSelectEnabled=!0,this.itemIdPath="objectId",this.messagesCommon=null,this.relatedRecordsEnabled=!1,this.store=null,this.view=null;const{hiddenFields:t,itemIdPath:i}=this;t.addMany(this._defaultHiddenFields),this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new f),this._set("grid",new p({itemIdPath:i,viewModel:this}))}initialize(){const e=async()=>{this.messages=await b("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await b("esri/t9n/common")};e(),this.handles.add([_(e),n((()=>this.grid.selectedItems),"change",(e=>this._onSelectionChange(e))),d((()=>this.relatedRecordsEnabled),(e=>this.store.relatedRecordsEnabled=e)),d((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),d((()=>this.store.state),(e=>{"loaded"===e&&this.grid?.scrollToTop()})),d((()=>[this.editingEnabled,this.messages]),(()=>this.layer?.loaded&&this._generateColumns())),d((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),n((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e)))])}destroy(){this._resetColumns(),this.handles.removeAll(),this._highlights.removeAll(),this._highlights.destroy(),this.grid?.destroy(),this.columns?.destroy(),this.layer=null,this.view=null}get activeSortOrders(){return this.grid?.sortOrders||[]}set attachmentsEnabled(e){this.attachmentsEnabled!==e&&(this._set("attachmentsEnabled",e),this._generateColumns(),this.store.attachmentsEnabled=e)}set fieldConfigs(e){this._set("fieldConfigs",e),this.layer?.loaded&&this._generateColumns()}set filterGeometry(e){if(!this.filterGeometry&&!e)return;const t=this.activeFilters.find((e=>"geometry"===e.type));t&&this.activeFilters.remove(t),this.clearSelection(),this._set("filterGeometry",e),this.store.filterGeometry=e,e&&this.activeFilters.add({type:"geometry",geometry:e})}set layer(e){this._set("layer",e),this.grid?.clearSort(),this._resetColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load()),this.notifyChange("state")}set messages(e){this.grid?.set("messages",e),this._set("messages",e)}clearHighlights(){this._highlights.removeAll()}clearSelection(){this.grid?.clearSelection()}deselectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid.deselectRows(t)}filterBySelection(){const e=this.grid.getSelectedRowIds();e.length&&(this.clearSelectionFilter(),this.store.objectIds=e,this.activeFilters.add({type:"selection",objectIds:e}))}getObjectIdIndex(e){return this.store?.getObjectIdIndex(e)}getValue(e,t){return this.store.getItemByObjectId(e)?.feature?.attributes[t]}async refresh(){return l(this._debounceRefresh())}reset(){this.grid.reset()}selectRows(e){const t=this._getStoreItemsFromSelectionParams(e);this.grid.selectRows(t)}scrollToIndex(e){this.grid?.scrollToIndex(e)}clearSelectionFilter(){this.store.objectIds=null;const e=this.activeFilters.find((e=>"selection"===e.type));e&&this.activeFilters.remove(e)}zoomToSelection(){const{layer:e,view:t}=this,s=this.grid.getSelectedRowIds();if(!e||!t||!s.length)return;const i=e.createQuery();i.objectIds=s,i.returnGeometry=!0,e.queryFeatures(i).then((e=>{t.goTo(e.features).catch((e=>{"AbortError"!==e.name&&console.error(e)}))}))}async _refresh(){await this.store.refreshLayerInfo();const e=this.grid.getSelectedRowIds();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,s)=>{t||this.deselectRows(e[s])}))}this.grid.refreshPageCache()}_onLayerLoad(){const e=this.layer.capabilities.query.maxRecordCount;e&&e<this.pageSize&&this.grid&&(this.grid.pageSize=e),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._resetColumns(),this.columns.addMany([...this._createFieldColumns()]),this.attachmentsEnabled&&this.columns.push(this._createAttachmentsColumn())}_createFieldColumns(){return this.fieldConfigs&&this.fieldConfigs.length?this._createColumnsFromConfigs():this._createColumnsFromFields()}_createColumnsFromConfigs(){const{editingEnabled:e,fieldConfigs:t,grid:s,hiddenFields:i,layer:r,messages:a,messagesCommon:l,store:n}=this,d=this.layer?.fields??[];return t.filter((e=>(d||[]).find((t=>e.name===t.name)))).map((t=>{const h=t.direction||null,c=t.formatFunction||null,m=t.textAlign||null,g=o(t.initialSortPriority)?t.initialSortPriority:null,p=(d||[]).find((e=>t.name===e.name)),y=!1===t.visible||!0!==t.visible&&i.includes(p.name);return new u({config:t,direction:h,editingEnabled:e,field:p,formatFunction:c,grid:s,hidden:y,layer:r,store:n,messages:a,messagesCommon:l,textAlign:m,initialSortPriority:g})}))}_createColumnsFromFields(){const{editingEnabled:e,grid:t,hiddenFields:s,layer:i,messages:r,messagesCommon:o,store:a}=this;return(this.layer?.fields??[]).map((l=>{const n=s.includes(l.name);return new u({editingEnabled:e,field:l,grid:t,hidden:n,layer:i,store:a,messages:r,messagesCommon:o})}))}_createAttachmentsColumn(){return new g({header:this.messages?.attachments})}_sortOrdersToLayerOrderByFields(e){return e&&e.length?e.filter(((e,t,s)=>s.map((e=>e.path)).indexOf(e.path)===t)).filter((({direction:e})=>!!e)).map((({direction:e,path:t})=>t+" "+e.toUpperCase())):[]}_highlight(e){const{view:t}=this,s=t&&e&&t.allLayerViews.items.find((({layer:t})=>t===e.layer));m(s)&&this._highlights.add(s.highlight(e),`feature-${e.getObjectId()}`)}_unhighlight(e){e&&this._highlights.remove(`feature-${e.getObjectId()}`)}_getStoreItemsFromSelectionParams(e){const s=[];return(e=e instanceof Array?e:[e]).forEach((e=>{let i=e instanceof t?e:null;const r=i?i.getObjectId():e;if("number"==typeof r||"string"==typeof r){if(!i){const e=this.store.getItemByObjectId(r);e&&(i=e.feature)}s.push({objectId:r,feature:i})}})),s}_onSelectionChange(e){const{highlightOnRowSelectEnabled:t}=this,{added:s,removed:i}=e;t&&s.forEach((e=>this._highlight(e.feature))),t&&i.forEach((e=>this._unhighlight(e.feature)))}_resetColumns(){this.columns.items.forEach((e=>e.destroy())),this.columns.removeAll()}};e([h({readOnly:!0})],C.prototype,"activeFilters",void 0),e([h({readOnly:!0})],C.prototype,"activeSortOrders",null),e([h()],C.prototype,"attachmentsEnabled",null),e([h()],C.prototype,"autoRefreshEnabled",void 0),e([h()],C.prototype,"cellClassNameGenerator",void 0),e([h()],C.prototype,"dataProvider",void 0),e([h()],C.prototype,"editingEnabled",void 0),e([h()],C.prototype,"fieldConfigs",null),e([h()],C.prototype,"filterGeometry",null),e([h({readOnly:!0})],C.prototype,"grid",void 0),e([h()],C.prototype,"hiddenFields",void 0),e([h()],C.prototype,"highlightOnRowSelectEnabled",void 0),e([h({readOnly:!0})],C.prototype,"itemIdPath",void 0),e([h()],C.prototype,"layer",null),e([h()],C.prototype,"messages",null),e([h()],C.prototype,"messagesCommon",void 0),e([h()],C.prototype,"relatedRecordsEnabled",void 0),e([h({readOnly:!0,type:f})],C.prototype,"store",void 0),e([h()],C.prototype,"view",void 0),C=e([c("esri.widgets.FeatureTable.FeatureTableViewModel")],C);const v=C;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{convertDateFormatToIntlOptions as i,formatDate as l}from"../../intl/date.js";import{convertNumberFormatToIntlOptions as o,formatNumber as a}from"../../intl/number.js";import r from"../../layers/support/CodedValueDomain.js";import{isNumericField as u,isStringField as s}from"../../layers/support/fieldUtils.js";import d from"../FeatureForm/InputField.js";import c from"./Grid/EditorColumn.js";import p from"../support/DatePicker.js";import m from"../support/TimePicker.js";import{renderingSanitizer as h}from"../support/widgetUtils.js";const f={cancelEdit:"Escape"},v={headerContent:"esri-field-column__header-content",input:"esri-field-column__cell-input",inputContainer:"esri-field-column__cell__input-container",dateInputContainer:"esri-field-column__cell__date-input-container",dateInputWrapper:"esri-field-column__cell__date-input-wrapper",button:"esri-field-column__button",saveIcon:"esri-icon-save",trashIcon:"esri-icon-trash",locked:"esri-icon-locked"},g=i("short-date-short-time"),y=i("short-date"),b=o({digitSeparator:!0,places:null});let _=class extends c{constructor(e){super(e),this._inputField=null,this.alias=null,this.cellValueFormatFunction=({rowData:e,value:t})=>{if(this.formatFunction){const{config:e,field:n}=this;return this.formatFunction({config:e,field:n,value:h.sanitize(t)})}if(null===t)return"&nbsp;";const{config:n,field:r,type:s}=this,{item:{feature:d}}=e,c=this._getDomainForFeature(d);if(c)return this._getComputedDomain(t,c);if("date"===s){var p,m;const e=null!=n&&null!=(p=n.format)&&p.dateFormat?i(n.format.dateFormat):!1===(null==n?void 0:n.includeTime)?y:g,o="feature"===(null==(m=this.layer)?void 0:m.type)&&this.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null;return t?l(t,{...e,...o}):null}if(u(r)){const e=null!=n&&n.format?o(n.format):b;return a(parseFloat(t),e)}return h.sanitize(t)},this.cellValueValidatorFunction=({oldValue:e,value:t})=>e!==t,this.config=null,this.defaultValue=null,this.description=null,this.editingEnabled=!1,this.field=null,this.formatFunction=null,this.headerRenderFunction=e=>{const{root:t}=e,{editable:n,editingEnabled:i,headerMenuEnabled:l,sortable:o}=this;if(this.removeCellContent(t),t.classList.add(v.headerContent),i&&!n&&t.appendChild(this.createLockedElement()),o)this.headerSorterRenderFunction(e);else{const{header:e,path:n}=this,i=document.createElement("div");i.innerHTML=e||n,t.appendChild(i)}l&&this.headerMenuRenderFunction(e)},this.inputRenderFunction=({root:e,column:t,rowData:n})=>{var i,l;if(null!=(i=this.activeEditInfo)&&i.updating)return;if(!this.editable)return;const o=this.getCellValue(t,n),a=this.createInputElement({root:e,column:t,rowData:n,value:o});if(this._set("activeEditInfo",{column:t,input:a,root:e,rowData:n,updating:!0,oldValue:o}),"date"===this.type)return void this._renderDateEditors(o,e,a);const r=this.createInputContainer();r.appendChild(a),this.removeCellContent(e),e.appendChild(r),a.focus(),a instanceof HTMLInputElement&&a.select(),null==(l=this.grid)||l.notifyResize()},this.layer=null,this.menuConfig=null,this.name=null,this.nullable=!0,this.parseInputValueFunction=({input:e})=>{const t=this._inputField,n=e.value,{required:i,type:l}=t;return i||""!==n?"number"===l||"date"===l?parseFloat(n):n:null},this.type=null,this.updateRowItemFunction=({rowData:e,column:t,value:n})=>{e.item.feature.attributes[t.path]=n}}get editable(){var e,t,n;return this.editingEnabled?this.config?!1!==this.config.editable&&(null==(t=this.field)?void 0:t.editable):null==(n=this.field)?void 0:n.editable:!!this.config&&(!0===this.config.editable&&(null==(e=this.field)?void 0:e.editable))}get header(){var e;return(null==(e=this.config)?void 0:e.label)||this.alias||this.path||null}get hidden(){const{config:e}=this;return!1===(null==e?void 0:e.visible)||this._get("hidden")||!1}set hidden(e){this._set("hidden",e)}get loadingMessage(){var e;return(null==(e=this.messages)?void 0:e.loading)||"..."}get maxLength(){var e,t;const n=null==(e=this.field)?void 0:e.length,i=null==(t=this.config)?void 0:t.maxLength;return!isNaN(i)&&i>=-1&&(-1===n||i<=n)?i:n}get path(){var e;return(null==(e=this.field)?void 0:e.name)||null}get required(){const e=this.get("field.nullable"),t=this.get("config.required");return this.editable&&(!e||!0===t)}get sortable(){var e;return!1!==(null==(e=this.config)?void 0:e.sortable)}createInputElement({rowData:e,value:t}){const{item:n}=e;if(!n||!n.feature)return null;this._inputField=this._setUpInputField(n.feature,t);const{field:i,maxLength:l,required:o}=this,{domain:a}=this._inputField;let r=null;"coded-value"===(null==a?void 0:a.type)?(r=this._createSelectElement(t,a.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),this._inputField),r.onchange=()=>{r.onblur=null,d()}):(r=document.createElement("input"),r.type=u(i)?"number":"text",l>-1&&(r.maxLength=l)),r.classList.add(v.input),r.value=t,r.required=o;let s=!1;r.onkeydown=e=>{s=e.key===f.cancelEdit},r.onblur=()=>{r.onblur=null,d()};const d=()=>{s?this.cancel():this.submit(),this._inputField=null};return r}createInputContainer(){const e=document.createElement("div");return e.classList.add(v.inputContainer),e}createLockedElement(){const e=document.createElement("div");return e.classList.add(v.locked),e}getCellValue({path:e},{item:t}){var n,i,l;return null!=(n=null==t||null==(i=t.feature)||null==(l=i.attributes)?void 0:l[e])?n:null}_renderDateEditors(e,t,n){var i;const{config:l,messagesCommon:o}=this,a=e?new Date(e):new Date(Date.now()),r=new p({dateInputEnabled:!0,value:a}),u=new m({value:a});n.value=a.getTime().toString();let s=!e;const d=()=>{s=!0;const e=this._getCombinedDateTime(r.value,u.value);n.value=e.getTime().toString()},c=()=>{s?this.submit():this.cancel()},h=()=>{n.value=null,this.submit()};r.watch("value",(()=>d())),u.watch("value",(()=>d()));const f=document.createElement("div"),g=document.createElement("div");r.container=f,u.container=g;const y=document.createElement("button");y.classList.add(v.button,v.saveIcon),y.onclick=()=>c(),y.title=null==o?void 0:o.save;const b=document.createElement("button");b.classList.add(v.button,v.trashIcon),b.onclick=()=>h(),b.title=null==o?void 0:o.clear;const _=document.createElement("div");_.classList.add(v.dateInputWrapper),_.appendChild(f),!1!==l.includeTime&&_.appendChild(g);const F=document.createElement("div");F.classList.add(v.dateInputContainer),F.appendChild(_),F.appendChild(y),F.appendChild(b),r.when((()=>{var e;return null==(e=this.grid)?void 0:e.notifyResize()})),u.when((()=>{var e;return null==(e=this.grid)?void 0:e.notifyResize()})),this.removeCellContent(t),t.appendChild(F),null==(i=this.grid)||i.notifyResize()}_createSelectElement(e,t,n){let i=!1;const l=t.map((t=>{t.value===e&&(i=!0);const n=document.createElement("option");return n.text=t.name,n.value=t.value,n}));if(null!=e&&""!==e&&!i){const t=document.createElement("option");t.text=e,t.value=e,l.unshift(t)}if(!n.required&&null==n.value){const e=document.createElement("option");e.value="",l.unshift(e)}const o=document.createElement("select");return l.forEach((e=>o.add(e))),o.value=e,o}_setUpInputField(e,t){const{config:n,field:i,layer:l}=this,o=new d({config:n,feature:e,field:i,layer:l,group:null,messages:null});return o.set("value",t),o}_isDomainCompatible(e){const{field:t}=this;if(e&&"coded-value"===e.type){const n=typeof e.codedValues[0].code;if("string"===n&&s(t)||"number"===n&&u(t))return!0}return!(!e||"range"!==e.type||!u(t))}_getDomainForFeature(e){const{layer:t,name:n}=this;if("wfs"===t.type||"geojson"===t.type)return null;const{typeIdField:i}=t,l=i===n,o=this.get("field.domain");if(l&&!o)return new r({name:"__internal-type-based-coded-value-domain__",codedValues:t.types.map((({id:e,name:t})=>({code:e,name:t})))});const a=i&&t.getFieldDomain(n,{feature:e})||o,u=this.get("config.domain");return this._isDomainCompatible(u)?u:a}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const n=t.codedValues.filter((t=>t.hasOwnProperty("code")&&t.code===e));return n&&n.length?n[0].name:e}return null}_getCombinedDateTime(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())}};e([t({readOnly:!0,aliasOf:"field.alias"})],_.prototype,"alias",void 0),e([t()],_.prototype,"cellValueFormatFunction",void 0),e([t()],_.prototype,"cellValueValidatorFunction",void 0),e([t()],_.prototype,"config",void 0),e([t({readOnly:!0,aliasOf:"field.defaultValue"})],_.prototype,"defaultValue",void 0),e([t({readOnly:!0,aliasOf:"field.description"})],_.prototype,"description",void 0),e([t({readOnly:!0})],_.prototype,"editable",null),e([t()],_.prototype,"editingEnabled",void 0),e([t()],_.prototype,"field",void 0),e([t()],_.prototype,"formatFunction",void 0),e([t({readOnly:!0})],_.prototype,"header",null),e([t()],_.prototype,"hidden",null),e([t()],_.prototype,"headerRenderFunction",void 0),e([t()],_.prototype,"inputRenderFunction",void 0),e([t()],_.prototype,"layer",void 0),e([t({readOnly:!0})],_.prototype,"loadingMessage",null),e([t()],_.prototype,"maxLength",null),e([t({readOnly:!0,aliasOf:"config.menuConfig"})],_.prototype,"menuConfig",void 0),e([t({readOnly:!0,aliasOf:"field.name"})],_.prototype,"name",void 0),e([t({readOnly:!0,aliasOf:"field.nullable"})],_.prototype,"nullable",void 0),e([t()],_.prototype,"parseInputValueFunction",void 0),e([t({readOnly:!0})],_.prototype,"path",null),e([t({readOnly:!0})],_.prototype,"required",null),e([t()],_.prototype,"sortable",null),e([t({readOnly:!0,aliasOf:"field.type"})],_.prototype,"type",void 0),e([t()],_.prototype,"updateRowItemFunction",void 0),_=e([n("esri.widgets.FeatureTable.FieldColumn")],_);const F=_;export{F as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{convertDateFormatToIntlOptions as i,formatDate as o}from"../../intl/date.js";import{convertNumberFormatToIntlOptions as l,formatNumber as a}from"../../intl/number.js";import r from"../../layers/support/CodedValueDomain.js";import{isNumericField as s,isStringField as d}from"../../layers/support/fieldUtils.js";import u from"../FeatureForm/InputField.js";import c from"./Grid/EditorColumn.js";import p from"../support/DatePicker.js";import m from"../support/TimePicker.js";import{renderingSanitizer as h}from"../support/widgetUtils.js";const f={cancelEdit:"Escape"},g={headerContent:"esri-field-column__header-content",input:"esri-field-column__cell-input",inputContainer:"esri-field-column__cell__input-container",dateInputContainer:"esri-field-column__cell__date-input-container",dateInputWrapper:"esri-field-column__cell__date-input-wrapper",button:"esri-field-column__button",saveIcon:"esri-icon-save",trashIcon:"esri-icon-trash",locked:"esri-icon-locked"},y=i("short-date-short-time"),v=i("short-date"),b=l({digitSeparator:!0,places:null});let _=class extends c{constructor(e){super(e),this._inputField=null,this.alias=null,this.cellValueFormatFunction=({rowData:e,value:t})=>{if(this.formatFunction){const{config:e,field:n}=this;return this.formatFunction({config:e,field:n,value:h.sanitize(t)})}if(null===t)return"&nbsp;";const{config:n,field:r,type:d}=this,{item:{feature:u}}=e,c=this._getDomainForFeature(u);if(c)return this._getComputedDomain(t,c);if("date"===d){const e=n?.format?.dateFormat?i(n.format.dateFormat):!1===n?.includeTime?v:y,l="feature"===this.layer?.type&&this.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null;return t?o(t,{...e,...l}):null}if(s(r)){const e=n?.format?l(n.format):b;return a(parseFloat(t),e)}return h.sanitize(t)},this.cellValueValidatorFunction=({oldValue:e,value:t})=>e!==t,this.config=null,this.defaultValue=null,this.description=null,this.editingEnabled=!1,this.field=null,this.formatFunction=null,this.headerRenderFunction=e=>{const{root:t}=e,{editable:n,editingEnabled:i,headerMenuEnabled:o,sortable:l}=this;if(this.removeCellContent(t),t.classList.add(g.headerContent),i&&!n&&t.appendChild(this.createLockedElement()),l)this.headerSorterRenderFunction(e);else{const{header:e,path:n}=this,i=document.createElement("div");i.innerHTML=e||n,t.appendChild(i)}o&&this.headerMenuRenderFunction(e)},this.inputRenderFunction=({root:e,column:t,rowData:n})=>{if(this.activeEditInfo?.updating)return;if(!this.editable)return;const i=this.getCellValue(t,n),o=this.createInputElement({root:e,column:t,rowData:n,value:i});if(this._set("activeEditInfo",{column:t,input:o,root:e,rowData:n,updating:!0,oldValue:i}),"date"===this.type)return void this._renderDateEditors(i,e,o);const l=this.createInputContainer();l.appendChild(o),this.removeCellContent(e),e.appendChild(l),o.focus(),o instanceof HTMLInputElement&&o.select(),this.grid?.notifyResize()},this.layer=null,this.menuConfig=null,this.name=null,this.nullable=!0,this.parseInputValueFunction=({input:e})=>{const t=this._inputField,n=e.value,{required:i,type:o}=t;return i||""!==n?"number"===o||"date"===o?parseFloat(n):n:null},this.type=null,this.updateRowItemFunction=({rowData:e,column:t,value:n})=>{e.item.feature.attributes[t.path]=n}}get editable(){return this.editingEnabled?this.config?!1!==this.config.editable&&this.field?.editable:this.field?.editable:!!this.config&&(!0===this.config.editable&&this.field?.editable)}get header(){return this.config?.label||this.alias||this.path||null}get hidden(){const{config:e}=this;return!1===e?.visible||this._get("hidden")||!1}set hidden(e){this._set("hidden",e)}get loadingMessage(){return this.messages?.loading||"..."}get maxLength(){const e=this.field?.length,t=this.config?.maxLength;return!isNaN(t)&&t>=-1&&(-1===e||t<=e)?t:e}get path(){return this.field?.name||null}get required(){const e=this.get("field.nullable"),t=this.get("config.required");return this.editable&&(!e||!0===t)}get sortable(){return!1!==this.config?.sortable}createInputElement({rowData:e,value:t}){const{item:n}=e;if(!n||!n.feature)return null;this._inputField=this._setUpInputField(n.feature,t);const{field:i,maxLength:o,required:l}=this,{domain:a}=this._inputField;let r=null;"coded-value"===a?.type?(r=this._createSelectElement(t,a.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),this._inputField),r.onchange=()=>{r.onblur=null,u()}):(r=document.createElement("input"),r.type=s(i)?"number":"text",o>-1&&(r.maxLength=o)),r.classList.add(g.input),r.value=t,r.required=l;let d=!1;r.onkeydown=e=>{d=e.key===f.cancelEdit},r.onblur=()=>{r.onblur=null,u()};const u=()=>{d?this.cancel():this.submit(),this._inputField=null};return r}createInputContainer(){const e=document.createElement("div");return e.classList.add(g.inputContainer),e}createLockedElement(){const e=document.createElement("div");return e.classList.add(g.locked),e}getCellValue({path:e},{item:t}){return t?.feature?.attributes?.[e]??null}_renderDateEditors(e,t,n){const{config:i,messagesCommon:o}=this,l=e?new Date(e):new Date(Date.now()),a=new p({dateInputEnabled:!0,value:l}),r=new m({value:l});n.value=l.getTime().toString();let s=!e;const d=()=>{s=!0;const e=this._getCombinedDateTime(a.value,r.value);n.value=e.getTime().toString()},u=()=>{s?this.submit():this.cancel()},c=()=>{n.value=null,this.submit()};a.watch("value",(()=>d())),r.watch("value",(()=>d()));const h=document.createElement("div"),f=document.createElement("div");a.container=h,r.container=f;const y=document.createElement("button");y.classList.add(g.button,g.saveIcon),y.onclick=()=>u(),y.title=o?.save;const v=document.createElement("button");v.classList.add(g.button,g.trashIcon),v.onclick=()=>c(),v.title=o?.clear;const b=document.createElement("div");b.classList.add(g.dateInputWrapper),b.appendChild(h),!1!==i.includeTime&&b.appendChild(f);const _=document.createElement("div");_.classList.add(g.dateInputContainer),_.appendChild(b),_.appendChild(y),_.appendChild(v),a.when((()=>this.grid?.notifyResize())),r.when((()=>this.grid?.notifyResize())),this.removeCellContent(t),t.appendChild(_),this.grid?.notifyResize()}_createSelectElement(e,t,n){let i=!1;const o=t.map((t=>{t.value===e&&(i=!0);const n=document.createElement("option");return n.text=t.name,n.value=t.value,n}));if(null!=e&&""!==e&&!i){const t=document.createElement("option");t.text=e,t.value=e,o.unshift(t)}if(!n.required&&null==n.value){const e=document.createElement("option");e.value="",o.unshift(e)}const l=document.createElement("select");return o.forEach((e=>l.add(e))),l.value=e,l}_setUpInputField(e,t){const{config:n,field:i,layer:o}=this,l=new u({config:n,feature:e,field:i,layer:o,group:null,messages:null});return l.set("value",t),l}_isDomainCompatible(e){const{field:t}=this;if(e&&"coded-value"===e.type){const n=typeof e.codedValues[0].code;if("string"===n&&d(t)||"number"===n&&s(t))return!0}return!(!e||"range"!==e.type||!s(t))}_getDomainForFeature(e){const{layer:t,name:n}=this;if("wfs"===t.type||"geojson"===t.type)return null;const{typeIdField:i}=t,o=i===n,l=this.get("field.domain");if(o&&!l)return new r({name:"__internal-type-based-coded-value-domain__",codedValues:t.types.map((({id:e,name:t})=>({code:e,name:t})))});const a=i&&t.getFieldDomain(n,{feature:e})||l,s=this.get("config.domain");return this._isDomainCompatible(s)?s:a}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const n=t.codedValues.filter((t=>t.hasOwnProperty("code")&&t.code===e));return n&&n.length?n[0].name:e}return null}_getCombinedDateTime(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())}};e([t({readOnly:!0,aliasOf:"field.alias"})],_.prototype,"alias",void 0),e([t()],_.prototype,"cellValueFormatFunction",void 0),e([t()],_.prototype,"cellValueValidatorFunction",void 0),e([t()],_.prototype,"config",void 0),e([t({readOnly:!0,aliasOf:"field.defaultValue"})],_.prototype,"defaultValue",void 0),e([t({readOnly:!0,aliasOf:"field.description"})],_.prototype,"description",void 0),e([t({readOnly:!0})],_.prototype,"editable",null),e([t()],_.prototype,"editingEnabled",void 0),e([t()],_.prototype,"field",void 0),e([t()],_.prototype,"formatFunction",void 0),e([t({readOnly:!0})],_.prototype,"header",null),e([t()],_.prototype,"hidden",null),e([t()],_.prototype,"headerRenderFunction",void 0),e([t()],_.prototype,"inputRenderFunction",void 0),e([t()],_.prototype,"layer",void 0),e([t({readOnly:!0})],_.prototype,"loadingMessage",null),e([t()],_.prototype,"maxLength",null),e([t({readOnly:!0,aliasOf:"config.menuConfig"})],_.prototype,"menuConfig",void 0),e([t({readOnly:!0,aliasOf:"field.name"})],_.prototype,"name",void 0),e([t({readOnly:!0,aliasOf:"field.nullable"})],_.prototype,"nullable",void 0),e([t()],_.prototype,"parseInputValueFunction",void 0),e([t({readOnly:!0})],_.prototype,"path",null),e([t({readOnly:!0})],_.prototype,"required",null),e([t()],_.prototype,"sortable",null),e([t({readOnly:!0,aliasOf:"field.type"})],_.prototype,"type",void 0),e([t()],_.prototype,"updateRowItemFunction",void 0),_=e([n("esri.widgets.FeatureTable.FieldColumn")],_);const F=_;export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../core/HandleOwner.js";import{isSome as i}from"../../../core/maybe.js";import{watch as r}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import l from"./support/ButtonMenu.js";import{renderingSanitizer as d}from"../../support/widgetUtils.js";const a={sortAscIcon:"esri-icon-arrow-up",sortDescIcon:"esri-icon-arrow-down",menuContainer:"esri-column__menu-container",menuIcon:"esri-icon-handle-horizontal",sorter:"esri-column__sorter"},u={keyboardSort1:"Enter",keyboardSort2:"Spacebar"};let c=class extends(o(e.EventedAccessor)){constructor(t){super(t),this._menuContainer=null,this.activeRowIndex=null,this.autoWidth=!1,this.cellValueFormatFunction=({value:t})=>d.sanitize(t),this.flexGrow=1,this.footerRenderFunction=null,this.frozen=!1,this.grid=null,this.header=null,this.headerRenderFunction=t=>{const{root:e}=t,{header:o,headerMenuEnabled:i,path:r,sortable:n}=this;if(this.removeCellContent(e),n)return this.headerSorterRenderFunction(t),void(i&&this.headerMenuRenderFunction(t));i&&this.headerMenuRenderFunction(t);const s=o||r;e.innerHTML!==s&&(e.innerHTML=s)},this.headerMenuRenderFunction=({root:t})=>{var e,o;(null==(e=this.menu)||null==(o=e.items)?void 0:o.length)&&t.appendChild(this._menuContainer)},this.headerSorterRenderFunction=({root:t})=>{var e;const{header:o,path:i,sortElement:r}=this,n=o||i;if(!r)return void(t.innerHTML=n);r.innerHTML!==n&&r.setAttribute("innerHTML",n),t.appendChild(r);const s=null==(e=this.grid)?void 0:e.getSlotElementByName(t.slot),l=null==s?void 0:s.parentElement;l&&!l.onkeydown&&(l.onkeydown=({key:t})=>{t!==u.keyboardSort1&&t!==u.keyboardSort2||r.click()})},this.hidden=!1,this.headerMenuEnabled=!0,this.initialSortPriority=null,this.menu=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.renderFunction=({root:t,column:e,rowData:o})=>{const i=this.getCellValue(e,o),r=this.cellValueFormatFunction({column:e,rowData:o,value:i});t.innerHTML!==r&&(t.innerHTML=r)},this.resizable=!0,this.sortable=!0,this.sortElement=null,this.textAlign="start",this.width=200}initialize(){const{messages:t,path:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this._menuContainer=document.createElement("div"),this._menuContainer.classList.add(a.menuContainer),this.menu=new l({label:null==t?void 0:t.options,iconClass:a.menuIcon,...this.menuConfig}),this.menu.container=this._menuContainer,this.menu.set("items",this.getMenuItems()),this.handles.add([r(this,"hidden",(()=>{var t;return null==(t=this.menu)?void 0:t.set("open",!1)}))])}destroy(){var t;null==(t=this.menu)||t.destroy()}set direction(t){this.sortable&&(this.sortElement&&(t?this.sortElement.direction!==t&&this.sortElement.setAttribute("direction",t):this.sortElement.removeAttribute("direction")),this._set("direction",t))}get direction(){return this._get("direction")||null}set path(t){this.sortElement&&this.sortElement.path!==t&&this.sortElement.setAttribute("path",t),this._set("path",t)}getMenuItems(){const{menuConfig:t,sortable:e}=this,o=null==t?void 0:t.items,i=this.getSortMenuItems(),r=[];return e&&r.push(...i),(null==o?void 0:o.length)&&r.push(...o),r.length?r:null}getSortMenuItems(){const{messages:t}=this;return[{selected:"asc"===this.direction,iconClass:a.sortAscIcon,label:null==t?void 0:t.sortAsc,autoCloseMenu:!0,clickFunction:()=>this.set("direction","asc"!==this.direction?"asc":null)},{selected:"desc"===this.direction,iconClass:a.sortDescIcon,label:null==t?void 0:t.sortDesc,autoCloseMenu:!0,clickFunction:()=>this.set("direction","desc"!==this.direction?"desc":null)}]}getCellValue(t,e){var o;return null!=(o=null==e?void 0:e.item[null==t?void 0:t.path])?o:""}createSortElement(){const{direction:t,header:e,path:o,initialSortPriority:r}=this,n=e||o,s=document.createElement("vaadin-grid-sorter");return s.classList.add(a.sorter),s.setAttribute("path",o),s.setAttribute("title",n),s.innerHTML=n,t&&s.setAttribute("direction",t),i(r)&&(s._initialOrder=r),s.addEventListener("direction-changed",(()=>{this.direction!==s.direction&&this._set("direction",s.direction)})),s}removeCellContent(t){if(t)for(;t.firstChild;)try{t.removeChild(t.firstChild)}catch(e){}}};t([n()],c.prototype,"activeRowIndex",void 0),t([n()],c.prototype,"autoWidth",void 0),t([n()],c.prototype,"cellValueFormatFunction",void 0),t([n()],c.prototype,"direction",null),t([n()],c.prototype,"flexGrow",void 0),t([n()],c.prototype,"footerRenderFunction",void 0),t([n()],c.prototype,"frozen",void 0),t([n()],c.prototype,"grid",void 0),t([n()],c.prototype,"header",void 0),t([n()],c.prototype,"headerRenderFunction",void 0),t([n()],c.prototype,"headerMenuRenderFunction",void 0),t([n()],c.prototype,"headerSorterRenderFunction",void 0),t([n()],c.prototype,"hidden",void 0),t([n()],c.prototype,"headerMenuEnabled",void 0),t([n({constructOnly:!0})],c.prototype,"initialSortPriority",void 0),t([n()],c.prototype,"menu",void 0),t([n()],c.prototype,"menuConfig",void 0),t([n()],c.prototype,"messages",void 0),t([n()],c.prototype,"messagesCommon",void 0),t([n()],c.prototype,"path",null),t([n()],c.prototype,"renderFunction",void 0),t([n()],c.prototype,"resizable",void 0),t([n()],c.prototype,"sortable",void 0),t([n({readOnly:!0})],c.prototype,"sortElement",void 0),t([n()],c.prototype,"textAlign",void 0),t([n()],c.prototype,"width",void 0),c=t([s("esri.widgets.FeatureTable.Grid.Column")],c);const h=c;export{h as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../core/HandleOwner.js";import{isSome as i}from"../../../core/maybe.js";import{watch as r}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import d from"./support/ButtonMenu.js";import{renderingSanitizer as l}from"../../support/widgetUtils.js";const a={sortAscIcon:"esri-icon-arrow-up",sortDescIcon:"esri-icon-arrow-down",menuContainer:"esri-column__menu-container",menuIcon:"esri-icon-handle-horizontal",sorter:"esri-column__sorter"},c={keyboardSort1:"Enter",keyboardSort2:"Spacebar"};let h=class extends(o(e.EventedAccessor)){constructor(t){super(t),this._menuContainer=null,this.activeRowIndex=null,this.autoWidth=!1,this.cellValueFormatFunction=({value:t})=>l.sanitize(t),this.flexGrow=1,this.footerRenderFunction=null,this.frozen=!1,this.grid=null,this.header=null,this.headerRenderFunction=t=>{const{root:e}=t,{header:o,headerMenuEnabled:i,path:r,sortable:n}=this;if(this.removeCellContent(e),n)return this.headerSorterRenderFunction(t),void(i&&this.headerMenuRenderFunction(t));i&&this.headerMenuRenderFunction(t);const s=o||r;e.innerHTML!==s&&(e.innerHTML=s)},this.headerMenuRenderFunction=({root:t})=>{this.menu?.items?.length&&t.appendChild(this._menuContainer)},this.headerSorterRenderFunction=({root:t})=>{const{header:e,path:o,sortElement:i}=this,r=e||o;if(!i)return void(t.innerHTML=r);i.innerHTML!==r&&i.setAttribute("innerHTML",r),t.appendChild(i);const n=this.grid?.getSlotElementByName(t.slot),s=n?.parentElement;s&&!s.onkeydown&&(s.onkeydown=({key:t})=>{t!==c.keyboardSort1&&t!==c.keyboardSort2||i.click()})},this.hidden=!1,this.headerMenuEnabled=!0,this.initialSortPriority=null,this.menu=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.renderFunction=({root:t,column:e,rowData:o})=>{const i=this.getCellValue(e,o),r=this.cellValueFormatFunction({column:e,rowData:o,value:i});t.innerHTML!==r&&(t.innerHTML=r)},this.resizable=!0,this.sortable=!0,this.sortElement=null,this.textAlign="start",this.width=200}initialize(){const{messages:t,path:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this._menuContainer=document.createElement("div"),this._menuContainer.classList.add(a.menuContainer),this.menu=new d({label:t?.options,iconClass:a.menuIcon,...this.menuConfig}),this.menu.container=this._menuContainer,this.menu.set("items",this.getMenuItems()),this.handles.add([r(this,"hidden",(()=>this.menu?.set("open",!1)))])}destroy(){this.menu?.destroy()}set direction(t){this.sortable&&(this.sortElement&&(t?this.sortElement.direction!==t&&this.sortElement.setAttribute("direction",t):this.sortElement.removeAttribute("direction")),this._set("direction",t))}get direction(){return this._get("direction")||null}set path(t){this.sortElement&&this.sortElement.path!==t&&this.sortElement.setAttribute("path",t),this._set("path",t)}getMenuItems(){const{menuConfig:t,sortable:e}=this,o=t?.items,i=this.getSortMenuItems(),r=[];return e&&r.push(...i),o?.length&&r.push(...o),r.length?r:null}getSortMenuItems(){const{messages:t}=this;return[{selected:"asc"===this.direction,iconClass:a.sortAscIcon,label:t?.sortAsc,autoCloseMenu:!0,clickFunction:()=>this.set("direction","asc"!==this.direction?"asc":null)},{selected:"desc"===this.direction,iconClass:a.sortDescIcon,label:t?.sortDesc,autoCloseMenu:!0,clickFunction:()=>this.set("direction","desc"!==this.direction?"desc":null)}]}getCellValue(t,e){return e?.item[t?.path]??""}createSortElement(){const{direction:t,header:e,path:o,initialSortPriority:r}=this,n=e||o,s=document.createElement("vaadin-grid-sorter");return s.classList.add(a.sorter),s.setAttribute("path",o),s.setAttribute("title",n),s.innerHTML=n,t&&s.setAttribute("direction",t),i(r)&&(s._initialOrder=r),s.addEventListener("direction-changed",(()=>{this.direction!==s.direction&&this._set("direction",s.direction)})),s}removeCellContent(t){if(t)for(;t.firstChild;)try{t.removeChild(t.firstChild)}catch(e){}}};t([n()],h.prototype,"activeRowIndex",void 0),t([n()],h.prototype,"autoWidth",void 0),t([n()],h.prototype,"cellValueFormatFunction",void 0),t([n()],h.prototype,"direction",null),t([n()],h.prototype,"flexGrow",void 0),t([n()],h.prototype,"footerRenderFunction",void 0),t([n()],h.prototype,"frozen",void 0),t([n()],h.prototype,"grid",void 0),t([n()],h.prototype,"header",void 0),t([n()],h.prototype,"headerRenderFunction",void 0),t([n()],h.prototype,"headerMenuRenderFunction",void 0),t([n()],h.prototype,"headerSorterRenderFunction",void 0),t([n()],h.prototype,"hidden",void 0),t([n()],h.prototype,"headerMenuEnabled",void 0),t([n({constructOnly:!0})],h.prototype,"initialSortPriority",void 0),t([n()],h.prototype,"menu",void 0),t([n()],h.prototype,"menuConfig",void 0),t([n()],h.prototype,"messages",void 0),t([n()],h.prototype,"messagesCommon",void 0),t([n()],h.prototype,"path",null),t([n()],h.prototype,"renderFunction",void 0),t([n()],h.prototype,"resizable",void 0),t([n()],h.prototype,"sortable",void 0),t([n({readOnly:!0})],h.prototype,"sortElement",void 0),t([n()],h.prototype,"textAlign",void 0),t([n()],h.prototype,"width",void 0),h=t([s("esri.widgets.FeatureTable.Grid.Column")],h);const u=h;export{u as default};