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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
  7. package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
  9. package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
  13. package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
  14. package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
  16. package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
  22. package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
  27. package/chunks/GaussianSplat.glsl.js +2 -2
  28. package/config.js +1 -1
  29. package/copyright.txt +0 -60
  30. package/core/SetUtils.js +1 -1
  31. package/core/workers/workerFactory.js +1 -1
  32. package/identity/IdentityModal.js +1 -1
  33. package/interfaces.d.ts +105 -9
  34. package/intl.js +1 -1
  35. package/kernel.js +1 -1
  36. package/layers/ImageryTileLayer.js +1 -1
  37. package/layers/ParquetLayer.js +1 -1
  38. package/layers/graphics/sources/ParquetSource.js +1 -1
  39. package/layers/graphics/sources/support/QueryTask.js +1 -1
  40. package/layers/mixins/ArcGISImageService.js +1 -1
  41. package/layers/mixins/ImageryTileMixin.js +1 -1
  42. package/layers/support/NumberFieldFormat.js +1 -1
  43. package/layers/support/Sublayer.js +1 -1
  44. package/layers/support/SubtypeSublayer.js +1 -1
  45. package/layers/support/featureLayerUtils.js +1 -1
  46. package/layers/support/fieldUtils.js +1 -1
  47. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  48. package/layers/support/rasterFunctionUtils.js +1 -1
  49. package/package.json +1 -1
  50. package/popup/content.js +1 -1
  51. package/portal/schemas/definitions.js +1 -1
  52. package/renderers/support/numberUtils.js +1 -1
  53. package/rest/geometryService.js +1 -1
  54. package/rest/geoprocessor.js +1 -1
  55. package/rest/imageService.js +1 -1
  56. package/rest/locator.js +1 -1
  57. package/rest/query.js +1 -1
  58. package/smartMapping/labels/bins.js +1 -1
  59. package/smartMapping/popup/support/clusterUtils.js +1 -1
  60. package/smartMapping/popup/support/utils.js +1 -1
  61. package/smartMapping/renderers/support/utils.js +1 -1
  62. package/support/BasemapStyle.js +1 -1
  63. package/support/actions/actionUtils.js +1 -1
  64. package/support/revision.js +1 -1
  65. package/symbols/support/svgUtils.js +1 -1
  66. package/tables/elements.js +1 -1
  67. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  68. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  69. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  70. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  71. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  72. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  73. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  74. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  75. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  76. package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
  77. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
  78. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  79. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  80. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  81. package/views/draw/support/Reshape.js +1 -1
  82. package/views/interactive/SegmentLabels.js +1 -1
  83. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  84. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  85. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  86. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  87. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  88. package/views/interactive/tooltip/content/Fields.js +1 -1
  89. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  90. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  91. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  92. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  93. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  94. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  95. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  96. package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
  97. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  98. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  99. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  100. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  101. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  102. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  103. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  104. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  105. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  106. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  107. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  108. package/views/navigation/gamepad/GamepadSettings.js +1 -1
  109. package/views/overlay/BoxOverlayItem.js +1 -1
  110. package/views/overlay/CrosshairOverlayItem.js +1 -1
  111. package/views/overlay/OutlineOverlayItem.js +1 -1
  112. package/views/ui/UI.js +1 -1
  113. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  114. package/widgets/AreaMeasurement2D.js +1 -1
  115. package/widgets/AreaMeasurement3D.js +1 -1
  116. package/widgets/Attachments.js +1 -1
  117. package/widgets/Attribution.js +1 -1
  118. package/widgets/BasemapGallery.js +1 -1
  119. package/widgets/BasemapLayerList.js +1 -1
  120. package/widgets/BasemapToggle.js +1 -1
  121. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  122. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  124. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  125. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  126. package/widgets/BatchAttributeForm.js +1 -1
  127. package/widgets/Bookmarks.js +1 -1
  128. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  129. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  130. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  131. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  132. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  133. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  134. package/widgets/BuildingExplorer.js +1 -1
  135. package/widgets/CatalogLayerList.js +1 -1
  136. package/widgets/Compass.js +1 -1
  137. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  138. package/widgets/CoordinateConversion.js +1 -1
  139. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  140. package/widgets/Daylight.js +1 -1
  141. package/widgets/DirectLineMeasurement3D.js +1 -1
  142. package/widgets/DirectionalPad.js +1 -1
  143. package/widgets/Directions.js +1 -1
  144. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  145. package/widgets/DistanceMeasurement2D.js +1 -1
  146. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  147. package/widgets/Editor/EditorViewModel.js +1 -1
  148. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  149. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  150. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  151. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  152. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  153. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  154. package/widgets/Editor/UpdateWorkflow.js +1 -1
  155. package/widgets/Editor/Workflow.js +1 -1
  156. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  157. package/widgets/Editor/components/FeatureList.js +1 -1
  158. package/widgets/Editor/components/FooterActions.js +1 -1
  159. package/widgets/Editor/components/MergeFeaturesList.js +1 -1
  160. package/widgets/Editor/components/Notices.js +1 -1
  161. package/widgets/Editor/components/PanelContent.js +1 -1
  162. package/widgets/Editor/components/PanelToolbar.js +1 -1
  163. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  164. package/widgets/Editor/components/Prompt.js +1 -1
  165. package/widgets/Editor/components/Settings.js +1 -1
  166. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  167. package/widgets/Editor/components/UploadDetails.js +1 -1
  168. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  169. package/widgets/Editor/support/errors.js +1 -1
  170. package/widgets/Editor.js +1 -1
  171. package/widgets/ElevationProfile/components/Legend.js +1 -1
  172. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  173. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  174. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  175. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  176. package/widgets/ElevationProfile.js +1 -1
  177. package/widgets/Expand.js +1 -1
  178. package/widgets/Feature/FeatureAttachments.js +1 -1
  179. package/widgets/Feature/FeatureContent.js +1 -1
  180. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  181. package/widgets/Feature/FeatureExpression.js +1 -1
  182. package/widgets/Feature/FeatureFields.js +1 -1
  183. package/widgets/Feature/FeatureMedia.js +1 -1
  184. package/widgets/Feature/FeatureRelationship.js +1 -1
  185. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  186. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  187. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  188. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  189. package/widgets/Feature.js +1 -1
  190. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  191. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  192. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  193. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  194. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  195. package/widgets/FeatureForm.js +1 -1
  196. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  197. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  198. package/widgets/FeatureTable.js +1 -1
  199. package/widgets/FeatureTemplates.js +1 -1
  200. package/widgets/Features/FeaturesDrillIn.js +1 -1
  201. package/widgets/Features.js +1 -1
  202. package/widgets/FloorFilter.js +1 -1
  203. package/widgets/FovOverlay.js +1 -1
  204. package/widgets/Fullscreen.js +1 -1
  205. package/widgets/Histogram.js +1 -1
  206. package/widgets/HistogramRangeSlider.js +1 -1
  207. package/widgets/Home.js +1 -1
  208. package/widgets/LayerList/LayerListItem.js +1 -1
  209. package/widgets/LayerList/ListItemPanel.js +1 -1
  210. package/widgets/LayerList.js +1 -1
  211. package/widgets/Legend/LegendViewModel.js +1 -1
  212. package/widgets/Legend/styles/card/CardView.js +1 -1
  213. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  214. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  215. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  216. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  217. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  218. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  219. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  220. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  221. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  222. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  223. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  224. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  225. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  226. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  227. package/widgets/Legend/styles/support/utils.js +1 -1
  228. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  229. package/widgets/Legend/support/styleUtils.js +1 -1
  230. package/widgets/Legend/support/utils.js +1 -1
  231. package/widgets/Legend.js +1 -1
  232. package/widgets/LineOfSight.js +1 -1
  233. package/widgets/Locate/LocateViewModel.js +1 -1
  234. package/widgets/Locate.js +1 -1
  235. package/widgets/Measurement.js +1 -1
  236. package/widgets/NavigationToggle.js +1 -1
  237. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  238. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  239. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  240. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  244. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  245. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  246. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  247. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  249. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  250. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  251. package/widgets/OrientedImageryViewer.js +1 -1
  252. package/widgets/PanoramicVideoViewer.js +1 -1
  253. package/widgets/PanoramicViewer.js +1 -1
  254. package/widgets/Popup.js +1 -1
  255. package/widgets/Print/FileLink.js +1 -1
  256. package/widgets/Print.js +1 -1
  257. package/widgets/ScaleBar.js +1 -1
  258. package/widgets/ScaleRangeSlider.js +1 -1
  259. package/widgets/Search/SearchResultRenderer.js +1 -1
  260. package/widgets/Search/support/layerSearchUtils.js +1 -1
  261. package/widgets/Search.js +1 -1
  262. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  263. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  264. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  265. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  266. package/widgets/ShadowCast.js +1 -1
  267. package/widgets/Sketch/SketchViewModel.js +1 -1
  268. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  269. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  270. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  271. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  272. package/widgets/Sketch.js +1 -1
  273. package/widgets/Slice.js +1 -1
  274. package/widgets/Slider.js +1 -1
  275. package/widgets/Spinner.js +1 -1
  276. package/widgets/Swipe.js +1 -1
  277. package/widgets/TableList/ListItemPanel.js +1 -1
  278. package/widgets/TableList.js +1 -1
  279. package/widgets/TimeSlider.js +1 -1
  280. package/widgets/TimeZoneLabel.js +1 -1
  281. package/widgets/Track.js +1 -1
  282. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  283. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  284. package/widgets/UtilityNetworkAssociations.js +1 -1
  285. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  286. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  287. package/widgets/UtilityNetworkTrace.js +1 -1
  288. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  289. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  290. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  291. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  292. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  293. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  294. package/widgets/ValuePicker.js +1 -1
  295. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  296. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  297. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  298. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  299. package/widgets/VideoPlayer.js +1 -1
  300. package/widgets/Weather/LabeledSlider.js +1 -1
  301. package/widgets/Weather.js +1 -1
  302. package/widgets/Widget.js +1 -1
  303. package/widgets/Zoom.js +1 -1
  304. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  305. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  306. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  307. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  308. package/widgets/smartMapping/ColorSlider.js +1 -1
  309. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  310. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  311. package/widgets/smartMapping/OpacitySlider.js +1 -1
  312. package/widgets/smartMapping/SizeSlider.js +1 -1
  313. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  314. package/widgets/support/ColorPicker.js +1 -1
  315. package/widgets/support/FilterBuilder.js +1 -1
  316. package/widgets/support/FilterCondition.js +1 -1
  317. package/widgets/support/GridControls.js +1 -1
  318. package/widgets/support/Heading.js +1 -1
  319. package/widgets/support/ItemList.js +1 -1
  320. package/widgets/support/LabeledSwitch.js +1 -1
  321. package/widgets/support/MeasurementWidgetContent.js +1 -1
  322. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  323. package/widgets/support/SelectionList/LayerItem.js +1 -1
  324. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  325. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  326. package/widgets/support/SelectionList.js +1 -1
  327. package/widgets/support/SelectionToolbar.js +1 -1
  328. package/widgets/support/SketchTooltipControls.js +1 -1
  329. package/widgets/support/SnappingControls.js +1 -1
  330. package/widgets/support/TimezonePicker.js +1 -1
  331. package/widgets/support/UnitSelect.js +1 -1
  332. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  333. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
  334. package/widgets/support/chartUtilsAm5.js +1 -1
  335. package/widgets/support/dateUtils.js +1 -1
  336. package/widgets/support/iconUtils.js +1 -1
  337. package/widgets/support/widget.js +1 -1
  338. package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
  339. package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
  340. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
  341. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
  342. package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
  343. package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
  344. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
  345. package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
  346. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  347. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
  348. package/widgets/support/jsxFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{isTable as s}from"../layers/support/layerUtils.js";import n from"./Widget.js";import{nullGroupBy as l,isTemplateItemGroup as a}from"./FeatureTemplates/featureTemplatesUtils.js";import d from"./FeatureTemplates/FeatureTemplatesViewModel.js";import m from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{ItemList as u}from"./support/ItemList.js";import{fetchThumbnail as h}from"./support/symbolPreviewUtils.js";import"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as g}from"../intl/substitute.js";const y={base:"esri-feature-templates"};function I(e){return e.length>0&&a(e[0])}function C(e){return e.id}let w=class extends n{constructor(e,t){super(e,t),this.enableListScroll=!0,this.filterText="",this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.selectionMode="none",this.viewModel=new d,this.visibleElements=new m,this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver((e,t)=>{e.forEach(async e=>{if(e.isIntersecting){const o=e.target;if(j(o))return void t.unobserve(o);const r=L(o),{layer:i,template:s}=r;M(o,!0);const n=r.label?g(this.messagesLegend.previewTemplateAriaLabel,{label:r.label}):this.messagesCommon.preview,l=await h(s,i,{ariaLabel:n}).catch(()=>(M(o,!1),null));if(null==l)return;o.appendChild(l)}})}),this._renderItemIcon=e=>s(e.layer)?b("span",{"data-has-icon":!0,"data-item":e,key:"icon"},b("calcite-icon",{icon:"table"})):b("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}initialize(){const e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(t(()=>this.viewModel,(t,o)=>{t&&!t.filterFunction&&(this.filterFunction=e),o&&o!==t&&o.filterFunction===e&&(o.filterFunction=null)},o))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get icon(){return"list-rectangle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}select(e,t){return this.viewModel.select(e,t)}render(){const{disabled:e,enableListScroll:t,filterText:o,headingLevel:r,messages:i,viewModel:{items:s,numberOfFeatureTemplates:n,selectedItem:d,state:m}}=this,c=this.visibleElements.filter&&n>1;if(I(s)){const e=s.find(e=>e.label===l.label);e&&(e.label=i.other)}return b("div",{"aria-label":i.widgetLabel,class:this.classes(y.base,p.widget)},"loading"===m?b("calcite-loader",{key:"loader",label:this.messagesCommon.loading,type:"indeterminate"}):"ready"===m?b(u,{disabled:e,enableListScroll:t,filterEnabled:c,filterText:o,headingLevel:r,id:this.id,identify:C,items:s,messages:{filterPlaceholder:i.filterPlaceholder,noItems:i.noItems,noMatches:i.noMatches},renderCustomGroupContent:this.renderCustomGroupContent,renderCustomItem:this.renderCustomItem,renderIcon:this._renderItemIcon,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:d??void 0,selectionMode:this.selectionMode??void 0,onFilterChange:e=>{this.filterText=e},onItemSelect:e=>!a(e)&&this.viewModel.select(e)}):null)}};function L(e){return e?.["data-item"]}function j(e){return!!e?.["data-has-icon"]}function M(e,t){e&&(e["data-has-icon"]=t)}e([r()],w.prototype,"disabled",null),e([r()],w.prototype,"enableListScroll",void 0),e([r()],w.prototype,"filterFunction",null),e([r()],w.prototype,"filterText",void 0),e([r()],w.prototype,"groupBy",null),e([r()],w.prototype,"headingLevel",void 0),e([r()],w.prototype,"icon",null),e([r()],w.prototype,"label",null),e([r()],w.prototype,"layers",null),e([r(),f("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],w.prototype,"messages",void 0),e([r(),f("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([r(),f("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([r({readOnly:!0})],w.prototype,"selectedItem",null),e([r()],w.prototype,"selectionMode",void 0),e([r(),v("select")],w.prototype,"viewModel",void 0),e([r({type:m,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([r()],w.prototype,"renderCustomItem",void 0),e([r()],w.prototype,"renderCustomGroupContent",void 0),e([r()],w.prototype,"renderItemLabel",void 0),e([r()],w.prototype,"renderItemDescription",void 0),e([r()],w.prototype,"renderItemContent",void 0),e([r()],w.prototype,"renderItemContentEnd",void 0),w=e([i("esri.widgets.FeatureTemplates")],w);const F=w;export{F as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{watch as o,initial as i}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 s}from"../core/accessorSupport/decorators/subclass.js";import{isTable as n}from"../layers/support/layerUtils.js";import l from"./Widget.js";import{nullGroupBy as a,isTemplateItemGroup as d}from"./FeatureTemplates/featureTemplatesUtils.js";import m from"./FeatureTemplates/FeatureTemplatesViewModel.js";import c from"./FeatureTemplates/VisibleElements.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as u}from"./support/globalCss.js";import{ItemList as h}from"./support/ItemList.js";import{fetchThumbnail as f}from"./support/symbolPreviewUtils.js";import{messageBundle as v,vmEvent as b,tsx as g}from"./support/widget.js";const y={base:"esri-feature-templates"};function I(e){return e.length>0&&d(e[0])}function C(e){return e.id}let w=class extends l{constructor(e,o){super(e,o),this.enableListScroll=!0,this.filterText="",this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.selectionMode="none",this.viewModel=new m,this.visibleElements=new c,this.renderCustomItem=e=>null,this.renderCustomGroupContent=e=>null,this.renderItemLabel=()=>null,this.renderItemDescription=()=>null,this.renderItemContent=e=>null,this.renderItemContentEnd=e=>null,this._iconIntersectionObserver=new IntersectionObserver((e,o)=>{e.forEach(async e=>{if(e.isIntersecting){const i=e.target;if(M(i))return void o.unobserve(i);const r=L(i),{layer:s,template:n}=r;F(i,!0);const l=r.label?t(this.messagesLegend.previewTemplateAriaLabel,{label:r.label}):this.messagesCommon.preview,a=await f(n,s,{ariaLabel:l}).catch(()=>(F(i,!1),null));if(null==a)return;i.appendChild(a)}})}),this._renderItemIcon=e=>n(e.layer)?g("span",{"data-has-icon":!0,"data-item":e,key:"icon"},g("calcite-icon",{icon:"table"})):g("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}),this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)}}initialize(){const e=({label:e})=>!this.filterText||!!e?.toLowerCase().includes(this.filterText.toLowerCase());this.addHandles(o(()=>this.viewModel,(t,o)=>{t&&!t.filterFunction&&(this.filterFunction=e),o&&o!==t&&o.filterFunction===e&&(o.filterFunction=null)},i))}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get filterFunction(){return this.viewModel.filterFunction}set filterFunction(e){this.viewModel.filterFunction=e}get groupBy(){return this.viewModel.groupBy}set groupBy(e){this.viewModel.groupBy=e}get icon(){return"list-rectangle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get selectedItem(){return this.viewModel.selectedItem}select(e,t){return this.viewModel.select(e,t)}render(){const{disabled:e,enableListScroll:t,filterText:o,headingLevel:i,messages:r,viewModel:{items:s,numberOfFeatureTemplates:n,selectedItem:l,state:m}}=this,c=this.visibleElements.filter&&n>1;if(I(s)){const e=s.find(e=>e.label===a.label);e&&(e.label=r.other)}return g("div",{"aria-label":r.widgetLabel,class:this.classes(y.base,u.widget)},"loading"===m?g("calcite-loader",{key:"loader",label:this.messagesCommon.loading,type:"indeterminate"}):"ready"===m?g(h,{disabled:e,enableListScroll:t,filterEnabled:c,filterText:o,headingLevel:i,id:this.id,identify:C,items:s,messages:{filterPlaceholder:r.filterPlaceholder,noItems:r.noItems,noMatches:r.noMatches},renderCustomGroupContent:this.renderCustomGroupContent,renderCustomItem:this.renderCustomItem,renderIcon:this._renderItemIcon,renderItemContent:this.renderItemContent,renderItemContentEnd:this.renderItemContentEnd,renderItemDescription:this.renderItemDescription,renderItemLabel:this.renderItemLabel,selectedItem:l??void 0,selectionMode:this.selectionMode??void 0,onFilterChange:e=>{this.filterText=e},onItemSelect:e=>!d(e)&&this.viewModel.select(e)}):null)}};function L(e){return e?.["data-item"]}function M(e){return!!e?.["data-has-icon"]}function F(e,t){e&&(e["data-has-icon"]=t)}e([r()],w.prototype,"disabled",null),e([r()],w.prototype,"enableListScroll",void 0),e([r()],w.prototype,"filterFunction",null),e([r()],w.prototype,"filterText",void 0),e([r()],w.prototype,"groupBy",null),e([r()],w.prototype,"headingLevel",void 0),e([r()],w.prototype,"icon",null),e([r()],w.prototype,"label",null),e([r()],w.prototype,"layers",null),e([r(),v("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],w.prototype,"messages",void 0),e([r(),v("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([r(),v("esri/widgets/Legend/t9n/Legend")],w.prototype,"messagesLegend",void 0),e([r({readOnly:!0})],w.prototype,"selectedItem",null),e([r()],w.prototype,"selectionMode",void 0),e([r(),b("select")],w.prototype,"viewModel",void 0),e([r({type:c,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([r()],w.prototype,"renderCustomItem",void 0),e([r()],w.prototype,"renderCustomGroupContent",void 0),e([r()],w.prototype,"renderItemLabel",void 0),e([r()],w.prototype,"renderItemDescription",void 0),e([r()],w.prototype,"renderItemContent",void 0),e([r()],w.prototype,"renderItemContentEnd",void 0),w=e([s("esri.widgets.FeatureTemplates")],w);const j=w;export{j 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 o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{loadActionUtilsComponents as s,renderAction as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{css as l}from"./css.js";import{zoomToFeature as c}from"../Popup/actions.js";import{loadCalciteComponents as n}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m,tsxFragment as d}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as u}from"../../intl/substitute.js";const h=c.clone();let f=class extends r{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return Promise.all([s(),n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})])}render(){const{flowItems:e}=this,t=e?.toArray();return m(d,null,t?.map((e,o)=>this._renderFlowItem(e,this.selectLastFlowItem&&o===t.length-1)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const{flowItems:e}=this,t=e?.pop();t&&("activeCategory"in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e,o){const{messages:i,closable:s,closed:r}=this,c="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,p=this._getExitMessage(e),d=i.selectFeature;return m("calcite-flow-item",{bind:this,closable:s,closed:r,description:t(this._getDrillInFlowItemDescription(e)??""),heading:t(e.title??""),key:`flow-item-${e.viewModel.uid}`,selected:o,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},m("calcite-action",{appearance:"transparent",bind:this,class:l.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:p,title:p}),c?m("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,n?m("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},m("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},a(h,{key:`action-${h.uid}`,title:this._getActionTitle(h),text:this._getActionTitle(h),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,m("div",{class:l.container},e.render()))}_getActionTitle(e){const{messages:t}=this,o=e.title??"";return"zoom-to-feature"===e.id?u(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}};e([o()],f.prototype,"flowItems",void 0),e([o(),p("esri/widgets/Features/t9n/Features")],f.prototype,"messages",void 0),e([o()],f.prototype,"closed",void 0),e([o()],f.prototype,"closable",void 0),e([o()],f.prototype,"selectLastFlowItem",void 0),f=e([i("esri.widgets.Features.FeaturesDrillIn")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{stripHTML as o}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{loadActionUtilsComponents as a,renderAction as r}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{css as c}from"./css.js";import{zoomToFeature as n}from"../Popup/actions.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import{tsx as d,tsxFragment as m,messageBundle as u}from"../support/widget.js";const h=n.clone();let f=class extends l{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return Promise.all([a(),p({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})])}render(){const{flowItems:e}=this,t=e?.toArray();return d(m,null,t?.map((e,o)=>this._renderFlowItem(e,this.selectLastFlowItem&&o===t.length-1)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const{flowItems:e}=this,t=e?.pop();t&&("activeCategory"in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e,t){const{messages:i,closable:s,closed:a}=this,l="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,p=this._getExitMessage(e),m=i.selectFeature;return d("calcite-flow-item",{bind:this,closable:s,closed:a,description:o(this._getDrillInFlowItemDescription(e)??""),heading:o(e.title??""),key:`flow-item-${e.viewModel.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},d("calcite-action",{appearance:"transparent",bind:this,class:c.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:p,title:p}),l?d("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:m,title:m}):null,n?d("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},d("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},r(h,{key:`action-${h.uid}`,title:this._getActionTitle(h),text:this._getActionTitle(h),textEnabled:!0,onclick:()=>this._handleZoomToFeature(e),bind:this}))):null,d("div",{class:c.container},e.render()))}_getActionTitle(e){const{messages:o}=this,i=e.title??"";return"zoom-to-feature"===e.id?t(i,{messages:o}):i}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}};e([i()],f.prototype,"flowItems",void 0),e([i(),u("esri/widgets/Features/t9n/Features")],f.prototype,"messages",void 0),e([i()],f.prototype,"closed",void 0),e([i()],f.prototype,"closable",void 0),e([i()],f.prototype,"selectLastFlowItem",void 0),f=e([s("esri.widgets.Features.FeaturesDrillIn")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import t from"../core/Collection.js";import i from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{watch as s,initial as n,when as r}from"../core/reactiveUtils.js";import{waitAnimationFrame as l}from"../core/scheduling.js";import{throttle as a}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as u}from"../geometry/support/geometryUtils.js";import{loadActionUtilsComponents as h,substituteActionImage as p,getActionStyles as m,renderAction as v}from"../support/actions/actionUtils.js";import g from"./Feature.js";import w from"./Spinner.js";import _ from"./Widget.js";import{css as M}from"./Feature/resources.js";import{FeatureContentMixin as f}from"./Feature/support/FeatureContentMixin.js";import{css as F}from"./Features/css.js";import y from"./Features/FeaturesDrillIn.js";import b from"./Features/FeaturesViewModel.js";import I from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as C}from"./Popup/actions.js";import{zoomToLocation as x}from"./Popup/actionUtils.js";import{loadCalciteComponents as A}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{Heading as N}from"./support/Heading.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as O}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as L}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as j}from"../intl/substitute.js";import{formatNumber as W}from"../intl/number.js";const D="selected-index",B=0,S="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(f(_)){constructor(e,i){super(e,i),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new t,this._drillInWidget=new y({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new C,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new b,this.visibleElements=new I,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=a(()=>this._displaySpinner(),B),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,s(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),s(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),s(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),s(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),s(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),s(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),s(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),s(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),s(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),s(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,n),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),s(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),s(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),s(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>x(this.viewModel,e))])}loadDependencies(){return Promise.all([h(),A({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new g({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():i.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():i.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(D);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(r(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return L("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(F.base,T.widget,T.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?L("div",{class:F.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o}=t;return L("div",{class:F.paginationText,key:"feature-pagination-text"},j(e.pageText,{index:W(o+1),total:W(i)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=t;return L("calcite-action",{appearance:"solid",bind:this,class:F.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._handlePaginationMenuButton,scale:"s",text:j(e.pageText,{index:W(o+1),total:W(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return L("calcite-action-bar",{class:F.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},L("calcite-action-group",{scale:"s"},L("calcite-action",{appearance:"solid",class:F.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),L("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return L("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},L("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?L("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?L("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?L("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?L("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return L("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[F.contentFeature]:!0,[F.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?L(N,{class:this.classes(F.featuresHeading,T.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),L("div",{class:this.classes(F.container,F.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:t,featureMenuTitle:i,messages:o,messagesCommon:s,initialDisplayMode:n,featureMenuOpen:r,selectedFeature:l,_collapseEnabled:a,_isCollapsed:d,featureNavigationTop:c,headingLevel:u}=this,{active:h,featureViewModels:p,pendingPromisesCount:m}=e,{featureMenuHeading:v}=t,g=i??o.selectFeature;if("feature"===n&&!r)return null;const w="list"===n?!l:r;return L("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[F.flowItemCollapsed]:d}),closable:"list"===n&&t.closeButton,closed:!h,collapsed:"list"===n&&d,collapseDirection:c?"down":"up",collapsible:"list"===n&&a,description:v?j(o.total,{total:p.length}):void 0,heading:v?g:void 0,headingLevel:u,key:"feature-menu",loading:e.waitingForContents,selected:w,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===n?this._renderHeaderActions():null,m>0?L("calcite-loader",{class:F.loader,inline:!0,key:"feature-menu-loader",label:s.loading,slot:"header-actions-end"}):null,L("div",{class:F.container},this._renderFeatureMenu()),L("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:F.featureMenuObserver}),"feature"===n?L("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?L("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=p({action:e,feature:this.selectedFeature}),s={[F.icon]:!!t,[F.actionImage]:!!o};return t&&(s[t]=!0),o||t?L("span",{"aria-hidden":"true",class:this.classes(F.icon,s),key:"icon",styles:m(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?L("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},L("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return v(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?L("div",{class:M.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=u(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await o(l(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");k(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,n=i?.attributes,r=e.title??"",l="zoom-to-feature"===s?j(r,{messages:t}):"remove-selected-feature"===s?j(r,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?j(r,{messages:t}):e.title;return l&&n?j(l,n):l??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=s(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,D)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new w({view:e}),e.ui.add(this._spinner,{key:S,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,S),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([d()],H.prototype,"_drillInFlowItems",void 0),e([d()],H.prototype,"_hideActionText",null),e([d()],H.prototype,"_featureNavigationVisible",null),e([d()],H.prototype,"_isCollapsed",null),e([d()],H.prototype,"_collapseEnabled",null),e([d({readOnly:!0})],H.prototype,"active",null),e([d()],H.prototype,"collapsed",void 0),e([d()],H.prototype,"content",null),e([d()],H.prototype,"icon",null),e([d()],H.prototype,"featureMenuOpen",null),e([d()],H.prototype,"featureMenuTitle",null),e([d()],H.prototype,"featureNavigationTop",void 0),e([d()],H.prototype,"features",null),e([d()],H.prototype,"goToOverride",null),e([d({type:C})],H.prototype,"headerActions",void 0),e([d()],H.prototype,"headingLevel",void 0),e([d()],H.prototype,"initialDisplayMode",null),e([d()],H.prototype,"location",null),e([d()],H.prototype,"label",null),e([d()],H.prototype,"map",null),e([d(),O("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([d(),O("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([d()],H.prototype,"promises",null),e([d()],H.prototype,"responsiveActionsEnabled",void 0),e([d({readOnly:!0})],H.prototype,"selectedFeature",null),e([d({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([d()],H.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([d()],H.prototype,"spatialReference",null),e([d()],H.prototype,"title",null),e([d()],H.prototype,"timeZone",null),e([d()],H.prototype,"updateLocationEnabled",null),e([d()],H.prototype,"view",null),e([d({type:b}),E(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([d({type:I,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([d()],H.prototype,"visible",null),H=e([c("esri.widgets.Features")],H);export{H as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import o from"../core/Collection.js";import s from"../core/Logger.js";import{ignoreAbortErrors as n}from"../core/promiseUtils.js";import{watch as r,initial as l,when as a}from"../core/reactiveUtils.js";import{waitAnimationFrame as d}from"../core/scheduling.js";import{throttle as c}from"../core/throttle.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{getPointFromGeometry as p}from"../geometry/support/geometryUtils.js";import{loadActionUtilsComponents as v,substituteActionImage as m,getActionStyles as g,renderAction as w}from"../support/actions/actionUtils.js";import _ from"./Feature.js";import M from"./Spinner.js";import f from"./Widget.js";import{css as F}from"./Feature/resources.js";import{FeatureContentMixin as y}from"./Feature/support/FeatureContentMixin.js";import{css as b}from"./Features/css.js";import I from"./Features/FeaturesDrillIn.js";import C from"./Features/FeaturesViewModel.js";import A from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as x}from"./Popup/actions.js";import{zoomToLocation as T}from"./Popup/actionUtils.js";import{loadCalciteComponents as N}from"./support/componentsUtils.js";import{globalCss as k}from"./support/globalCss.js";import{Heading as O}from"./support/Heading.js";import{tsx as E,messageBundle as L,vmEvent as W}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";const j="selected-index",B=0,S="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(y(f)){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new o,this._drillInWidget=new I({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new x,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new C,this.visibleElements=new A,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=c(()=>this._displaySpinner(),B),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,r(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),r(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),r(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),r(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),r(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),r(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),r(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),r(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),r(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,l),r(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),r(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>T(this.viewModel,e))])}loadDependencies(){return Promise.all([v(),N({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new _({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():s.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():s.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(j);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(a(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return E("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(b.base,k.widget,k.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n}=o;return E("div",{class:b.paginationText,key:"feature-pagination-text"},t(e.pageText,{index:i(n+1),total:i(s)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n,pendingPromisesCount:r}=o;return E("calcite-action",{appearance:"solid",bind:this,class:b.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:r>0,onclick:this._handlePaginationMenuButton,scale:"s",text:t(e.pageText,{index:i(n+1),total:i(s)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return E("calcite-action-bar",{class:b.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},E("calcite-action-group",{scale:"s"},E("calcite-action",{appearance:"solid",class:b.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),E("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return E("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},E("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?E("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?E("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?E("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?E("calcite-action",{active:"toggle"===e.type&&e.value,appearance:"solid",bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return E("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[b.contentFeature]:!0,[b.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?E(O,{class:this.classes(b.featuresHeading,k.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),E("div",{class:this.classes(b.container,b.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:i,featureMenuTitle:o,messages:s,messagesCommon:n,initialDisplayMode:r,featureMenuOpen:l,selectedFeature:a,_collapseEnabled:d,_isCollapsed:c,featureNavigationTop:u,headingLevel:h}=this,{active:p,featureViewModels:v,pendingPromisesCount:m}=e,{featureMenuHeading:g}=i,w=o??s.selectFeature;if("feature"===r&&!l)return null;const _="list"===r?!a:l;return E("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[b.flowItemCollapsed]:c}),closable:"list"===r&&i.closeButton,closed:!p,collapsed:"list"===r&&c,collapseDirection:u?"down":"up",collapsible:"list"===r&&d,description:g?t(s.total,{total:v.length}):void 0,heading:g?w:void 0,headingLevel:h,key:"feature-menu",loading:e.waitingForContents,selected:_,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===r?this._renderHeaderActions():null,m>0?E("calcite-loader",{class:b.loader,inline:!0,key:"feature-menu-loader",label:n.loading,slot:"header-actions-end"}):null,E("div",{class:b.container},this._renderFeatureMenu()),E("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:b.featureMenuObserver}),"feature"===r?E("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},n.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?E("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=m({action:e,feature:this.selectedFeature}),s={[b.icon]:!!t,[b.actionImage]:!!o};return t&&(s[t]=!0),o||t?E("span",{"aria-hidden":"true",class:this.classes(b.icon,s),key:"icon",styles:g(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?E("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},E("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return w(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?E("div",{class:F.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=p(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await n(d(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");D(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:i,selectedFeature:o,messagesCommon:s}=this,{id:n}=e,r=o?.attributes,l=e.title??"",a="zoom-to-feature"===n?t(l,{messages:i}):"remove-selected-feature"===n?t(l,{messages:s}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?t(l,{messages:i}):e.title;return a&&r?t(a,r):a??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,j)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);n&&"toggle"===n.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new M({view:e}),e.ui.add(this._spinner,{key:S,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,S),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([u()],H.prototype,"_drillInFlowItems",void 0),e([u()],H.prototype,"_hideActionText",null),e([u()],H.prototype,"_featureNavigationVisible",null),e([u()],H.prototype,"_isCollapsed",null),e([u()],H.prototype,"_collapseEnabled",null),e([u({readOnly:!0})],H.prototype,"active",null),e([u()],H.prototype,"collapsed",void 0),e([u()],H.prototype,"content",null),e([u()],H.prototype,"icon",null),e([u()],H.prototype,"featureMenuOpen",null),e([u()],H.prototype,"featureMenuTitle",null),e([u()],H.prototype,"featureNavigationTop",void 0),e([u()],H.prototype,"features",null),e([u()],H.prototype,"goToOverride",null),e([u({type:x})],H.prototype,"headerActions",void 0),e([u()],H.prototype,"headingLevel",void 0),e([u()],H.prototype,"initialDisplayMode",null),e([u()],H.prototype,"location",null),e([u()],H.prototype,"label",null),e([u()],H.prototype,"map",null),e([u(),L("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([u(),L("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([u()],H.prototype,"promises",null),e([u()],H.prototype,"responsiveActionsEnabled",void 0),e([u({readOnly:!0})],H.prototype,"selectedFeature",null),e([u({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([u()],H.prototype,"selectedFeatureIndex",null),e([u({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([u()],H.prototype,"spatialReference",null),e([u()],H.prototype,"title",null),e([u()],H.prototype,"timeZone",null),e([u()],H.prototype,"updateLocationEnabled",null),e([u()],H.prototype,"view",null),e([u({type:C}),W(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([u({type:A,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([u()],H.prototype,"visible",null),H=e([h("esri.widgets.Features")],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"../intl.js";import{watch as t}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 s}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import{css as o}from"./FloorFilter/css.js";import n from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import{Heading as c,incrementHeadingLevel as h}from"./support/Heading.js";import{isRTL as d,storeNode as u}from"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as M}from"../intl/substitute.js";const g=new Set(["ArrowUp","ArrowDown","End","Home"]);let f=class extends l{constructor(e,i){super(e,i),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new n,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(t(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=m("div",{class:this.classes(o.separator)}),n=this._getComponentPosition(),r=this._getPosition(n),c="top-right"===n||"bottom-right"===n,h="top-left"===n||"bottom-left"===n,u=d(this.container),v=u&&h||!u&&c?s:i,M=u&&h||!u&&c?i:s;return m("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(o.floorFilter,a.widget,`${o.floorFilterLayout}${t}`,`${o.floorFilterPosition}${r}`),key:"floor-filter-menu"},v,this.viewModel?.filterMenuOpen?l:null,M)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),m("div",{class:this.classes(a.widget,o.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return m("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&a.buttonDisabled,o.browseButton,this.viewModel?.filterMenuOpen&&a.widgetButtonActive),key:"browse-button",onclick:this._toggleFilterMenu,title:t.buttons.browse,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:this.icon,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:t,messages:i}=this,s=this.viewModel?.getFacility(e),l=this.viewModel?.getFacilityLevels(e),n=l.map(e=>this._renderLevelButton(e));if(!n.length)return null;const r=s&&M(i.selector.levelsLabel,{name:`"${s.name}"`});if(this._isWebScene(this.view?.map)&&n?.length>1){const i={id:`all--${e}`,facilityId:e,shortName:t.all,longName:t.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(i);n.push(s)}return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},n)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,n=`levels--${l}`,r=this.level===l,c=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||r||this.viewModel.levelsExpanded?m("li",{key:n},m("button",{bind:this,class:this.classes(a.widgetButton,r?a.widgetButtonActive:null,a.interactive,o.levelButton),"data-id":l,"data-list-id":"levels",onclick:this._levelSelected,onfocus:this._onItemFocus,type:"button"},c)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return m("button",{"aria-label":e.close,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.closeLevelsButton),key:"close-levels-button",onclick:this._closeLevels,title:e.close,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,n=this.viewModel?.filterMenuOpen,r=this.viewModel?.getSite(s),c=this.viewModel?.getFacility(i),h="site"===l&&n?!r:!c;return m("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(a.widget,a.widgetButton,h&&a.buttonDisabled,a.interactive,this.viewModel?.getFacilityLevels(i).length>0?o.zoomButtonLevels:o.zoomButton),key:"zoom-button",onclick:this._zoomToClicked,title:t.buttons.zoomTo,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{icon:"zoom-to-object",scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return m("button",{"aria-label":s,bind:this,class:this.classes(a.widget,a.widgetButton,a.interactive,o.minimizeToggleButton),key:"minimize-toggle-button",onclick:this._toggleCollapsed,title:s,type:"button"},m("div",{class:this.classes(o.buttonInfo)},m("calcite-icon",{class:this.classes(o.iconFlip),icon:i,scale:"s"}),m("span",{class:this.classes(o.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=m("div",{class:this.classes(`${o.filterMenuHeader}`),key:"filter-menu-site-header"},m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},i)),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),n=this._renderSiteItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-site"},s,l,n)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,n=this.viewModel.hasMultipleSites?m("button",{bind:this,class:this.classes(o.filterMenuHeaderBack),onclick:this._backClicked,title:t.back,type:"button"},m("calcite-icon",{class:this.classes(d(this.container)?o.iconRight:o.iconLeft),icon:d(this.container)?"chevron-right":"chevron-left"})):null,r=this.viewModel.hasMultipleSites?m(c,{class:this.classes(o.filterMenuHeaderSubtext),level:h(this.headingLevel)},s):null,a=m("div",{class:this.classes(o.filterMenuHeader),key:"filter-menu-site-header"},n,m("div",{class:this.classes(o.filterMenuHeaderTextGroup)},m(c,{class:this.classes(o.filterMenuHeaderText),level:this.headingLevel},l),r),m("button",{bind:this,class:this.classes(o.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},m("calcite-icon",{icon:"x"}))),u=this._renderSearchInput(),v=this._renderFacilityItems();return m("div",{class:this.classes(o.filterMenu),key:"filter-menu-facility"},a,u,v)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return m("div",{class:this.classes(o.filterMenuSearch),key:"filter-menu-search"},m("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),m("input",{afterCreate:u,bind:this,class:this.classes(o.filterMenuSearchInput),"data-node-ref":"_searchInput",oninput:this._onSearchChange,onpaste:this._onSearchChange,placeholder:e.search,value:this.viewModel.searchTerm??void 0}),t?m("calcite-icon",{bind:this,class:this.classes(o.iconClose),icon:"x",key:"filter-menu-search-clear",onclick:this._onSearchClear,title:e.clear}):null)}_renderBlueCircle(){return m("span",{class:this.classes(o.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults);return m("ul",{afterCreate:u,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(o.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",onkeydown:this._handleListKeydown,tabIndex:-1},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuSite),"data-id":i,"data-list-id":"sites",onclick:this._siteSelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t),m("calcite-icon",{class:this.classes(d(this.container)?o.iconLeft:o.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:t}=this,i=this.viewModel.getSite(t),s=this.viewModel.filterFeatures.facilities.facilitiesInfo,l=this.viewModel.filterFacilities(s).map(e=>this._renderFacilityItem(e)),n=0===l.length&&this.viewModel?.searchTerm&&m("div",{class:this.classes(a.empty)},e.noResults),r=i?M(e.selector.siteFacilitiesLabel,{name:`"${i.name}"`}):e.selector.facilitiesLabel;return m("ul",{afterCreate:u,"aria-label":r,bind:this,class:this.classes(o.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",onkeydown:this._handleListKeydown,tabIndex:-1},l,n)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return m("li",{key:s},m("button",{bind:this,class:this.classes(o.filterMenuFacility),"data-id":i,"data-list-id":"facilities",onclick:this._facilitySelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,m("span",{class:this.classes(l?o.filterMenuSelectedItem:o.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,o="Tab"===l,n=g.has(l);n&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(n||o)&&this._handleItemNavigation(l,e.shiftKey,r,o,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const o=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,o!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let o=0;o<i.length;o++){const e=i[o].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const o=l?.getElementsByTagName("li");if(!o)return;const n=[];Array.from(o).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&n.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;n.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([i()],f.prototype,"_searchInput",void 0),e([i()],f.prototype,"enabled",null),e([i()],f.prototype,"longNames",null),e([i()],f.prototype,"minimized",null),e([i()],f.prototype,"pinnedLevels",null),e([i()],f.prototype,"site",null),e([i()],f.prototype,"facility",null),e([i()],f.prototype,"level",null),e([i()],f.prototype,"view",null),e([i({type:n})],f.prototype,"viewModel",void 0),e([i(),v("esri/widgets/FloorFilter/t9n/FloorFilter")],f.prototype,"messages",void 0),e([i(),v("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([i()],f.prototype,"goToOverride",null),e([i()],f.prototype,"headingLevel",void 0),e([i()],f.prototype,"icon",null),f=e([s("esri.widgets.FloorFilter")],f);const p=f;export{p as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{watch 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 l}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{css as n}from"./FloorFilter/css.js";import r from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{Heading as h,incrementHeadingLevel as d}from"./support/Heading.js";import{messageBundle as u,tsx as v}from"./support/widget.js";import{isRTL as m,storeNode as M}from"./support/widgetUtils.js";const g=new Set(["ArrowUp","ArrowDown","End","Home"]);let f=class extends o{constructor(e,t){super(e,t),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new r,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(i(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return a({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=v("div",{class:this.classes(n.separator)}),o=this._getComponentPosition(),r=this._getPosition(o),a="top-right"===o||"bottom-right"===o,h="top-left"===o||"bottom-left"===o,d=m(this.container),u=d&&h||!d&&a?s:i,M=d&&h||!d&&a?i:s;return v("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(n.floorFilter,c.widget,`${n.floorFilterLayout}${t}`,`${n.floorFilterPosition}${r}`),key:"floor-filter-menu"},u,this.viewModel?.filterMenuOpen?l:null,M)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),v("div",{class:this.classes(c.widget,n.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return v("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(c.widget,c.widgetButton,c.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&c.buttonDisabled,n.browseButton,this.viewModel?.filterMenuOpen&&c.widgetButtonActive),key:"browse-button",onclick:this._toggleFilterMenu,title:t.buttons.browse,type:"button"},v("div",{class:this.classes(n.buttonInfo)},v("calcite-icon",{icon:this.icon,scale:"s"}),v("span",{class:this.classes(n.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:i,messages:s}=this,l=this.viewModel?.getFacility(e),o=this.viewModel?.getFacilityLevels(e),r=o.map(e=>this._renderLevelButton(e));if(!r.length)return null;const a=l&&t(s.selector.levelsLabel,{name:`"${l.name}"`});if(this._isWebScene(this.view?.map)&&r?.length>1){const t={id:`all--${e}`,facilityId:e,shortName:i.all,longName:i.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(t);r.push(s)}return v("ul",{afterCreate:M,"aria-label":a,bind:this,class:this.classes(n.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},r)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,o=`levels--${l}`,r=this.level===l,a=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||r||this.viewModel.levelsExpanded?v("li",{key:o},v("button",{bind:this,class:this.classes(c.widgetButton,r?c.widgetButtonActive:null,c.interactive,n.levelButton),"data-id":l,"data-list-id":"levels",onclick:this._levelSelected,onfocus:this._onItemFocus,type:"button"},a)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return v("button",{"aria-label":e.close,bind:this,class:this.classes(c.widget,c.widgetButton,c.interactive,n.closeLevelsButton),key:"close-levels-button",onclick:this._closeLevels,title:e.close,type:"button"},v("div",{class:this.classes(n.buttonInfo)},v("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,o=this.viewModel?.filterMenuOpen,r=this.viewModel?.getSite(s),a=this.viewModel?.getFacility(i),h="site"===l&&o?!r:!a;return v("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(c.widget,c.widgetButton,h&&c.buttonDisabled,c.interactive,this.viewModel?.getFacilityLevels(i).length>0?n.zoomButtonLevels:n.zoomButton),key:"zoom-button",onclick:this._zoomToClicked,title:t.buttons.zoomTo,type:"button"},v("div",{class:this.classes(n.buttonInfo)},v("calcite-icon",{icon:"zoom-to-object",scale:"s"}),v("span",{class:this.classes(n.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return v("button",{"aria-label":s,bind:this,class:this.classes(c.widget,c.widgetButton,c.interactive,n.minimizeToggleButton),key:"minimize-toggle-button",onclick:this._toggleCollapsed,title:s,type:"button"},v("div",{class:this.classes(n.buttonInfo)},v("calcite-icon",{class:this.classes(n.iconFlip),icon:i,scale:"s"}),v("span",{class:this.classes(n.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=v("div",{class:this.classes(`${n.filterMenuHeader}`),key:"filter-menu-site-header"},v("div",{class:this.classes(n.filterMenuHeaderTextGroup)},v(h,{class:this.classes(n.filterMenuHeaderText),level:this.headingLevel},i)),v("button",{bind:this,class:this.classes(n.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},v("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),o=this._renderSiteItems();return v("div",{class:this.classes(n.filterMenu),key:"filter-menu-site"},s,l,o)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,o=this.viewModel.hasMultipleSites?v("button",{bind:this,class:this.classes(n.filterMenuHeaderBack),onclick:this._backClicked,title:t.back,type:"button"},v("calcite-icon",{class:this.classes(m(this.container)?n.iconRight:n.iconLeft),icon:m(this.container)?"chevron-right":"chevron-left"})):null,r=this.viewModel.hasMultipleSites?v(h,{class:this.classes(n.filterMenuHeaderSubtext),level:d(this.headingLevel)},s):null,a=v("div",{class:this.classes(n.filterMenuHeader),key:"filter-menu-site-header"},o,v("div",{class:this.classes(n.filterMenuHeaderTextGroup)},v(h,{class:this.classes(n.filterMenuHeaderText),level:this.headingLevel},l),r),v("button",{bind:this,class:this.classes(n.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},v("calcite-icon",{icon:"x"}))),c=this._renderSearchInput(),u=this._renderFacilityItems();return v("div",{class:this.classes(n.filterMenu),key:"filter-menu-facility"},a,c,u)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return v("div",{class:this.classes(n.filterMenuSearch),key:"filter-menu-search"},v("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),v("input",{afterCreate:M,bind:this,class:this.classes(n.filterMenuSearchInput),"data-node-ref":"_searchInput",oninput:this._onSearchChange,onpaste:this._onSearchChange,placeholder:e.search,value:this.viewModel.searchTerm??void 0}),t?v("calcite-icon",{bind:this,class:this.classes(n.iconClose),icon:"x",key:"filter-menu-search-clear",onclick:this._onSearchClear,title:e.clear}):null)}_renderBlueCircle(){return v("span",{class:this.classes(n.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&v("div",{class:this.classes(c.empty)},e.noResults);return v("ul",{afterCreate:M,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(n.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",onkeydown:this._handleListKeydown,tabIndex:-1},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return v("li",{key:s},v("button",{bind:this,class:this.classes(n.filterMenuSite),"data-id":i,"data-list-id":"sites",onclick:this._siteSelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,v("span",{class:this.classes(l?n.filterMenuSelectedItem:n.filterMenuItemName)},t),v("calcite-icon",{class:this.classes(m(this.container)?n.iconLeft:n.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:i}=this,s=this.viewModel.getSite(i),l=this.viewModel.filterFeatures.facilities.facilitiesInfo,o=this.viewModel.filterFacilities(l).map(e=>this._renderFacilityItem(e)),r=0===o.length&&this.viewModel?.searchTerm&&v("div",{class:this.classes(c.empty)},e.noResults),a=s?t(e.selector.siteFacilitiesLabel,{name:`"${s.name}"`}):e.selector.facilitiesLabel;return v("ul",{afterCreate:M,"aria-label":a,bind:this,class:this.classes(n.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",onkeydown:this._handleListKeydown,tabIndex:-1},o,r)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return v("li",{key:s},v("button",{bind:this,class:this.classes(n.filterMenuFacility),"data-id":i,"data-list-id":"facilities",onclick:this._facilitySelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,v("span",{class:this.classes(l?n.filterMenuSelectedItem:n.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,o="Tab"===l,n=g.has(l);n&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(n||o)&&this._handleItemNavigation(l,e.shiftKey,r,o,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const o=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,o!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let o=0;o<i.length;o++){const e=i[o].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const o=l?.getElementsByTagName("li");if(!o)return;const n=[];Array.from(o).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&n.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;n.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([s()],f.prototype,"_searchInput",void 0),e([s()],f.prototype,"enabled",null),e([s()],f.prototype,"longNames",null),e([s()],f.prototype,"minimized",null),e([s()],f.prototype,"pinnedLevels",null),e([s()],f.prototype,"site",null),e([s()],f.prototype,"facility",null),e([s()],f.prototype,"level",null),e([s()],f.prototype,"view",null),e([s({type:r})],f.prototype,"viewModel",void 0),e([s(),u("esri/widgets/FloorFilter/t9n/FloorFilter")],f.prototype,"messages",void 0),e([s(),u("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([s()],f.prototype,"goToOverride",null),e([s()],f.prototype,"headingLevel",void 0),e([s()],f.prototype,"icon",null),f=e([l("esri.widgets.FloorFilter")],f);const p=f;export{p 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{rad2deg as s}from"../core/mathUtils.js";import{formatAngleDegrees as e,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const n="esri-fov-overlay",l={base:n,outer:`${n}-outer`,reset:`${n}-reset`,text:`${n}-text`};let c=class extends m{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return a("div",{class:l.outer},a("div",{class:l.base},a("p",{class:l.text},this._overlay),a("p",{class:l.reset,onclick:this.onReset,title:this._messagesCommon.reset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=e(s(t),"degrees","arithmetic","arithmetic",0),m=u/(2*Math.tan(t/2));return`${i} | ${o(r,m,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),p("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),p("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,n as base,l as css};
5
+ import{__decorate as t}from"tslib";import{rad2deg as s}from"../core/mathUtils.js";import{formatAngleDegrees as e,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import{messageBundle as n,tsx as a}from"./support/widget.js";const p="esri-fov-overlay",l={base:p,outer:`${p}-outer`,reset:`${p}-reset`,text:`${p}-text`};let c=class extends m{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return a("div",{class:l.outer},a("div",{class:l.base},a("p",{class:l.text},this._overlay),a("p",{class:l.reset,onclick:this.onReset,title:this._messagesCommon.reset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=e(s(t),"degrees","arithmetic","arithmetic",0),m=u/(2*Math.tan(t/2));return`${i} | ${o(r,m,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),n("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),n("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,p as base,l as css};
@@ -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 s from"../core/Logger.js";import{property as o}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 i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
5
+ import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o}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 i from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as p,tsx as a}from"./support/widget.js";const d={base:"esri-fullscreen"};let u=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return a("div",{class:this.classes(d.base,c.widget)},!o&&a("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Fullscreen")],u);const m=u;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{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./Histogram/HistogramViewModel.js";import{globalCss as s}from"./support/globalCss.js";import{onResize as n}from"./support/widgetUtils.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as d}from"../intl/substitute.js";var u;const h="esri-histogram",c={base:h,horizontalLayout:`${h}--horizontal`,verticalLayout:`${h}--vertical`,content:`${h}__content`,svg:`${h}__svg`,bar:`${h}__bar`,bars:`${h}__bars`,label:`${h}__label`,dataLines:`${h}__data-lines`,dataLinesSubgroup:`${h}__data-lines-subgroup`,dataLine:`${h}__data-line`,averageLabel:`${h}__average-label`,averageDataLine:`${h}__average-data-line`,averageSymbol:`${h}__average-symbol`};let p=u=class extends r{constructor(e,t){super(e,t),this._bgFillId=`${this.id}-bg-fill`,this._containerNode=null,this._containerDimensions={width:0,height:0},this._defaultBarColor="#d8d8d8",this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.dataLineUpdatedFunction=null,this.messages=null,this.viewModel=new a}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get icon(){return"graph-histogram"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}set layout(e){"vertical"!==e&&(e="horizontal"),this._set("layout",e)}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get state(){return this.viewModel.state}static fromHistogramResult(e){const{bins:t,maxValue:i,minValue:r}=e;return new u({bins:t,max:i,min:r})}render(){const{label:e,layout:t,state:i}=this,r=this.classes(c.base,s.widget,"horizontal"===t?c.horizontalLayout:c.verticalLayout,"disabled"===i?s.disabled:null);return l("div",{afterCreate:this._afterContainerNodeCreate,"aria-label":e,bind:this,class:r},"ready"===i?this._renderContent():null)}_renderContent(){if(!this._containerNode)return;const e=this._bgFillId,t=`clip-path: url(#${e})`;return l("div",{class:c.content},l("svg",{class:c.svg,xmlns:"http://www.w3.org/2000/svg"},l("defs",null,this._renderFillDefinition(e)),l("g",{style:t},this._renderBarsGroup()),this._renderLinesGroup()))}_renderBarsGroup(){return l("g",{class:this.classes(c.bars)},this._renderBars())}_renderBars(){const{layout:e,viewModel:{binRange:t,range:i}}=this;if(!t||!i)return;const r=t/i,{width:a,height:s}=this._containerDimensions;if(0===s&&0===a)return;if(0===s&&0!==a)return void this.scheduleRender();const[n,o]="vertical"===e?[s*r,a]:[s,a*r];return this._getBarDimensions(n,o).map(([e,t],i)=>this._renderBar(i,e,t))}_renderBar(e,t,i){const{bins:r,layout:a,max:s,messages:n,viewModel:{range:o}}=this;if(!r||null==s)return;const{width:u,height:h}=this._containerDimensions,p=r.slice()[e],{count:g,maxValue:m,minValue:_}=p,b=s-m,[v,L]="vertical"===a?[0,b*(h/o)]:[u-i-b*(u/o),h-t],f=d(n.barLabel,{count:g,maxValue:m,minValue:_});return l("rect",{afterCreate:this._afterBarCreate,"aria-label":f,bind:this,class:c.bar,"data-index":e,fill:this._defaultBarColor,height:t,role:"img","shape-rendering":"crispEdges","stroke-width":"0",width:i,x:v,y:L})}_renderLinesGroup(){return l("g",{class:this.classes(c.dataLines)},this._renderAverageLine(),this._renderCustomLines())}_renderAverageLine(){const{average:e}=this;if(null==e)return;const t=[l("tspan",{class:this.classes(c.averageSymbol)},"x̄ "),l("tspan",{class:this.classes(c.averageLabel)},this.labelFormatFunction?this.labelFormatFunction(e,"average"):e)];return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup)},l("title",{key:"title"},e),this._renderLine(e,this.classes(c.averageDataLine)),this._renderLabel({label:t,value:e}))}_renderCustomLines(){if(this.dataLines?.length)return this.dataLines.map((e,t)=>this._renderLineSubgroup(e,t))}_renderLineSubgroup(e,t){const{value:i}=e;return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup),"data-index":t},l("title",{key:"title"},i),this._renderLine(i),this._renderLabel(e))}_renderLine(e,t){const[i,r,a,s]=this._getLinePosition(e);return l("line",{class:this.classes(c.dataLine,t),"shape-rendering":"crispEdges",x1:i,x2:r,y1:a,y2:s})}_renderLabel(e,t){const{label:i,value:r}=e,[a,s]=this._getLabelPosition(r),n=2;return l("text",{class:this.classes(c.label,t),"text-anchor":"end",transform:"horizontal"===this.layout?"rotate(270)":null,x:a,y:s-n},i??"")}_renderFillDefinition(e){const{width:t,height:i}=this._containerDimensions;return l("clipPath",{id:e},l("rect",{height:i,width:t,x:"0",y:"0"}))}_afterContainerNodeCreate(e){this._containerNode=e,this.addHandles(n(e,e=>{const{width:t,height:i}=e.contentRect;this._containerDimensions={width:t,height:i}}))}_getIndexFromElement(e){const t=e.dataset?.index,i=e.getAttribute("data-index");return null!=t?parseInt(t,10):null!=i?parseInt(i,10):null}_afterBarCreate(e){if(this.barCreatedFunction){const t=this._getIndexFromElement(e)??-1;this.barCreatedFunction(t,e)}}_afterLinesSubgroupCreate(e){if(this.dataLineCreatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineCreatedFunction(i,r,t)}}_afterLinesSubgroupUpdate(e){if(this.dataLineUpdatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineUpdatedFunction(i,r,t)}}_getBarDimensions(e,t){const{bins:i,layout:r}=this,a=i?i.map(e=>e.count):[],s=Math.max.apply(Math,a);return a.map(i=>"vertical"===r?[e/a.length,0!==s?i/s*t:0]:[0!==s?i/s*e:0,t/a.length])}_getLinePosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0,0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions,[o,l]=[a*s||1,n-a*n||1];return"vertical"===t?[0,"100%",l,l]:[o,o,"100%",0]}_getLabelPosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions;return"vertical"===t?[s,n-a*n]:[0,a*s]}};e([t()],p.prototype,"_bgFillId",void 0),e([t()],p.prototype,"_containerNode",void 0),e([t()],p.prototype,"_containerDimensions",void 0),e([t()],p.prototype,"_defaultBarColor",void 0),e([t()],p.prototype,"average",null),e([t()],p.prototype,"barCreatedFunction",void 0),e([t()],p.prototype,"dataLines",void 0),e([t()],p.prototype,"dataLineCreatedFunction",void 0),e([t()],p.prototype,"dataLineUpdatedFunction",void 0),e([t()],p.prototype,"icon",null),e([t()],p.prototype,"label",null),e([t()],p.prototype,"labelFormatFunction",null),e([t({value:"horizontal"})],p.prototype,"layout",null),e([t()],p.prototype,"max",null),e([t(),o("esri/widgets/Histogram/t9n/Histogram")],p.prototype,"messages",void 0),e([t()],p.prototype,"min",null),e([t({readOnly:!0})],p.prototype,"state",null),e([t({type:a})],p.prototype,"viewModel",void 0),p=u=e([i("esri.widgets.Histogram")],p);const g=p;export{g as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.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 a from"./Widget.js";import s from"./Histogram/HistogramViewModel.js";import{globalCss as n}from"./support/globalCss.js";import{messageBundle as o,tsx as l}from"./support/widget.js";import{onResize as d}from"./support/widgetUtils.js";var h;const u="esri-histogram",c={base:u,horizontalLayout:`${u}--horizontal`,verticalLayout:`${u}--vertical`,content:`${u}__content`,svg:`${u}__svg`,bar:`${u}__bar`,bars:`${u}__bars`,label:`${u}__label`,dataLines:`${u}__data-lines`,dataLinesSubgroup:`${u}__data-lines-subgroup`,dataLine:`${u}__data-line`,averageLabel:`${u}__average-label`,averageDataLine:`${u}__average-data-line`,averageSymbol:`${u}__average-symbol`};let g=h=class extends a{constructor(e,t){super(e,t),this._bgFillId=`${this.id}-bg-fill`,this._containerNode=null,this._containerDimensions={width:0,height:0},this._defaultBarColor="#d8d8d8",this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.dataLineUpdatedFunction=null,this.messages=null,this.viewModel=new s}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get icon(){return"graph-histogram"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}set layout(e){"vertical"!==e&&(e="horizontal"),this._set("layout",e)}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get state(){return this.viewModel.state}static fromHistogramResult(e){const{bins:t,maxValue:i,minValue:r}=e;return new h({bins:t,max:i,min:r})}render(){const{label:e,layout:t,state:i}=this,r=this.classes(c.base,n.widget,"horizontal"===t?c.horizontalLayout:c.verticalLayout,"disabled"===i?n.disabled:null);return l("div",{afterCreate:this._afterContainerNodeCreate,"aria-label":e,bind:this,class:r},"ready"===i?this._renderContent():null)}_renderContent(){if(!this._containerNode)return;const e=this._bgFillId,t=`clip-path: url(#${e})`;return l("div",{class:c.content},l("svg",{class:c.svg,xmlns:"http://www.w3.org/2000/svg"},l("defs",null,this._renderFillDefinition(e)),l("g",{style:t},this._renderBarsGroup()),this._renderLinesGroup()))}_renderBarsGroup(){return l("g",{class:this.classes(c.bars)},this._renderBars())}_renderBars(){const{layout:e,viewModel:{binRange:t,range:i}}=this;if(!t||!i)return;const r=t/i,{width:a,height:s}=this._containerDimensions;if(0===s&&0===a)return;if(0===s&&0!==a)return void this.scheduleRender();const[n,o]="vertical"===e?[s*r,a]:[s,a*r];return this._getBarDimensions(n,o).map(([e,t],i)=>this._renderBar(i,e,t))}_renderBar(e,i,r){const{bins:a,layout:s,max:n,messages:o,viewModel:{range:d}}=this;if(!a||null==n)return;const{width:h,height:u}=this._containerDimensions,g=a.slice()[e],{count:p,maxValue:m,minValue:_}=g,b=n-m,[v,L]="vertical"===s?[0,b*(u/d)]:[h-r-b*(h/d),u-i],f=t(o.barLabel,{count:p,maxValue:m,minValue:_});return l("rect",{afterCreate:this._afterBarCreate,"aria-label":f,bind:this,class:c.bar,"data-index":e,fill:this._defaultBarColor,height:i,role:"img","shape-rendering":"crispEdges","stroke-width":"0",width:r,x:v,y:L})}_renderLinesGroup(){return l("g",{class:this.classes(c.dataLines)},this._renderAverageLine(),this._renderCustomLines())}_renderAverageLine(){const{average:e}=this;if(null==e)return;const t=[l("tspan",{class:this.classes(c.averageSymbol)},"x̄ "),l("tspan",{class:this.classes(c.averageLabel)},this.labelFormatFunction?this.labelFormatFunction(e,"average"):e)];return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup)},l("title",{key:"title"},e),this._renderLine(e,this.classes(c.averageDataLine)),this._renderLabel({label:t,value:e}))}_renderCustomLines(){if(this.dataLines?.length)return this.dataLines.map((e,t)=>this._renderLineSubgroup(e,t))}_renderLineSubgroup(e,t){const{value:i}=e;return l("g",{afterCreate:this._afterLinesSubgroupCreate,afterUpdate:this._afterLinesSubgroupUpdate,bind:this,class:this.classes(c.dataLinesSubgroup),"data-index":t},l("title",{key:"title"},i),this._renderLine(i),this._renderLabel(e))}_renderLine(e,t){const[i,r,a,s]=this._getLinePosition(e);return l("line",{class:this.classes(c.dataLine,t),"shape-rendering":"crispEdges",x1:i,x2:r,y1:a,y2:s})}_renderLabel(e,t){const{label:i,value:r}=e,[a,s]=this._getLabelPosition(r),n=2;return l("text",{class:this.classes(c.label,t),"text-anchor":"end",transform:"horizontal"===this.layout?"rotate(270)":null,x:a,y:s-n},i??"")}_renderFillDefinition(e){const{width:t,height:i}=this._containerDimensions;return l("clipPath",{id:e},l("rect",{height:i,width:t,x:"0",y:"0"}))}_afterContainerNodeCreate(e){this._containerNode=e,this.addHandles(d(e,e=>{const{width:t,height:i}=e.contentRect;this._containerDimensions={width:t,height:i}}))}_getIndexFromElement(e){const t=e.dataset?.index,i=e.getAttribute("data-index");return null!=t?parseInt(t,10):null!=i?parseInt(i,10):null}_afterBarCreate(e){if(this.barCreatedFunction){const t=this._getIndexFromElement(e)??-1;this.barCreatedFunction(t,e)}}_afterLinesSubgroupCreate(e){if(this.dataLineCreatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineCreatedFunction(i,r,t)}}_afterLinesSubgroupUpdate(e){if(this.dataLineUpdatedFunction){const t=this._getIndexFromElement(e),i=e.childNodes[1],r=e.childNodes[2]?e.childNodes[2]:null;this.dataLineUpdatedFunction(i,r,t)}}_getBarDimensions(e,t){const{bins:i,layout:r}=this,a=i?i.map(e=>e.count):[],s=Math.max.apply(Math,a);return a.map(i=>"vertical"===r?[e/a.length,0!==s?i/s*t:0]:[0!==s?i/s*e:0,t/a.length])}_getLinePosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0,0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions,[o,l]=[a*s||1,n-a*n||1];return"vertical"===t?[0,"100%",l,l]:[o,o,"100%",0]}_getLabelPosition(e){const{layout:t,min:i,viewModel:{range:r}}=this;if(null==i)return[0,0];const a=Math.round((e-i)/r*100)/100,{width:s,height:n}=this._containerDimensions;return"vertical"===t?[s,n-a*n]:[0,a*s]}};e([i()],g.prototype,"_bgFillId",void 0),e([i()],g.prototype,"_containerNode",void 0),e([i()],g.prototype,"_containerDimensions",void 0),e([i()],g.prototype,"_defaultBarColor",void 0),e([i()],g.prototype,"average",null),e([i()],g.prototype,"barCreatedFunction",void 0),e([i()],g.prototype,"dataLines",void 0),e([i()],g.prototype,"dataLineCreatedFunction",void 0),e([i()],g.prototype,"dataLineUpdatedFunction",void 0),e([i()],g.prototype,"icon",null),e([i()],g.prototype,"label",null),e([i()],g.prototype,"labelFormatFunction",null),e([i({value:"horizontal"})],g.prototype,"layout",null),e([i()],g.prototype,"max",null),e([i(),o("esri/widgets/Histogram/t9n/Histogram")],g.prototype,"messages",void 0),e([i()],g.prototype,"min",null),e([i({readOnly:!0})],g.prototype,"state",null),e([i({type:s})],g.prototype,"viewModel",void 0),g=h=e([r("esri.widgets.Histogram")],g);const p=g;export{p 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 t from"../Color.js";import{watch as i}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{Integer as s}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import o from"./Histogram.js";import n from"./Slider.js";import l from"./Widget.js";import d from"./HistogramRangeSlider/HistogramRangeSliderViewModel.js";import{getDeviationValues as h}from"./smartMapping/support/utils.js";import{globalCss as u}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const g="esri-histogram-range-slider",c={base:g,sliderContainer:`${g}__slider-container`,histogramContainer:`${g}__histogram-container`,rangeTypePrefix:`${g}__range-type--`};let v=class extends l{constructor(e,i){super(e,i),this._barElements=[],this._histogram=null,this._slider=null,this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.excludedBarColor=new t("#d7e5f0"),this.includedBarColor=new t("#599dd4"),this.messages=null,this.standardDeviationCount=1,this.viewModel=new d}initialize(){const{average:e,bins:t,hasTimeData:r,max:s,min:a,viewModel:l}=this;this._updateBarFill=this._updateBarFill.bind(this),this._histogram=new o({average:e,bins:t,barCreatedFunction:(e,t)=>{0===e&&(this._barElements=[]),this._barElements.push(t),this._updateBarFill(e,t),this.barCreatedFunction?.(e,t)},dataLines:this._getDataLines(),dataLineCreatedFunction:(e,t)=>{this.dataLineCreatedFunction?.(e,t)},labelFormatFunction:this.labelFormatFunction,layout:"horizontal",max:s,min:a}),this._slider=new n({labelFormatFunction:this.labelFormatFunction,layout:"horizontal",visibleElements:{labels:!0,rangeLabels:!0},rangeLabelInputsEnabled:!r,viewModel:l}),this.addHandles([this._slider.on("max-change",e=>this.emit("max-change",e)),this._slider.on("min-change",e=>this.emit("min-change",e)),this._slider.on("segment-drag",e=>{this._updateBarFills(),this.emit("segment-drag",e)}),this._slider.on("thumb-change",e=>{this._updateBarFills(),this.emit("thumb-change",e)}),this._slider.on("thumb-drag",e=>{this._updateBarFills(),this.emit("thumb-drag",e)}),i(()=>this.bins,e=>{if(e&&this._histogram.bins){const t=this._histogram.bins.length-e.length;this._barElements.splice(-t,t)}else this._barElements=[];this._histogram.set({bins:e}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.max,this.min,this.rangeType,this.values],([e,t])=>{this._histogram.set({max:e,min:t}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.average,this.dataLines,this.standardDeviation,this.standardDeviationCount],([e])=>{this._histogram.set({average:e,dataLines:this._getDataLines()})}),i(()=>this.labelFormatFunction,e=>{this._histogram.set({labelFormatFunction:e})}),i(()=>this.hasTimeData,e=>{this._slider.set({rangeLabelInputsEnabled:!e})})])}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get hasTimeData(){return this.viewModel.hasTimeData}set hasTimeData(e){this.viewModel.hasTimeData=e}get icon(){return"arrow-double-horizontal"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get precision(){return this.viewModel.precision}set precision(e){this.viewModel.precision=e}get rangeType(){return this.viewModel.rangeType}set rangeType(e){this.viewModel.rangeType=e}get standardDeviation(){return this.viewModel.standardDeviation}set standardDeviation(e){this.viewModel.standardDeviation=e}get values(){return this.viewModel.values}set values(e){this.viewModel.values=e}generateWhereClause(e){return this.viewModel.generateWhereClause(e)}render(){const{rangeType:e,viewModel:t,label:i}=this,r=this.classes(c.base,u.widget,`${c.rangeTypePrefix}${e}`,"disabled"===t.state?u.disabled:null);return p("div",{"aria-label":i,class:r},"disabled"===t.state?null:this._renderContent())}_renderContent(){return[this._renderHistogram(),this._renderSlider()]}_renderSlider(){return p("div",{class:c.sliderContainer,key:`${this.id}-slider-container`},this._slider.render())}_renderHistogram(){return p("div",{class:c.histogramContainer},this._histogram.render())}_getDataLines(){return[...this._getStandardDeviationDataLines(),...this.dataLines||[]]}_getStandardDeviationDataLines(){const{average:e,standardDeviation:t,standardDeviationCount:i}=this;return h(t,e,i).map(e=>({value:e}))}_updateBarFills(){this._barElements.forEach((e,t)=>this._updateBarFill(t,e))}_updateBarFill(e,t){t.setAttribute("fill",this._getFillForBar(e)?.toHex()??"")}_getFillForBar(e){const{bins:t,rangeType:i,values:r}=this;if(-1===e||!t?.length||!i||!r?.length)return null;const s=t[e];if(!s)return null;const{maxValue:a,minValue:o}=s,n=a-o,l=r[0]>o&&r[0]<a;switch(i){case"equal":case"not-equal":return this.includedBarColor;case"less-than":case"at-most":return l?this._getBlendedColor((r[0]-o)/n):a<=r[0]?this.includedBarColor:this.excludedBarColor;case"greater-than":case"at-least":return l?this._getBlendedColor(1-(r[0]-o)/n):o>=r[0]?this.includedBarColor:this.excludedBarColor;case"between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor(1-(r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor((r[1]-o)/n):o>=r[0]&&a<=r[1]?this.includedBarColor:this.excludedBarColor;break;case"not-between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor((r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor(1-(r[1]-o)/n):o>r[0]&&a<r[1]?this.excludedBarColor:this.includedBarColor}return this.includedBarColor}_getBlendedColor(e){return t.blendColors(this.excludedBarColor,this.includedBarColor,e)}};e([r()],v.prototype,"average",null),e([r()],v.prototype,"barCreatedFunction",void 0),e([r()],v.prototype,"bins",null),e([r()],v.prototype,"dataLines",void 0),e([r()],v.prototype,"dataLineCreatedFunction",void 0),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"excludedBarColor",void 0),e([r()],v.prototype,"hasTimeData",null),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"includedBarColor",void 0),e([r()],v.prototype,"icon",null),e([r()],v.prototype,"label",null),e([r()],v.prototype,"labelFormatFunction",null),e([r()],v.prototype,"max",null),e([r(),m("esri/widgets/HistogramRangeSlider/t9n/HistogramRangeSlider")],v.prototype,"messages",void 0),e([r()],v.prototype,"min",null),e([r()],v.prototype,"precision",null),e([r()],v.prototype,"rangeType",null),e([r()],v.prototype,"standardDeviation",null),e([r()],v.prototype,"standardDeviationCount",void 0),e([r()],v.prototype,"values",null),e([r({type:d})],v.prototype,"viewModel",void 0),v=e([a("esri.widgets.HistogramRangeSlider")],v);const b=v;export{b as default};
5
+ import{__decorate as e}from"tslib";import t from"../Color.js";import{watch as i}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{Integer as s}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import o from"./Histogram.js";import n from"./Slider.js";import l from"./Widget.js";import d from"./HistogramRangeSlider/HistogramRangeSliderViewModel.js";import{getDeviationValues as h}from"./smartMapping/support/utils.js";import{globalCss as u}from"./support/globalCss.js";import{messageBundle as m,tsx as p}from"./support/widget.js";const g="esri-histogram-range-slider",c={base:g,sliderContainer:`${g}__slider-container`,histogramContainer:`${g}__histogram-container`,rangeTypePrefix:`${g}__range-type--`};let v=class extends l{constructor(e,i){super(e,i),this._barElements=[],this._histogram=null,this._slider=null,this.barCreatedFunction=null,this.dataLines=null,this.dataLineCreatedFunction=null,this.excludedBarColor=new t("#d7e5f0"),this.includedBarColor=new t("#599dd4"),this.messages=null,this.standardDeviationCount=1,this.viewModel=new d}initialize(){const{average:e,bins:t,hasTimeData:r,max:s,min:a,viewModel:l}=this;this._updateBarFill=this._updateBarFill.bind(this),this._histogram=new o({average:e,bins:t,barCreatedFunction:(e,t)=>{0===e&&(this._barElements=[]),this._barElements.push(t),this._updateBarFill(e,t),this.barCreatedFunction?.(e,t)},dataLines:this._getDataLines(),dataLineCreatedFunction:(e,t)=>{this.dataLineCreatedFunction?.(e,t)},labelFormatFunction:this.labelFormatFunction,layout:"horizontal",max:s,min:a}),this._slider=new n({labelFormatFunction:this.labelFormatFunction,layout:"horizontal",visibleElements:{labels:!0,rangeLabels:!0},rangeLabelInputsEnabled:!r,viewModel:l}),this.addHandles([this._slider.on("max-change",e=>this.emit("max-change",e)),this._slider.on("min-change",e=>this.emit("min-change",e)),this._slider.on("segment-drag",e=>{this._updateBarFills(),this.emit("segment-drag",e)}),this._slider.on("thumb-change",e=>{this._updateBarFills(),this.emit("thumb-change",e)}),this._slider.on("thumb-drag",e=>{this._updateBarFills(),this.emit("thumb-drag",e)}),i(()=>this.bins,e=>{if(e&&this._histogram.bins){const t=this._histogram.bins.length-e.length;this._barElements.splice(-t,t)}else this._barElements=[];this._histogram.set({bins:e}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.max,this.min,this.rangeType,this.values],([e,t])=>{this._histogram.set({max:e,min:t}),this._updateBarFills(),this.scheduleRender()}),i(()=>[this.average,this.dataLines,this.standardDeviation,this.standardDeviationCount],([e])=>{this._histogram.set({average:e,dataLines:this._getDataLines()})}),i(()=>this.labelFormatFunction,e=>{this._histogram.set({labelFormatFunction:e})}),i(()=>this.hasTimeData,e=>{this._slider.set({rangeLabelInputsEnabled:!e})})])}get average(){return this.viewModel.average}set average(e){this.viewModel.average=e}get bins(){return this.viewModel.bins}set bins(e){this.viewModel.bins=e}get hasTimeData(){return this.viewModel.hasTimeData}set hasTimeData(e){this.viewModel.hasTimeData=e}get icon(){return"arrow-double-horizontal"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get precision(){return this.viewModel.precision}set precision(e){this.viewModel.precision=e}get rangeType(){return this.viewModel.rangeType}set rangeType(e){this.viewModel.rangeType=e}get standardDeviation(){return this.viewModel.standardDeviation}set standardDeviation(e){this.viewModel.standardDeviation=e}get values(){return this.viewModel.values}set values(e){this.viewModel.values=e}generateWhereClause(e){return this.viewModel.generateWhereClause(e)}render(){const{rangeType:e,viewModel:t,label:i}=this,r=this.classes(c.base,u.widget,`${c.rangeTypePrefix}${e}`,"disabled"===t.state?u.disabled:null);return p("div",{"aria-label":i,class:r},"disabled"===t.state?null:this._renderContent())}_renderContent(){return[this._renderHistogram(),this._renderSlider()]}_renderSlider(){return p("div",{class:c.sliderContainer,key:`${this.id}-slider-container`},this._slider.render())}_renderHistogram(){return p("div",{class:c.histogramContainer},this._histogram.render())}_getDataLines(){return[...this._getStandardDeviationDataLines(),...this.dataLines||[]]}_getStandardDeviationDataLines(){const{average:e,standardDeviation:t,standardDeviationCount:i}=this;return h(t,e,i).map(e=>({value:e}))}_updateBarFills(){this._barElements.forEach((e,t)=>this._updateBarFill(t,e))}_updateBarFill(e,t){t.setAttribute("fill",this._getFillForBar(e)?.toHex()??"")}_getFillForBar(e){const{bins:t,rangeType:i,values:r}=this;if(-1===e||!t?.length||!i||!r?.length)return null;const s=t[e];if(!s)return null;const{maxValue:a,minValue:o}=s,n=a-o,l=r[0]>o&&r[0]<a;switch(i){case"equal":case"not-equal":return this.includedBarColor;case"less-than":case"at-most":return l?this._getBlendedColor((r[0]-o)/n):a<=r[0]?this.includedBarColor:this.excludedBarColor;case"greater-than":case"at-least":return l?this._getBlendedColor(1-(r[0]-o)/n):o>=r[0]?this.includedBarColor:this.excludedBarColor;case"between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor(1-(r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor((r[1]-o)/n):o>=r[0]&&a<=r[1]?this.includedBarColor:this.excludedBarColor;break;case"not-between":if(2===r.length)return r[0]>o&&r[0]<a?this._getBlendedColor((r[0]-o)/n):r[1]>o&&r[1]<a?this._getBlendedColor(1-(r[1]-o)/n):o>r[0]&&a<r[1]?this.excludedBarColor:this.includedBarColor}return this.includedBarColor}_getBlendedColor(e){return t.blendColors(this.excludedBarColor,this.includedBarColor,e)}};e([r()],v.prototype,"average",null),e([r()],v.prototype,"barCreatedFunction",void 0),e([r()],v.prototype,"bins",null),e([r()],v.prototype,"dataLines",void 0),e([r()],v.prototype,"dataLineCreatedFunction",void 0),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"excludedBarColor",void 0),e([r()],v.prototype,"hasTimeData",null),e([r({type:t,json:{type:[s],write:!0}})],v.prototype,"includedBarColor",void 0),e([r()],v.prototype,"icon",null),e([r()],v.prototype,"label",null),e([r()],v.prototype,"labelFormatFunction",null),e([r()],v.prototype,"max",null),e([r(),m("esri/widgets/HistogramRangeSlider/t9n/HistogramRangeSlider")],v.prototype,"messages",void 0),e([r()],v.prototype,"min",null),e([r()],v.prototype,"precision",null),e([r()],v.prototype,"rangeType",null),e([r()],v.prototype,"standardDeviation",null),e([r()],v.prototype,"standardDeviationCount",void 0),e([r()],v.prototype,"values",null),e([r({type:d})],v.prototype,"viewModel",void 0),v=e([a("esri.widgets.HistogramRangeSlider")],v);const b=v;export{b as default};
package/widgets/Home.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 o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s}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 l from"./Widget.js";import n from"./Home/HomeViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{vmEvent as a}from"./support/decorators/vmEvent.js";import{tsx as d}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const g={base:"esri-home"};let v=class extends l{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.uiStrings=void 0,this.viewModel=new n,this._go=()=>{const{viewModel:e}=this;"going-home"===e.state?e.cancelGo():e.go()},t(i.getLogger(this),"Home","arcgis-home",{version:"4.32"})}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"home"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewpoint(){return this.viewModel.viewpoint}set viewpoint(e){this.viewModel.viewpoint=e}cancelGo(){this.viewModel.cancelGo()}go(){return this.viewModel.go()}render(){const{messagesCommon:e,messages:o,icon:t}=this,i=this.viewModel?.state,s="going-home"===i;return d("div",{class:this.classes(g.base,m.widget)},d("calcite-button",{class:m.widgetButton,disabled:"disabled"===i,iconStart:s?void 0:t,kind:"neutral",label:o.widgetLabel,onclick:this._go,scale:s?"s":"m",title:"going-home"===i?e.cancel:o.title},s?d("calcite-loader",{inline:!0,label:""}):null))}};e([s()],v.prototype,"goToOverride",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),c("esri/widgets/Home/t9n/Home")],v.prototype,"messages",void 0),e([s(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"view",null),e([s({type:n}),a("go")],v.prototype,"viewModel",void 0),e([s({type:o})],v.prototype,"viewpoint",null),v=e([r("esri.widgets.Home")],v);const u=v;export{u as default};
5
+ import{__decorate as e}from"tslib";import o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s}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 l from"./Widget.js";import n from"./Home/HomeViewModel.js";import{loadCalciteComponents as m}from"./support/componentsUtils.js";import{globalCss as p}from"./support/globalCss.js";import{messageBundle as c,vmEvent as a,tsx as d}from"./support/widget.js";const g={base:"esri-home"};let v=class extends l{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.uiStrings=void 0,this.viewModel=new n,this._go=()=>{const{viewModel:e}=this;"going-home"===e.state?e.cancelGo():e.go()},t(i.getLogger(this),"Home","arcgis-home",{version:"4.32"})}loadDependencies(){return m({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"home"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewpoint(){return this.viewModel.viewpoint}set viewpoint(e){this.viewModel.viewpoint=e}cancelGo(){this.viewModel.cancelGo()}go(){return this.viewModel.go()}render(){const{messagesCommon:e,messages:o,icon:t}=this,i=this.viewModel?.state,s="going-home"===i;return d("div",{class:this.classes(g.base,p.widget)},d("calcite-button",{class:p.widgetButton,disabled:"disabled"===i,iconStart:s?void 0:t,kind:"neutral",label:o.widgetLabel,onclick:this._go,scale:s?"s":"m",title:"going-home"===i?e.cancel:o.title},s?d("calcite-loader",{inline:!0,label:""}):null))}};e([s()],v.prototype,"goToOverride",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),c("esri/widgets/Home/t9n/Home")],v.prototype,"messages",void 0),e([s(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"view",null),e([s({type:n}),a("go")],v.prototype,"viewModel",void 0),e([s({type:o})],v.prototype,"viewpoint",null),v=e([r("esri.widgets.Home")],v);const u=v;export{u 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{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as n,isCatalogSublayer as o}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as s,getActionStyles as a}from"../../support/actions/actionUtils.js";import l from"../Widget.js";import{getStatusIcon as r,getVisibilityIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g}from"./support/layerListUtils.js";import{loadCalciteComponents as y}from"../support/componentsUtils.js";import{tsx as h}from"../support/jsxFactory.js";import{setFocus as b}from"../support/widgetUtils.js";import"@arcgis/toolkit/dom";import{substitute as v}from"../../intl/substitute.js";var _;let I=class extends l{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return y({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return h("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return h("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:r({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:o}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=o&&"persistenceEnabled"in o&&(n(o)||!o.persistenceEnabled);return(s||a)&&l?h("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:t,parent:i,messages:n,visibilityAppearance:o,css:s}=this;if(!("visible"in t&&"layerVisibility"in n&&"showLayer"in n&&"hideLayer"in n&&"visibleToggle"in s&&o))return null;const{visible:a}=t,l=this._getParentVisibilityMode(i);if("inherited"===l)return null;const r=c({visible:a,exclusive:"exclusive"===l,visibilityAppearance:o}),d="checkbox"===o,p=n.layerVisibility,m=v(a?n.hideLayer:n.showLayer,{layerName:e});return h("calcite-action",{appearance:"transparent",class:s.visibleToggle,icon:d?r:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(t,i),scale:"s",slot:d?"actions-start":"actions-end",text:p,title:m},d?null:h("calcite-icon",{class:this.classes({[s.visibleIcon]:"exclusive"!==l&&a}),icon:r,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:h("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return h("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:s(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return h("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>h("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&o(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&o(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?h("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?h("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r),g="group"===r?.type,y=!u&&!c&&e&&g,b=!!e&&("childrenSortable"in t&&t.childrenSortable&&m(t));return c||y?h("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:b,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,a)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?h("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},h("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),h("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?h("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?h("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},h("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},h("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:a,title:l,type:r,indicator:c}=i;return h("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:a,icon:s(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?h("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return h(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(b(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(g(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([t()],I.prototype,"activeItem",void 0),e([t()],I.prototype,"canMove",void 0),e([t()],I.prototype,"css",void 0),e([t()],I.prototype,"displayMode",void 0),e([t()],I.prototype,"dragEnabled",void 0),e([t()],I.prototype,"dragDisabled",void 0),e([t()],I.prototype,"item",void 0),e([t()],I.prototype,"layerTablesEnabled",void 0),e([t()],I.prototype,"listModeDisabled",void 0),e([t()],I.prototype,"messages",void 0),e([t()],I.prototype,"messagesCommon",void 0),e([t()],I.prototype,"onAction",void 0),e([t()],I.prototype,"onPanelOpen",void 0),e([t()],I.prototype,"onCatalogOpen",void 0),e([t()],I.prototype,"onTablesOpen",void 0),e([t()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([t()],I.prototype,"onTooltipReferenceChange",void 0),e([t()],I.prototype,"parent",void 0),e([t()],I.prototype,"parentTitles",void 0),e([t()],I.prototype,"rootGroupUid",void 0),e([t()],I.prototype,"selectionMode",void 0),e([t()],I.prototype,"selectedItems",void 0),e([t()],I.prototype,"selectedDragItemLayerUid",void 0),e([t()],I.prototype,"visibleElements",void 0),e([t()],I.prototype,"visibilityAppearance",void 0),e([t()],I.prototype,"_title",null),e([t()],I.prototype,"_renderedItemStatus",null),e([t()],I.prototype,"_renderedItemTemporaryIcon",null),e([t()],I.prototype,"_renderedItemToggle",null),e([t()],I.prototype,"_renderedPanel",null),e([t()],I.prototype,"_renderedPanelAction",null),e([t()],I.prototype,"_renderedActions",null),e([t()],I.prototype,"_renderedActionMenu",null),e([t()],I.prototype,"_renderedActionMenuContent",null),e([t()],I.prototype,"_renderedCatalogFootprintIcon",null),e([t()],I.prototype,"_renderedCatalogDynamicIcon",null),e([t()],I.prototype,"_renderedCatalogSelectNode",null),e([t()],I.prototype,"_renderedChildList",null),e([t()],I.prototype,"_hasTables",null),e([t()],I.prototype,"_renderedTablesItem",null),e([t()],I.prototype,"_renderedItemMessage",null),e([t()],I.prototype,"_singleAction",null),e([t()],I.prototype,"_filteredSections",null),e([t()],I.prototype,"_actionsCount",null),I=_=e([i("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.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 n}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerFromCatalog as o,isCatalogSublayer as s}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as a,getActionStyles as l}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{getStatusIcon as c,getVisibilityIcon as d,listItemHasChildren as p,areChildrenHidden as m,canSortSublayers as u,getSingleAction as g,getItem as y}from"./support/layerListUtils.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{tsx as b}from"../support/widget.js";import{setFocus as v}from"../support/widgetUtils.js";var _;let I=class extends r{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return h({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:a,parent:l,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in a&&!i.visibleAtCurrentTimeExtent?`${t} (${a.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in a&&!i.visibleAtCurrentScale?`${t} (${a.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return b("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,l),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,a="connectionStatus"in e?e.connectionStatus:void 0,l=!!a;return b("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:l},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:l&&"connected"===a}),icon:c({connectionStatus:a,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:n}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,a="temporaryTableIndicators"in t&&t.temporaryTableIndicators,l=n&&"persistenceEnabled"in n&&(o(n)||!n.persistenceEnabled);return(s||a)&&l?b("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:i,parent:n,messages:o,visibilityAppearance:s,css:a}=this;if(!("visible"in i&&"layerVisibility"in o&&"showLayer"in o&&"hideLayer"in o&&"visibleToggle"in a&&s))return null;const{visible:l}=i,r=this._getParentVisibilityMode(n);if("inherited"===r)return null;const c=d({visible:l,exclusive:"exclusive"===r,visibilityAppearance:s}),p="checkbox"===s,m=o.layerVisibility,u=t(l?o.hideLayer:o.showLayer,{layerName:e});return b("calcite-action",{appearance:"transparent",class:a.visibleToggle,icon:p?c:void 0,key:"visibility-toggle",label:u,onclick:()=>this._toggleVisibility(i,n),scale:"s",slot:p?"actions-start":"actions-end",text:m,title:u},p?null:b("calcite-icon",{class:this.classes({[a.visibleIcon]:"exclusive"!==r&&l}),icon:c,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:b("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return b("calcite-action",{active:t,appearance:"transparent",disabled:n,icon:a(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),scale:"s",slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return b("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},b("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>b("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&s(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&s(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?b("calcite-action",{appearance:"transparent",disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),scale:"s",slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const a=[...this.parentTitles??[],t.title],{children:l,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&p(t),d=!n&&m(r),g="group"===r?.type,y=!d&&!c&&e&&g,h=!!e&&("childrenSortable"in t&&t.childrenSortable&&u(t));return c||y?b("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:h,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},l?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,a)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?b("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},b("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?b("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},b("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},b("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?b("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},b("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},b("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:g(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:s,title:l,type:r,indicator:c}=i;return b("calcite-action",{active:"toggle"===r&&i.value,appearance:"transparent","data-action-id":i.id,disabled:s,icon:a(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),scale:"s",slot:n?void 0:"actions-end",text:l??"",textEnabled:n,title:l??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?b("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:l(o)}):null}_renderItem(e,t,i=[]){return b(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(v(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(y(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([i()],I.prototype,"activeItem",void 0),e([i()],I.prototype,"canMove",void 0),e([i()],I.prototype,"css",void 0),e([i()],I.prototype,"displayMode",void 0),e([i()],I.prototype,"dragEnabled",void 0),e([i()],I.prototype,"dragDisabled",void 0),e([i()],I.prototype,"item",void 0),e([i()],I.prototype,"layerTablesEnabled",void 0),e([i()],I.prototype,"listModeDisabled",void 0),e([i()],I.prototype,"messages",void 0),e([i()],I.prototype,"messagesCommon",void 0),e([i()],I.prototype,"onAction",void 0),e([i()],I.prototype,"onPanelOpen",void 0),e([i()],I.prototype,"onCatalogOpen",void 0),e([i()],I.prototype,"onTablesOpen",void 0),e([i()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([i()],I.prototype,"onTooltipReferenceChange",void 0),e([i()],I.prototype,"parent",void 0),e([i()],I.prototype,"parentTitles",void 0),e([i()],I.prototype,"rootGroupUid",void 0),e([i()],I.prototype,"selectionMode",void 0),e([i()],I.prototype,"selectedItems",void 0),e([i()],I.prototype,"selectedDragItemLayerUid",void 0),e([i()],I.prototype,"visibleElements",void 0),e([i()],I.prototype,"visibilityAppearance",void 0),e([i()],I.prototype,"_title",null),e([i()],I.prototype,"_renderedItemStatus",null),e([i()],I.prototype,"_renderedItemTemporaryIcon",null),e([i()],I.prototype,"_renderedItemToggle",null),e([i()],I.prototype,"_renderedPanel",null),e([i()],I.prototype,"_renderedPanelAction",null),e([i()],I.prototype,"_renderedActions",null),e([i()],I.prototype,"_renderedActionMenu",null),e([i()],I.prototype,"_renderedActionMenuContent",null),e([i()],I.prototype,"_renderedCatalogFootprintIcon",null),e([i()],I.prototype,"_renderedCatalogDynamicIcon",null),e([i()],I.prototype,"_renderedCatalogSelectNode",null),e([i()],I.prototype,"_renderedChildList",null),e([i()],I.prototype,"_hasTables",null),e([i()],I.prototype,"_renderedTablesItem",null),e([i()],I.prototype,"_renderedItemMessage",null),e([i()],I.prototype,"_singleAction",null),e([i()],I.prototype,"_filteredSections",null),e([i()],I.prototype,"_actionsCount",null),I=_=e([n("esri.widgets.LayerList.LayerListItem")],I);const C=I;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{IdentifiableMixin as t}from"../../core/Identifiable.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as i,initial as r}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 o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Widget.js";import{isSublayer as d}from"./support/layerListUtils.js";import{isWidget as a}from"../support/widget.js";import{tsx as p}from"../support/jsxFactory.js";let g=class extends(t(l)){constructor(e,t){super(e,t),this._legend=null,this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}initialize(){this.addHandles([i(()=>this._canCreateLegend,()=>this._createLegend(),r),i(()=>[this._legend,this._legendOptions],()=>this._updateLegend(),r)])}destroy(){this._legend=n(this._legend)}get _canCreateLegend(){const{content:e,listItem:t}=this;if(!t)return!1;const n="legend";return e===n||null!=e&&!!Array.isArray(e)&&e.includes(n)}get _legendOptions(){const{listItem:e,_legendLayerInfo:t}=this,n=e?.view;return t&&n?{view:n,layerInfos:[t]}:{}}get _legendLayerInfo(){const e=this.listItem?.layer;if(!e||"subtype-sublayer"===e.type)return null;const t=d(e)?e:null,n=e?.parent,i=null!=n&&"type"in n&&"map-image"===n.type?t?.source:null,r="";return i&&n?{layer:n,title:r,sublayerIds:[i.mapLayerId]}:{layer:e,title:r}}get disabled(){const{listItem:e,_legend:t,content:n}=this;return!e||!(Array.isArray(n)&&n.length>1)&&(!!t&&(!t.activeLayerInfos?.length||!e.visibleAtCurrentScale||!e.visible))}set disabled(e){this._overrideIfSome("disabled",e)}get icon(){const{image:e}=this,t=this._getFirstWidget();return this._get("icon")??(!e&&t?t.icon:null)}set icon(e){this._overrideIfSome("icon",e)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(e){this._override("title",e)}render(){return p("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(e){const{_legend:t,disabled:n,open:i}=this;return e&&!n&&i?"legend"===e&&t?p("div",{key:"legend-widget"},t.render()):"string"==typeof e?p("div",{innerHTML:e,key:e}):a(e)?p("div",{key:"content-widget"},e.render()):e instanceof HTMLElement?p("div",{afterCreate:this._attachToNode,bind:e,key:"content-element"}):null:null}_renderContents(){const{content:e,open:t}=this;return t?Array.isArray(e)?e.map(e=>this._renderContent(e)):this._renderContent(e):null}async _createLegend(){if(n(this._legend),this._legend=null,!this._canCreateLegend)return;const{default:e}=await import("../Legend.js"),t=new e(this._legendOptions);this._legend=t}_attachToNode(e){e.appendChild(this)}_updateLegend(){const e=this._legend;e&&e.set(this._legendOptions)}_getWidget(e){return"legend"===e?this._legend:a(e)?e:null}_getFirstWidget(){const{content:e}=this;return Array.isArray(e)?e.map(e=>this._getWidget(e)).find(e=>e):this._getWidget(e)}};e([s()],g.prototype,"_legend",void 0),e([s()],g.prototype,"_canCreateLegend",null),e([s()],g.prototype,"_legendOptions",null),e([s()],g.prototype,"_legendLayerInfo",null),e([s()],g.prototype,"content",void 0),e([s()],g.prototype,"disabled",null),e([s()],g.prototype,"flowEnabled",void 0),e([s()],g.prototype,"icon",null),e([s()],g.prototype,"image",void 0),e([s()],g.prototype,"listItem",void 0),e([s()],g.prototype,"open",void 0),e([s()],g.prototype,"title",null),e([s()],g.prototype,"visible",void 0),g=e([o("esri.widgets.LayerList.ListItemPanel")],g);const c=g;export{c as default};
5
+ import{__decorate as e}from"tslib";import{IdentifiableMixin as t}from"../../core/Identifiable.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as i,initial as r}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 o}from"../../core/accessorSupport/decorators/subclass.js";import l from"../Widget.js";import{isSublayer as d}from"./support/layerListUtils.js";import{tsx as a,isWidget as p}from"../support/widget.js";let g=class extends(t(l)){constructor(e,t){super(e,t),this._legend=null,this.content=null,this.flowEnabled=!1,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}initialize(){this.addHandles([i(()=>this._canCreateLegend,()=>this._createLegend(),r),i(()=>[this._legend,this._legendOptions],()=>this._updateLegend(),r)])}destroy(){this._legend=n(this._legend)}get _canCreateLegend(){const{content:e,listItem:t}=this;if(!t)return!1;const n="legend";return e===n||null!=e&&!!Array.isArray(e)&&e.includes(n)}get _legendOptions(){const{listItem:e,_legendLayerInfo:t}=this,n=e?.view;return t&&n?{view:n,layerInfos:[t]}:{}}get _legendLayerInfo(){const e=this.listItem?.layer;if(!e||"subtype-sublayer"===e.type)return null;const t=d(e)?e:null,n=e?.parent,i=null!=n&&"type"in n&&"map-image"===n.type?t?.source:null,r="";return i&&n?{layer:n,title:r,sublayerIds:[i.mapLayerId]}:{layer:e,title:r}}get disabled(){const{listItem:e,_legend:t,content:n}=this;return!e||!(Array.isArray(n)&&n.length>1)&&(!!t&&(!t.activeLayerInfos?.length||!e.visibleAtCurrentScale||!e.visible))}set disabled(e){this._overrideIfSome("disabled",e)}get icon(){const{image:e}=this,t=this._getFirstWidget();return this._get("icon")??(!e&&t?t.icon:null)}set icon(e){this._overrideIfSome("icon",e)}get title(){return this._get("title")||(this._getFirstWidget()?.label??"")}set title(e){this._override("title",e)}render(){return a("div",{class:"esri-list-item-panel"},this._renderContents())}_renderContent(e){const{_legend:t,disabled:n,open:i}=this;return e&&!n&&i?"legend"===e&&t?a("div",{key:"legend-widget"},t.render()):"string"==typeof e?a("div",{innerHTML:e,key:e}):p(e)?a("div",{key:"content-widget"},e.render()):e instanceof HTMLElement?a("div",{afterCreate:this._attachToNode,bind:e,key:"content-element"}):null:null}_renderContents(){const{content:e,open:t}=this;return t?Array.isArray(e)?e.map(e=>this._renderContent(e)):this._renderContent(e):null}async _createLegend(){if(n(this._legend),this._legend=null,!this._canCreateLegend)return;const{default:e}=await import("../Legend.js"),t=new e(this._legendOptions);this._legend=t}_attachToNode(e){e.appendChild(this)}_updateLegend(){const e=this._legend;e&&e.set(this._legendOptions)}_getWidget(e){return"legend"===e?this._legend:p(e)?e:null}_getFirstWidget(){const{content:e}=this;return Array.isArray(e)?e.map(e=>this._getWidget(e)).find(e=>e):this._getWidget(e)}};e([s()],g.prototype,"_legend",void 0),e([s()],g.prototype,"_canCreateLegend",null),e([s()],g.prototype,"_legendOptions",null),e([s()],g.prototype,"_legendLayerInfo",null),e([s()],g.prototype,"content",void 0),e([s()],g.prototype,"disabled",null),e([s()],g.prototype,"flowEnabled",void 0),e([s()],g.prototype,"icon",null),e([s()],g.prototype,"image",void 0),e([s()],g.prototype,"listItem",void 0),e([s()],g.prototype,"open",void 0),e([s()],g.prototype,"title",null),e([s()],g.prototype,"visible",void 0),g=e([o("esri.widgets.LayerList.ListItemPanel")],g);const c=g;export{c as default};