@arcgis/core 4.34.0-next.69 → 4.34.0-next.70

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 (324) hide show
  1. package/applications/Components/QuantityFormatter.js +1 -1
  2. package/applications/Components/analysisUtils.js +1 -1
  3. package/applications/MapViewer/mediaUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{e2486bf5546443408c85.js → 0618ea8bf9da93d713b1.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0b69d251961d8b46fe30.js +1 -0
  7. package/assets/esri/core/workers/chunks/{adfb018f510e19a520fb.js → 0f37204f86d2997a2811.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{e0fe6bb51ecc9b2faf69.js → 16cfbe7bedf75d3a86e5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{4f0f6653b8e92c633d14.js → 181b3564a0e3939020bc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{aff553c3d6544e20f188.js → 28a2f74d4a449386d082.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{5185c63fecc5f493e142.js → 3bf99037befdedd75cb4.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8e2558b14be70b273ce4.js → 43095bed5456251940b9.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4a5092e27e6f294ea888.js +1 -0
  14. package/assets/esri/core/workers/chunks/4d33eec23ad6dbd6a0f0.js +1 -0
  15. package/assets/esri/core/workers/chunks/52286d4135b8395a3400.js +1 -0
  16. package/assets/esri/core/workers/chunks/{66cb5b294d7f251c2cc8.js → 540506802776f77e47f3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7e95896ac41c7e2ca26a.js → 56f54d007b0da0d908aa.js} +1 -1
  18. package/assets/esri/core/workers/chunks/5879cebb22157b0b4998.js +1 -0
  19. package/assets/esri/core/workers/chunks/{4102ed32b8dbdc32cb3b.js → 5c4ba165816809e06340.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{aa970a547c60c43d6c7f.js → 61896e64e9ef49b4bb1b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{82cb5defb0593e3017ff.js → 6391ce002fbde9f27a77.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{a895da7fd64ebad3d5a4.js → 6dc62c170e9583222df2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/72bde3290ad2e1a11d9b.js +2 -0
  24. package/assets/esri/core/workers/chunks/{48316d91c06928f69f61.js → 78b33c6d73824085c6d1.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{b482132638f3b351724c.js → 7aaa6b318195d7342e6c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/810e4c16c6eae420508b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{837830e1cf712d4243a5.js → 83589cfcc443b925c1aa.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{26b791291689434dde09.js → 8b587affaaa0b1e4368c.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d1b361b8adf1c719a10a.js → 925ad2665c2fe0f47cc3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{5b84eba4a28e25b6d5c0.js → 9421389888d4d9e4e809.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{80b0c88a76bd523a406a.js → 96740c75ad65d651cc43.js} +1 -1
  32. package/assets/esri/core/workers/chunks/98c94a99e2e04d5ae65f.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ab727ed4417b7dd94ce9.js → 9c00c2263e52ad51c2a2.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f054557e23978e174686.js → a2baeb9fa805c3537049.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{18c7b1e1fbf7eb6c3c33.js → a33e1a031ba9f028023d.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5c053d197935c65792ce.js → b03dcbc31bccb9fdf9fe.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{e4e224983c3ee24fc51d.js → b7f5a26ff3a73c64552d.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bc5fa33afec5354601a1.js → b818b5e392d5eb7c7e70.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{efea3e82cec476d486e0.js → bce41b41431a7daed33c.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{b052d3ef5493eedb44a5.js → c07507a42def2bd2a222.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b335e96f6bcac6d2f0ee.js → c427516421edf56e7776.js} +1 -1
  42. package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +1 -0
  43. package/assets/esri/core/workers/chunks/{097a5c333de28ec5e16f.js → cd58b40a8105be758c0e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ce1f4508487298ab57b6.js +1 -0
  45. package/assets/esri/core/workers/chunks/{144bfd64daf103a06734.js → ce8f56cf371812b57a46.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{0c4f07eb3f3dd5cd2c6c.js → d1711256493d55eca523.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{489fa17e60f25d5f33ae.js → d44f3ee27e142e0c3030.js} +1 -1
  48. package/assets/esri/core/workers/chunks/d682dd49bb9ee7f48f93.js +1 -0
  49. package/assets/esri/core/workers/chunks/{6a5b5b80917a5375b9f6.js → e2384a1079a4722c41dd.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{fe353a53968827bcd9cc.js → e3ad0a390387c5847aca.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{87fb5d755860057da164.js → e8e0f73fb94e63e2abc3.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f8adac87e48ea86bec21.js → eb0a5d592f5805836203.js} +1 -1
  53. package/assets/esri/core/workers/chunks/f3ef59991c577ff5e825.js +1 -0
  54. package/assets/esri/core/workers/chunks/{ed1272e7681e561d843f.js → f51c1420c9243d550c9d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/f749e2a89a14ab89ae59.js +1 -0
  56. package/assets/esri/core/workers/chunks/f7e9cbd54154341bd2de.js +1 -0
  57. package/assets/esri/core/workers/chunks/{09dbb3e200ef8d514eb3.js → f87a6b32292c1464b7b7.js} +2 -2
  58. package/assets/esri/core/workers/chunks/{a2963ffc9a8c90822d2d.js → fdf2b980e8a8aa47ce91.js} +1 -1
  59. package/chunks/Theme.js +1 -1
  60. package/chunks/chartUtilsAm5.js +1 -1
  61. package/config.js +1 -1
  62. package/core/arrayUtils.js +1 -1
  63. package/editing/templateUtils.js +1 -1
  64. package/identity/IdentityModal.js +1 -1
  65. package/interfaces.d.ts +39 -19
  66. package/kernel.js +1 -1
  67. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  68. package/layers/support/GaussianSplatAtlasPageAllocator.js +1 -1
  69. package/package.json +3 -2
  70. package/support/actions/actionUtils.js +1 -1
  71. package/support/modeUtils.js +1 -1
  72. package/support/popupUtils.js +1 -1
  73. package/support/revision.js +1 -1
  74. package/symbols/cim/cimAnalyzer.js +1 -1
  75. package/symbols/cim/defaultCIMValues.js +1 -1
  76. package/symbols/cim/enums.js +5 -0
  77. package/symbols/support/svgUtils.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientSizeHelper.js +1 -1
  80. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  81. package/views/2d/interactive/editingTools.js +1 -1
  82. package/views/2d/layers/MediaLayerView2D.js +1 -1
  83. package/views/2d/layers/TileLayerView2D.js +1 -1
  84. package/views/3d/layers/FlowSubView3D.js +1 -1
  85. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  86. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  87. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  88. package/views/3d/layers/TiledLayerView3D.js +1 -1
  89. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  90. package/views/3d/layers/support/TerrainTileTree3DDebugger.js +1 -1
  91. package/views/3d/state/ViewStateManager.js +1 -1
  92. package/views/3d/support/CombinedElevationProvider.js +1 -1
  93. package/views/3d/terrain/TerrainSurface.js +1 -1
  94. package/views/3d/terrain/TileAgent.js +1 -1
  95. package/views/3d/terrain/tileUtils.js +1 -1
  96. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  97. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  98. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  99. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  100. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  101. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  102. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  103. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  104. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  105. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  106. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  107. package/views/GroundView.js +1 -1
  108. package/views/SceneView.js +1 -1
  109. package/views/ToolViewManager.js +1 -1
  110. package/views/VideoView.js +1 -1
  111. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  112. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  113. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  114. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  115. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  117. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  118. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  119. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  120. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  121. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  122. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  123. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  124. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  125. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  126. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  127. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  128. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  129. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  130. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  131. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  132. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  133. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  134. package/views/overlay/BoxOverlayItem.js +1 -1
  135. package/views/overlay/CrosshairOverlayItem.js +1 -1
  136. package/views/overlay/OutlineOverlayItem.js +1 -1
  137. package/views/support/GroundViewElevationSampler.js +1 -1
  138. package/widgets/AreaMeasurement2D.js +1 -1
  139. package/widgets/AreaMeasurement3D.js +1 -1
  140. package/widgets/Attachments.js +1 -1
  141. package/widgets/Attribution.js +1 -1
  142. package/widgets/BasemapGallery.js +1 -1
  143. package/widgets/BasemapLayerList.js +1 -1
  144. package/widgets/BasemapToggle.js +1 -1
  145. package/widgets/BatchAttributeForm.js +1 -1
  146. package/widgets/Bookmarks.js +1 -1
  147. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  148. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  149. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  150. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  151. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  152. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  153. package/widgets/BuildingExplorer.js +1 -1
  154. package/widgets/CatalogLayerList.js +1 -1
  155. package/widgets/Compass.js +1 -1
  156. package/widgets/CoordinateConversion.js +1 -1
  157. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  158. package/widgets/Daylight.js +1 -1
  159. package/widgets/DirectLineMeasurement3D.js +1 -1
  160. package/widgets/DirectionalPad.js +1 -1
  161. package/widgets/Directions.js +1 -1
  162. package/widgets/DistanceMeasurement2D.js +1 -1
  163. package/widgets/Editor/EditorViewModel.js +1 -1
  164. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  165. package/widgets/Editor/components/FeatureList.js +1 -1
  166. package/widgets/Editor/components/FooterActions.js +1 -1
  167. package/widgets/Editor/components/Notices.js +1 -1
  168. package/widgets/Editor/components/PanelContent.js +1 -1
  169. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  170. package/widgets/Editor/components/Prompt.js +1 -1
  171. package/widgets/Editor/components/Settings.js +1 -1
  172. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  173. package/widgets/Editor/components/UploadDetails.js +1 -1
  174. package/widgets/Editor.js +1 -1
  175. package/widgets/ElevationProfile/components/Legend.js +1 -1
  176. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  177. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  178. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  179. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  180. package/widgets/ElevationProfile.js +1 -1
  181. package/widgets/Feature/FeatureAttachments.js +1 -1
  182. package/widgets/Feature/FeatureExpression.js +1 -1
  183. package/widgets/Feature/FeatureFields.js +1 -1
  184. package/widgets/Feature/FeatureMedia.js +1 -1
  185. package/widgets/Feature/FeatureRelationship.js +1 -1
  186. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  187. package/widgets/Feature/FeatureUtilityNetworkAssociations.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.js +1 -1
  195. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  196. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  197. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  198. package/widgets/FeatureTable.js +1 -1
  199. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  200. package/widgets/FeatureTemplates.js +1 -1
  201. package/widgets/Features/FeaturesDrillIn.js +1 -1
  202. package/widgets/Features.js +1 -1
  203. package/widgets/FloorFilter.js +1 -1
  204. package/widgets/FovOverlay.js +1 -1
  205. package/widgets/Fullscreen.js +1 -1
  206. package/widgets/Histogram.js +1 -1
  207. package/widgets/HistogramRangeSlider.js +1 -1
  208. package/widgets/Home.js +1 -1
  209. package/widgets/LayerList/LayerListItem.js +1 -1
  210. package/widgets/LayerList.js +1 -1
  211. package/widgets/Legend/styles/card/CardView.js +1 -1
  212. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  213. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  214. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  215. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  216. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  217. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  218. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  219. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  220. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  221. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  222. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  223. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  224. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  225. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  226. package/widgets/Legend.js +1 -1
  227. package/widgets/LineOfSight.js +1 -1
  228. package/widgets/Locate.js +1 -1
  229. package/widgets/Measurement.js +1 -1
  230. package/widgets/NavigationToggle.js +1 -1
  231. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  232. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  233. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  234. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  235. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  236. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  237. package/widgets/OrientedImageryViewer.js +1 -1
  238. package/widgets/PanoramicViewer.js +1 -1
  239. package/widgets/Popup.js +1 -1
  240. package/widgets/Print.js +1 -1
  241. package/widgets/ScaleBar.js +1 -1
  242. package/widgets/ScaleRangeSlider.js +1 -1
  243. package/widgets/Search/SearchResultRenderer.js +1 -1
  244. package/widgets/Search.js +1 -1
  245. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  246. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  247. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  248. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  249. package/widgets/ShadowCast.js +1 -1
  250. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  251. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  252. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  253. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  254. package/widgets/Sketch.js +1 -1
  255. package/widgets/Slice.js +1 -1
  256. package/widgets/Slider.js +1 -1
  257. package/widgets/Spinner.js +1 -1
  258. package/widgets/Swipe.js +1 -1
  259. package/widgets/TableList.js +1 -1
  260. package/widgets/TimeSlider.js +1 -1
  261. package/widgets/TimeZoneLabel.js +1 -1
  262. package/widgets/Track.js +1 -1
  263. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  264. package/widgets/UtilityNetworkAssociations.js +1 -1
  265. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  266. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  267. package/widgets/UtilityNetworkTrace.js +1 -1
  268. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  269. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  270. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  271. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  272. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  273. package/widgets/ValuePicker.js +1 -1
  274. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  275. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  276. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  277. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  278. package/widgets/VideoPlayer.js +1 -1
  279. package/widgets/Weather/LabeledSlider.js +1 -1
  280. package/widgets/Weather.js +1 -1
  281. package/widgets/Widget.js +1 -1
  282. package/widgets/Zoom.js +1 -1
  283. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  284. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  285. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  286. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  287. package/widgets/smartMapping/ColorSlider.js +1 -1
  288. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  289. package/widgets/smartMapping/OpacitySlider.js +1 -1
  290. package/widgets/smartMapping/SizeSlider.js +1 -1
  291. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  292. package/widgets/support/ColorPicker.js +1 -1
  293. package/widgets/support/FilterBuilder.js +1 -1
  294. package/widgets/support/FilterCondition.js +1 -1
  295. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  296. package/widgets/support/GridControls.js +1 -1
  297. package/widgets/support/Heading.js +1 -1
  298. package/widgets/support/ItemList.js +1 -1
  299. package/widgets/support/LabeledSwitch.js +1 -1
  300. package/widgets/support/MeasurementWidgetContent.js +1 -1
  301. package/widgets/support/SelectionList.js +1 -1
  302. package/widgets/support/SelectionToolbar.js +1 -1
  303. package/widgets/support/SketchTooltipControls.js +1 -1
  304. package/widgets/support/SnappingControls.js +1 -1
  305. package/widgets/support/TimezonePicker.js +1 -1
  306. package/widgets/support/UnitSelect.js +1 -1
  307. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  308. package/widgets/support/widget.js +1 -1
  309. package/assets/esri/core/workers/chunks/12d30c2367652e2c688b.js +0 -1
  310. package/assets/esri/core/workers/chunks/170ec7fb070c63230c81.js +0 -1
  311. package/assets/esri/core/workers/chunks/3386420c9ae891db5be7.js +0 -2
  312. package/assets/esri/core/workers/chunks/3cef77453623bbb37ad2.js +0 -1
  313. package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +0 -1
  314. package/assets/esri/core/workers/chunks/570b17a1a4ab405bbdcb.js +0 -1
  315. package/assets/esri/core/workers/chunks/6433116597021a9af680.js +0 -1
  316. package/assets/esri/core/workers/chunks/7944c18b270c85ff2e41.js +0 -1
  317. package/assets/esri/core/workers/chunks/81e518dd62bd95611d00.js +0 -1
  318. package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +0 -1
  319. package/assets/esri/core/workers/chunks/a6f66492651646c18f10.js +0 -1
  320. package/assets/esri/core/workers/chunks/bd7e303dd64a27ba6846.js +0 -1
  321. package/assets/esri/core/workers/chunks/e956d437c0c2ea81db93.js +0 -1
  322. package/assets/esri/core/workers/chunks/f1865b28f0f75cadd716.js +0 -1
  323. package/layers/GroundLayer.js +0 -5
  324. /package/assets/esri/core/workers/chunks/{3386420c9ae891db5be7.js.LICENSE.txt → 72bde3290ad2e1a11d9b.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/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";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 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};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{renderingSanitizer as t}from"../../../../core/sanitizerUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import i from"./ButtonMenuViewModel.js";import{loadCalciteComponents as r}from"../../../support/componentsUtils.js";import{globalCss as l}from"../../../support/globalCss.js";import{storeNode as a,isActivationKey as d}from"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const c="esri-button-menu",m={base:c,content:`${c}__content`,itemWrapper:`${c}__item-wrapper`,icon:`${c}__icon`,item:`${c}__item`,itemLabel:`${c}__item-label`,itemLabelContent:`${c}__item-label-content`,selectableMenuItem:`${c}__item--selectable`,selectedMenuItem:`${c}__item--selected`,checkbox:`${c}__checkbox`,embeddedContentWrapper:`${c}__embedded-content-wrapper`,button:`${c}__button`,buttonSelected:`${c}__button--selected`};let u=class extends s{constructor(e,t){super(e,t),this._popover=null,this.disabled=!1,this.viewModel=new i}loadDependencies(){return r({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._popover=null}get items(){return this.viewModel.items}set items(e){this.viewModel.items=e}get open(){return this.viewModel.open}set open(e){this.viewModel.open=e}render(){const{open:e}=this,t=`${this.id}-button`;return p("div",{class:this.classes(m.base,l.widget),key:"menu"},p("calcite-button",{appearance:"transparent",bind:this,class:this.classes(m.button,e&&m.buttonSelected),disabled:this.disabled,iconStart:e?"x":"ellipsis",id:t,kind:"neutral",label:this.label||"button",onclick:()=>this._toggleOpen(e),tabIndex:0}),p("calcite-popover",{afterCreate:a,afterUpdate:()=>this._popover?.reposition(),autoClose:!0,bind:this,"data-node-ref":"_popover",label:this.label||"menu",open:e,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:t,onCalcitePopoverClose:this._onPopoverClose},this._renderMenuContent()))}_onPopoverClose(){this.open=!1}_renderMenuContent(){const{id:e,open:t}=this;return p("div",{afterCreate:this._afterMenuContentNodeCreate,bind:this,class:m.content,hidden:!t,key:"esri-button-menu-content"},p("ul",{"aria-labelledby":`${e}-button`,bind:this,class:m.itemWrapper,id:`${e}-menu`,role:"menu"},this.items?.length?this._renderItems():null))}_renderItems(){return this.items?.map((e,t)=>this._renderItem(e,t))}_renderItem(e,o,n){const s=null!=n?`${this.id}-menu-item-${o}-${n}`:`${this.id}-menu-item-${o}`,i=`${s}-label`,r=this.classes(m.item,e.selectionEnabled?m.selectableMenuItem:null,e.selectionEnabled&&e.selected?m.selectedMenuItem:null);return p("li",{afterCreate:this._afterMenuItemCreate,bind:this,class:r,"data-item-index":o,"data-item-subIndex":n,for:s,key:s,onclick:t=>this._handleMenuItemInteraction(t,e),onkeydown:t=>this._handleMenuItemKeydown(t,e),role:"menuitem",tabIndex:this.disabled?-1:0},p("input",{checked:e.selected,class:m.checkbox,disabled:!0,id:s,name:s,tabIndex:-1,type:"checkbox"}),p("label",{class:m.itemLabel,for:s,id:i},p("span",{"aria-hidden":"true",class:m.icon}),p("span",{class:m.itemLabelContent},t.sanitize(e.label))),p("ul",{"aria-labelledby":i,class:m.embeddedContentWrapper,id:`${this.id}-submenu`,role:"menu"},e?.items?.map((e,t)=>this._renderItem(e,o,t))))}_handleMenuItemInteraction(e,t){t.selected=!t.selected,t.open=!(!t.selected||!t.items),t.autoCloseMenu&&this.set("open",!1),t.clickFunction?.({event:e,item:t}),e.stopPropagation()}_handleMenuItemKeydown(e,t){const{key:o}=e;d(o)&&this._handleMenuItemInteraction(e,t),"Escape"===o&&(this.open=!1,e.preventDefault(),e.stopPropagation())}_afterMenuContentNodeCreate(e){e.focus()}_toggleOpen(e){this.open=!e}_afterMenuItemCreate(e){0===e["data-item-index"]&&e.focus()}};e([o()],u.prototype,"disabled",void 0),e([o()],u.prototype,"items",null),e([o()],u.prototype,"open",null),e([o()],u.prototype,"viewModel",void 0),u=e([n("esri.widgets.FeatureTable.Grid.support.ButtonMenu")],u);const b=u;export{b as default};
5
+ import{__decorate as e}from"tslib";import{renderingSanitizer as t}from"../../../../core/sanitizerUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import i from"./ButtonMenuViewModel.js";import{loadCalciteComponents as r}from"../../../support/componentsUtils.js";import{globalCss as l}from"../../../support/globalCss.js";import{storeNode as a,isActivationKey as d}from"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const c="esri-button-menu",m={base:c,content:`${c}__content`,itemWrapper:`${c}__item-wrapper`,icon:`${c}__icon`,item:`${c}__item`,itemLabel:`${c}__item-label`,itemLabelContent:`${c}__item-label-content`,selectableMenuItem:`${c}__item--selectable`,selectedMenuItem:`${c}__item--selected`,checkbox:`${c}__checkbox`,embeddedContentWrapper:`${c}__embedded-content-wrapper`,button:`${c}__button`,buttonSelected:`${c}__button--selected`};let u=class extends s{constructor(e,t){super(e,t),this._popover=null,this.disabled=!1,this.viewModel=new i}loadDependencies(){return r({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._popover=null}get items(){return this.viewModel.items}set items(e){this.viewModel.items=e}get open(){return this.viewModel.open}set open(e){this.viewModel.open=e}render(){const{open:e}=this,t=`${this.id}-button`;return p("div",{class:this.classes(m.base,l.widget),key:"menu"},p("calcite-button",{appearance:"transparent",bind:this,class:this.classes(m.button,e&&m.buttonSelected),disabled:this.disabled,iconStart:e?"x":"ellipsis",id:t,kind:"neutral",label:this.label||"button",onclick:()=>this._toggleOpen(e),tabIndex:0}),p("calcite-popover",{afterCreate:a,afterUpdate:()=>this._popover?.reposition(),autoClose:!0,bind:this,"data-node-ref":"_popover",label:this.label||"menu",open:e,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:t,onCalcitePopoverClose:this._onPopoverClose},this._renderMenuContent()))}_onPopoverClose(){this.open=!1}_renderMenuContent(){const{id:e,open:t}=this;return p("div",{afterCreate:this._afterMenuContentNodeCreate,bind:this,class:m.content,hidden:!t,key:"esri-button-menu-content"},p("ul",{"aria-labelledby":`${e}-button`,bind:this,class:m.itemWrapper,id:`${e}-menu`,role:"menu"},this.items?.length?this._renderItems():null))}_renderItems(){return this.items?.map((e,t)=>this._renderItem(e,t))}_renderItem(e,o,n){const s=null!=n?`${this.id}-menu-item-${o}-${n}`:`${this.id}-menu-item-${o}`,i=`${s}-label`,r=this.classes(m.item,e.selectionEnabled?m.selectableMenuItem:null,e.selectionEnabled&&e.selected?m.selectedMenuItem:null);return p("li",{afterCreate:this._afterMenuItemCreate,bind:this,class:r,"data-item-index":o,"data-item-subIndex":n,for:s,key:s,onclick:t=>this._handleMenuItemInteraction(t,e),onkeydown:t=>this._handleMenuItemKeydown(t,e),role:"menuitem",tabIndex:this.disabled?-1:0},p("input",{checked:e.selected,class:m.checkbox,disabled:!0,id:s,name:s,tabIndex:-1,type:"checkbox"}),p("label",{class:m.itemLabel,for:s,id:i},p("span",{"aria-hidden":"true",class:m.icon}),p("span",{class:m.itemLabelContent},t.sanitize(e.label))),p("ul",{"aria-labelledby":i,class:m.embeddedContentWrapper,id:`${this.id}-submenu`,role:"menu"},e?.items?.map((e,t)=>this._renderItem(e,o,t))))}_handleMenuItemInteraction(e,t){t.selected=!t.selected,t.open=!(!t.selected||!t.items),t.autoCloseMenu&&this.set("open",!1),t.clickFunction?.({event:e,item:t}),e.stopPropagation()}_handleMenuItemKeydown(e,t){const{key:o}=e;d(o)&&this._handleMenuItemInteraction(e,t),"Escape"===o&&(this.open=!1,e.preventDefault(),e.stopPropagation())}_afterMenuContentNodeCreate(e){e.focus()}_toggleOpen(e){this.open=!e}_afterMenuItemCreate(e){0===e["data-item-index"]&&e.focus()}};e([o()],u.prototype,"disabled",void 0),e([o()],u.prototype,"items",null),e([o()],u.prototype,"open",null),e([o()],u.prototype,"viewModel",void 0),u=e([n("esri.widgets.FeatureTable.Grid.support.ButtonMenu")],u);const b=u;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/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 p,isSubtypeGroupLayer as m}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 x,discardNode as k}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{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.menuConfig=null,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)||m(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)):p(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):m(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 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),p=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(p),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,p=r?.length,m=d?O("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?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&&p,y=O("input",{afterCreate:x,afterRemoved:k,afterUpdate:x,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||p?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"}),m,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:x,afterRemoved:k,afterUpdate:x,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,p=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:p},p),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:p}=a,m=null!=p,u=h.length,g=s?.selectedItems?.length??0,w=`${r.objectIdField}: ${p}`,b=F(t.selectedCount,{count:g}),v=F(t.attachmentsCount,{count:u}),y=m?O("calcite-action",{bind:this,icon:$.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:l,text:w,textEnabled:!0,title:w}):void 0,f=m?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,_=m?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=m&&"list"===a.mode&&null!=p&&g&&d?O("calcite-action",{icon:$.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)},scale:l,text:i.delete,textEnabled:!0,title:F(t.deleteAttachmentCount,{count:g})}):void 0,A=m&&"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",void 0),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"../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 p,isSubtypeGroupLayer as m}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.menuConfig=null,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)||m(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)):p(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):m(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 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),p=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(p),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,p=r?.length,m=d?O("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?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&&p,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||p?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"}),m,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,p=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:p},p),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:p}=a,m=null!=p,u=h.length,g=s?.selectedItems?.length??0,w=`${r.objectIdField}: ${p}`,b=F(t.selectedCount,{count:g}),v=F(t.attachmentsCount,{count:u}),y=m?O("calcite-action",{bind:this,icon:$.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:l,text:w,textEnabled:!0,title:w}):void 0,f=m?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,_=m?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=m&&"list"===a.mode&&null!=p&&g&&d?O("calcite-action",{icon:$.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,s?.selectedItems?.map(e=>e.value)??[],!0)},scale:l,text:i.delete,textEnabled:!0,title:F(t.deleteAttachmentCount,{count:g})}):void 0,A=m&&"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",void 0),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};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{createTask as e}from"../../core/asyncUtils.js";import{EventedAccessor as s}from"../../core/Evented.js";import{abortMaybe as l}from"../../core/maybe.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as r,sync as a,when as n}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as d,isSharedTemplateOrMetadata as c}from"../../editing/templateUtils.js";import{getEffectiveLayerCapabilities as h,isSubtypeGroupLayer as y}from"../../layers/support/layerUtils.js";import{isTemplateItemGroup as f,mapItemsByTemplate as g,isTemplateGroupInfo as _,loadLayerWithTemplates as I,makeTemplateItemInfos as F,makeGroupItemInfos as b,nullGroupBy as v}from"./featureTemplatesUtils.js";import T from"./TemplateItem.js";import j from"./TemplateItemGroup.js";const w=({layer:t})=>({key:t,label:t.title??""}),B=({layer:t})=>({key:t.geometryType,label:t.geometryType??""});let k=class extends s{constructor(t){super(t),this._allItems=[],this._updatingHandles=new u,this._updateTask=null,this.disabled=!1,this.disabledItemFunction=null,this.filterFunction=null,this.selectedItem=null,this.templateInfos=null,this.view=null}initialize(){this._get("groupBy")||(this.groupBy="layer"),this.addHandles([i(()=>[this.templateInfos,this.layers],([t],e)=>{t&&t===e?.at(0)||(this._updateTask=l(this._updateTask),t?this._updateAllItems(t):this._getTemplatesAndUpdateAllItems())},r),i(()=>this._groupByFunction,()=>{null==this.templateInfos&&(this._updateTask=l(this._updateTask),this._getTemplatesAndUpdateAllItems())},a),i(()=>this.filterFunction,t=>{for(const e of this._allItems)f(e)&&(e.filterFunction=t)},a)])}set groupBy(t){if(this._set("groupBy",t),"function"!=typeof t)switch(t){case"layer":this._groupByFunction=w;break;case"geometry":this._groupByFunction=B;break;default:this._groupByFunction=null}else this._groupByFunction=e=>this._ensureGroupByObject(t(e))}get layers(){return this._get("layers")}set layers(t){const e="layers";if(this.removeHandles(e),t){const s=()=>this.notifyChange("state");this.addHandles(t.map(t=>n(()=>t.loadStatus,s)),e)}this._set("layers",t)}get state(){return this.updating?"loading":0!==this.layers.length||this.templateInfos?.length?"ready":"disabled"}get numberOfFeatureTemplates(){return this._allItems.reduce((t,e)=>f(e)?t+e.allItems.length:t+1,0)}get items(){const{filterFunction:t}=this;return null==t?this._allItems:this._allItems.filter(e=>f(e)?e.items.length>0:t(e))}get updating(){return this._updatingHandles.updating}refresh(){this.notifyChange("filterFunction");for(const t of this._allItems)f(t)&&t.reapplyFilter()}select(t,{emit:e=!0}={}){const s=this.selectedItem,l=t?.clone()||null;this._set("selectedItem",l),e&&this.emit("select",{item:l,oldItem:s,template:l?.template??null})}_createItem(t,e){return new T({disabledFunction:this.disabledItemFunction,layer:e,template:t})}_ensureGroupByObject(t){return"string"==typeof t?{key:t,label:t}:t}_updateAllItems(t){const e=this._allItems;if(0===t.length)return A(e),void(this._allItems=[]);const[s,l]=g(e),o=t=>{const e=s.get(t.template);return e?(s.delete(t.template),e):this._createItem(t.template,t.layer)},{filterFunction:i}=this,r=t.filter(U).map(t=>_(t)?new j({filterFunction:i,label:t.label,allItems:t.templateInfos.filter(U).map(t=>o(t))}):o(t));for(const a of[...s.values(),...l])a.destroy();this._allItems=r}async _getTemplatesFromLayers(t){const e=[],s={signal:t};await Promise.all(this.layers.map(async l=>{await I(l,s),o(t);const i=h(l)?.operations;i?.supportsEditing&&i?.supportsAdd&&(y(l)?e.push(...l.sublayers):e.push(l))}));const l=await d(e,this.view,t);o(t);const i=F(l),r=this._groupByFunction;if(null==r)return i;const a=b(i,r);return 1===a.length&&a[0].label===v.label?a[0].templateInfos:a}async _getTemplatesAndUpdateAllItems(){if(0===this.layers.length)return;const t=e(async t=>{const e=await this._getTemplatesFromLayers(t);o(t),this._updateAllItems(e)});this._updateTask=t,await this._updatingHandles.addPromise(t.promise)}};function A(t){for(const e of t){if(f(e))for(const t of e.items)t.destroy();e.destroy()}}function U(t){return _(t)?t.templateInfos.some(U):!c(t.template)||!1!==t.template.visible}t([p()],k.prototype,"_allItems",void 0),t([p()],k.prototype,"_groupByFunction",void 0),t([p()],k.prototype,"_updatingHandles",void 0),t([p()],k.prototype,"disabled",void 0),t([p()],k.prototype,"disabledItemFunction",void 0),t([p({value:null})],k.prototype,"filterFunction",void 0),t([p()],k.prototype,"groupBy",null),t([p({value:[]})],k.prototype,"layers",null),t([p()],k.prototype,"state",null),t([p({readOnly:!0})],k.prototype,"numberOfFeatureTemplates",null),t([p({readOnly:!0})],k.prototype,"items",null),t([p({readOnly:!0})],k.prototype,"selectedItem",void 0),t([p()],k.prototype,"templateInfos",void 0),t([p()],k.prototype,"updating",null),t([p()],k.prototype,"view",void 0),k=t([m("esri.widgets.FeatureTemplates.FeatureTemplatesViewModel")],k);const H=k;export{H as default};
5
+ import{__decorate as t}from"tslib";import{createTask as e}from"../../core/asyncUtils.js";import{EventedAccessor as s}from"../../core/Evented.js";import{abortMaybe as l}from"../../core/maybe.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{watch as i,syncAndInitial as r,sync as a,when as n}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as d,isSharedTemplateOrMetadata as c}from"../../editing/templateUtils.js";import{getEffectiveLayerCapabilities as y,isSubtypeGroupLayer as h}from"../../layers/support/layerUtils.js";import{isTemplateItemGroup as f,mapItemsByTemplate as g,isTemplateGroupInfo as _,loadLayerWithTemplates as I,makeTemplateItemInfos as b,makeGroupItemInfos as F,nullGroupBy as v}from"./featureTemplatesUtils.js";import T from"./TemplateItem.js";import j from"./TemplateItemGroup.js";const w=({layer:t})=>({key:t,label:t.title??""}),B=({layer:t})=>({key:t.geometryType,label:t.geometryType??""});let k=class extends s{constructor(t){super(t),this._allItems=[],this._updatingHandles=new u,this._updateTask=null,this.disabled=!1,this.disabledItemFunction=null,this.filterFunction=null,this.selectedItem=null,this.templateInfos=null,this.view=null}initialize(){this._get("groupBy")||(this.groupBy="layer"),this.addHandles([i(()=>[this.templateInfos,this.layers],([t],e)=>{t&&t===e?.at(0)||(this._updateTask=l(this._updateTask),t?this._updateAllItems(t):this._getTemplatesAndUpdateAllItems())},r),i(()=>this._groupByFunction,()=>{null==this.templateInfos&&(this._updateTask=l(this._updateTask),this._getTemplatesAndUpdateAllItems())},a),i(()=>this.filterFunction,t=>{for(const e of this._allItems)f(e)&&(e.filterFunction=t)},a)])}set groupBy(t){if(this._set("groupBy",t),"function"!=typeof t)switch(t){case"layer":this._groupByFunction=w;break;case"geometry":this._groupByFunction=B;break;default:this._groupByFunction=null}else this._groupByFunction=e=>this._ensureGroupByObject(t(e))}get layers(){return this._get("layers")}set layers(t){const e="layers";if(this.removeHandles(e),t){const s=()=>this.notifyChange("state");this.addHandles(t.map(t=>n(()=>t.loadStatus,s)),e)}this._set("layers",t)}get state(){return this.updating?"loading":0!==this.layers.length||this.templateInfos?.length?"ready":"disabled"}get numberOfFeatureTemplates(){return this._allItems.reduce((t,e)=>f(e)?t+e.allItems.length:t+1,0)}get items(){const{filterFunction:t}=this;return null==t?this._allItems:this._allItems.filter(e=>f(e)?e.items.length>0:t(e))}get updating(){return this._updatingHandles.updating}refresh(){this.notifyChange("filterFunction");for(const t of this._allItems)f(t)&&t.reapplyFilter()}select(t,{emit:e=!0}={}){const s=this.selectedItem,l=t?.clone()||null;this._set("selectedItem",l),e&&this.emit("select",{item:l,oldItem:s,template:l?.template??null})}_createItem(t,e){return new T({disabledFunction:this.disabledItemFunction,layer:e,template:t})}_ensureGroupByObject(t){return"string"==typeof t?{key:t,label:t}:t}_updateAllItems(t){const e=this._allItems;if(0===t.length)return A(e),void(this._allItems=[]);const[s,l]=g(e),o=t=>{const e=s.get(t.template);return e?(s.delete(t.template),e):this._createItem(t.template,t.layer)},{filterFunction:i}=this,r=t.filter(U).map(t=>_(t)?new j({filterFunction:i,label:t.label,allItems:t.templateInfos.filter(U).map(t=>o(t))}):o(t));for(const a of[...s.values(),...l])a.destroy();this._allItems=r}async _getTemplatesFromLayers(t){const e=[],s={signal:t};await Promise.all(this.layers.map(async l=>{await I(l,s),o(t);const i=y(l)?.operations;i?.supportsEditing&&i?.supportsAdd&&(h(l)?e.push(...l.sublayers):e.push(l))}));const l=await d({layers:e,view:this.view,signal:t,queryOptions:{returnVisibleTemplatesOnly:!0}});o(t);const i=b(l),r=this._groupByFunction;if(null==r)return i;const a=F(i,r);return 1===a.length&&a[0].label===v.label?a[0].templateInfos:a}async _getTemplatesAndUpdateAllItems(){if(0===this.layers.length)return;const t=e(async t=>{const e=await this._getTemplatesFromLayers(t);o(t),this._updateAllItems(e)});this._updateTask=t,await this._updatingHandles.addPromise(t.promise)}};function A(t){for(const e of t){if(f(e))for(const t of e.items)t.destroy();e.destroy()}}function U(t){return _(t)?t.templateInfos.some(U):!c(t.template)||!1!==t.template.visible}t([p()],k.prototype,"_allItems",void 0),t([p()],k.prototype,"_groupByFunction",void 0),t([p()],k.prototype,"_updatingHandles",void 0),t([p()],k.prototype,"disabled",void 0),t([p()],k.prototype,"disabledItemFunction",void 0),t([p({value:null})],k.prototype,"filterFunction",void 0),t([p()],k.prototype,"groupBy",null),t([p({value:[]})],k.prototype,"layers",null),t([p()],k.prototype,"state",null),t([p({readOnly:!0})],k.prototype,"numberOfFeatureTemplates",null),t([p({readOnly:!0})],k.prototype,"items",null),t([p({readOnly:!0})],k.prototype,"selectedItem",void 0),t([p()],k.prototype,"templateInfos",void 0),t([p()],k.prototype,"updating",null),t([p()],k.prototype,"view",void 0),k=t([m("esri.widgets.FeatureTemplates.FeatureTemplatesViewModel")],k);const O=k;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{isTable as s}from"../layers/support/layerUtils.js";import n from"./Widget.js";import{nullGroupBy as l,isTemplateItemGroup as a}from"./FeatureTemplates/featureTemplatesUtils.js";import d from"./FeatureTemplates/FeatureTemplatesViewModel.js";import m from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{ItemList as u}from"./support/ItemList.js";import{fetchThumbnail as h}from"./support/symbolPreviewUtils.js";import"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import{substitute as g}from"../intl/substitute.js";const y={base:"esri-feature-templates"};function I(e){return e.length>0&&a(e[0])}function C(e){return e.id}let w=class extends n{constructor(e,t){super(e,t),this.enableListScroll=!0,this.filterText="",this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.selectionMode="none",this.viewModel=new d,this.visibleElements=new m,this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(async e=>{if(e.isIntersecting){const o=e.target;if(j(o))return void t.unobserve(o);const r=L(o),{layer:i,template:s}=r;M(o,!0);const n=r.label?g(this.messagesLegend.previewTemplateAriaLabel,{label:r.label}):this.messagesCommon.preview,l=await h(s,i,{ariaLabel:n}).catch(()=>(M(o,!1),null));if(null==l)return;o.appendChild(l)}})}),this._renderItemIcon=e=>s(e.layer)?b("span",{"data-has-icon":!0,"data-item":e,key:"icon"},b("calcite-icon",{icon:"table"})):b("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}initialize(){const e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(t(()=>this.viewModel,(t,o)=>{t&&!t.filterFunction&&(this.filterFunction=e),o&&o!==t&&o.filterFunction===e&&(o.filterFunction=null)},o))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get icon(){return"list-rectangle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}select(e,t){return this.viewModel.select(e,t)}render(){const{disabled:e,enableListScroll:t,filterText:o,headingLevel:r,messages:i,viewModel:{items:s,numberOfFeatureTemplates:n,selectedItem:d,state:m}}=this,c=this.visibleElements.filter&&n>1;if(I(s)){const e=s.find(e=>e.label===l.label);e&&(e.label=i.other)}return b("div",{"aria-label":i.widgetLabel,class:this.classes(y.base,p.widget)},"loading"===m?b("calcite-loader",{key:"loader",label:this.messagesCommon.loading,type:"indeterminate"}):"ready"===m?b(u,{disabled:e,enableListScroll:t,filterEnabled:c,filterText:o,headingLevel:r,id:this.id,identify:C,items:s,messages:{filterPlaceholder:i.filterPlaceholder,noItems:i.noItems,noMatches:i.noMatches},renderCustomGroupContent:this.renderCustomGroupContent,renderCustomItem:this.renderCustomItem,renderIcon:this._renderItemIcon,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:d??void 0,selectionMode:this.selectionMode??void 0,onFilterChange:e=>{this.filterText=e},onItemSelect:e=>!a(e)&&this.viewModel.select(e)}):null)}};function L(e){return e?.["data-item"]}function j(e){return!!e?.["data-has-icon"]}function M(e,t){e&&(e["data-has-icon"]=t)}e([r()],w.prototype,"disabled",null),e([r()],w.prototype,"enableListScroll",void 0),e([r()],w.prototype,"filterFunction",null),e([r()],w.prototype,"filterText",void 0),e([r()],w.prototype,"groupBy",null),e([r()],w.prototype,"headingLevel",void 0),e([r()],w.prototype,"icon",null),e([r()],w.prototype,"label",null),e([r()],w.prototype,"layers",null),e([r(),f("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],w.prototype,"messages",void 0),e([r(),f("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([r(),f("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([r({readOnly:!0})],w.prototype,"selectedItem",null),e([r()],w.prototype,"selectionMode",void 0),e([r(),v("select")],w.prototype,"viewModel",void 0),e([r({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([r()],w.prototype,"renderCustomItem",void 0),e([r()],w.prototype,"renderCustomGroupContent",void 0),e([r()],w.prototype,"renderItemLabel",void 0),e([r()],w.prototype,"renderItemDescription",void 0),e([r()],w.prototype,"renderItemContent",void 0),e([r()],w.prototype,"renderItemContentEnd",void 0),w=e([i("esri.widgets.FeatureTemplates")],w);const F=w;export{F as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{isTable as s}from"../layers/support/layerUtils.js";import n from"./Widget.js";import{nullGroupBy as l,isTemplateItemGroup as a}from"./FeatureTemplates/featureTemplatesUtils.js";import d from"./FeatureTemplates/FeatureTemplatesViewModel.js";import m from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{ItemList as u}from"./support/ItemList.js";import{fetchThumbnail as h}from"./support/symbolPreviewUtils.js";import"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as g}from"../intl/substitute.js";const y={base:"esri-feature-templates"};function I(e){return e.length>0&&a(e[0])}function C(e){return e.id}let w=class extends n{constructor(e,t){super(e,t),this.enableListScroll=!0,this.filterText="",this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.selectionMode="none",this.viewModel=new d,this.visibleElements=new m,this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(async e=>{if(e.isIntersecting){const o=e.target;if(j(o))return void t.unobserve(o);const r=L(o),{layer:i,template:s}=r;M(o,!0);const n=r.label?g(this.messagesLegend.previewTemplateAriaLabel,{label:r.label}):this.messagesCommon.preview,l=await h(s,i,{ariaLabel:n}).catch(()=>(M(o,!1),null));if(null==l)return;o.appendChild(l)}})}),this._renderItemIcon=e=>s(e.layer)?b("span",{"data-has-icon":!0,"data-item":e,key:"icon"},b("calcite-icon",{icon:"table"})):b("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}initialize(){const e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(t(()=>this.viewModel,(t,o)=>{t&&!t.filterFunction&&(this.filterFunction=e),o&&o!==t&&o.filterFunction===e&&(o.filterFunction=null)},o))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get icon(){return"list-rectangle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}select(e,t){return this.viewModel.select(e,t)}render(){const{disabled:e,enableListScroll:t,filterText:o,headingLevel:r,messages:i,viewModel:{items:s,numberOfFeatureTemplates:n,selectedItem:d,state:m}}=this,c=this.visibleElements.filter&&n>1;if(I(s)){const e=s.find(e=>e.label===l.label);e&&(e.label=i.other)}return b("div",{"aria-label":i.widgetLabel,class:this.classes(y.base,p.widget)},"loading"===m?b("calcite-loader",{key:"loader",label:this.messagesCommon.loading,type:"indeterminate"}):"ready"===m?b(u,{disabled:e,enableListScroll:t,filterEnabled:c,filterText:o,headingLevel:r,id:this.id,identify:C,items:s,messages:{filterPlaceholder:i.filterPlaceholder,noItems:i.noItems,noMatches:i.noMatches},renderCustomGroupContent:this.renderCustomGroupContent,renderCustomItem:this.renderCustomItem,renderIcon:this._renderItemIcon,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:d??void 0,selectionMode:this.selectionMode??void 0,onFilterChange:e=>{this.filterText=e},onItemSelect:e=>!a(e)&&this.viewModel.select(e)}):null)}};function L(e){return e?.["data-item"]}function j(e){return!!e?.["data-has-icon"]}function M(e,t){e&&(e["data-has-icon"]=t)}e([r()],w.prototype,"disabled",null),e([r()],w.prototype,"enableListScroll",void 0),e([r()],w.prototype,"filterFunction",null),e([r()],w.prototype,"filterText",void 0),e([r()],w.prototype,"groupBy",null),e([r()],w.prototype,"headingLevel",void 0),e([r()],w.prototype,"icon",null),e([r()],w.prototype,"label",null),e([r()],w.prototype,"layers",null),e([r(),f("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],w.prototype,"messages",void 0),e([r(),f("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([r(),f("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([r({readOnly:!0})],w.prototype,"selectedItem",null),e([r()],w.prototype,"selectionMode",void 0),e([r(),v("select")],w.prototype,"viewModel",void 0),e([r({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([r()],w.prototype,"renderCustomItem",void 0),e([r()],w.prototype,"renderCustomGroupContent",void 0),e([r()],w.prototype,"renderItemLabel",void 0),e([r()],w.prototype,"renderItemDescription",void 0),e([r()],w.prototype,"renderItemContent",void 0),e([r()],w.prototype,"renderItemContentEnd",void 0),w=e([i("esri.widgets.FeatureTemplates")],w);const F=w;export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{loadActionUtilsComponents as s,renderAction as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{css as l}from"./css.js";import{zoomToFeature as c}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m,tsxFragment as d}from"../support/jsxFactory.js";import{substitute as u}from"../../intl/substitute.js";const h=c.clone();let f=class extends r{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return Promise.all([s(),n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})])}render(){const{flowItems:e}=this,t=e?.toArray();return m(d,null,t?.map((e,o)=>this._renderFlowItem(e,this.selectLastFlowItem&&o===t.length-1)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const{flowItems:e}=this,t=e?.pop();t&&("activeCategory"in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e,o){const{messages:i,closable:s,closed:r}=this,c="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,p=this._getExitMessage(e),d=i.selectFeature;return m("calcite-flow-item",{bind:this,closable:s,closed:r,description:t(this._getDrillInFlowItemDescription(e)??""),heading:t(e.title??""),key:`flow-item-${e.viewModel.uid}`,selected:o,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},m("calcite-action",{appearance:"transparent",bind:this,class:l.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:p,title:p}),c?m("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,n?m("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},m("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},a(h,{key:`action-${h.uid}`,title:this._getActionTitle(h),text:this._getActionTitle(h),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,m("div",{class:l.container},e.render()))}_getActionTitle(e){const{messages:t}=this,o=e.title??"";return"zoom-to-feature"===e.id?u(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}};e([o()],f.prototype,"flowItems",void 0),e([o(),p("esri/widgets/Features/t9n/Features")],f.prototype,"messages",void 0),e([o()],f.prototype,"closed",void 0),e([o()],f.prototype,"closable",void 0),e([o()],f.prototype,"selectLastFlowItem",void 0),f=e([i("esri.widgets.Features.FeaturesDrillIn")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{loadActionUtilsComponents as s,renderAction as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{css as l}from"./css.js";import{zoomToFeature as c}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m,tsxFragment as d}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as u}from"../../intl/substitute.js";const h=c.clone();let f=class extends r{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return Promise.all([s(),n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})])}render(){const{flowItems:e}=this,t=e?.toArray();return m(d,null,t?.map((e,o)=>this._renderFlowItem(e,this.selectLastFlowItem&&o===t.length-1)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const{flowItems:e}=this,t=e?.pop();t&&("activeCategory"in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e,o){const{messages:i,closable:s,closed:r}=this,c="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,p=this._getExitMessage(e),d=i.selectFeature;return m("calcite-flow-item",{bind:this,closable:s,closed:r,description:t(this._getDrillInFlowItemDescription(e)??""),heading:t(e.title??""),key:`flow-item-${e.viewModel.uid}`,selected:o,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},m("calcite-action",{appearance:"transparent",bind:this,class:l.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:p,title:p}),c?m("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,n?m("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},m("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},a(h,{key:`action-${h.uid}`,title:this._getActionTitle(h),text:this._getActionTitle(h),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,m("div",{class:l.container},e.render()))}_getActionTitle(e){const{messages:t}=this,o=e.title??"";return"zoom-to-feature"===e.id?u(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}};e([o()],f.prototype,"flowItems",void 0),e([o(),p("esri/widgets/Features/t9n/Features")],f.prototype,"messages",void 0),e([o()],f.prototype,"closed",void 0),e([o()],f.prototype,"closable",void 0),e([o()],f.prototype,"selectLastFlowItem",void 0),f=e([i("esri.widgets.Features.FeaturesDrillIn")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as n,when as r}from"../core/reactiveUtils.js";import{waitAnimationFrame as l}from"../core/scheduling.js";import{throttle as a}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as u}from"../geometry/support/geometryUtils.js";import{loadActionUtilsComponents as h,substituteActionImage as p,getActionStyles as m,renderAction as v}from"../support/actions/actionUtils.js";import g from"./Feature.js";import w from"./Spinner.js";import _ from"./Widget.js";import{css as M}from"./Feature/resources.js";import{FeatureContentMixin as f}from"./Feature/support/FeatureContentMixin.js";import{css as F}from"./Features/css.js";import y from"./Features/FeaturesDrillIn.js";import b from"./Features/FeaturesViewModel.js";import I from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as C}from"./Popup/actions.js";import{zoomToLocation as x}from"./Popup/actionUtils.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{Heading as N}from"./support/Heading.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as L}from"./support/jsxFactory.js";import{substitute as j}from"../intl/substitute.js";import{formatNumber as W}from"../intl/number.js";const D="selected-index",B=0,S="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(f(_)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new y({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new C,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new b,this.visibleElements=new I,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=a(()=>this._displaySpinner(),B),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,n),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>x(this.viewModel,e))])}loadDependencies(){return Promise.all([h(),A({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new g({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(D);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(r(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return L("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(F.base,T.widget,T.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o}=t;return L("div",{class:F.paginationText,key:"feature-pagination-text"},j(e.pageText,{index:W(o+1),total:W(i)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return L("calcite-action",{appearance:"solid",bind:this,class:F.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._handlePaginationMenuButton,scale:"s",text:j(e.pageText,{index:W(o+1),total:W(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return L("calcite-action-bar",{class:F.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},L("calcite-action-group",{scale:"s"},L("calcite-action",{appearance:"solid",class:F.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),L("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return L("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},L("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?L("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?L("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?L("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?L("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return L("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[F.contentFeature]:!0,[F.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?L(N,{class:this.classes(F.featuresHeading,T.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),L("div",{class:this.classes(F.container,F.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:t,featureMenuTitle:i,messages:o,messagesCommon:s,initialDisplayMode:n,featureMenuOpen:r,selectedFeature:l,_collapseEnabled:a,_isCollapsed:d,featureNavigationTop:c,headingLevel:u}=this,{active:h,featureViewModels:p,pendingPromisesCount:m}=e,{featureMenuHeading:v}=t,g=i??o.selectFeature;if("feature"===n&&!r)return null;const w="list"===n?!l:r;return L("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[F.flowItemCollapsed]:d}),closable:"list"===n&&t.closeButton,closed:!h,collapsed:"list"===n&&d,collapseDirection:c?"down":"up",collapsible:"list"===n&&a,description:v?j(o.total,{total:p.length}):void 0,heading:v?g:void 0,headingLevel:u,key:"feature-menu",loading:e.waitingForContents,selected:w,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===n?this._renderHeaderActions():null,m>0?L("calcite-loader",{class:F.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,L("div",{class:F.container},this._renderFeatureMenu()),L("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:F.featureMenuObserver}),"feature"===n?L("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?L("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=p({action:e,feature:this.selectedFeature}),s={[F.icon]:!!t,[F.actionImage]:!!o};return t&&(s[t]=!0),o||t?L("span",{"aria-hidden":"true",class:this.classes(F.icon,s),key:"icon",styles:m(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?L("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},L("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return v(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?L("div",{class:M.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=u(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await o(l(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");k(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?j(r,{messages:t}):"remove-selected-feature"===s?j(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?j(r,{messages:t}):e.title;return l&&n?j(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,D)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new w({view:e}),e.ui.add(this._spinner,{key:S,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,S),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([d()],H.prototype,"_drillInFlowItems",void 0),e([d()],H.prototype,"_hideActionText",null),e([d()],H.prototype,"_featureNavigationVisible",null),e([d()],H.prototype,"_isCollapsed",null),e([d()],H.prototype,"_collapseEnabled",null),e([d({readOnly:!0})],H.prototype,"active",null),e([d()],H.prototype,"collapsed",void 0),e([d()],H.prototype,"content",null),e([d()],H.prototype,"icon",null),e([d()],H.prototype,"featureMenuOpen",null),e([d()],H.prototype,"featureMenuTitle",null),e([d()],H.prototype,"featureNavigationTop",void 0),e([d()],H.prototype,"features",null),e([d()],H.prototype,"goToOverride",null),e([d({type:C})],H.prototype,"headerActions",void 0),e([d()],H.prototype,"headingLevel",void 0),e([d()],H.prototype,"initialDisplayMode",null),e([d()],H.prototype,"location",null),e([d()],H.prototype,"label",null),e([d()],H.prototype,"map",null),e([d(),O("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([d(),O("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([d()],H.prototype,"promises",null),e([d()],H.prototype,"responsiveActionsEnabled",void 0),e([d({readOnly:!0})],H.prototype,"selectedFeature",null),e([d({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([d()],H.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([d()],H.prototype,"spatialReference",null),e([d()],H.prototype,"title",null),e([d()],H.prototype,"timeZone",null),e([d()],H.prototype,"updateLocationEnabled",null),e([d()],H.prototype,"view",null),e([d({type:b}),E(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([d({type:I,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([d()],H.prototype,"visible",null),H=e([c("esri.widgets.Features")],H);export{H as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as n,when as r}from"../core/reactiveUtils.js";import{waitAnimationFrame as l}from"../core/scheduling.js";import{throttle as a}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as u}from"../geometry/support/geometryUtils.js";import{loadActionUtilsComponents as h,substituteActionImage as p,getActionStyles as m,renderAction as v}from"../support/actions/actionUtils.js";import g from"./Feature.js";import w from"./Spinner.js";import _ from"./Widget.js";import{css as M}from"./Feature/resources.js";import{FeatureContentMixin as f}from"./Feature/support/FeatureContentMixin.js";import{css as F}from"./Features/css.js";import y from"./Features/FeaturesDrillIn.js";import b from"./Features/FeaturesViewModel.js";import I from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as C}from"./Popup/actions.js";import{zoomToLocation as x}from"./Popup/actionUtils.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{Heading as N}from"./support/Heading.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as L}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as j}from"../intl/substitute.js";import{formatNumber as W}from"../intl/number.js";const D="selected-index",B=0,S="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(f(_)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new y({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new C,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new b,this.visibleElements=new I,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=a(()=>this._displaySpinner(),B),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,n),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>x(this.viewModel,e))])}loadDependencies(){return Promise.all([h(),A({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new g({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(D);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(r(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return L("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(F.base,T.widget,T.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o}=t;return L("div",{class:F.paginationText,key:"feature-pagination-text"},j(e.pageText,{index:W(o+1),total:W(i)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return L("calcite-action",{appearance:"solid",bind:this,class:F.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._handlePaginationMenuButton,scale:"s",text:j(e.pageText,{index:W(o+1),total:W(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return L("calcite-action-bar",{class:F.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},L("calcite-action-group",{scale:"s"},L("calcite-action",{appearance:"solid",class:F.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),L("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return L("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},L("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?L("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?L("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?L("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?L("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return L("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[F.contentFeature]:!0,[F.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?L(N,{class:this.classes(F.featuresHeading,T.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),L("div",{class:this.classes(F.container,F.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:t,featureMenuTitle:i,messages:o,messagesCommon:s,initialDisplayMode:n,featureMenuOpen:r,selectedFeature:l,_collapseEnabled:a,_isCollapsed:d,featureNavigationTop:c,headingLevel:u}=this,{active:h,featureViewModels:p,pendingPromisesCount:m}=e,{featureMenuHeading:v}=t,g=i??o.selectFeature;if("feature"===n&&!r)return null;const w="list"===n?!l:r;return L("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[F.flowItemCollapsed]:d}),closable:"list"===n&&t.closeButton,closed:!h,collapsed:"list"===n&&d,collapseDirection:c?"down":"up",collapsible:"list"===n&&a,description:v?j(o.total,{total:p.length}):void 0,heading:v?g:void 0,headingLevel:u,key:"feature-menu",loading:e.waitingForContents,selected:w,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===n?this._renderHeaderActions():null,m>0?L("calcite-loader",{class:F.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,L("div",{class:F.container},this._renderFeatureMenu()),L("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:F.featureMenuObserver}),"feature"===n?L("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?L("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=p({action:e,feature:this.selectedFeature}),s={[F.icon]:!!t,[F.actionImage]:!!o};return t&&(s[t]=!0),o||t?L("span",{"aria-hidden":"true",class:this.classes(F.icon,s),key:"icon",styles:m(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?L("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},L("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return v(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?L("div",{class:M.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=u(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await o(l(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");k(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?j(r,{messages:t}):"remove-selected-feature"===s?j(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?j(r,{messages:t}):e.title;return l&&n?j(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,D)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new w({view:e}),e.ui.add(this._spinner,{key:S,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,S),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([d()],H.prototype,"_drillInFlowItems",void 0),e([d()],H.prototype,"_hideActionText",null),e([d()],H.prototype,"_featureNavigationVisible",null),e([d()],H.prototype,"_isCollapsed",null),e([d()],H.prototype,"_collapseEnabled",null),e([d({readOnly:!0})],H.prototype,"active",null),e([d()],H.prototype,"collapsed",void 0),e([d()],H.prototype,"content",null),e([d()],H.prototype,"icon",null),e([d()],H.prototype,"featureMenuOpen",null),e([d()],H.prototype,"featureMenuTitle",null),e([d()],H.prototype,"featureNavigationTop",void 0),e([d()],H.prototype,"features",null),e([d()],H.prototype,"goToOverride",null),e([d({type:C})],H.prototype,"headerActions",void 0),e([d()],H.prototype,"headingLevel",void 0),e([d()],H.prototype,"initialDisplayMode",null),e([d()],H.prototype,"location",null),e([d()],H.prototype,"label",null),e([d()],H.prototype,"map",null),e([d(),O("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([d(),O("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([d()],H.prototype,"promises",null),e([d()],H.prototype,"responsiveActionsEnabled",void 0),e([d({readOnly:!0})],H.prototype,"selectedFeature",null),e([d({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([d()],H.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([d()],H.prototype,"spatialReference",null),e([d()],H.prototype,"title",null),e([d()],H.prototype,"timeZone",null),e([d()],H.prototype,"updateLocationEnabled",null),e([d()],H.prototype,"view",null),e([d({type:b}),E(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([d({type:I,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([d()],H.prototype,"visible",null),H=e([c("esri.widgets.Features")],H);export{H as default};