@arcgis/core 5.0.0-next.14 → 5.0.0-next.16

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 (366) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
  7. package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
  9. package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
  12. package/assets/esri/core/workers/chunks/71d9e9b0a7f8c0edd32d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
  14. package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
  15. package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
  17. package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
  18. package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
  23. package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
  24. package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
  25. package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
  28. package/chunks/GaussianSplat.glsl.js +2 -2
  29. package/config.js +1 -1
  30. package/copyright.txt +0 -60
  31. package/core/SetUtils.js +1 -1
  32. package/core/accessorSupport/ensureType.js +1 -1
  33. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  34. package/core/workers/workerFactory.js +1 -1
  35. package/identity/IdentityModal.js +1 -1
  36. package/interfaces.d.ts +107 -11
  37. package/intl.js +1 -1
  38. package/kernel.js +1 -1
  39. package/layers/ImageryTileLayer.js +1 -1
  40. package/layers/ParquetLayer.js +1 -1
  41. package/layers/graphics/sources/ParquetSource.js +1 -1
  42. package/layers/graphics/sources/support/QueryTask.js +1 -1
  43. package/layers/mixins/ArcGISImageService.js +1 -1
  44. package/layers/mixins/ImageryTileMixin.js +1 -1
  45. package/layers/support/NumberFieldFormat.js +1 -1
  46. package/layers/support/Sublayer.js +1 -1
  47. package/layers/support/SubtypeSublayer.js +1 -1
  48. package/layers/support/featureLayerUtils.js +1 -1
  49. package/layers/support/fieldUtils.js +1 -1
  50. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  51. package/layers/support/rasterFunctionUtils.js +1 -1
  52. package/package.json +1 -1
  53. package/popup/content.js +1 -1
  54. package/portal/schemas/definitions.js +1 -1
  55. package/renderers/support/numberUtils.js +1 -1
  56. package/rest/geometryService.js +1 -1
  57. package/rest/geoprocessor.js +1 -1
  58. package/rest/imageService.js +1 -1
  59. package/rest/locator.js +1 -1
  60. package/rest/query.js +1 -1
  61. package/smartMapping/labels/bins.js +1 -1
  62. package/smartMapping/popup/support/clusterUtils.js +1 -1
  63. package/smartMapping/popup/support/utils.js +1 -1
  64. package/smartMapping/renderers/support/utils.js +1 -1
  65. package/support/BasemapStyle.js +1 -1
  66. package/support/actions/actionUtils.js +1 -1
  67. package/support/revision.js +1 -1
  68. package/symbols/support/svgUtils.js +1 -1
  69. package/tables/elements.js +1 -1
  70. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  71. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  72. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  73. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  74. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  75. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  76. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  77. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  78. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  79. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  80. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  81. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  82. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  83. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  84. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -32
  85. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +17 -0
  86. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +10 -0
  87. package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
  88. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
  89. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  90. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  91. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  92. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  93. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +5 -0
  94. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +5 -0
  95. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  96. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  97. package/views/draw/support/Reshape.js +1 -1
  98. package/views/input/gamepad/GamepadInputDevice.js +1 -1
  99. package/views/input/gamepad/GamepadSource.js +1 -1
  100. package/views/interactive/SegmentLabels.js +1 -1
  101. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  102. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  103. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  104. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  105. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  106. package/views/interactive/tooltip/content/Fields.js +1 -1
  107. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  108. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  109. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  110. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  111. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  112. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  113. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  114. package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
  115. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  117. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  118. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  119. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  120. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  121. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  122. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  123. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  124. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  125. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  126. package/views/overlay/BoxOverlayItem.js +1 -1
  127. package/views/overlay/CrosshairOverlayItem.js +1 -1
  128. package/views/overlay/OutlineOverlayItem.js +1 -1
  129. package/views/ui/UI.js +1 -1
  130. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  131. package/widgets/AreaMeasurement2D.js +1 -1
  132. package/widgets/AreaMeasurement3D.js +1 -1
  133. package/widgets/Attachments.js +1 -1
  134. package/widgets/Attribution.js +1 -1
  135. package/widgets/BasemapGallery.js +1 -1
  136. package/widgets/BasemapLayerList.js +1 -1
  137. package/widgets/BasemapToggle.js +1 -1
  138. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  139. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  140. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  141. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  142. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  143. package/widgets/BatchAttributeForm.js +1 -1
  144. package/widgets/Bookmarks.js +1 -1
  145. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  146. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  147. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  148. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  149. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  150. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  151. package/widgets/BuildingExplorer.js +1 -1
  152. package/widgets/CatalogLayerList.js +1 -1
  153. package/widgets/Compass.js +1 -1
  154. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  155. package/widgets/CoordinateConversion.js +1 -1
  156. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  157. package/widgets/Daylight.js +1 -1
  158. package/widgets/DirectLineMeasurement3D.js +1 -1
  159. package/widgets/DirectionalPad.js +1 -1
  160. package/widgets/Directions.js +1 -1
  161. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  162. package/widgets/DistanceMeasurement2D.js +1 -1
  163. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  164. package/widgets/Editor/EditorViewModel.js +1 -1
  165. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  166. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  167. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  168. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  169. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  170. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  171. package/widgets/Editor/UpdateWorkflow.js +1 -1
  172. package/widgets/Editor/Workflow.js +1 -1
  173. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  174. package/widgets/Editor/components/FeatureList.js +1 -1
  175. package/widgets/Editor/components/FooterActions.js +1 -1
  176. package/widgets/Editor/components/MergeFeaturesList.js +1 -1
  177. package/widgets/Editor/components/Notices.js +1 -1
  178. package/widgets/Editor/components/PanelContent.js +1 -1
  179. package/widgets/Editor/components/PanelToolbar.js +1 -1
  180. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  181. package/widgets/Editor/components/Prompt.js +1 -1
  182. package/widgets/Editor/components/Settings.js +1 -1
  183. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  184. package/widgets/Editor/components/UploadDetails.js +1 -1
  185. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  186. package/widgets/Editor/support/errors.js +1 -1
  187. package/widgets/Editor.js +1 -1
  188. package/widgets/ElevationProfile/components/Legend.js +1 -1
  189. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  190. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  191. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  192. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  193. package/widgets/ElevationProfile.js +1 -1
  194. package/widgets/Expand.js +1 -1
  195. package/widgets/Feature/FeatureAttachments.js +1 -1
  196. package/widgets/Feature/FeatureContent.js +1 -1
  197. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  198. package/widgets/Feature/FeatureExpression.js +1 -1
  199. package/widgets/Feature/FeatureFields.js +1 -1
  200. package/widgets/Feature/FeatureMedia.js +1 -1
  201. package/widgets/Feature/FeatureRelationship.js +1 -1
  202. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  203. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  204. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  205. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  206. package/widgets/Feature.js +1 -1
  207. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  208. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  209. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  210. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  211. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  212. package/widgets/FeatureForm.js +1 -1
  213. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  214. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  215. package/widgets/FeatureTable.js +1 -1
  216. package/widgets/FeatureTemplates.js +1 -1
  217. package/widgets/Features/FeaturesDrillIn.js +1 -1
  218. package/widgets/Features.js +1 -1
  219. package/widgets/FloorFilter.js +1 -1
  220. package/widgets/FovOverlay.js +1 -1
  221. package/widgets/Fullscreen.js +1 -1
  222. package/widgets/Histogram.js +1 -1
  223. package/widgets/HistogramRangeSlider.js +1 -1
  224. package/widgets/Home.js +1 -1
  225. package/widgets/LayerList/LayerListItem.js +1 -1
  226. package/widgets/LayerList/ListItemPanel.js +1 -1
  227. package/widgets/LayerList.js +1 -1
  228. package/widgets/Legend/LegendViewModel.js +1 -1
  229. package/widgets/Legend/styles/card/CardView.js +1 -1
  230. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  231. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  232. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  233. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  234. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  235. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  236. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  237. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  238. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  239. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  240. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  241. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  242. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  243. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  244. package/widgets/Legend/styles/support/utils.js +1 -1
  245. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  246. package/widgets/Legend/support/styleUtils.js +1 -1
  247. package/widgets/Legend/support/utils.js +1 -1
  248. package/widgets/Legend.js +1 -1
  249. package/widgets/LineOfSight.js +1 -1
  250. package/widgets/Locate/LocateViewModel.js +1 -1
  251. package/widgets/Locate.js +1 -1
  252. package/widgets/Measurement.js +1 -1
  253. package/widgets/NavigationToggle.js +1 -1
  254. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  255. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  256. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  257. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  258. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  259. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  260. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  261. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  262. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  263. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  264. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  265. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  266. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  267. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  268. package/widgets/OrientedImageryViewer.js +1 -1
  269. package/widgets/PanoramicVideoViewer.js +1 -1
  270. package/widgets/PanoramicViewer.js +1 -1
  271. package/widgets/Popup.js +1 -1
  272. package/widgets/Print/FileLink.js +1 -1
  273. package/widgets/Print.js +1 -1
  274. package/widgets/ScaleBar.js +1 -1
  275. package/widgets/ScaleRangeSlider.js +1 -1
  276. package/widgets/Search/SearchResultRenderer.js +1 -1
  277. package/widgets/Search/support/layerSearchUtils.js +1 -1
  278. package/widgets/Search.js +1 -1
  279. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  280. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  281. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  282. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  283. package/widgets/ShadowCast.js +1 -1
  284. package/widgets/Sketch/SketchViewModel.js +1 -1
  285. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  286. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  287. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  288. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  289. package/widgets/Sketch.js +1 -1
  290. package/widgets/Slice.js +1 -1
  291. package/widgets/Slider.js +1 -1
  292. package/widgets/Spinner.js +1 -1
  293. package/widgets/Swipe.js +1 -1
  294. package/widgets/TableList/ListItemPanel.js +1 -1
  295. package/widgets/TableList.js +1 -1
  296. package/widgets/TimeSlider.js +1 -1
  297. package/widgets/TimeZoneLabel.js +1 -1
  298. package/widgets/Track.js +1 -1
  299. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  300. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  301. package/widgets/UtilityNetworkAssociations.js +1 -1
  302. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  303. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  304. package/widgets/UtilityNetworkTrace.js +1 -1
  305. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  306. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  307. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  308. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  309. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  310. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  311. package/widgets/ValuePicker.js +1 -1
  312. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  313. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  314. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  315. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  316. package/widgets/VideoPlayer.js +1 -1
  317. package/widgets/Weather/LabeledSlider.js +1 -1
  318. package/widgets/Weather.js +1 -1
  319. package/widgets/Widget.js +1 -1
  320. package/widgets/Zoom.js +1 -1
  321. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  322. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  323. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  324. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  325. package/widgets/smartMapping/ColorSlider.js +1 -1
  326. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  327. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  328. package/widgets/smartMapping/OpacitySlider.js +1 -1
  329. package/widgets/smartMapping/SizeSlider.js +1 -1
  330. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  331. package/widgets/support/ColorPicker.js +1 -1
  332. package/widgets/support/FilterBuilder.js +1 -1
  333. package/widgets/support/FilterCondition.js +1 -1
  334. package/widgets/support/GridControls.js +1 -1
  335. package/widgets/support/Heading.js +1 -1
  336. package/widgets/support/ItemList.js +1 -1
  337. package/widgets/support/LabeledSwitch.js +1 -1
  338. package/widgets/support/MeasurementWidgetContent.js +1 -1
  339. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  340. package/widgets/support/SelectionList/LayerItem.js +1 -1
  341. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  342. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  343. package/widgets/support/SelectionList.js +1 -1
  344. package/widgets/support/SelectionToolbar.js +1 -1
  345. package/widgets/support/SketchTooltipControls.js +1 -1
  346. package/widgets/support/SnappingControls.js +1 -1
  347. package/widgets/support/TimezonePicker.js +1 -1
  348. package/widgets/support/UnitSelect.js +1 -1
  349. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  350. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
  351. package/widgets/support/chartUtilsAm5.js +1 -1
  352. package/widgets/support/dateUtils.js +1 -1
  353. package/widgets/support/iconUtils.js +1 -1
  354. package/widgets/support/widget.js +1 -1
  355. package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +0 -1
  356. package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
  357. package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
  358. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
  359. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
  361. package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
  362. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
  363. package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
  364. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  365. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
  366. package/widgets/support/jsxFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import{abortMaybe as i,destroyMaybe as s}from"../core/maybe.js";import{memoize as n}from"../core/memoize.js";import{throwIfAborted as r,createAbortError as o}from"../core/promiseUtils.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./ElevationProfile/css.js";import u from"./ElevationProfile/ElevationProfileViewModel.js";import m from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as _}from"./ElevationProfile/components/Legend.js";import{SettingsButton as v}from"./ElevationProfile/components/SettingsButton.js";import{getConfig as C}from"./ElevationProfile/support/constants.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as y}from"./support/decorators/messageBundle.js";import{tsx as b,tsxFragment as w}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const k=[{type:"select"},{type:"sketch"}],M={none:null,"no-valid-input":"noProfile","no-visible-profiles":"noProfile","refined-but-no-chart-data":"noProfile","too-complex":"tooComplex","unknown-error":"unknown","invalid-geometry":"invalidGeometry","invalid-elevation-info":"invalidElevationInfo"};let B=class extends d{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new m,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=n((t,e,i,s)=>({chart:t,data:e,stationary:i,messages:s})),this._onZoomOutButtonClick=()=>{this._chart?.zoomOut()},this._onClearButtonClick=()=>{this.viewModel.clear()},t?.viewModel||(this._defaultViewModel=new u({view:t?.view}),this.viewModel=this._defaultViewModel)}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}postInitialize(){this.addHandles([a(()=>({container:this._chartContainer}),({container:t})=>{this._destroyChart(),null!=t&&this._initializeChart(t)},l),a(()=>this._chartUpdateParams,()=>this._updateChart(this._chartUpdateParams),l)])}destroy(){this._destroyChart(),null!=this._defaultViewModel&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get icon(){return"altitude"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get test(){return{chart:this._chart}}get _selectButtonVisible(){return!0===this.visibleElements.selectButton&&this.viewModel.selectAvailable}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,null==t||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _profilesArray(){return this.profiles.toArray()}render(){const{viewModel:t,visible:e}=this;return b("div",{"aria-label":this.messages.widgetLabel,class:this.classes({[p.base]:e,[f.widget]:e,[f.panel]:e,[f.widgetDisabled]:e&&"disabled"===t.state,[p.refined]:1===t.progress}),key:this},b("div",{bind:this,key:"content-wrapper"},e?this._renderContentForState():null))}_renderContentForState(){switch(this.viewModel.state){case"ready":case"disabled":return this._renderContentForReadyState();case"selecting":return this._renderContentForSelectingState();case"creating":return this._renderContentForCreatingState();case"selected":return this._renderContentForSelectedState();case"created":return this._renderContentForCreatedState()}}_renderContentForReadyState(){const{messages:t,visibleElements:e,_selectButtonVisible:i}=this,{sketchButton:s}=e;let n;return n=s&&i?t.readyPrompt:s?t.readyPromptCreateOnly:i?t.readyPromptSelectOnly:t.errors?.noProfile,this._renderContent({prompt:n,chart:!1,actions:k})}_renderContentForSelectingState(){const{view:t}=this;if(null==t)return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:"select-cancel"}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(null==t)return null;const i=e.hasVertices?[{type:"sketch-cancel"},{type:"sketch-done",disabled:!e.tool.interaction.canStopCreating}]:[{type:"select"},{type:"sketch",disabled:!0}];if("no-valid-input"===e.errorState){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:i,prompt:e})}const s=this._getErrorMessage();return s?this._renderContent({chart:!1,actions:i,prompt:s}):this._renderContent({chart:!0,actions:i})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_getErrorMessage(){const t=M[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=null!=t.prompt?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),{viewModel:i}=this,s=null!=i.input;return b(w,null,b("header",{class:p.header,key:"header"},this._zoomOutButtonVisible?this._renderZoomOutButton():null,this.visibleElements.clearButton&&s?this._renderClearButton():null,this.visibleElements.settingsButton?b(v,{messages:this.messages,uniformChartScaling:i.uniformChartScaling,unit:i.unit,unitOptions:i.unitOptions,visibleElements:this.visibleElements,onUniformChartScalingChange:t=>i.uniformChartScaling=t,onUnitChange:t=>i.unit=t}):null),b("div",{class:p.mainContainer,key:"main-container"},e),this.visibleElements.legend?b(_,{effectiveUnits:i.effectiveUnits,messages:this.messages,profiles:this._profilesArray}):null,this._renderActions(t))}_renderZoomOutButton(){const t=this.messages.zoomOut;return b("calcite-action",{appearance:"transparent",class:p.zoomOutButton,"data-testid":"zoom-out-button",icon:"magnifying-glass-minus",key:"zoom-out",onclick:this._onZoomOutButtonClick,scale:"s",text:t,title:t})}_renderClearButton(){const t=this.messages.clearProfile;return b("calcite-action",{appearance:"transparent",class:p.clearButton,"data-testid":"clear-button",icon:"trash",key:"clear-profile",onclick:this._onClearButtonClick,scale:"s",text:t,title:t})}_renderPrompt(t){return[b("div",{bind:this,class:p.promptContainer,key:"prompt-container"},b("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return b("div",{class:p.chartContainer,key:"empty-chart-container"});const{chartData:t,progress:e}=this.viewModel,i=this._chartIsRefined||this._canRenderChart(),s=null!=t&&e<1;return i?b(w,null,this._renderSpinner({size:i?"small":"large",visible:s}),b("div",{afterCreate:this._onChartContainerUpdate,afterRemoved:this._onChartContainerRemoved,afterUpdate:this._onChartContainerUpdate,bind:this,class:p.chartContainer,key:"chart-container"})):b(w,null,this._renderSpinner({size:"large",visible:s}),b("div",{class:p.chartContainer,key:"chart-container-empty"}))}_renderSpinner(t){const e="small"===t.size,i=t.visible??!0;return b("calcite-loader",{class:this.classes(p.chartSpinner,e&&p.chartSpinnerSmall,i&&p.chartSpinnerVisible),"data-testid":"chart-spinner",inline:e,key:"spinner",label:"",scale:"s"})}_canRenderChart(){const t=this.viewModel.chartData;if(null==t)return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=null!=i?i.length:0;return t.refined||e<=C().largeChartSamples}_renderActions({actions:t}){const e=t.map(t=>{switch(t.type){case"sketch":return this.visibleElements.sketchButton&&this._renderAction({action:t,className:p.sketchButton,label:this.messages.sketchButtonLabel,onClick:this._onSketchButtonClick,primary:!0});case"sketch-cancel":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.sketchCancelButton,label:this.messagesCommon.cancel,primary:!1});case"sketch-done":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:p.sketchDoneButton,label:this.messagesCommon.done,primary:!0});case"select":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:p.selectButton,label:this.messages.selectButtonLabel,primary:!1});case"select-cancel":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.selectCancelButton,label:this.messagesCommon.cancel,primary:!1})}}).filter(Boolean);return e.length?b("footer",{class:p.footer,key:"footer"},e):null}_renderAction({action:t,className:e,label:i,onClick:s,primary:n}){return b("calcite-button",{appearance:n?"solid":"outline-fill",bind:this,class:this.classes(p.actionButton,e),disabled:t.disabled,key:`action-${t.type}`,onclick:s},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:s,stationary:n}=t;null!=i&&null!=s&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=null!=e&&e.refined)}_onChartContainerUpdate(t){this._chartContainer=t}_onChartContainerRemoved(t){this._chartContainer===t&&(this._chartContainer=null)}_initializeChart(t){i(this._chartInitTask),this._chartInitTask=e(async e=>{const{createChart:i}=await import("./ElevationProfile/support/chartUtils.js");r(e);const n=await i({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw s(n),o();this._chart=n,this._updateChart(this._chartUpdateParams)})}_destroyChart(){this._chartInitTask=i(this._chartInitTask),this._chart=s(this._chart),this._chartIsRefined=!1}};t([c({type:u})],B.prototype,"viewModel",void 0),t([c()],B.prototype,"view",null),t([c()],B.prototype,"input",null),t([c()],B.prototype,"profiles",null),t([c()],B.prototype,"unitOptions",null),t([c()],B.prototype,"unit",null),t([c({type:m,nonNullable:!0})],B.prototype,"visibleElements",void 0),t([c()],B.prototype,"icon",null),t([c()],B.prototype,"label",null),t([c()],B.prototype,"visible",null),t([c(),y("esri/widgets/ElevationProfile/t9n/ElevationProfile")],B.prototype,"messages",void 0),t([c(),y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),t([c(),y("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([c()],B.prototype,"_chartContainer",void 0),t([c()],B.prototype,"_chart",void 0),t([c()],B.prototype,"_chartInitTask",void 0),t([c()],B.prototype,"_chartIsRefined",void 0),t([c()],B.prototype,"_zoomOutButtonVisible",void 0),t([c()],B.prototype,"_selectButtonVisible",null),t([c()],B.prototype,"_chartUpdateParams",null),t([c()],B.prototype,"_chartMessages",null),t([c()],B.prototype,"_profilesArray",null),B=t([h("esri.widgets.ElevationProfile")],B);const S=B;export{S as default};
5
+ import{__decorate as t}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import{abortMaybe as i,destroyMaybe as s}from"../core/maybe.js";import{memoize as n}from"../core/memoize.js";import{throwIfAborted as r,createAbortError as o}from"../core/promiseUtils.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./ElevationProfile/css.js";import u from"./ElevationProfile/ElevationProfileViewModel.js";import m from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as _}from"./ElevationProfile/components/Legend.js";import{SettingsButton as v}from"./ElevationProfile/components/SettingsButton.js";import{getConfig as C}from"./ElevationProfile/support/constants.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{messageBundle as y,tsx as b,tsxFragment as w}from"./support/widget.js";const k=[{type:"select"},{type:"sketch"}],M={none:null,"no-valid-input":"noProfile","no-visible-profiles":"noProfile","refined-but-no-chart-data":"noProfile","too-complex":"tooComplex","unknown-error":"unknown","invalid-geometry":"invalidGeometry","invalid-elevation-info":"invalidElevationInfo"};let B=class extends d{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new m,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=n((t,e,i,s)=>({chart:t,data:e,stationary:i,messages:s})),this._onZoomOutButtonClick=()=>{this._chart?.zoomOut()},this._onClearButtonClick=()=>{this.viewModel.clear()},t?.viewModel||(this._defaultViewModel=new u({view:t?.view}),this.viewModel=this._defaultViewModel)}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}postInitialize(){this.addHandles([a(()=>({container:this._chartContainer}),({container:t})=>{this._destroyChart(),null!=t&&this._initializeChart(t)},l),a(()=>this._chartUpdateParams,()=>this._updateChart(this._chartUpdateParams),l)])}destroy(){this._destroyChart(),null!=this._defaultViewModel&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get icon(){return"altitude"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get test(){return{chart:this._chart}}get _selectButtonVisible(){return!0===this.visibleElements.selectButton&&this.viewModel.selectAvailable}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,null==t||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _profilesArray(){return this.profiles.toArray()}render(){const{viewModel:t,visible:e}=this;return b("div",{"aria-label":this.messages.widgetLabel,class:this.classes({[p.base]:e,[f.widget]:e,[f.panel]:e,[f.widgetDisabled]:e&&"disabled"===t.state,[p.refined]:1===t.progress}),key:this},b("div",{bind:this,key:"content-wrapper"},e?this._renderContentForState():null))}_renderContentForState(){switch(this.viewModel.state){case"ready":case"disabled":return this._renderContentForReadyState();case"selecting":return this._renderContentForSelectingState();case"creating":return this._renderContentForCreatingState();case"selected":return this._renderContentForSelectedState();case"created":return this._renderContentForCreatedState()}}_renderContentForReadyState(){const{messages:t,visibleElements:e,_selectButtonVisible:i}=this,{sketchButton:s}=e;let n;return n=s&&i?t.readyPrompt:s?t.readyPromptCreateOnly:i?t.readyPromptSelectOnly:t.errors?.noProfile,this._renderContent({prompt:n,chart:!1,actions:k})}_renderContentForSelectingState(){const{view:t}=this;if(null==t)return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:"select-cancel"}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(null==t)return null;const i=e.hasVertices?[{type:"sketch-cancel"},{type:"sketch-done",disabled:!e.tool.interaction.canStopCreating}]:[{type:"select"},{type:"sketch",disabled:!0}];if("no-valid-input"===e.errorState){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:i,prompt:e})}const s=this._getErrorMessage();return s?this._renderContent({chart:!1,actions:i,prompt:s}):this._renderContent({chart:!0,actions:i})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_getErrorMessage(){const t=M[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=null!=t.prompt?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),{viewModel:i}=this,s=null!=i.input;return b(w,null,b("header",{class:p.header,key:"header"},this._zoomOutButtonVisible?this._renderZoomOutButton():null,this.visibleElements.clearButton&&s?this._renderClearButton():null,this.visibleElements.settingsButton?b(v,{messages:this.messages,uniformChartScaling:i.uniformChartScaling,unit:i.unit,unitOptions:i.unitOptions,visibleElements:this.visibleElements,onUniformChartScalingChange:t=>i.uniformChartScaling=t,onUnitChange:t=>i.unit=t}):null),b("div",{class:p.mainContainer,key:"main-container"},e),this.visibleElements.legend?b(_,{effectiveUnits:i.effectiveUnits,messages:this.messages,profiles:this._profilesArray}):null,this._renderActions(t))}_renderZoomOutButton(){const t=this.messages.zoomOut;return b("calcite-action",{appearance:"transparent",class:p.zoomOutButton,"data-testid":"zoom-out-button",icon:"magnifying-glass-minus",key:"zoom-out",onclick:this._onZoomOutButtonClick,scale:"s",text:t,title:t})}_renderClearButton(){const t=this.messages.clearProfile;return b("calcite-action",{appearance:"transparent",class:p.clearButton,"data-testid":"clear-button",icon:"trash",key:"clear-profile",onclick:this._onClearButtonClick,scale:"s",text:t,title:t})}_renderPrompt(t){return[b("div",{bind:this,class:p.promptContainer,key:"prompt-container"},b("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return b("div",{class:p.chartContainer,key:"empty-chart-container"});const{chartData:t,progress:e}=this.viewModel,i=this._chartIsRefined||this._canRenderChart(),s=null!=t&&e<1;return i?b(w,null,this._renderSpinner({size:i?"small":"large",visible:s}),b("div",{afterCreate:this._onChartContainerUpdate,afterRemoved:this._onChartContainerRemoved,afterUpdate:this._onChartContainerUpdate,bind:this,class:p.chartContainer,key:"chart-container"})):b(w,null,this._renderSpinner({size:"large",visible:s}),b("div",{class:p.chartContainer,key:"chart-container-empty"}))}_renderSpinner(t){const e="small"===t.size,i=t.visible??!0;return b("calcite-loader",{class:this.classes(p.chartSpinner,e&&p.chartSpinnerSmall,i&&p.chartSpinnerVisible),"data-testid":"chart-spinner",inline:e,key:"spinner",label:"",scale:"s"})}_canRenderChart(){const t=this.viewModel.chartData;if(null==t)return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=null!=i?i.length:0;return t.refined||e<=C().largeChartSamples}_renderActions({actions:t}){const e=t.map(t=>{switch(t.type){case"sketch":return this.visibleElements.sketchButton&&this._renderAction({action:t,className:p.sketchButton,label:this.messages.sketchButtonLabel,onClick:this._onSketchButtonClick,primary:!0});case"sketch-cancel":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.sketchCancelButton,label:this.messagesCommon.cancel,primary:!1});case"sketch-done":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:p.sketchDoneButton,label:this.messagesCommon.done,primary:!0});case"select":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:p.selectButton,label:this.messages.selectButtonLabel,primary:!1});case"select-cancel":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.selectCancelButton,label:this.messagesCommon.cancel,primary:!1})}}).filter(Boolean);return e.length?b("footer",{class:p.footer,key:"footer"},e):null}_renderAction({action:t,className:e,label:i,onClick:s,primary:n}){return b("calcite-button",{appearance:n?"solid":"outline-fill",bind:this,class:this.classes(p.actionButton,e),disabled:t.disabled,key:`action-${t.type}`,onclick:s},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:s,stationary:n}=t;null!=i&&null!=s&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=null!=e&&e.refined)}_onChartContainerUpdate(t){this._chartContainer=t}_onChartContainerRemoved(t){this._chartContainer===t&&(this._chartContainer=null)}_initializeChart(t){i(this._chartInitTask),this._chartInitTask=e(async e=>{const{createChart:i}=await import("./ElevationProfile/support/chartUtils.js");r(e);const n=await i({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw s(n),o();this._chart=n,this._updateChart(this._chartUpdateParams)})}_destroyChart(){this._chartInitTask=i(this._chartInitTask),this._chart=s(this._chart),this._chartIsRefined=!1}};t([c({type:u})],B.prototype,"viewModel",void 0),t([c()],B.prototype,"view",null),t([c()],B.prototype,"input",null),t([c()],B.prototype,"profiles",null),t([c()],B.prototype,"unitOptions",null),t([c()],B.prototype,"unit",null),t([c({type:m,nonNullable:!0})],B.prototype,"visibleElements",void 0),t([c()],B.prototype,"icon",null),t([c()],B.prototype,"label",null),t([c()],B.prototype,"visible",null),t([c(),y("esri/widgets/ElevationProfile/t9n/ElevationProfile")],B.prototype,"messages",void 0),t([c(),y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),t([c(),y("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([c()],B.prototype,"_chartContainer",void 0),t([c()],B.prototype,"_chart",void 0),t([c()],B.prototype,"_chartInitTask",void 0),t([c()],B.prototype,"_chartIsRefined",void 0),t([c()],B.prototype,"_zoomOutButtonVisible",void 0),t([c()],B.prototype,"_selectButtonVisible",null),t([c()],B.prototype,"_chartUpdateParams",null),t([c()],B.prototype,"_chartMessages",null),t([c()],B.prototype,"_profilesArray",null),B=t([h("esri.widgets.ElevationProfile")],B);const S=B;export{S as default};
package/widgets/Expand.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import{makeHandle as o}from"../core/handleUtils.js";import n from"../core/Logger.js";import{watch as s,initial as i}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import p from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{isWidget as h,hasDomNode as u}from"./support/widget.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";const v="esri-expand",_={base:v,toggle:`${v}__toggle`,popoverContent:`${v}__popover-content`,panel:`${v}__panel`,panelContent:`${v}__panel-content`,sheet:`${v}__sheet`,contentContainer:`${v}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${v}__icon-number`},w="chevrons-left",y="chevrons-right",f=Symbol("scheduleRender-override-handle");let x=class extends a{constructor(e,o){super(e,o),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new p,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e},t(n.getLogger(this),"Expand","arcgis-expand",{version:"4.34"})}initialize(){this.addHandles(s(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),i))}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return y}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return"object"==typeof this.content&&"icon"in this.content&&this.content.icon?this.content.icon:w}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return"object"==typeof this.content&&"label"in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return g("div",{class:this.classes(_.base,d.widget)},this._renderToggle(),e?g("calcite-sheet",{class:_.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},g("calcite-panel",{class:_.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},g("div",{class:_.panelContent},this._renderContent()))):t?g("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},g("div",{class:_.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?g("span",{class:_.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===w||s===y;return g("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:d.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?g("calcite-icon",{class:this.classes(_.icon,i&&_.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return g("div",{class:_.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?g("div",{class:_.contentContainer,innerHTML:e,key:"content__string"}):h(e)?g("div",{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(f),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(f),this._overwriteChildScheduleRender(e))},class:_.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?g("div",{afterCreate:this._attachToNode,bind:e,class:_.contentContainer,key:"content__html-element"}):u(e)?g("div",{afterCreate:this._attachToNode,bind:e.domNode,class:_.contentContainer,key:"content__node"}):null}_overwriteChildScheduleRender(e){const t=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(o(()=>e.scheduleRender=t),f)}_attachToNode(e){const t=this;e.appendChild(t)}};e([l({readOnly:!0})],x.prototype,"expandTitle",null),e([l()],x.prototype,"_toggleActionEl",void 0),e([l()],x.prototype,"_displaySheet",null),e([l()],x.prototype,"autoCollapse",null),e([l()],x.prototype,"closeOnEsc",void 0),e([l()],x.prototype,"collapseIcon",null),e([l()],x.prototype,"collapseTooltip",void 0),e([l()],x.prototype,"content",void 0),e([l()],x.prototype,"expanded",null),e([l()],x.prototype,"expandIcon",null),e([l()],x.prototype,"expandTooltip",void 0),e([l()],x.prototype,"focusTrapDisabled",void 0),e([l()],x.prototype,"group",null),e([l()],x.prototype,"icon",null),e([l()],x.prototype,"iconNumber",void 0),e([l()],x.prototype,"label",null),e([l(),m("esri/widgets/Expand/t9n/Expand")],x.prototype,"messages",void 0),e([l(),m("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([l()],x.prototype,"mode",void 0),e([l()],x.prototype,"placement",void 0),e([l()],x.prototype,"view",null),e([l({type:p})],x.prototype,"viewModel",void 0),x=e([r("esri.widgets.Expand")],x);const C=x;export{C as default};
5
+ import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import{makeHandle as o}from"../core/handleUtils.js";import n from"../core/Logger.js";import{watch as s,initial as i}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import c from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as d}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{messageBundle as h,tsx as u,isWidget as m,hasDomNode as g}from"./support/widget.js";const v="esri-expand",_={base:v,toggle:`${v}__toggle`,popoverContent:`${v}__popover-content`,panel:`${v}__panel`,panelContent:`${v}__panel-content`,sheet:`${v}__sheet`,contentContainer:`${v}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${v}__icon-number`},w="chevrons-left",y="chevrons-right",C=Symbol("scheduleRender-override-handle");let x=class extends a{constructor(e,o){super(e,o),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new c,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e},t(n.getLogger(this),"Expand","arcgis-expand",{version:"4.34"})}initialize(){this.addHandles(s(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),i))}loadDependencies(){return d({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return y}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return"object"==typeof this.content&&"icon"in this.content&&this.content.icon?this.content.icon:w}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return"object"==typeof this.content&&"label"in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return u("div",{class:this.classes(_.base,p.widget)},this._renderToggle(),e?u("calcite-sheet",{class:_.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},u("calcite-panel",{class:_.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},u("div",{class:_.panelContent},this._renderContent()))):t?u("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},u("div",{class:_.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?u("span",{class:_.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===w||s===y;return u("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:p.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?u("calcite-icon",{class:this.classes(_.icon,i&&_.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return u("div",{class:_.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?u("div",{class:_.contentContainer,innerHTML:e,key:"content__string"}):m(e)?u("div",{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(C),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(C),this._overwriteChildScheduleRender(e))},class:_.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,class:_.contentContainer,key:"content__html-element"}):g(e)?u("div",{afterCreate:this._attachToNode,bind:e.domNode,class:_.contentContainer,key:"content__node"}):null}_overwriteChildScheduleRender(e){const t=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(o(()=>e.scheduleRender=t),C)}_attachToNode(e){const t=this;e.appendChild(t)}};e([l({readOnly:!0})],x.prototype,"expandTitle",null),e([l()],x.prototype,"_toggleActionEl",void 0),e([l()],x.prototype,"_displaySheet",null),e([l()],x.prototype,"autoCollapse",null),e([l()],x.prototype,"closeOnEsc",void 0),e([l()],x.prototype,"collapseIcon",null),e([l()],x.prototype,"collapseTooltip",void 0),e([l()],x.prototype,"content",void 0),e([l()],x.prototype,"expanded",null),e([l()],x.prototype,"expandIcon",null),e([l()],x.prototype,"expandTooltip",void 0),e([l()],x.prototype,"focusTrapDisabled",void 0),e([l()],x.prototype,"group",null),e([l()],x.prototype,"icon",null),e([l()],x.prototype,"iconNumber",void 0),e([l()],x.prototype,"label",null),e([l(),h("esri/widgets/Expand/t9n/Expand")],x.prototype,"messages",void 0),e([l(),h("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([l()],x.prototype,"mode",void 0),e([l()],x.prototype,"placement",void 0),e([l()],x.prototype,"view",null),e([l({type:c})],x.prototype,"viewModel",void 0),x=e([r("esri.widgets.Expand")],x);const f=x;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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{watch as e,initial as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Attachments.js";import a from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import p from"./support/FeatureElementInfo.js";import"../support/widgetUtils.js";import{tsx as l}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const d={base:"esri-feature-attachments"};let h=class extends a{constructor(t,e){super(t,e),this._featureElementInfo=null,this.attachmentsWidget=new o,this.headingLevel=2,this.viewModel=new n}initialize(){this._featureElementInfo=new p,this.addHandles([e(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),i),e(()=>this.viewModel,t=>this.attachmentsWidget.viewModel=t,i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(t){this.viewModel.description=t}get displayType(){return this.attachmentsWidget.displayType}set displayType(t){this.attachmentsWidget.displayType=t}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}render(){const{attachmentsWidget:t}=this;return l("div",{class:d.base},this._featureElementInfo?.render(),t?.render())}_setupFeatureElementInfo(){const{description:t,title:e,headingLevel:i}=this;this._featureElementInfo?.set({description:t,title:e,headingLevel:i})}};t([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),t([s()],h.prototype,"description",null),t([s()],h.prototype,"displayType",null),t([s()],h.prototype,"graphic",null),t([s()],h.prototype,"headingLevel",void 0),t([s()],h.prototype,"title",null),t([s({type:n})],h.prototype,"viewModel",void 0),h=t([r("esri.widgets.Feature.FeatureAttachments")],h);export{h as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Attachments.js";import a from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import p from"./support/FeatureElementInfo.js";import{tsx as d}from"../support/widget.js";const l={base:"esri-feature-attachments"};let h=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new o,this.headingLevel=2,this.viewModel=new n}initialize(){this._featureElementInfo=new p,this.addHandles([t(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),i),t(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return d("div",{class:l.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};e([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),e([s()],h.prototype,"description",null),e([s()],h.prototype,"displayType",null),e([s()],h.prototype,"graphic",null),e([s()],h.prototype,"headingLevel",void 0),e([s()],h.prototype,"title",null),e([s({type:n})],h.prototype,"viewModel",void 0),h=e([r("esri.widgets.Feature.FeatureAttachments")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import s from"./FeatureContent/FeatureContentViewModel.js";import{shouldOpenInNewTab as a}from"./support/featureUtils.js";import{isWidget as i}from"../support/widget.js";import{tsx as d}from"../support/jsxFactory.js";const n="esri-feature-content",c={base:n,loaderContainer:`${n}__loader-container`,loader:`${n}__loader`};let l=class extends o{constructor(e,r){super(e,r),this.viewModel=null,this._addTargetToAnchors=e=>{Array.from(e.querySelectorAll("a")).forEach(e=>{a(e.href)&&!e.hasAttribute("target")&&e.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return d("div",{class:c.base},"loading"===e?this._renderLoading():this._renderCreated())}_renderLoading(){return d("div",{class:c.loaderContainer,key:"loader"},d("div",{class:c.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?d("div",{afterCreate:this._attachToNode,bind:e,key:e}):i(e)?d("div",{key:e},!e.destroyed&&e.render()):d("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const r=this;e.appendChild(r)}};e([r()],l.prototype,"creator",null),e([r()],l.prototype,"graphic",null),e([r({type:s})],l.prototype,"viewModel",void 0),l=e([t("esri.widgets.Feature.FeatureContent")],l);export{l as default};
5
+ import{__decorate as e}from"tslib";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 t}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import a from"./FeatureContent/FeatureContentViewModel.js";import{shouldOpenInNewTab as s}from"./support/featureUtils.js";import{tsx as i,isWidget as d}from"../support/widget.js";const n="esri-feature-content",c={base:n,loaderContainer:`${n}__loader-container`,loader:`${n}__loader`};let l=class extends o{constructor(e,r){super(e,r),this.viewModel=null,this._addTargetToAnchors=e=>{Array.from(e.querySelectorAll("a")).forEach(e=>{s(e.href)&&!e.hasAttribute("target")&&e.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return i("div",{class:c.base},"loading"===e?this._renderLoading():this._renderCreated())}_renderLoading(){return i("div",{class:c.loaderContainer,key:"loader"},i("div",{class:c.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?i("div",{afterCreate:this._attachToNode,bind:e,key:e}):d(e)?i("div",{key:e},!e.destroyed&&e.render()):i("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const r=this;e.appendChild(r)}};e([r()],l.prototype,"creator",null),e([r()],l.prototype,"graphic",null),e([r({type:a})],l.prototype,"viewModel",void 0),l=e([t("esri.widgets.Feature.FeatureContent")],l);export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as r,when as a,initial as l}from"../../../core/reactiveUtils.js";import{throttle as p}from"../../../core/throttle.js";import{property as c}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 h from"../../../geometry/Point.js";import"../../../popup/content/AttachmentsContent.js";import"../../../popup/content/Content.js";import"../../../popup/content/CustomContent.js";import"../../../popup/content/ExpressionContent.js";import u from"../../../popup/content/FieldsContent.js";import d from"../../../popup/content/MediaContent.js";import"../../../popup/content/RelationshipContent.js";import f from"../../../popup/content/TextContent.js";import"../../../popup/content/UtilityNetworkAssociationsContent.js";import v from"../../../popup/ElementExpressionInfo.js";import _ from"../FeatureContent/FeatureContentViewModel.js";import y from"../FeatureFields/FeatureFieldsViewModel.js";import w from"../FeatureMedia/FeatureMediaViewModel.js";import{compileExpression as T}from"../support/arcadeFeatureUtils.js";const j=1;let k=class extends o{constructor(t){super(t),this._compileTask=null,this._evaluateTask=null,this.expressionInfo=null,this.graphic=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const e="fields"===t?new y:"media"===t?new w:"text"===t?new _:null;this._set("contentElementViewModel",e)},this._compileThrottled=p(this._startCompile,()=>this.notifyChange("state"),j,this),this._evaluateThrottled=p(this._startEvaluate,()=>this.notifyChange("state"),j,this),this.addHandles([r(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),l),r(()=>[this.contentElement],()=>this._createVM(),l),a(()=>{if(!this._compileTask?.finished)return null;const t=this._compileTask.value,e=t?.dependencies;return[t,this.spatialReference,this.map,this.view,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateThrottled(t))])}initialize(){this.addHandles([this._compileThrottled,this._evaluateThrottled])}destroy(){this._compileTask=s(this._compileTask),this._evaluateTask=s(this._evaluateTask),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null)}get contentElement(){return this._evaluateTask?.value}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get state(){const{contentElement:t,contentElementViewModel:e}=this;return this._compileThrottled.hasPendingUpdates()||this._evaluateThrottled.hasPendingUpdates()||!this._compileTask?.finished||!this._evaluateTask?.finished?"loading":t||e?"ready":"disabled"}get map(){return this.view?.map??null}set map(t){this._override("map",t)}_startCompile(){this._evaluateTask=s(this._evaluateTask),this._compileTask=s(this._compileTask),this._compileTask=i(async t=>{const{expressionInfo:e,graphic:o}=this,i=e?.expression;if(!i||!o)return null;const s=await T({expression:i,graphic:o});return n(t),s})}_startEvaluate(t){this._evaluateTask=s(this._evaluateTask),this._evaluateTask=i(async e=>{const{graphic:o}=this;if(!t||!o)return null;const{interceptor:i,spatialReference:s,map:r,location:a,view:l}=this,p=await t.evaluate({graphic:o,interceptor:i,location:a,map:r,options:{signal:e},spatialReference:s,view:l});n(e);const c=p;if(!c||"esri.arcade.Dictionary"!==c.declaredClass)return null;const m=await c.castAsJsonAsync(e);n(e);const h=m?.type,v="media"===h?d.fromJSON(m):"text"===h?f.fromJSON(m):"fields"===h?u.fromJSON(m):null;return"media"===v.type&&!v.mediaInfos||"fields"===v.type&&!v.fieldInfos||"text"===v.type&&!v.text?null:v})}};t([c()],k.prototype,"_compileTask",void 0),t([c()],k.prototype,"_evaluateTask",void 0),t([c({type:v})],k.prototype,"expressionInfo",void 0),t([c({type:e})],k.prototype,"graphic",void 0),t([c({readOnly:!0})],k.prototype,"contentElement",null),t([c({readOnly:!0})],k.prototype,"contentElementViewModel",void 0),t([c()],k.prototype,"interceptor",void 0),t([c({type:h})],k.prototype,"location",void 0),t([c()],k.prototype,"spatialReference",null),t([c({readOnly:!0})],k.prototype,"state",null),t([c()],k.prototype,"map",null),t([c()],k.prototype,"view",void 0),k=t([m("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],k);export{k as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Accessor.js";import{createTask as s}from"../../../core/asyncUtils.js";import{abortMaybe as o}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as a,when as n,initial as l}from"../../../core/reactiveUtils.js";import{throttle as p}from"../../../core/throttle.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import m from"../../../geometry/Point.js";import{MediaContent as d,TextContent as u,FieldsContent as f}from"../../../popup/content.js";import v from"../../../popup/ElementExpressionInfo.js";import _ from"../FeatureContent/FeatureContentViewModel.js";import y from"../FeatureFields/FeatureFieldsViewModel.js";import w from"../FeatureMedia/FeatureMediaViewModel.js";import{compileExpression as T}from"../support/arcadeFeatureUtils.js";const g=1;let k=class extends i{constructor(e){super(e),this._compileTask=null,this._evaluateTask=null,this.expressionInfo=null,this.graphic=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._createVM=()=>{const e=this.contentElement?.type;this.contentElementViewModel?.destroy();const t="fields"===e?new y:"media"===e?new w:"text"===e?new _:null;this._set("contentElementViewModel",t)},this._compileThrottled=p(this._startCompile,()=>this.notifyChange("state"),g,this),this._evaluateThrottled=p(this._startEvaluate,()=>this.notifyChange("state"),g,this),this.addHandles([a(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),l),a(()=>[this.contentElement],()=>this._createVM(),l),n(()=>{if(!this._compileTask?.finished)return null;const e=this._compileTask.value,t=e?.dependencies;return[e,this.spatialReference,this.map,this.view,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateThrottled(e))])}initialize(){this.addHandles([this._compileThrottled,this._evaluateThrottled])}destroy(){this._compileTask=o(this._compileTask),this._evaluateTask=o(this._evaluateTask),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null)}get contentElement(){return this._evaluateTask?.value}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{contentElement:e,contentElementViewModel:t}=this;return this._compileThrottled.hasPendingUpdates()||this._evaluateThrottled.hasPendingUpdates()||!this._compileTask?.finished||!this._evaluateTask?.finished?"loading":e||t?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}_startCompile(){this._evaluateTask=o(this._evaluateTask),this._compileTask=o(this._compileTask),this._compileTask=s(async e=>{const{expressionInfo:t,graphic:i}=this,s=t?.expression;if(!s||!i)return null;const o=await T({expression:s,graphic:i});return r(e),o})}_startEvaluate(e){this._evaluateTask=o(this._evaluateTask),this._evaluateTask=s(async t=>{const{graphic:i}=this;if(!e||!i)return null;const{interceptor:s,spatialReference:o,map:a,location:n,view:l}=this,p=await e.evaluate({graphic:i,interceptor:s,location:n,map:a,options:{signal:t},spatialReference:o,view:l});r(t);const c=p;if(!c||"esri.arcade.Dictionary"!==c.declaredClass)return null;const h=await c.castAsJsonAsync(t);r(t);const m=h?.type,v="media"===m?d.fromJSON(h):"text"===m?u.fromJSON(h):"fields"===m?f.fromJSON(h):null;return"media"===v.type&&!v.mediaInfos||"fields"===v.type&&!v.fieldInfos||"text"===v.type&&!v.text?null:v})}};e([c()],k.prototype,"_compileTask",void 0),e([c()],k.prototype,"_evaluateTask",void 0),e([c({type:v})],k.prototype,"expressionInfo",void 0),e([c({type:t})],k.prototype,"graphic",void 0),e([c({readOnly:!0})],k.prototype,"contentElement",null),e([c({readOnly:!0})],k.prototype,"contentElementViewModel",void 0),e([c()],k.prototype,"interceptor",void 0),e([c({type:m})],k.prototype,"location",void 0),e([c()],k.prototype,"spatialReference",null),e([c({readOnly:!0})],k.prototype,"state",null),e([c()],k.prototype,"map",null),e([c()],k.prototype,"view",void 0),k=e([h("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],k);export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return p({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return c("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return c("div",{class:u.loadingSpinnerContainer,key:"loading-container"},c("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{tsx as p}from"../support/widget.js";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return c({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return p("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return p("div",{class:u.loadingSpinnerContainer,key:"loading-container"},p("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{watch as t,initial as s}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import l from"./FeatureFields/FeatureFieldsViewModel.js";import n from"./support/FeatureElementInfo.js";import{globalCss as d}from"../support/globalCss.js";import{autoLink as a}from"../support/uriUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as f}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const u="esri-feature-fields",m={base:u,fieldHeader:`${u}__field-header`,fieldData:`${u}__field-data`,fieldDataDate:`${u}__field-data--date`};let c=class extends o{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new l,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new n,this.addHandles(t(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),s))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return f("div",{class:m.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:s}=this.viewModel,i=e.fieldName||"",r=e.label||i,o=s?null==s[i]?"":s[i]:"",l=!("date-time"!==e?.fieldFormat?.type),n="number"==typeof o&&!l?this._forceLTR(o):a(this.messagesURIUtils,o),d={[m.fieldDataDate]:l};return f("tr",{key:`fields-element-info-row-${i}-${t}`},f("th",{class:m.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${i}-${t}`}),f("td",{class:this.classes(m.fieldData,d),innerHTML:n,key:`fields-element-info-row-data-${i}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?f("table",{class:d.table,summary:this.messages.fieldsSummary},f("tbody",null,e.map((e,t)=>this._renderFieldInfo(e,t)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`&lrm;${e}`}};e([i()],c.prototype,"attributes",null),e([i()],c.prototype,"description",null),e([i()],c.prototype,"expressionInfos",null),e([i()],c.prototype,"fieldInfos",null),e([i()],c.prototype,"title",null),e([i({type:l,nonNullable:!0})],c.prototype,"viewModel",void 0),e([i(),p("esri/widgets/Feature/t9n/Feature")],c.prototype,"messages",void 0),e([i(),p("esri/widgets/support/t9n/uriUtils")],c.prototype,"messagesURIUtils",void 0),c=e([r("esri.widgets.Feature.FeatureFields")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as s}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import l from"./FeatureFields/FeatureFieldsViewModel.js";import n from"./support/FeatureElementInfo.js";import{globalCss as d}from"../support/globalCss.js";import{autoLink as a}from"../support/uriUtils.js";import{tsx as f,messageBundle as p}from"../support/widget.js";const u="esri-feature-fields",m={base:u,fieldHeader:`${u}__field-header`,fieldData:`${u}__field-data`,fieldDataDate:`${u}__field-data--date`};let c=class extends o{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new l,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new n,this.addHandles(t(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),s))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return f("div",{class:m.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:s}=this.viewModel,i=e.fieldName||"",r=e.label||i,o=s?null==s[i]?"":s[i]:"",l=!("date-time"!==e?.fieldFormat?.type),n="number"==typeof o&&!l?this._forceLTR(o):a(this.messagesURIUtils,o),d={[m.fieldDataDate]:l};return f("tr",{key:`fields-element-info-row-${i}-${t}`},f("th",{class:m.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${i}-${t}`}),f("td",{class:this.classes(m.fieldData,d),innerHTML:n,key:`fields-element-info-row-data-${i}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?f("table",{class:d.table,summary:this.messages.fieldsSummary},f("tbody",null,e.map((e,t)=>this._renderFieldInfo(e,t)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`&lrm;${e}`}};e([i()],c.prototype,"attributes",null),e([i()],c.prototype,"description",null),e([i()],c.prototype,"expressionInfos",null),e([i()],c.prototype,"fieldInfos",null),e([i()],c.prototype,"title",null),e([i({type:l,nonNullable:!0})],c.prototype,"viewModel",void 0),e([i(),p("esri/widgets/Feature/t9n/Feature")],c.prototype,"messages",void 0),e([i(),p("esri/widgets/support/t9n/uriUtils")],c.prototype,"messagesURIUtils",void 0),c=e([r("esri.widgets.Feature.FeatureFields")],c);export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}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 o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{graphic:e,layer:t}=this.viewModel;return e?.isAggregate&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[o.new(t),c];f(this.container)&&h.push(s.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return h(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),p.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{prefersReducedMotion as i}from"../../core/a11yUtils.js";import{watch as a,initial as r}from"../../core/reactiveUtils.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 s}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as n}from"../../renderers/support/utils.js";import{isDarkMode as l}from"../../support/modeUtils.js";import d from"../Widget.js";import m from"./FeatureMedia/FeatureMediaViewModel.js";import c from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as h}from"./support/featureUtils.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import{tsx as u,isRTL as f,messageBundle as g}from"../support/widget.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends d{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new m,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new c,this.addHandles([a(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),r),a(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),r)])}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:i}=this.viewModel,a=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},a,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},t(this.messages.pageText,{index:i+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:m}=r,c=h(m??void 0)?"_blank":"_self",p="_blank"===c?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(m?u("a",{href:m,rel:p,target:c,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{graphic:e,layer:t}=this.viewModel;return e?.isAggregate&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await n(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!i())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:d,ThemeAm5:m,esriChartColorSet:c}=await import("./FeatureMedia/chartCommon.js"),h=m.new(t);h.rule("ColorSet").set("colors",c),h.rule("ColorSet").set("reuse",!0);const p=[o.new(t),h];l(this.container)&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const u=await this._getRendererColors(),f=await this._getSeriesColors(a.series),g=d.new(t,{}),M=f.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=f.get(e)||u.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return f(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:p}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:f(this.container)}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:p,xAxis:u,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),u.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:p}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const u=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:f(this.container)}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:p,xAxis:g,yAxis:u,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),u.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:p}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:f(this.container)}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:p,xAxis:u,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),h.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),u.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([o()],T.prototype,"_refreshIntervalInfo",void 0),e([o()],T.prototype,"attributes",null),e([o()],T.prototype,"activeMediaInfoIndex",null),e([o()],T.prototype,"description",null),e([o()],T.prototype,"fieldInfoMap",null),e([o()],T.prototype,"layer",null),e([o()],T.prototype,"mediaInfos",null),e([o()],T.prototype,"popupTemplate",null),e([o()],T.prototype,"relatedInfos",null),e([o()],T.prototype,"title",null),e([o({type:m})],T.prototype,"viewModel",void 0),e([o(),g("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([s("esri.widgets.Feature.FeatureMedia")],T);export{T as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as i,on as r,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as n}from"../../core/string.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../Widget.js";import u from"./FeatureRelationship/FeatureRelationshipViewModel.js";import p from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{globalCss as m}from"../support/globalCss.js";import{isRTL as v}from"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{tsx as g}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as _}from"../../intl/substitute.js";import{formatNumber as f}from"../../intl/number.js";var b;const y="esri-feature",I=`${y}-relationship`,F={base:I,listContainer:`${I}__list`,listItem:`${I}__list-item`,listItemHidden:`${I}__list-item--hidden`,listContainerQuerying:`${I}__list--querying`,featureObserver:`${y}__feature-observer`,stickySpinnerContainer:`${y}__sticky-loading-container`,loadingSpinnerContainer:`${y}__loading-container`},C={title:!0,description:!0};let M=b=class extends c{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements={...C},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new p,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o),i(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),r(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return h({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i,allCategoriesCount:r}=this.viewModel;return!e&&"ready"===i&&(!!r&&(r>s||0===s)||!!t&&(t>s||0===s))}get displayListItems(){const{relatedFeatureViewModels:e,allCategoriesCount:t}=this.viewModel;return this.displayShowAllButton||!!e.length||!!t}get allItemsDescription(){const{messages:e}=this,{featureCount:t,allCategories:s,allCategoriesCount:i}=this.viewModel;return _(e?.numberRecords,{number:f(s?i:t)})}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){const{activeCategory:e,title:t}=this.viewModel;return e?.name??t}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...C,...e}}render(){const{state:e}=this.viewModel;return g("div",{class:this.classes(F.base,m.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_selectCategory(e){const{flowItems:t,featureVisibleElements:s,viewModel:i}=this;t&&(i.activeCategory=e,i.showAllEnabled=!0,t.push(new b({flowItems:t,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:i})))}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new b({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?g("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return g("calcite-loader",{inline:!0,label:""})}_renderLoading(){return g("div",{class:F.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return g("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=v(this.container)?"chevron-left":"chevron-right";return g("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderCategory(e){const{count:t,name:s,value:i}=e,r=f(t);return g("calcite-list-item",{class:F.listItem,disabled:!t,key:i,label:s,onCalciteListItemSelect:()=>this._selectCategory(e)},g("calcite-chip",{label:r,scale:"s",slot:"content-end"},r),this._renderChevronIconNode())}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return g("calcite-list-item",{class:this.classes(F.listItem,{[F.listItemHidden]:i}),description:n(e.description??""),key:e.uid,label:n(s),onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?g("calcite-list-item",{description:this.allItemsDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return g("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},g("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return g("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e,categories:t}=this.viewModel;return g("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},t?.map(e=>this._renderCategory(e))??e.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return g("div",{class:this.classes(F.listContainer,{[F.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return g("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},g("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(e=>{this.addHandles(i(()=>[e.title,e.state],()=>this.scheduleRender(),o),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([l()],M.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([l({readOnly:!0})],M.prototype,"displayShowAllButton",null),e([l({readOnly:!0})],M.prototype,"displayListItems",null),e([l({readOnly:!0})],M.prototype,"allItemsDescription",null),e([l()],M.prototype,"description",null),e([l()],M.prototype,"featureVisibleElements",void 0),e([l()],M.prototype,"flowItems",void 0),e([l()],M.prototype,"flowType",void 0),e([l()],M.prototype,"headingLevel",void 0),e([l()],M.prototype,"title",null),e([l({type:u})],M.prototype,"viewModel",void 0),e([l(),w("esri/widgets/Feature/t9n/Feature")],M.prototype,"messages",void 0),e([l(),w("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([l()],M.prototype,"visibleElements",void 0),e([a("visibleElements")],M.prototype,"castVisibleElements",null),M=b=e([d("esri.widgets.Feature.FeatureRelationship")],M);export{M as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t,formatNumber as s}from"../../intl.js";import{destroyMaybe as i}from"../../core/maybe.js";import{after as r}from"../../core/promiseUtils.js";import{watch as o,on as n,initial as l}from"../../core/reactiveUtils.js";import{stripHTML as a}from"../../core/string.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as c}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import h from"../Widget.js";import p from"./FeatureRelationship/FeatureRelationshipViewModel.js";import m from"./support/FeatureElementInfo.js";import{loadCalciteComponents as v}from"../support/componentsUtils.js";import{globalCss as w}from"../support/globalCss.js";import{tsx as _,isRTL as g,messageBundle as f}from"../support/widget.js";var b;const y="esri-feature",I=`${y}-relationship`,F={base:I,listContainer:`${I}__list`,listItem:`${I}__list-item`,listItemHidden:`${I}__list-item--hidden`,listContainerQuerying:`${I}__list--querying`,featureObserver:`${y}__feature-observer`,stickySpinnerContainer:`${y}__sticky-loading-container`,loadingSpinnerContainer:`${y}__loading-container`},C={title:!0,description:!0};let M=b=class extends h{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new p,this.messages=null,this.messagesCommon=null,this.visibleElements={...C},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new m,this.addHandles([o(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),l),o(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),n(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return v({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=i(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i,allCategoriesCount:r}=this.viewModel;return!e&&"ready"===i&&(!!r&&(r>s||0===s)||!!t&&(t>s||0===s))}get displayListItems(){const{relatedFeatureViewModels:e,allCategoriesCount:t}=this.viewModel;return this.displayShowAllButton||!!e.length||!!t}get allItemsDescription(){const{messages:e}=this,{featureCount:i,allCategories:r,allCategoriesCount:o}=this.viewModel;return t(e?.numberRecords,{number:s(r?o:i)})}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){const{activeCategory:e,title:t}=this.viewModel;return e?.name??t}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...C,...e}}render(){const{state:e}=this.viewModel;return _("div",{class:this.classes(F.base,w.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_selectCategory(e){const{flowItems:t,featureVisibleElements:s,viewModel:i}=this;t&&(i.activeCategory=e,i.showAllEnabled=!0,t.push(new b({flowItems:t,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:i})))}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new b({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?_("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return _("calcite-loader",{inline:!0,label:""})}_renderLoading(){return _("div",{class:F.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return _("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=g(this.container)?"chevron-left":"chevron-right";return _("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderCategory(e){const{count:t,name:i,value:r}=e,o=s(t);return _("calcite-list-item",{class:F.listItem,disabled:!t,key:r,label:i,onCalciteListItemSelect:()=>this._selectCategory(e)},_("calcite-chip",{label:o,scale:"s",slot:"content-end"},o),this._renderChevronIconNode())}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return _("calcite-list-item",{class:this.classes(F.listItem,{[F.listItemHidden]:i}),description:a(e.description??""),key:e.uid,label:a(s),onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?_("calcite-list-item",{description:this.allItemsDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return _("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},_("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return _("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e,categories:t}=this.viewModel;return _("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},t?.map(e=>this._renderCategory(e))??e.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return _("div",{class:this.classes(F.listContainer,{[F.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return _("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},_("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(e=>{this.addHandles(o(()=>[e.title,e.state],()=>this.scheduleRender(),l),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await r(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([d()],M.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([d({readOnly:!0})],M.prototype,"displayShowAllButton",null),e([d({readOnly:!0})],M.prototype,"displayListItems",null),e([d({readOnly:!0})],M.prototype,"allItemsDescription",null),e([d()],M.prototype,"description",null),e([d()],M.prototype,"featureVisibleElements",void 0),e([d()],M.prototype,"flowItems",void 0),e([d()],M.prototype,"flowType",void 0),e([d()],M.prototype,"headingLevel",void 0),e([d()],M.prototype,"title",null),e([d({type:p})],M.prototype,"viewModel",void 0),e([d(),f("esri/widgets/Feature/t9n/Feature")],M.prototype,"messages",void 0),e([d(),f("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([d()],M.prototype,"visibleElements",void 0),e([c("visibleElements")],M.prototype,"castVisibleElements",null),M=b=e([u("esri.widgets.Feature.FeatureRelationship")],M);export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import c from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as p}from"../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as u}from"../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as m}from"../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends d{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new c,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),t=>this._renderTypeList(t,e.get(t)))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter(e=>e.title.toLowerCase().includes(this.filterText)).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return u(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:i,title:s}=e,o="loading"===i.state,l=this._findFlowItem(i),r=l<0&&this._isParentFeature(i),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:t(e.terminalName??""),key:`associated-feature-type-${i.uid}`,label:t(s),onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,i)},u(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,m(e.association)?n("calcite-chip",{label:p(e.association),scale:"s",slot:"content-end"},p(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(e=>this._renderItemTooltip(e))}_renderAssociatedFeatureList(e){return e.toArray().map(e=>this._renderAssociatedFeature(e))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{expanded:!0,key:"show-all",label:e.title,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"content-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([i()],v.prototype,"description",void 0),e([i()],v.prototype,"featureVisibleElements",void 0),e([i()],v.prototype,"flowItems",void 0),e([i()],v.prototype,"flowType",void 0),e([i()],v.prototype,"listType",void 0),e([i()],v.prototype,"parentFeatureViewModel",void 0),e([i()],v.prototype,"title",void 0),e([i({type:c})],v.prototype,"viewModel",void 0),e([i({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([s("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as i}from"../../core/string.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as r}from"../support/componentsUtils.js";import{globalCss as n}from"../support/globalCss.js";import{tsx as a,tsxFragment as c}from"../support/widget.js";import d from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import p from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as u}from"../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as m}from"../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as h}from"../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends p{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new d,this.visibleElements=new l}initialize(){this.setUpObserver()}loadDependencies(){return r({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return a("div",{class:this.classes(f.base,n.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():a("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?a(c,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),t=>this._renderTypeList(t,e.get(t)))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const o=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new l({title:!1,description:!1}),viewModel:i});t.push(o)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter(e=>e.title.toLowerCase().includes(this.filterText)).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return m(e.association)?a("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:t,title:s}=e,o="loading"===t.state,l=this._findFlowItem(t),r=l<0&&this._isParentFeature(t),n=r||l>=0;return a("calcite-list-item",{class:o?f.listItemHidden:void 0,description:i(e.terminalName??""),key:`associated-feature-type-${t.uid}`,label:i(s),onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,t)},m(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,h(e.association)?a("calcite-chip",{label:u(e.association),scale:"s",slot:"content-end"},u(e.association)):null,this._renderChevronIconNode(n))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(e=>this._renderItemTooltip(e))}_renderAssociatedFeatureList(e){return e.toArray().map(e=>this._renderAssociatedFeature(e))}_renderChevronIconNode(e){return a("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,i){const{messagesFeature:s}=this,{displayCount:o}=this.viewModel,l=i.slice(0,o),r=l.length<i.length;return a("calcite-list-item",{expanded:!0,key:"show-all",label:e.title,value:e.id},a("calcite-chip",{label:String(i.length),scale:"s",slot:"content-end"},i.length),a("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(l),this._renderAssociatedFeatureList(l)],r?a("calcite-list-item",{description:t(s?.numberRecords,{number:i.length.toString()}),key:"show-all-item",label:s.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},a("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([s()],v.prototype,"description",void 0),e([s()],v.prototype,"featureVisibleElements",void 0),e([s()],v.prototype,"flowItems",void 0),e([s()],v.prototype,"flowType",void 0),e([s()],v.prototype,"listType",void 0),e([s()],v.prototype,"parentFeatureViewModel",void 0),e([s()],v.prototype,"title",void 0),e([s({type:d})],v.prototype,"viewModel",void 0),e([s({type:l,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([o("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as s}from"../../core/string.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import a from"../Widget.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import c from"./support/FeatureElementInfo.js";import{loadCalciteComponents as d}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import h from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const y="esri-feature-utility-network-associations",g=`${y}__loading-container`,f={base:y,listContainer:`${y}__list`,loadingContainer:g,loadingContainerSticky:`${g}--sticky`};let v=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new h,this.messages=null,this.messagesCommon=null,this.visibleElements=new l}initialize(){this._featureElementInfo=new c,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o)])}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(f.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?u("div",{class:f.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return u("div",{class:f.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"information",key:"association-not-found",kind:"info",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:s(e.description),key:`association-type-${e.type}`,label:s(i),value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return u("div",{class:f.listContainer,key:"list-container"},"ready"===i?u("div",null,u("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map(e=>this._renderAssociations(e)))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([n({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([n()],v.prototype,"flowType",void 0),e([n()],v.prototype,"flowItems",void 0),e([n()],v.prototype,"parentFeatureViewModel",void 0),e([n()],v.prototype,"featureVisibleElements",void 0),e([n()],v.prototype,"description",null),e([n()],v.prototype,"headingLevel",void 0),e([n()],v.prototype,"title",null),e([n({type:h})],v.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([n({type:l,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([r("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);export{v as default};
5
+ import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as s}from"../../core/string.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import a from"../Widget.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import c from"./support/FeatureElementInfo.js";import{loadCalciteComponents as d}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import{tsx as m,messageBundle as u}from"../support/widget.js";import h from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const y="esri-feature-utility-network-associations",g=`${y}__loading-container`,f={base:y,listContainer:`${y}__list`,loadingContainer:g,loadingContainerSticky:`${g}--sticky`};let v=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new h,this.messages=null,this.messagesCommon=null,this.visibleElements=new l}initialize(){this._featureElementInfo=new c,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o)])}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(f.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?m("div",{class:f.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return m("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return m("div",{class:f.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return m("calcite-notice",{icon:"information",key:"association-not-found",kind:"info",open:!0,scale:"s",width:"full"},m("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return m("calcite-list-item",{description:s(e.description),key:`association-type-${e.type}`,label:s(i),value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},m("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return m("div",{class:f.listContainer,key:"list-container"},"ready"===i?m("div",null,m("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map(e=>this._renderAssociations(e)))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([n({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([n()],v.prototype,"flowType",void 0),e([n()],v.prototype,"flowItems",void 0),e([n()],v.prototype,"parentFeatureViewModel",void 0),e([n()],v.prototype,"featureVisibleElements",void 0),e([n()],v.prototype,"description",null),e([n()],v.prototype,"headingLevel",void 0),e([n()],v.prototype,"title",null),e([n({type:h})],v.prototype,"viewModel",void 0),e([n(),u("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([n(),u("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([n({type:l,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([r("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{css as e}from"../resources.js";import{isWidget as r,hasDomNode as s}from"../../support/widget.js";import{tsx as c}from"../../support/jsxFactory.js";const n=n=>{const i=n;let d=class extends i{constructor(){super(...arguments),this.renderNodeContent=o=>r(o)&&!o.destroyed?c("div",{class:e.contentNode,key:o},o.render()):o instanceof HTMLElement?c("div",{afterCreate:this._attachToNode,bind:o,class:e.contentNode,key:o}):s(o)?c("div",{afterCreate:this._attachToNode,bind:o.domNode,class:e.contentNode,key:o}):null}_attachToNode(o){const t=this;o.appendChild(t)}};return d=o([t("esri.widgets.Feature.support.FeatureContentMixin")],d),d};export{n as FeatureContentMixin};
5
+ import{__decorate as e}from"tslib";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{css as o}from"../resources.js";import{isWidget as r,tsx as s,hasDomNode as n}from"../../support/widget.js";const c=c=>{const d=c;let i=class extends d{constructor(){super(...arguments),this.renderNodeContent=e=>r(e)&&!e.destroyed?s("div",{class:o.contentNode,key:e},e.render()):e instanceof HTMLElement?s("div",{afterCreate:this._attachToNode,bind:e,class:o.contentNode,key:e}):n(e)?s("div",{afterCreate:this._attachToNode,bind:e.domNode,class:o.contentNode,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};return i=e([t("esri.widgets.Feature.support.FeatureContentMixin")],i),i};export{c as FeatureContentMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../Widget.js";import{Heading as i}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as s}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const p="esri-feature-element-info",n={base:p,title:`${p}__title`,description:`${p}__description`};let l=class extends o{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return s("div",{class:n.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?s(i,{class:n.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?s("div",{class:n.description,innerHTML:e,key:"description"}):null}};e([t()],l.prototype,"description",void 0),e([t()],l.prototype,"headingLevel",void 0),e([t()],l.prototype,"title",void 0),l=e([r("esri.widgets.Feature.support.FeatureElementInfo")],l);export{l as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../Widget.js";import{Heading as o}from"../../support/Heading.js";import{tsx as s}from"../../support/widget.js";const n="esri-feature-element-info",p={base:n,title:`${n}__title`,description:`${n}__description`};let l=class extends i{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return s("div",{class:p.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?s(o,{class:p.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?s("div",{class:p.description,innerHTML:e,key:"description"}):null}};e([t()],l.prototype,"description",void 0),e([t()],l.prototype,"headingLevel",void 0),e([t()],l.prototype,"title",void 0),l=e([r("esri.widgets.Feature.support.FeatureElementInfo")],l);export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{watch as s,initial as i}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import{cast as o}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import d from"./Feature/FeatureAttachments.js";import a from"./Feature/FeatureContent.js";import c from"./Feature/FeatureExpression.js";import p from"./Feature/FeatureFields.js";import u from"./Feature/FeatureMedia.js";import m from"./Feature/FeatureRelationship.js";import h from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as v}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as _}from"./support/Heading.js";import{tsx as M,messageBundle as E}from"./support/widget.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(w(l)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new y}initialize(){this.addHandles(s(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),i))}loadDependencies(){return g({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:v.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(v.base,f.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:v.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:v.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(_,{class:v.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:v.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(v.contentNode,v.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(v.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:v.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:v.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:v.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:v.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:v.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:v.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:s}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:n,user:o}=i,r="edit"===i.type?o?s.lastEditedByUser:s.lastEdited:o?s.lastCreatedByUser:s.lastCreated,l=t(r,{date:n,user:o});return M("div",{class:this.classes(v.lastEditedInfo,v.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(v.contentElement,v.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new d({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new u({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"relationship"===n.type){const e=new m({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new h({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new a({viewModel:e}))}this.scheduleRender()}};e([n()],F.prototype,"flowType",void 0),e([n()],F.prototype,"graphic",null),e([n()],F.prototype,"defaultPopupTemplateEnabled",null),e([n()],F.prototype,"flowItems",void 0),e([n()],F.prototype,"headingLevel",void 0),e([n({readOnly:!0})],F.prototype,"isTable",null),e([n()],F.prototype,"icon",null),e([n()],F.prototype,"label",null),e([n()],F.prototype,"location",null),e([n(),E("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([n(),E("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([n()],F.prototype,"spatialReference",null),e([n()],F.prototype,"timeZone",null),e([n({readOnly:!0})],F.prototype,"title",null),e([n()],F.prototype,"visibleElements",void 0),e([o("visibleElements")],F.prototype,"castVisibleElements",null),e([n()],F.prototype,"map",null),e([n()],F.prototype,"view",null),e([n({type:y})],F.prototype,"viewModel",void 0),F=e([r("esri.widgets.Feature")],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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../support/widgetUtils.js";import{tsx as t}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{getAssociationTitle as e}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";function o(t){const{feature:r,association:o,associationType:i,messages:s}=t,{attachment:n,connectivity:c,container:a,content:u,structure:l}=s,p=r.sourceLayer;if(!o&&!i)return;if(!o)switch(i){case"attachment":return n;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!p)return;const m=r.attributes[p.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return e(o,m,s)}function i(e){const{feature:i,heading:s}=e,n=s||r(i),c=o(e)??"";return t("calcite-block",{description:c,heading:n})}export{i as AssociationDetails};
5
+ import{tsx as t}from"../../support/widget.js";import{getAssociationTitle as e}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";function o(t){const{feature:r,association:o,associationType:i,messages:n}=t,{attachment:s,connectivity:c,container:a,content:u,structure:l}=n,f=r.sourceLayer;if(!o&&!i)return;if(!o)switch(i){case"attachment":return s;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!f)return;const m=r.attributes[f.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return e(o,m,n)}function i(e){const{feature:i,heading:n}=e,s=n||r(i),c=o(e)??"";return t("calcite-block",{description:c,heading:s})}export{i as AssociationDetails};