@arcgis/core 5.0.0-next.13 → 5.0.0-next.15

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 (348) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
  7. package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
  9. package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
  13. package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
  14. package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
  16. package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
  22. package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
  27. package/chunks/GaussianSplat.glsl.js +2 -2
  28. package/config.js +1 -1
  29. package/copyright.txt +0 -60
  30. package/core/SetUtils.js +1 -1
  31. package/core/workers/workerFactory.js +1 -1
  32. package/identity/IdentityModal.js +1 -1
  33. package/interfaces.d.ts +105 -9
  34. package/intl.js +1 -1
  35. package/kernel.js +1 -1
  36. package/layers/ImageryTileLayer.js +1 -1
  37. package/layers/ParquetLayer.js +1 -1
  38. package/layers/graphics/sources/ParquetSource.js +1 -1
  39. package/layers/graphics/sources/support/QueryTask.js +1 -1
  40. package/layers/mixins/ArcGISImageService.js +1 -1
  41. package/layers/mixins/ImageryTileMixin.js +1 -1
  42. package/layers/support/NumberFieldFormat.js +1 -1
  43. package/layers/support/Sublayer.js +1 -1
  44. package/layers/support/SubtypeSublayer.js +1 -1
  45. package/layers/support/featureLayerUtils.js +1 -1
  46. package/layers/support/fieldUtils.js +1 -1
  47. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  48. package/layers/support/rasterFunctionUtils.js +1 -1
  49. package/package.json +1 -1
  50. package/popup/content.js +1 -1
  51. package/portal/schemas/definitions.js +1 -1
  52. package/renderers/support/numberUtils.js +1 -1
  53. package/rest/geometryService.js +1 -1
  54. package/rest/geoprocessor.js +1 -1
  55. package/rest/imageService.js +1 -1
  56. package/rest/locator.js +1 -1
  57. package/rest/query.js +1 -1
  58. package/smartMapping/labels/bins.js +1 -1
  59. package/smartMapping/popup/support/clusterUtils.js +1 -1
  60. package/smartMapping/popup/support/utils.js +1 -1
  61. package/smartMapping/renderers/support/utils.js +1 -1
  62. package/support/BasemapStyle.js +1 -1
  63. package/support/actions/actionUtils.js +1 -1
  64. package/support/revision.js +1 -1
  65. package/symbols/support/svgUtils.js +1 -1
  66. package/tables/elements.js +1 -1
  67. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  68. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  69. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  70. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  71. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  72. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  73. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  74. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  75. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  76. package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
  77. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
  78. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  79. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  80. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  81. package/views/draw/support/Reshape.js +1 -1
  82. package/views/interactive/SegmentLabels.js +1 -1
  83. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  84. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  85. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  86. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  87. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  88. package/views/interactive/tooltip/content/Fields.js +1 -1
  89. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  90. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  91. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  92. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  93. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  94. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  95. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  96. package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
  97. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  98. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  99. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  100. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  101. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  102. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  103. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  104. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  105. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  106. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  107. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  108. package/views/navigation/gamepad/GamepadSettings.js +1 -1
  109. package/views/overlay/BoxOverlayItem.js +1 -1
  110. package/views/overlay/CrosshairOverlayItem.js +1 -1
  111. package/views/overlay/OutlineOverlayItem.js +1 -1
  112. package/views/ui/UI.js +1 -1
  113. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  114. package/widgets/AreaMeasurement2D.js +1 -1
  115. package/widgets/AreaMeasurement3D.js +1 -1
  116. package/widgets/Attachments.js +1 -1
  117. package/widgets/Attribution.js +1 -1
  118. package/widgets/BasemapGallery.js +1 -1
  119. package/widgets/BasemapLayerList.js +1 -1
  120. package/widgets/BasemapToggle.js +1 -1
  121. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  122. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  124. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  125. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  126. package/widgets/BatchAttributeForm.js +1 -1
  127. package/widgets/Bookmarks.js +1 -1
  128. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  129. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  130. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  131. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  132. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  133. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  134. package/widgets/BuildingExplorer.js +1 -1
  135. package/widgets/CatalogLayerList.js +1 -1
  136. package/widgets/Compass.js +1 -1
  137. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  138. package/widgets/CoordinateConversion.js +1 -1
  139. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  140. package/widgets/Daylight.js +1 -1
  141. package/widgets/DirectLineMeasurement3D.js +1 -1
  142. package/widgets/DirectionalPad.js +1 -1
  143. package/widgets/Directions.js +1 -1
  144. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  145. package/widgets/DistanceMeasurement2D.js +1 -1
  146. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  147. package/widgets/Editor/EditorViewModel.js +1 -1
  148. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  149. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  150. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  151. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  152. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  153. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  154. package/widgets/Editor/UpdateWorkflow.js +1 -1
  155. package/widgets/Editor/Workflow.js +1 -1
  156. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  157. package/widgets/Editor/components/FeatureList.js +1 -1
  158. package/widgets/Editor/components/FooterActions.js +1 -1
  159. package/widgets/Editor/components/MergeFeaturesList.js +1 -1
  160. package/widgets/Editor/components/Notices.js +1 -1
  161. package/widgets/Editor/components/PanelContent.js +1 -1
  162. package/widgets/Editor/components/PanelToolbar.js +1 -1
  163. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  164. package/widgets/Editor/components/Prompt.js +1 -1
  165. package/widgets/Editor/components/Settings.js +1 -1
  166. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  167. package/widgets/Editor/components/UploadDetails.js +1 -1
  168. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  169. package/widgets/Editor/support/errors.js +1 -1
  170. package/widgets/Editor.js +1 -1
  171. package/widgets/ElevationProfile/components/Legend.js +1 -1
  172. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  173. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  174. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  175. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  176. package/widgets/ElevationProfile.js +1 -1
  177. package/widgets/Expand.js +1 -1
  178. package/widgets/Feature/FeatureAttachments.js +1 -1
  179. package/widgets/Feature/FeatureContent.js +1 -1
  180. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  181. package/widgets/Feature/FeatureExpression.js +1 -1
  182. package/widgets/Feature/FeatureFields.js +1 -1
  183. package/widgets/Feature/FeatureMedia.js +1 -1
  184. package/widgets/Feature/FeatureRelationship.js +1 -1
  185. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  186. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  187. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  188. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  189. package/widgets/Feature.js +1 -1
  190. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  191. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  192. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  193. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  194. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  195. package/widgets/FeatureForm.js +1 -1
  196. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  197. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  198. package/widgets/FeatureTable.js +1 -1
  199. package/widgets/FeatureTemplates.js +1 -1
  200. package/widgets/Features/FeaturesDrillIn.js +1 -1
  201. package/widgets/Features.js +1 -1
  202. package/widgets/FloorFilter.js +1 -1
  203. package/widgets/FovOverlay.js +1 -1
  204. package/widgets/Fullscreen.js +1 -1
  205. package/widgets/Histogram.js +1 -1
  206. package/widgets/HistogramRangeSlider.js +1 -1
  207. package/widgets/Home.js +1 -1
  208. package/widgets/LayerList/LayerListItem.js +1 -1
  209. package/widgets/LayerList/ListItemPanel.js +1 -1
  210. package/widgets/LayerList.js +1 -1
  211. package/widgets/Legend/LegendViewModel.js +1 -1
  212. package/widgets/Legend/styles/card/CardView.js +1 -1
  213. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  214. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  215. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  216. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  217. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  218. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  219. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  220. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  221. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  222. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  223. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  224. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  225. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  226. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  227. package/widgets/Legend/styles/support/utils.js +1 -1
  228. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  229. package/widgets/Legend/support/styleUtils.js +1 -1
  230. package/widgets/Legend/support/utils.js +1 -1
  231. package/widgets/Legend.js +1 -1
  232. package/widgets/LineOfSight.js +1 -1
  233. package/widgets/Locate/LocateViewModel.js +1 -1
  234. package/widgets/Locate.js +1 -1
  235. package/widgets/Measurement.js +1 -1
  236. package/widgets/NavigationToggle.js +1 -1
  237. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  238. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  239. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  240. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  244. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  245. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  246. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  247. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  249. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  250. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  251. package/widgets/OrientedImageryViewer.js +1 -1
  252. package/widgets/PanoramicVideoViewer.js +1 -1
  253. package/widgets/PanoramicViewer.js +1 -1
  254. package/widgets/Popup.js +1 -1
  255. package/widgets/Print/FileLink.js +1 -1
  256. package/widgets/Print.js +1 -1
  257. package/widgets/ScaleBar.js +1 -1
  258. package/widgets/ScaleRangeSlider.js +1 -1
  259. package/widgets/Search/SearchResultRenderer.js +1 -1
  260. package/widgets/Search/support/layerSearchUtils.js +1 -1
  261. package/widgets/Search.js +1 -1
  262. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  263. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  264. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  265. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  266. package/widgets/ShadowCast.js +1 -1
  267. package/widgets/Sketch/SketchViewModel.js +1 -1
  268. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  269. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  270. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  271. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/Slice.js +1 -1
  274. package/widgets/Slider.js +1 -1
  275. package/widgets/Spinner.js +1 -1
  276. package/widgets/Swipe.js +1 -1
  277. package/widgets/TableList/ListItemPanel.js +1 -1
  278. package/widgets/TableList.js +1 -1
  279. package/widgets/TimeSlider.js +1 -1
  280. package/widgets/TimeZoneLabel.js +1 -1
  281. package/widgets/Track.js +1 -1
  282. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  283. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  284. package/widgets/UtilityNetworkAssociations.js +1 -1
  285. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  286. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  287. package/widgets/UtilityNetworkTrace.js +1 -1
  288. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  289. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  290. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  291. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  292. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  293. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  294. package/widgets/ValuePicker.js +1 -1
  295. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  296. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  297. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  298. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  299. package/widgets/VideoPlayer.js +1 -1
  300. package/widgets/Weather/LabeledSlider.js +1 -1
  301. package/widgets/Weather.js +1 -1
  302. package/widgets/Widget.js +1 -1
  303. package/widgets/Zoom.js +1 -1
  304. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  305. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  306. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  307. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  308. package/widgets/smartMapping/ColorSlider.js +1 -1
  309. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  310. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  311. package/widgets/smartMapping/OpacitySlider.js +1 -1
  312. package/widgets/smartMapping/SizeSlider.js +1 -1
  313. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  314. package/widgets/support/ColorPicker.js +1 -1
  315. package/widgets/support/FilterBuilder.js +1 -1
  316. package/widgets/support/FilterCondition.js +1 -1
  317. package/widgets/support/GridControls.js +1 -1
  318. package/widgets/support/Heading.js +1 -1
  319. package/widgets/support/ItemList.js +1 -1
  320. package/widgets/support/LabeledSwitch.js +1 -1
  321. package/widgets/support/MeasurementWidgetContent.js +1 -1
  322. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  323. package/widgets/support/SelectionList/LayerItem.js +1 -1
  324. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  325. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  326. package/widgets/support/SelectionList.js +1 -1
  327. package/widgets/support/SelectionToolbar.js +1 -1
  328. package/widgets/support/SketchTooltipControls.js +1 -1
  329. package/widgets/support/SnappingControls.js +1 -1
  330. package/widgets/support/TimezonePicker.js +1 -1
  331. package/widgets/support/UnitSelect.js +1 -1
  332. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  333. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
  334. package/widgets/support/chartUtilsAm5.js +1 -1
  335. package/widgets/support/dateUtils.js +1 -1
  336. package/widgets/support/iconUtils.js +1 -1
  337. package/widgets/support/widget.js +1 -1
  338. package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
  339. package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
  340. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
  341. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
  342. package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
  343. package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
  344. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
  345. package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
  346. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  347. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
  348. package/widgets/support/jsxFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import{referenceSetter as s}from"../../core/collectionUtils.js";import{deprecatedFunction as l}from"../../core/deprecate.js";import o from"../../core/Error.js";import n from"../../core/Handles.js";import r from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{debounce as h,ignoreAbortErrors as d,after as m,throwIfAborted as c,createResolver as p}from"../../core/promiseUtils.js";import{watch as u,on as g,initial as b}from"../../core/reactiveUtils.js";import{throttle as f}from"../../core/throttle.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as T}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveFieldAlias as w}from"../../editing/fieldUtils.js";import{getLowerCaseDefaultHiddenFields as _}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as C,getSubtypesFromLayer as I,isSubtypeGroupLayer as v}from"../../layers/support/layerUtils.js";import{createFieldInfos as E}from"../../support/popupUtils.js";import A from"../../tables/AttributeTableTemplate.js";import F from"../../tables/support/FieldOrder.js";import{defaultHighlightName as j,temporaryHighlightName as S}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as R}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as x}from"../../views/support/selectionUtils.js";import U from"./ActionColumn.js";import O from"./AttachmentsColumn.js";import V from"./FieldColumn.js";import z from"./RelationshipColumn.js";import W from"./Grid/Column.js";import P from"./Grid/Grid.js";import H from"./Grid/GridViewModel.js";import L from"./Grid/GroupColumn.js";import B from"./support/AttachmentsColumnTemplate.js";import Z from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as G,isFieldColumn as k,isRelationshipColumn as N}from"./support/columnUtils.js";import{downloadAttachmentInfo as D,exportToCSV as M}from"./support/exportUtils.js";import $ from"./support/FeatureStore.js";import q from"./support/FieldColumnTemplate.js";import Q from"./support/RelationshipColumnTemplate.js";import K from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as J,isIFeatureTableSupportedLayerWithRelationships as X,findRelatedLayerInSources as Y,findRelationship as ee,uniqueColumnNames as te,hasColumnForField as ie,findField as se,isIFeatureTableSupportedLayerWithAttachments as le,getTableHighlightKey as oe,getRelationshipIdsToShow as ne}from"./support/tableUtils.js";import{createAttributeTableElements as re}from"./support/templateUtils.js";import{goTo as ae}from"../support/goToUtils.js";import"../support/widgetUtils.js";import{messageBundle as he}from"../support/decorators/messageBundle.js";import"@arcgis/toolkit/dom";import{onLocaleChange as de}from"../../intl/locale.js";import{substitute as me}from"../../intl/substitute.js";import{fetchMessageBundle as ce}from"../../intl/messages.js";const pe="80px";let ue=class extends H{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new n,this._refreshDebounced=h(()=>this._refresh()),this._syncTemplateThrottled=f(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new Z,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new i,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:o});t&&t(n)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new i,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new $),this._set("grid",new P({viewModel:this}))}initialize(){const e=async()=>{this.messages=await ce("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await ce("esri/t9n/common"),this.messagesUnits=await ce("esri/core/t9n/Units"),this.messagesURIUtils=await ce("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([de(()=>{e(),this._generateColumns()}),u(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},b),g(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),u(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,d(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),u(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),u(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),u(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),u(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),u(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),u(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),u(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),u(()=>this.editingEnabled,e=>{this.editableColumns.forEach(t=>t.tableEditingEnabled=e),this.refreshCellContent()}),u(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),u(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),u(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),g(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),g(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,n=o?.getObjectId(),r="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:n}),(r||"cell-click"===l)&&this._onCellInteraction(n)}),u(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),u(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),g(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),u(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),u(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),u(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),u(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),u(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),g(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),g(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),u(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),u(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=a(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return _(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return R(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;if(x(e)||C(e)){const t=e;return this._selectionManager?.sources?.includes(t)?t:null}return null}get _subtypes(){return I(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:s,highlightIds:l}=this,o=new i;return e&&o.push({type:"geometry",geometry:e}),s?o.push({type:"selection",objectIds:l.toArray()}):t.length&&o.push({type:"objectId",objectIds:t.toArray()}),o}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>G(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>k(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new i}set hiddenFields(e){this._set("hiddenFields",s(e,this._get("hiddenFields"),i))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return J(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>N(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!X(e)||!i?.length)return l;const o=[],n=s?.layers||t||[];return i.forEach(t=>{const i=Y(e,n,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this._get("timeZone")}set timeZone(e){this.allColumns.forEach(t=>t.tableTimeZone=e),this._set("timeZone",e)}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:s,objectId:l,relationshipId:o}=t,{objectIdField:n}=s,r=ee(s,o),a=s.displayField||r?.keyField||n;e.set({highlightIds:new i([l]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,o)});const h=e.hiddenFields;h.includes(te.action)||h.add(te.action),h.includes(te.attachments)||h.add(te.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await D(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([te.action,te.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await M({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(l(r.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(te.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),d(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:s,layer:l}=this;if(!this.attachmentsEnabled||!l)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await l.load();const o=this._getDefaultLayerDisplayField(l),n=await this.store.getAttachmentsByObjectId(e,!0),r=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:n,mode:n.length?"list":"file",objectId:e}),this.set({highlightIds:new i([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(o)}),s.includes(te.action)||s.add(te.action),null!=r&&this.scrollToIndex(r)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){l(r.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,n=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{n&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),n&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await ae(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:n,columns:r}=this,a=[],h=re(r.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new F({field:e,order:t}))}),n.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new F({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&v(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>G(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>N(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:i}=this;if(!e||!i)return null;const{elements:s,orderByFields:l}=e,o=E(i),n=[];n.push(...this._generateColumnsFromAttributeTableElements(s,l));const r=o.map(e=>{if(!e.fieldName||ie(e.fieldName,n))return null;const{fieldName:t}=e,s=se(i,t);return s?this._generateDefaultFieldColumn(s,{hidden:!0,orderByFields:l}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(t);return n.push(...r),this.attachmentsEnabled&&le(i)&&!n.some(e=>G(e))&&n.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&X(i)&&i.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!n.some(t=>N(t)&&t.relationshipId===e)&&n.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),n.length?n:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=se(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:n,label:r}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{editingEnabled:m,grid:c,messages:p,messagesCommon:u,messagesURIUtils:g,store:b,timeZone:f,view:y}=this;return new V({description:n,direction:h,field:o,fieldName:l,grid:c,initialSortPriority:d,label:r,layer:t,messages:p,messagesCommon:u,messagesURIUtils:g,store:b,tableEditingEnabled:m,tableTimeZone:f,view:y,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,timeZone:d}=this;return new L({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,tableTimeZone:d})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,timeZone:m}=this;return new O({description:s,fieldName:`${te.attachments}-${i}`,grid:o,label:l,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,tableTimeZone:m,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,n=this.relationshipInfos.find(e=>e.relationshipId===o);if(!n)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:r,messages:a,messagesCommon:h,messagesURIUtils:d,store:m,timeZone:c}=this;return new z({description:s,fieldName:`${te.relationship}-${o}-${i}`,grid:r,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,tableTimeZone:c,layer:n.relatedLayer,relatedLayer:n.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{editingEnabled:t,grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a,view:h}=this;if(!e?.length||!s)return null;const d=[];return e.forEach((e,m)=>{const{autoWidth:c,description:p,direction:u,flexGrow:g,fieldName:b,formatFunction:f,frozen:y,frozenToEnd:T,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,resizable:F,sortable:j,textAlign:S,textWrap:R,timeZone:x,type:U,width:O}=e;if(!U)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(y&&T)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const z=!1===e.visible;if("group"===U){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const t=this._generateColumnsFromColumnTemplates(e.columnTemplates),s=z||this._isFieldHidden(e.label);d.push(new L({autoWidth:c,columns:t,description:p,flexGrow:g,frozen:y,frozenToEnd:T,grid:i,hidden:s,icon:w,iconText:_,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,tableTimeZone:a,textAlign:S,textWrap:R,timeZone:x,width:O}))}else if("attachment"===U){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");d.push(this._generateAttachmentsColumnFromTemplate(e,m))}else if("relationship"===U){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");d.push(this._generateRelationshipColumnFromTemplate(i,e,m))}else if(!b)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const P=z||this._isFieldHidden(b);if("column"===U)d.push(new W({autoWidth:c,description:p,direction:u,fieldName:b,flexGrow:g,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:P,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,sortable:j,tableTimeZone:a,textAlign:S,textWrap:R,timeZone:x,width:O}));else if("field"===U){const m=se(s,e.fieldName);if(!m)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:b,required:U}=e;d.push(new V({autoWidth:c,description:p,direction:u,editable:b,field:m,fieldName:m.name,flexGrow:g,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:P,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,menuConfig:A,required:U,resizable:F,sortable:j,store:r,tableEditingEnabled:t,tableTimeZone:a,template:e,textAlign:S,textWrap:R,timeZone:x,width:O,view:h,onShowPromptCallback:this._onShowPromptCallback}))}}),d.length?d:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(t)??[]}_generateDefaultFieldColumn(e,t){const{editingEnabled:i,grid:s,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,timeZone:h,view:d}=this,m=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const c=e.name,p=m?.findIndex(({field:e})=>e&&e===c)??-1,u=p>-1?m?.at(p)?.order:void 0,g=p>-1?p:void 0;return new V({direction:u,field:e,fieldName:c,grid:s,hidden:t?.hidden||this._isFieldHidden(c),initialSortPriority:g,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,tableEditingEnabled:i,tableTimeZone:h,view:d,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{attachmentsViewEnabled:h,autoWidth:d,description:m,flexGrow:c,fieldName:p,formatFunction:u,frozen:g,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,resizable:I,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:j,thumbnailsEnabled:S,timeZone:R,width:x}=e;return new O({attachmentsViewEnabled:h,autoWidth:d,description:m,fieldName:`${te.attachments}-${t}`,flexGrow:c,formatFunction:u,frozen:g,frozenToEnd:b,grid:i,hidden:!1===e.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,layer:s,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:I,store:r,tableTimeZone:a,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:j,thumbnailsEnabled:S,timeZone:R,width:x,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,timeZone:r}=this,a=te.attachments;return new O({fieldName:a,grid:t,hidden:e?.hidden||this._isFieldHidden(a),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,tableTimeZone:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{autoWidth:h,collapsed:d,description:m,flexGrow:c,fieldName:p,formatFunction:u,frozen:g,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,relationshipId:I,resizable:v,textAlign:E,textWrap:A,timeZone:F,width:j}=t;return new z({autoWidth:h,collapsed:d,description:m,fieldName:`${te.relationship}-${I}-${i}`,flexGrow:c,formatFunction:u,frozen:g,frozenToEnd:b,grid:s,hidden:!1===t.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,relationshipId:I,resizable:v,store:r,tableTimeZone:a,textAlign:E,textWrap:A,timeZone:F,width:j,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a}=this,{relationshipId:h}=l;return new z({...t,fieldName:`${te.relationship}-${h}-${s}`,grid:o,hidden:i,messages:n,messagesCommon:r,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new U({hidden:this._isFieldHidden(te.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:j}),oe(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(oe(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await m(25),c(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:S})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(te.action)||s.add(te.action),s.includes(te.attachments)||s.add(te.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:ne(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([te.action,te.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new K({columnTemplates:[new q({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new Q({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:pe})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new q({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new B({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:pe})),new K({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:n}=this;if(!n||!o.length)return void t.cancel();const r=o.find(e=>e.code===l);if(!r)return void t.cancel();const a=p(),h=this._createSubtypeEditPrompt(s,r,a),d=!!n.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(r.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,i){const{_subtypes:s,messages:l,messagesCommon:o}=this,n=s.find(t=>t.code===e)?.name??`${e}`;let r="update-fields";const a=[{label:l.subtypes.useDefaultValuesOption,value:"update-fields"},{label:l.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:l.subtypes.changeWarningTitle,message:me(l.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:a,defaultRadioSelection:"update-fields",onRadioSelection:e=>{r=e},actions:{primary:{label:o.apply,action:()=>i.resolve(r),type:"positive"},secondary:{label:o.cancel,type:"neutral",action:()=>i.resolve("undo")}},cancel:()=>i.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new K({columnTemplates:[new q({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new B({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:pe})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&w(s,i)]}):i?.fields.map(e=>[e.name,w(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?r.getLogger(this).warnOnce(e):r.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([y()],ue.prototype,"_defaultHiddenFields",null),e([y()],ue.prototype,"_effectiveTableTemplate",null),e([y()],ue.prototype,"_effectiveAttributeTableTemplate",null),e([y()],ue.prototype,"_highlights",void 0),e([y()],ue.prototype,"_highlightableLayerView",null),e([y()],ue.prototype,"_selectionManager",null),e([y()],ue.prototype,"_selectableLayer",null),e([y()],ue.prototype,"_subtypes",null),e([y()],ue.prototype,"_tableHighlightsReady",null),e([y()],ue.prototype,"_viewSelection",null),e([y()],ue.prototype,"_viewSelectionReady",null),e([y()],ue.prototype,"activeFilters",null),e([y({readOnly:!0})],ue.prototype,"activeSortOrders",null),e([y()],ue.prototype,"allRelatedTablesVisible",null),e([y()],ue.prototype,"attachmentsColumns",null),e([y()],ue.prototype,"attachmentsEnabled",null),e([y()],ue.prototype,"attachmentsViewOptions",void 0),e([y({type:A})],ue.prototype,"attributeTableTemplate",void 0),e([y()],ue.prototype,"autoRefreshEnabled",void 0),e([y()],ue.prototype,"clearPrompt",null),e([y({readOnly:!0})],ue.prototype,"columns",void 0),e([y()],ue.prototype,"dataProvider",void 0),e([y()],ue.prototype,"definitionExpression",null),e([y()],ue.prototype,"fieldColumns",null),e([y()],ue.prototype,"filterGeometry",null),e([y()],ue.prototype,"filterBySelectionEnabled",null),e([y({readOnly:!0})],ue.prototype,"grid",void 0),e([y()],ue.prototype,"hiddenFields",null),e([y()],ue.prototype,"highlightEnabled",void 0),e([y()],ue.prototype,"initialSize",null),e([y()],ue.prototype,"isQueryingOrSyncing",null),e([y()],ue.prototype,"isSyncingAttachments",null),e([y()],ue.prototype,"layer",null),e([y()],ue.prototype,"layers",void 0),e([y()],ue.prototype,"layerFieldConfigurations",null),e([y()],ue.prototype,"layerView",null),e([y()],ue.prototype,"menuConfig",void 0),e([y()],ue.prototype,"messages",void 0),e([y(),he("esri/t9n/common")],ue.prototype,"messagesCommon",void 0),e([y(),he("esri/core/t9n/Units")],ue.prototype,"messagesUnits",void 0),e([y(),he("esri/widgets/support/t9n/uriUtils")],ue.prototype,"messagesURIUtils",void 0),e([y()],ue.prototype,"outFields",null),e([y()],ue.prototype,"prompt",void 0),e([y()],ue.prototype,"relatedRecordsEnabled",null),e([y()],ue.prototype,"relatedTable",null),e([y()],ue.prototype,"relatedTables",void 0),e([y()],ue.prototype,"relationship",null),e([y()],ue.prototype,"relationshipColumnConfigs",void 0),e([y()],ue.prototype,"relationshipColumns",null),e([y()],ue.prototype,"relationshipConfig",null),e([y()],ue.prototype,"relationshipInfos",null),e([y()],ue.prototype,"relationships",null),e([y()],ue.prototype,"returnGeometryEnabled",null),e([y()],ue.prototype,"returnMEnabled",null),e([y()],ue.prototype,"returnZEnabled",null),e([y()],ue.prototype,"selectionSource",void 0),e([y()],ue.prototype,"showAllRelatedTables",null),e([y()],ue.prototype,"showPrompt",null),e([y()],ue.prototype,"showRelatedTableCallback",void 0),e([y({readOnly:!0,type:$})],ue.prototype,"store",void 0),e([y()],ue.prototype,"supportsAttachments",null),e([y()],ue.prototype,"supportsAddAttachments",null),e([y()],ue.prototype,"supportsDeleteAttachments",null),e([y()],ue.prototype,"supportsResizeAttachments",null),e([y()],ue.prototype,"supportsUpdateAttachments",null),e([y()],ue.prototype,"syncTemplateOnChangesEnabled",void 0),e([y()],ue.prototype,"tableController",void 0),e([y()],ue.prototype,"tableParent",void 0),e([y({type:K})],ue.prototype,"tableTemplate",void 0),e([y()],ue.prototype,"tableTemplateOverride",void 0),e([y()],ue.prototype,"timeExtent",null),e([y()],ue.prototype,"timeZone",null),e([y()],ue.prototype,"view",null),ue=e([T("esri.widgets.FeatureTable.FeatureTableViewModel")],ue);const ge=ue;export{ge as default};
5
+ import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../intl.js";import{isSome as l}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import{referenceSetter as n}from"../../core/collectionUtils.js";import{deprecatedFunction as r}from"../../core/deprecate.js";import a from"../../core/Error.js";import h from"../../core/Handles.js";import d from"../../core/Logger.js";import{abortMaybe as m}from"../../core/maybe.js";import{debounce as c,ignoreAbortErrors as p,after as u,throwIfAborted as g,createResolver as b}from"../../core/promiseUtils.js";import{watch as f,on as y,initial as T}from"../../core/reactiveUtils.js";import{throttle as w}from"../../core/throttle.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as C}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveFieldAlias as I}from"../../editing/fieldUtils.js";import{getLowerCaseDefaultHiddenFields as v}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as E,getSubtypesFromLayer as A,isSubtypeGroupLayer as F}from"../../layers/support/layerUtils.js";import{createFieldInfos as S}from"../../support/popupUtils.js";import j from"../../tables/AttributeTableTemplate.js";import R from"../../tables/support/FieldOrder.js";import{defaultHighlightName as x,temporaryHighlightName as U}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as O}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as V}from"../../views/support/selectionUtils.js";import z from"./ActionColumn.js";import W from"./AttachmentsColumn.js";import P from"./FieldColumn.js";import H from"./RelationshipColumn.js";import L from"./Grid/Column.js";import B from"./Grid/Grid.js";import Z from"./Grid/GridViewModel.js";import G from"./Grid/GroupColumn.js";import k from"./support/AttachmentsColumnTemplate.js";import N from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as D,isFieldColumn as M,isRelationshipColumn as $}from"./support/columnUtils.js";import{downloadAttachmentInfo as q,exportToCSV as Q}from"./support/exportUtils.js";import K from"./support/FeatureStore.js";import J from"./support/FieldColumnTemplate.js";import X from"./support/RelationshipColumnTemplate.js";import Y from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as ee,isIFeatureTableSupportedLayerWithRelationships as te,findRelatedLayerInSources as ie,findRelationship as se,uniqueColumnNames as le,hasColumnForField as oe,findField as ne,isIFeatureTableSupportedLayerWithAttachments as re,getTableHighlightKey as ae,getRelationshipIdsToShow as he}from"./support/tableUtils.js";import{createAttributeTableElements as de}from"./support/templateUtils.js";import{goTo as me}from"../support/goToUtils.js";import{messageBundle as ce}from"../support/widget.js";const pe="80px";let ue=class extends Z{constructor(e){super(e),this._currentTemporaryHighlight=null,this._highlights=new h,this._refreshDebounced=c(()=>this._refresh()),this._syncTemplateThrottled=w(()=>this._syncAttributeTableTemplate()),this._temporaryHighlightAbortController=null,this.attachmentsViewOptions=new N,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new o,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:o});t&&t(n)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.maxSize=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new o,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new K),this._set("grid",new B({viewModel:this}))}initialize(){const e=async()=>{this.messages=await s("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await s("esri/t9n/common"),this.messagesUnits=await s("esri/core/t9n/Units"),this.messagesURIUtils=await s("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([t(()=>{e(),this._generateColumns()}),f(()=>[this.messages,this.messagesCommon,this.messagesURIUtils],()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach(t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils}),this.refreshCellContent()},T),y(()=>this.highlightIds,"change",e=>this._onHighlightIdsChange(e),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),f(()=>this.grid?.temporaryHighlightId,e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,p(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))}),f(()=>this.attachmentsEnabled,()=>this.layer?.loaded&&this._generateColumns()),f(()=>this._viewSelection,()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}),f(()=>[this._tableHighlightsReady,this._viewSelectionReady],()=>this._syncSelection()),f(()=>this.layer,async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch(()=>{})),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)}),f(()=>this.layer?.loaded,e=>e&&this._onLayerLoad()),f(()=>this.store.state,e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())}),f(()=>this._effectiveTableTemplate,()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()}),f(()=>this.editingEnabled,e=>{this.editableColumns.forEach(t=>t.tableEditingEnabled=e),this.refreshCellContent()}),f(()=>this.timeZone??this.view?.timeZone,()=>this.refreshCellContent()),f(()=>this.store.effectiveWhere,()=>"loaded"===this.store.state&&this.reset()),f(()=>this.layer?.timeExtent,(e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset()),y(()=>this.layer,"refresh",e=>this._onLayerRefresh(e)),y(()=>this.grid,["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,n=o?.getObjectId(),r="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:n}),(r||"cell-click"===l)&&this._onCellInteraction(n)}),f(()=>this.actionColumnConfig,e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())}),f(()=>this.relatedRecordsEnabled,()=>this.layer?.loaded&&this._generateColumns()),y(()=>this.objectIds,"change",()=>this._onObjectIdsChange(),{onListenerAdd:()=>this._onObjectIdsChange()}),f(()=>[this.paginationEnabled,this.pageIndex],()=>this.refreshPageCache()),f(()=>this.activeSortOrders,e=>{this.store.sortOrders=e,this._syncTemplateThrottled()}),f(()=>this.allVisibleColumns,()=>this._syncTemplateThrottled()),f(()=>this.pageCount,()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}),f(()=>this.state,e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()}),y(()=>this.tableParent?.highlightIds,"change",({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}}),y(()=>this.tableParent,"cell-click",e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)}),f(()=>this.attachmentsViewOptions.objectId,(e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}),f(()=>this.layerFieldConfigurations,()=>this.refreshCellContent())])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=m(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return v(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return O(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;if(V(e)||E(e)){const t=e;return this._selectionManager?.sources?.includes(t)?t:null}return null}get _subtypes(){return A(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get actionColumn(){return super.actionColumn}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:i,highlightIds:s}=this,l=new o;return e&&l.push({type:"geometry",geometry:e}),i?l.push({type:"selection",objectIds:s.toArray()}):t.length&&l.push({type:"objectId",objectIds:t.toArray()}),l}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map(({path:e,direction:t})=>({fieldName:e,direction:t})).filter(e=>e.fieldName&&e.direction):[]}get allColumns(){return super.allColumns}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get allVisibleColumns(){return super.allVisibleColumns}get attachmentsColumns(){return this.allColumns.filter(e=>D(e))}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get effectiveSize(){return super.effectiveSize}get fieldColumns(){return this.allColumns.filter(e=>M(e))}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get groupColumns(){return super.groupColumns}get hiddenFields(){return this._get("hiddenFields")??new o}set hiddenFields(e){this._set("hiddenFields",n(e,this._get("hiddenFields"),o))}get highlightIds(){return super.highlightIds}set highlightIds(e){super.highlightIds=e}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isEditing(){return super.isEditing}get isQuerying(){return super.isQuerying}get isSyncing(){return super.isSyncing}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some(e=>!!e.isQueryingOrSyncing)}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some(e=>!!e.isSyncingAttachments)}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerFieldConfigurations(){const e=this.layer;return ee(e)?e.fieldConfigurations:void 0}get layerView(){return this.store.layerView}get objectIds(){return super.objectIds}set objectIds(e){super.objectIds=e}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get pageCount(){return super.pageCount}get pageIndex(){return super.pageIndex}set pageIndex(e){super.pageIndex=e}get pageSize(){return super.pageSize}set pageSize(e){super.pageSize=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find(({id:t})=>t===e)}get relationshipColumns(){return this.allColumns.filter(e=>$(e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!te(e)||!i?.length)return l;const o=[],n=s?.layers||t||[];return i.forEach(t=>{const i=ie(e,n,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))}),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get rowHighlightIds(){return super.rowHighlightIds}set rowHighlightIds(e){super.rowHighlightIds=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get size(){return super.size}get state(){return super.state}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){return this.supportsUpdateAttachments}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this._get("timeZone")}set timeZone(e){this.allColumns.forEach(t=>t.tableTimeZone=e),this._set("timeZone",e)}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach(t=>t.view=e),this.refreshCellContent()}get visibleColumns(){return super.visibleColumns}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch(e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)}),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:i,objectId:s,relationshipId:l}=t,{objectIdField:n}=i,r=se(i,l),a=i.displayField||r?.keyField||n;e.set({highlightIds:new o([s]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,l)});const h=e.hiddenFields;h.includes(le.action)||h.add(le.action),h.includes(le.attachments)||h.add(le.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter(e=>!e.error).map(e=>e.objectId);i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find(e=>e.id===t);await q(i)}drainRelatedTables(){this.relatedTables.drain(e=>e.destroy()),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([le.action,le.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach(e=>e.destroy());const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await Q({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(r(d.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(le.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){await Promise.all([...this.relatedTables.map(e=>e.refresh()),p(this._refreshDebounced())])}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:i,layer:s}=this;if(!this.attachmentsEnabled||!s)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await s.load();const l=this._getDefaultLayerDisplayField(s),n=await this.store.getAttachmentsByObjectId(e,!0),r=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:n,mode:n.length?"list":"file",objectId:e}),this.set({highlightIds:new o([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(l)}),i.includes(le.action)||i.add(le.action),null!=r&&this.scrollToIndex(r)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){r(d.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,o=s.objectId===e;await l.updateAttachment(e,t,i).catch(e=>{o&&e&&"object"==typeof e&&"error"in e&&e.error instanceof a&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)}),o&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await me(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:n,columns:r}=this,a=[],h=de(r.toArray());o.forEach(({fieldName:e,direction:t})=>{e&&t&&a.push(new R({field:e,order:t}))}),n.forEach(({fieldName:e,direction:t})=>{t&&!a.some(t=>t.field===e)&&a.push(new R({field:e,order:t}))}),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach((t,i)=>{t||this.highlightIds.remove(e[i])})}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&F(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some(e=>D(e))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some(e=>$(e))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:t}=this;if(!e||!t)return null;const{elements:i,orderByFields:s}=e,o=S(t),n=[];n.push(...this._generateColumnsFromAttributeTableElements(i,s));const r=o.map(e=>{if(!e.fieldName||oe(e.fieldName,n))return null;const{fieldName:i}=e,l=ne(t,i);return l?this._generateDefaultFieldColumn(l,{hidden:!0,orderByFields:s}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)}).filter(l);return n.push(...r),this.attachmentsEnabled&&re(t)&&!n.some(e=>D(e))&&n.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&te(t)&&t.relationships?.forEach(({id:e},t)=>{const i=this.relationshipInfos.find(t=>t.relationshipId===e);i&&!n.some(t=>$(t)&&t.relationshipId===e)&&n.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))}),n.length?n:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}}).filter(e=>!!e)??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=ne(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:n,label:r}=i,a=s?.findIndex(({field:e})=>e&&e===l)??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{editingEnabled:m,grid:c,messages:p,messagesCommon:u,messagesURIUtils:g,store:b,timeZone:f,view:y}=this;return new P({description:n,direction:h,field:o,fieldName:l,grid:c,initialSortPriority:d,label:r,layer:t,messages:p,messagesCommon:u,messagesURIUtils:g,store:b,tableEditingEnabled:m,tableTimeZone:f,view:y,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,timeZone:d}=this;return new G({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,tableTimeZone:d})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,timeZone:m}=this;return new W({description:s,fieldName:`${le.attachments}-${i}`,grid:o,label:l,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,tableTimeZone:m,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,n=this.relationshipInfos.find(e=>e.relationshipId===o);if(!n)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:r,messages:a,messagesCommon:h,messagesURIUtils:d,store:m,timeZone:c}=this;return new H({description:s,fieldName:`${le.relationship}-${o}-${i}`,grid:r,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,tableTimeZone:c,layer:n.relatedLayer,relatedLayer:n.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{editingEnabled:t,grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a,view:h}=this;if(!e?.length||!s)return null;const d=[];return e.forEach((e,m)=>{const{autoWidth:c,description:p,direction:u,flexGrow:g,fieldName:b,formatFunction:f,frozen:y,frozenToEnd:T,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,resizable:F,sortable:S,textAlign:j,textWrap:R,timeZone:x,type:U,width:O}=e;if(!U)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(y&&T)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const V=!1===e.visible;if("group"===U){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const t=this._generateColumnsFromColumnTemplates(e.columnTemplates),s=V||this._isFieldHidden(e.label);d.push(new G({autoWidth:c,columns:t,description:p,flexGrow:g,frozen:y,frozenToEnd:T,grid:i,hidden:s,icon:w,iconText:_,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,tableTimeZone:a,textAlign:j,textWrap:R,timeZone:x,width:O}))}else if("attachment"===U){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");d.push(this._generateAttachmentsColumnFromTemplate(e,m))}else if("relationship"===U){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find(e=>e.relationshipId===t);if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");d.push(this._generateRelationshipColumnFromTemplate(i,e,m))}else if(!b)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const z=V||this._isFieldHidden(b);if("column"===U)d.push(new L({autoWidth:c,description:p,direction:u,fieldName:b,flexGrow:g,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:z,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,sortable:S,tableTimeZone:a,textAlign:j,textWrap:R,timeZone:x,width:O}));else if("field"===U){const m=ne(s,e.fieldName);if(!m)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:b,required:U}=e;d.push(new P({autoWidth:c,description:p,direction:u,editable:b,field:m,fieldName:m.name,flexGrow:g,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:z,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,menuConfig:A,required:U,resizable:F,sortable:S,store:r,tableEditingEnabled:t,tableTimeZone:a,template:e,textAlign:j,textWrap:R,timeZone:x,width:O,view:h,onShowPromptCallback:this._onShowPromptCallback}))}}),d.length?d:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map(e=>this._generateDefaultFieldColumn(e)).filter(l)??[]}_generateDefaultFieldColumn(e,t){const{editingEnabled:i,grid:s,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,timeZone:h,view:d}=this,m=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const c=e.name,p=m?.findIndex(({field:e})=>e&&e===c)??-1,u=p>-1?m?.at(p)?.order:void 0,g=p>-1?p:void 0;return new P({direction:u,field:e,fieldName:c,grid:s,hidden:t?.hidden||this._isFieldHidden(c),initialSortPriority:g,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,tableEditingEnabled:i,tableTimeZone:h,view:d,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{attachmentsViewEnabled:h,autoWidth:d,description:m,flexGrow:c,fieldName:p,formatFunction:u,frozen:g,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,resizable:I,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:S,thumbnailsEnabled:j,timeZone:R,width:x}=e;return new W({attachmentsViewEnabled:h,autoWidth:d,description:m,fieldName:`${le.attachments}-${t}`,flexGrow:c,formatFunction:u,frozen:g,frozenToEnd:b,grid:i,hidden:!1===e.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,layer:s,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:I,store:r,tableTimeZone:a,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:S,thumbnailsEnabled:j,timeZone:R,width:x,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,timeZone:r}=this,a=le.attachments;return new W({fieldName:a,grid:t,hidden:e?.hidden||this._isFieldHidden(a),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,tableTimeZone:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{autoWidth:h,collapsed:d,description:m,flexGrow:c,fieldName:p,formatFunction:u,frozen:g,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,relationshipId:I,resizable:v,textAlign:E,textWrap:A,timeZone:F,width:S}=t;return new H({autoWidth:h,collapsed:d,description:m,fieldName:`${le.relationship}-${I}-${i}`,flexGrow:c,formatFunction:u,frozen:g,frozenToEnd:b,grid:s,hidden:!1===t.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,relationshipId:I,resizable:v,store:r,tableTimeZone:a,textAlign:E,textWrap:A,timeZone:F,width:S,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach((t,s)=>{const{relationshipId:l}=t,o=e.find(e=>e.relationshipId===l);o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))}):e.forEach((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e}))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a}=this,{relationshipId:h}=l;return new H({...t,fieldName:`${le.relationship}-${h}-${s}`,grid:o,hidden:i,messages:n,messagesCommon:r,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new z({hidden:this._isFieldHidden(le.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some(e=>e.toLowerCase()===t)}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:x}),ae(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(ae(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await u(25),g(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:U})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach(e=>this._addTableHighlight(e)):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach(e=>this._removeTableHighlight(e)),t.forEach(e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(le.action)||s.add(le.action),s.includes(le.attachments)||s.add(le.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:he(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([le.action,le.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new Y({columnTemplates:[new J({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}}))},resizable:!1}),new X({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:pe})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new J({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map(([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}}))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new k({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:pe})),new Y({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:n}=this;if(!n||!o.length)return void t.cancel();const r=o.find(e=>e.code===l);if(!r)return void t.cancel();const a=b(),h=this._createSubtypeEditPrompt(s,r,a),d=!!n.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(r.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,s){const{_subtypes:l,messages:o,messagesCommon:n}=this,r=l.find(t=>t.code===e)?.name??`${e}`;let a="update-fields";const h=[{label:o.subtypes.useDefaultValuesOption,value:"update-fields"},{label:o.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:o.subtypes.changeWarningTitle,message:i(o.subtypes.changeWarning,{originalType:r,newType:t.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>{a=e},actions:{primary:{label:n.apply,action:()=>s.resolve(a),type:"positive"},secondary:{label:n.cancel,type:"neutral",action:()=>s.resolve("undo")}},cancel:()=>s.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new Y({columnTemplates:[new J({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map(([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}}))},resizable:!1}),new k({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:pe})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter(({type:e})=>"field"===e||"column"===e).map(({fieldName:e,label:t})=>{if(null!=t&&""!==t)return[e,t];const s=i?.fieldsIndex.get(e);return[e,s&&I(s,i)]}):i?.fields.map(e=>[e.name,I(e,i)])??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex(e=>e.frozenToEnd);return e>-1?e:void 0}_logWarning(e,t){t?d.getLogger(this).warnOnce(e):d.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([_()],ue.prototype,"_defaultHiddenFields",null),e([_()],ue.prototype,"_effectiveTableTemplate",null),e([_()],ue.prototype,"_effectiveAttributeTableTemplate",null),e([_()],ue.prototype,"_highlights",void 0),e([_()],ue.prototype,"_highlightableLayerView",null),e([_()],ue.prototype,"_selectionManager",null),e([_()],ue.prototype,"_selectableLayer",null),e([_()],ue.prototype,"_subtypes",null),e([_()],ue.prototype,"_tableHighlightsReady",null),e([_()],ue.prototype,"_viewSelection",null),e([_()],ue.prototype,"_viewSelectionReady",null),e([_()],ue.prototype,"activeFilters",null),e([_({readOnly:!0})],ue.prototype,"activeSortOrders",null),e([_()],ue.prototype,"allRelatedTablesVisible",null),e([_()],ue.prototype,"attachmentsColumns",null),e([_()],ue.prototype,"attachmentsEnabled",null),e([_()],ue.prototype,"attachmentsViewOptions",void 0),e([_({type:j})],ue.prototype,"attributeTableTemplate",void 0),e([_()],ue.prototype,"autoRefreshEnabled",void 0),e([_()],ue.prototype,"clearPrompt",null),e([_({readOnly:!0})],ue.prototype,"columns",void 0),e([_()],ue.prototype,"dataProvider",void 0),e([_()],ue.prototype,"definitionExpression",null),e([_()],ue.prototype,"fieldColumns",null),e([_()],ue.prototype,"filterGeometry",null),e([_()],ue.prototype,"filterBySelectionEnabled",null),e([_({readOnly:!0})],ue.prototype,"grid",void 0),e([_()],ue.prototype,"hiddenFields",null),e([_()],ue.prototype,"highlightEnabled",void 0),e([_()],ue.prototype,"initialSize",null),e([_()],ue.prototype,"isQueryingOrSyncing",null),e([_()],ue.prototype,"isSyncingAttachments",null),e([_()],ue.prototype,"layer",null),e([_()],ue.prototype,"layers",void 0),e([_()],ue.prototype,"layerFieldConfigurations",null),e([_()],ue.prototype,"layerView",null),e([_()],ue.prototype,"menuConfig",void 0),e([_()],ue.prototype,"messages",void 0),e([_(),ce("esri/t9n/common")],ue.prototype,"messagesCommon",void 0),e([_(),ce("esri/core/t9n/Units")],ue.prototype,"messagesUnits",void 0),e([_(),ce("esri/widgets/support/t9n/uriUtils")],ue.prototype,"messagesURIUtils",void 0),e([_()],ue.prototype,"outFields",null),e([_()],ue.prototype,"prompt",void 0),e([_()],ue.prototype,"relatedRecordsEnabled",null),e([_()],ue.prototype,"relatedTable",null),e([_()],ue.prototype,"relatedTables",void 0),e([_()],ue.prototype,"relationship",null),e([_()],ue.prototype,"relationshipColumnConfigs",void 0),e([_()],ue.prototype,"relationshipColumns",null),e([_()],ue.prototype,"relationshipConfig",null),e([_()],ue.prototype,"relationshipInfos",null),e([_()],ue.prototype,"relationships",null),e([_()],ue.prototype,"returnGeometryEnabled",null),e([_()],ue.prototype,"returnMEnabled",null),e([_()],ue.prototype,"returnZEnabled",null),e([_()],ue.prototype,"selectionSource",void 0),e([_()],ue.prototype,"showAllRelatedTables",null),e([_()],ue.prototype,"showPrompt",null),e([_()],ue.prototype,"showRelatedTableCallback",void 0),e([_({readOnly:!0,type:K})],ue.prototype,"store",void 0),e([_()],ue.prototype,"supportsAttachments",null),e([_()],ue.prototype,"supportsAddAttachments",null),e([_()],ue.prototype,"supportsDeleteAttachments",null),e([_()],ue.prototype,"supportsResizeAttachments",null),e([_()],ue.prototype,"supportsUpdateAttachments",null),e([_()],ue.prototype,"syncTemplateOnChangesEnabled",void 0),e([_()],ue.prototype,"tableController",void 0),e([_()],ue.prototype,"tableParent",void 0),e([_({type:Y})],ue.prototype,"tableTemplate",void 0),e([_()],ue.prototype,"tableTemplateOverride",void 0),e([_()],ue.prototype,"timeExtent",null),e([_()],ue.prototype,"timeZone",null),e([_()],ue.prototype,"view",null),ue=e([C("esri.widgets.FeatureTable.FeatureTableViewModel")],ue);const ge=ue;export{ge as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as i}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as o,watch as n}from"../../../core/reactiveUtils.js";import{renderingSanitizer as l}from"../../../core/sanitizerUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../Widget.js";import h from"./GridViewModel.js";import{globalCss as u}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as m}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const c="esri-grid",p="compact column-borders",_={base:c,content:`${c}__content`,grid:`${c}__grid`,noDataMessage:`${c}__no-data-message`},f={sort:["Enter"," "]};let v=class extends a{constructor(e,t){super(e,t),this._columnElements=[],this._grid=null,this._temporaryHighlightId=null,this.itemIdPath="objectId",this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new h,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on("before-changes",()=>this.renderNow()),this.columns.on("change",()=>this.onColumnChange()),o(()=>this.highlightIds,"before-add",({target:e})=>{!this.multipleSelectionEnabled&&e.length&&e.removeAll()}),this.rowHighlightIds.on("change",()=>this.generateCellPartNames()),n(()=>this.effectiveSize,()=>this._updateGridSize()),n(()=>this.isEditing,()=>{this.generateCellPartNames(),this.requestContentUpdate()}),n(()=>this.store?.state,(e,t)=>{"ready"!==e||"loaded"!==t&&"error"!==t||this.refreshPageCache()}),o(()=>this._table,"scroll",()=>this.viewModel.closeColumnMenus()),i(window,"resize",()=>this._updateColumnBorderStyles()),o(()=>this._table,"scrollend",()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex()),this._updateColumnBorderStyles()}),n(()=>this.multipleSelectionEnabled,e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()})])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}get _columnRendering(){return this.columnPerformanceModeEnabled?"lazy":"eager"}get _selectedItems(){const{highlightIds:e,store:t}=this;return e.toArray().map(e=>t?.getItemByObjectId(e)??{objectId:e})}get _gridIsDisabled(){return 0===this.viewModel.allVisibleColumns.length||this.hasInvalidColumnConfiguration}get _noDataMessage(){return l.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=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 dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this._temporaryHighlightId}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",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 noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=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 rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter(e=>!!e&&e.path).map(({direction:e,path:t})=>({direction:e,path:t})):[]}get store(){return this.viewModel.store}set store(e){this.viewModel.store=e}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange("sortOrders")}getColumnProps(e,t){const{id:i}=this,{autoWidth:r,direction:o,fieldName:n,flexGrow:l,frozen:s,frozenToEnd:d,hidden:a,label:h,resizable:u,textAlign:g,width:m}=e,c=`${i}_${n}_${t}`,{renderFunction:p,footerRenderFunction:_,headerRenderFunction:f}=e,v=_?(e,t)=>_({root:e,column:t}):void 0,y=f?(e,t)=>f({root:e,column:t}):void 0,C=p?(e,t,i)=>p({root:e,column:t,rowData:i}):void 0;let w="";return e.direction&&(w+=" direction"),e.invalid&&(w+=" invalid"),{footerRenderer:v,headerRenderer:y,renderer:C,autoWidth:r,direction:o,flexGrow:l,frozen:s,frozenToEnd:d,headerPartName:w,key:c,resizable:u,bind:this,"data-fieldName":n,header:h,hidden:this.hasInvalidColumnConfiguration||a,path:n,"text-align":g,width:"number"==typeof m?`${m}px`:m,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;if(this._grid){if(this._grid._sorters?.length&&(this._grid._sorters.forEach(e=>{e._order=null,e.direction=null}),e=!0),this.columns.length){this.columns.some(e=>!!e.direction)&&(this.columns.forEach(e=>e.direction=null),e=!0)}e&&(this.notifyChange("sortOrders"),this.scheduleRender())}}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),this.store?.reset(),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this._temporaryHighlightId=null}requestContentUpdate(){this._grid?.requestContentUpdate(),this._temporaryHighlightId=null}selectRows(e){const{itemIdPath:t}=this,i=e?.filter(e=>!this.highlightIds.includes(e[t])),r=i.map(e=>e[t]);r.length&&(this.multipleSelectionEnabled||(this.highlightIds.removeAll(),r.splice(1)),this.highlightIds.addMany(r))}deselectRows(e){const{itemIdPath:t}=this,i=e?.map(e=>e[t])||[];i.length&&this.highlightIds.removeMany(i)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange("sortOrders")}scrollToIndex(e){0!==this.size&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this._temporaryHighlightId=null)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){const{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach(e=>this._applyRenderersToColumnElement(e)),this.requestContentUpdate()}render(){return m("div",{bind:this,class:this.classes(_.base,u.widget)},m("div",{bind:this,class:_.content},this._renderGrid()))}_renderGrid(){return m("vaadin-grid",{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:_.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,disabled:this._gridIsDisabled,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,multiSortPriority:this.multipleSortPriority,pageSize:this.pageSize,ref:"grid",rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return"disabled"!==this.state&&this.columns.length?[this._renderSelectionColumn(),this._renderColumns()]:null}_renderSelectionColumn(){return m("vaadin-grid-selection-column",{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:"center"})}_renderColumns(){return Array.from(this.columns,(e,t)=>"columns"in e?this._renderGroupColumn(e,t):m("vaadin-grid-column",{...this.getColumnProps(e,t)})).filter(t)}_renderGroupColumn(e,t){const i=this.getColumnProps(e,t);if(i.hidden||!e.columns)return null;const r=e.columns.filter(({hidden:e})=>!e);return r.length?m("vaadin-grid-column-group",{...i},r.map(e=>m("vaadin-grid-column",{...this.getColumnProps(e,t)}))):null}_renderEmptyState(){const e=this.viewModel;if("loaded"===e.state&&!e.isQueryingOrSyncing)return m("div",{class:_.noDataMessage,slot:"empty-state"},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){const t=this._grid=e;t.setAttribute("theme",p),customElements.whenDefined("vaadin-grid").then(()=>{this._appendStyles(),this._addGridEventListeners()}),t.__updateSorter=(e,i,r)=>{const o=t._sorters,n=!o.includes(e),{multiSort:l,multiSortOnShiftClick:s,multiSortPriority:d}=t,a=o.filter(t=>t!==e),h=l&&(!s||!r)||s&&i;e._order=null,e.direction?h?null!=e._initialOrder?(n?o[e._initialOrder]=e:o.splice(e._initialOrder,0,e),e._initialOrder=null):"append"===d&&n?t._sorters=[...a,e]:"prepend"===d&&(t._sorters=[e,...a]):(e.direction||s)&&(t._sorters=e.direction?[e]:[],a.forEach(e=>{e._order=null,e.direction=null})):n||(t._sorters=[...a])},t.__removeSorters=e=>{if(0===e.length)return;const i=new Set(e.filter(e=>!e.direction));t._sorters=t._sorters.filter(e=>!i.has(e)),t.__applySorters()}}_appendStyles(){const e=this._grid?.shadowRoot,t=document.createElement("style");e&&(t.textContent='\n #items [part~="row"][editing],\n #items [part~="row"][editing][selected] {\n z-index: 2;\n }\n\n #items [part~="editing"],\n #items [part~="editing"][selected] {\n z-index: 3;\n }\n\n [frozen], [frozen-to-end] {\n z-index: 4;\n }\n\n [last-frozen] {\n overflow: visible;\n }\n\n [part~=\'cell\'] ::slotted(vaadin-grid-cell-content) {\n align-items: center;\n box-sizing: border-box !important;\n height: 100%;\n line-height: 2em;\n min-height: 40px;\n }\n\n #items [part~="text-wrap"] {\n text-wrap: wrap;\n }\n ',e.appendChild(t))}_afterGridUpdate(e){this._grid||(this._grid=e)}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){const t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){const e=this._grid;r(e),this.addHandles([i(e,["click","dblclick","keydown","pointerover","pointerout"],e=>this._onGridInteraction(e)),i(e,["pointerover","pointerout","cell-focus"],e=>this._onTransientGridInteraction(e)),i(e,"selected-items-changed",this._onSelectedItemsChange),i(e,"sorter-changed",()=>{this.notifyChange("sortOrders"),this._updateColumnBorderStyles()}),i(e,"column-resize",e=>{const t=e.detail.resizedColumn,i=t.getAttribute("data-fieldName"),r=this.findColumn(i);r?.set({width:t.width}),this._updateColumnBorderStyles()}),i(e,"column-reorder",()=>this._onColumnOrderChange())])}_onGridInteraction(e){const t=this._grid;if(r(t),("pointerover"===e.type||"pointerout"===e.type)&&e.relatedTarget!==t){const{target:t,relatedTarget:i}=e;if(!this._isGridCellContentNode(t)||!this._isGridCellContentNode(i))return}let i=null;try{i=t.getEventContext(e)}catch(a){}if(!i)return;const{column:o,index:n,item:l,section:s}=i;if(!s)return;if("header"===s&&"keydown"===e.type&&o?.path){const t=e.key;f.sort.includes(t)&&this.findColumn(o.path)?.sort()}const d=`cell-${e.type}`;this.emit(d,{type:d,context:i,index:n,item:l,native:e,path:o?.path??void 0})}_onTransientGridInteraction(e){if("pointerout"===e.type)return void(this._temporaryHighlightId=null);const t=this._grid;if(t)try{const{item:i}=t.getEventContext(e);this._temporaryHighlightId=i?.objectId}catch{this._temporaryHighlightId=null}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&"vaadin-grid-cell-content"===e.localName)}_onColumnOrderChange(){const e=this._grid;r(e);const t=e._getColumnsInOrder(0),i=[],o=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map(e=>e.getAttribute("data-fieldName"));t?.forEach(e=>{const t=e.getAttribute("data-fieldName");if(null!=t){const e=this.findColumn(t);i.push(t),e&&"columns"in e&&e.columns?.length&&e.columns.sort((e,t)=>o.indexOf(e.fieldName)>o.indexOf(t.fieldName)?1:-1)}}),this.columns.sort((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1),this.notifyChange("sortOrders"),this.emit("column-reorder",{type:"column-reorder"})}_clearSelection(){this.highlightIds.removeAll(),this._temporaryHighlightId=null}_onSelectedItemsChange(e){const{highlightIds:t,itemIdPath:i}=this,r=e.detail.value.map(e=>e[i]),o=r.filter(e=>!t.includes(e));if(!this.multipleSelectionEnabled&&o.length&&t.length)t.removeAll(),t.add(o[0]);else{const e=t.filter(e=>!r.includes(e));t.removeMany(e),t.addMany(o)}}_applyRenderersToColumnElement(e){const t=e?.path,i=null!=t?this.findColumn(t):void 0;if(i)try{const{renderFunction:t,footerRenderFunction:r,headerRenderFunction:o}=i;t&&"renderer"in e&&(e.renderer=(e,i,r)=>t({root:e,column:i,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),o&&(e.headerRenderer=(e,t)=>o({root:e,column:t}))}catch(r){}}_updateColumnBorderStyles(){try{this._grid?._updateFirstAndLastColumn()}catch(e){}}};e([s()],v.prototype,"_columnElements",void 0),e([s()],v.prototype,"_columnRendering",null),e([s()],v.prototype,"_selectedItems",null),e([s()],v.prototype,"_grid",void 0),e([s()],v.prototype,"_gridIsDisabled",null),e([s()],v.prototype,"_noDataMessage",null),e([s()],v.prototype,"_table",null),e([s()],v.prototype,"_temporaryHighlightId",void 0),e([s()],v.prototype,"cellPartNameGenerator",null),e([s()],v.prototype,"columns",null),e([s()],v.prototype,"columnPerformanceModeEnabled",null),e([s()],v.prototype,"columnReorderingEnabled",null),e([s()],v.prototype,"dataProvider",null),e([s()],v.prototype,"editingEnabled",null),e([s()],v.prototype,"effectiveSize",null),e([s()],v.prototype,"groupColumns",null),e([s()],v.prototype,"hasInvalidColumnConfiguration",null),e([s()],v.prototype,"highlightIds",null),e([s()],v.prototype,"temporaryHighlightId",null),e([s()],v.prototype,"isEditing",null),e([s()],v.prototype,"isReady",null),e([s()],v.prototype,"itemIdPath",void 0),e([s()],v.prototype,"label",null),e([s(),g("esri/widgets/FeatureTable/t9n/FeatureTable")],v.prototype,"messages",void 0),e([s()],v.prototype,"multipleSelectionEnabled",null),e([s()],v.prototype,"multiSortEnabled",null),e([s()],v.prototype,"noDataMessage",null),e([s()],v.prototype,"pageIndex",null),e([s()],v.prototype,"multipleSortPriority",null),e([s()],v.prototype,"pageSize",null),e([s()],v.prototype,"paginationEnabled",null),e([s()],v.prototype,"rowDetailsRenderer",null),e([s()],v.prototype,"rowHighlightIds",null),e([s()],v.prototype,"selectionColumnEnabled",void 0),e([s()],v.prototype,"size",null),e([s({readOnly:!0})],v.prototype,"sortOrders",null),e([s()],v.prototype,"store",null),e([s()],v.prototype,"state",null),e([s()],v.prototype,"viewModel",void 0),v=e([d("esri.widgets.FeatureTable.Grid.Grid")],v);const y=v;export{y as default};
5
+ import{__decorate as e}from"tslib";import"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as i}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as n,watch as o}from"../../../core/reactiveUtils.js";import{renderingSanitizer as l}from"../../../core/sanitizerUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../../Widget.js";import h from"./GridViewModel.js";import{globalCss as u}from"../../support/globalCss.js";import{messageBundle as g,tsx as m}from"../../support/widget.js";const c="esri-grid",p="compact column-borders",_={base:c,content:`${c}__content`,grid:`${c}__grid`,noDataMessage:`${c}__no-data-message`},f={sort:["Enter"," "]};let v=class extends a{constructor(e,t){super(e,t),this._columnElements=[],this._grid=null,this._temporaryHighlightId=null,this.itemIdPath="objectId",this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new h,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on("before-changes",()=>this.renderNow()),this.columns.on("change",()=>this.onColumnChange()),n(()=>this.highlightIds,"before-add",({target:e})=>{!this.multipleSelectionEnabled&&e.length&&e.removeAll()}),this.rowHighlightIds.on("change",()=>this.generateCellPartNames()),o(()=>this.effectiveSize,()=>this._updateGridSize()),o(()=>this.isEditing,()=>{this.generateCellPartNames(),this.requestContentUpdate()}),o(()=>this.store?.state,(e,t)=>{"ready"!==e||"loaded"!==t&&"error"!==t||this.refreshPageCache()}),n(()=>this._table,"scroll",()=>this.viewModel.closeColumnMenus()),i(window,"resize",()=>this._updateColumnBorderStyles()),n(()=>this._table,"scrollend",()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex()),this._updateColumnBorderStyles()}),o(()=>this.multipleSelectionEnabled,e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()})])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain(e=>!e.destroyed&&e.destroy())}get _columnRendering(){return this.columnPerformanceModeEnabled?"lazy":"eager"}get _selectedItems(){const{highlightIds:e,store:t}=this;return e.toArray().map(e=>t?.getItemByObjectId(e)??{objectId:e})}get _gridIsDisabled(){return 0===this.viewModel.allVisibleColumns.length||this.hasInvalidColumnConfiguration}get _noDataMessage(){return l.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=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 dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this._temporaryHighlightId}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",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 noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=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 rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter(e=>!!e&&e.path).map(({direction:e,path:t})=>({direction:e,path:t})):[]}get store(){return this.viewModel.store}set store(e){this.viewModel.store=e}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange("sortOrders")}getColumnProps(e,t){const{id:i}=this,{autoWidth:r,direction:n,fieldName:o,flexGrow:l,frozen:s,frozenToEnd:d,hidden:a,label:h,resizable:u,textAlign:g,width:m}=e,c=`${i}_${o}_${t}`,{renderFunction:p,footerRenderFunction:_,headerRenderFunction:f}=e,v=_?(e,t)=>_({root:e,column:t}):void 0,y=f?(e,t)=>f({root:e,column:t}):void 0,C=p?(e,t,i)=>p({root:e,column:t,rowData:i}):void 0;let w="";return e.direction&&(w+=" direction"),e.invalid&&(w+=" invalid"),{footerRenderer:v,headerRenderer:y,renderer:C,autoWidth:r,direction:n,flexGrow:l,frozen:s,frozenToEnd:d,headerPartName:w,key:c,resizable:u,bind:this,"data-fieldName":o,header:h,hidden:this.hasInvalidColumnConfiguration||a,path:o,"text-align":g,width:"number"==typeof m?`${m}px`:m,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;if(this._grid){if(this._grid._sorters?.length&&(this._grid._sorters.forEach(e=>{e._order=null,e.direction=null}),e=!0),this.columns.length){this.columns.some(e=>!!e.direction)&&(this.columns.forEach(e=>e.direction=null),e=!0)}e&&(this.notifyChange("sortOrders"),this.scheduleRender())}}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),this.store?.reset(),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this._temporaryHighlightId=null}requestContentUpdate(){this._grid?.requestContentUpdate(),this._temporaryHighlightId=null}selectRows(e){const{itemIdPath:t}=this,i=e?.filter(e=>!this.highlightIds.includes(e[t])),r=i.map(e=>e[t]);r.length&&(this.multipleSelectionEnabled||(this.highlightIds.removeAll(),r.splice(1)),this.highlightIds.addMany(r))}deselectRows(e){const{itemIdPath:t}=this,i=e?.map(e=>e[t])||[];i.length&&this.highlightIds.removeMany(i)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange("sortOrders")}scrollToIndex(e){0!==this.size&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this._temporaryHighlightId=null)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){const{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach(e=>this._applyRenderersToColumnElement(e)),this.requestContentUpdate()}render(){return m("div",{bind:this,class:this.classes(_.base,u.widget)},m("div",{bind:this,class:_.content},this._renderGrid()))}_renderGrid(){return m("vaadin-grid",{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:_.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,disabled:this._gridIsDisabled,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,multiSortPriority:this.multipleSortPriority,pageSize:this.pageSize,ref:"grid",rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return"disabled"!==this.state&&this.columns.length?[this._renderSelectionColumn(),this._renderColumns()]:null}_renderSelectionColumn(){return m("vaadin-grid-selection-column",{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:"center"})}_renderColumns(){return Array.from(this.columns,(e,t)=>"columns"in e?this._renderGroupColumn(e,t):m("vaadin-grid-column",{...this.getColumnProps(e,t)})).filter(t)}_renderGroupColumn(e,t){const i=this.getColumnProps(e,t);if(i.hidden||!e.columns)return null;const r=e.columns.filter(({hidden:e})=>!e);return r.length?m("vaadin-grid-column-group",{...i},r.map(e=>m("vaadin-grid-column",{...this.getColumnProps(e,t)}))):null}_renderEmptyState(){const e=this.viewModel;if("loaded"===e.state&&!e.isQueryingOrSyncing)return m("div",{class:_.noDataMessage,slot:"empty-state"},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){const t=this._grid=e;t.setAttribute("theme",p),customElements.whenDefined("vaadin-grid").then(()=>{this._appendStyles(),this._addGridEventListeners()}),t.__updateSorter=(e,i,r)=>{const n=t._sorters,o=!n.includes(e),{multiSort:l,multiSortOnShiftClick:s,multiSortPriority:d}=t,a=n.filter(t=>t!==e),h=l&&(!s||!r)||s&&i;e._order=null,e.direction?h?null!=e._initialOrder?(o?n[e._initialOrder]=e:n.splice(e._initialOrder,0,e),e._initialOrder=null):"append"===d&&o?t._sorters=[...a,e]:"prepend"===d&&(t._sorters=[e,...a]):(e.direction||s)&&(t._sorters=e.direction?[e]:[],a.forEach(e=>{e._order=null,e.direction=null})):o||(t._sorters=[...a])},t.__removeSorters=e=>{if(0===e.length)return;const i=new Set(e.filter(e=>!e.direction));t._sorters=t._sorters.filter(e=>!i.has(e)),t.__applySorters()}}_appendStyles(){const e=this._grid?.shadowRoot,t=document.createElement("style");e&&(t.textContent='\n #items [part~="row"][editing],\n #items [part~="row"][editing][selected] {\n z-index: 2;\n }\n\n #items [part~="editing"],\n #items [part~="editing"][selected] {\n z-index: 3;\n }\n\n [frozen], [frozen-to-end] {\n z-index: 4;\n }\n\n [last-frozen] {\n overflow: visible;\n }\n\n [part~=\'cell\'] ::slotted(vaadin-grid-cell-content) {\n align-items: center;\n box-sizing: border-box !important;\n height: 100%;\n line-height: 2em;\n min-height: 40px;\n }\n\n #items [part~="text-wrap"] {\n text-wrap: wrap;\n }\n ',e.appendChild(t))}_afterGridUpdate(e){this._grid||(this._grid=e)}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){const t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){const e=this._grid;r(e),this.addHandles([i(e,["click","dblclick","keydown","pointerover","pointerout"],e=>this._onGridInteraction(e)),i(e,["pointerover","pointerout","cell-focus"],e=>this._onTransientGridInteraction(e)),i(e,"selected-items-changed",this._onSelectedItemsChange),i(e,"sorter-changed",()=>{this.notifyChange("sortOrders"),this._updateColumnBorderStyles()}),i(e,"column-resize",e=>{const t=e.detail.resizedColumn,i=t.getAttribute("data-fieldName"),r=this.findColumn(i);r?.set({width:t.width}),this._updateColumnBorderStyles()}),i(e,"column-reorder",()=>this._onColumnOrderChange())])}_onGridInteraction(e){const t=this._grid;if(r(t),("pointerover"===e.type||"pointerout"===e.type)&&e.relatedTarget!==t){const{target:t,relatedTarget:i}=e;if(!this._isGridCellContentNode(t)||!this._isGridCellContentNode(i))return}let i=null;try{i=t.getEventContext(e)}catch(a){}if(!i)return;const{column:n,index:o,item:l,section:s}=i;if(!s)return;if("header"===s&&"keydown"===e.type&&n?.path){const t=e.key;f.sort.includes(t)&&this.findColumn(n.path)?.sort()}const d=`cell-${e.type}`;this.emit(d,{type:d,context:i,index:o,item:l,native:e,path:n?.path??void 0})}_onTransientGridInteraction(e){if("pointerout"===e.type)return void(this._temporaryHighlightId=null);const t=this._grid;if(t)try{const{item:i}=t.getEventContext(e);this._temporaryHighlightId=i?.objectId}catch{this._temporaryHighlightId=null}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&"vaadin-grid-cell-content"===e.localName)}_onColumnOrderChange(){const e=this._grid;r(e);const t=e._getColumnsInOrder(0),i=[],n=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map(e=>e.getAttribute("data-fieldName"));t?.forEach(e=>{const t=e.getAttribute("data-fieldName");if(null!=t){const e=this.findColumn(t);i.push(t),e&&"columns"in e&&e.columns?.length&&e.columns.sort((e,t)=>n.indexOf(e.fieldName)>n.indexOf(t.fieldName)?1:-1)}}),this.columns.sort((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1),this.notifyChange("sortOrders"),this.emit("column-reorder",{type:"column-reorder"})}_clearSelection(){this.highlightIds.removeAll(),this._temporaryHighlightId=null}_onSelectedItemsChange(e){const{highlightIds:t,itemIdPath:i}=this,r=e.detail.value.map(e=>e[i]),n=r.filter(e=>!t.includes(e));if(!this.multipleSelectionEnabled&&n.length&&t.length)t.removeAll(),t.add(n[0]);else{const e=t.filter(e=>!r.includes(e));t.removeMany(e),t.addMany(n)}}_applyRenderersToColumnElement(e){const t=e?.path,i=null!=t?this.findColumn(t):void 0;if(i)try{const{renderFunction:t,footerRenderFunction:r,headerRenderFunction:n}=i;t&&"renderer"in e&&(e.renderer=(e,i,r)=>t({root:e,column:i,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),n&&(e.headerRenderer=(e,t)=>n({root:e,column:t}))}catch(r){}}_updateColumnBorderStyles(){try{this._grid?._updateFirstAndLastColumn()}catch(e){}}};e([s()],v.prototype,"_columnElements",void 0),e([s()],v.prototype,"_columnRendering",null),e([s()],v.prototype,"_selectedItems",null),e([s()],v.prototype,"_grid",void 0),e([s()],v.prototype,"_gridIsDisabled",null),e([s()],v.prototype,"_noDataMessage",null),e([s()],v.prototype,"_table",null),e([s()],v.prototype,"_temporaryHighlightId",void 0),e([s()],v.prototype,"cellPartNameGenerator",null),e([s()],v.prototype,"columns",null),e([s()],v.prototype,"columnPerformanceModeEnabled",null),e([s()],v.prototype,"columnReorderingEnabled",null),e([s()],v.prototype,"dataProvider",null),e([s()],v.prototype,"editingEnabled",null),e([s()],v.prototype,"effectiveSize",null),e([s()],v.prototype,"groupColumns",null),e([s()],v.prototype,"hasInvalidColumnConfiguration",null),e([s()],v.prototype,"highlightIds",null),e([s()],v.prototype,"temporaryHighlightId",null),e([s()],v.prototype,"isEditing",null),e([s()],v.prototype,"isReady",null),e([s()],v.prototype,"itemIdPath",void 0),e([s()],v.prototype,"label",null),e([s(),g("esri/widgets/FeatureTable/t9n/FeatureTable")],v.prototype,"messages",void 0),e([s()],v.prototype,"multipleSelectionEnabled",null),e([s()],v.prototype,"multiSortEnabled",null),e([s()],v.prototype,"noDataMessage",null),e([s()],v.prototype,"pageIndex",null),e([s()],v.prototype,"multipleSortPriority",null),e([s()],v.prototype,"pageSize",null),e([s()],v.prototype,"paginationEnabled",null),e([s()],v.prototype,"rowDetailsRenderer",null),e([s()],v.prototype,"rowHighlightIds",null),e([s()],v.prototype,"selectionColumnEnabled",void 0),e([s()],v.prototype,"size",null),e([s({readOnly:!0})],v.prototype,"sortOrders",null),e([s()],v.prototype,"store",null),e([s()],v.prototype,"state",null),e([s()],v.prototype,"viewModel",void 0),v=e([d("esri.widgets.FeatureTable.Grid.Grid")],v);const y=v;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{watch as i,on as l,sync as o,initial as n}from"../core/reactiveUtils.js";import{renderingSanitizer as s}from"../core/sanitizerUtils.js";import{formatFileSize as a}from"../core/unitFormatUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as d}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as h,isMapImageLayer as m,isSubtypeGroupLayer as p}from"../layers/support/layerUtils.js";import u from"../tables/AttributeTableTemplate.js";import g from"./Widget.js";import{isSupportedImage as w,getCalciteIconForAttachment as b}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as v,Prompt as y}from"./Editor/components/Prompt.js";import f from"./FeatureTable/ColumnMenuVisibleElements.js";import _ from"./FeatureTable/FeatureTableViewModel.js";import M from"./FeatureTable/VisibleElements.js";import{isGroupColumn as C}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as A,isIFeatureTableSupportedLayer as S,isIFeatureTableSupportedLayerWithAttachments as T,getRelationshipIdsToShow as E}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import{getIconForLayer as R}from"./support/iconUtils.js";import{storeNode as k,discardNode as x}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as F}from"../intl/substitute.js";var j;const z="esri-feature-table",L=`${z}__attachments-view`,U={base:z,content:`${z}__content`,menuPopover:`${z}__menu-popover`,layerDropdownMenu:`${z}__layer-switcher-menu`,tableContainer:`${z}__table-container`,tableContainerWithAttachments:`${z}__table-container--attachments`,tableNavigation:`${z}__table-navigation`,attachmentsView:L,attachmentsViewContent:`${L}__content`,attachmentsViewDropArea:`${L}__drop-area`,attachmentsViewIcon:`${L}__icon`,attachmentsViewInformation:`${L}__information`,attachmentsViewList:`${L}__list`,attachmentsViewListFileSize:`${L}__list__filesize`,attachmentsViewListItemDelete:`${L}__list-item--delete`,attachmentsViewListThumbnail:`${L}__list__thumbnail`,expanded:`${z}__expanded`,collapsed:`${z}__collapsed`},$={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 B=j=class extends g{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 _,this.visibleElements=new M,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),i(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),i(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},n),l(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),i(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([V({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(),A()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?s.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(S):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,size:n}=this;if(o)return s.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":case"loading":return t.loading;case"error":return t.errorData}return F(t.header,{title:s.sanitize(e.title),count:n,selected:l.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=>{!S(e)||p(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{d(e)||"catalog-footprint"===e.type||(h(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):m(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):p(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}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 M({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 f({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 M({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new f({sortAscending:c,sortDescending:c})})}return a?new M({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 f({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 O("div",{bind:this,class:this.classes(U.base,I.widget)},O("calcite-panel",{bind:this,class:U.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?O("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(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return O("div",{class:i},O("calcite-panel",{overlayPositioning:"fixed"},O("div",null,[this._shouldShowGrid?O("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return O("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?O("div",{class:i},O("calcite-panel",{overlayPositioning:"fixed"},O("div",null,[O("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[O("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return O("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 O("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:$.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},O("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?O(y,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=F(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,t){const{messages:i,messagesCommon:l}=this,o=F(i.deleteAttachmentCount,{count:t.length});this.showPrompt({title:o,message:i.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:l.delete,action:async()=>{try{await this.deleteAttachments(e,t,!1)}finally{this.clearPrompt()}}},secondary:{label:l.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 O("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:$.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:$.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:$.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:$.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:$.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:$.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:$.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(t).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 O("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:$.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?O("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 O("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},O("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=C(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 O("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 O("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},O("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},O("calcite-action",{icon:$.layers,slot:"trigger",text:e,title:e}),O("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return O("calcite-dropdown-item",{iconStart:i?R(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&&T(a),m=new j({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:E(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:r,objectId:c}=e,d=s.find(e=>e.id===n),h=s.length,m=r?.length,p=d?O("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=m?void 0:O("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(r??[]).pop(),w=g?O("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&m,y=O("input",{afterCreate:k,afterRemoved:x,afterUpdate:k,bind:this,"data-node-ref":"_attachmentsInput",files:r,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?O("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:$.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?O("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:$.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||m?O("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[O("div",{class:U.attachmentsView,key:"attachments-view"},O("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},O("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},O("calcite-icon",{class:U.attachmentsViewIcon,icon:$.upload,scale:"l"}),p,u,O("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},O("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?O("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),O("label",{key:"file-label"},l.fileName),O("span",{key:"file-span"},d.name),O("label",{key:"size-label"},l.size),O("span",{key:"size-span"},a(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:s,objectId:r}=e;return O("calcite-list",{afterCreate:k,afterRemoved:x,afterUpdate:k,bind:this,class:U.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${r}`,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=a(l,d??0);return O("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),O("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:m},m),O("calcite-action",{appearance:"transparent",icon:$.downloadTo,key:`download-attachment-${s}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(r??-1,s)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=r?O("calcite-action",{appearance:"transparent",disabled:!n,icon:$.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,O("calcite-action",{appearance:"transparent",icon:$.launch,key:`launch-attachment-${s}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=r?O("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:$.delete,key:`delete-attachment-${s}`,label:`${c}`,onclick:()=>{this.deleteAttachments(r,[s],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)}))}_renderAttachmentsViewListThumbnail(e){return O("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},O("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&&w(i)?O("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):O("calcite-icon",{icon:b(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:t,messagesCommon:i,navigationScale:l,relatedTable:o,relatedTables:n}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:s,attachmentsViewOptions:a,layer:r,supportsAddAttachments:c,supportsDeleteAttachments:d}=e;if(!r)return;const{attachmentInfos:h,objectId:m}=a,p=null!=m,u=h.length,g=s?.selectedItems?.length??0,w=`${r.objectIdField}: ${m}`,b=F(t.selectedCount,{count:g}),v=F(t.attachmentsCount,{count:u}),y=p?O("calcite-action",{bind:this,icon:$.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(m),scale:l,text:w,textEnabled:!0,title:w}):void 0,f=p?O("calcite-action",{icon:$.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:v,onclick:()=>{u>0&&(a.mode="list")},scale:l,text:v,textEnabled:!0,title:v}):void 0,_=p?O("calcite-chip",{closable:!0,closed:0===g,key:"navigation-chip",kind:"inverse",label:b,scale:l,selected:!0,title:b,value:"selected",onCalciteChipClose:()=>s?.selectedItems?.forEach(e=>e.selected=!1)},b):void 0,M=o?O("calcite-label",{layout:"inline",scale:l},t.showAllTables,O("calcite-switch",{checked:this.allRelatedTablesVisible,scale:l,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,C=p&&"list"===a.mode&&null!=m&&g&&d?O("calcite-action",{icon:$.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(m,s?.selectedItems?.map(e=>e.value)??[],!0)},scale:l,text:i.delete,textEnabled:!0,title:F(t.deleteAttachmentCount,{count:g})}):void 0,A=p&&"list"===a.mode&&c?O("calcite-action",{bind:this,icon:$.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{a.attachmentId=null,a.mode="file"},scale:l,text:t.addAttachment,textEnabled:!0,title:t.addAttachment}):void 0;return O("div",{class:U.tableNavigation,key:"table-nav"},O("calcite-action",{icon:$.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{o&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},scale:l,text:this.layer?.title??"",textEnabled:!1,title:o?t.exitRelatedRecords:t.exitAttachments}),n.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),y,f,O("div",null,_,M,C,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return O("calcite-action",{icon:$.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([r()],B.prototype,"_attachmentsInput",void 0),e([r()],B.prototype,"_columnVisibilityActions",void 0),e([r()],B.prototype,"_effectiveDescription",null),e([r()],B.prototype,"_effectiveLayers",null),e([r()],B.prototype,"_effectiveTitle",null),e([r()],B.prototype,"_effectiveVisibleElements",null),e([r()],B.prototype,"_filteredTables",null),e([r()],B.prototype,"_hasAttachmentsViewError",null),e([r()],B.prototype,"_hasCustomMenuItems",null),e([r()],B.prototype,"_hasDefaultMenuItems",null),e([r()],B.prototype,"_shouldShowGrid",null),e([r()],B.prototype,"_shouldShowMenu",null),e([r()],B.prototype,"_shouldShowAttachmentsView",null),e([r()],B.prototype,"_showClearSelectionAction",null),e([r()],B.prototype,"_showColumnsVisibilityAction",null),e([r()],B.prototype,"_showDeleteSelectionAction",null),e([r()],B.prototype,"_showExportSelectionToCSVAction",null),e([r()],B.prototype,"_showLayerDropdown",null),e([r()],B.prototype,"_shouldShowNavigationBar",null),e([r()],B.prototype,"_showRefreshDataAction",null),e([r()],B.prototype,"_showSelectedRecordsShowSelectedAction",null),e([r()],B.prototype,"_showSelectedRecordsShowAllAction",null),e([r()],B.prototype,"_showZoomToSelectionAction",null),e([r()],B.prototype,"_viewLayers",null),e([r()],B.prototype,"attachmentsList",void 0),e([r({readOnly:!0})],B.prototype,"grid",null),e([r()],B.prototype,"actionColumn",null),e([r()],B.prototype,"actionColumnConfig",null),e([r({readOnly:!0})],B.prototype,"activeFilters",null),e([r({readOnly:!0})],B.prototype,"activeSortOrders",null),e([r()],B.prototype,"allColumns",null),e([r({readOnly:!0})],B.prototype,"allRelatedTablesVisible",null),e([r()],B.prototype,"allVisibleColumns",null),e([r()],B.prototype,"attachmentsColumns",null),e([r()],B.prototype,"attachmentsEnabled",null),e([r()],B.prototype,"attachmentsViewOptions",null),e([r({type:u})],B.prototype,"attributeTableTemplate",null),e([r()],B.prototype,"autoRefreshEnabled",null),e([r()],B.prototype,"clearPrompt",null),e([r()],B.prototype,"columnPerformanceModeEnabled",null),e([r()],B.prototype,"columnReorderingEnabled",null),e([r({readOnly:!0})],B.prototype,"columns",null),e([r()],B.prototype,"definitionExpression",null),e([r()],B.prototype,"description",void 0),e([r()],B.prototype,"disabled",void 0),e([r()],B.prototype,"editingEnabled",null),e([r()],B.prototype,"effectiveSize",null),e([r()],B.prototype,"effectiveTable",null),e([r()],B.prototype,"fieldColumns",null),e([r()],B.prototype,"filterGeometry",null),e([r()],B.prototype,"filterBySelectionEnabled",null),e([r()],B.prototype,"groupColumns",null),e([r()],B.prototype,"hiddenFields",null),e([r()],B.prototype,"highlightEnabled",null),e([r()],B.prototype,"highlightIds",null),e([r()],B.prototype,"icon",null),e([r()],B.prototype,"initialSize",null),e([r()],B.prototype,"isQueryingOrSyncing",null),e([r()],B.prototype,"isSyncingAttachments",null),e([r()],B.prototype,"label",null),e([r()],B.prototype,"layer",null),e([r()],B.prototype,"layers",null),e([r()],B.prototype,"layerView",null),e([r()],B.prototype,"maxSize",null),e([r(),D("esri/widgets/FeatureTable/t9n/FeatureTable")],B.prototype,"messages",null),e([r(),D("esri/t9n/common")],B.prototype,"messagesCommon",null),e([r(),D("esri/core/t9n/Units")],B.prototype,"messagesUnits",null),e([r(),D("esri/widgets/support/t9n/uriUtils")],B.prototype,"messagesURIUtils",null),e([r()],B.prototype,"menuConfig",null),e([r()],B.prototype,"multipleSelectionEnabled",null),e([r()],B.prototype,"multiSortEnabled",null),e([r()],B.prototype,"multipleSortPriority",null),e([r()],B.prototype,"navigationScale",void 0),e([r()],B.prototype,"noDataMessage",null),e([r()],B.prototype,"objectIds",null),e([r()],B.prototype,"outFields",null),e([r()],B.prototype,"pageCount",null),e([r()],B.prototype,"pageIndex",null),e([r()],B.prototype,"pageSize",null),e([r()],B.prototype,"paginationEnabled",null),e([r()],B.prototype,"prompt",null),e([r()],B.prototype,"relatedRecordsEnabled",null),e([r()],B.prototype,"relatedTable",null),e([r()],B.prototype,"relatedTables",null),e([r()],B.prototype,"relationship",null),e([r()],B.prototype,"relationshipColumnConfigs",null),e([r()],B.prototype,"relationshipColumns",null),e([r()],B.prototype,"relationshipConfig",null),e([r()],B.prototype,"relationshipInfos",null),e([r()],B.prototype,"returnGeometryEnabled",null),e([r()],B.prototype,"returnMEnabled",null),e([r()],B.prototype,"returnZEnabled",null),e([r()],B.prototype,"rowHighlightIds",null),e([r()],B.prototype,"selectionSource",null),e([r()],B.prototype,"showAllRelatedTables",null),e([r()],B.prototype,"showPrompt",null),e([r()],B.prototype,"showRelatedTableCallback",null),e([r()],B.prototype,"size",null),e([r({readOnly:!0})],B.prototype,"state",null),e([r()],B.prototype,"supportsAddAttachments",null),e([r()],B.prototype,"supportsAttachments",null),e([r()],B.prototype,"supportsDeleteAttachments",null),e([r()],B.prototype,"supportsResizeAttachments",null),e([r()],B.prototype,"supportsUpdateAttachments",null),e([r()],B.prototype,"syncTemplateOnChangesEnabled",null),e([r({constructOnly:!0})],B.prototype,"tableController",null),e([r({constructOnly:!0})],B.prototype,"tableParent",null),e([r()],B.prototype,"tableTemplate",null),e([r()],B.prototype,"tableTemplateOverride",null),e([r()],B.prototype,"title",void 0),e([r()],B.prototype,"timeExtent",null),e([r()],B.prototype,"timeZone",null),e([r()],B.prototype,"view",null),e([r({type:_}),P(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],B.prototype,"viewModel",void 0),e([r()],B.prototype,"visibleColumns",null),e([r({type:M,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([r({type:M})],B.prototype,"visibleElementsOverride",null),B=j=e([c("esri.widgets.FeatureTable")],B);const N=B;export{N 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}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as h}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as m,isMapImageLayer as p,isSubtypeGroupLayer as u}from"../layers/support/layerUtils.js";import g from"../tables/AttributeTableTemplate.js";import w from"./Widget.js";import{isSupportedImage as b,getCalciteIconForAttachment as v}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as y,Prompt as f}from"./Editor/components/Prompt.js";import _ from"./FeatureTable/ColumnMenuVisibleElements.js";import M from"./FeatureTable/FeatureTableViewModel.js";import C from"./FeatureTable/VisibleElements.js";import{isGroupColumn as A}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as S,isIFeatureTableSupportedLayer as T,isIFeatureTableSupportedLayerWithAttachments as E,getRelationshipIdsToShow as V}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import{getIconForLayer as k}from"./support/iconUtils.js";import{messageBundle as x,vmEvent as D,tsx as P}from"./support/widget.js";import{storeNode as O,discardNode as F}from"./support/widgetUtils.js";var z;const L="esri-feature-table",j=`${L}__attachments-view`,U={base:L,content:`${L}__content`,menuPopover:`${L}__menu-popover`,layerDropdownMenu:`${L}__layer-switcher-menu`,tableContainer:`${L}__table-container`,tableContainerWithAttachments:`${L}__table-container--attachments`,tableNavigation:`${L}__table-navigation`,attachmentsView:j,attachmentsViewContent:`${j}__content`,attachmentsViewDropArea:`${j}__drop-area`,attachmentsViewIcon:`${j}__icon`,attachmentsViewInformation:`${j}__information`,attachmentsViewList:`${j}__list`,attachmentsViewListFileSize:`${j}__list__filesize`,attachmentsViewListItemDelete:`${j}__list-item--delete`,attachmentsViewListThumbnail:`${j}__list__thumbnail`,expanded:`${L}__expanded`,collapsed:`${L}__collapsed`},$={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 B=z=class extends w{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 M,this.visibleElements=new C,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([I({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")}),y(),S()])}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(T):[],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=>{!T(e)||u(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{h(e)||"catalog-footprint"===e.type||(m(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):p(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):u(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}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 C({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 _({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 C({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new _({sortAscending:c,sortDescending:c})})}return a?new C({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 _({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 P("div",{bind:this,class:this.classes(U.base,R.widget)},P("calcite-panel",{bind:this,class:U.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?P("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(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return P("div",{class:i},P("calcite-panel",{overlayPositioning:"fixed"},P("div",null,[this._shouldShowGrid?P("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return P("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?P("div",{class:i},P("calcite-panel",{overlayPositioning:"fixed"},P("div",null,[P("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[P("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return P("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 P("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:$.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},P("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?P(f,{...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 P("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:$.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:$.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:$.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:$.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:$.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:$.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:$.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 P("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:$.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?P("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 P("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},P("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=A(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 P("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 P("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},P("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},P("calcite-action",{icon:$.layers,slot:"trigger",text:e,title:e}),P("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return P("calcite-dropdown-item",{iconStart:i?k(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&&E(a),m=new z({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:V(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?P("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=m?void 0:P("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?P("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&m,y=P("input",{afterCreate:O,afterRemoved:F,afterUpdate:O,bind:this,"data-node-ref":"_attachmentsInput",files:a,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?P("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:$.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?P("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:$.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||m?P("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[P("div",{class:U.attachmentsView,key:"attachments-view"},P("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},P("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},P("calcite-icon",{class:U.attachmentsViewIcon,icon:$.upload,scale:"l"}),p,u,P("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},P("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?P("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),P("label",{key:"file-label"},l.fileName),P("span",{key:"file-span"},d.name),P("label",{key:"size-label"},l.size),P("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 P("calcite-list",{afterCreate:O,afterRemoved:F,afterUpdate:O,bind:this,class:U.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 P("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),P("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:m},m),P("calcite-action",{appearance:"transparent",icon:$.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?P("calcite-action",{appearance:"transparent",disabled:!n,icon:$.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,P("calcite-action",{appearance:"transparent",icon:$.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?P("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:$.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 P("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},P("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&&b(i)?P("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):P("calcite-icon",{icon:v(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?P("calcite-action",{bind:this,icon:$.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:o,text:b,textEnabled:!0,title:b}):void 0,_=u?P("calcite-action",{icon:$.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?P("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?P("calcite-label",{layout:"inline",scale:o},i.showAllTables,P("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?P("calcite-action",{icon:$.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?P("calcite-action",{bind:this,icon:$.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 P("div",{class:U.tableNavigation,key:"table-nav"},P("calcite-action",{icon:$.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,_,P("div",null,M,C,A,S))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return P("calcite-action",{icon:$.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()],B.prototype,"_attachmentsInput",void 0),e([c()],B.prototype,"_columnVisibilityActions",void 0),e([c()],B.prototype,"_effectiveDescription",null),e([c()],B.prototype,"_effectiveLayers",null),e([c()],B.prototype,"_effectiveTitle",null),e([c()],B.prototype,"_effectiveVisibleElements",null),e([c()],B.prototype,"_filteredTables",null),e([c()],B.prototype,"_hasAttachmentsViewError",null),e([c()],B.prototype,"_hasCustomMenuItems",null),e([c()],B.prototype,"_hasDefaultMenuItems",null),e([c()],B.prototype,"_shouldShowGrid",null),e([c()],B.prototype,"_shouldShowMenu",null),e([c()],B.prototype,"_shouldShowAttachmentsView",null),e([c()],B.prototype,"_showClearSelectionAction",null),e([c()],B.prototype,"_showColumnsVisibilityAction",null),e([c()],B.prototype,"_showDeleteSelectionAction",null),e([c()],B.prototype,"_showExportSelectionToCSVAction",null),e([c()],B.prototype,"_showLayerDropdown",null),e([c()],B.prototype,"_shouldShowNavigationBar",null),e([c()],B.prototype,"_showRefreshDataAction",null),e([c()],B.prototype,"_showSelectedRecordsShowSelectedAction",null),e([c()],B.prototype,"_showSelectedRecordsShowAllAction",null),e([c()],B.prototype,"_showZoomToSelectionAction",null),e([c()],B.prototype,"_viewLayers",null),e([c()],B.prototype,"attachmentsList",void 0),e([c({readOnly:!0})],B.prototype,"grid",null),e([c()],B.prototype,"actionColumn",null),e([c()],B.prototype,"actionColumnConfig",null),e([c({readOnly:!0})],B.prototype,"activeFilters",null),e([c({readOnly:!0})],B.prototype,"activeSortOrders",null),e([c()],B.prototype,"allColumns",null),e([c({readOnly:!0})],B.prototype,"allRelatedTablesVisible",null),e([c()],B.prototype,"allVisibleColumns",null),e([c()],B.prototype,"attachmentsColumns",null),e([c()],B.prototype,"attachmentsEnabled",null),e([c()],B.prototype,"attachmentsViewOptions",null),e([c({type:g})],B.prototype,"attributeTableTemplate",null),e([c()],B.prototype,"autoRefreshEnabled",null),e([c()],B.prototype,"clearPrompt",null),e([c()],B.prototype,"columnPerformanceModeEnabled",null),e([c()],B.prototype,"columnReorderingEnabled",null),e([c({readOnly:!0})],B.prototype,"columns",null),e([c()],B.prototype,"definitionExpression",null),e([c()],B.prototype,"description",void 0),e([c()],B.prototype,"disabled",void 0),e([c()],B.prototype,"editingEnabled",null),e([c()],B.prototype,"effectiveSize",null),e([c()],B.prototype,"effectiveTable",null),e([c()],B.prototype,"fieldColumns",null),e([c()],B.prototype,"filterGeometry",null),e([c()],B.prototype,"filterBySelectionEnabled",null),e([c()],B.prototype,"groupColumns",null),e([c()],B.prototype,"hiddenFields",null),e([c()],B.prototype,"highlightEnabled",null),e([c()],B.prototype,"highlightIds",null),e([c()],B.prototype,"icon",null),e([c()],B.prototype,"initialSize",null),e([c()],B.prototype,"isQueryingOrSyncing",null),e([c()],B.prototype,"isSyncingAttachments",null),e([c()],B.prototype,"label",null),e([c()],B.prototype,"layer",null),e([c()],B.prototype,"layers",null),e([c()],B.prototype,"layerView",null),e([c()],B.prototype,"maxSize",null),e([c(),x("esri/widgets/FeatureTable/t9n/FeatureTable")],B.prototype,"messages",null),e([c(),x("esri/t9n/common")],B.prototype,"messagesCommon",null),e([c(),x("esri/core/t9n/Units")],B.prototype,"messagesUnits",null),e([c(),x("esri/widgets/support/t9n/uriUtils")],B.prototype,"messagesURIUtils",null),e([c()],B.prototype,"menuConfig",null),e([c()],B.prototype,"multipleSelectionEnabled",null),e([c()],B.prototype,"multiSortEnabled",null),e([c()],B.prototype,"multipleSortPriority",null),e([c()],B.prototype,"navigationScale",void 0),e([c()],B.prototype,"noDataMessage",null),e([c()],B.prototype,"objectIds",null),e([c()],B.prototype,"outFields",null),e([c()],B.prototype,"pageCount",null),e([c()],B.prototype,"pageIndex",null),e([c()],B.prototype,"pageSize",null),e([c()],B.prototype,"paginationEnabled",null),e([c()],B.prototype,"prompt",null),e([c()],B.prototype,"relatedRecordsEnabled",null),e([c()],B.prototype,"relatedTable",null),e([c()],B.prototype,"relatedTables",null),e([c()],B.prototype,"relationship",null),e([c()],B.prototype,"relationshipColumnConfigs",null),e([c()],B.prototype,"relationshipColumns",null),e([c()],B.prototype,"relationshipConfig",null),e([c()],B.prototype,"relationshipInfos",null),e([c()],B.prototype,"returnGeometryEnabled",null),e([c()],B.prototype,"returnMEnabled",null),e([c()],B.prototype,"returnZEnabled",null),e([c()],B.prototype,"rowHighlightIds",null),e([c()],B.prototype,"selectionSource",null),e([c()],B.prototype,"showAllRelatedTables",null),e([c()],B.prototype,"showPrompt",null),e([c()],B.prototype,"showRelatedTableCallback",null),e([c()],B.prototype,"size",null),e([c({readOnly:!0})],B.prototype,"state",null),e([c()],B.prototype,"supportsAddAttachments",null),e([c()],B.prototype,"supportsAttachments",null),e([c()],B.prototype,"supportsDeleteAttachments",null),e([c()],B.prototype,"supportsResizeAttachments",null),e([c()],B.prototype,"supportsUpdateAttachments",null),e([c()],B.prototype,"syncTemplateOnChangesEnabled",null),e([c({constructOnly:!0})],B.prototype,"tableController",null),e([c({constructOnly:!0})],B.prototype,"tableParent",null),e([c()],B.prototype,"tableTemplate",null),e([c()],B.prototype,"tableTemplateOverride",null),e([c()],B.prototype,"title",void 0),e([c()],B.prototype,"timeExtent",null),e([c()],B.prototype,"timeZone",null),e([c()],B.prototype,"view",null),e([c({type:M}),D(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],B.prototype,"viewModel",void 0),e([c()],B.prototype,"visibleColumns",null),e([c({type:C,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([c({type:C})],B.prototype,"visibleElementsOverride",null),B=z=e([d("esri.widgets.FeatureTable")],B);const N=B;export{N as default};