@arcgis/core 5.0.0-next.57 → 5.0.0-next.59

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 (351) hide show
  1. package/Graphic.d.ts +2 -2
  2. package/Viewpoint.d.ts +1 -1
  3. package/applications/Components/arcadeFeatureUtils.d.ts +20 -1
  4. package/applications/Components/arcadeFeatureUtils.js +1 -1
  5. package/applications/Urban/meshUtils.d.ts +2 -2
  6. package/arcade.d.ts +1 -1
  7. package/arcade.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/0bd73a66baea2f52e8a6.js +1 -0
  10. package/assets/esri/core/workers/chunks/18ce7b1559a45d017c45.js +1 -0
  11. package/assets/esri/core/workers/chunks/262c5794650853457acc.js +1 -0
  12. package/assets/esri/core/workers/chunks/3405a23973f9e701a4d6.js +1 -0
  13. package/assets/esri/core/workers/chunks/352c674730c7b7258ae3.js +1 -0
  14. package/assets/esri/core/workers/chunks/55a9ea536c64976c3409.js +1 -0
  15. package/assets/esri/core/workers/chunks/62752cd6821959cf6751.js +1 -0
  16. package/assets/esri/core/workers/chunks/72e3a48aa365542b0689.js +1 -0
  17. package/assets/esri/core/workers/chunks/{5f9e64f00329cb646f0c.js → 741d170187e58e81584d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/a6b1e3ec30f6d641aea9.js +1 -0
  19. package/assets/esri/core/workers/chunks/{da2c41ac0f82f32013c1.js → a7aa87e2c4197ba595ef.js} +10 -10
  20. package/assets/esri/core/workers/chunks/{d76513a6260d9ec4ea25.js → bf82bb1cdd8b31e7f2aa.js} +1 -1
  21. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  22. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  23. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  24. package/assets/esri/themes/base/widgets/_Attribution.scss +2 -2
  25. package/assets/esri/themes/base/widgets/_FeatureTable.scss +24 -0
  26. package/assets/esri/themes/dark/main.css +1 -1
  27. package/assets/esri/themes/light/main.css +1 -1
  28. package/assets/esri/themes/light/view.css +1 -1
  29. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  30. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  31. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  32. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  33. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  34. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  35. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  36. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  37. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  38. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  39. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  40. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  41. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  42. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  43. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  44. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  45. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  46. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  47. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  48. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  49. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  50. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  53. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  54. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  55. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  56. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  57. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  58. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  59. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  60. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  61. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  62. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  63. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  64. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  65. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  70. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
  71. package/chunks/lerc-wasm.js +1 -1
  72. package/config.js +1 -1
  73. package/core/workers/workerFactory.js +1 -1
  74. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  75. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  76. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  77. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  78. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  79. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  80. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  81. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  82. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  83. package/geometry/Extent.d.ts +1 -1
  84. package/geometry/Mesh.d.ts +2 -2
  85. package/geometry/SpatialReference.js +1 -1
  86. package/geometry/geometryEngine.d.ts +3 -3
  87. package/geometry/{geometryEngineInterfaces.d.ts → geometryEngineTypes.d.ts} +1 -1
  88. package/geometry/operators/affineTransformOperator.d.ts +3 -3
  89. package/geometry/operators/alphaShapeOperator.d.ts +1 -1
  90. package/geometry/operators/areaOperator.d.ts +1 -1
  91. package/geometry/operators/boundaryOperator.d.ts +3 -3
  92. package/geometry/operators/bufferOperator.d.ts +1 -1
  93. package/geometry/operators/centroidOperator.d.ts +1 -1
  94. package/geometry/operators/clipOperator.d.ts +3 -3
  95. package/geometry/operators/containsOperator.d.ts +1 -1
  96. package/geometry/operators/convexHullOperator.d.ts +3 -3
  97. package/geometry/operators/crossesOperator.d.ts +1 -1
  98. package/geometry/operators/cutOperator.d.ts +2 -2
  99. package/geometry/operators/densifyOperator.d.ts +3 -3
  100. package/geometry/operators/differenceOperator.d.ts +3 -3
  101. package/geometry/operators/disjointOperator.d.ts +1 -1
  102. package/geometry/operators/distanceOperator.d.ts +1 -1
  103. package/geometry/operators/equalsOperator.d.ts +1 -1
  104. package/geometry/operators/generalizeOperator.d.ts +3 -3
  105. package/geometry/operators/geodesicBufferOperator.d.ts +1 -2
  106. package/geometry/operators/geodesicProximityOperator.d.ts +2 -5
  107. package/geometry/operators/geodeticAreaOperator.d.ts +1 -2
  108. package/geometry/operators/geodeticDensifyOperator.d.ts +3 -4
  109. package/geometry/operators/geodeticDistanceOperator.d.ts +1 -2
  110. package/geometry/operators/geodeticLengthOperator.d.ts +1 -2
  111. package/geometry/operators/geodeticUtilsOperator.d.ts +1 -1
  112. package/geometry/operators/graphicBufferOperator.d.ts +1 -1
  113. package/geometry/operators/integrateOperator.d.ts +2 -2
  114. package/geometry/operators/intersectionOperator.d.ts +3 -3
  115. package/geometry/operators/intersectsOperator.d.ts +1 -1
  116. package/geometry/operators/isNearOperator.d.ts +1 -1
  117. package/geometry/operators/labelPointOperator.d.ts +1 -1
  118. package/geometry/operators/lengthOperator.d.ts +1 -1
  119. package/geometry/operators/linesToPolygonsOperator.d.ts +1 -1
  120. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  121. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  122. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  123. package/geometry/operators/offsetOperator.d.ts +3 -3
  124. package/geometry/operators/overlapsOperator.d.ts +1 -1
  125. package/geometry/operators/projectOperator.d.ts +4 -6
  126. package/geometry/operators/proximityOperator.d.ts +2 -2
  127. package/geometry/operators/relateOperator.d.ts +1 -1
  128. package/geometry/operators/shapePreservingProjectOperator.d.ts +3 -3
  129. package/geometry/operators/simplifyOGCOperator.d.ts +3 -3
  130. package/geometry/operators/simplifyOperator.d.ts +3 -3
  131. package/geometry/operators/symmetricDifferenceOperator.d.ts +3 -3
  132. package/geometry/operators/touchesOperator.d.ts +1 -1
  133. package/geometry/operators/{support/proximityResult.d.ts → types.d.ts} +18 -3
  134. package/geometry/operators/unionOperator.d.ts +3 -3
  135. package/geometry/operators/withinOperator.d.ts +1 -1
  136. package/geometry/projection/projectBoundingSphere.js +1 -1
  137. package/geometry/support/curves/curveUtils.js +1 -1
  138. package/geometry/support/geodesicUtils.d.ts +15 -2
  139. package/geometry/support/jsonUtils.d.ts +1 -1
  140. package/geometry/support/meshUtils/types.d.ts +34 -0
  141. package/geometry/support/meshUtils.d.ts +4 -7
  142. package/geometry/support/sphere.js +1 -1
  143. package/geometry/support/webMercatorUtils.d.ts +1 -1
  144. package/geometry/types.d.ts +23 -1
  145. package/geometry.d.ts +1 -1
  146. package/interfaces.d.ts +69 -72
  147. package/kernel.js +1 -1
  148. package/layers/CSVLayer.d.ts +0 -2
  149. package/layers/CatalogLayer.d.ts +1 -1
  150. package/layers/FeatureLayer.d.ts +1 -1
  151. package/layers/GeoJSONLayer.d.ts +1 -1
  152. package/layers/KnowledgeGraphLayer.js +1 -1
  153. package/layers/LinkChartLayer.js +1 -1
  154. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  155. package/layers/OGCFeatureLayer.d.ts +1 -1
  156. package/layers/OrientedImageryLayer.d.ts +1 -3
  157. package/layers/ParquetLayer.d.ts +1 -1
  158. package/layers/WFSLayer.d.ts +1 -1
  159. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  160. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  161. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -3
  162. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  163. package/layers/knowledgeGraph/layerUtils.js +1 -1
  164. package/layers/mixins/APIKeyMixin.d.ts +2 -2
  165. package/layers/mixins/ArcGISImageService.d.ts +4 -3
  166. package/layers/mixins/BlendLayer.d.ts +16 -15
  167. package/layers/mixins/DisplayFilteredLayer.d.ts +6 -3
  168. package/layers/mixins/FeatureEffectLayer.d.ts +23 -21
  169. package/layers/mixins/FeatureLayerBase.d.ts +23 -20
  170. package/layers/mixins/ImageryTileMixin.d.ts +5 -5
  171. package/layers/mixins/PortalLayer.d.ts +7 -7
  172. package/layers/mixins/RasterPresetRendererMixin.d.ts +6 -3
  173. package/layers/mixins/SceneService.d.ts +2 -2
  174. package/layers/mixins/TemporalLayer.d.ts +8 -7
  175. package/layers/mixins/TemporalSceneLayer.d.ts +2 -2
  176. package/layers/mixins/TrackableLayer.d.ts +4 -4
  177. package/layers/ogc/wfsUtils.d.ts +1 -1
  178. package/layers/raster/formats/Lerc.js +1 -1
  179. package/layers/raster/functions/creators/createSurfaceFunctions.d.ts +2 -2
  180. package/layers/support/DisplayFilterInfo.d.ts +7 -7
  181. package/layers/support/FeatureReductionCluster.d.ts +5 -5
  182. package/layers/support/FieldsIndex.d.ts +1 -2
  183. package/layers/support/RasterBandInfo.d.ts +1 -1
  184. package/layers/support/RasterInfo.d.ts +2 -2
  185. package/layers/support/RasterSensorInfo.d.ts +1 -1
  186. package/layers/support/Sublayer.d.ts +3 -3
  187. package/layers/support/SubtypeSublayer.d.ts +1 -1
  188. package/layers/support/TrackInfo.d.ts +2 -2
  189. package/layers/support/arcgisLayerUrl.js +1 -1
  190. package/layers/support/fieldUtils.d.ts +0 -1
  191. package/layers/support/source/QueryTableDataSource.d.ts +2 -2
  192. package/layers/support/types.d.ts +2 -2
  193. package/layers/types.d.ts +1 -1
  194. package/package.json +2 -2
  195. package/popup/FieldInfo.d.ts +8 -8
  196. package/popup/content/AttachmentsContent.d.ts +2 -2
  197. package/popup/content/CustomContent.d.ts +1 -1
  198. package/portal/interfaces.d.ts +2 -2
  199. package/portal/support/resourceUtils.d.ts +6 -7
  200. package/rest/featureService/types.d.ts +1 -1
  201. package/rest/geometryService.d.ts +2 -2
  202. package/rest/imageService.d.ts +1 -1
  203. package/rest/knowledgeGraph/GraphAnyValue.d.ts +1 -1
  204. package/rest/query/support/AttachmentInfo.d.ts +1 -1
  205. package/rest/query.d.ts +1 -1
  206. package/rest/support/BufferParameters.d.ts +1 -1
  207. package/rest/support/DataLayer.d.ts +1 -1
  208. package/rest/support/DensifyParameters.d.ts +1 -1
  209. package/rest/support/DistanceParameters.d.ts +1 -1
  210. package/rest/support/FeatureSet.d.ts +2 -2
  211. package/rest/support/FindImagesParameters.d.ts +1 -1
  212. package/rest/support/GeneralizeParameters.d.ts +1 -1
  213. package/rest/support/IdentifyParameters.d.ts +1 -1
  214. package/rest/support/ImageGPSInfoParameters.d.ts +1 -1
  215. package/rest/support/ImageMeasureResultAreaValue.d.ts +1 -1
  216. package/rest/support/ImageToMapMultirayParameters.d.ts +1 -1
  217. package/rest/support/OffsetParameters.d.ts +1 -1
  218. package/rest/support/ProjectParameters.d.ts +1 -1
  219. package/rest/support/Query.d.ts +1 -1
  220. package/rest/support/QueryMixin.d.ts +1 -1
  221. package/rest/support/RelationParameters.d.ts +1 -1
  222. package/rest/support/RelationshipQuery.d.ts +1 -1
  223. package/rest/support/TopFeaturesQuery.d.ts +1 -1
  224. package/smartMapping/labels/bins.d.ts +3 -6
  225. package/smartMapping/labels/clusters.d.ts +2 -2
  226. package/smartMapping/popup/clusters.d.ts +4 -4
  227. package/smartMapping/popup/templates.d.ts +4 -4
  228. package/smartMapping/renderers/color.d.ts +6 -6
  229. package/smartMapping/renderers/size.d.ts +6 -6
  230. package/smartMapping/statistics/support/ageUtils.d.ts +5 -5
  231. package/smartMapping/statistics/types.d.ts +5 -5
  232. package/smartMapping/types.d.ts +9 -1
  233. package/support/revision.js +1 -1
  234. package/unionTypes.d.ts +1 -1
  235. package/views/2d/MapViewConstraints.d.ts +5 -4
  236. package/views/2d/engine/webgl/Painter.js +1 -1
  237. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  238. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  239. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  240. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  241. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  242. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  243. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  244. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  245. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  246. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  247. package/views/3d/layers/I3SMeshView3D.js +1 -1
  248. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  249. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  250. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  251. package/views/3d/layers/i3s/I3SNode.js +1 -1
  252. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  253. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  254. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  255. package/views/3d/support/ElevationRange.js +1 -1
  256. package/views/3d/terrain/TerrainSurface.js +1 -1
  257. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  258. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  259. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  260. package/views/BreakpointsOwner.d.ts +1 -1
  261. package/views/LinkChartView.d.ts +1 -2
  262. package/views/MapView.d.ts +1 -2
  263. package/views/SceneView.d.ts +1 -2
  264. package/views/View.d.ts +1 -1
  265. package/views/Viewport2DMixin.d.ts +1 -1
  266. package/views/draw/MultipointDrawAction.d.ts +1 -1
  267. package/views/draw/MultipointDrawAction.js +1 -1
  268. package/views/draw/PointDrawAction.d.ts +1 -1
  269. package/views/draw/PointDrawAction.js +1 -1
  270. package/views/draw/PolygonDrawAction.d.ts +1 -1
  271. package/views/draw/PolygonDrawAction.js +1 -1
  272. package/views/draw/PolylineDrawAction.d.ts +1 -1
  273. package/views/draw/PolylineDrawAction.js +1 -1
  274. package/views/draw/SegmentDrawAction.d.ts +1 -1
  275. package/views/draw/SegmentDrawAction.js +1 -1
  276. package/views/input/{IViewEvents.js → mouseButtons.js} +1 -1
  277. package/views/input/types.d.ts +602 -1
  278. package/views/layers/BuildingSceneLayerView.d.ts +1 -1
  279. package/views/layers/FeatureLayerViewMixin.d.ts +1 -1
  280. package/views/layers/ImageryLayerViewMixin.d.ts +1 -1
  281. package/views/layers/MediaLayerViewMixin.d.ts +1 -1
  282. package/views/layers/PointCloudLayerView.d.ts +1 -1
  283. package/views/layers/SceneLayerView.d.ts +2 -2
  284. package/views/types.d.ts +148 -2
  285. package/webdoc/geotriggersInfo/FeatureFilter.d.ts +1 -1
  286. package/webscene/support/FeatureReferenceObjectId.d.ts +1 -1
  287. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -2
  288. package/widgets/BasemapLayerList.d.ts +3 -4
  289. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +1 -1
  290. package/widgets/CatalogLayerList.d.ts +2 -4
  291. package/widgets/Directions/DirectionsViewModel.d.ts +1 -1
  292. package/widgets/Editor/types.d.ts +1 -1
  293. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  294. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +46 -5
  295. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  296. package/widgets/FeatureTable/FieldColumn.js +1 -1
  297. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  298. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  299. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  300. package/widgets/FeatureTable/VisibleElements.d.ts +30 -9
  301. package/widgets/FeatureTable/VisibleElements.js +1 -1
  302. package/widgets/FeatureTable/support/AttachmentsViewOptions.d.ts +1 -1
  303. package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -0
  304. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  305. package/widgets/FeatureTable/support/interfaces.d.ts +2 -2
  306. package/widgets/FeatureTable.d.ts +46 -5
  307. package/widgets/FeatureTable.js +1 -1
  308. package/widgets/LayerList/LayerListViewModel.d.ts +9 -10
  309. package/widgets/LayerList/ListItem.d.ts +9 -11
  310. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  311. package/widgets/LayerList.d.ts +7 -4
  312. package/widgets/Legend/LegendViewModel.d.ts +5 -5
  313. package/widgets/Legend/support/ActiveLayerInfo.d.ts +5 -5
  314. package/widgets/Legend.d.ts +4 -4
  315. package/widgets/Popup/types.d.ts +3 -3
  316. package/widgets/Popup.d.ts +3 -3
  317. package/widgets/TableList/TableListViewModel.d.ts +2 -4
  318. package/widgets/TableList.d.ts +1 -1
  319. package/widgets/UtilityNetworkTrace/types.d.ts +1 -1
  320. package/assets/esri/core/workers/chunks/052ded41dc06c93ec0a7.js +0 -1
  321. package/assets/esri/core/workers/chunks/30184e39129d9c66ea54.js +0 -1
  322. package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +0 -1
  323. package/assets/esri/core/workers/chunks/537de53ef1e9101468f5.js +0 -1
  324. package/assets/esri/core/workers/chunks/94f02082a006003ef5a9.js +0 -1
  325. package/assets/esri/core/workers/chunks/a1f264abbd6354c333bf.js +0 -1
  326. package/assets/esri/core/workers/chunks/d3db7244fac7398cc700.js +0 -1
  327. package/assets/esri/core/workers/chunks/d94a2ad5a91de7086fbe.js +0 -1
  328. package/assets/esri/core/workers/chunks/ed38c1043e6a83f49f93.js +0 -1
  329. package/geometry/geodesicUtils.d.ts +0 -19
  330. package/geometry/operators/support/geodeticCurveType.d.ts +0 -2
  331. package/geometry/operators/support/projectionTransformation.d.ts +0 -16
  332. package/geometry/support/MeshVertexSpace.d.ts +0 -4
  333. package/geometry/support/meshUtils/elevation.d.ts +0 -16
  334. package/geometry/support/meshUtils/elevationSampler.d.ts +0 -9
  335. package/geometry/support/meshUtils/georeference.d.ts +0 -10
  336. package/geometry/support/typeUtils.d.ts +0 -16
  337. package/smartMapping/popup/support/utils.d.ts +0 -13
  338. package/smartMapping/support/binningUtils.d.ts +0 -11
  339. package/smartMapping/support/clusterUtils.d.ts +0 -11
  340. package/smartMapping/support/utils.d.ts +0 -4
  341. package/views/2d/constraints/GeometryConstraint.d.ts +0 -4
  342. package/views/HitTestItem3D.d.ts +0 -20
  343. package/views/HitTestOptions.d.ts +0 -25
  344. package/views/IBreakpointsOwner.d.ts +0 -55
  345. package/views/IObjectId.d.ts +0 -2
  346. package/views/ISceneView.d.ts +0 -5
  347. package/views/IView.d.ts +0 -43
  348. package/views/input/IViewEvents.d.ts +0 -602
  349. /package/views/draw/input/{CursorUpdateEvents.d.ts → CursorUpdateEvent.d.ts} +0 -0
  350. /package/views/draw/input/{CursorUpdateEvents.js → CursorUpdateEvent.js} +0 -0
  351. /package/views/layers/{HighlightableLayerView.d.ts → types.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import type Accessor from "../../../core/Accessor.js";
2
2
  import type EsriError from "../../../core/Error.js";
3
3
  import type AttachmentInfo from "../../../rest/query/support/AttachmentInfo.js";
4
- import type { ObjectId } from "../../../views/IObjectId.js";
4
+ import type { ObjectId } from "../../../views/types.js";
5
5
 
6
6
  export interface AttachmentsViewOptionsProperties {}
7
7
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import b from"../../../time/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as I,isIFeatureTableSupportedLayerWithRelationships as A,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.editingEnabled=!1,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return I(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return A(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u});p.sourceLayer=a.sourceLayer;const l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"editingEnabled",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"timeZone",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import n from"../../../core/Error.js";import{clone as o}from"../../../core/lang.js";import u from"../../../core/Logger.js";import{getOrCreateMapValue as p}from"../../../core/MapUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as d,when as h}from"../../../core/reactiveUtils.js";import{property as c,subclass as y}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as g}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as _,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import b from"../../../rest/support/RelationshipQuery.js";import E from"../../../time/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as I,isIFeatureTableSupportedLayerWithEditing as O,isIFeatureTableSupportedLayerWithRelationships as A,findRelatedLayer as w}from"./tableUtils.js";let j=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._pendingEdits=new l,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.count=0,this.editingEnabled=!1,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new l,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([d(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),d(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&I(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return O(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return A(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return _(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:n}=t,o=i>0;return("one-to-one"!==a||!o)&&("one-to-many"!==a||"origin"!==n||!o)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:m(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get fieldsWithContingentValues(){return new Set}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this._pendingEdits.size>0}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||m(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=w(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}cancelPendingEdits(){for(const[e,{originalFeature:t}]of this._pendingEdits){const r=this.getItemByObjectId(e);r&&(r.feature=t)}this._pendingEdits.clear()}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new n("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}itemHasPendingEdits(e,t){const r=this._pendingEdits.get(e);return!!r&&(!t||r.changes.has(t))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:n}=this;return a&&"loaded"===n?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,n]of s)if(n.some((t,s)=>{const n=t.objectId===e;return n&&(i=a*r+s),n}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&_(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async savePendingEdits(){if(!this.hasPendingEdits)return;if(!this._canSavePendingEdits)return void this._logError("store:update-error","An error occurred. Unable to save pending edits.");const e=[];for(const[t]of this._pendingEdits){const r=this.getItemByObjectId(t);r?.feature&&e.push(r.feature)}await this._savePendingEdits(e)}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){if(!this.autoSaveEnabled)return void this._stashPendingEdits(e);const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e);!(await this._update(e)).updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this._pendingEdits.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new n("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:o}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],o&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}_stashPendingEdits({objectId:e,updates:t}){const r=this.getItemByObjectId(e);if(!r)throw new n("store:update-error","Feature with provided 'objectId' not found.");const s=r.feature,i=s.clone(),a=p(this._pendingEdits,e,()=>({originalFeature:i,changes:new Map}));t.forEach(({fieldName:e,value:t})=>{a.changes.set(e,t),s.attributes[e]=t}),this._pendingEdits.set(e,a)}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new n("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new n("store:update-error","Feature with provided 'objectId' not found.");const u=o(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u});p.sourceLayer=a.sourceLayer;const l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}async _savePendingEdits(e){const{_layerWithEditing:t}=this;if(!this.supportsUpdate||!t)throw new n("store:update-error","Update is not supported.");const r=t.applyEdits({updateFeatures:e}).then(e=>{const{updateFeatureResults:t}=e,r=t.filter(e=>!!e.error);if(r.length)throw this.cancelPendingEdits(),r[0].error;return e});return this._queueEditOperation(()=>r)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],n=[];e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s);const o=this._pendingEdits.get(r);if(o){const t=e.clone(),r=o.changes;for(const[s,i]of r)e.attributes[s]=i;o.originalFeature=t}return i.forEach((e,t)=>{n.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:n}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new n("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new b({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:n,objectIds:o}=this,u=t.createQuery();return u.geometry=n,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=o?.length?o:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:n,filterGeometry:o,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:d,supportsCacheHint:h,supportsOrderBy:c,supportsPagination:y}=this,{layer:g,start:_}=e,m=u?.length,f=g.createQuery();f.returnGeometry=d,f.outFields=i,f.returnM=r,f.returnZ=s,y?(f.start=_,f.num=l,f.where=n,f.timeExtent=a,f.objectIds=m?u:void 0):f.objectIds=m?u:this._getObjectIdsForPage(_,l??0),c&&(f.orderByFields=p),o&&(f.geometry=o),h&&(f.cacheHint=!0);return(await g.queryFeatures(f)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:n,supportsOrderBy:o}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,o&&(u.orderByFields=a),n&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new b({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:n,returnGeometry:o,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:d,relatedLayer:h,relationshipId:c}=t,y=p.createQuery(),g=new b({cacheHint:u,num:n,objectIds:[d],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:o,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await h.queryRelatedFeatures(g);return _[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),this._pendingEdits.clear(),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),this._pendingEdits.clear(),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([c()],j.prototype,"_attachmentsOperationQueue",void 0),e([c({readOnly:!0})],j.prototype,"_capabilities",null),e([c()],j.prototype,"_defaultOutFields",void 0),e([c()],j.prototype,"_editOperationQueue",void 0),e([c()],j.prototype,"_effectiveReturnZ",null),e([c()],j.prototype,"_effectiveReturnM",null),e([c({readOnly:!0})],j.prototype,"_layerWithAttachments",null),e([c({readOnly:!0})],j.prototype,"_layerWithAttachmentsEditing",null),e([c({readOnly:!0})],j.prototype,"_layerWithEditing",null),e([c({readOnly:!0})],j.prototype,"_layerWithRelationships",null),e([c()],j.prototype,"_loaded",void 0),e([c()],j.prototype,"_loadError",void 0),e([c()],j.prototype,"_loading",void 0),e([c()],j.prototype,"_objectIdCache",void 0),e([c()],j.prototype,"_pendingEdits",void 0),e([c()],j.prototype,"_pendingEditsAreInvalid",null),e([c()],j.prototype,"_queryOperationQueue",void 0),e([c({readOnly:!0})],j.prototype,"_relatedLayer",null),e([c({readOnly:!0})],j.prototype,"_relatedLayerCapabilities",null),e([c({readOnly:!0})],j.prototype,"_relatedLayerSupportsCacheHint",null),e([c()],j.prototype,"_relatedLayerSupportsQuery",null),e([c()],j.prototype,"_relatedLayerSupportsQueryRelated",null),e([c()],j.prototype,"_sortedFieldNames",null),e([c()],j.prototype,"_subtypeCode",null),e([c()],j.prototype,"_subtypeField",null),e([c()],j.prototype,"_canUseRelatedLayer",null),e([c()],j.prototype,"attachmentsEnabled",void 0),e([c()],j.prototype,"autoSaveEnabled",void 0),e([c()],j.prototype,"canAddRelatedFeature",null),e([c({readOnly:!0})],j.prototype,"count",void 0),e([c()],j.prototype,"editingEnabled",void 0),e([c()],j.prototype,"effectiveOutFields",null),e([c()],j.prototype,"effectiveTimeExtent",null),e([c()],j.prototype,"effectiveWhere",null),e([c({readOnly:!0})],j.prototype,"failures",void 0),e([c()],j.prototype,"fieldsWithContingentValues",null),e([c({types:g})],j.prototype,"filterGeometry",void 0),e([c()],j.prototype,"hasContingentValues",null),e([c()],j.prototype,"hasInvalidPendingEdits",null),e([c()],j.prototype,"hasPendingEdits",null),e([c()],j.prototype,"initialSize",void 0),e([c({readOnly:!0})],j.prototype,"isQuerying",null),e([c({readOnly:!0})],j.prototype,"isSyncing",null),e([c({readOnly:!0})],j.prototype,"isSyncingAttachmentEdits",null),e([c({readOnly:!0})],j.prototype,"isSyncingFeatureEdits",null),e([c({readOnly:!0})],j.prototype,"itemCache",null),e([c()],j.prototype,"layer",void 0),e([c()],j.prototype,"layerView",null),e([c()],j.prototype,"objectIds",void 0),e([c()],j.prototype,"orderByFields",null),e([c()],j.prototype,"outFields",void 0),e([c({readOnly:!0})],j.prototype,"pageCache",void 0),e([c()],j.prototype,"pageSize",void 0),e([c()],j.prototype,"relationship",null),e([c()],j.prototype,"relationshipConfig",void 0),e([c()],j.prototype,"relationshipIds",null),e([c()],j.prototype,"relationshipInfos",null),e([c()],j.prototype,"relationships",null),e([c()],j.prototype,"relatedRecordsEnabled",void 0),e([c()],j.prototype,"returnGeometry",void 0),e([c()],j.prototype,"returnZ",void 0),e([c()],j.prototype,"returnM",void 0),e([c()],j.prototype,"sortOrders",void 0),e([c({readOnly:!0})],j.prototype,"state",null),e([c()],j.prototype,"supportsAdd",null),e([c()],j.prototype,"supportsAddAttachments",null),e([c()],j.prototype,"supportsAttachments",null),e([c()],j.prototype,"supportsCacheHint",null),e([c()],j.prototype,"supportsCacheHintQueryRelated",null),e([c()],j.prototype,"supportsDelete",null),e([c()],j.prototype,"supportsEditing",null),e([c()],j.prototype,"supportsM",null),e([c()],j.prototype,"supportsOrderBy",null),e([c()],j.prototype,"supportsPagination",null),e([c()],j.prototype,"supportsQuery",null),e([c()],j.prototype,"supportsQueryRelated",null),e([c()],j.prototype,"supportsResizeAttachments",null),e([c()],j.prototype,"supportsUpdate",null),e([c()],j.prototype,"supportsUpdateAttachments",null),e([c()],j.prototype,"supportsZ",null),e([c({type:E})],j.prototype,"timeExtent",void 0),e([c()],j.prototype,"timeZone",void 0),e([c()],j.prototype,"view",void 0),e([c()],j.prototype,"where",void 0),j=e([y("esri.widgets.FeatureTable.support.FeatureStore")],j);const C=j;export{C as default};
@@ -19,9 +19,9 @@ import type FieldColumnTemplate from "./FieldColumnTemplate.js";
19
19
  import type GroupColumnTemplate from "./GroupColumnTemplate.js";
20
20
  import type RelationshipColumnTemplate from "./RelationshipColumnTemplate.js";
21
21
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
22
- import type { GeometryUnion } from "../../../geometry/support/typeUtils.js";
22
+ import type { GeometryUnion } from "../../../geometry/types.js";
23
23
  import type { FieldValue } from "../../../layers/support/fieldUtils.js";
24
- import type { ObjectId } from "../../../views/IObjectId.js";
24
+ import type { ObjectId } from "../../../views/types.js";
25
25
  import type { CellValue, Direction } from "../Grid/types.js";
26
26
 
27
27
  export interface FieldValueFormatFunctionParams extends FormatFunctionParams {}
@@ -15,10 +15,10 @@ import type AttachmentsViewOptions from "./FeatureTable/support/AttachmentsViewO
15
15
  import type TableTemplate from "./FeatureTable/support/TableTemplate.js";
16
16
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
17
17
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
18
- import type { GeometryUnion } from "../geometry/support/typeUtils.js";
18
+ import type { GeometryUnion } from "../geometry/types.js";
19
19
  import type { TimeZone } from "../time/types.js";
20
20
  import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
21
- import type { ObjectId } from "../views/IObjectId.js";
21
+ import type { ObjectId } from "../views/types.js";
22
22
  import type { WidgetProperties } from "./Widget.js";
23
23
  import type { FeatureTableViewModelEvents, FeatureTableViewModelProperties } from "./FeatureTable/FeatureTableViewModel.js";
24
24
  import type { GridMultiSortPriority, GridSupportedColumns, FeatureTableState, TableMenuConfig, Direction } from "./FeatureTable/Grid/types.js";
@@ -34,7 +34,7 @@ import type { TableTemplateProperties } from "./FeatureTable/support/TableTempla
34
34
  import type { TimeExtentProperties } from "../time/TimeExtent.js";
35
35
  import type { VisibleElementsProperties } from "./FeatureTable/VisibleElements.js";
36
36
 
37
- export interface FeatureTableProperties extends WidgetProperties, Partial<Pick<FeatureTable, "actionColumnConfig" | "attachmentsEnabled" | "attachmentsViewOptions" | "autoRefreshEnabled" | "columnPerformanceModeEnabled" | "columnReorderingEnabled" | "definitionExpression" | "description" | "disabled" | "editingEnabled" | "filterBySelectionEnabled" | "highlightEnabled" | "initialSize" | "layer" | "layers" | "maxSize" | "menuConfig" | "multipleSelectionEnabled" | "multipleSortPriority" | "multiSortEnabled" | "navigationScale" | "noDataMessage" | "outFields" | "pageSize" | "paginationEnabled" | "relatedRecordsEnabled" | "relatedTables" | "returnGeometryEnabled" | "returnMEnabled" | "returnZEnabled" | "syncTemplateOnChangesEnabled" | "timeZone" | "title" | "view">> {
37
+ export interface FeatureTableProperties extends WidgetProperties, Partial<Pick<FeatureTable, "actionColumnConfig" | "attachmentsEnabled" | "attachmentsViewOptions" | "autoRefreshEnabled" | "autoSaveEnabled" | "columnPerformanceModeEnabled" | "columnReorderingEnabled" | "definitionExpression" | "description" | "disabled" | "editingEnabled" | "filterBySelectionEnabled" | "highlightEnabled" | "initialSize" | "layer" | "layers" | "maxSize" | "menuConfig" | "multipleSelectionEnabled" | "multipleSortPriority" | "multiSortEnabled" | "navigationScale" | "noDataMessage" | "outFields" | "pageSize" | "paginationEnabled" | "relatedRecordsEnabled" | "relatedTables" | "returnGeometryEnabled" | "returnMEnabled" | "returnZEnabled" | "syncTemplateOnChangesEnabled" | "timeZone" | "title" | "view">> {
38
38
  /**
39
39
  * Use this property to configure how columns display within the table in regard to visibility, column order, and sorting.
40
40
  *
@@ -786,6 +786,13 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
786
786
  * @since 4.23
787
787
  */
788
788
  accessor autoRefreshEnabled: boolean;
789
+ /**
790
+ * Indicates whether the table should automatically save edits, or store all edits locally until the 'savePendingEdits' or 'cancelPendingEdits' methods are called.
791
+ *
792
+ * @default true
793
+ * @since 5.0
794
+ */
795
+ accessor autoSaveEnabled: boolean;
789
796
  /**
790
797
  * Indicates whether to enable the table's column performance mode. This mode is designed to improve the performance of the table when working with a large number of columns.
791
798
  *
@@ -961,6 +968,27 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
961
968
  * @since 4.33
962
969
  */
963
970
  get groupColumns(): GroupColumn[];
971
+ /**
972
+ * Convenience property indicating the data set contains contingent values.
973
+ *
974
+ * @default false
975
+ * @since 5.0
976
+ */
977
+ get hasContingentValues(): boolean;
978
+ /**
979
+ * Indicates there are unsaved edits and that they are invalid.
980
+ *
981
+ * @default false
982
+ * @since 5.0
983
+ */
984
+ get hasInvalidPendingEdits(): boolean;
985
+ /**
986
+ * Indicates there are unsaved edits. This does not account for whether the edits are valid or not.
987
+ *
988
+ * @default false
989
+ * @since 5.0
990
+ */
991
+ get hasPendingEdits(): boolean;
964
992
  /**
965
993
  * A collection of string values which indicate [field.names](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) that should be hidden within the table. By default fields such as `CreationDate`, `Creator`, `EditDate`, `Editor`, and `GlobalID` do not show. If these fields are needed, set them via [TableTemplate#columnTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-support-TableTemplate.html#columnTemplates). In this case, it is required to set column template's [FieldColumnTemplate#visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-support-FieldColumnTemplate.html#visible) property to `true`.
966
994
  *
@@ -1050,13 +1078,13 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
1050
1078
  */
1051
1079
  accessor initialSize: number | null | undefined;
1052
1080
  /**
1053
- * Indicates if the table is querying or syncing data. This is useful when determining if the table is busy. This can be especially helpful when the table is querying a large amount of features.
1081
+ * Indicates the table is querying or syncing data. This is useful when determining if the table is busy. This can be especially helpful when the table is querying a large amount of features.
1054
1082
  *
1055
1083
  * @since 4.31
1056
1084
  */
1057
1085
  get isQueryingOrSyncing(): boolean;
1058
1086
  /**
1059
- * Indicates if the table is syncing attachment edits.
1087
+ * Indicates the table is syncing attachment edits.
1060
1088
  *
1061
1089
  * @since 4.31
1062
1090
  */
@@ -1521,6 +1549,12 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
1521
1549
  */
1522
1550
  get visibleElements(): VisibleElements;
1523
1551
  set visibleElements(value: VisibleElementsProperties);
1552
+ /**
1553
+ * Cancels any unsaved edits.
1554
+ *
1555
+ * @since 5.0
1556
+ */
1557
+ cancelPendingEdits(): void;
1524
1558
  /**
1525
1559
  * Clears the current selection filter within the table.
1526
1560
  *
@@ -1614,6 +1648,13 @@ export default class FeatureTable extends Widget<FeatureTableProperties> {
1614
1648
  * @since 4.30
1615
1649
  */
1616
1650
  refreshCellContent(): void;
1651
+ /**
1652
+ * Attempts to save any pending edits. If any edits are invalid, the save will be rejected until the edits are in a valid state.
1653
+ *
1654
+ * @returns Resolves when the edits are saved or rejected.
1655
+ * @since 5.0
1656
+ */
1657
+ savePendingEdits(): Promise<void>;
1617
1658
  /**
1618
1659
  * Resets the horizontal scroll position of the table to the default view.
1619
1660
  *
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{watch as l,on as o,sync as n,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as a}from"../core/sanitizerUtils.js";import{formatFileSize as r}from"../core/unitFormatUtils.js";import{property as c,subclass as d}from"../core/accessorSupport/decorators.js";import{geometryTypes as h}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as m}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as p,isMapImageLayer as u,isSubtypeGroupLayer as g}from"../layers/support/layerUtils.js";import w from"../tables/AttributeTableTemplate.js";import b from"../time/TimeExtent.js";import v from"./Widget.js";import{isSupportedImage as y,getCalciteIconForAttachment as f}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as _,Prompt as M}from"./Editor/components/Prompt.js";import C from"./FeatureTable/ColumnMenuVisibleElements.js";import A from"./FeatureTable/FeatureTableViewModel.js";import S from"./FeatureTable/VisibleElements.js";import{isGroupColumn as T}from"./FeatureTable/support/columnUtils.js";import E from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as V,isIFeatureTableSupportedLayer as I,isIFeatureTableSupportedLayerWithAttachments as R,getRelationshipIdsToShow as x}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import{globalCss as D}from"./support/globalCss.js";import{getIconForLayer as P}from"./support/iconUtils.js";import{messageBundle as O,vmEvent as F,tsx as z}from"./support/widget.js";import{storeNode as L,discardNode as j}from"./support/widgetUtils.js";var U;const $="esri-feature-table",B=`${$}__attachments-view`,N={base:$,content:`${$}__content`,menuPopover:`${$}__menu-popover`,layerDropdownMenu:`${$}__layer-switcher-menu`,tableContainer:`${$}__table-container`,tableContainerWithAttachments:`${$}__table-container--attachments`,tableNavigation:`${$}__table-navigation`,attachmentsView:B,attachmentsViewContent:`${B}__content`,attachmentsViewDropArea:`${B}__drop-area`,attachmentsViewIcon:`${B}__icon`,attachmentsViewInformation:`${B}__information`,attachmentsViewList:`${B}__list`,attachmentsViewListFileSize:`${B}__list__filesize`,attachmentsViewListItemDelete:`${B}__list-item--delete`,attachmentsViewListThumbnail:`${B}__list__thumbnail`,expanded:`${$}__expanded`,collapsed:`${$}__collapsed`},H={chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let Z=U=class extends v{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.navigationScale="m",this.title=null,this.viewModel=new A,this.visibleElements=new S,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},n),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},s),o(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([k({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),_(),V()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?a.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(I):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:i,state:l,highlightIds:o,title:n,size:s}=this;if(n)return a.sanitize("function"==typeof n?n():n);if(!e)return i.noLayer;switch(l){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:a.sanitize(e.title),count:s,selected:o.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!I(e)||g(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{m(e)||"catalog-footprint"===e.type||(p(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):u(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):g(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get groupColumns(){return this.viewModel.groupColumns}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new S({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new S({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new C({sortAscending:c,sortDescending:c})})}return a?new S({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})}):null}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return z("div",{bind:this,class:this.classes(N.base,D.widget)},z("calcite-panel",{bind:this,class:N.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?z("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(N.tableContainer);if(t.length){const l=this.classes(N.base,this.allRelatedTablesVisible?N.expanded:N.collapsed,this._shouldShowAttachmentsView?N.tableContainerWithAttachments:void 0);return z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[this._shouldShowGrid?z("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return z("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[z("div",{class:this.classes(N.base,N.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[z("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return z("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return z("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:H.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},z("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?z(M,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:i}=this,l=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:l,messagesCommon:o}=this,n=t(l.deleteAttachmentCount,{count:i.length});this.showPrompt({title:n,message:l.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:o.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:o.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return z("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:H.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:H.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:H.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:H.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:H.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:H.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:H.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return z("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:H.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?z("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return z("calcite-popover",{autoClose:!0,class:N.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},z("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=T(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})})))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return z("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return z("div",{class:N.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},z("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},z("calcite-action",{icon:H.layers,slot:"trigger",text:e,title:e}),z("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return z("calcite-dropdown-item",{iconStart:i?P(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{editingEnabled:t,effectiveTable:i,paginationEnabled:l,pageSize:o,view:n,viewModel:s}=this,{layer:a,objectId:r,relatedLayer:c,relationshipId:d}=e;await a.load();const h=this.attachmentsEnabled&&R(a),m=new U({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:x(a,d),tableController:this,tableParent:i,view:n,showRelatedTableCallback:e=>s.emit("show-related-table",e)});this.relatedTables.add(m),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:s,candidates:a,objectId:c}=e,d=s.find(e=>e.id===n),h=s.length,m=a?.length,p=d?z("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=m?void 0:z("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(a??[]).pop(),w=g?z("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&m,y=z("input",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,"data-node-ref":"_attachmentsInput",files:a,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||m?z("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[z("div",{class:N.attachmentsView,key:"attachments-view"},z("div",{class:N.attachmentsViewContent,key:"attachments-view-content"},z("div",{bind:this,class:N.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},z("calcite-icon",{class:N.attachmentsViewIcon,icon:H.upload,scale:"l"}),p,u,z("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},z("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?z("div",{class:N.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),z("label",{key:"file-label"},l.fileName),z("span",{key:"file-span"},d.name),z("label",{key:"size-label"},l.size),z("span",{key:"size-span"},r(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:s,objectId:a}=e;return z("calcite-list",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,class:N.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${a}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...s?.map(t=>{const{id:s,name:c,size:d,url:h}=t,m=r(l,d??0);return z("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),z("span",{class:N.attachmentsViewListFileSize,slot:"actions-end",title:m},m),z("calcite-action",{appearance:"transparent",icon:H.downloadTo,key:`download-attachment-${s}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,s)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=a?z("calcite-action",{appearance:"transparent",disabled:!n,icon:H.replaceImage,key:`replace-attachment-${s}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=s},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,z("calcite-action",{appearance:"transparent",icon:H.launch,key:`launch-attachment-${s}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=a?z("calcite-action",{appearance:"transparent",class:N.attachmentsViewListItemDelete,disabled:!o,icon:H.delete,key:`delete-attachment-${s}`,label:`${c}`,onclick:()=>{this.deleteAttachments(a,[s],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)}))}_renderAttachmentsViewListThumbnail(e){return z("div",{class:N.attachmentsViewListThumbnail,slot:"content-start"},z("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&y(i)?z("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):z("calcite-icon",{icon:f(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:l,navigationScale:o,relatedTable:n,relatedTables:s}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:m,objectId:p}=r,u=null!=p,g=m.length,w=a?.selectedItems?.length??0,b=`${c.objectIdField}: ${p}`,v=t(i.selectedCount,{count:w}),y=t(i.attachmentsCount,{count:g}),f=u?z("calcite-action",{bind:this,icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:o,text:b,textEnabled:!0,title:b}):void 0,_=u?z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:o,text:y,textEnabled:!0,title:y}):void 0,M=u?z("calcite-chip",{closable:!0,closed:0===w,key:"navigation-chip",kind:"inverse",label:v,scale:o,selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=n?z("calcite-label",{layout:"inline",scale:o},i.showAllTables,z("calcite-switch",{checked:this.allRelatedTablesVisible,scale:o,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,A=u&&"list"===r.mode&&null!=p&&w&&h?z("calcite-action",{icon:H.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:o,text:l.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:w})}):void 0,S=u&&"list"===r.mode&&d?z("calcite-action",{bind:this,icon:H.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.attachmentId=null,r.mode="file"},scale:o,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return z("div",{class:N.tableNavigation,key:"table-nav"},z("calcite-action",{icon:H.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{n&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},scale:o,text:this.layer?.title??"",textEnabled:!1,title:n?i.exitRelatedRecords:i.exitAttachments}),s.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,z("div",null,M,C,A,S))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([c()],Z.prototype,"_attachmentsInput",void 0),e([c()],Z.prototype,"_columnVisibilityActions",void 0),e([c()],Z.prototype,"_effectiveDescription",null),e([c()],Z.prototype,"_effectiveLayers",null),e([c()],Z.prototype,"_effectiveTitle",null),e([c()],Z.prototype,"_effectiveVisibleElements",null),e([c()],Z.prototype,"_filteredTables",null),e([c()],Z.prototype,"_hasAttachmentsViewError",null),e([c()],Z.prototype,"_hasCustomMenuItems",null),e([c()],Z.prototype,"_hasDefaultMenuItems",null),e([c()],Z.prototype,"_shouldShowGrid",null),e([c()],Z.prototype,"_shouldShowMenu",null),e([c()],Z.prototype,"_shouldShowAttachmentsView",null),e([c()],Z.prototype,"_showClearSelectionAction",null),e([c()],Z.prototype,"_showColumnsVisibilityAction",null),e([c()],Z.prototype,"_showDeleteSelectionAction",null),e([c()],Z.prototype,"_showExportSelectionToCSVAction",null),e([c()],Z.prototype,"_showLayerDropdown",null),e([c()],Z.prototype,"_shouldShowNavigationBar",null),e([c()],Z.prototype,"_showRefreshDataAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowSelectedAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowAllAction",null),e([c()],Z.prototype,"_showZoomToSelectionAction",null),e([c()],Z.prototype,"_viewLayers",null),e([c()],Z.prototype,"attachmentsList",void 0),e([c({readOnly:!0})],Z.prototype,"grid",null),e([c()],Z.prototype,"actionColumn",null),e([c()],Z.prototype,"actionColumnConfig",null),e([c({readOnly:!0})],Z.prototype,"activeFilters",null),e([c({readOnly:!0})],Z.prototype,"activeSortOrders",null),e([c()],Z.prototype,"allColumns",null),e([c({readOnly:!0})],Z.prototype,"allRelatedTablesVisible",null),e([c()],Z.prototype,"allVisibleColumns",null),e([c()],Z.prototype,"attachmentsColumns",null),e([c()],Z.prototype,"attachmentsEnabled",null),e([c()],Z.prototype,"attachmentsViewOptions",null),e([c({type:w})],Z.prototype,"attributeTableTemplate",null),e([c()],Z.prototype,"autoRefreshEnabled",null),e([c()],Z.prototype,"clearPrompt",null),e([c()],Z.prototype,"columnPerformanceModeEnabled",null),e([c()],Z.prototype,"columnReorderingEnabled",null),e([c({readOnly:!0})],Z.prototype,"columns",null),e([c()],Z.prototype,"definitionExpression",null),e([c()],Z.prototype,"description",void 0),e([c()],Z.prototype,"disabled",void 0),e([c()],Z.prototype,"editingEnabled",null),e([c()],Z.prototype,"effectiveSize",null),e([c()],Z.prototype,"effectiveTable",null),e([c()],Z.prototype,"fieldColumns",null),e([c({types:h})],Z.prototype,"filterGeometry",null),e([c()],Z.prototype,"filterBySelectionEnabled",null),e([c()],Z.prototype,"groupColumns",null),e([c()],Z.prototype,"hiddenFields",null),e([c()],Z.prototype,"highlightEnabled",null),e([c()],Z.prototype,"highlightIds",null),e([c()],Z.prototype,"icon",null),e([c()],Z.prototype,"initialSize",null),e([c()],Z.prototype,"isQueryingOrSyncing",null),e([c()],Z.prototype,"isSyncingAttachments",null),e([c()],Z.prototype,"label",null),e([c()],Z.prototype,"layer",null),e([c()],Z.prototype,"layers",null),e([c()],Z.prototype,"layerView",null),e([c()],Z.prototype,"maxSize",null),e([c(),O("esri/widgets/FeatureTable/t9n/FeatureTable")],Z.prototype,"messages",null),e([c(),O("esri/t9n/common")],Z.prototype,"messagesCommon",null),e([c(),O("esri/core/t9n/Units")],Z.prototype,"messagesUnits",null),e([c(),O("esri/widgets/support/t9n/uriUtils")],Z.prototype,"messagesURIUtils",null),e([c()],Z.prototype,"menuConfig",null),e([c()],Z.prototype,"multipleSelectionEnabled",null),e([c()],Z.prototype,"multiSortEnabled",null),e([c()],Z.prototype,"multipleSortPriority",null),e([c()],Z.prototype,"navigationScale",void 0),e([c()],Z.prototype,"noDataMessage",null),e([c()],Z.prototype,"objectIds",null),e([c()],Z.prototype,"outFields",null),e([c()],Z.prototype,"pageCount",null),e([c()],Z.prototype,"pageIndex",null),e([c()],Z.prototype,"pageSize",null),e([c()],Z.prototype,"paginationEnabled",null),e([c()],Z.prototype,"prompt",null),e([c()],Z.prototype,"relatedRecordsEnabled",null),e([c()],Z.prototype,"relatedTable",null),e([c()],Z.prototype,"relatedTables",null),e([c()],Z.prototype,"relationship",null),e([c()],Z.prototype,"relationshipColumnConfigs",null),e([c()],Z.prototype,"relationshipColumns",null),e([c()],Z.prototype,"relationshipConfig",null),e([c()],Z.prototype,"relationshipInfos",null),e([c()],Z.prototype,"returnGeometryEnabled",null),e([c()],Z.prototype,"returnMEnabled",null),e([c()],Z.prototype,"returnZEnabled",null),e([c()],Z.prototype,"rowHighlightIds",null),e([c()],Z.prototype,"selectionSource",null),e([c()],Z.prototype,"showAllRelatedTables",null),e([c()],Z.prototype,"showPrompt",null),e([c()],Z.prototype,"showRelatedTableCallback",null),e([c()],Z.prototype,"size",null),e([c({readOnly:!0})],Z.prototype,"state",null),e([c()],Z.prototype,"supportsAddAttachments",null),e([c()],Z.prototype,"supportsAttachments",null),e([c()],Z.prototype,"supportsDeleteAttachments",null),e([c()],Z.prototype,"supportsResizeAttachments",null),e([c()],Z.prototype,"supportsUpdateAttachments",null),e([c()],Z.prototype,"syncTemplateOnChangesEnabled",null),e([c({constructOnly:!0})],Z.prototype,"tableController",null),e([c({constructOnly:!0})],Z.prototype,"tableParent",null),e([c({type:E})],Z.prototype,"tableTemplate",null),e([c()],Z.prototype,"tableTemplateOverride",null),e([c()],Z.prototype,"title",void 0),e([c({type:b})],Z.prototype,"timeExtent",null),e([c()],Z.prototype,"timeZone",null),e([c()],Z.prototype,"view",null),e([c({type:A}),F(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],Z.prototype,"viewModel",void 0),e([c()],Z.prototype,"visibleColumns",null),e([c({type:S,nonNullable:!0})],Z.prototype,"visibleElements",void 0),e([c({type:S})],Z.prototype,"visibleElementsOverride",null),Z=U=e([d("esri.widgets.FeatureTable")],Z);const G=Z;export{G as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{watch as l,on as o,sync as n,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as a}from"../core/sanitizerUtils.js";import{formatFileSize as r}from"../core/unitFormatUtils.js";import{property as c,subclass as d}from"../core/accessorSupport/decorators.js";import{geometryTypes as h}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as p}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as m,isMapImageLayer as u,isSubtypeGroupLayer as g}from"../layers/support/layerUtils.js";import b from"../tables/AttributeTableTemplate.js";import w from"../time/TimeExtent.js";import v from"./Widget.js";import{isSupportedImage as y,getCalciteIconForAttachment as f}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as _,Prompt as M}from"./Editor/components/Prompt.js";import C from"./FeatureTable/ColumnMenuVisibleElements.js";import S from"./FeatureTable/FeatureTableViewModel.js";import A from"./FeatureTable/VisibleElements.js";import{isGroupColumn as E}from"./FeatureTable/support/columnUtils.js";import T from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as V,isIFeatureTableSupportedLayer as I,isIFeatureTableSupportedLayerWithAttachments as R,getRelationshipIdsToShow as k}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as D}from"./support/globalCss.js";import{getIconForLayer as P}from"./support/iconUtils.js";import{messageBundle as F,vmEvent as O,tsx as z}from"./support/widget.js";import{storeNode as L,discardNode as j}from"./support/widgetUtils.js";var $;const U="esri-feature-table",B=`${U}__attachments-view`,N={base:U,content:`${U}__content`,menuPopover:`${U}__menu-popover`,layerDropdownMenu:`${U}__layer-switcher-menu`,tableContainer:`${U}__table-container`,tableContainerWithAttachments:`${U}__table-container--attachments`,tableNavigation:`${U}__table-navigation`,attachmentsView:B,attachmentsViewContent:`${B}__content`,attachmentsViewDropArea:`${B}__drop-area`,attachmentsViewIcon:`${B}__icon`,attachmentsViewInformation:`${B}__information`,attachmentsViewList:`${B}__list`,attachmentsViewListFileSize:`${B}__list__filesize`,attachmentsViewListItemDelete:`${B}__list-item--delete`,attachmentsViewListThumbnail:`${B}__list__thumbnail`,expanded:`${U}__expanded`,collapsed:`${U}__collapsed`,footerMessage:`${U}__footer__message`,footerIconDanger:`${U}__footer__icon--danger`},H={chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",reset:"reset",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let Z=$=class extends v{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.navigationScale="m",this.title=null,this.viewModel=new S,this.visibleElements=new A,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},n),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},s),o(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([x({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),_(),V()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?a.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(I):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:i,state:l,highlightIds:o,title:n,size:s}=this;if(n)return a.sanitize("function"==typeof n?n():n);if(!e)return i.noLayer;switch(l){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:a.sanitize(e.title),count:s,selected:o.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!I(e)||g(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{p(e)||"catalog-footprint"===e.type||(m(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):u(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):g(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new A({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new C({sortAscending:c,sortDescending:c})})}return a?new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})}):null}cancelPendingEdits(){this.viewModel.cancelPendingEdits()}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return z("div",{bind:this,class:this.classes(N.base,D.widget)},z("calcite-panel",{bind:this,class:N.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?z("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(N.tableContainer);if(t.length){const l=this.classes(N.base,this.allRelatedTablesVisible?N.expanded:N.collapsed,this._shouldShowAttachmentsView?N.tableContainerWithAttachments:void 0);return z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[this._shouldShowGrid?z("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return z("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[z("div",{class:this.classes(N.base,N.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[z("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return z("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return z("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:H.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},z("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this.visibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:l}=this,o=e||t,n=this.hasContingentValues,s=[z("calcite-button",{appearance:"outline",disabled:t,iconStart:H.reset,key:"footer-reset-button",onclick:()=>this.cancelPendingEdits(),slot:"footer-end",width:"auto"},l.reset),z("calcite-button",{disabled:o,iconStart:H.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},l.save)];if(n){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,l=e?z("calcite-icon",{class:N.footerIconDanger,icon:H.exclamationMarkTriangle,scale:"s",slot:"footer-start"}):void 0;s.push(z("div",{class:N.footerMessage,key:"footer-message",slot:"footer-start"},l,t))}return s}_renderPrompt(){return this.prompt?z(M,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:i}=this,l=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:l,messagesCommon:o}=this,n=t(l.deleteAttachmentCount,{count:i.length});this.showPrompt({title:n,message:l.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:o.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:o.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return z("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:H.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:H.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:H.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:H.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:H.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:H.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:H.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return z("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:H.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?z("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return z("calcite-popover",{autoClose:!0,class:N.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},z("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=E(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})})))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return z("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return z("div",{class:N.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},z("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},z("calcite-action",{icon:H.layers,slot:"trigger",text:e,title:e}),z("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return z("calcite-dropdown-item",{iconStart:i?P(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:l,effectiveTable:o,paginationEnabled:n,pageSize:s,view:a,viewModel:r}=this,{layer:c,objectId:d,relatedLayer:h,relationshipId:p}=e;await c.load();const m=this.attachmentsEnabled&&R(c),u=new $({layer:c,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:m,editingEnabled:l,paginationEnabled:n,pageSize:s,relatedRecordsEnabled:!0,relationshipConfig:{objectId:d,relatedLayer:h,relationshipId:p},relationshipColumnConfigs:k(c,p),tableController:this,tableParent:o,view:a,showRelatedTableCallback:e=>r.emit("show-related-table",e)});this.relatedTables.add(u),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:s,candidates:a,objectId:c}=e,d=s.find(e=>e.id===n),h=s.length,p=a?.length,m=d?z("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:z("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(a??[]).pop(),b=g?z("calcite-label",{key:"filename-node"},g.name):void 0,w=i&&null!=c,v=w&&p,y=z("input",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,"data-node-ref":"_attachmentsInput",files:a,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=w?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?z("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[z("div",{class:N.attachmentsView,key:"attachments-view"},z("div",{class:N.attachmentsViewContent,key:"attachments-view-content"},z("div",{bind:this,class:N.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},z("calcite-icon",{class:N.attachmentsViewIcon,icon:H.upload,scale:"l"}),m,u,z("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},z("fieldset",null,b,y,f,_,M)))),null!=c&&null!=d?z("div",{class:N.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),z("label",{key:"file-label"},l.fileName),z("span",{key:"file-span"},d.name),z("label",{key:"size-label"},l.size),z("span",{key:"size-span"},r(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:s,objectId:a}=e;return z("calcite-list",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,class:N.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${a}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...s?.map(t=>{const{id:s,name:c,size:d,url:h}=t,p=r(l,d??0);return z("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),z("span",{class:N.attachmentsViewListFileSize,slot:"actions-end",title:p},p),z("calcite-action",{appearance:"transparent",icon:H.downloadTo,key:`download-attachment-${s}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,s)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=a?z("calcite-action",{appearance:"transparent",disabled:!n,icon:H.replaceImage,key:`replace-attachment-${s}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=s},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,z("calcite-action",{appearance:"transparent",icon:H.launch,key:`launch-attachment-${s}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=a?z("calcite-action",{appearance:"transparent",class:N.attachmentsViewListItemDelete,disabled:!o,icon:H.delete,key:`delete-attachment-${s}`,label:`${c}`,onclick:()=>{this.deleteAttachments(a,[s],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)}))}_renderAttachmentsViewListThumbnail(e){return z("div",{class:N.attachmentsViewListThumbnail,slot:"content-start"},z("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&y(i)?z("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):z("calcite-icon",{icon:f(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:l,navigationScale:o,relatedTable:n,relatedTables:s}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:p,objectId:m}=r,u=null!=m,g=p.length,b=a?.selectedItems?.length??0,w=`${c.objectIdField}: ${m}`,v=t(i.selectedCount,{count:b}),y=t(i.attachmentsCount,{count:g}),f=u?z("calcite-action",{bind:this,icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(m),scale:o,text:w,textEnabled:!0,title:w}):void 0,_=u?z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:o,text:y,textEnabled:!0,title:y}):void 0,M=u?z("calcite-chip",{closable:!0,closed:0===b,key:"navigation-chip",kind:"inverse",label:v,scale:o,selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=n?z("calcite-label",{layout:"inline",scale:o},i.showAllTables,z("calcite-switch",{checked:this.allRelatedTablesVisible,scale:o,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,S=u&&"list"===r.mode&&null!=m&&b&&h?z("calcite-action",{icon:H.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(m,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:o,text:l.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:b})}):void 0,A=u&&"list"===r.mode&&d?z("calcite-action",{bind:this,icon:H.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.attachmentId=null,r.mode="file"},scale:o,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return z("div",{class:N.tableNavigation,key:"table-nav"},z("calcite-action",{icon:H.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{n&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},scale:o,text:this.layer?.title??"",textEnabled:!1,title:n?i.exitRelatedRecords:i.exitAttachments}),s.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,z("div",null,M,C,S,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([c()],Z.prototype,"_attachmentsInput",void 0),e([c()],Z.prototype,"_columnVisibilityActions",void 0),e([c()],Z.prototype,"_effectiveDescription",null),e([c()],Z.prototype,"_effectiveLayers",null),e([c()],Z.prototype,"_effectiveTitle",null),e([c()],Z.prototype,"_effectiveVisibleElements",null),e([c()],Z.prototype,"_filteredTables",null),e([c()],Z.prototype,"_hasAttachmentsViewError",null),e([c()],Z.prototype,"_hasCustomMenuItems",null),e([c()],Z.prototype,"_hasDefaultMenuItems",null),e([c()],Z.prototype,"_shouldShowGrid",null),e([c()],Z.prototype,"_shouldShowMenu",null),e([c()],Z.prototype,"_shouldShowAttachmentsView",null),e([c()],Z.prototype,"_showClearSelectionAction",null),e([c()],Z.prototype,"_showColumnsVisibilityAction",null),e([c()],Z.prototype,"_showDeleteSelectionAction",null),e([c()],Z.prototype,"_showExportSelectionToCSVAction",null),e([c()],Z.prototype,"_showLayerDropdown",null),e([c()],Z.prototype,"_shouldShowNavigationBar",null),e([c()],Z.prototype,"_showRefreshDataAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowSelectedAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowAllAction",null),e([c()],Z.prototype,"_showZoomToSelectionAction",null),e([c()],Z.prototype,"_viewLayers",null),e([c()],Z.prototype,"attachmentsList",void 0),e([c({readOnly:!0})],Z.prototype,"grid",null),e([c()],Z.prototype,"actionColumn",null),e([c()],Z.prototype,"actionColumnConfig",null),e([c({readOnly:!0})],Z.prototype,"activeFilters",null),e([c({readOnly:!0})],Z.prototype,"activeSortOrders",null),e([c()],Z.prototype,"allColumns",null),e([c({readOnly:!0})],Z.prototype,"allRelatedTablesVisible",null),e([c()],Z.prototype,"allVisibleColumns",null),e([c()],Z.prototype,"attachmentsColumns",null),e([c()],Z.prototype,"attachmentsEnabled",null),e([c()],Z.prototype,"attachmentsViewOptions",null),e([c({type:b})],Z.prototype,"attributeTableTemplate",null),e([c()],Z.prototype,"autoRefreshEnabled",null),e([c()],Z.prototype,"autoSaveEnabled",null),e([c()],Z.prototype,"clearPrompt",null),e([c()],Z.prototype,"columnPerformanceModeEnabled",null),e([c()],Z.prototype,"columnReorderingEnabled",null),e([c({readOnly:!0})],Z.prototype,"columns",null),e([c()],Z.prototype,"definitionExpression",null),e([c()],Z.prototype,"description",void 0),e([c()],Z.prototype,"disabled",void 0),e([c()],Z.prototype,"editingEnabled",null),e([c()],Z.prototype,"effectiveSize",null),e([c()],Z.prototype,"effectiveTable",null),e([c()],Z.prototype,"fieldColumns",null),e([c({types:h})],Z.prototype,"filterGeometry",null),e([c()],Z.prototype,"filterBySelectionEnabled",null),e([c()],Z.prototype,"groupColumns",null),e([c()],Z.prototype,"hasContingentValues",null),e([c()],Z.prototype,"hasInvalidPendingEdits",null),e([c()],Z.prototype,"hasPendingEdits",null),e([c()],Z.prototype,"hiddenFields",null),e([c()],Z.prototype,"highlightEnabled",null),e([c()],Z.prototype,"highlightIds",null),e([c()],Z.prototype,"icon",null),e([c()],Z.prototype,"initialSize",null),e([c()],Z.prototype,"isQueryingOrSyncing",null),e([c()],Z.prototype,"isSyncing",null),e([c()],Z.prototype,"isSyncingAttachments",null),e([c()],Z.prototype,"label",null),e([c()],Z.prototype,"layer",null),e([c()],Z.prototype,"layers",null),e([c()],Z.prototype,"layerView",null),e([c()],Z.prototype,"maxSize",null),e([c(),F("esri/widgets/FeatureTable/t9n/FeatureTable")],Z.prototype,"messages",null),e([c(),F("esri/t9n/common")],Z.prototype,"messagesCommon",null),e([c(),F("esri/core/t9n/Units")],Z.prototype,"messagesUnits",null),e([c(),F("esri/widgets/support/t9n/uriUtils")],Z.prototype,"messagesURIUtils",null),e([c()],Z.prototype,"menuConfig",null),e([c()],Z.prototype,"multipleSelectionEnabled",null),e([c()],Z.prototype,"multiSortEnabled",null),e([c()],Z.prototype,"multipleSortPriority",null),e([c()],Z.prototype,"navigationScale",void 0),e([c()],Z.prototype,"noDataMessage",null),e([c()],Z.prototype,"objectIds",null),e([c()],Z.prototype,"outFields",null),e([c()],Z.prototype,"pageCount",null),e([c()],Z.prototype,"pageIndex",null),e([c()],Z.prototype,"pageSize",null),e([c()],Z.prototype,"paginationEnabled",null),e([c()],Z.prototype,"prompt",null),e([c()],Z.prototype,"relatedRecordsEnabled",null),e([c()],Z.prototype,"relatedTable",null),e([c()],Z.prototype,"relatedTables",null),e([c()],Z.prototype,"relationship",null),e([c()],Z.prototype,"relationshipColumnConfigs",null),e([c()],Z.prototype,"relationshipColumns",null),e([c()],Z.prototype,"relationshipConfig",null),e([c()],Z.prototype,"relationshipInfos",null),e([c()],Z.prototype,"returnGeometryEnabled",null),e([c()],Z.prototype,"returnMEnabled",null),e([c()],Z.prototype,"returnZEnabled",null),e([c()],Z.prototype,"rowHighlightIds",null),e([c()],Z.prototype,"selectionSource",null),e([c()],Z.prototype,"showAllRelatedTables",null),e([c()],Z.prototype,"showPrompt",null),e([c()],Z.prototype,"showRelatedTableCallback",null),e([c()],Z.prototype,"size",null),e([c({readOnly:!0})],Z.prototype,"state",null),e([c()],Z.prototype,"supportsAddAttachments",null),e([c()],Z.prototype,"supportsAttachments",null),e([c()],Z.prototype,"supportsDeleteAttachments",null),e([c()],Z.prototype,"supportsResizeAttachments",null),e([c()],Z.prototype,"supportsUpdateAttachments",null),e([c()],Z.prototype,"syncTemplateOnChangesEnabled",null),e([c({constructOnly:!0})],Z.prototype,"tableController",null),e([c({constructOnly:!0})],Z.prototype,"tableParent",null),e([c({type:T})],Z.prototype,"tableTemplate",null),e([c()],Z.prototype,"tableTemplateOverride",null),e([c()],Z.prototype,"title",void 0),e([c({type:w})],Z.prototype,"timeExtent",null),e([c()],Z.prototype,"timeZone",null),e([c()],Z.prototype,"view",null),e([c({type:S}),O(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],Z.prototype,"viewModel",void 0),e([c()],Z.prototype,"visibleColumns",null),e([c({type:A,nonNullable:!0})],Z.prototype,"visibleElements",void 0),e([c({type:A})],Z.prototype,"visibleElementsOverride",null),Z=$=e([d("esri.widgets.FeatureTable")],Z);const G=Z;export{G as default};
@@ -9,7 +9,7 @@ export interface LayerListViewModelProperties extends EventedMixinProperties, Pa
9
9
  export interface LayerListViewModelEvents {
10
10
  /**
11
11
  * Fires after the user clicks on an [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html)
12
- * or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) inside the LayerList widget.
12
+ * or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) inside the LayerList.
13
13
  * This event may be used to define a custom function to execute when particular actions are clicked.
14
14
  */
15
15
  "trigger-action": LayerListViewModelTriggerActionEvent;
@@ -44,8 +44,7 @@ export default class LayerListViewModel extends EventedAccessor {
44
44
  * Whether to provide an indication if a layer is being published in the
45
45
  * [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html). When a layer is publishing,
46
46
  * a rotating square will appear to the right of the list item title.
47
- * The list item
48
- * [ListItem#publishing](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#publishing) property
47
+ * The [ListItem#publishing](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#publishing) property
49
48
  * will be `false` if `checkPublishStatusEnabled` is `false`.
50
49
  *
51
50
  * @default false
@@ -54,10 +53,9 @@ export default class LayerListViewModel extends EventedAccessor {
54
53
  accessor checkPublishStatusEnabled: boolean;
55
54
  /**
56
55
  * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html).
57
- * Each list item can be modified
58
- * according to its modifiable properties. Actions can be added to list items
59
- * using the [ListItem#actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections)
60
- * property of the ListItem.
56
+ * Each list item can be modified according to its modifiable properties.
57
+ * Actions can be added to list items using the
58
+ * [ListItem#actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property.
61
59
  *
62
60
  * @since 4.4
63
61
  * @example
@@ -83,8 +81,9 @@ export default class LayerListViewModel extends EventedAccessor {
83
81
  */
84
82
  accessor listItemCreatedFunction: ListItemModifier | null | undefined;
85
83
  /**
86
- * Specifies whether to ignore the [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property of the layers to display all layers.
87
- * A common use case for `listModeDisabled` is when you want to use the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) to manage and configure a layer's `listMode` value.
84
+ * Specifies whether to ignore the [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property to display all layers.
85
+ * A common use case for `listModeDisabled` is when you want to use the
86
+ * [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) to manage and configure a layer's `listMode` value.
88
87
  *
89
88
  * @default false
90
89
  * @since 4.30
@@ -94,7 +93,7 @@ export default class LayerListViewModel extends EventedAccessor {
94
93
  /**
95
94
  * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers.
96
95
  * To hide layers from the LayerList widget, set the
97
- * [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property on the layer(s) to `hide`.
96
+ * [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property to `hide`.
98
97
  *
99
98
  * @see [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode)
100
99
  */
@@ -30,9 +30,8 @@ export interface ListItemProperties extends IdentifiableMixinProperties, Partial
30
30
  * in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget.
31
31
  *
32
32
  * A common scenario for using ListItemPanel is to display a [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget within
33
- * each list item. The `legend` keyword can be used in the
34
- * [ListItemPanel#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) property of the
35
- * panel to display a legend for each layer in the LayerList.
33
+ * each list item. The `legend` keyword can be used in the [ListItemPanel#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content)
34
+ * property to display a legend for each layer in the LayerList.
36
35
  *
37
36
  * @since 4.7
38
37
  * @example
@@ -76,13 +75,13 @@ export interface ConnectedLayerView extends LayerView {
76
75
  export type ListItemVisibilityMode = "independent" | "inherited" | "exclusive";
77
76
 
78
77
  /**
79
- * The ListItem class represents one of the [LayerListViewModel#operationalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#operationalItems)
80
- * in the [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html). In the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html)
81
- * widget UI, the list item represents a layer displayed in the view. It provides access to the associated layer's properties, allows
82
- * the developer to configure actions related to the layer, and allows the developer to add content to the item related to the layer.
78
+ * The ListItem class represents one of the [LayerListViewModel#operationalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#operationalItems).
79
+ * In the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget UI, the list item represents a layer displayed in the view.
80
+ * It provides access to the associated layer's properties, allows the developer to configure actions
81
+ * related to the layer, and allows the developer to add content to the item related to the layer.
83
82
  *
84
83
  * To hide list items in the LayerList widget, you must set the
85
- * [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property on the desired layers to `hide`.
84
+ * [Layer#listMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) property to `hide` on the desired layers.
86
85
  * You cannot hide list items using this class or the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) class.
87
86
  *
88
87
  * @since 4.2
@@ -193,9 +192,8 @@ export default abstract class ListItem extends ListItemSuperclass {
193
192
  * in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget.
194
193
  *
195
194
  * A common scenario for using ListItemPanel is to display a [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget within
196
- * each list item. The `legend` keyword can be used in the
197
- * [ListItemPanel#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) property of the
198
- * panel to display a legend for each layer in the LayerList.
195
+ * each list item. The `legend` keyword can be used in the [ListItemPanel#content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content)
196
+ * property to display a legend for each layer in the LayerList.
199
197
  *
200
198
  * @since 4.7
201
199
  * @example
@@ -59,7 +59,7 @@ export type ListItemPanelContents = ListItemPanelContent | ListItemPanelContent[
59
59
  * This class allows you to display custom content for each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)
60
60
  * in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. ListItemPanel objects typically aren't constructed.
61
61
  * Rather, they are modified using the [LayerList#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction)
62
- * property in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget.
62
+ * property.
63
63
  *
64
64
  * A common scenario for using ListItemPanel is to display a [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget within each list item.
65
65
  * This allows users to create a legend for each layer in the map simply by adding the string "legend" as the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content).